-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into review-base
- Loading branch information
Showing
62 changed files
with
16,827 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
env: | ||
FOUNDRY_PROFILE: ci | ||
|
||
jobs: | ||
check: | ||
strategy: | ||
fail-fast: true | ||
|
||
name: Foundry project | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
submodules: recursive | ||
|
||
- name: Install Foundry | ||
uses: foundry-rs/foundry-toolchain@v1 | ||
with: | ||
version: nightly | ||
|
||
- name: Show Forge version | ||
run: | | ||
forge --version | ||
- name: Run Forge fmt | ||
run: | | ||
forge fmt --check | ||
id: fmt | ||
|
||
- name: Run Forge build | ||
run: | | ||
forge build --sizes | ||
id: build | ||
|
||
- name: Run Forge tests | ||
run: | | ||
forge test -vvv | ||
id: test | ||
env: | ||
FORGE_SNAPSHOT_CHECK: true |
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,14 @@ | ||
# Compiler files | ||
cache/ | ||
out/ | ||
|
||
# Ignores development broadcast logs | ||
!/broadcast | ||
/broadcast/*/31337/ | ||
/broadcast/**/dry-run/ | ||
|
||
# Docs | ||
docs/ | ||
|
||
# Dotenv file | ||
.env |
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,15 @@ | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std | ||
[submodule "lib/solady"] | ||
path = lib/solady | ||
url = https://github.com/vectorized/solady | ||
[submodule "lib/soledge"] | ||
path = lib/soledge | ||
url = https://github.com/vectorized/soledge | ||
[submodule "lib/permit2"] | ||
path = lib/permit2 | ||
url = https://github.com/Uniswap/permit2 | ||
[submodule "lib/tstorish"] | ||
path = lib/tstorish | ||
url = https://github.com/ProjectOpenSea/tstorish |
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,20 @@ | ||
[profile.default] | ||
solc = '0.8.28' | ||
evm_version='cancun' | ||
via_ir = true | ||
# optimizer_runs = 4_294_967_295 | ||
optimizer_runs = 200 | ||
bytecode_hash = 'none' | ||
src = "src" | ||
out = "out" | ||
libs = ["lib"] | ||
extra_output_files = ["irOptimized"] | ||
|
||
[profile.default.optimizer_details.yulDetails] | ||
# optimizerSteps = "dhfoD[xarrscLMcCTU]uljmul:fDnTOcmu" | ||
# TODO: use default with everything but FunctionSpecializer (F) | ||
|
||
[fmt] | ||
line_length = 210 | ||
tab_width = 4 | ||
bracket_spacing = true |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,39 @@ | ||
// SPDX-License-Identifier: UNLICENSED | ||
pragma solidity ^0.8.13; | ||
|
||
import { Script, console } from "forge-std/Script.sol"; | ||
import { TheCompact } from "../src/TheCompact.sol"; | ||
|
||
interface ImmutableCreate2Factory { | ||
function safeCreate2(bytes32 salt, bytes calldata initializationCode) external payable returns (address deploymentAddress); | ||
} | ||
|
||
contract TheCompactScript is Script { | ||
TheCompact public theCompact; | ||
|
||
function setUp() public { } | ||
|
||
function run() public { | ||
vm.startBroadcast(); | ||
|
||
// ensure permit2 is deployed | ||
assert(address(0x000000000022D473030F116dDEE9F6B43aC78BA3).code.length > 0); | ||
|
||
// to deploy using create2 (need to rederive salt and target address when changing code): | ||
bytes32 salt = bytes32(0x00000000000000000000000000000000000000008a0f466a78cd1102ce3d82f7); | ||
address targetAddress = address(0x00000000000018DF021Ff2467dF97ff846E09f48); | ||
// ensure create2 deployer is deployed | ||
address immutableCreate2Factory = address(0x0000000000FFe8B47B3e2130213B802212439497); | ||
assert(immutableCreate2Factory.code.length > 0); | ||
// deploy it and check the target address | ||
theCompact = TheCompact(ImmutableCreate2Factory(immutableCreate2Factory).safeCreate2(salt, type(TheCompact).creationCode)); | ||
assert(address(theCompact) == targetAddress); | ||
|
||
// // to just deploy it directly: | ||
// theCompact = new TheCompact(); | ||
|
||
assert(keccak256(bytes(theCompact.name())) == keccak256(bytes("The Compact"))); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
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,42 @@ | ||
{ | ||
"basicTransfer": "56867", | ||
"basicWithdrawal": "59992", | ||
"batchClaim": "112512", | ||
"batchClaimRegisteredWithDeposit": "112512", | ||
"batchClaimRegisteredWithDepositWithWitness": "113271", | ||
"batchClaimWithWitness": "113265", | ||
"batchDepositAndRegisterViaPermit2": "222059", | ||
"batchDepositAndRegisterWithWitnessViaPermit2": "222037", | ||
"batchTransfer": "81344", | ||
"batchWithdrawal": "100093", | ||
"claim": "56974", | ||
"claimAndWithdraw": "73432", | ||
"claimWithWitness": "59471", | ||
"depositAndRegisterViaPermit2": "124429", | ||
"depositBatchSingleERC20": "68050", | ||
"depositBatchSingleNative": "28353", | ||
"depositBatchViaPermit2NativeAndERC20": "129751", | ||
"depositBatchViaPermit2SingleERC20": "104905", | ||
"depositERC20AndURI": "67276", | ||
"depositERC20Basic": "67302", | ||
"depositERC20ViaPermit2AndURI": "98471", | ||
"depositETHAndURI": "26754", | ||
"depositETHBasic": "28391", | ||
"qualifiedBatchClaim": "114134", | ||
"qualifiedBatchClaimWithWitness": "113672", | ||
"qualifiedClaim": "60406", | ||
"qualifiedClaimWithWitness": "59098", | ||
"qualifiedSplitBatchClaim": "141486", | ||
"qualifiedSplitBatchClaimWithWitness": "141552", | ||
"qualifiedSplitClaim": "86977", | ||
"qualifiedSplitClaimWithWitness": "87452", | ||
"register": "25379", | ||
"splitBatchClaim": "140788", | ||
"splitBatchClaimWithWitness": "140749", | ||
"splitBatchTransfer": "110652", | ||
"splitBatchWithdrawal": "140361", | ||
"splitClaim": "86751", | ||
"splitClaimWithWitness": "86232", | ||
"splitTransfer": "82482", | ||
"splitWithdrawal": "93770" | ||
} |
Oops, something went wrong.