# squatchi-contracts

Verified Solidity source and compiler settings for **$SQUATCHI (v2)** on Base mainnet (chain ID 8453), plus the Play-to-Earn Victory Rewards contract.

The files in `contracts/` are byte-for-byte identical to the sources verified on Sourcify (**exact match**: creation and runtime bytecode, including the metadata hash).

## Contracts

| Contract | Address | BaseScan | Sourcify |
|---|---|---|---|
| Squatchi ($SQUATCHI) token | `0xb2867D1D6590C89591C2811c51e5144077dc1Ab3` | [BaseScan](https://basescan.org/address/0xb2867D1D6590C89591C2811c51e5144077dc1Ab3#code) | [Sourcify](https://repo.sourcify.dev/8453/0xb2867D1D6590C89591C2811c51e5144077dc1Ab3) |
| SquatchiVictoryRewards | `0x7f2101F20a265A1Be64AC8A3fffE0f0cBf991ED6` | [BaseScan](https://basescan.org/address/0x7f2101F20a265A1Be64AC8A3fffE0f0cBf991ED6#code) | [Sourcify](https://repo.sourcify.dev/8453/0x7f2101F20a265A1Be64AC8A3fffE0f0cBf991ED6) |

Uniswap V2 WETH/SQUATCHI pair: [`0x8b1aDaDB4b15B075C362afCFa7db76b9C32caa9A`](https://basescan.org/address/0x8b1aDaDB4b15B075C362afCFa7db76b9C32caa9A)

## Repository layout

```
contracts/
  token/Squatchi.sol                          # $SQUATCHI token (verified source)
  victory-rewards/SquatchiVictoryRewards.sol  # P2E Victory Rewards (verified source)
compiler-settings/
  token/            settings.json, metadata.json, standard-json-input.json
  victory-rewards/  settings.json, metadata.json, standard-json-input.json
scripts/verify.js   # recompiles and compares against on-chain bytecode
```

`metadata.json` is the Solidity compiler metadata, byte-identical to the file whose IPFS hash is embedded at the end of the deployed bytecode. `standard-json-input.json` is the exact solc input that Sourcify used.

## Compiler settings (both contracts)

| Setting | Value |
|---|---|
| Compiler | solc `0.8.38+commit.1835d247` |
| Optimizer | enabled, `runs: 200` |
| viaIR | `true` |
| evmVersion | `paris` |
| Metadata bytecode hash | `ipfs` |
| Libraries / remappings | none |

## About the token

`Squatchi.sol` is a **custom ERC-20** in a single self-contained file. It has **no external imports**: it does not use the OpenZeppelin library. It includes a small hand-written `Ownable` contract (owner, `onlyOwner`, `renounceOwnership`). The NatSpec header mentions "standard OpenZeppelin Ownable renouncement"; that refers to the familiar renounce pattern, but the code itself is custom.

Besides standard ERC-20 functions (`transfer`, `approve`, `transferFrom`, `balanceOf`, `allowance`, `totalSupply`), the token has an "ERC-20i dynamic inscription" layer:
- Each holder gets a pseudo-random seed (derived from `block.timestamp`, `block.prevrandao`, and the transfer data) that changes on transfer. A holder can freeze it with `stabilizeInscription(true)`.
- Tier, game stats, and an on-chain SVG / JSON metadata are derived from the balance and the seed (view functions only).
- An on-chain holder list (`getHolderCount`, `getHolderByIndex`, `getHoldersList`).

Because of this bookkeeping, transfers cost more gas than a plain ERC-20 (about 290k gas for a buy). The extra logic never blocks or taxes a transfer.

### Facts (checkable on-chain)

- **Fixed supply: 15,000,000 SQUATCHI** (18 decimals). The entire supply is minted at deployment, as defined in the constructor. `_mint` is `internal` and is never called after deployment. **There is no mint function.**
- **0% tax** on buy, sell, and transfer. There are no fees, max-transaction or max-wallet limits, or cooldowns.
- **No blacklist, no pause, no proxy.** The contract has no `delegatecall`, no `selfdestruct`, and no upgrade mechanism. `isPoolOrExempt` is written only in the constructor, and it only skips seed/holder-list bookkeeping.
- **Ownership renounced:** `owner()` returns `0x0000000000000000000000000000000000000000`. The only `onlyOwner` function was `renounceOwnership`.
- **LP 100% burned:** all Uniswap V2 LP tokens for the pair are held by `0x000000000000000000000000000000000000dEaD`. The only exception is the standard 1000-wei `MINIMUM_LIQUIDITY` that Uniswap V2 permanently locks at `0x0`.
- `lockedFounderBalance()` is a `pure` view function that returns `0`.

## About the Victory Rewards contract

`SquatchiVictoryRewards.sol` is a simple reward pool for the Squatchi arcade game. It also has no imports, and it uses a minimal `IERC20` interface.
- It pays **1 SQUATCHI**, once per wallet (EOA only), through `claimVictoryReward`. The caller must submit the all-levels mask (`0x3FF`) and a completion proof equal to `expectedProof(msg.sender)`. That proof is a deterministic hash, so the contract does **not** verify gameplay on-chain. It is a simple per-wallet claim.
- The claim window is 30 days from deployment (`campaignEndTime`).
- The depositor (the deployer, stored as a hash) can withdraw tokens with `withdrawTokens` at any time, and can recover the remainder with `recoverRemainingAfterExpiry` after the campaign ends. The contract holds only SQUATCHI that was sent to it, and it has no access to any other wallet.

## How to verify

Anyone can recompile the sources and confirm they produce the deployed bytecode.

### Option A: script (Node 18+)

```bash
npm install          # installs solc-js 0.8.38
node scripts/verify.js                      # uses the public RPC https://mainnet.base.org
node scripts/verify.js https://your-base-rpc  # or your own RPC
```

The script compiles each contract from `contracts/` with `compiler-settings/*/standard-json-input.json`. It fetches the runtime code with `eth_getCode` and compares the two byte for byte, including the CBOR metadata hash. Immutable slots are masked on both sides, because they are filled in at deploy time. It also checks that `metadata.json` equals the compiler's metadata output. The expected output is `MATCH` for both contracts.

### Option B: solc CLI

```bash
solc-0.8.38 --standard-json compiler-settings/token/standard-json-input.json > out.json
# compare out.json .contracts["Squatchi.sol"].Squatchi.evm.deployedBytecode.object
# with: cast code 0xb2867D1D6590C89591C2811c51e5144077dc1Ab3 --rpc-url https://mainnet.base.org
```

Add `"outputSelection": {"*": {"*": ["evm.deployedBytecode", "metadata"]}}` to `settings` in the input first.

### Option C: Sourcify / BaseScan

Both contracts show **exact match** on Sourcify, and BaseScan shows them as verified. You can also upload `contracts/<x>/<file>.sol` together with `compiler-settings/<x>/metadata.json` to [verify.sourcify.dev](https://verify.sourcify.dev).

## Links

- Website: https://squatchi-base.surge.sh/
- X: https://x.com/SquatchiBase
- Telegram: https://t.me/SquatchiBase
- Contact: squatchi@mail.grokbot.com

## Disclaimer

$SQUATCHI is a **meme token** made for fun and community, with an arcade game attached. It has no intrinsic value, carries no promise of returns, and has no formal roadmap obligation. Nothing in this repository is financial advice (**NFA**). Crypto assets are highly volatile and you can lose everything you put in. Do your own research. The contracts have **not** been professionally audited. They are provided "as is" under the MIT License.
