- Make sure to use node 12.12.0
- Run
npm install
in project root directory - Create
.env
file:
PRIVATE_KEY="{YOUR_PRIVATE_KEY}"
CONTRACT_OWNER="{CONTRACT_OWNER}"
FEE_LIMIT="{FEE_LIMIT}"
USER_FEE_PERCENTAGE="{USER_FEE_PERCENTAGE}"
PROXY_ADDRESS="{PROXY_ADDRESS}"
CONTRACT_VERSION_1_ADDRESS="{CONTRACT_VERSION_1_ADDRESS}"
CONTRACT_VERSION_2_ADDRESS="{CONTRACT_VERSION_2_ADDRESS}"
- Run
npm run rebuild
in project root directory
As a testnet network we can use Shasta. Shasta's test coins can be obtained https://www.trongrid.io/shasta/#request. Transactions for testnet can be found on https://shasta.tronscan.org/#/. For test deploying:
- Run
npx hardhat run --network testnet ./scripts/1_deploy_proxy.ts
to deploy test proxy. - Run
npx hardhat run --network testnet ./scripts/2_deploy_contract.ts
to deploy test contract. - Run
npx hardhat run --network testnet ./scripts/3_set_initial_proxy_state.ts
to set initial proxy state. - Run
npx hardhat run --network testnet ./scripts/4_mint_tokens.ts
to mint test tokens. - Run
npx hardhat run --network testnet ./scripts/5_deploy_new_contract.ts
to deploy test contract V2. - Run
npx hardhat run --network testnet ./scripts/6_upgrade_contract.ts
to upgrade proxy contract. - Run
npx hardhat run --network testnet ./scripts/7_burn_tokens.ts
to burn test tokens.
After EACH script on https://shasta.tronscan.org/ check that transaction was confirmed.