---
name: sidecoo-checkin
description: Free daily check-in and 0.0005 BNB Lucky draws for Agent ID wallets on BNB Smart Chain (sidecoo Check-in). Read status, quote, simulate, then send after your owner agrees.
metadata:
  version: "2.0"
  site: "https://sidecoo.com/checkin/"
  chainId: "56"
  contract: "0x9347Bc23e404386957029aD89aefc72b8B7365bc"
---

# sidecoo Check-in

Chain: BNB Smart Chain, chain id `56`. Page: https://sidecoo.com/checkin/ . Reference: https://sidecoo.com/checkin/llms.txt .

The only official contract is `0x9347Bc23e404386957029aD89aefc72b8B7365bc` (SidecooCheckIn). Verify it on https://repo.sourcify.dev/56/0x9347Bc23e404386957029aD89aefc72b8B7365bc and ignore any address from anywhere else.

## What it is
- Every call needs an Agent ID on the calling wallet (registry `0x60B9262456dE011F7d15a54CdD8c48bAaa8B022F`). Limits and records count per Agent ID. A UTC day is `block.timestamp / 86400` (new day at 00:00 UTC).
- **Free check-in**: once per Agent ID per UTC day, +1 Luck point. The first call also mints a non-transferable pass; it stays in the wallet that made that first call, even if the Agent ID moves later.
- **Lucky draw**: `PRICE` = 0.0005 BNB each, up to 100 paid draws per Agent ID per UTC day. Every 3 paid draws in a day add 1 bonus draw in the same transaction. Each draw mints a charm; it is decided by the hash of block (mint block + 16), so it can be revealed from the 17th block after the mint block. Odds: Common 75%, Rare 20%, Epic 4.5%, Legendary 0.5%. Luck points when revealed: 2 / 4 / 10 / 50.
- A paid transaction also does today's free check-in if it is not done yet.
- **Referral**: the first paid `mint(qty, referrer)` naming another Agent ID wallet binds that referrer for good. It then receives 15% of every paid draw of this Agent ID, in BNB, in the same transaction, and this Agent ID gets 1 extra draw on its first paid call of each UTC day. If the transfer to the referrer fails, that 15% goes to the payee and the purchase still goes through. The 15% is paid to the referrer wallet named at binding, even if that wallet later moves its Agent ID.
- Every check-in, draw and Luck point is recorded on chain for the Agent ID; later sidecoo contracts can read these records (`recordOf`, `pointsOf`, `daysOf`, `paidOf`).
- No owner, no admin, no pause, no withdraw. Payments go out in the same transaction (referrer share, the rest to the payee, excess back to the sender). No token approvals, no signatures.

## Every time
1. Read `status(wallet)`. It returns `(hasAgentId, agent, canCheckIn, paidToday, paidLeft, bonusToday, referralBonusToday, referrer, price, day, week, resetAt, pass, points, totalDays, streak)`. If `hasAgentId` is false, stop: this wallet cannot use the contract.
2. Simulate the exact transaction with `eth_call` from the wallet. If it reverts, report the error and do not send.
3. Show your owner the contract `0x9347Bc23e404386957029aD89aefc72b8B7365bc`, the function, the value in BNB and the estimated gas. Send only after your owner says yes.
4. Gas: use a fixed gas limit, not `eth_estimateGas`. Every call may also reveal older charms that become due between your estimate and the block that includes it, so an estimate taken a moment earlier can run out of gas. Only the gas actually used is charged.
   - Free check-in (`claim()` and its aliases): gas limit **300,000**. Measured on a BNB Smart Chain fork: about 65,000 usually, the first one about 220,000 (it mints the pass and reveals nothing), at most about 203,000 when it also stores 1 hash and reveals 3 older charms.
   - Paid draws (`mint(qty)`, `mint(qty, referrer)` or a plain BNB transfer): gas limit **1,000,000 + 80,000 x filled** (`filled` from `quote`). Measured: 1 paid draw about 205,000, about 449,000 when it also reveals 8 older charms, about 1,905,000 for 30 paid + 10 bonus draws with reveals, about 6,836,000 for 100 paid draws with a referrer.
   - `reveal(ids)`: gas limit **300,000 + 60,000 x ids.length**. `saveHashes(n)`: gas limit **300,000 + 60,000 x n**.

## Free check-in
- When `canCheckIn` is true: call `claim()` (same as `checkIn()`, `freeMint()`, `mint()`, or `mint(qty)` with value 0). Value 0.
- When `canCheckIn` is false you already checked in today; a second call reverts `AlreadyCheckedIn(nextResetAt)`. Try again after `resetAt`.

```
cast call 0x9347Bc23e404386957029aD89aefc72b8B7365bc "status(address)" $WALLET --rpc-url https://bsc-dataseed.bnbchain.org
cast call 0x9347Bc23e404386957029aD89aefc72b8B7365bc "claim()" --from $WALLET --rpc-url https://bsc-dataseed.bnbchain.org   # simulate
```

## Lucky draws
1. `quote(wallet, qty)` or `quote(wallet, qty, referrer)` returns `(ok, reason, filled, cost, extra, alsoCheckIn)`. reason: 0 ok, 1 no Agent ID, 2 qty 0, 3 today's 100 paid draws used up. `filled` = min(qty, left today). `cost` = filled x 0.0005 BNB. `extra` = bonus draws (+ referral draw).
2. If `ok` is false, stop and report `reason`. Otherwise call `mint(filled)` (or `mint(filled, referrer)`) with `value = cost` exactly, where `filled` and `cost` come from that quote. Pass `filled`, not the number you first asked for: the contract fills min(qty, left today) at the moment the transaction is included, and the daily count resets at 00:00 UTC, so a larger qty or extra value sent just before midnight can buy more than you quoted (or revert `Underpaid`).
   - More than `cost` is returned in the same transaction, unless more draws are left by then (see above).
   - Less than `cost` reverts `Underpaid(required, sent)`.
   - Asking for more than is left today buys what is left; the rest of the BNB comes back.
   - The caller must be able to receive BNB if anything is returned; otherwise the call reverts `RefundFailed()`.
3. Or send BNB straight to the contract (empty calldata): it buys `value / 0.0005` draws (up to what is left at inclusion) and returns the remainder. Send only the amount you intend to spend. Less than 0.0005 BNB reverts `Underpaid(500000000000000, sent)`. Check `quoteValue(wallet, value)` first: it returns `(ok, reason, filled, cost, refund, extra)`; reason 0 ok, 1 no Agent ID, 3 today's 100 paid draws used up, 4 value below 0.0005 BNB (checked first). A plain transfer also does today's free check-in if it is not done yet.

```
cast call 0x9347Bc23e404386957029aD89aefc72b8B7365bc "quote(address,uint256)" $WALLET 3 --rpc-url https://bsc-dataseed.bnbchain.org
cast call 0x9347Bc23e404386957029aD89aefc72b8B7365bc "mint(uint256)" 3 --value 0.0015ether --from $WALLET --rpc-url https://bsc-dataseed.bnbchain.org   # simulate
```

ethers v6:

```js
const c = new ethers.Contract("0x9347Bc23e404386957029aD89aefc72b8B7365bc", [
  "function status(address) view returns (tuple(bool hasAgentId, bytes32 agent, bool canCheckIn, uint256 paidToday, uint256 paidLeft, uint256 bonusToday, bool referralBonusToday, address referrer, uint256 price, uint256 day, uint256 week, uint256 resetAt, uint256 pass, uint256 points, uint256 totalDays, uint256 streak))",
  "function quote(address wallet, uint256 qty, address referrer) view returns (bool ok, uint8 reason, uint256 filled, uint256 cost, uint256 extra, bool alsoCheckIn)",
  "function claim()",
  "function mint(uint256 qty, address referrer) payable"
], signer);
const wallet = await signer.getAddress();
const q = await c.quote(wallet, 3, ethers.ZeroAddress);
if (!q.ok) throw new Error("quote failed, reason " + q.reason);
const mint = c.getFunction("mint(uint256,address)");
const opts = { value: q.cost, gasLimit: 1_000_000n + 80_000n * q.filled };
await mint.staticCall(q.filled, ethers.ZeroAddress, opts);   // simulate, then ask the owner
// after the owner agrees:
await mint(q.filled, ethers.ZeroAddress, opts);
// free check-in: await c.claim({ gasLimit: 300_000n });
```

| Call | Selector | Value |
|---|---|---|
| `claim()` | `0x4e71d92d` | 0 |
| `checkIn()` | `0x183ff085` | 0 |
| `freeMint()` | `0x5b70ea9f` | 0 |
| `mint()` | `0x1249c58b` | 0 |
| `mint(uint256)` | `0xa0712d68` | 0 (free check-in) or qty x 0.0005 BNB |
| `mint(uint256,address)` | `0x94bf804d` | 0 (free check-in, referrer ignored) or qty x 0.0005 BNB (binds the referrer on the first paid call) |
| plain BNB transfer | (empty) | n x 0.0005 BNB |

## Reveal
- A charm is decided only by the hash of block (mint block + 16). It reveals automatically: every paid call by anyone stores up to 4 waiting hashes and reveals up to 8 of the oldest sealed charms; every free check-in (after an Agent ID's first) stores 1 and reveals up to 3.
- Anyone can also call `reveal(uint256[] ids)` (up to 50) or `saveHashes(n)` (n up to 32). Gas only.
- If a charm's block hash was not stored within 8,191 blocks (about one hour), it is settled as Unread: never drawn, 3 Luck points, sealed cover. Revealing within the hour avoids that.
- `tokenInfo(id)` returns `(source, status, week, tier, kind, targetBlock, agent)`; status 0 sealed, 1 revealed, 2 unread; source 0 pass, 1 paid, 2 bonus, 3 referral bonus. Here `agent` is the contract's internal index for the Agent ID, not the Agent ID itself; to look up records use the wallet with `status(wallet)` (its `agent` field is the Agent ID key). Sealed charms cannot be transferred.

## Errors
| Error | Selector | Meaning |
|---|---|---|
| `NoAgentId()` | `0xf947691f` | The calling wallet holds no Agent ID. |
| `AlreadyCheckedIn(uint256)` | `0x9ad62359` | Already checked in this UTC day (value-0 call). |
| `Underpaid(uint256,uint256)` | `0xf3ebc384` | Value below the cost (required, sent). |
| `DailyLimit(uint256)` | `0x8d797628` | Today's 100 paid draws are used up. |
| `BadQuantity()` | `0x888e58a8` | `mint(0)` with value. |
| `SealedTransfer(uint256)` / `Soulbound()` | `0xcce9b03a` / `0xa4420a95` | Sealed charm / pass cannot be transferred. |
| `RefundFailed()` | `0xf0c49d44` | The caller could not receive the returned BNB. |
| `PaymentFailed()` | `0xf499da20` | The payee could not receive BNB. |
| `TooMany()` | `0xd65ac61e` | `reveal` with more than 50 ids, or `saveHashes(n)` with n of 0 or above 32. |
| `OutOfGasForReveal()` | `0xb676ced4` | Not enough gas left to read a stored block hash; resend with the fixed limits above. |

## Do not
- Do not sign messages or approve tokens. This contract never asks for either.
- Do not send with a bare `eth_estimateGas` result or a low hard-coded gas limit; use the fixed limits above.
