masaun / forceDAO-yield-farming-strategy-on-polygon

This is a smart contract that deal with a yield farming strategy which is using AAVE and Polycat.finance on Polygon.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ForceDAO Yield Farming Strategy on Polygon

【Introduction of the ForceDAO Yield Farming Strategy on Polygon】

  • This is a smart contract that deal with a yield farming strategy which use AAVE and Polycat.finance on Polygon.
    • A user create a new Yield Farming Strategy contract via the Yield Farming Strategy Factory contract.
    • A user can earn double rewards from the AAVE Market and Polycat.finance . (In terms of the Polycat, this smart contract assume that use the single staking pool of the Polycat.finance in order to earn rewards. By the way, rewards token on Polycat.finance is the Fish Token : https://polycat.finance/pools )

 


【Workflow】

  • Diagram of workflow: diagram_ForceDAO

 


【Remarks】

  • Versions
    • Solidity (Solc): v0.6.12
    • Truffle: v5.1.60
    • web3.js: v1.2.9
    • openzeppelin-solidity: v3.4.1
    • ganache-cli: v6.9.1 (ganache-core: 2.10.2)

 


【Setup】

① Install modules

  • Install npm modules in the root directory
npm install

② Compile & migrate contracts (on local)

npm run migrate:local

【Script for the DEMO of workflow】



  • 4: In advance, Please check MATIC token balance of executor's (user's) wallet address .


  • 6: Execute a script
npm run script:YieldFarmingStrategy

【Demo Video】


【Unit test (on local)】

  • 1: Start ganache-cli
$ ganache-cli -d --fork https://polygon-mainnet.infura.io/v3/{YOUR INFURA KEY}@{BLOCK_NUMBER}

(※ -d option is the option in order to be able to use same address on Ganache-CLI every time)
(※ Please stop and re-start if an error of "Returned error: project ID does not have access to archive state" is displayed)


  • 2: Execute test of the smart-contracts
npm run test:YieldFarmingStrategy

( truffle test ./test/test-local/YieldFarmingStrategy.test.js --network local )


npm run test:MasterChef

( truffle test ./test/test-local/polycat/MasterChef.test.js --network local )



【References】





About

This is a smart contract that deal with a yield farming strategy which is using AAVE and Polycat.finance on Polygon.


Languages

Language:Solidity 85.9%Language:JavaScript 14.1%Language:Shell 0.0%