@@ -6,7 +6,6 @@ import {Role} from "../../../Role.sol";
66
77import {CrossChain} from "./CrossChain.sol " ;
88import {IBridgeAndCall} from "@lxly-bridge-and-call/IBridgeAndCall.sol " ;
9- import {PolygonZkEVMBridgeV2} from "@zkevm-contracts/v2/PolygonZkEVMBridgeV2.sol " ;
109
1110library PolygonAgglayerCrossChainStorage {
1211
@@ -16,7 +15,6 @@ library PolygonAgglayerCrossChainStorage {
1615
1716 struct Data {
1817 address router;
19- address bridge;
2018 }
2119
2220 function data () internal pure returns (Data storage data_ ) {
@@ -28,7 +26,7 @@ library PolygonAgglayerCrossChainStorage {
2826
2927}
3028
31- contract PolygonAgglayerCrossChainERC721 is Module , CrossChain {
29+ contract PolygonAgglayerCrossChain is Module , CrossChain {
3230
3331 /*//////////////////////////////////////////////////////////////
3432 EXTENSION CONFIG
@@ -47,9 +45,8 @@ contract PolygonAgglayerCrossChainERC721 is Module, CrossChain {
4745
4846 /// @dev Called by a Core into an Module during the installation of the Module.
4947 function onInstall (bytes calldata data ) external {
50- ( address router , address bridge ) = abi.decode (data, (address , address ));
48+ address router = abi.decode (data, (address ));
5149 _polygonAgglayerStorage ().router = router;
52- _polygonAgglayerStorage ().bridge = bridge;
5350 }
5451
5552 /// @dev Called by a Core into an Module during the uninstallation of the Module.
@@ -86,28 +83,18 @@ contract PolygonAgglayerCrossChainERC721 is Module, CrossChain {
8683 bytes calldata _extraArgs
8784 ) external payable override {
8885 address router = _polygonAgglayerStorage ().router;
89- (address _fallbackAddress , bool _forceUpdateGlobalExitRoot , address _token , uint256 _amount , bytes memory permitData ) =
90- abi.decode (_extraArgs, (address , bool , address , uint256 , bytes ));
91-
92- if (_token == address (0 ) && _amount == 0 ) {
93- PolygonZkEVMBridgeV2 (router).bridgeMessage (
94- uint32 (_destinationChain), _callAddress, _forceUpdateGlobalExitRoot, _payload
95- );
96- } else if (_payload.length == 0 ) {
97- PolygonZkEVMBridgeV2 (router).bridgeAsset (
98- uint32 (_destinationChain), _callAddress, _amount, _token, _forceUpdateGlobalExitRoot, _permitData)
99- );
100- } else {
101- IBridgeAndCall (router).bridgeAndCall (
102- _token,
103- _amount,
104- uint32 (_destinationChain),
105- _callAddress,
106- _fallbackAddress,
107- _payload,
108- _forceUpdateGlobalExitRoot
109- );
110- }
86+ (address _fallbackAddress , bool _forceUpdateGlobalExitRoot , address _token , uint256 _amount ) =
87+ abi.decode (_extraArgs, (address , bool , address , uint256 ));
88+
89+ IBridgeAndCall (router).bridgeAndCall (
90+ _token,
91+ _amount,
92+ uint32 (_destinationChain),
93+ _callAddress,
94+ _fallbackAddress,
95+ _payload,
96+ _forceUpdateGlobalExitRoot
97+ );
11198
11299 onCrossChainTransactionSent (_destinationChain, _callAddress, _payload, _extraArgs);
113100 }
0 commit comments