-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add sanity checks in bridge sdk transfer function #1959
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
packages/arb-token-bridge-ui/src/token-bridge-sdk/Erc20WithdrawalStarter.ts
Outdated
Show resolved
Hide resolved
|
||
if (signerChainId !== sourceChainId) { | ||
throw new Error( | ||
`Signer is on chain ${signerChainId} but should be on chain ${sourceChainId}.` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also have some actionable here - eg. "Please check your connection / Please try again after refreshing/reconnecting your wallet."
@@ -59,12 +64,25 @@ export class EthWithdrawalStarter extends BridgeTransferStarter { | |||
throw 'Native currency withdrawals to a custom destination address are not supported yet.' | |||
} | |||
|
|||
await validateSignerChainId({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everywhere - We should also add a check for addressIsSmartContract
along with this.
- We can abstract
validateSignerChainId + addressIsSmartContract = validateTransfer (or something like that)
as 1 function which takes in the toAddress+signer as input and does all the checks within it.
Closes FS-858