Skip to content

Commit

Permalink
chore: add deploy config
Browse files Browse the repository at this point in the history
  • Loading branch information
Atlasoin committed Oct 28, 2024
1 parent 619c151 commit dc84338
Show file tree
Hide file tree
Showing 19 changed files with 789 additions and 268 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:

- name: Run Forge build
run: |
forge build --sizes
forge clean && forge build --sizes
id: build

- name: Run Forge tests
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ out/
!/broadcast
/broadcast/*/31337/
/broadcast/**/dry-run/
broadcast

# Docs
docs/

# Dotenv file
.env

node_modules/
node_modules/

deployments
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Lints
lint :; forge fmt
47 changes: 18 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@

This is a demo repo using OVM contracts lib to calculate Pi onchain.

`./prgrams` contains the python code for computing task.
`./src` is the main entry for the contract code.

## Documentation

https://book.getfoundry.sh/

## Usage

Expand All @@ -29,34 +25,27 @@ $ forge test
$ forge fmt
```

### Gas Snapshots

```shell
$ forge snapshot
```

### Anvil

```shell
$ anvil
```

### Deploy

```shell
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
```
# With verification
forge script script/Deploy.s.sol:Deploy \
--chain-id $CHAIN_ID \
--rpc-url $RPC_URL \
--private-key $PRIVATE_KEY \
--verifier-url $VERIFIER_URL \
--verifier $VERIFIER \
--verify \
--broadcast --ffi -vvvv

### Cast
# Without verification
forge script script/Deploy.s.sol:Deploy \
--chain-id $CHAIN_ID \
--rpc-url $RPC_URL \
--private-key $PRIVATE_KEY \
--broadcast --ffi -vvvv

```shell
$ cast <subcommand>
```

### Help

```shell
$ forge --help
$ anvil --help
$ cast --help
```
# generate easily readable abi to /deployments
forge script script/Deploy.s.sol:Deploy --sig 'sync()' --rpc-url $RPC_URL --broadcast --ffi
```
5 changes: 5 additions & 0 deletions deploy-config/30732.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"proxyAdminOwner": "0xEA02bb4e91e36c8F853D9b37B74A832FFeDbF157",
"templateAdmin": "0xE0b98a1062B7f2f77087Cc1Dc9889B79FF46cAb8",
"ovmTaskAddress": "0xca0338b1862bce76b4e4b39f1f0c3117429fbdfa"
}
87 changes: 84 additions & 3 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,87 @@
[profile.default]
src = "src"
out = "out"
libs = ["node_modules","lib"]

# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
auto_detect_solc = false
bytecode_hash = "none"
evm_version = "paris"
fs_permissions = [
{ access = "read", path = "./out-optimized" },
{ access = "read", path = "package.json" },
{ access = "read-write", path = "./benchmark/results" },
{ access='read-write', path='./deployments/' },
{ access='read', path='./deploy-config/' },
{ access='read', path='./broadcast/' },
{ access='read', path = './out/' },
{ access='read', path='./script/' },
]
gas_limit = 9223372036854775807

optimizer = true
optimizer_runs = 999999
out = "out"
script = "script"
sender = "0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38"
solc = "0.8.24"
src = "src"
test = "test"

[profile.default.fuzz]
max_test_rejects = 1_000_000 # Number of times `vm.assume` can fail
runs = 50

[profile.default.invariant]
call_override = false # Override unsafe external calls to perform reentrancy checks
depth = 20 # Number of calls executed in one run
fail_on_revert = true
runs = 20

# Run only the code inside benchmark directory
[profile.benchmark]
test = "benchmark"

# Speed up compilation and tests during development
[profile.lite]
optimizer = false

# Compile only the production code and the test mocks with via IR
[profile.optimized]
out = "out-optimized"
test = "test/mocks"
via_ir = true

# See "SMTChecker and Formal Verification" in the Solidity docs
[profile.smt]
ignored_error_codes = [
7737, # Disable inline assembly warnings
]
out = "out-optimized"
script = "src"
test = "src"
via_ir = true



# Test the optimized contracts without re-compiling them
[profile.test-optimized]
src = "test"

[doc]
ignore = ["**/*.t.sol", "script/**"]
out = "docs"


[fmt]
line_length = 100
tab_width = 4
bracket_spacing = false
int_types = "long"
multiline_func_header = "attributes_first"
quote_style = "preserve"
number_underscore = "preserve"
hex_underscore = "remove"
single_line_statement_blocks = "preserve"
override_spacing = false
wrap_comments = true
ignore = []
contract_new_lines = false
sort_imports = true
27 changes: 0 additions & 27 deletions programs/main.py

This file was deleted.

11 changes: 0 additions & 11 deletions programs/ovm/__init__.py

This file was deleted.

16 changes: 0 additions & 16 deletions programs/ovm/bridge.py

This file was deleted.

45 changes: 0 additions & 45 deletions programs/ovm/bridge_pb2.py

This file was deleted.

Loading

0 comments on commit dc84338

Please sign in to comment.