Skip to content

Commit 8b99a54

Browse files
committed
use IndirectCall lib for triggering calls
1 parent 833873f commit 8b99a54

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

contracts/crosschain/ERC7802Bridge.sol

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,10 @@ contract ERC7802Bridge is ERC721("ERC7802Bridge", "ERC7802Bridge"), IERC7786Rece
225225
);
226226
require(success && (returndata.length == 0 ? token.code.length == 0 : uint256(bytes32(returndata)) == 1));
227227
} else {
228-
(bool success, ) = getBridgeEndpoint(bridgeId).call(
229-
abi.encodePacked(token, abi.encodeCall(IERC7802.crosschainBurn, (from, amount)))
228+
(bool success, ) = IndirectCall.indirectCall(
229+
token,
230+
abi.encodeCall(IERC7802.crosschainBurn, (from, amount)),
231+
bridgeId
230232
);
231233
require(success);
232234
}
@@ -243,8 +245,10 @@ contract ERC7802Bridge is ERC721("ERC7802Bridge", "ERC7802Bridge"), IERC7786Rece
243245
);
244246
require(success && (returndata.length == 0 ? token.code.length == 0 : uint256(bytes32(returndata)) == 1));
245247
} else {
246-
(bool success, ) = getBridgeEndpoint(bridgeId).call(
247-
abi.encodePacked(token, abi.encodeCall(IERC7802.crosschainMint, (to, amount)))
248+
(bool success, ) = IndirectCall.indirectCall(
249+
token,
250+
abi.encodeCall(IERC7802.crosschainMint, (to, amount)),
251+
bridgeId
248252
);
249253
require(success);
250254
}

0 commit comments

Comments
 (0)