Skip to content

Checksum of token addresses in API #57

@abdullathedruid

Description

@abdullathedruid

When looking at the generate_unsigned_bridge_txn endpoint, there is inconsistent behaviour with how checksummed addresses are handled in the 'fromToken' and 'toToken' parameters. This may be the case for other endpoints, but I have not checked.

The following query returns the correct transaction:

https://syn-api-dev.herokuapp.com/v1/generate_unsigned_bridge_txn?fromChain=10&toChain=1&fromToken=0x5A5fFf6F753d7C11A56A52FE47a177a87e431655&toToken=0x0f2d719407fdbeff09d87557abb7232601fd9f29&amountFrom=0x56bc75e2d63100000&addressTo=0x4c973791F77337F07916c68780A9E98c75988409

Whereas the following returns an error:

https://syn-api-dev.herokuapp.com/v1/generate_unsigned_bridge_txn?fromChain=10&toChain=1&fromToken=0x5A5fFf6F753d7C11A56A52FE47a177a87e431655&toToken=0x0f2D719407FdBeFF09D87557AbB7232601FD9F29&amountFrom=0x56bc75e2d63100000&addressTo=0x4c973791F77337F07916c68780A9E98c75988409

Note the difference in the toToken field: 0x0f2D719407FdBeFF09D87557AbB7232601FD9F29 vs 0x0f2d719407fdbeff09d87557abb7232601fd9f29

I would believe this is caused by the way the token addresses are stored in the sdk: https://github.com/synapsecns/sdk/blob/master/src/tokens.ts

For example: SYN [ChainId.ETH] address is lower case whilst the addresses for other chains are checksummed

For consistency, it would make sense to either ignore the casing of the addresses (to allow for either checksummed or lower case addresses) or to enforce checksumming of addresses

Many thanks!
Happy to answer further questions

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions