Skip to content

Commit

Permalink
fix network config
Browse files Browse the repository at this point in the history
  • Loading branch information
zkJoaquin committed Feb 2, 2024
1 parent 005a806 commit 9e3e7ab
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions contracts/gateway/zkpolygon/ZkPolygonL1Gateway.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ contract ZkPolygonL1Gateway is IZkPolygonGateway, L1BaseGateway, BaseGateway {
/// @notice ZkPolygon message service on local chain
IZkPolygon public messageService;

uint32 public constant ETH_NETWORK_ID = 0;
uint32 public constant ETH_NETWORK_ID = 1;
// Default to true
bool public constant FORCE_UPDATE_GLOBAL_EXIT_ROOT = true;

Expand All @@ -25,9 +25,7 @@ contract ZkPolygonL1Gateway is IZkPolygonGateway, L1BaseGateway, BaseGateway {
mapping(uint256 => mapping(uint256 => bool)) public isMessageFinalized;

/// @dev Receive eth from ZkPolygon canonical bridge
receive() external payable {
}

receive() external payable {}

function initialize(IArbitrator _arbitrator, IZkPolygon _messageService) external initializer {
__L1BaseGateway_init(_arbitrator);
Expand All @@ -39,15 +37,17 @@ contract ZkPolygonL1Gateway is IZkPolygonGateway, L1BaseGateway, BaseGateway {
function sendMessage(uint256 _value, bytes memory _callData, bytes memory) external payable onlyArbitrator {
bytes memory executeData = abi.encodeCall(IZkPolygonGateway.claimMessageCallback, (_value, _callData));
messageService.bridgeMessage{value: msg.value}(
ETH_NETWORK_ID,
remoteGateway,
FORCE_UPDATE_GLOBAL_EXIT_ROOT,
executeData
ETH_NETWORK_ID, remoteGateway, FORCE_UPDATE_GLOBAL_EXIT_ROOT, executeData
);
}

function claimMessageCallback(uint256 _value, bytes memory _callData) external payable override onlyMessageService {
function claimMessageCallback(uint256 _value, bytes memory _callData)
external
payable
override
onlyMessageService
{
require(msg.value == _value, "Invalid value from canonical message service");
arbitrator.receiveMessage{value: _value}(_value, _callData);
}
}
}

0 comments on commit 9e3e7ab

Please sign in to comment.