Skip to content

Commit

Permalink
Remove foundry patch (#2736)
Browse files Browse the repository at this point in the history
* Remove foundry patch

The patch in alloy is now included in foundry.

- Create a separate dev shell with the legacy version of foundry that
  we need to generate ethers bindings.
- Switch to foundry.nix overlay because the nixpkgs version is likely to
  lag a lot because foundry doesn't properly version their code.
- Enable the optimizer. This used to be the default but this was changed
  in foundry recently.

* CI: nuke contracts rust cache if nix files change

I think this sometimes leads to weird compilation errors.

* use glob

* revert change to use openssl 3.0 in dev env

This causes some issues when linking against libcurl which is needed by
some of our rust code. So we need to do something smarter.

This will break the script to build docker containers locally with nix
but shouldn't break anything else.

We could use openssl_3 in the nix dev env everywhere but this would lead
to a huge number of nix derivations missing the upstream binary cache
and therefore would be really annoying.

I think this will unblock the CI and we can figure out what to do from
here.

* foundry: allow internal reverts

This is described here:

    https://book.getfoundry.sh/cheatcodes/expect-revert#error
  • Loading branch information
sveitser authored Mar 7, 2025
1 parent c4cca68 commit ccde27c
Show file tree
Hide file tree
Showing 17 changed files with 807 additions and 54 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
- uses: Swatinem/rust-cache@v2
name: Enable Rust Caching
with:
prefix-key: v2-rust
prefix-key: v2-rust-${{ hashFiles('flake.*') }}

- name: Check toolchain versions
run: nix develop --accept-flake-config -c ./scripts/show-toolchain-versions
Expand Down
9 changes: 9 additions & 0 deletions contract-bindings-alloy/src/erc1967proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ pub mod ERC1967Proxy {
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct AddressEmptyCode {
#[allow(missing_docs)]
pub target: alloy::sol_types::private::Address,
}
#[allow(
Expand Down Expand Up @@ -189,6 +190,7 @@ pub mod ERC1967Proxy {
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct ERC1967InvalidImplementation {
#[allow(missing_docs)]
pub implementation: alloy::sol_types::private::Address,
}
#[allow(
Expand Down Expand Up @@ -479,7 +481,9 @@ pub mod ERC1967Proxy {
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct constructorCall {
#[allow(missing_docs)]
pub implementation: alloy::sol_types::private::Address,
#[allow(missing_docs)]
pub _data: alloy::sol_types::private::Bytes,
}
const _: () = {
Expand Down Expand Up @@ -550,9 +554,13 @@ pub mod ERC1967Proxy {
};
///Container for all the [`ERC1967Proxy`](self) custom errors.
pub enum ERC1967ProxyErrors {
#[allow(missing_docs)]
AddressEmptyCode(AddressEmptyCode),
#[allow(missing_docs)]
ERC1967InvalidImplementation(ERC1967InvalidImplementation),
#[allow(missing_docs)]
ERC1967NonPayable(ERC1967NonPayable),
#[allow(missing_docs)]
FailedInnerCall(FailedInnerCall),
}
#[automatically_derived]
Expand Down Expand Up @@ -710,6 +718,7 @@ pub mod ERC1967Proxy {
}
///Container for all the [`ERC1967Proxy`](self) events.
pub enum ERC1967ProxyEvents {
#[allow(missing_docs)]
Upgraded(Upgraded),
}
#[automatically_derived]
Expand Down
53 changes: 53 additions & 0 deletions contract-bindings-alloy/src/feecontract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ pub mod FeeContract {
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct AddressEmptyCode {
#[allow(missing_docs)]
pub target: alloy::sol_types::private::Address,
}
#[allow(
Expand Down Expand Up @@ -660,6 +661,7 @@ pub mod FeeContract {
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct ERC1967InvalidImplementation {
#[allow(missing_docs)]
pub implementation: alloy::sol_types::private::Address,
}
#[allow(
Expand Down Expand Up @@ -1148,6 +1150,7 @@ pub mod FeeContract {
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct OwnableInvalidOwner {
#[allow(missing_docs)]
pub owner: alloy::sol_types::private::Address,
}
#[allow(
Expand Down Expand Up @@ -1214,6 +1217,7 @@ pub mod FeeContract {
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct OwnableUnauthorizedAccount {
#[allow(missing_docs)]
pub account: alloy::sol_types::private::Address,
}
#[allow(
Expand Down Expand Up @@ -1340,6 +1344,7 @@ pub mod FeeContract {
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct UUPSUnsupportedProxiableUUID {
#[allow(missing_docs)]
pub slot: alloy::sol_types::private::FixedBytes<32>,
}
#[allow(
Expand Down Expand Up @@ -2095,6 +2100,7 @@ pub mod FeeContract {
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct UPGRADE_INTERFACE_VERSIONReturn {
#[allow(missing_docs)]
pub _0: alloy::sol_types::private::String,
}
#[allow(
Expand Down Expand Up @@ -2201,12 +2207,14 @@ pub mod FeeContract {
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct balancesCall {
#[allow(missing_docs)]
pub user: alloy::sol_types::private::Address,
}
///Container type for the return parameters of the [`balances(address)`](balancesCall) function.
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct balancesReturn {
#[allow(missing_docs)]
pub amount: alloy::sol_types::private::primitives::aliases::U256,
}
#[allow(
Expand Down Expand Up @@ -2317,6 +2325,7 @@ pub mod FeeContract {
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct depositCall {
#[allow(missing_docs)]
pub user: alloy::sol_types::private::Address,
}
///Container type for the return parameters of the [`deposit(address)`](depositCall) function.
Expand Down Expand Up @@ -2435,8 +2444,11 @@ pub mod FeeContract {
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct getVersionReturn {
#[allow(missing_docs)]
pub majorVersion: u8,
#[allow(missing_docs)]
pub minorVersion: u8,
#[allow(missing_docs)]
pub patchVersion: u8,
}
#[allow(
Expand Down Expand Up @@ -2555,6 +2567,7 @@ pub mod FeeContract {
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct initializeCall {
#[allow(missing_docs)]
pub multisig: alloy::sol_types::private::Address,
}
///Container type for the return parameters of the [`initialize(address)`](initializeCall) function.
Expand Down Expand Up @@ -2673,6 +2686,7 @@ pub mod FeeContract {
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct maxDepositAmountReturn {
#[allow(missing_docs)]
pub _0: alloy::sol_types::private::primitives::aliases::U256,
}
#[allow(
Expand Down Expand Up @@ -2783,6 +2797,7 @@ pub mod FeeContract {
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct minDepositAmountReturn {
#[allow(missing_docs)]
pub _0: alloy::sol_types::private::primitives::aliases::U256,
}
#[allow(
Expand Down Expand Up @@ -2893,6 +2908,7 @@ pub mod FeeContract {
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct ownerReturn {
#[allow(missing_docs)]
pub _0: alloy::sol_types::private::Address,
}
#[allow(
Expand Down Expand Up @@ -3003,6 +3019,7 @@ pub mod FeeContract {
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct proxiableUUIDReturn {
#[allow(missing_docs)]
pub _0: alloy::sol_types::private::FixedBytes<32>,
}
#[allow(
Expand Down Expand Up @@ -3217,6 +3234,7 @@ pub mod FeeContract {
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct transferOwnershipCall {
#[allow(missing_docs)]
pub newOwner: alloy::sol_types::private::Address,
}
///Container type for the return parameters of the [`transferOwnership(address)`](transferOwnershipCall) function.
Expand Down Expand Up @@ -3331,7 +3349,9 @@ pub mod FeeContract {
#[allow(non_camel_case_types, non_snake_case, clippy::pub_underscore_fields)]
#[derive(Clone)]
pub struct upgradeToAndCallCall {
#[allow(missing_docs)]
pub newImplementation: alloy::sol_types::private::Address,
#[allow(missing_docs)]
pub data: alloy::sol_types::private::Bytes,
}
///Container type for the return parameters of the [`upgradeToAndCall(address,bytes)`](upgradeToAndCallCall) function.
Expand Down Expand Up @@ -3456,17 +3476,29 @@ pub mod FeeContract {
};
///Container for all the [`FeeContract`](self) function calls.
pub enum FeeContractCalls {
#[allow(missing_docs)]
UPGRADE_INTERFACE_VERSION(UPGRADE_INTERFACE_VERSIONCall),
#[allow(missing_docs)]
balances(balancesCall),
#[allow(missing_docs)]
deposit(depositCall),
#[allow(missing_docs)]
getVersion(getVersionCall),
#[allow(missing_docs)]
initialize(initializeCall),
#[allow(missing_docs)]
maxDepositAmount(maxDepositAmountCall),
#[allow(missing_docs)]
minDepositAmount(minDepositAmountCall),
#[allow(missing_docs)]
owner(ownerCall),
#[allow(missing_docs)]
proxiableUUID(proxiableUUIDCall),
#[allow(missing_docs)]
renounceOwnership(renounceOwnershipCall),
#[allow(missing_docs)]
transferOwnership(transferOwnershipCall),
#[allow(missing_docs)]
upgradeToAndCall(upgradeToAndCallCall),
}
#[automatically_derived]
Expand Down Expand Up @@ -3784,20 +3816,35 @@ pub mod FeeContract {
}
///Container for all the [`FeeContract`](self) custom errors.
pub enum FeeContractErrors {
#[allow(missing_docs)]
AddressEmptyCode(AddressEmptyCode),
#[allow(missing_docs)]
DepositTooLarge(DepositTooLarge),
#[allow(missing_docs)]
DepositTooSmall(DepositTooSmall),
#[allow(missing_docs)]
ERC1967InvalidImplementation(ERC1967InvalidImplementation),
#[allow(missing_docs)]
ERC1967NonPayable(ERC1967NonPayable),
#[allow(missing_docs)]
FailedInnerCall(FailedInnerCall),
#[allow(missing_docs)]
FunctionDoesNotExist(FunctionDoesNotExist),
#[allow(missing_docs)]
InvalidInitialization(InvalidInitialization),
#[allow(missing_docs)]
InvalidUserAddress(InvalidUserAddress),
#[allow(missing_docs)]
NoFunctionCalled(NoFunctionCalled),
#[allow(missing_docs)]
NotInitializing(NotInitializing),
#[allow(missing_docs)]
OwnableInvalidOwner(OwnableInvalidOwner),
#[allow(missing_docs)]
OwnableUnauthorizedAccount(OwnableUnauthorizedAccount),
#[allow(missing_docs)]
UUPSUnauthorizedCallContext(UUPSUnauthorizedCallContext),
#[allow(missing_docs)]
UUPSUnsupportedProxiableUUID(UUPSUnsupportedProxiableUUID),
}
#[automatically_derived]
Expand Down Expand Up @@ -4209,11 +4256,17 @@ pub mod FeeContract {
}
///Container for all the [`FeeContract`](self) events.
pub enum FeeContractEvents {
#[allow(missing_docs)]
Deposit(Deposit),
#[allow(missing_docs)]
Initialized(Initialized),
#[allow(missing_docs)]
Log(Log),
#[allow(missing_docs)]
OwnershipTransferred(OwnershipTransferred),
#[allow(missing_docs)]
Upgrade(Upgrade),
#[allow(missing_docs)]
Upgraded(Upgraded),
}
#[automatically_derived]
Expand Down
Loading

0 comments on commit ccde27c

Please sign in to comment.