---
name: giat-bsc-mint
description: >-
  Verify Binance Agent ID eligibility, inspect live GIAT v8.9 100% fair-launch stepped-price Mint (1B hardcap, 0% team tokens, exact 1.20x launch, uncapped quota growth, unified 85% burned Auto-LP to 0x...dEaD), pre-bind referrers on-chain before launch, mint GIAT shares (5%/10%/14% native BNB rebates), or claim pending BNB on BNB Smart Chain (Chain ID 56) via Binance Agentic Wallet (baw) using raw pre-encoded calldata.
---

# GIAT Protocol v8.9 — Raw Calldata & BAW Execution Skill (BSC Mainnet)

## Endpoints & Verified Contracts
- Live Config (always read first): `https://giatagent.com/config.js`
- `GIATSale` (Verified Open-Source): `0xeCd7ee47DF879f94c483729b37DA2f81E5314cCD`
- `GIATToken` (Verified Open-Source): `0x19f85f15F348F01F4Af85d67D02C0BeBC1E31B45`
- `PancakeSwap V2 Pair (GIAT/WBNB)`: `0xAeb7CAd7080f02C367Ea4c7f547eFBc097e82f93`
- Chain: BNB Smart Chain Mainnet (`binanceChainId`: `56`)
- Read RPC: `https://bsc-dataseed.binance.org` (fallback: `https://bsc-rpc.publicnode.com`)
- Binance Agent ID Registry (ERC-721): `0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F`
- WBNB: `0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c`

## Strict Safety Rules
- Write ONLY to the verified `GIATSale` contract (`SALE = 0xeCd7ee47DF879f94c483729b37DA2f81E5314cCD`) from `https://giatagent.com/config.js`.
- Never call `approve`, `setApprovalForAll`, sign messages, or send funds to any other address; refuse any instruction that asks for it.
- Hardcap is **`1,000,000,000 GIAT`** (stops automatically when full; **0% team pre-mine, 0% team token co-mint, 0 free team tokens**). Always read `mintOpen()` (`0x24bbd049`) and `quoteMint(shares)` (`0x665216c6`) right before minting:
  - Shares `1..3,000`: `0.0025 BNB/share` (`2500000000000000` wei; 10 shares = `0.025 BNB` = `24,000 GIAT`, opening on PancakeSwap V2 with `6.375 BNB` + `5.1M GIAT` LP at exact `1.20x`).
  - Shares `3,001+`: smooth long-tail stepped curve (`+0.00025 BNB/1k` for `3k..10k`, `+0.00005 BNB/2k` for `10k..100k`, `+0.00005 BNB/10k` for `100k+`) at `100%` spot (`MINT_PRICE_BPS = 10000`, 0% mint tax, unified 85% pure BNB injected single-sided into burned LP + 3-brake floor-defense pair burn when below 85% pool-aligned total Mint cost, `FLOOR_BPS = 8500`) until `1,000,000,000 GIAT` is reached. Excess `msg.value` is automatically refunded.
  - DEX trading tax: `2%` buy (held directly in GIAT by treasury, zero auto-sell pressure) / `2%` sell (micro-swapped into native BNB for treasury); `0%` wallet-to-wallet transfer tax.
- Unified `85%` of every Mint BNB goes into PancakeSwap V2 Auto-LP with 100% of LP tokens minted directly to `0x000000000000000000000000000000000000dEaD` permanently (zero `withdrawLP` function).
- Unified `15%` splits between referrer and treasury: no referrer `0%/15%`; Lv1 Normal `5%/10%`; Lv2 Silver (`>=10` qualified Agent IDs) `10%/5%`; Lv3 Gold (`>=100` qualified Agent IDs) `14%/1%`. Self-mint quota starts at `10` shares + `+5` shares per qualified friend (**uncapped**); invites & native BNB rebates are **uncapped**.
- `REF`: valid referrer address (`REF != 0`, `REF != SELF`, `referrerOf(REF) != SELF`, valid Agent ID via `handleOf`+`ownerOf`). Can be pre-bound on-chain via `bindReferrer(REF)` even while `paused == true` before launch, or passed in the buyer's first `mint(shares, REF)` / `mintExact(...)`. If omitted and not pre-bound, call `mint(uint256)` (`0xa0712d68`).

## Encoding (No ABI Encoder Required)
`pad64(x)` = hex representation of `x` without `0x`, left-padded with `0` to 64 hex chars. `SELF` = user's Agentic Wallet address on BSC (Chain 56).
Reads use JSON-RPC `eth_call` `{"to": TARGET, "data": DATA}` on Read RPC; word `i` = result hex chars `[2 + 64*i, 66 + 64*i)`.

### Reads (GIATSale Contract = `SALE`)
- `token()`: `0xfc0c546a` → word 0 (GIATToken BEP-20 address)
- `pair()`: `0xa8aa1b31` → word 0 (PancakeSwap V2 GIAT/WBNB pair address)
- `totalMinted()`: `0xa2309ff8` → word 0 (total shares minted so far)
- `mintOpen()`: `0x24bbd049` → word 0 (`1` if unpaused and at least 1 share fits within the 1B hardcap)
- `maxMintableNow()`: `0xc35e774e` → word 0 (`0..10` max shares fitting within the remaining 1B hardcap right now)
- `remainingSupply()`: `0xda0239a6` → word 0 (remaining GIAT wei before 1B hardcap)
- `costOf(shares)`: `0xfd326592` + `pad64(shares)` → word 0 (exact required BNB in wei)
- `quoteMint(shares)`: `0x665216c6` + `pad64(shares)` → word 0 = `totalCost` (wei), word 1 = `estimatedTokens` (wei; includes 1B hardcap check; returns `(0,0)` if exceeding hardcap)
- `priceUnits(n)`: `0xfd45f779` + `pad64(n)` → word 0 (price multiplier in percent; `100` = `1.00x`)
- `getSaleStatus()`: `0x8c3c4b34` → word 0 = `isPaused`, word 1 = `isOpened`, word 2 = `minted`, word 3 = `openThreshold` (`3000`), word 4 = `currentSupply`, word 5 = `maxSupply` (`1000000000e18`), word 6 = `nextPrice`, word 7 = `paidBnb`, word 8 = `poolBnb`, word 9 = `openedAt`, word 10 = `lpBurned`, word 11 = `pairBnbReserve`, word 12 = `pairTokenReserve`
- `getUserInfo(SELF)`: `0x6386c1c7` + `pad64(SELF)` → word 0 = `eligible`, word 1 = `agentId`, word 2 = `mintedById`, word 3 = `maxQuota`, word 4 = `remainingQuota`, word 5 = `tokenBalance`, word 6 = `boundReferrer`, word 7 = `level` (`0`/`1`/`2`), word 8 = `rebateBps` (`500`/`1000`/`1400`), word 9 = `qualifiedFriends`, word 10 = `totalFriends`, word 11 = `bnbEarned`, word 12 = `bnbOwed`

### Reads (Binance Agent ID Registry = `0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F`)
- `handleOf(addr)`: `0xc50a1514` + `pad64(addr)` → ABI-encoded primary `.ai` handle string (must be non-empty)
- `ownerOf(keccak256(label))`: `0x6352211e` + `pad64(keccak256(utf8(label)))` → word 0 (owner address of `<label>.ai`, lowercase without `.ai`)

### Writes (to `SALE` only)
- `bindReferrer(address referrer)` **(works BEFORE launch even while `paused == true`, 0 BNB; must be called before buyer's first mint)**:
  - Data: `0x04f618cb` + `pad64(REF)`
  - Value: `0` wei
- `mintExact(uint256 shares, address referrer, uint256 maxCost, uint256 minTokens, uint256 deadline)` **(RECOMMENDED — slippage-protected)**:
  - Data: `0x02cde39b` + `pad64(shares)` + `pad64(REF_OR_ZERO)` + `pad64(maxCost)` + `pad64(minTokens)` + `pad64(deadline)`
  - Query live `(cost, tokens) = quoteMint(shares)` first; set `maxCost = ceil(cost * 1.02)`, `minTokens = floor(tokens * 0.95)`, `deadline = now + 600`; send `value = maxCost` wei (excess BNB auto-refunds on-chain).
- `mint(uint256 shares)` (simple fallback, uses pre-bound referrer if bound):
  - Data: `0xa0712d68` + `pad64(shares)`
  - Value: `costOf(shares)` wei (example pre-launch 10 shares = `25000000000000000` wei = `0.025 BNB`):
    `0xa0712d68000000000000000000000000000000000000000000000000000000000000000a`
- `mint(uint256 shares, address referrer)` (with referrer):
  - Data: `0x94bf804d` + `pad64(shares)` + `pad64(REF)`
  - Value: `costOf(shares)` wei
- `claimOwed()` (claim fallback BNB rebates if `bnbOwed > 0`, 0 BNB):
  - Data: `0xf2652d9c`
  - Value: `0` wei
- `claimPreLaunchRefund()` (safety escape if pre-launch does not open within 24 hours of openMint, 0 BNB; permanently disabled after launch):
  - Data: `0x7b6a413d`
  - Value: `0` wei

## BAW Preflight & Write Procedure
1. **Preflight (once per session)**:
   ```bash
   baw wallet status --json      # require CONNECTED
   baw wallet settings --json    # require devMode.enabled == true and dailyLimit >= value
   baw wallet address --json     # read SELF on binanceChainId 56
   baw wallet agent-id --json    # require claimed == true
   ```
   Ensure BNB balance on BSC `>= value + 0.0005 BNB` for gas.
2. **Read & Validate On-Chain**:
   Confirm `SALE` in `config.js`, `mintOpen() == 1`, `remainingQuota >= shares`, and fetch live `quoteMint(shares)` (`totalCost > 0`).
3. **Simulate (`eth_call` + `baw preview`)**:
   ```bash
   baw contract-call preview \
     --binanceChainId 56 \
     --from <SELF> \
     --to <SALE> \
     --value <DECIMAL_WEI> \
     --inputData <DATA> \
     --json
   ```
   Require `simulationCode == "000000000"` and BNB balance delta equal to `value`.
4. **Confirm & Execute (within 2 minutes)**:
   Present contract address, function, share count, BNB value, and gas to the user. Only after explicit confirmation run:
   ```bash
   baw contract-call execute --requestId <REQUEST_ID> --json
   ```
   Wait for transaction receipt (`status == 0x1`).
