Skip to content

Task/sean/str 695#229

Merged
auroter merged 24 commits intodevelopfrom
task/sean/str-695
Jul 18, 2023
Merged

Task/sean/str 695#229
auroter merged 24 commits intodevelopfrom
task/sean/str-695

Conversation

@auroter
Copy link
Contributor

@auroter auroter commented Jul 13, 2023

To test:

  1. You will need to add these actions in the Dashboard-API if you haven't already: See "Create Avalanche Approve" and "Create Avalanche Exchange" in Dashboard API > Contracts
  2. Use the new Quote example in String-API (STR-675 branch) Postman for Avalanche Approve and Swap
  3. Note the estimated gas value
  4. Transact once you've gotten the quote
  5. Hit the quote endpoint again and notice that the estimated gas value has scaled up by about 3.

The original estimate is not able to account for any actions simulated after Approve(), because the commands being simulated do not sequentially maintain state. Therefore if you simulate Approve() and then Swap(), the Swap() simulation will fail because the current status of the real blockchain does not include the Approve().

The reasoning above is why you should expect the gas estimate to scale by a factor of ~3 after executing the transaction once - because the original estimate did not account for the Approve() or the Forwarding of the asset (Transfer()) from the API back to the end user.

Sean and others added 19 commits July 2, 2023 15:30
…ution of multiple calls, added calls for NFT and Token Forwarding (not complete yet)
…cko always appeared to be down, fixed an issue with updating the timestamp of a cached token value even when failing to retrieve a new value
…d a bug where finding 0 tokens to forward for ERC721 or ERC20 reported an error, fixed a bug where forwards failed because they were using safeTransferFrom without an approve, added true max gas caching for each transaction request, fixed a bug where forwarding would be attempted when there was nothing to forward, added true gas summing including forwarding
frostbournesb
frostbournesb previously approved these changes Jul 13, 2023
@auroter auroter requested a review from frostbournesb July 16, 2023 18:59
@auroter auroter merged commit 9d7e465 into develop Jul 18, 2023
@auroter auroter deleted the task/sean/str-695 branch July 18, 2023 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants