example code for deploy an upgrade smart contract on binance smart chain (testnet)
prepare config
- please update secret (deployer) to .secret file
- update bscscan api key in truffle-config.js
Install dependencies
npm install
deploy smart contract
truffle migrate --network testnet
verify contract
truffle run verify HelloWorld --network testnet
upgrade smart contract version (HelloWorld to HelloWorldV2)
- move file resources/3_upgrade_helloworld_v2.js to migrations/3_upgrade_helloworld_v2.js
and run
truffle migrate --network testnet
verify contract
truffle run verify HelloWorldV2 --network testnet