diff --git a/package.json b/package.json index 8f3d95cd..3d54d233 100644 --- a/package.json +++ b/package.json @@ -72,6 +72,7 @@ "build": "yarn compile && npx del-cli dist abi && npx tsc || true && npx del-cli './dist/typechain-types/**/*.js' && npx cpx './data/**/*' dist/data && npx cpx './artifacts/contracts/**/*' ./abi && npx del-cli './abi/**/*.dbg.json'", "compile": "npx hardhat compile --force", "generate": "yarn compile && ./scripts/generate_go.sh || true && ./scripts/generate_addresses.sh && yarn lint:fix", + "docs": "forge doc", "lint": "npx eslint . --ext .js,.ts", "lint:fix": "npx eslint . --ext .js,.ts,.json --fix", "prepublishOnly": "yarn build", @@ -80,4 +81,4 @@ }, "types": "./dist/lib/index.d.ts", "version": "0.0.8" -} +} \ No newline at end of file diff --git a/readme.md b/readme.md index 8587c0d5..886f320f 100644 --- a/readme.md +++ b/readme.md @@ -31,7 +31,9 @@ getAddress("zrc20", "zeta_mainnet", "USDT.BSC"); The third argument (symbol) is only used when querying ZRC-20 addresses to specify which token address is needed. -To view a table of all contracts visit the [Contract Addresses](https://www.zetachain.com/docs/reference/contracts/) page in the docs. +To view a table of all contracts visit the [Contract +Addresses](https://www.zetachain.com/docs/reference/contracts/) page in the +docs. Importing [`ZetaInterfaces`](https://www.zetachain.com/docs/developers/cross-chain-messaging/connector/) @@ -42,8 +44,8 @@ import "@zetachain/protocol-contracts/contracts/evm/interfaces/ZetaInterfaces.so import "@zetachain/protocol-contracts/contracts/evm/tools/ZetaInteractor.sol"; ``` -Importing [ZRC20](https://www.zetachain.com/docs/developers/tokens/zrc20/) -and the [system +Importing [ZRC20](https://www.zetachain.com/docs/developers/tokens/zrc20/) and +the [system contract](https://www.zetachain.com/docs/developers/omnichain/system-contract/) for omni-chain smart contracts: @@ -55,12 +57,14 @@ import "@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol"; ## Prerequisites for Development -Before you can contribute to this project, you must have the following installed: +Before you can contribute to this project, you must have the following +installed: - [Node.js](https://nodejs.org/) - [Yarn](https://yarnpkg.com/) - [jq](https://stedolan.github.io/jq/) - [abigen](https://geth.ethereum.org/docs/tools/abigen) +- [forge](https://getfoundry.sh/) ## Compiling Contracts @@ -75,7 +79,8 @@ to the `artifacts` directory. ## Generating Go Bindings and Contract Addresses -To generate Go bindings for the Solidity contracts and fetch, run the following command: +To generate Go bindings for the Solidity contracts and fetch, run the following +command: ``` yarn generate @@ -84,6 +89,16 @@ yarn generate This will use `abigen` to generate Go bindings for the contracts and output the resulting Go files to the `pkg` directory. +## Generating Contract Docs + +To generate the docs from protocol contracts, run the following command: + +``` +yarn docs +``` + +This script uses `forge doc` to generate the docs. + ## Contributing If you would like to contribute to this project, please fork the repository and