Skip to content
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

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

fionnachan
Copy link
Member

Closes FS-858

@cla-bot cla-bot bot added the cla-signed label Oct 3, 2024
Copy link

vercel bot commented Oct 3, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
arbitrum-token-bridge ✅ Ready (Inspect) Visit Preview Dec 12, 2024 2:46pm


if (signerChainId !== sourceChainId) {
throw new Error(
`Signer is on chain ${signerChainId} but should be on chain ${sourceChainId}.`
Copy link
Contributor

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({
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants