Skip to content

Latest commit

 

History

History
70 lines (44 loc) · 1.96 KB

README.md

File metadata and controls

70 lines (44 loc) · 1.96 KB

Staking DAPP Using dAPIs

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.

MIT License

Installation

  • Install dependencies
yarn
  • Enter credentials
cp credentials.example.json credentials.json

# ..and populate credentials.json with your mnemonic

Deploy the Contracts and set dAPIs

  • 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.

Using the dAPP

  • Import the DappToken contract address in your account's Metamask and send all the DAPP to the Staking Contract. The Staking contract will control all the DAPP Tokens

  • Also import the Wrapped ETH contract address in your account's Metamask. WETH will be used to stake and earn DAPP Tokens. Don't send this directly to the staking contract.

Staking WETH

  • To stake WETH
yarn stake
  • To issue and send DAPP rewards back to the Staker
yarn issue

Unstaking WETH

  • To unstake and get back your WETH
yarn unstake
  • As any user can stake/unstake WETH, you can try running yarn stake and yarn unstake with 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 stake command.