Skip to content

abhi3700/evm_boilerplate

Repository files navigation

About

Installation

yarn install

Usage

Build

yarn compile

Contract size

yarn contract-size

Test

yarn test

TypeChain

Compile the smart contracts and generate TypeChain artifacts:

yarn typechain

Lint Solidity

Lint the Solidity code:

yarn lint:sol

Lint TypeScript

Lint the TypeScript code:

yarn lint:ts

Coverage

Generate the code coverage report:

yarn coverage

Report Gas

See the gas usage per unit test and average gas per method call:

REPORT_GAS=true yarn test

Clean

Delete the smart contract artifacts, the coverage reports and the Hardhat cache:

yarn clean

Verify

yarn verify <network_name> <deployed_contract_address> <constructor params>
// TODO: add your own SC arguments or empty
yarn verify <network_name> <deployed_contract_address> --constructor-args verify/erc20token.args.ts

For multiple arguments, follow this guide.

Flatten

yarn flatten <contract-filename-w-ext-with-dir> > ./flatten/<contract-filename-w-ext>

Then, the file can be used to upload the code manually (click on 'Contract' tab >> verify and publish) or using script (with Block explorer API as per the network)

Deploy

  • Environment variables: Create a .env file with its values in .env.example

localhost

// on terminal-1
$ npx hardhat node

// on terminal-2
$ yarn hardhat deploy:Escrow --network localhost

ETH Testnet - Goerli

  • Deploy the contracts
yarn hardhat deploy:Escrow --network goerli

ETH Mainnet

  • Deploy the contracts
yarn hardhat deploy:Escrow --network mainnet

About

Boilerplate SC for EVM Blockchains

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published