contract-template
v0.0.7
Published
This template provides a template for contract development and operation, including tools and conventions. These are recommended and not mendatory. If you have a suggestion, please make a PR to the template.
Downloads
1
Readme
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.json
by runningnpm init
- Things to remove
deployments/
directory
- Replace
README.md
withREADME-TEMPLATE.md
and 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/*.md
for 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.toml
as well)defaultKey
: default key to be used ifenv.PRIVATE_KEY
is empty. Default is the well known keynetwork
: list of networks. Can be selected withnpx hardhat --network
flag. These can contain tags depending on the deployment purpose, such asbaobab-qa
namedAccounts
: 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.toml
as well)profile
: list of profiles. Can be selected withHARDHAT_PROFILE
environment variable.rpc_endpoints
: alias forcast