-
Notifications
You must be signed in to change notification settings - Fork 75
feat(documentation): Add NatSpec comments to contracts #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
c8bc78d
feat: Add NatSpec
nicholaspai f39201e
Merge branch 'master' of https://github.com/across-protocol/across-sm…
nicholaspai 1a92ce9
Update README.md
nicholaspai 2a4757b
Update README.md
nicholaspai fae2205
Update README.md
nicholaspai 8fc835a
Update README.md
nicholaspai 0f8147d
Update README.md
nicholaspai cf8a8ce
Update HubPool.sol
nicholaspai 6e6c463
Merge branch 'npai/natspec' of https://github.com/across-protocol/acr…
nicholaspai d158ef6
Update contracts/HubPool.sol
nicholaspai 2952b1d
Update contracts/HubPool.sol
nicholaspai 2d675a7
Update HubPool.sol
nicholaspai 159ecea
Merge branch 'npai/natspec' of https://github.com/across-protocol/acr…
nicholaspai e5297a2
Update contracts/HubPool.sol
nicholaspai 7737389
Update contracts/HubPool.sol
nicholaspai 7920060
Update HubPool.sol
nicholaspai 01bf8ba
Merge branch 'npai/natspec' of https://github.com/across-protocol/acr…
nicholaspai 00424a8
Update contracts/HubPool.sol
nicholaspai 050f400
Update contracts/HubPool.sol
nicholaspai 7b3f77d
Update contracts/HubPool.sol
nicholaspai 2bc04bb
Update contracts/HubPool.sol
nicholaspai 8c3d1b0
Update contracts/HubPool.sol
nicholaspai b6198d1
Update contracts/HubPool.sol
nicholaspai 9432c80
Update contracts/HubPool.sol
nicholaspai 9fb9e8b
Update contracts/HubPool.sol
nicholaspai 05f490b
Update contracts/HubPool.sol
nicholaspai be69980
Update contracts/HubPool.sol
nicholaspai 377f3dc
Update contracts/HubPool.sol
nicholaspai ef61688
Update HubPool.sol
nicholaspai ea269d6
Merge branch 'npai/natspec' of https://github.com/across-protocol/acr…
nicholaspai cfb51bc
Update contracts/HubPool.sol
nicholaspai d2fa9a9
Update contracts/HubPool.sol
nicholaspai 95824de
Update HubPool.sol
nicholaspai 2f0b837
Merge branch 'npai/natspec' of https://github.com/across-protocol/acr…
nicholaspai ee704c6
Update Ethereum_Adapter.sol
nicholaspai 14f12d0
Update contracts/SpokePool.sol
nicholaspai 975f7d0
Update contracts/SpokePool.sol
nicholaspai babb7ee
Update contracts/SpokePool.sol
nicholaspai d8eac06
Update contracts/SpokePool.sol
nicholaspai 4d241f2
Update contracts/SpokePool.sol
nicholaspai 69e67c6
Update contracts/SpokePool.sol
nicholaspai 598efdb
Update contracts/SpokePool.sol
nicholaspai 9a83495
Update contracts/SpokePool.sol
nicholaspai ae8b3d9
Update contracts/SpokePool.sol
nicholaspai aae3977
Update contracts/SpokePool.sol
nicholaspai 767a91e
Update contracts/SpokePool.sol
nicholaspai 0fff462
nit
71b1024
nit
chrismaree File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,46 +1,38 @@ | ||
| # Advanced Sample Hardhat Project | ||
|  | ||
|
|
||
| This project demonstrates an advanced Hardhat use case, integrating other tools commonly used alongside Hardhat in the ecosystem. | ||
| Contains smart contract suite to enable instant token transfers between any two networks. Relays are backstopped by | ||
| liquidity held in a central `HubPool` on Ethereum, which also serves as the cross-chain administrator of all contracts in the | ||
| system. `SpokePool` contracts are deployed to any network that wants to originate token deposits or be the final | ||
| destination for token transfers, and they are all governed by the `HubPool` on Ethereum. | ||
|
|
||
| The project comes with a sample contract, a test for that contract, a sample script that deploys that contract, and an example of a task implementation, which simply lists the available accounts. It also comes with a variety of other tools, preconfigured to work with the project code. | ||
| This contract set is the second iteration of the [Across smart contracts](https://github.com/across-protocol/across-smart-contracts) | ||
| which facilitate token transfers from any L2 to L1. | ||
|
|
||
| Try running some of the following tasks: | ||
| ## Build | ||
|
|
||
| ```shell | ||
| npx hardhat accounts | ||
| npx hardhat compile | ||
| npx hardhat clean | ||
| npx hardhat test | ||
| npx hardhat node | ||
| npx hardhat help | ||
| REPORT_GAS=true npx hardhat test | ||
| npx hardhat coverage | ||
| npx hardhat run scripts/deploy.ts | ||
| TS_NODE_FILES=true npx ts-node scripts/deploy.ts | ||
| npx eslint '**/*.{js,ts}' | ||
| npx eslint '**/*.{js,ts}' --fix | ||
| npx prettier '**/*.{json,sol,md}' --check | ||
| npx prettier '**/*.{json,sol,md}' --write | ||
| npx solhint 'contracts/**/*.sol' | ||
| npx solhint 'contracts/**/*.sol' --fix | ||
| yarn | ||
| yarn hardhat compile | ||
| ``` | ||
|
|
||
| # Etherscan verification | ||
|
|
||
| To try out Etherscan verification, you first need to deploy a contract to an Ethereum network that's supported by Etherscan, such as Ropsten. | ||
|
|
||
| In this project, copy the .env.example file to a file named .env, and then edit it to fill in the details. Enter your Etherscan API key, your Ropsten node URL (eg from Alchemy), and the private key of the account which will send the deployment transaction. With a valid .env file in place, first deploy your contract: | ||
| ## Test | ||
|
|
||
| ```shell | ||
| hardhat run --network ropsten scripts/sample-script.ts | ||
| yarn test # Run unit tests without gas analysis | ||
| yarn test:gas-analytics # Run only tests that count gas costs | ||
| yarn test:report-gas # Run unit tests with hardhat-gas-reporter enabled | ||
| ``` | ||
|
|
||
| Then, copy the deployment address and paste it in to replace `DEPLOYED_CONTRACT_ADDRESS` in this command: | ||
| ## Lint | ||
|
|
||
| ```shell | ||
| npx hardhat verify --network ropsten DEPLOYED_CONTRACT_ADDRESS "Hello, Hardhat!" | ||
| yarn lint | ||
| yarn lint-fix | ||
| ``` | ||
|
|
||
| # Performance optimizations | ||
| ## Deploy and Verify | ||
|
|
||
| For faster runs of your tests and scripts, consider skipping ts-node's type checking by setting the environment variable `TS_NODE_TRANSPILE_ONLY` to `1` in hardhat's environment. For more details see [the documentation](https://hardhat.org/guides/typescript.html#performance-optimizations). | ||
| ```shell | ||
| NODE_URL_1=https://mainnet.infura.com/xxx yarn hardhat deploy --tags HubPool --network mainnet | ||
| ETHERSCAN_API_KEY=XXX yarn hardhat etherscan-verify --network mainnet --license AGPL-3.0 --force-license --solc-input | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.