The yearn.finance Vaults Safe App allows Gnosis Safes to interact with yearn.finance vaults.
Read more about Safe Apps here.
If you are interested in contributing or have any questions, ping me on Twitter.
To start developing on the Yearn Finance Safe app, first clone this repository and enter the new directory.
git clone https://github.com/TomAFrench/yearn-safe-app.git
cd yearn-safe-app
Before getting started you will need to create a .env
file. We have provided .env.example
as a template.
cp .env.example .env
Finally install any dependencies and start the dev server
yarn install
yarn start
The app will then be hosted on http://localhost:3002
. By default the app will expect an injected web3 provider such as metamask; if you want to interact with the app through the Gnosis UI you'll need to set the REACT_APP_LOCAL_WEB3_PROVIDER
environment variable to false
.
In order to allow the Gnosis Safe UI to access the app while it's running on localhost we need to edit the headers on the dev server (node_modules/react-scripts/config/webpackDevServer.config.js
) to avoid CORS issues:
headers: {
"Access-Control-Allow-Origin": "\*",
"Access-Control-Allow-Methods": "GET",
"Access-Control-Allow-Headers": "X-Requested-With, content-type, Authorization"
},
We automate injecting these headers in to the server config through react-app-rewired.