@@ -21,6 +21,18 @@ contract Passage {
21
21
/// @param amount - The amount of the token entering the rollup.
22
22
event Enter (uint256 indexed rollupChainId , address indexed token , address indexed rollupRecipient , uint256 amount );
23
23
24
+ /// @notice Emitted to send a special transaction to the rollup.
25
+ event Transact (
26
+ uint256 indexed rollupChainId ,
27
+ address indexed sender ,
28
+ address indexed to ,
29
+ bytes data ,
30
+ uint256 value ,
31
+ uint256 gas ,
32
+ uint256 maxPrioFee ,
33
+ uint256 maxBaseFee
34
+ );
35
+
24
36
/// @notice Emitted when the admin withdraws tokens from the contract.
25
37
event Withdrawal (address indexed token , address indexed recipient , uint256 amount );
26
38
@@ -56,6 +68,40 @@ contract Passage {
56
68
emit Enter (rollupChainId, address (0 ), rollupRecipient, msg .value );
57
69
}
58
70
71
+ /// @notice Allows a special transaction to be sent to the rollup with sender == L1 msg.sender.
72
+ /// @dev Transaction is processed after normal rollup block execution.
73
+ /// @param rollupChainId - The rollup chain to send the transaction to.
74
+ /// @param to - The address to call on the rollup.
75
+ /// @param data - The data to send to the rollup.
76
+ /// @param value - The amount of Ether to send on the rollup.
77
+ /// @param gas - The gas limit for the transaction.
78
+ /// @param maxPrioFee - The maximum priority fee for the transaction.
79
+ /// @param maxBaseFee - The maximum base fee for the transaction.
80
+ /// @custom:emits Transact indicating the transaction to mine on the rollup.
81
+ function transact (
82
+ uint256 rollupChainId ,
83
+ address to ,
84
+ bytes calldata data ,
85
+ uint256 value ,
86
+ uint256 gas ,
87
+ uint256 maxPrioFee ,
88
+ uint256 maxBaseFee
89
+ ) public {
90
+ emit Transact (rollupChainId, msg .sender , to, data, value, gas, maxPrioFee, maxBaseFee);
91
+ }
92
+
93
+ /// @dev See `transact` above for docs.
94
+ function transact (
95
+ address to ,
96
+ bytes calldata data ,
97
+ uint256 value ,
98
+ uint256 gas ,
99
+ uint256 maxPrioFee ,
100
+ uint256 maxBaseFee
101
+ ) external {
102
+ transact (defaultRollupChainId, to, data, value, gas, maxPrioFee, maxBaseFee);
103
+ }
104
+
59
105
/// @notice Allows the admin to withdraw ETH or ERC20 tokens from the contract.
60
106
/// @dev Only the admin can call this function.
61
107
function withdraw (address token , address recipient , uint256 amount ) external {
0 commit comments