Skip to content

aneiosi/template-evm-contracts

 
 

Repository files navigation

Boilerplate for ethereum solidity smart contract development

SCRIPTS

Some of the following pnpm scripts rely on utils/doAction.ts to allow parameterizing via command line argument (have a look inside if you need modifications).

pnpm prepare

As a standard lifecycle pnpm script, it is executed automatically upon install. It generates config files and typechain declarations to get you started with typesafe contract interactions.

pnpm format and pnpm format:fix

These will format check your code. the :fix version will modifiy the files to match the requirement specified in .prettierrc.json.

pnpm compile

This will compile your contracts.

pnpm void:deploy

This will deploy your contracts on the in-memory hardhat network and exit, leaving no trace. Quick way to ensure deployments work as intended without consequences.

pnpm test [mocha args...]

This will execute your tests using mocha. you can pass extra arguments to mocha.

pnpm coverage

This will produce a test coverage report in the coverage/ folder.

pnpm gas

This will produce a gas report for functions used in tests.

pnpm dev

These will run a local hardhat network on localhost:8545 and deploy your contracts on it. Plus it will watch for any changes and redeploy them.

pnpm local:dev

This assumes a local node it running on localhost:8545. It will deploy your contracts on it. Plus it will watch for any changes and redeploy them.

pnpm execute <network> <file.ts> [args...]

This will execute the script <file.ts> against the specified network.

pnpm deploy <network> [args...]

This will run the deploy scripts on the specified network.

Behind the scene it uses hardhat deploy command so you can append any argument for it.

pnpm export <network> <file.json>

This will export the abi+address of deployed contract to <file.json>

pnpm fork:execute <network> [--blockNumber <blockNumber>] [--deploy] <file.ts> [args...]

This will execute the script <file.ts> against a temporary fork of the specified network.

if --deploy is used, deploy scripts will be executed.

pnpm fork:deploy <network> [--blockNumber <blockNumber>] [args...]

This will deploy the contract against a temporary fork of the specified network.

Behind the scene it uses hardhat deploy command so you can append any argument for it.

pnpm fork:test <network> [--blockNumber <blockNumber>] [mocha args...]

This will test the contract against a temporary fork of the specified network.

pnpm fork:dev <network> [--blockNumber <blockNumber>] [args...]

This will deploy the contract against a fork of the specified network and it will keep running as a node.

Behind the scene it uses hardhat node command so you can append any argument for it.

About

Template to develop ethereum smart contracts

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 62.2%
  • Solidity 36.4%
  • JavaScript 1.4%