Skip to content

ashlesh-settlemint/trident

Repository files navigation

Empty

Project structure

This project is set up using Hardhat Ethereum development environment to provide the best developer experience possible. In the Explorer panel on the left, you will find all the files and folders of which we describe below.

root
|    README.md                          # This file
|    hardhat.config.ts                  # Hardhat configuration file https://hardhat.org/config/
|    .solhint.json                      # Configuration file for the solhint linter
|    bpaas.json                         # This file is generated by the deploy command and contains
|                                       # all the information a dAPP needs to interact with the contracts.
|
+--+ .secrets
|  |   default.hardhat.config.ts        # This read-only file is prepopulated with the access settings and
|                                       # credentials from your blockchain node. These values are used in the
|                                       # hardhat configuration file. If you want to use different settings,
|                                       # modify them there.
|
+--+ abi                                # The compile task creates ABI fields for each contract in this folder
|  |   ...                              # For each import you get a ABI file as well
|
+--+ contracts                          # This folder contains your Solidity smart contracts.
|
+--+ deploy                             # This folder contains the scripts to deploy the contract to your
|  |                                    # blockchain node. (https://hardhat.org/plugins/hardhat-deploy.html)
|
+--+ deployments                        # This folder is generated in the deploy task and contains the bytecode and
|  |                                    # addresses of all your contracts on chain. Store this folder in version control
|  |                                    # as it is a crucial piece of information to work with your contract system
+--+ test                               # This folder contains the test suite for your contracts using
|  |                                    # ethers.js and waffle. (https://hardhat.org/guides/waffle-testing.html)
+--+ typechain                          # A generated folder by the compile task that has the Typescript types for your
   |                                    # contracts

Tasks

While the terminal (shortcut: ^⇧` or via the hamburger menu top left corner) is a fully functional linux based terminal to execute all Hardhat commands, on the left bottom in the Exporer panel you will find the TASK RUNNER panel that provides one click access to predefined commands for the most common actions.

lint (yarn lint)

Uses solhint to lint your contracts. The configuration can be found in .solhint.

> Executing task: yarn run lint <

yarn run v1.22.5
$ npx solhint --fix 'contracts/**/*.sol'

contracts/GenericToken.sol
  45:3  error  Explicitly mark visibility in function  func-visibility

✖ 1 problem (1 error, 0 warnings)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
The terminal process "bash '-c', 'yarn run lint'" terminated with exit code: 1.

compile (yarn compile)

The compile taks compiles your solidity contracts to their ABI and bytecode and generates typescript types for them using Typechain. The typescript types provide typesafety, auto completion and checks to prevent the use of wrong functions or arguments.

> Executing task: yarn run compile <

yarn run v1.22.5
$ npx hardhat compile
Compiling 11 files with 0.8.4
Generating typings for: 12 artifacts in dir: typechain for target: ethers-v5
Successfully generated 23 typings!
Compilation finished successfully
Done in 6.35s.

Terminal will be reused by tasks, press any key to close it.

deploy (yarn deploy)

This task deploys your smart contracts (using the script in the deploy folder) to the blockchain node you selected when launching this IDE (into in the .secrets folder).

> Executing task: yarn run deploy <

yarn run v1.22.5
$ npx hardhat deploy --export bpaas.json --network bpaas
Nothing to compile
No need to generate any newer typings.

deploying "GenericToken" (tx: 0x7d8433594d82308aed36703186bbcf4656586a711087eec3a438c7ec46de85bc)...: deployed at 0x0735BAACebc86A5FC8Cf7b479787C1cBDD727487 with 1639306 gas
Done in 18.91s.

Terminal will be reused by tasks, press any key to close it.

The deploy task does not execute the same deploy script twice (it will mention something like reusing "GenericToken" at 0x0735BAACebc86A5FC8Cf7b479787C1cBDD727487) in the terminal when you do. By adding files wit higher initial numbers in the filename you can modify your smart contact system over time.

If you do want to start fresh, use the deploy:reset task. This will overwrite all the deployments folder and bpaas.json file. Use with caution!

The deploy:local task is for testing your deploy scripts and deploys to the internal Hardhat network.

Please note that deploying to networks that require a gasprice, espacially mainnets, require you to fund the account used to deploy with the native cryptocurrency of that network. (ETH, BNB, AVAX, etc)

About

No description, website, or topics provided.

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE
Unknown
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published