-
Clone the repo.
$ git clone https://github.com/wfkhrrzi/contract-template-v1.git
-
Install required dependencies.
$ npm install
-
Create
.env
from the.env.example
template.$ cp .env.example .env
-
Populate the
.env
file with the preferred configuration.PUBLIC_KEY=<INSERT YOUR WALET PUBLIC KEY> PRIVATE_KEY=<INSERT YOUR WALET PRIVATE KEY>
-
Test the contracts.
$ npx hardhat test
-
Finalize the deployment script & configuration.
# .env DEPLOY_NETWORK=bsc_testnet # modify the chain used for deployment here
// scripts/deployContract/deployScript.ts export async function deployContracts(deployToChain = false) { const ABIs: Abi[] = []; const config = new Config(); const ContractDeployment = new DeployContract(config); let func_deploy: | typeof DeployContract.deployLocal | typeof ContractDeployment.deployToChain; if (deployToChain) { func_deploy = ContractDeployment.deployToChain.bind(ContractDeployment); } else { func_deploy = DeployContract.deployLocal.bind(DeployContract); } // modify contract deployment script here. Refer to sample deployment script in the file }
-
Deploy the contract
$ npm run deploy