1
1
// SPDX-License-Identifier: MIT
2
2
3
- /// @custom:authors: [@jaybuidl, @shotaronowhere]
3
+ /// @custom:authors: [@jaybuidl, @mani99brar, @ shotaronowhere]
4
4
/// @custom:reviewers: []
5
5
/// @custom:auditors: []
6
6
/// @custom:bounties: []
@@ -12,6 +12,7 @@ import "../canonical/gnosis-chain/IAMB.sol";
12
12
import "../interfaces/outboxes/IVeaOutboxOnL1.sol " ;
13
13
import "../interfaces/updaters/ISequencerDelayUpdatable.sol " ;
14
14
import "../interfaces/tokens/gnosis/IWETH.sol " ;
15
+ import "../interfaces/gateways/IReceiverGateway.sol " ;
15
16
16
17
/// @dev Vea Outbox From Arbitrum to Gnosis.
17
18
/// Note: This contract is deployed on Gnosis.
@@ -299,11 +300,18 @@ contract VeaOutboxArbToGnosis is IVeaOutboxOnL1, ISequencerDelayUpdatable {
299
300
/// @param _proof The merkle proof to prove the message inclusion in the inbox state root.
300
301
/// @param _msgId The zero based index of the message in the inbox.
301
302
/// @param _to The address of the contract on Gnosis to call.
302
- /// @param _message The message encoded in the vea inbox as abi.encodeWithSelector(fnSelector, msg.sender, param1, param2, ...)
303
- function sendMessage (bytes32 [] calldata _proof , uint64 _msgId , address _to , bytes calldata _message ) external {
303
+ /// @param _from The address of the contract on Arbitrum that sent the message.
304
+ /// @param _message The message in the vea inbox
305
+ function sendMessage (
306
+ bytes32 [] calldata _proof ,
307
+ uint64 _msgId ,
308
+ address _to ,
309
+ address _from ,
310
+ bytes calldata _message
311
+ ) external {
304
312
require (_proof.length < 64 , "Proof too long. " );
305
313
306
- bytes32 nodeHash = keccak256 (abi.encodePacked (_msgId, _to, _message));
314
+ bytes32 nodeHash = keccak256 (abi.encodePacked (_msgId, _to, _from, _message));
307
315
308
316
// double hashed leaf
309
317
// avoids second order preimage attacks
@@ -351,8 +359,7 @@ contract VeaOutboxArbToGnosis is IVeaOutboxOnL1, ISequencerDelayUpdatable {
351
359
relayed[relayIndex] = replay | bytes32 (1 << offset);
352
360
353
361
// UNTRUSTED.
354
- (bool success , ) = _to.call (_message);
355
- require (success, "Failed to call contract " );
362
+ IReceiverGateway (_to).receiveMessage (_from, _message);
356
363
357
364
emit MessageRelayed (_msgId);
358
365
}
@@ -421,7 +428,7 @@ contract VeaOutboxArbToGnosis is IVeaOutboxOnL1, ISequencerDelayUpdatable {
421
428
} else {
422
429
address challenger = _claim.challenger;
423
430
_claim.challenger = address (0 );
424
- claimHashes[_epoch] == hashClaim (_claim);
431
+ claimHashes[_epoch] = hashClaim (_claim);
425
432
require (weth.transfer (challenger, deposit), "Failed WETH transfer. " ); // should revert on errors, but we check return value anyways
426
433
}
427
434
}
0 commit comments