Skip to content

Commit

Permalink
chore: remove foundry install
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Smith committed Nov 5, 2024
1 parent eb1c194 commit b8cc060
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 118 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,17 @@ jobs:
steps:
- uses: actions/checkout@v4
- run: cargo fmt --all -- --check

verify-bytecode:
name: Verify Bytecode
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: curl -L https://foundry.paradigm.xyz | bash && foundryup
- run: forge build --contracts=contracts
- run: mkdir -p bytecode/Erc6492.sol
- run: jq -r .bytecode.object out/Erc6492.sol/ValidateSigOffchain.json | xxd -r -p > bytecode/Erc6492.sol/ValidateSigOffchain.bytecode
- run: mkdir -p bytecode/Erc1271Mock.sol
- run: jq -r .bytecode.object out/Erc1271Mock.sol/Erc1271Mock.json | xxd -r -p > bytecode/Erc1271Mock.sol/Erc1271Mock.bytecode
- run: git diff bytecode
- run: if [ -n "$(git diff bytecode)" ]; then exit 1; fi
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/target
/out
/cache
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,3 @@ alloy = { version = "0.3", features = ["signer-local"] }
alloy-node-bindings = { git = "https://github.com/alloy-rs/alloy.git", rev = "d68a6b7" }
regex = "1"
tokio = { version = "1", features = ["full"] }

[build-dependencies]
alloy-primitives = { version = "0.8.0" }
serde_json = "1"
104 changes: 0 additions & 104 deletions build.rs

This file was deleted.

Binary file added bytecode/Erc1271Mock.sol/Erc1271Mock.bytecode
Binary file not shown.
Binary file not shown.
8 changes: 8 additions & 0 deletions devloop.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
#!/bin/bash
set -e

forge build --contracts=contracts

mkdir -p bytecode/Erc6492.sol
jq -r .bytecode.object out/Erc6492.sol/ValidateSigOffchain.json | xxd -r -p > bytecode/Erc6492.sol/ValidateSigOffchain.bytecode

mkdir -p bytecode/Erc1271Mock.sol
jq -r .bytecode.object out/Erc1271Mock.sol/Erc1271Mock.json | xxd -r -p > bytecode/Erc1271Mock.sol/Erc1271Mock.bytecode

cargo fmt --all
cargo clippy --workspace --all-features --all-targets -- -D warnings
cargo test --workspace --all-features --all-targets
Expand Down
12 changes: 4 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ sol! {
constructor (address _signer, bytes32 _hash, bytes memory _signature);
}
}
const VALIDATE_SIG_OFFCHAIN_BYTECODE: &[u8] = include_bytes!(concat!(
env!("OUT_DIR"),
"/../../../../.foundry/forge/out/Erc6492.sol/ValidateSigOffchain.bytecode"
));
const VALIDATE_SIG_OFFCHAIN_BYTECODE: &[u8] =
include_bytes!("../bytecode/Erc6492.sol/ValidateSigOffchain.bytecode");

#[must_use]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
Expand Down Expand Up @@ -374,10 +372,8 @@ mod test {
);
}

const ERC1271_MOCK_BYTECODE: &[u8] = include_bytes!(concat!(
env!("OUT_DIR"),
"/../../../../.foundry/forge/out/Erc1271Mock.sol/Erc1271Mock.bytecode"
));
const ERC1271_MOCK_BYTECODE: &[u8] =
include_bytes!("../bytecode/Erc1271Mock.sol/Erc1271Mock.bytecode");
const ERC6492_MAGIC_BYTES: [u16; 16] = [
0x6492, 0x6492, 0x6492, 0x6492, 0x6492, 0x6492, 0x6492, 0x6492, 0x6492, 0x6492, 0x6492,
0x6492, 0x6492, 0x6492, 0x6492, 0x6492,
Expand Down

0 comments on commit b8cc060

Please sign in to comment.