Skip to content

Commit

Permalink
feat: Adds bundle helper ABI (#66)
Browse files Browse the repository at this point in the history
### TL;DR

Added BundleHelper contract ABI and bindings to support bundle submission.

### Changes

- Added new `BundleHelper.json` ABI file with contract interface definitions
- Integrated BundleHelper module into the bindings system
- Added BundleHelper to the public exports in lib.rs
- Fixed a typo in contract bindings documentation comment
  • Loading branch information
dylanlott authored Dec 19, 2024
1 parent 4d1074f commit af8027a
Show file tree
Hide file tree
Showing 3 changed files with 199 additions and 4 deletions.
184 changes: 184 additions & 0 deletions abi/BundleHelper.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
[
{
"type": "constructor",
"inputs": [
{
"name": "_zenith",
"type": "address",
"internalType": "address"
},
{
"name": "_orders",
"type": "address",
"internalType": "address"
}
],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "orders",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "contract HostOrders"
}
],
"stateMutability": "view"
},
{
"type": "function",
"name": "submit",
"inputs": [
{
"name": "fills",
"type": "tuple[]",
"internalType": "struct BundleHelper.FillPermit2[]",
"components": [
{
"name": "outputs",
"type": "tuple[]",
"internalType": "struct IOrders.Output[]",
"components": [
{
"name": "token",
"type": "address",
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "recipient",
"type": "address",
"internalType": "address"
},
{
"name": "chainId",
"type": "uint32",
"internalType": "uint32"
}
]
},
{
"name": "permit2",
"type": "tuple",
"internalType": "struct UsesPermit2.Permit2Batch",
"components": [
{
"name": "permit",
"type": "tuple",
"internalType": "struct ISignatureTransfer.PermitBatchTransferFrom",
"components": [
{
"name": "permitted",
"type": "tuple[]",
"internalType": "struct ISignatureTransfer.TokenPermissions[]",
"components": [
{
"name": "token",
"type": "address",
"internalType": "address"
},
{
"name": "amount",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"name": "nonce",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "deadline",
"type": "uint256",
"internalType": "uint256"
}
]
},
{
"name": "owner",
"type": "address",
"internalType": "address"
},
{
"name": "signature",
"type": "bytes",
"internalType": "bytes"
}
]
}
]
},
{
"name": "header",
"type": "tuple",
"internalType": "struct Zenith.BlockHeader",
"components": [
{
"name": "rollupChainId",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "hostBlockNumber",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "gasLimit",
"type": "uint256",
"internalType": "uint256"
},
{
"name": "rewardAddress",
"type": "address",
"internalType": "address"
},
{
"name": "blockDataHash",
"type": "bytes32",
"internalType": "bytes32"
}
]
},
{
"name": "v",
"type": "uint8",
"internalType": "uint8"
},
{
"name": "r",
"type": "bytes32",
"internalType": "bytes32"
},
{
"name": "s",
"type": "bytes32",
"internalType": "bytes32"
}
],
"outputs": [],
"stateMutability": "nonpayable"
},
{
"type": "function",
"name": "zenith",
"inputs": [],
"outputs": [
{
"name": "",
"type": "address",
"internalType": "contract Zenith"
}
],
"stateMutability": "view"
}
]
17 changes: 14 additions & 3 deletions src/bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,6 @@ pub mod HostOrders {
pub use super::orders::Orders::OrdersInstance as HostOrdersInstance;
}

// contra

/// Contract Bindings for the Passage contract.
#[allow(non_snake_case)]
pub mod Passage {
Expand All @@ -425,11 +423,24 @@ pub mod Passage {

pub use transactor::Transactor;

/// Contrract Bindings for the RollupPassage contract.
/// Contract Bindings for the RollupPassage contract.
#[allow(non_snake_case)]
pub mod RollupPassage {
pub use super::rollup_passage::RollupPassage::*;

pub use super::rollup_passage::ISignatureTransfer::*;
pub use super::rollup_passage::UsesPermit2::*;
}

pub mod bundle_helper {
//! Bundle Helper contract bindings
alloy_sol_types::sol!(
#[derive(Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
#[sol(rpc)]
BundleHelper,
"abi/BundleHelper.json"
);

pub use super::bundle_helper::BundleHelper::{new, submitCall, FillPermit2};
pub use super::bundle_helper::Zenith::BlockHeader;
}
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

mod bindings;
pub use bindings::{
mintCall, HostOrders, Passage, RollupOrders, RollupPassage, Transactor, Zenith,
bundle_helper, mintCall, HostOrders, Passage, RollupOrders, RollupPassage, Transactor, Zenith,
};

mod block;
Expand Down

0 comments on commit af8027a

Please sign in to comment.