Skip to content

Update swap.js#4

Open
MithrandirBalrog wants to merge 2 commits intoCreator-Bid:mainfrom
MithrandirBalrog:patch-1
Open

Update swap.js#4
MithrandirBalrog wants to merge 2 commits intoCreator-Bid:mainfrom
MithrandirBalrog:patch-1

Conversation

@MithrandirBalrog
Copy link
Copy Markdown

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.

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.
@0xArdi
Copy link
Copy Markdown
Collaborator

0xArdi commented Feb 13, 2026

Hey @MithrandirBalrog , thanks for you contribution.

Do you mind addressing the merge conflicts?

@MithrandirBalrog
Copy link
Copy Markdown
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

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.

2 participants