Update swap.js#4
Open
MithrandirBalrog wants to merge 2 commits intoCreator-Bid:mainfrom
Open
Conversation
native ETH / WETH / cbBTC resolution correctness
Scope: create a shared token registry helper (clawlett/scripts/lib/tokens.js) used by swap.js and balance.js.
Acceptance: ETH->USDC, USDC->ETH, WETH->USDC, cbBTC->USDC all quote/execute correctly.
Problem: fallback minOut math mixes float + BigInt and slippage display is misleading.
Acceptance: no BigInt errors, correct printed slippage, deterministic minAmountOut.
Moreover, some issues with chain/contract preflight checks
Problem: scripts can run on wrong RPC/network with confusing failures.
Scope: preflight in initialize.js, swap.js, balance.js: chainId 8453 + bytecode existence for required contracts.
Acceptance: clear fail-fast error if wrong chain/missing contracts.
Finally, it fixes problem with safer approvals + revoke tooling
Problem: current flow uses MaxUint256 approvals.
Scope: approve.js and revoke.js; optional exact approvals in swap.js.
Acceptance: operator can set exact allowance and revoke to zero after trade window.
Collaborator
|
Hey @MithrandirBalrog , thanks for you contribution. Do you mind addressing the merge conflicts? |
Author
|
Hey @0xArdi — sure thing. I’ll rebase my branch onto Creator-Bid:main and resolve the conflicts, then push an updated commit shortly. We will submit shorter comits i'm really sorry for that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
native ETH / WETH / cbBTC resolution correctness
Scope: create a shared token registry helper (clawlett/scripts/lib/tokens.js) used by swap.js and balance.js.
Acceptance: ETH->USDC, USDC->ETH, WETH->USDC, cbBTC->USDC all quote/execute correctly.
Problem: fallback minOut math mixes float + BigInt and slippage display is misleading.
Acceptance: no BigInt errors, correct printed slippage, deterministic minAmountOut.
Moreover, some issues with chain/contract preflight checks
Problem: scripts can run on wrong RPC/network with confusing failures.
Scope: preflight in initialize.js, swap.js, balance.js: chainId 8453 + bytecode existence for required contracts.
Acceptance: clear fail-fast error if wrong chain/missing contracts.
Finally, it fixes problem with safer approvals + revoke tooling
Problem: current flow uses MaxUint256 approvals.
Scope: approve.js and revoke.js; optional exact approvals in swap.js.
Acceptance: operator can set exact allowance and revoke to zero after trade window.