dAPP to stake Mock Wrapped ETH or any ERC20 token to earn DAPP Tokens of the same equivalent staked value in USD using API3's dAPIs on Polygon Mumbai Testnet.
- Install dependencies
yarn- Enter credentials
cp credentials.example.json credentials.json
# ..and populate credentials.json with your mnemonic- Compile the contracts
yarn compile- To deploy and set all the dAPI and Contract addresses
yarn deploy- Head on to API3 Market and get access to the dAPIs so that the dAPP can access them. They are free to use on Mumbai Testnet. Just head on to it, enter your Staking contract's address, click on request access and approve the transactions.
- For
ETH/USDon Polygon Mumbai - ETH/USD dAPI - For
USDC/USDon Polygon Mumbai - USDC/USD dAPI
- For
-
Import the
DappTokencontract address in your account's Metamask and send all theDAPPto the Staking Contract. The Staking contract will control all theDAPPTokens -
Also import the
Wrapped ETHcontract address in your account's Metamask.WETHwill be used to stake and earnDAPPTokens. Don't send this directly to the staking contract.
- To stake
WETH
yarn stake- To issue and send
DAPPrewards back to the Staker
yarn issue- To unstake and get back your WETH
yarn unstake-
As any user can stake/unstake WETH, you can try running
yarn stakeandyarn unstakewith a different mnemonic with enough gas to make the trasnactions. -
Only the owner (the address that deployed the contract) can issue the rewards - run
yarn stakecommand.