feat(tokens): buySelfPay recipient + new sale stack (#145 gap2 / launch#21)#161
Conversation
…ale stack addrs (#145 gap2 / launch#21) launch#21 redeployed the sale stack with buyTokensFor(to,…)/buyAPNTsFor(to,…) (recipient-capable self-pay). SDK side: - LAUNCH_SALE_ADDRESSES Sepolia: saleGToken 0x86aC02…, saleAPNTs 0x1cE319…, buyHelper 0xF78f89… (canonical GToken/aPNTs unchanged; getPayoutToken on-chain verified → 0x20a051… / 0x9e66B457…). - refreshed SaleContractV2/APNTsSaleContract/BuyHelper ABIs (now include the *For variants). - SelfPayParams.recipient?: Address → routes to buyTokensFor/buyAPNTsFor (e.g. USDT self-pay into an AirAccount); omitted = pay to self (buyTokens/buyAPNTs). aPNTs minOut guard unchanged. 20 tokens tests (+recipient routing); check:abi PASS; build green.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
clestons
left a comment
There was a problem hiding this comment.
clestons review — #161 [4-round: DeepSeek R1 → Sonnet R2 → Codex R3 → Opus R4]
feat(tokens): buySelfPay recipient + new sale stack (#145 gap2 / launch#21) — adds SelfPayParams.recipient? optional param; routes buySelfPay to buyTokensFor/buyAPNTsFor when set. New Sepolia sale addresses, refreshed ABIs. +2451/-2045, 6 files.
Core correctness — verified ✅
Routing logic (tokenSale.ts L263-283):
GTOKENpath:buyTokensFor(to, usdAmount, payAddr, minOut)— 4 args matches ABI(address to, uint256 usdAmount, address paymentToken, uint256 minTokensOut)✅aPNTspath:buyAPNTsFor(to, usdAmount, payAddr)— 3 args matches ABI(address to, uint256 usdAmount, address paymentToken)✅- No
minOutfor aPNTs — ABI has no slippage param; consistent withbuyAPNTs(usdAmount, paymentToken)and the #147 design constraint. DeepSeek R1 flagged this as [Medium] — false positive (ABI confirmed, Codex R3 independently confirmed). - Fallback (no
recipient): passes through to existingbuyTokens/buyAPNTsunchanged ✅
ABI refresh:
APNTsSaleContract: newbuyAPNTsFor✅SaleContractV2: newbuyTokensFor,capExempt,setCapExempt,CapExemptUpdated/TokensPurchasedForevents ✅ — consistent with launch#22+#23 reviewBuyHelper: newaddRelayer/removeRelayer/isRelayer/owner+NotRelayer/ZeroRelayererrors ✅ — consistent with launch#24 review
Addresses (Sepolia) — on-chain verified (launch#25):
- SaleContractV2
0x86aC0278fAFA3Bf51e18426937A264e16B78bce4✅ - APNTsSaleContract
0x1cE31924EE7e0296d6b739d0bC96B354CA55b30C✅ - BuyHelper
0xF78f898413ef069C870A554f47B66eC6D9c5B429(capExempt[BuyHelper]=truelive-verified) ✅
Codex R3: no new blocking findings. R1 false positive confirmed rejected.
APPROVE. SelfPayParams.recipient? routing is correct, ABI argument orders match contracts, no-minOut-for-aPNTs constraint preserved, addresses chain-verified. Merge is the maintainer's call.
Completes #145 gap 2. launch#21 redeployed the sale stack with
buyTokensFor/buyAPNTsFor. SDK: new Sepolia sale addresses (canonical payout on-chain verified), refreshed ABIs, andSelfPayParams.recipient?→ routes to the *For variants (deliver USDT-paid aPNTs/GToken into an AirAccount). 20 tokens tests; check:abi PASS.