This repo is for inspiration purposes, this code isn't audited.
-
Basic Solidity Smart Contract for creating your own Yearn Affiliate Wrapper (
contracts/AffiliateToken.sol
) -
Sample test suite that runs on mainnet fork. (
tests/
)
This mix is configured for use with Ganache on a forked mainnet.
-
Install Brownie & Ganache-CLI, if you haven't already.
-
Sign up for Infura and generate an API key. Store it in the
WEB3_INFURA_PROJECT_ID
environment variable.
export WEB3_INFURA_PROJECT_ID=YourProjectID
- Sign up for Etherscan and generate an API key. This is required for fetching source codes of the mainnet contracts we will be interacting with. Store the API key in the
ETHERSCAN_TOKEN
environment variable.
export ETHERSCAN_TOKEN=YourApiToken
- Download the mix.
brownie bake yearn-affiliate
If you are using Ganache to fork a network, then you may have issues with the blockchain archive state every 30 minutes. This is due to your node provider (i.e. Infura) only allowing free users access to 30 minutes of archive state. To solve this, upgrade to a paid plan, or simply restart your ganache instance and redploy your contracts.
- Yearn Discord channel
- Brownie Gitter channel