Skip to content

Commit

Permalink
Evm: Gas optimizations (polytope-labs#272)
Browse files Browse the repository at this point in the history
  • Loading branch information
seunlanlege authored Jul 27, 2024
1 parent 3ffbbdb commit ccc6d69
Show file tree
Hide file tree
Showing 25 changed files with 182 additions and 402 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
[submodule "evm/lib/forge-std"]
path = evm/lib/forge-std
url = git@github.com:foundry-rs/forge-std
[submodule "evm/lib/ERC6160"]
path = evm/lib/ERC6160
url = https://github.com/polytope-labs/ERC6160
[submodule "evm/lib/solidity-stringutils"]
path = evm/lib/solidity-stringutils
url = https://github.com/Arachnid/solidity-stringutils
274 changes: 71 additions & 203 deletions evm/abi/src/generated/beefy.rs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions evm/abi/src/generated/erc20.rs

Large diffs are not rendered by default.

79 changes: 0 additions & 79 deletions evm/abi/src/generated/evm_host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1078,51 +1078,6 @@ pub mod evm_host {
},
],
),
(
::std::borrow::ToOwned::to_owned("setHostParamsAdmin"),
::std::vec![
::ethers::core::abi::ethabi::Function {
name: ::std::borrow::ToOwned::to_owned("setHostParamsAdmin"),
inputs: ::std::vec![
::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("params"),
kind: ::ethers::core::abi::ethabi::ParamType::Tuple(
::std::vec![
::ethers::core::abi::ethabi::ParamType::Uint(256usize),
::ethers::core::abi::ethabi::ParamType::Uint(256usize),
::ethers::core::abi::ethabi::ParamType::Uint(256usize),
::ethers::core::abi::ethabi::ParamType::Address,
::ethers::core::abi::ethabi::ParamType::Address,
::ethers::core::abi::ethabi::ParamType::Address,
::ethers::core::abi::ethabi::ParamType::Address,
::ethers::core::abi::ethabi::ParamType::Address,
::ethers::core::abi::ethabi::ParamType::Uint(256usize),
::ethers::core::abi::ethabi::ParamType::Uint(256usize),
::ethers::core::abi::ethabi::ParamType::Address,
::ethers::core::abi::ethabi::ParamType::Array(
::std::boxed::Box::new(
::ethers::core::abi::ethabi::ParamType::Uint(256usize),
),
),
::ethers::core::abi::ethabi::ParamType::Array(
::std::boxed::Box::new(
::ethers::core::abi::ethabi::ParamType::Address,
),
),
::ethers::core::abi::ethabi::ParamType::Bytes,
],
),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("struct HostParams"),
),
},
],
outputs: ::std::vec![],
constant: ::core::option::Option::None,
state_mutability: ::ethers::core::abi::ethabi::StateMutability::NonPayable,
},
],
),
(
::std::borrow::ToOwned::to_owned("stateCommitmentFee"),
::std::vec![
Expand Down Expand Up @@ -2625,15 +2580,6 @@ pub mod evm_host {
.method_hash([106, 200, 139, 173], new_state)
.expect("method not found (this should never happen)")
}
///Calls the contract's `setHostParamsAdmin` (0x928af6d3) function
pub fn set_host_params_admin(
&self,
params: HostParams,
) -> ::ethers::contract::builders::ContractCall<M, ()> {
self.0
.method_hash([146, 138, 246, 211], (params,))
.expect("method not found (this should never happen)")
}
///Calls the contract's `stateCommitmentFee` (0xb5c8a08e) function
pub fn state_commitment_fee(
&self,
Expand Down Expand Up @@ -4479,17 +4425,6 @@ pub mod evm_host {
pub struct SetFrozenStateCall {
pub new_state: u8,
}
///Container type for all input parameters for the `setHostParamsAdmin` function with signature
/// `setHostParamsAdmin((uint256,uint256,uint256,address,address,address,address,address,
/// uint256,uint256,address,uint256[],address[],bytes))` and selector `0x928af6d3`
#[derive(Clone, ::ethers::contract::EthCall, ::ethers::contract::EthDisplay)]
#[ethcall(
name = "setHostParamsAdmin",
abi = "setHostParamsAdmin((uint256,uint256,uint256,address,address,address,address,address,uint256,uint256,address,uint256[],address[],bytes))"
)]
pub struct SetHostParamsAdminCall {
pub params: HostParams,
}
///Container type for all input parameters for the `stateCommitmentFee` function with signature
/// `stateCommitmentFee()` and selector `0xb5c8a08e`
#[derive(
Expand Down Expand Up @@ -4732,7 +4667,6 @@ pub mod evm_host {
ResponseReceipts(ResponseReceiptsCall),
SetConsensusState(SetConsensusStateCall),
SetFrozenState(SetFrozenStateCall),
SetHostParamsAdmin(SetHostParamsAdminCall),
StateCommitmentFee(StateCommitmentFeeCall),
StateMachineCommitment(StateMachineCommitmentCall),
StateMachineCommitmentUpdateTime(StateMachineCommitmentUpdateTimeCall),
Expand Down Expand Up @@ -4892,11 +4826,6 @@ pub mod evm_host {
{
return Ok(Self::SetFrozenState(decoded));
}
if let Ok(decoded) =
<SetHostParamsAdminCall as ::ethers::core::abi::AbiDecode>::decode(data)
{
return Ok(Self::SetHostParamsAdmin(decoded));
}
if let Ok(decoded) =
<StateCommitmentFeeCall as ::ethers::core::abi::AbiDecode>::decode(data)
{
Expand Down Expand Up @@ -5003,8 +4932,6 @@ pub mod evm_host {
Self::ResponseReceipts(element) => ::ethers::core::abi::AbiEncode::encode(element),
Self::SetConsensusState(element) => ::ethers::core::abi::AbiEncode::encode(element),
Self::SetFrozenState(element) => ::ethers::core::abi::AbiEncode::encode(element),
Self::SetHostParamsAdmin(element) =>
::ethers::core::abi::AbiEncode::encode(element),
Self::StateCommitmentFee(element) =>
::ethers::core::abi::AbiEncode::encode(element),
Self::StateMachineCommitment(element) =>
Expand Down Expand Up @@ -5065,7 +4992,6 @@ pub mod evm_host {
Self::ResponseReceipts(element) => ::core::fmt::Display::fmt(element, f),
Self::SetConsensusState(element) => ::core::fmt::Display::fmt(element, f),
Self::SetFrozenState(element) => ::core::fmt::Display::fmt(element, f),
Self::SetHostParamsAdmin(element) => ::core::fmt::Display::fmt(element, f),
Self::StateCommitmentFee(element) => ::core::fmt::Display::fmt(element, f),
Self::StateMachineCommitment(element) => ::core::fmt::Display::fmt(element, f),
Self::StateMachineCommitmentUpdateTime(element) =>
Expand Down Expand Up @@ -5248,11 +5174,6 @@ pub mod evm_host {
Self::SetFrozenState(value)
}
}
impl ::core::convert::From<SetHostParamsAdminCall> for EvmHostCalls {
fn from(value: SetHostParamsAdminCall) -> Self {
Self::SetHostParamsAdmin(value)
}
}
impl ::core::convert::From<StateCommitmentFeeCall> for EvmHostCalls {
fn from(value: StateCommitmentFeeCall) -> Self {
Self::StateCommitmentFee(value)
Expand Down
Loading

0 comments on commit ccc6d69

Please sign in to comment.