Template to kickstart a solidity project
- Yarn >= v1.22.0
- Node >= v18.0.0
- Clone this repo
git clone git@github.com:Syndika-Corp/solidity-project-template.git
or create a new repository from this template in github. - Adjust
package.json
if necessary:- name
- version
- description
- author
- license
- Install all modules using
yarn
- Create
.env
file and complete it with your variables according to.env.example
- Enjoy coding!
This template consists of the following folders:
-
addresses
- used for storing addresses of the contracts in JSON format segregated by the network, e.g. forLock
contract, the deployed instances on goerli and mainnet networks will be stored inaddresses/Lock.json
directory as follows:{ "goerli": "0xEA71eCbaf87D93092bc21139000c1348858200d2", "mainnet": "0x3Aa5ebB10DC797CAC828524e59A333d0A371443c" }
-
contracts
- utilized for storing smart-contracts written in Solidity as.sol
files -
deploy
- contains exported functions for smart-contract deployment, each contract should have its own TS file for this purpose -
docs
- holds docgen and other artifacts relevant for smart-contract documentation -
scripts
- contains entry-point files for smart-contract deployment and address logging, can be augmented with new script files correspondingly -
test
- contains all modules for smart-contract testing -
typechain-types
- generated contract types by typechain -
coverage
- the test coverage report
All necessary constants for deployment separated by network name can be stored in ./constants.ts
.
This project comes with a sample contract, a test for that contract, and relevant scripts for contract deployment.
yarn
or yarn install
yarn chain
yarn coverage
yarn docs
yarn compile
yarn build
yarn deploy <network_name>
yarn test
The package stores contract
types
anddeployment infrormation
to integrate the contracts in other Dapp parts
-
NPM account login:
yarn login
-
Publish package:
yarn publish --access restricted