Skip to content

Commit 3e983ba

Browse files
authored
Contract (#1)
* chore: forge init * forge install: forge-std v1.9.5 * Add Namespace contract * Redeploy contract to optimism-sepolia * Add namespace deployment and Whitelist contract * Replace hasRole to isGranted * Fix whitelist address env * Update deployed contract * Delete cached * Add /cache directory to .gitignore
1 parent dbb7585 commit 3e983ba

26 files changed

+1736
-1
lines changed

.github/workflows/test.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
env:
9+
FOUNDRY_PROFILE: ci
10+
11+
jobs:
12+
check:
13+
strategy:
14+
fail-fast: true
15+
16+
name: Foundry project
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
submodules: recursive
22+
23+
- name: Install Foundry
24+
uses: foundry-rs/foundry-toolchain@v1
25+
26+
- name: Show Forge version
27+
run: |
28+
forge --version
29+
30+
- name: Run Forge fmt
31+
run: |
32+
forge fmt --check
33+
id: fmt
34+
35+
- name: Run Forge build
36+
run: |
37+
forge build --sizes
38+
id: build
39+
40+
- name: Run Forge tests
41+
run: |
42+
forge test -vvv
43+
id: test

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,5 @@ out/
4848
.yarn/build-state.yml
4949
.yarn/install-state.gz
5050
.pnp.*
51+
52+
/cache

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "lib/forge-std"]
2+
path = lib/forge-std
3+
url = https://github.com/foundry-rs/forge-std

.yarnrc.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
enableGlobalCache: true
2+
3+
enableTelemetry: false
4+
5+
npmRegistryServer: "https://registry.npmjs.org"
6+
7+
nodeLinker: node-modules
8+
9+
supportedArchitectures:
10+
cpu:
11+
- x64
12+
- arm64
13+
libc:
14+
- glibc
15+
- musl
16+
os:
17+
- darwin
18+
- linux
19+
20+
yarnPath: .yarn/releases/yarn-4.6.0.cjs

README.md

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,79 @@
1-
# namespace
1+
## Foundry
2+
3+
**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**
4+
5+
Foundry consists of:
6+
7+
- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools).
8+
- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
9+
- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network.
10+
- **Chisel**: Fast, utilitarian, and verbose solidity REPL.
11+
12+
## Documentation
13+
14+
https://book.getfoundry.sh/
15+
16+
## Usage
17+
18+
### Build
19+
20+
```shell
21+
$ forge build
22+
```
23+
24+
### Test
25+
26+
```shell
27+
$ forge test
28+
```
29+
30+
### Format
31+
32+
```shell
33+
$ forge fmt
34+
```
35+
36+
### Gas Snapshots
37+
38+
```shell
39+
$ forge snapshot
40+
```
41+
42+
### Anvil
43+
44+
```shell
45+
$ anvil
46+
```
47+
48+
### Deploy
49+
50+
```shell
51+
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
52+
```
53+
54+
### Cast
55+
56+
```shell
57+
$ cast <subcommand>
58+
```
59+
60+
### Help
61+
62+
```shell
63+
$ forge --help
64+
$ anvil --help
65+
$ cast --help
66+
```
67+
68+
# Verify contract
69+
70+
```shell
71+
forge verify-contract \
72+
$CONTRACT_ADDRESS \
73+
src/Namespace.sol:Namespace \
74+
--chain-id $CHAIN_ID \
75+
--constructor-args $(cast abi-encode "constructor(address)" "$OWNER_ADDRESS") \
76+
--etherscan-api-key $ETHERSCAN_API_KEY \
77+
--compiler-version $COMPILER_VERSION \
78+
--watch
79+
```

broadcast/NamespaceDeployment.s.sol/11155420/run-1737130083.json

Lines changed: 70 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/NamespaceDeployment.s.sol/11155420/run-1737161536.json

Lines changed: 71 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/NamespaceDeployment.s.sol/11155420/run-1737162562.json

Lines changed: 71 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/NamespaceDeployment.s.sol/11155420/run-1737163324.json

Lines changed: 71 additions & 0 deletions
Large diffs are not rendered by default.

broadcast/NamespaceDeployment.s.sol/11155420/run-latest.json

Lines changed: 71 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)