Closed FidelVe closed 2 months ago
figure out the issue:
the transaction im trying to make has the "minimum to receive" amount as an int
when it should be a hex
it was this:
[
'_swap',
'hx406ce67e4b2d09e714eaf48224f2e0ba49e14fbc',
'389240021972184000',
[ 1, 'cxc3c552054ba6823107b56086134c2afc26ab1dfa' ]
]
after changing it like this the tx is a success
[
'_swap',
'hx406ce67e4b2d09e714eaf48224f2e0ba49e14fbc',
'566b9c25d0761c',
[ 1, 'cxc3c552054ba6823107b56086134c2afc26ab1dfa' ]
]
Description of the transaction that is failing
im sending a transaction to swap bnusd to baln tokens, this is the transaction https://tracker.lisbon.icon.community/transaction/0x19ef2df75a13ab00e01acfcba74678e24892f80da9433fb059111c693c8f0db8
this is the transaction payload:
Decoding the
_data
field with RLP shows the following:the amount of bnUSD token sent is
1
the price of the pool at the time of the transaction is2.440887722886505
the expected amount of BALN token to receive is0.4096870128944057
with a slippage of 5% the minimum amount that was inputted in the transaction is0.3892026622496854
The transaction is failing indicating that the minimum amount is
1043.5560935640935
This is incorrect because you can see that in the payload the amount that is defined as the minimum amount is
0.3892026622496854
Example of a successfull transaction for the same swap
The following is a successfull transaction done on mainnet with the balanced web app https://tracker.icon.community/transaction/0xc87bebcd53e06aca817ae01d3900b13796a24945dcd4386d8fb33fc5bf248eba
this is the transaction payload:
decoding the
_data
field with RLP shows the following:Conclusion
The only difference is that im sending my transaction on Lisbon and the transaction that is a success and was done using the balanced webapp was done on mainnet
Given that all the data for executing the transaction on lisbon seems correct Im thinking that the reason for the transaction failing is that different versions of the router contract are currently live on lisbon an on mainnet but im not able to verify this.
if someone can spot the bug in this I appreciate it.