Skip chain id validation in AbstractBridgeAdapter
on testnets (#668)
This commit is contained in:
parent
38665ffc86
commit
ec82c42c1b
@ -4,6 +4,9 @@
|
||||
"changes": [
|
||||
{
|
||||
"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 {
|
||||
chainId := chainid()
|
||||
}
|
||||
// Allow testing on Ganache
|
||||
if (chainId != expectedChainId && chainId != 1337) {
|
||||
// Skip chain id validation on Ganache (1337), Anvil (31337), Goerli (5), Mumbai (80001), Base Goerli (84531)
|
||||
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")));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user