# 号神 — buyer operations

Official source: https://haoshen.pages.dev. Chain: BSC 56. Sole sale contract: 0x3a58112bde93508bbb21e2de29a9f5470677b609 (verified source https://bscscan.com/address/0x3a58112bde93508bbb21e2de29a9f5470677b609#code; Sourcify https://repo.sourcify.dev/56/0x3a58112bde93508bbb21e2de29a9f5470677b609). Token: 0xf791b7d8ead1c91d014137d7e3e163bdc9176220. Official pair: 0x13db1b4ed8dc4149a4c66013fd36d4b4159a8cb4. Daily claim station (sale.DAILY_STATION()): 0x3d0525f4c4d49c1c67ee0a460bbb3662e0a91349. Deployment block: 135212957. Use only these addresses; re-read TOKEN(), PAIR() and DAILY_STATION() from the sale to confirm.

Sale facts: no owner or administrator, no proxy/upgrade, pause or withdrawal function. Token authority: only the sale can mint/burn by its fixed rules. Taxes fixed: buy 1%, sell 3%. Confirm the deployed source and official website point to the same sale before an actual purchase.

## Price, time and assets

One share costs 0.02 BNB = 20000000000000000 wei. Presale cap 2000 shares; 10000 tokens (18 decimals) per presale share. No free shares. Each Agent ID AND each wallet may purchase 10 shares in total, including purchases after opening; ID transfer preserves its used quota, and changing the ID held by a wallet does not reset that wallet's used quota. Single transaction cap 10. A second transaction is another purchase, not an idempotent retry.

Start = deployment timestamp + 31650 seconds: saleStart() = 1795442401 (2026-11-23 22:00:01 UTC+8). Presale duration = 28800 seconds, priority window = 900 seconds. Read saleStart(), presaleEnd(), priorityEndsAt(). During the priority window the ID must have bound a valid referrer before saleStart via bindReferrer(address).

The purchase selling out the presale opens the pool. After the duration, with at least 300 shares sold (state TimeUpPending), anyone can call openPool(), or the next mint fills at the presale price (10000 tokens per share, presale shares left permitting) and opens the pool in the same transaction. In the opening block, every mint after the opening reverts HAOSHENOpeningBlock(nextBlock) and quote returns reason 10; mint from the next block at the pool price. If fewer sold, presale continues without a principal refund; the mint reaching the minimum opens the pool. Holders cannot transfer before the pool opens. After opening every share still costs 0.02 BNB and tokensOut follows reference pool price × 0.99; reference is max(spot, this block's observed high). Lifetime gross payment cap: 500 BNB.

Block allowance after opening is max(10 shares = 0.20 BNB, min(5 BNB, WBNB reserve × 5%)), where the WBNB reserve is the lower of the reserve at the block's first token transfer and the current reserve (a buy earlier in the block does not raise it). blockMintLeft()/blockMintCapNow() return 0 before opening to mean no block allowance restriction. The pool token reserve safety bound can reduce or stop a fill. Send all mints in a block before sells; a sell between mints can make subsequent mints fail the 2% price-drop check.

## Source getters and progress

Read TOKEN()/token(), PAIR()/pair(), ROUTER(), WBNB(), PAYEE(), OFFICIAL_REFERRER(), SHARE_PRICE()/price()/mintPrice(), maxPerAgent()/maxPerWallet()/baseQuota(), remainingFor(address), mintedByAgent(uint256), purchasedByWallet(address).

MAX_SUPPLY() = 25000, totalMinted() = netPaid()/SHARE_PRICE(): BOTH are lifetime purchased shares. FREE_SUPPLY()=0. TOTAL_SHARES()=2000 and sharesMinted()=presaleSold(): BOTH are presale shares. There is no fixed ERC-20 token supply cap; do not substitute the token's totalSupply for share counts. Sale Transfer(0,buyer,shares) is a non-transferable purchase receipt event; the sale is not an ERC-20 or NFT. The token independently emits its standard Transfer(0,buyer,tokenWei).

## Quote and fill

`quote(address buyer,uint256 value) view returns (uint256 shares,uint256 cost,uint256 change,uint256 tokensOut,uint16 refBps,uint8 reason)`

Value/cost/change are native BNB wei; tokensOut is token wei, shares are whole integer shares. There is no quote(uint256) or zero-argument quote overload. The quote uses the bound referrer, not an explicit referrer. Simulate the full mint to validate an explicit referrer.

Fill = min(floor(value/SHARE_PRICE), 100, remaining ID quota, remaining wallet quota, presale or gross-cap shares left, current block allowance, pool-token limit fit). The quantity argument never caps payment fill. Unspent value is returned in the same transaction as BNB or, if the 30,000-gas native call fails, WBNB. This is change, not a principal refund. No fills revert merely because of a fractional remainder; below one full share reverts.

For price P=20000000000000000 wei and at least two shares of room:

| call | value | actual shares | change |
|---|---|---|---|
| mint(1) | P+1 | 1 | 1 wei |
| mint(1) | 2P | 2 | 0 |
| mint(2) | 2P-1 | 1 | P-1 |
| mint() | P-1 | revert HAOSHENUnderpaid | no purchase |

At an ID cap of one remaining share, a 2P payment fills one share and returns P. On failure quote returns (0,0,value,0,0,reason).

| reason | meaning | mint revert |
|---|---|---|
| 1 | wrong phase, not started or lifetime cap | HAOSHENWrongPhase() |
| 10 | pool opened earlier in this block; retry next block | HAOSHENOpeningBlock(nextBlock) |
| 2 | payment below one share | HAOSHENUnderpaid(required,sent) |
| 3 | missing Agent ID or registry read fails | HAOSHENNoAgentId() |
| 6 | priority window, ID not pre-bound | HAOSHENPriorityWindow(endsAt) |
| 9 | lifetime Agent ID or wallet quota exhausted | HAOSHENAgentCapReached() |
| 4 | post-opening block allowance exhausted | HAOSHENBlockCapReached() |
| 8 | reserve safety limit or pool price rounds to zero | HAOSHENPoolTokenLimit() |
| 7 | invalid explicit referrer that would be used (mint only) | HAOSHENBadReferrer(address) |
| 5 | reference price > spot × 1.02 | HAOSHENMintAboveMarket() |

Reason 0 means OK. Check order is exactly 1→10→2→3→6→9→4→8→7→5; it determines the first failure reported. Reason 8 also covers a post-opening payment too small for the pool buyback or add to move at least one token wei. state(): 0 NotStarted,1 Presale,2 FullPending,3 TimeUpPending,4 Open,5 Capped,6 Extended. FullPending is an internal state inside the selling-out transaction (that purchase opens the pool before returning); callers do not observe it between transactions. In TimeUpPending and Extended, purchases continue at the presale price; presaleEnd is not a hard mint deadline.

## Full purchase simulation

Use the ABI from the final verified source. From the buyer address, read quote(buyer,value); require reason=0. Encode the full signature `mint(uint256,address,uint256)` with requested_shares=q.shares, the intended referrer (or zero), and minTokensOut=floor(q.tokensOut*98/100). The contract checks tokens × requested_shares ≥ minTokensOut × filled shares, so if fewer shares fill than quoted (block allowance, presale remainder), the minimum scales down per share instead of reverting. mint()/mint(uint256)/direct BNB transfer carry no minimum: they fill by payment amount and have no slippage protection.

Use the exact same to/data/value/from for eth_call and eth_estimateGas. For example, construct calldata with `cast calldata "mint(uint256,address,uint256)" Q_SHARES REFERRER MIN_TOKENS`, then call JSON-RPC `eth_call` with {from:BUYER,to:SALE,data:CALLDATA,value:VALUE_HEX}, "latest". A quote does not reserve a price or quota. If an explicit referrer was passed, eth_call is essential because quote has no explicit referrer parameter.

Present the expected cost, filled shares, token output, change, referrer, chain and authority changes to the buyer. Execute only with their authorization; no ERC-20 allowance is needed to buy with BNB. Estimate gas with a margin (e.g. estimate×120/100). On receipt.status=1, check HAOSHENMinted and both receipt/token Transfer events. If submission status is unknown, keep its transaction hash and reconcile first; do not blindly submit another purchase. Refresh quote/simulation before any new attempt.

`mint()` = mint with no explicit referrer/minimum. `mint(uint256)` quantity does not cap fill. Direct BNB transfer is equivalent except transfers from WBNB/router are not purchases. All these no-minimum entries require a nonzero payment, eligible phase, ID and quota; they are not free-mint paths. They fill by payment amount without slippage protection; use the full protected entry for a minimum output. A pre-start eth_call correctly reverts; do not relax the clock or charge zero to force a scanner probe to succeed.

## Referral and rewards

Referral payout is 5%, then 10% after 10 valid invites, then 15% after 50. Valid invite = one distinct Agent ID accumulating 10 shares with a referrer, counted once for its first inviter. The purchase reaching a threshold receives the old rate. Each mint allocates 80% to the pool: during presale it is retained by the sale and deposited when the pool opens; after opening half buys back and burns, and the rest adds liquidity. The current referral rate goes to the resolved referrer and the remainder to PAYEE in the purchase transaction. No referrer means no referral payment. Same wallet/same ID self-referral gives no reward.

Binding resolution: a bound referrer wins while valid, ignoring an explicitly passed address. The first explicit valid referrer also binds an unbound wallet. If the bound referrer loses its ID, another valid explicitly supplied referrer is paid; zero, the original bound address or yourself mean no referrer; another address without an ID reverts HAOSHENBadReferrer (except OFFICIAL_REFERRER). Referral binding follows wallet; priority and purchase quota follow Agent ID. Valid invite credit remains with the original inviter, which can differ from a later referral payee. The official referrer 0x2d771385ff2a6e01dd0a56c28a3d6002306bbd0f is a constructor address, accepted without an ID; the contract never silently substitutes it for address(0).

Each mint issues extra tokens equal to 3% of buyer tokens into the current reward pool. Epochs are 24 hours from saleStart. At epoch end, rewards split by valid invites added in that epoch. Call claimable(referrer,uint256[] epochs) then claim(uint256[] epochs), or allow later mints to settle due rewards automatically. Duplicate/unfinished/already claimed epochs do not pay twice; claim reverts HAOSHENNothingToClaim if nothing is paid. No BNB reward or claim fee. Empty epochs roll into the next mint's epoch; if no future mint occurs they remain held. Read rewardMintedTotal(), not a sum that counts HAOSHENRewardRolled as new issuance.

## Selling after opening

Read token ROUTER(), QUOTE(), PAIR(), BUY_TAX_BPS(), SELL_TAX_BPS(). Use the supporting-fee-on-transfer router entry `swapExactTokensForETHSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256)` with path [TOKEN,WBNB], the buyer as recipient and an explicit deadline. Approve only the chosen amountIn and skip zero amounts. Simulate before sending, with gas limit estimateGas+200000 as inherited guidance for one/two-hop sells. Direct pair sells are not supported by this recipe.

Collected tax swaps at most once successfully per block, capped at 0.15% of token reserve, and needs at least 400000 gas at the internal auto-swap check; below that check it skips the swap. Anyone can separately call token.swapTax() with at least 250000 gas at its internal check. Failed swaps retain tax tokens for a later attempt; token tax balances are not realized BNB income.

## Daily token claim — separate station, after pool opening

Read DAILY = sale.DAILY_STATION(). This is a separate contract from the sale's referral-reward claim(uint256[]).
The sale constructor mints 600000 HAOSHEN directly to DAILY once. No owner, admin, upgrade,
withdrawal, recovery or parameter-changing function exists in DAILY. There is no calendar expiry.
After token.openedAt() > 0, each currently owned Agent ID may claim one 200 token bundle
per UTC day, while stock remains and fewer than 90 bundles have been claimed that day.
The BNB fee is 0.00026 (260000000000000 wei); it goes to the same PAYEE as the sale, in the same transaction.
No prior share purchase or token allowance is required. Agent ID transfer never resets that ID's usage.
First day may be partial. Unused days do not accumulate. Token quantity is fixed; market price is not promised.

`DAILY.preview(address wallet,uint256 value) view returns (Quote)` where Quote is
`(uint256 day,uint256 identity,uint256 amount,uint256 fee,uint256 refund,uint8 reason)`.
day=floor(block.timestamp/86400); identity=uint256(keccak256(bytes(REGISTRY.handleOf(wallet)))).
The station checks ownerOf(identity)==wallet. A stale handle or registry failure is ineligible.
Read inventory(), claimFee(), claimAmount(), dailyCap(), dailyClaimed(day), claimed(day,identity), nextResetAt().
MAX_SUPPLY() is the initial 3000 whole bundles, not a lifetime hard cap: external token donations can add stock.

Reasons in check order: 1 pool closed; 8 zero wallet; 3 no current ID; 4 replay;
5 daily cap; 6 insufficient stock; 7 below fee; 0 ready. Code 2 is unused.
Reason 1 reverts HAOSHENPoolNotOpen(); 7 reverts HAOSHENUnderpaid(required,sent); 3/5/6/8 revert HAOSHENUnavailable(reason).
These failures charge no fee and consume no claim slot (normal network gas still applies).
Reason 4 is successful replay: zero tokens, zero fee, full refund, including after today's cap or stock is exhausted.
Use claim() for automatic ID resolution. claim(uint256 identity) also exists; the argument is the ID, never quantity
or a fixed 1. A mismatch reverts HAOSHENWrongIdentity(), including on replay. Direct BNB calls use the same claim logic.

| call to DAILY | value | tokens | change |
|---|---|---|---|
| claim() first eligible today | 260000000000000 | 200 | 0 |
| claim() first eligible today | 260000000000000+1 | 200 | 1 wei |
| claim() first eligible today | 2×260000000000000 | 200 | 260000000000000 wei |
| claim() first eligible today | 260000000000000-1 | revert HAOSHENUnderpaid | no fee |
| claim() already claimed today | any value | 0 | full value |

Complete workflow (substitute verified SALE and actual Agent ID owner BUYER; RPC is a read-only endpoint):
1. Read DAILY=`cast call SALE "DAILY_STATION()(address)" --rpc-url RPC` and TOKEN=`cast call SALE "token()(address)" --rpc-url RPC`.
2. Confirm chain_id=56 and deployed verified source; DAILY.TOKEN() matches TOKEN; DAILY.PAYEE() matches SALE.PAYEE();
   TOKEN.openedAt()>0. Read `cast call DAILY "preview(address,uint256)((uint256,uint256,uint256,uint256,uint256,uint8))" BUYER 260000000000000 --rpc-url RPC`.
3. Require reason=0, amount=200000000000000000000, fee=260000000000000, refund=0. Encode `cast calldata "claim()"`.
4. Perform JSON-RPC eth_call with {from:BUYER,to:DAILY,data:CALLDATA,value:VALUE_HEX}, latest,
   where VALUE_HEX is the hex encoding of 260000000000000 wei. Estimate the same call and add a gas margin.
5. Present fee, 200 tokens and chain to the buyer; obtain their transaction authorization.
   Send that exact to/data/value, with no new allowance. Check HAOSHENClaimed, current-day claimed=true,
   exact token balance increase and refund. Reconcile an unknown transaction hash before retry.

All overpayment is change: the per-ID daily limit remains one bundle, even at double payment.
Fees/refunds settle as BNB or equal nominal WBNB if the 30,000-gas native call fails. WBNB fallback emits HAOSHENSentAsWbnb.
Wallet-to-wallet transfers of this token have no tax, so the station's exact-received check succeeds.
Subsequent sales to the official pair are subject to the existing 3% sell tax.
In every sale phase the correct description is: after the official pool opens, daily claims are available while stock
and daily quota remain. A pending/extended presale does not promise that a pool will open at a fixed time.
