To deploy the USDC contract, first create a config.json file in the deploy/config folder, based on the config.example.json file.
Then, run the following command to generate the typings:
npm run buildThe command above fetches the USDC contracts' source code and compiles them with Truffle, instead of using the existing Hardhat in the project, to avoid the USDC contract bytecode mismatch issue. This is related to the following issue: Hardhat and Truffle with same compiler options compile different bytecode
After that, create a .env file at the root of the project, based on the .env.example file.
Finally, run the following command to deploy the USDC contract on the QTum testnet:
npm run deploy-qtum-testnetAfter each contract deployment, the deployed addresses of the contract are saved in the .migrate.storage.json file.
So, in the case where deployment stops at the third step, for example, just comment out the already completed transactions and run the following command to continue the migration process:
npx hardhat migrate --network qtumTestnet --from 3 --continueIf you run the command above without the
--continueoption, it will remove all previous records from the.migrate.storage.jsonfile.
- Typings are generated based on the artifacts that are created after the Truffle compilation process of the
stablecoin-evmcontracts. - qtum-ethers-wrapper is used for contract deployment and interaction, so almost all features of the @solarity/hardhat-migrate are not supported.