22pragma solidity 0.8.24 ;
33
44import {IEntryPoint} from "account-abstraction/interfaces/IEntryPoint.sol " ;
5- import {Address} from "openzeppelin-contracts/contracts/utils/Address.sol " ;
65import {CAIP10} from "openzeppelin-contracts/contracts/utils/CAIP10.sol " ;
76import {CAIP2} from "openzeppelin-contracts/contracts/utils/CAIP2.sol " ;
87import {Strings} from "openzeppelin-contracts/contracts/utils/Strings.sol " ;
@@ -18,7 +17,6 @@ import {Paymaster} from "./Paymaster.sol";
1817/// @notice An inbox contract within RIP-7755. This contract's sole purpose is to route requested transactions on
1918/// destination chains and store record of their fulfillment.
2019contract RIP7755Inbox is ERC7786Base , Paymaster {
21- using Address for address payable ;
2220 using Strings for string ;
2321
2422 struct MainStorage {
@@ -152,7 +150,7 @@ contract RIP7755Inbox is ERC7786Base, Paymaster {
152150 uint256 valueSent;
153151
154152 for (uint256 i; i < messages.length ; i++ ) {
155- address payable to = payable ( messages[i].receiver.parseAddress () );
153+ address to = messages[i].receiver.parseAddress ();
156154 uint256 value = _locateAttributeValue (messages[i].attributes);
157155 _call (to, messages[i].payload, value);
158156
@@ -166,11 +164,16 @@ contract RIP7755Inbox is ERC7786Base, Paymaster {
166164 }
167165 }
168166
169- function _call (address payable to , bytes memory data , uint256 value ) private {
170- if (data.length == 0 ) {
171- to.sendValue (value);
172- } else {
173- to.functionCallWithValue (data, value);
167+ function _call (address to , bytes memory data , uint256 value ) private {
168+ bytes memory result;
169+ /// @solidity memory-safe-assembly
170+ assembly {
171+ result := mload (0x40 )
172+ if iszero (call (gas (), to, value, add (data, 0x20 ), mload (data), codesize (), 0x00 )) {
173+ // Bubble up the revert if the call reverts.
174+ returndatacopy (result, 0x00 , returndatasize ())
175+ revert (result, returndatasize ())
176+ }
174177 }
175178 }
176179
0 commit comments