sygmaprotocol / sygma-sdk

A Typescript SDK to add cross-chain capabilities such as bridging tokens and sending messages across dApp projects.
https://docs.buildwithsygma.com/
GNU Lesser General Public License v3.0
31 stars 19 forks source link

Prevent using a wrong address format for destination #367

Closed LyonSsS closed 3 weeks ago

LyonSsS commented 4 months ago

Story

As a User I want use the SDK to transfer some ERC20 tokens And when I paste the destination address in wrong format I should receive an error at the SDK level that this is not compatible

Background

When using the SDK to send some ERC20 token from EVM to EVM network, I am able to paste the destination address ( receiver address) in a wrong format. This works just fine using the SDK and the deposit is successful. The issue then arise when the relayer wants to execute this tx on destination. It fails and the error is abstracted on the relayer log. We should prevent the user in creating this faulty transaction from the beginning.

Details

I create a deposit TX from Mumbai to Sepolia, where the destination address was in substrate format 5GjowPEaFNnwbrmpPuDmBVdF2e7n3cHwk2LnUwHXsaW5KtEL . This deposit tx went trough -> https://mumbai.polygonscan.com/tx/0x69c8692b37d24ddfd20e378f1b6ef4c7848c3745f3f9ea3aaa6815570be34073 Then this failed at execution level on relayer, with an abstract error message. image

Scenarios

Scenario: Given I am <type of user/persona> When And Then

Implementation details

Testing details

Acceptance criteria

MakMuftic commented 2 months ago

We are supporting: evm, substrate and btc networks

LyonSsS commented 1 month ago

This should also fix https://github.com/sygmaprotocol/sygma-relayer/issues/323