Commit 8323407f authored by smartcontracts's avatar smartcontracts Committed by GitHub

fix(sdk): withdrawal bug for some custom bridges (#3245)

Fixes a bug in the SDK that would cause withdrawals to revert for
certain custom bridges on Kovan.
Co-authored-by: default avatarmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 3fc87053
---
'@eth-optimism/sdk': patch
---
Fixes a bug in the SDK for certain bridge withdrawals.
...@@ -184,8 +184,12 @@ export class StandardBridgeAdapter implements IBridgeAdapter { ...@@ -184,8 +184,12 @@ export class StandardBridgeAdapter implements IBridgeAdapter {
return true return true
} catch (err) { } catch (err) {
// If the L2 token is not an L2StandardERC20, it may throw an error. If there's a call // If the L2 token is not an L2StandardERC20, it may throw an error. If there's a call
// exception then we assume that the token is not supported. Other errors are thrown. // exception then we assume that the token is not supported. Other errors are thrown. Since
if (err.message.toString().includes('CALL_EXCEPTION')) { // the JSON-RPC API is not well-specified, we need to handle multiple possible error codes.
if (
err.message.toString().includes('CALL_EXCEPTION') ||
err.stack.toString().includes('execution reverted')
) {
return false return false
} else { } else {
throw err throw err
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment