Skip to content
This repository was archived by the owner on Mar 26, 2025. It is now read-only.

Commit af8027a

Browse files
authored
feat: Adds bundle helper ABI (#66)
### 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
1 parent 4d1074f commit af8027a

File tree

3 files changed

+199
-4
lines changed

3 files changed

+199
-4
lines changed

abi/BundleHelper.json

Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
1+
[
2+
{
3+
"type": "constructor",
4+
"inputs": [
5+
{
6+
"name": "_zenith",
7+
"type": "address",
8+
"internalType": "address"
9+
},
10+
{
11+
"name": "_orders",
12+
"type": "address",
13+
"internalType": "address"
14+
}
15+
],
16+
"stateMutability": "nonpayable"
17+
},
18+
{
19+
"type": "function",
20+
"name": "orders",
21+
"inputs": [],
22+
"outputs": [
23+
{
24+
"name": "",
25+
"type": "address",
26+
"internalType": "contract HostOrders"
27+
}
28+
],
29+
"stateMutability": "view"
30+
},
31+
{
32+
"type": "function",
33+
"name": "submit",
34+
"inputs": [
35+
{
36+
"name": "fills",
37+
"type": "tuple[]",
38+
"internalType": "struct BundleHelper.FillPermit2[]",
39+
"components": [
40+
{
41+
"name": "outputs",
42+
"type": "tuple[]",
43+
"internalType": "struct IOrders.Output[]",
44+
"components": [
45+
{
46+
"name": "token",
47+
"type": "address",
48+
"internalType": "address"
49+
},
50+
{
51+
"name": "amount",
52+
"type": "uint256",
53+
"internalType": "uint256"
54+
},
55+
{
56+
"name": "recipient",
57+
"type": "address",
58+
"internalType": "address"
59+
},
60+
{
61+
"name": "chainId",
62+
"type": "uint32",
63+
"internalType": "uint32"
64+
}
65+
]
66+
},
67+
{
68+
"name": "permit2",
69+
"type": "tuple",
70+
"internalType": "struct UsesPermit2.Permit2Batch",
71+
"components": [
72+
{
73+
"name": "permit",
74+
"type": "tuple",
75+
"internalType": "struct ISignatureTransfer.PermitBatchTransferFrom",
76+
"components": [
77+
{
78+
"name": "permitted",
79+
"type": "tuple[]",
80+
"internalType": "struct ISignatureTransfer.TokenPermissions[]",
81+
"components": [
82+
{
83+
"name": "token",
84+
"type": "address",
85+
"internalType": "address"
86+
},
87+
{
88+
"name": "amount",
89+
"type": "uint256",
90+
"internalType": "uint256"
91+
}
92+
]
93+
},
94+
{
95+
"name": "nonce",
96+
"type": "uint256",
97+
"internalType": "uint256"
98+
},
99+
{
100+
"name": "deadline",
101+
"type": "uint256",
102+
"internalType": "uint256"
103+
}
104+
]
105+
},
106+
{
107+
"name": "owner",
108+
"type": "address",
109+
"internalType": "address"
110+
},
111+
{
112+
"name": "signature",
113+
"type": "bytes",
114+
"internalType": "bytes"
115+
}
116+
]
117+
}
118+
]
119+
},
120+
{
121+
"name": "header",
122+
"type": "tuple",
123+
"internalType": "struct Zenith.BlockHeader",
124+
"components": [
125+
{
126+
"name": "rollupChainId",
127+
"type": "uint256",
128+
"internalType": "uint256"
129+
},
130+
{
131+
"name": "hostBlockNumber",
132+
"type": "uint256",
133+
"internalType": "uint256"
134+
},
135+
{
136+
"name": "gasLimit",
137+
"type": "uint256",
138+
"internalType": "uint256"
139+
},
140+
{
141+
"name": "rewardAddress",
142+
"type": "address",
143+
"internalType": "address"
144+
},
145+
{
146+
"name": "blockDataHash",
147+
"type": "bytes32",
148+
"internalType": "bytes32"
149+
}
150+
]
151+
},
152+
{
153+
"name": "v",
154+
"type": "uint8",
155+
"internalType": "uint8"
156+
},
157+
{
158+
"name": "r",
159+
"type": "bytes32",
160+
"internalType": "bytes32"
161+
},
162+
{
163+
"name": "s",
164+
"type": "bytes32",
165+
"internalType": "bytes32"
166+
}
167+
],
168+
"outputs": [],
169+
"stateMutability": "nonpayable"
170+
},
171+
{
172+
"type": "function",
173+
"name": "zenith",
174+
"inputs": [],
175+
"outputs": [
176+
{
177+
"name": "",
178+
"type": "address",
179+
"internalType": "contract Zenith"
180+
}
181+
],
182+
"stateMutability": "view"
183+
}
184+
]

src/bindings.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,6 @@ pub mod HostOrders {
412412
pub use super::orders::Orders::OrdersInstance as HostOrdersInstance;
413413
}
414414

415-
// contra
416-
417415
/// Contract Bindings for the Passage contract.
418416
#[allow(non_snake_case)]
419417
pub mod Passage {
@@ -425,11 +423,24 @@ pub mod Passage {
425423

426424
pub use transactor::Transactor;
427425

428-
/// Contrract Bindings for the RollupPassage contract.
426+
/// Contract Bindings for the RollupPassage contract.
429427
#[allow(non_snake_case)]
430428
pub mod RollupPassage {
431429
pub use super::rollup_passage::RollupPassage::*;
432430

433431
pub use super::rollup_passage::ISignatureTransfer::*;
434432
pub use super::rollup_passage::UsesPermit2::*;
435433
}
434+
435+
pub mod bundle_helper {
436+
//! Bundle Helper contract bindings
437+
alloy_sol_types::sol!(
438+
#[derive(Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
439+
#[sol(rpc)]
440+
BundleHelper,
441+
"abi/BundleHelper.json"
442+
);
443+
444+
pub use super::bundle_helper::BundleHelper::{new, submitCall, FillPermit2};
445+
pub use super::bundle_helper::Zenith::BlockHeader;
446+
}

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
mod bindings;
1515
pub use bindings::{
16-
mintCall, HostOrders, Passage, RollupOrders, RollupPassage, Transactor, Zenith,
16+
bundle_helper, mintCall, HostOrders, Passage, RollupOrders, RollupPassage, Transactor, Zenith,
1717
};
1818

1919
mod block;

0 commit comments

Comments
 (0)