Skip to content

feat(tokens): buySelfPay recipient + new sale stack (#145 gap2 / launch#21)#161

Merged
jhfnetboy merged 1 commit into
mainfrom
feat/selfpay-recipient
Jun 23, 2026
Merged

feat(tokens): buySelfPay recipient + new sale stack (#145 gap2 / launch#21)#161
jhfnetboy merged 1 commit into
mainfrom
feat/selfpay-recipient

Conversation

@jhfnetboy

Copy link
Copy Markdown
Member

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, and SelfPayParams.recipient? → routes to the *For variants (deliver USDT-paid aPNTs/GToken into an AirAccount). 20 tokens tests; check:abi PASS.

…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.
@jhfnetboy
jhfnetboy requested a review from fanhousanbu as a code owner June 23, 2026 13:25
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@clestons clestons left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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):

  • GTOKEN path: buyTokensFor(to, usdAmount, payAddr, minOut) — 4 args matches ABI (address to, uint256 usdAmount, address paymentToken, uint256 minTokensOut)
  • aPNTs path: buyAPNTsFor(to, usdAmount, payAddr) — 3 args matches ABI (address to, uint256 usdAmount, address paymentToken)
  • No minOut for aPNTs — ABI has no slippage param; consistent with buyAPNTs(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 existing buyTokens/buyAPNTs unchanged ✅

ABI refresh:

  • APNTsSaleContract: new buyAPNTsFor
  • SaleContractV2: new buyTokensFor, capExempt, setCapExempt, CapExemptUpdated/TokensPurchasedFor events ✅ — consistent with launch#22+#23 review
  • BuyHelper: new addRelayer/removeRelayer/isRelayer/owner + NotRelayer/ZeroRelayer errors ✅ — consistent with launch#24 review

Addresses (Sepolia) — on-chain verified (launch#25):

  • SaleContractV2 0x86aC0278fAFA3Bf51e18426937A264e16B78bce4
  • APNTsSaleContract 0x1cE31924EE7e0296d6b739d0bC96B354CA55b30C
  • BuyHelper 0xF78f898413ef069C870A554f47B66eC6D9c5B429 (capExempt[BuyHelper]=true live-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.

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