pnpm i
Create .env
file by referencing .env.sample
.
Installing foundry:
curl -L https://foundry.paradigm.xyz | bash
foundryup
-
Compile contracts and create their Typescript bindings.
pnpm compile
-
Run tests
pnpm test
-
Deploy to local hardhat node
pnpm deploy:default
Note: If you want to force deploy again, add--reset
flag -
Deploy to Goerli
pnpm deploy:goerli
Notes:
i. To only run a single deploy file run: pnpm deploy:goerli --tags <tag>
Tags are defined in the deploy script at the end like: func.tags = ["<tag>"]
ii. By default deploy uses Legacy transactions which is not ideal. So specify the EIP-1559 gas params when calling like this:
pnpm deploy:mainnet --tags <tag> --maxfee <inWei> --priorityfee <inWei>
iii. If need to deploy new implementation for a proxy which doesn't exist in the deployments folder:
- Create
ContractName.json
withaddress
- Create
ContractName_Proxy.json
withaddress
&transactionHash
- Make sure
MultiProxyController.json
exists withabi
andtransactionHash
ContractName_Implementation.json
would then get deployed via script, but it'll fail to upgrade the proxy asMultiProxyController
is owned by multisig (so do that manually).
-
Verify deployed contracts on Etherscan
pnpm verify:goerli
Note: If getting "Invalid API Key" error for arbiscan, etc. Execute like this: source .env && pnpm verify:arbitrum --api-key $ARBISCAN_API_KEY
Contracts should be deployed in the following order:
- MultiProxyController
- StakingTokenProvider
- NFTXLPStaking
- NFTXSimpleFeeDistributor
- NFTXVaultFactoryUpgradeable
- NFTXInventoryStaking
- NFTXEligibilityManager
- NFTXStakingZap, NFTXUnstakingInventoryZap, TimelockExcludeList, NFTXMarketplace0xZap, NFTXVaultCreationZap