Deploy Smart Contract
You can also add an array of accounts
(defined by their private key) for the corresponding network to be used by the provider. Note that the account will have to have enough native token funds, this will be tGGG if you're interacting with the Genesis L2 Devnet. This balance is to cover the contract deployment costs on the network.
Write a deployment script
You can create a deployment script in a new file in the scripts
directory, for example, deploy.ts
. This script should include the necessary code to deploy the smart contract to the Genesis L2 Devnet using the deploy
function provided by Hardhat.
Deploy the smart contract
Run your deployment script using the following command, using the --network
tag to the Genesis L2 Devnet test network you have defined in the config:
Verify
You can then run the hardhat verify
task, passing the address of the contract, the network where it's deployed, and the constructor arguments that were used to deploy it (if any):
If your contract has multiple constructor arguments like the preset ERC721, you will need to save your constructor arguments to a separate file like arguments.js
in the root directory as so:
The verification command then becomes:
See the guide in the Hardhat docs for more information and other ways to verify your contract.
Last updated