Skip chain id validation in AbstractBridgeAdapter
on testnets (#668)
This commit is contained in:
parent
38665ffc86
commit
ec82c42c1b
@ -4,6 +4,9 @@
|
|||||||
"changes": [
|
"changes": [
|
||||||
{
|
{
|
||||||
"note": "Add KyberElastic mixin for Ethereum, Polygon, Arbitrum, Avalanche"
|
"note": "Add KyberElastic mixin for Ethereum, Polygon, Arbitrum, Avalanche"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"note": "Skip chain id validation in AbstractBridgeAdapter on testnets"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -23,8 +23,14 @@ abstract contract AbstractBridgeAdapter is IBridgeAdapter {
|
|||||||
assembly {
|
assembly {
|
||||||
chainId := chainid()
|
chainId := chainid()
|
||||||
}
|
}
|
||||||
// Allow testing on Ganache
|
// Skip chain id validation on Ganache (1337), Anvil (31337), Goerli (5), Mumbai (80001), Base Goerli (84531)
|
||||||
if (chainId != expectedChainId && chainId != 1337) {
|
bool skipValidation = (chainId == 1337 ||
|
||||||
|
chainId == 31337 ||
|
||||||
|
chainId == 5 ||
|
||||||
|
chainId == 80001 ||
|
||||||
|
chainId == 84531);
|
||||||
|
|
||||||
|
if (chainId != expectedChainId && !skipValidation) {
|
||||||
revert(string(abi.encodePacked(expectedChainName, "BridgeAdapter.constructor: wrong chain ID")));
|
revert(string(abi.encodePacked(expectedChainName, "BridgeAdapter.constructor: wrong chain ID")));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user