Skip to content

wfkhrrzi/hardhat-boilerplate-v1

Repository files navigation

Installation & Setup

  1. Clone the repo.

    $ git clone https://github.com/wfkhrrzi/contract-template-v1.git
  2. Install required dependencies.

    $ npm install
  3. Create .env from the .env.example template.

     $ cp .env.example .env
  4. Populate the .env file with the preferred configuration.

    PUBLIC_KEY=<INSERT YOUR WALET PUBLIC KEY>
    PRIVATE_KEY=<INSERT YOUR WALET PRIVATE KEY>
  5. Test the contracts.

    $ npx hardhat test

Deployment

  1. 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
    }
  2. Deploy the contract

    $ npm run deploy

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published