@@ -20,6 +20,17 @@ contract Passage {
2020    /// @param amount - The amount of Ether entering the rollup. 
2121    event Enter  (uint256  indexed  rollupChainId , address  indexed  rollupRecipient , uint256  amount );
2222
23+     /// @notice Emitted to send a special transaction to the rollup. 
24+     event Transact  (
25+         uint256  indexed  rollupChainId ,
26+         address  indexed  sender ,
27+         address  indexed  to ,
28+         bytes  data ,
29+         uint256  value ,
30+         uint256  gas ,
31+         uint256  maxFeePerGas 
32+     );
33+ 
2334    /// @notice Emitted when the admin withdraws tokens from the contract. 
2435    event Withdrawal  (address  indexed  token , address  indexed  recipient , uint256  amount );
2536
@@ -45,15 +56,64 @@ contract Passage {
4556    /// @param rollupRecipient - The recipient of the Ether on the rollup. 
4657    /// @custom:emits Enter indicating the amount of Ether to mint on the rollup & its recipient. 
4758    function enter  (uint256  rollupChainId , address  rollupRecipient ) public  payable  {
59+         if  (msg .value  ==  0 ) return ;
4860        emit  Enter (rollupChainId, rollupRecipient, msg .value );
4961    }
5062
5163    /// @notice Allows native Ether to enter the default rollup. 
52-     /// @dev see `enter` above  for docs. 
64+     /// @dev see `enter` for docs. 
5365    function enter  (address  rollupRecipient ) external  payable  {
5466        enter (defaultRollupChainId, rollupRecipient);
5567    }
5668
69+     /// @notice Allows a special transaction to be sent to the rollup with sender == L1 msg.sender. 
70+     /// @dev Transaction is processed after normal rollup block execution. 
71+     /// @dev See `enterTransact` for docs. 
72+     function transact  (
73+         uint256  rollupChainId ,
74+         address  to ,
75+         bytes  calldata  data ,
76+         uint256  value ,
77+         uint256  gas ,
78+         uint256  maxFeePerGas 
79+     ) public  payable  {
80+         enterTransact (rollupChainId, msg .sender , to, data, value, gas, maxFeePerGas);
81+     }
82+ 
83+     /// @dev See `transact` for docs. 
84+     function transact  (address  to , bytes  calldata  data , uint256  value , uint256  gas , uint256  maxFeePerGas )
85+         external 
86+         payable 
87+     {
88+         enterTransact (defaultRollupChainId, msg .sender , to, data, value, gas, maxFeePerGas);
89+     }
90+ 
91+     /// @notice Send Ether on the rollup, send a special transaction to be sent to the rollup with sender == L1 msg.sender. 
92+     /// @dev Enter and Transact are processed after normal rollup block execution. 
93+     /// @dev See `enter` for Enter docs. 
94+     /// @param rollupChainId - The rollup chain to send the transaction to. 
95+     /// @param etherRecipient - The recipient of the ether. 
96+     /// @param to - The address to call on the rollup. 
97+     /// @param data - The data to send to the rollup. 
98+     /// @param value - The amount of Ether to send on the rollup. 
99+     /// @param gas - The gas limit for the transaction. 
100+     /// @param maxFeePerGas - The maximum fee per gas for the transaction (per EIP-1559). 
101+     /// @custom:emits Transact indicating the transaction to mine on the rollup. 
102+     function enterTransact  (
103+         uint256  rollupChainId ,
104+         address  etherRecipient ,
105+         address  to ,
106+         bytes  calldata  data ,
107+         uint256  value ,
108+         uint256  gas ,
109+         uint256  maxFeePerGas 
110+     ) public  payable  {
111+         // if msg.value is attached, Enter 
112+         enter (rollupChainId, etherRecipient);
113+         // emit Transact event 
114+         emit  Transact (rollupChainId, msg .sender , to, data, value, gas, maxFeePerGas);
115+     }
116+ 
57117    /// @notice Allows the admin to withdraw ETH or ERC20 tokens from the contract. 
58118    /// @dev Only the admin can call this function. 
59119    function withdraw  (address  token , address  recipient , uint256  amount ) external  {
0 commit comments