@@ -8,14 +8,16 @@ import "./../upgrade/UpgradableECCM.sol";
88import "./../libs/EthCrossChainUtils.sol " ;
99import "./../interface/IEthCrossChainManager.sol " ;
1010import "./../interface/IEthCrossChainData.sol " ;
11+
1112contract EthCrossChainManager is IEthCrossChainManager , UpgradableECCM {
1213 using SafeMath for uint256 ;
13-
14+
1415 event InitGenesisBlockEvent (uint256 height , bytes rawHeader );
1516 event ChangeBookKeeperEvent (uint256 height , bytes rawHeader );
1617 event CrossChainEvent (address indexed sender , bytes txId , address proxyOrAssetContract , uint64 toChainId , bytes toContract , bytes rawdata );
1718 event VerifyHeaderAndExecuteTxEvent (uint64 fromChainID , bytes toContract , bytes crossChainTxHash , bytes fromChainTxHash );
18- constructor (address _eccd ) UpgradableECCM (_eccd) public {}
19+
20+ constructor (address _eccd , uint64 _chainId ) UpgradableECCM (_eccd, _chainId) public {}
1921
2022 /* @notice sync Poly chain genesis block header to smart contrat
2123 * @dev this function can only be called once, nextbookkeeper of rawHeader can't be empty
@@ -157,7 +159,7 @@ contract EthCrossChainManager is IEthCrossChainManager, UpgradableECCM {
157159 require (eccd.markFromChainTxExist (toMerkleValue.fromChainID, Utils.bytesToBytes32 (toMerkleValue.txHash)), "Save crosschain tx exist failed! " );
158160
159161 // Ethereum ChainId is 2, we need to check the transaction is for Ethereum network
160- require (toMerkleValue.makeTxParam.toChainId == uint64 ( 2 ) , "This Tx is not aiming at Ethereum network! " );
162+ require (toMerkleValue.makeTxParam.toChainId == chainId , "This Tx is not aiming at Ethereum network! " );
161163
162164 // Obtain the targeting contract, so that Ethereum cross chain manager contract can trigger the executation of cross chain tx on Ethereum side
163165 address toContract = Utils.bytesToAddress (toMerkleValue.makeTxParam.toContract);
0 commit comments