0.0.7 • Published 3 years ago
contract-template v0.0.7
Contract-template
This template provides a template for contract development and operation, including tools and conventions. These are recommended and not mandatory. If you have a suggestion, please make a PR to the template.
Overview
Directory Structure
The directory structure of this template is as follows:
contracts/: solidity contractsdeploy/: deployment scriptslib/: library functions to be published to NPMscript/: scripts to interact with contractstest/: unit tests
Must-do After Repo Creation
There are a few things that must be done after a new repo has been created using this template.
- Update
package.jsonby runningnpm init - Things to remove
deployments/directory
- Replace
README.mdwithREADME-TEMPLATE.mdand fill in information- Fill in each section or add/remove sections as you want
- Replace "@klaytn/contract-template" with appropriate NPM package name
- Fill in
docs/*.mdfor developer guide
Configuration
This template ships default configurations. However, if you need to change it, here's are some options:
Here are the list of configurable files:
package.json: package info. Need to be updated withnpm init(see this section)hardhat.config.ts(please syncfoundry.tomlas well)defaultKey: default key to be used ifenv.PRIVATE_KEYis empty. Default is the well known keynetwork: list of networks. Can be selected withnpx hardhat --networkflag. These can contain tags depending on the deployment purpose, such asbaobab-qanamedAccounts: accounts forgetNamedAccounts()(see deploy/deploy_lock.ts)etherscan: required for etherscan-verifydodoc: required for dodocpaths: required for hardhat-deployexternal: required for hardhat-deploy
foundry.toml(please syncfoundry.tomlas well)profile: list of profiles. Can be selected withHARDHAT_PROFILEenvironment variable.rpc_endpoints: alias forcast
0.0.7
3 years ago