# sidecoo Shixi Packet / sidecoo 拾喜紅包

The contract has no administrator, upgrade function, or administrative withdrawal. Refunds return to the creator under the packet rules. The fee recipient is fixed.
[Verified source](https://bscscan.com/address/0xA91D946887A2A625A9E6dBb54E8bc28439D7cA49#code) · [ABI](abi.json)

## Connection

- Chain ID **56** (BNB Smart Chain). Sole packet contract `0xA91D946887A2A625A9E6dBb54E8bc28439D7cA49`. Confirm deployed code and that `website()` returns `https://sidecoo.com/agc-packet/`.
- AGC (18 decimals) `0x63dea5acdbe1f27c968907d08610a5f0a0284ba6`. Agent ID registry `0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F`. Fixed 3% fee recipient `0x225784F1F10aF2c0Bfc50C746c1c0E4d3eA68C51`.
- Every transaction below has `value=0`. Preview amount and destination, run `eth_call` and `eth_estimateGas` with the selected address, and wait for wallet confirmation. Credentials, approvals for claims, and message signatures are unnecessary. Check status, relevant contract event, and the AGC transfer log after confirmation.

## Claim

1. With a packet number, read `canClaim(id, account)` and `quote(id, account)`. Read `packet(id)` for schedule, shares left, gate, and prize state. Without a packet number, read `claimable(account)` for the newest 200 packets. It returns eligible ungated IDs in ascending order.
2. If eligible and shares remain, confirm `claim(id)`. It costs only network gas. `claim()`, `mint()`, and `freeMint()` claim the first eligible ungated packet in the same scan. Use a packet number for asset-gated packets or older packets.
3. On state changes, reread the reason and report it. `claimedOf(id, account)` records ordinary AGC paid to the account. Link the transaction hash and report actual AGC received.

| Code | English | 繁體中文 |
| --- | --- | --- |
| 0 | Eligible | 可領取 |
| 1 | Packet missing | 找不到這包 |
| 2 | Expired | 已到期 |
| 3 | Fully claimed | 已領完 |
| 4 | Packet creator | 開包者不能領自己的包 |
| 5 | Agent ID already claimed this packet | 此 Agent ID 已領過 |
| 6 | Valid Agent ID required | 需要有效的 Agent ID |
| 7 | Yet to start | 尚未開場 |
| 8 | First claim in this contract only | 限本合約首次領取 |
| 9 | Asset gate unmet or unreadable | 未達資產門檻或讀取失敗 |
| 10 | Unsupported token-system address | 此代幣系統地址無法領取 |

## Open a packet

Use `quoteCreate(grossAmount, params)` to preview nominal receipt, 3% fee, principal, minimum share and separate prize. Standard wallet funding uses `minReceived=grossAmount`. The contract records actual receipt. Minimum receipt is 10,000 AGC. Set 1–10,000 shares. Equal shares require at least 1,000 AGC per share, and variable amounts require an initial mean of 1,000 AGC with a 200 AGC minimum. Variable amounts use the previous block hash. `startAt=0` starts immediately, or schedule up to 48 hours ahead. Set expiry between 10 minutes and 7 days from creation, after the start. Use the zero address and zero minimum for no asset gate.

Review and confirm `AGC.approve(packetContract, grossAmount)` for exactly the amount. Wait for success, check the allowance, then separately recheck the quote and preflight and confirm `packet.create(grossAmount, minReceived, params)`. Read `Created` for the packet ID and `Funded` for receipt and fee.

## Prize and refund

A full packet schedules its prize automatically. After expiry, anyone can call `settle(id)` if an unfilled packet with a prize has a claimant. The fixed target is the scheduling block plus 20. Once the target has passed, anyone can call `draw(id)`. The target hash fixes the result. If the hash is temporarily unavailable, retry when it is readable. Calling after 8,191 blocks voids the prize and makes it refundable. The winner can call `claimLucky(id)`. The creator can use `refund(id)` for expired unclaimed principal and any eligible unused or void prize. Only the creator receives refunds.

## Calldata examples

The examples use packet ID 1, 10,000 AGC gross and minimum receipt, two equal shares, a 1,000 AGC prize, and fixture expiry Unix 2000000000. The expiry is a fixture value. Do not send the example as written. Calculate `expiry = nowUnixSeconds + durationSeconds` using the current BSC block timestamp in Unix seconds and a duration from 600 seconds (10 minutes) to 604800 seconds (7 days), for example 3600 seconds. Re-encode `Params.expiry` and your quote parameters before sending. Replace `{packetAddressWord}` with the deployed address without 0x left-padded to 64 hex characters. Send `approve` to AGC and the other examples to the packet contract. Run settlement examples when the packet is in the corresponding state.

<!-- examples generated from the ABI and verified on the BSC fork -->

| Entry | Calldata | BNB value |
| --- | --- | --- |
| approve | `0x095ea7b3{packetAddressWord}00000000000000000000000000000000000000000000021e19e0c9bab2400000` | `0` |
| **create expiry** | **Fixture only. Do not send the following calldata as written.** Set expiry to current Unix seconds + 600–604800 seconds (10 minutes to 7 days). | — |
| create | `0x8613285c00000000000000000000000000000000000000000000021e19e0c9bab240000000000000000000000000000000000000000000000000021e19e0c9bab24000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003635c9adc5dea0000000000000000000000000000000000000000000000000000000000000773594000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000` | `0` |
| claim(uint256) | `0x379607f50000000000000000000000000000000000000000000000000000000000000001` | `0` |
| claim() | `0x4e71d92d` | `0` |
| mint() | `0x1249c58b` | `0` |
| freeMint() | `0x5b70ea9f` | `0` |
| settle | `0x8df828000000000000000000000000000000000000000000000000000000000000000001` | `0` |
| draw | `0x3b3041470000000000000000000000000000000000000000000000000000000000000001` | `0` |
| claimLucky | `0xa37bb0670000000000000000000000000000000000000000000000000000000000000001` | `0` |
| refund | `0x278ecde10000000000000000000000000000000000000000000000000000000000000001` | `0` |
- Sourcify: https://repo.sourcify.dev/56/0xA91D946887A2A625A9E6dBb54E8bc28439D7cA49

Split modes: mode 0 is equal split and mode 1 is lucky split. Lucky-split amounts come from the previous block hash, so they can be predicted before a claim is sent. Every packet sidecoo opens uses equal split.
Entry points: claim(), mint() and freeMint() all just claim one packet share, with value 0. None of them buys or charges anything.
Lucky prize: for packets sidecoo opens, its keeper calls draw(id) after the target block. Anyone else may also call draw(id).
Safety: sidecoo never asks for a private key, seed phrase or pairing code. Never share them with anyone.

分法：mode 0 為平均、mode 1 為拼手氣。拼手氣的金額由前一個區塊的雜湊決定，領取前就能算出。sidecoo 開的紅包全部是平均。
claim()、mint()、freeMint() 都只是領一份紅包，value 為 0，不會買任何東西或收費。
幸運獎：sidecoo 開的紅包，由看守程式在目標區塊過後呼叫 draw(id)；任何人也都可以呼叫。
sidecoo 絕不索取私鑰、助記詞或配對碼，請勿提供給任何人。
