RiverBox - NFT Protocol
Sample Scripts
Install dependencies
yarn
Compile contracts
yarn run hardhat compile
Build doc
yarn run hardhat docgen
Run lint
yarn run lint
yarn run lint:fix
Run format
yarn run format
yarn run format:fix
Generate types for SDK
yarn run hardhat typechain
Hardhat start local test node
yarn run hardhat node --network hardhat --no-deploy --show-accounts
yarn run env-cmd -f envs/.env.exampleA yarn run hardhat node --network hardhat --no-deploy --show-accounts
Hardhat run tests on local node
yarn run hardhat test --network localhost
yarn run env-cmd -f envs/.env.exampleA yarn run hardhat test --network localhost
Hardhat run scripts on local node
yarn run hardhat run scripts/sample-script.ts --network localhost
yarn run env-cmd -f envs/.env.exampleA yarn run hardhat run scripts/sample-script.ts --network localhost
Hardhat run deploy
yarn run hardhat deploy --network localhost
yarn run env-cmd -f envs/.env.exampleA yarn run hardhat deploy --network localhost --reset
RiverBox Dev (Only focus upgradeable version)
Hardhat test
FUSION_TABLE=./config/assets/6.17-fusion-table.csv yarn run hardhat test --network hardhat test/upgradeable/*.ts
Hardhat solidity-coverage
yarn run hardhat coverage --testfiles test/upgradeable --network hardhat
Admin SOP
Fresh deployment
localhost
Deploy
deploy proxy contracts (start a local hardhat
network first ref)
LOAD_TASK=True yarn run hardhat riverbox:upgradeable:init:deploy --network localhost | tee -a ./logs/deployToLocal.log
setHierarchy(Use existing deployment information)
LOAD_TASK=True yarn run hardhat riverbox:setHierarchy --input ./config/assets/6.19-fusion-table.csv --batch-size 50 --stock-sub-sample 10 --network localhost | tee -a ./logs/setHierarchyLocal.log
setHierarchy(Override address or implementation name)
export RIVERBOX_ADDRESS={}
export RIVERBOX_IMPL={}
LOAD_TASK=True yarn run hardhat riverbox:setHierarchy --input ./config/assets/6.19-fusion-table.csv --batch-size 50 --river-box-address $RIVERBOX_ADDRESS --river-box-impl $RIVERBOX_IMPL --stock-sub-sample 10 --network localhost | tee -a ./logs/setHierarchyLocal.log
Upgrade RiverBox Implementation. (Replace --new-impl-name with the name of new implementation contract name)
LOAD_TASK=True yarn run hardhat riverbox:proxy:upgradeImpl --new-impl-name RiverBoxImpl --network localhost | tee -a ./logs/upgradeRiverBoxLocal.log
Upgrade RiverBoxEx Implementation. (Replace --new-impl-name with the name of new implementation contract name)
LOAD_TASK=True yarn run hardhat riverboxEx:proxy:upgradeImpl --new-impl-name RiverBoxExchangeImpl --network localhost | tee -a ./logs/upgradeRiverBoxExLocal.log
bscTest
Deploy
deploy proxy contracts
LOAD_TASK=True yarn run env-cmd -f ./envs/.env.eth.bsc-test yarn run hardhat riverbox:upgradeable:init:deploy --network bscTest | tee -a ./logs/deployToBscTest.log
setHierarchy(Use existing deployment information)
LOAD_TASK=True yarn run env-cmd -f ./envs/.env.eth.bsc-test yarn run hardhat riverbox:setHierarchy --input ./config/assets/6.19-fusion-table.csv --batch-size 50 --stock-sub-sample 10 --network bscTest | tee -a ./logs/setHierarchyBscTest.log
setHierarchy(Override address or implementation name)
export RIVERBOX_ADDRESS={}
export RIVERBOX_IMPL={}
LOAD_TASK=True yarn run env-cmd -f ./envs/.env.eth.bsc-test yarn run hardhat riverbox:setHierarchy --input ./config/assets/6.1-fusion-table.csv --batch-size 50 --river-box-address $RIVERBOX_ADDRESS --river-box-impl $RIVERBOX_IMPL --network bscTest | tee -a ./logs/setHierarchyBscTest.log
Upgrade RiverBox Implementation. (Replace --new-impl-name with the name of new implementation contract name)
LOAD_TASK=True yarn run env-cmd -f ./envs/.env.eth.bsc-test yarn run hardhat riverbox:proxy:upgradeImpl --new-impl-name RiverBoxImpl --network bscTest | tee -a ./logs/upgradeRiverBoxBscTest.log
Upgrade RiverBoxEx Implementation. (Replace --new-impl-name with the name of new implementation contract name)
LOAD_TASK=True yarn run env-cmd -f ./envs/.env.eth.bsc-test yarn run hardhat riverboxEx:proxy:upgradeImpl --new-impl-name RiverBoxExchangeImpl --network bscTest | tee -a ./logs/upgradeRiverBoxExBscTest.log
Generic Interact
# check supply
LOAD_TASK=True yarn run env-cmd -f ./envs/.env.eth.bsc-test yarn run hardhat riverbox:interact --function-name totalSupply --args \[\] --network bscTest
# withdraw
LOAD_TASK=True yarn run env-cmd -f ./envs/.env.eth.bsc-test yarn run hardhat riverbox:interact --function-name withdraw --args \[\"0xEd558c75937611cD07dEC3dB75B557462bbe8EF7\",\"1150000000000000000\"\] --network bscTest
# check paused
LOAD_TASK=True yarn run env-cmd -f ./envs/.env.eth.bsc-test yarn run hardhat riverbox:interact --function-name paused --args \[\] --network bscTest