-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
981f976
commit 1427897
Showing
10 changed files
with
427 additions
and
94 deletions.
There are no files selected for viewing
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
forge build | ||
npx lint-staged |
This file contains 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,66 +1,35 @@ | ||
## Foundry | ||
# rns-contracts | ||
|
||
**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.** | ||
The collections of smart contracts that power the Ronin Name Service (RNS). | ||
|
||
Foundry consists of: | ||
## Development | ||
|
||
- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools). | ||
- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data. | ||
- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network. | ||
- **Chisel**: Fast, utilitarian, and verbose solidity REPL. | ||
### Requirement | ||
|
||
## Documentation | ||
- [Foundry forge@^0.2.0](https://book.getfoundry.sh/) | ||
|
||
https://book.getfoundry.sh/ | ||
### Build & Test | ||
|
||
## Usage | ||
|
||
### Build | ||
|
||
```shell | ||
$ forge build | ||
``` | ||
|
||
### Test | ||
|
||
```shell | ||
$ forge test | ||
``` | ||
|
||
### Format | ||
- Install packages | ||
|
||
```shell | ||
$ forge fmt | ||
$ forge install | ||
``` | ||
|
||
### Gas Snapshots | ||
- Build contracts | ||
|
||
```shell | ||
$ forge snapshot | ||
$ forge build | ||
``` | ||
|
||
### Anvil | ||
- Run test | ||
|
||
```shell | ||
$ anvil | ||
$ forge test | ||
``` | ||
|
||
### Deploy | ||
|
||
```shell | ||
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key> | ||
``` | ||
|
||
### Cast | ||
|
||
```shell | ||
$ cast <subcommand> | ||
``` | ||
|
||
### Help | ||
|
||
```shell | ||
$ forge --help | ||
$ anvil --help | ||
$ cast --help | ||
$ forge script <path/to/file.s.sol> -f --private-key <your_private_key> | ||
``` |
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "rns-contracts", | ||
"version": "1.0.0", | ||
"description": "RNS smart contracts.", | ||
"author": "Axie Infinity Engineering <[email protected]>", | ||
"license": "MIT", | ||
"repository": "https://github.com/axieinfinity/rns-contracts.git", | ||
"files": [ | ||
"src/**/*.sol" | ||
], | ||
"devDependencies": { | ||
"husky": "^8.0.3", | ||
"lint-staged": "^14.0.1" | ||
}, | ||
"lint-staged": { | ||
"{src,script,test}/**/*.sol": [ | ||
"forge fmt" | ||
] | ||
}, | ||
"scripts": { | ||
"prepare": "husky install" | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
ds-test/=lib/forge-std/lib/ds-test/src/ | ||
forge-std/=lib/forge-std/src/ |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.