- For Main net: If you got some error, remember to first
rm -rf artifacts
and thennpx hardhat clean
- Deploy:
- change
API_URL
to the right network you want to deploy to inpackages/hardhat/.env
npx hardhat run --network <network> deploy/deployPermanentPortfolio.js
- change
- (optional): Might need to manually verify if your deploy script fails, especially for vaults not portfolio contract:
npx hardhat verify --network arbitrum 0x47cF63A2C2a60efD53193504c8a9846D38254549 "0x14FbC760eFaF36781cB0eb3Cb255aD976117B9Bd" "Equilibria-RETH" "ALP-EQB-RETH"
npx hardhat verify --network bsc 0x51766aeF369c60e8Af732454b3a10cA068589438
- Update the contract addresses resides in
rebalance
server andfrontend
- Upgrade Portfolio Contract:
- change
API_URL
to the right network you want to deploy to inpackages/hardhat/.env
- Comment out the deployment part of
vault contract
, if you only want to upgradeportfolio contract
(e.g. comment outapolloxBscVault
indeployContracts()
, upgradeProxy.js) - command:
npx hardhat run --network <network> deploy/upgradeProxy.js
- (optional): if you see this error, it means you're verifying the wrong contract. You should only verify the implementation contract since the proxy should remain the same.
message: 'execution reverted: ERC1967: new implementation is not a contract',
- change
- Upgrade Vault Contract: N/A, you need to create a new deploy script for this.
- dpx:
BLOCK_NUMBER=97022421 yarn test test/dpxArbitrumVaultTest.js
- radiant:
- USDT:
BLOCK_NUMBER=86630670 yarn test test/radiantArbitrumVaultTest.js
- wETH:
BLOCK_NUMBER=101043121 yarn test test/radiantArbitrumVaultTest.js
- USDT:
- arbitrum rich impersonate address:
0x2B9AcFd85440B7828DB8E54694Ee07b2B056B30C
add the new vault into:
deposit()
for loopredeem()
for loop- add new vault address in the portfolio's contructor, add its
require
accordingly and add this new vault into thevault[]
- need to add lots of variable in
utils.js
- update need to manually add some tokens into
/debank
route in rebalance backend (for instance, 0xeeeeee for each blockchain can be different token) - need to find the API of that protocol you integrated first, and then calculate its
apr_composition
in/apr_composition
endpoint in rebalance backend - check the result of
apr composition
on frontend side - frontend side:
/addresses
: github
- clean up cache:
rm -rf hardhat/cache
yarn cache clean
rm -rf artifacts