You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a request for discussion, not a particular proposal for a solution.
What is the Problem Being Solved?
Autoswap (and other contracts) return success and failure indication as strings. Clients must compare strings to learn the outcome. For many contracts the outcome is almost always a success, since either give or want satisfies offer safety. With Autoswap, the distinction between /Swap successfully completed/ and / is insufficient to buy amountOut / tells whether the trade went through.
Description of the Design
Doing a string compare on the results seems infelicitous. Maybe the contracts could publish some enum values? I don't think we have enough common outcomes across contracts to standardize this yet, so it would have to be for each contract.
Security Considerations
This is mostly about usability, I think.
Test Plan
As we figure out what we want
The text was updated successfully, but these errors were encountered:
We need to improve the code in Multipool Autoswap, as this isn't generally how contracts work. They generally work much better - getOfferResult throws and it is the promise rejection that indicates an error. See #2336 for the issue detailing what needs to be done.
This is a request for discussion, not a particular proposal for a solution.
What is the Problem Being Solved?
Autoswap (and other contracts) return success and failure indication as strings. Clients must compare strings to learn the outcome. For many contracts the outcome is almost always a success, since either
give
orwant
satisfies offer safety. With Autoswap, the distinction between/Swap successfully completed/
and/ is insufficient to buy amountOut /
tells whether the trade went through.Description of the Design
Doing a string compare on the results seems infelicitous. Maybe the contracts could publish some enum values? I don't think we have enough common outcomes across contracts to standardize this yet, so it would have to be for each contract.
Security Considerations
This is mostly about usability, I think.
Test Plan
As we figure out what we want
The text was updated successfully, but these errors were encountered: