All Contracts In Here
The development process must strictly follow the principle of test-driven development, write test cases first, and then write the function implementation.
The project structure is as follows
contracts/
├── contracts --- Contract source code directory, mainly store *.sol contract files
│ ├── HelloWorld.sol
│ └── ...
├── scripts --- js script directory, mainly store deployment scripts.
│ ├── HelloWorld-deploy.js
│ └── ...
├── test --- Contract unit test directory
│ ├── HelloWorld-test.js
│ └── ...
├── hardhat.config.js --- hardhat configuration file
├── package.json
├── .env --- Environment variable file (need to be created manually)
└── ...Running Test Locally (Recommend)
npx hardhat testnpx hardhat test --grep oneRunning Test On Polygon Testnet
npx hardhat test --network mumbainpx hardhat run scripts/HelloWorld-deploy.ts --network mumbainpx hardhat run --network polygon_testnet scripts/HelloWorld-deploy.ts
npx hardhat run --network polygon_testnet filePathnpm run compile```bash
contracts/
├── abi/
│ └── contracts/
│ ├── HelloWorld.sol/
│ │ ├── HelloWorld.json ---abi description file
│ │ └── HelloWorld.ts ---abi Typescript file
│ └── OtherXXX.sol/
│ ├── OtherXXX.json
│ └── OtherXXX.ts
│ └── contracts_sui/
│ └── core/
│ └── OtherXXX.sol
│ └── token/
│ └── SuiBFBToken.sol
└── ...Copy the files in the abi/ directory to the corresponding project for use
About the abi/ directory, you can also use the npm run compile command to generate the abi/ directory, and then copy the files in the abi/ directory to the corresponding project for use.