diff --git a/.env.local.example b/.env.local.example deleted file mode 100644 index 7ce1fa2..0000000 --- a/.env.local.example +++ /dev/null @@ -1,4 +0,0 @@ -VITE_PRIVY_APP_ID= -VITE_MONAD_TESTNET_RPC_URL= -VITE_MONAD_MAINNET_RPC_URL= -VITE_2048_FAUCET_URL= diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..da174b3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,99 @@ +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + frontend: + name: Frontend + runs-on: ubuntu-latest + defaults: + run: + working-directory: packages/frontend + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + working-directory: . + + - name: Lint + run: pnpm lint + + - name: Type check and Build + run: pnpm build + + contracts: + name: Contracts + runs-on: ubuntu-latest + defaults: + run: + working-directory: packages/contracts + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Foundry + uses: foundry-rs/foundry-toolchain@v1 + + - name: Install Forge dependencies + run: forge install foundry-rs/forge-std@3b20d60d14b343ee4f908cb8079495c07f5e8981 Vectorized/solady@c9e079c0ca836dcc52777a1fa7227ef28e3537b3 --no-git + + - name: Lint (Format Check) + run: forge fmt --check + + - name: Build + run: forge build + + - name: Test + run: forge test -vvv + + indexer: + name: Indexer + runs-on: ubuntu-latest + defaults: + run: + working-directory: packages/indexer + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + working-directory: . + + - name: Install Envio CLI + run: npm install -g envio + + - name: Codegen + run: pnpm codegen diff --git a/.gitignore b/.gitignore index a547bf3..eca36e5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,24 +1,46 @@ -# Logs -logs +# Dependencies +node_modules/ +.pnp +.pnp.js + +# Production builds +dist/ +build/ + +# Testing +coverage/ + +# Misc +.DS_Store *.log +*.log.* npm-debug.log* yarn-debug.log* yarn-error.log* pnpm-debug.log* lerna-debug.log* -node_modules -dist -dist-ssr -*.local - -# Editor directories and files +# IDEs .vscode/* !.vscode/extensions.json -.idea +.idea/ +*.swp +*.swo +*~ + +# Environment variables +.env +.env.local +.env.development.local +.env.test.local +.env.production.local + +# Foundry/Forge +cache/ +out/ +broadcast/ +/packages/contracts/lib/ + +# OS .DS_Store -*.suo -*.ntvs* -*.njsproj -*.sln -*.sw? +Thumbs.db diff --git a/ARCHITECTURE.md b/ARCHITECTURE.md new file mode 100644 index 0000000..4a9381d --- /dev/null +++ b/ARCHITECTURE.md @@ -0,0 +1,562 @@ +# Architecture Overview + +This document explains how the onchain 2048 game works, from the smart contracts to the frontend, and how they interact to create a fully decentralized gaming experience. + +## Table of Contents + +1. [High-Level Architecture](#high-level-architecture) +2. [Smart Contract Design](#smart-contract-design) +3. [Board Representation](#board-representation) +4. [Game Lifecycle](#game-lifecycle) +5. [Frontend Architecture](#frontend-architecture) +6. [Transaction Flow](#transaction-flow) +7. [Key Design Decisions](#key-design-decisions) + +--- + +## High-Level Architecture + +The 2048 game is played entirely onchain with these components: + +``` +┌─────────────────────────────────────────────────────────────┐ +│ Frontend (React) │ +│ • User interface and game rendering │ +│ • Local game logic (optimistic updates) │ +│ • Transaction signing via Privy embedded wallets │ +└─────────────────────────────────────────────────────────────┘ + │ + │ Transactions + ▼ +┌─────────────────────────────────────────────────────────────┐ +│ Monad Blockchain (EVM-compatible) │ +│ │ +│ ┌───────────────────────────────────────────────────────┐ │ +│ │ Monad2048.sol (Main Contract) │ │ +│ │ • Game state storage │ │ +│ │ • Validates all moves │ │ +│ │ • Prevents cheating/replays │ │ +│ └───────────────────────────────────────────────────────┘ │ +│ │ │ +│ │ Uses │ +│ ▼ │ +│ ┌───────────────────────────────────────────────────────┐ │ +│ │ LibBoard.sol (Game Logic Library) │ │ +│ │ • Board transformations (move processing) │ │ +│ │ • Move validation │ │ +│ │ • Tile compression and merging │ │ +│ └───────────────────────────────────────────────────────┘ │ +└─────────────────────────────────────────────────────────────┘ +``` + +--- + +## Smart Contract Design + +### Monad2048.sol - Main Game Contract + +**Purpose**: Manages game state and ensures all moves are valid. + +**Key Components**: + +1. **Game State Storage**: + +```solidity +struct GameState { + uint8 move; // Last move direction (UP=0, DOWN=1, LEFT=2, RIGHT=3) + uint120 nextMove; // Next move number (4, 5, 6, ...) + uint128 board; // Current board state (encoded as 128 bits) +} + +mapping(bytes32 gameId => GameState state) public state; +``` + +2. **Replay Prevention**: + +```solidity +// Prevents reusing the same starting position + first 3 moves +mapping(bytes32 gameHash => bytes32 gameId) public gameHashOf; +``` + +3. **Two Main Functions**: + + **`startGame(gameId, boards[4], moves[3])`**: + - Called after the player makes their first 3 moves locally + - Validates the starting board has exactly 2 tiles (value 2 or 4) + - Validates each of the first 3 moves is legal + - Prevents replay attacks by hashing the board sequence + - Stores the game state after move 3 + + **`play(gameId, move, resultBoard)`**: + - Called for every move after the first 3 + - Validates the move transforms the previous board correctly + - Updates the game state with the new board + - Emits `NewMove` event + +### LibBoard.sol - Game Logic Library + +**Purpose**: Pure functions that implement 2048 game mechanics. + +**Key Functions**: + +1. **`validateStartPosition(board)`**: Ensures starting board has exactly 2 tiles +2. **`validateTransformation(prevBoard, move, nextBoard, seed)`**: Verifies a move is legal +3. **`processMove(board, move, seed)`**: Applies a move to a board and adds a random tile +4. **Move Processing Pipeline**: + ``` + Board → Compress → Merge → Add Random Tile → New Board + ``` + +**Move Directions**: + +- `UP = 0`: Tiles slide upward +- `DOWN = 1`: Tiles slide downward +- `LEFT = 2`: Tiles slide left +- `RIGHT = 3`: Tiles slide right + +--- + +## Board Representation + +The game board is encoded as a single **128-bit unsigned integer** (`uint128`). + +### Encoding Format + +- Board has 16 cells (4x4 grid) +- Each cell uses 8 bits (1 byte) +- Cell value stores **log₂(tile_value)** instead of the actual tile value + +**Why log₂?** This allows efficient storage: + +``` +Tile Value → Stored Value (log₂) +───────────────────────────────── +Empty (0) → 0 +2 → 1 +4 → 2 +8 → 3 +16 → 4 +32 → 5 +64 → 6 +128 → 7 +256 → 8 +512 → 9 +1024 → 10 +2048 → 11 +4096 → 12 +``` + +### Memory Layout + +The board is stored as 128 bits (16 bytes) laid out as: + +``` +Bit positions: [127-120][119-112]...[15-8][7-0] +Cell positions: [0] [1] ... [14] [15] + +Grid mapping: + 0 1 2 3 + 4 5 6 7 + 8 9 10 11 + 12 13 14 15 +``` + +**Example**: A board with tiles `[2, 4, _, _]` in the first row would be: + +``` +0x01020000000000000000000000000000 + ^^ ^^ (rest are zeros) + | | + | +-- log₂(4) = 2 + +----- log₂(2) = 1 +``` + +--- + +## Game Lifecycle + +### 1. Game Initialization (Local) + +**User Action**: Clicks "New Game" + +**Frontend Flow**: + +1. Generates a unique `gameId`: + - First 160 bits: User's Ethereum address + - Last 96 bits: Random nonce +2. Creates initial board with 2 random tiles (90% chance of 2, 10% chance of 4) +3. Sets `playedMovesCount = 1` +4. No blockchain transaction yet + +### 2. First Three Moves (Local + Validation) + +**User Action**: Swipes or presses arrow keys + +**Frontend Flow**: + +1. Processes move locally (compress, merge, add random tile) +2. Encodes the board state +3. Stores the move in `encodedMoves` array +4. Increments `playedMovesCount` + +**Why wait until move 3?** There are billions of possible board states possible after 3 moves. This lets the contract mandate two random players to have different start positions. + +### 3. Move 3 → Blockchain Initialization + +**User Action**: Makes the 3rd move + +**Frontend Flow**: + +1. Processes the move locally +2. Calls `initializeGameTransaction(gameId, boards[4], moves[3])` + - `boards[4]`: Initial board + boards after moves 1, 2, 3 + - `moves[3]`: The 3 move directions + +**Smart Contract Flow** (`startGame`): + +1. Validates the game ID encodes the player's address +2. Checks the game ID hasn't been used +3. Validates starting board has exactly 2 tiles +4. Validates each transformation using `LibBoard.validateTransformation()` +5. Checks board sequence hasn't been played before (anti-replay) +6. Stores game state after move 3 +7. Emits `NewGame` event + +**Transaction Details**: + +- Gas: ~150,000 +- Method: `eth_sendRawTransactionSync` (Monad's synchronous transaction API) +- Timeout: 10 seconds + +### 4. Subsequent Moves (Onchain) + +**User Action**: Makes move 4, 5, 6, ... + +**Frontend Flow**: + +1. Processes move locally (optimistic update) +2. Calls `playNewMoveTransaction(gameId, boardAfterMove, move, moveCount)` + +**Smart Contract Flow** (`play`): + +1. Validates the game ID matches the sender +2. Retrieves the previous board state +3. Applies the move using `LibBoard.processMove()` +4. Compares result to submitted board - must match exactly +5. Updates game state +6. Emits `NewMove` event + +**Transaction Details**: + +- Gas: ~100,000 +- Each move is a separate transaction +- Frontend tracks nonce locally to send transactions sequentially + +### 5. Random Tile Placement (Deterministic) + +**How randomness works**: + +Both frontend and contract use the same deterministic seed: + +```solidity +seed = keccak256(gameId || moveNumber) +``` + +This ensures: + +- Frontend can predict where tiles will appear +- Contract validates the same placement +- No randomness manipulation by players + +**Tile selection**: + +1. Find all empty cells +2. Use `seed % emptyCount` to pick a cell +3. Use `seed % 100` to decide value (>90 = tile 4, else tile 2) + +### 6. Game Over Detection + +**Frontend checks after each move**: + +1. Is the board full? (16 tiles) +2. Are there any adjacent tiles with the same value? +3. If no valid moves remain → Game Over + +**No onchain game-over transaction** - the contract simply won't accept invalid moves. + +### 7. Game Resumption + +**User Action**: Clicks "Resync Game" or switches networks + +**Frontend Flow**: + +1. Calls `getLatestGameBoard(gameId)` to read contract state +2. Decodes the board (convert log₂ values back to tile values) +3. Restores the board visually +4. Resumes gameplay from that point + +--- + +## Frontend Architecture + +### Technology Stack + +- **React 19**: UI framework +- **Vite**: Build tool +- **Privy**: Authentication and embedded wallets (no seed phrases needed) +- **Viem**: Ethereum library for contract interactions +- **Tailwind CSS**: Styling + +### Key Components + +1. **App.tsx** - Main game logic: + - Game state management (tiles, score, game over) + - Move processing (compress, merge, add tiles) + - Keyboard and touch input handling + - Transaction orchestration + +2. **Board.tsx** - Visual rendering: + - 4x4 grid display + - Tile animations (slide, merge, appear) + - Responsive design + +3. **useTransactions.tsx** - Blockchain interaction: + - Transaction signing + - Nonce management (local tracking for sequential txs) + - Balance checking + - Contract method calls + +4. **NetworkContext.tsx** - Network management: + - Testnet/Mainnet switching + - RPC client configuration + - Explorer URL mapping + +### State Management + +**Game State**: + +```typescript +{ + tiles: Tile[], // Current tiles on board + score: number, // Current score + gameOver: boolean, // Is game finished? + activeGameId: Hex, // Current game's ID + encodedMoves: EncodedMove[], // History of moves + playedMovesCount: number // How many moves made +} +``` + +**Tile Object**: + +```typescript +{ + id: string, // Unique identifier + value: number, // 2, 4, 8, ..., 2048 + row: number, // 0-3 + col: number, // 0-3 + mergedFrom?: string[], // IDs of tiles that merged + isNew?: boolean // Just spawned? +} +``` + +--- + +## Transaction Flow + +### Optimistic Updates + +The frontend uses **optimistic updates** to provide instant feedback: + +1. User makes a move +2. Frontend immediately updates the UI +3. Transaction is sent to blockchain in the background +4. If transaction fails, board reverts to previous state + +### Error Handling + +**If a transaction fails**: + +1. Frontend catches the error +2. Displays an error toast with details +3. Reverts the board to the pre-move state +4. User can try again or resync with contract + +**Insufficient Balance**: + +- Opens a faucet dialog +- Provides link to get test tokens +- Prevents further moves until balance restored + +### Nonce Management + +**Problem**: Sending multiple transactions quickly requires careful nonce tracking. + +**Solution**: + +```typescript +userNonce.current = await getTransactionCount(address) + +// For each transaction: +const nonce = userNonce.current +userNonce.current = nonce + 1 // Increment immediately + +await sendTransaction({ nonce, ... }) +``` + +This allows transactions to be sent sequentially without waiting for confirmation. + +--- + +## Key Design Decisions + +### 1. Why Wait Until Move 3? + +**Gas Optimization**: Starting a game with 1 transaction is cheaper than 4 separate transactions. + +**Trade-off**: First 3 moves aren't validated until the 4th move, but the contract checks all 3 retroactively. + +### 2. Why Store Board as uint128? + +**Efficiency**: + +- 128 bits fits perfectly in a single storage slot +- Using log₂ encoding allows values up to 2^255 (way beyond 2048) +- Cheaper to store and read than an array + +### 3. Why Deterministic Randomness? + +**Verifiability**: + +- Contract can validate that frontend placed tiles correctly +- No need for oracle or VRF (Verifiable Random Function) +- Prevents cheating - can't "reroll" tile placement + +**Seed formula**: `keccak256(gameId || moveNumber)` ensures: + +- Each move gets a unique seed +- Players can't predict future tiles +- Contract and frontend agree on placement + +### 4. Why Privy Embedded Wallets? + +**User Experience**: + +- No seed phrase management +- Social login (Google, email) +- Passkey support +- Reduces friction for non-crypto users + +### 5. Why Monad? + +**Performance**: + +- Synchronous transaction confirmation (`eth_sendRawTransactionSync`) +- Fast block times +- Low latency for onchain gaming +- Each move confirmed within ~10 seconds + +### 6. Why Validate Every Move Onchain? + +**Trust Minimization**: + +- Anyone can verify game integrity +- Scores are provably legitimate +- No server can manipulate outcomes +- Truly decentralized gaming + +### 7. Board Encoding Efficiency + +**Log₂ encoding saves space**: + +- Normal encoding: 16 cells × 16 bits = 256 bits +- Log₂ encoding: 16 cells × 8 bits = 128 bits +- 50% storage reduction + +**Bit manipulation benefits**: + +- Fast tile merging with bit shifts +- Efficient empty cell detection +- Compact state representation + +--- + +## Security Features + +### 1. Game ID Validation + +The game ID must encode the player's address in the first 160 bits: + +```solidity +require(player == address(uint160(uint256(gameId) >> 96))) +``` + +This ensures: + +- Only the game creator can make moves +- No one can hijack another player's game + +### 2. Replay Attack Prevention + +The contract hashes the starting position + first 3 moves: + +```solidity +bytes32 hashedBoards = keccak256(abi.encodePacked(boards)) +require(gameHashOf[hashedBoards] == bytes32(0)) +gameHashOf[hashedBoards] = gameId +``` + +This prevents: + +- Reusing a winning game sequence +- Claiming multiple high scores from one game + +### 3. Move Validation + +Every move is validated by recomputing it: + +```solidity +require(processMove(prevBoard, move, seed) == resultBoard) +``` + +This ensures: + +- No invalid board states +- Tiles merge correctly +- Random tiles placed according to seed + +### 4. Client-Side Nonce Tracking + +Prevents nonce conflicts when sending rapid transactions: + +- Frontend tracks nonce locally +- Increments immediately after sending +- Prevents transaction race conditions + +--- + +## Contract Addresses + +**Testnet (Chain ID: 10143)**: + +- Address: `0xC52d29f79b2552801e95C8Dc7646f59125009904` + +**Mainnet (Chain ID: 143)**: + +- Address: `0x53748668642735CDa45935716525E7DFbC8aAACC` + +Both deployments use identical contract code with gas optimizations: + +- Solidity 0.8.28 +- Optimizer runs: 2,000,000 +- Via IR compilation +- EVM version: Paris + +--- + +## Further Reading + +- [Monad Developer Docs](https://docs.monad.xyz) +- [2048 Game Rules]() +- [Privy Documentation](https://docs.privy.io) +- [Viem Documentation](https://viem.sh) +- [Foundry Book](https://book.getfoundry.sh) diff --git a/FEATURE.md b/FEATURE.md new file mode 100644 index 0000000..ff6523d --- /dev/null +++ b/FEATURE.md @@ -0,0 +1,1532 @@ +# Realtime Leaderboard Feature + +## Overview + +Add a realtime updating top-10 high score leaderboard to the 2048 on Monad game. The leaderboard displays the highest-scoring games across all players, updates in realtime as new high scores are achieved, and features animated entry effects for new leaderboard positions. + +**Key Requirements**: +- Primary ranking by **actual game score** (sum of merged tiles) +- Each entry shows: score, moves played, gas consumed, total MON burned +- Same player can appear multiple times (one entry per game) +- Handle all data pipeline states: empty, syncing, realtime + +--- + +## Architecture + +### Data Flow + +``` +┌─────────────────┐ Events + Txs ┌─────────────────┐ Index ┌─────────────────┐ +│ Monad2048 │ ─────────────▶ │ Envio │ ───────────▶ │ PostgreSQL │ +│ Smart Contract │ NewGame │ HyperIndex │ │ (Local/Hosted) │ +│ │ NewMove │ Indexer │ │ │ +└─────────────────┘ + Receipts └─────────────────┘ └────────┬────────┘ + │ + GraphQL API + │ + ▼ +┌─────────────────┐ Fetch ┌─────────────────┐ Query ┌─────────────────┐ +│ React │ ◀───────────── │ Leaderboard │ ◀────────── │ Hasura │ +│ Frontend │ Leaderboard │ Hook │ GraphQL │ GraphQL Engine │ +│ │ + Status │ + IndexerStatus│ │ │ +└─────────────────┘ └─────────────────┘ └─────────────────┘ +``` + +### Why HyperIndex (Not Direct HyperSync) + +| Consideration | HyperSync Direct | HyperIndex | +|--------------|------------------|------------| +| Historical backfill | Client must process all events | Pre-indexed, instant queries | +| Score calculation | Must decode boards client-side | Computed in event handlers | +| Gas/MON tracking | Must fetch receipts separately | Indexed with transactions | +| Realtime updates | Must poll events + recompute | Automatic indexing + GraphQL | +| Infrastructure | API token in frontend (security risk) | Hosted service, secure endpoint | +| Query flexibility | Limited filtering | Full GraphQL with sorting/pagination | +| Local development | N/A | Docker-based local stack | + +**Decision**: Use **Envio HyperIndex** hosted service for production, with local Docker setup for development. + +--- + +## Monorepo Commands (Root-Level Scripts) + +### Package Scripts Configuration + +#### Root `package.json` additions + +```json +{ + "scripts": { + "dev": "pnpm run --parallel dev:frontend dev:indexer", + "dev:frontend": "pnpm --filter frontend dev", + "dev:indexer": "pnpm --filter indexer dev", + "build": "pnpm run --parallel build:frontend build:indexer", + "build:frontend": "pnpm --filter frontend build", + "build:indexer": "pnpm --filter indexer codegen", + "indexer:start": "pnpm --filter indexer dev", + "indexer:stop": "pnpm --filter indexer stop", + "indexer:codegen": "pnpm --filter indexer codegen", + "clean": "pnpm run --parallel clean:frontend clean:indexer", + "clean:frontend": "pnpm --filter frontend clean", + "clean:indexer": "pnpm --filter indexer stop" + } +} +``` + +### Command Reference + +| Command | Description | +|---------|-------------| +| `pnpm dev` | Run full stack (frontend + indexer) in parallel | +| `pnpm dev:frontend` | Run only the webapp | +| `pnpm dev:indexer` | Run only the data pipeline (indexer + Hasura + PostgreSQL) | +| `pnpm indexer:start` | Alias for starting the data pipeline | +| `pnpm indexer:stop` | Stop and clean up Docker containers | +| `pnpm indexer:codegen` | Regenerate types from GraphQL schema | +| `pnpm build` | Build all packages for production | + +### Prerequisites + +```bash +# Required for indexer +docker --version # Docker must be running + +# Install dependencies +pnpm install +``` + +--- + +## Technical Design + +### 1. Score Calculation Strategy + +The smart contract events emit board states as 128-bit encoded integers. **Actual game score** is calculated by detecting merges between consecutive board states. + +**Board Encoding** (from contract): +- 16 tiles × 8 bits each = 128 bits +- Each cell stores `log₂(tile_value)`: 0=empty, 1=2, 2=4, 3=8, ... 11=2048 + +**Score Calculation Algorithm**: + +```typescript +// Score = sum of all merged tile values +// When two 4s merge into an 8, score += 8 +// When two 8s merge into a 16, score += 16 + +function calculateScoreDelta(prevBoard: number[], newBoard: number[]): number { + const prevSum = prevBoard.reduce((a, b) => a + b, 0); + const newSum = newBoard.reduce((a, b) => a + b, 0); + + // New tile added is either 2 or 4 (90%/10% probability) + // Score delta = (newSum - prevSum) - newTileValue + // But we can simplify: merges double values, so: + // scoreDelta = sum of all tiles that appeared due to merges + + // A merge of two Xs creates one 2X, so net change = 2X - X - X + newTile = newTile + // But score gained = 2X (the merged value) + + // Precise calculation requires tracking which tiles merged + // Simplified: score delta = (tiles that disappeared) * their values + + const prevTiles = prevBoard.filter(t => t > 0).sort((a, b) => a - b); + const newTiles = newBoard.filter(t => t > 0).sort((a, b) => a - b); + + // Find merged tiles by comparing sorted arrays + let scoreDelta = 0; + // ... detailed merge detection logic + + return scoreDelta; +} +``` + +**For NewGame (first 3 moves)**: The contract receives `boards[4]` containing all intermediate states, so we calculate score from all 3 transitions. + +**For NewMove**: We store `previousBoard` in the Game entity and compare with `result`. + +### 2. Gas & MON Tracking + +**Gas Constants** (from contract analysis): +- `startGame()`: ~150,000 gas (includes validation of 3 moves) +- `play()`: ~100,000 gas per move + +**Data from Transaction Receipts**: +- `gasUsed`: Actual gas consumed +- `effectiveGasPrice`: Gas price in wei +- `MON burned = gasUsed × effectiveGasPrice` + +**Envio HyperIndex Configuration** for transaction data: + +```yaml +# config.yaml - enable transaction receipt indexing +field_selection: + transaction: + - hash + - from + - gasUsed + - effectiveGasPrice +``` + +### 3. Data Schema + +#### Envio HyperIndex Schema (`schema.graphql`) + +```graphql +# Tracks each move in a game (for score calculation) +type GameMove @entity { + id: ID! # txHash + gameId: String! @index # Reference to Game + moveNumber: Int! # 1, 2, 3, 4, 5... + direction: Int! # 0=UP, 1=DOWN, 2=LEFT, 3=RIGHT + boardBefore: String! # Board state before move (hex) + boardAfter: String! # Board state after move (hex) + scoreDelta: Int! # Score gained from this move + gasUsed: BigInt! # Gas consumed + gasPrice: BigInt! # Effective gas price (wei) + monBurned: BigInt! # gasUsed * gasPrice (wei) + timestamp: BigInt! # Block timestamp + txHash: String! # Transaction hash +} + +# Aggregated game data +type Game @entity { + id: ID! # gameId (bytes32) + player: String! @index # Player address (indexed for queries) + score: Int! # Actual game score (sum of merges) + highestTile: Int! # Highest tile value achieved + moveCount: Int! # Total moves played + latestBoard: String! # Current board state (hex) + + # Gas tracking + totalGasUsed: BigInt! # Sum of all gas used + totalMonBurned: BigInt! # Sum of all MON burned (wei) + + # Timestamps + startedAt: BigInt! # Block timestamp of NewGame + lastMoveAt: BigInt! # Block timestamp of last move + + # Status + isActive: Boolean! # True if game still has valid moves +} + +# Player aggregate stats (optional, for profile features) +type Player @entity { + id: ID! # Player address + totalGamesPlayed: Int! # Count of games + totalMovesPlayed: Int! # Sum of all moves + totalMonBurned: BigInt! # Total MON spent on games + bestScore: Int! # Highest score achieved + bestGameId: String # Reference to best game +} + +# Indexer status for frontend state management +type IndexerStatus @entity { + id: ID! # "status" (singleton) + chainId: Int! # Network chain ID + lastIndexedBlock: BigInt! # Most recent block processed + lastIndexedTimestamp: BigInt!# Timestamp of last block + totalGamesIndexed: Int! # Count of games in database + isBackfilling: Boolean! # True if still catching up +} +``` + +### 4. Event Handlers + +#### `src/handlers/index.ts` + +```typescript +import { + Monad2048, + Game, + GameMove, + Player, + IndexerStatus, + handlerContext +} from "generated"; + +// ============================================================ +// Board Decoding & Score Calculation +// ============================================================ + +function decodeBoard(boardBigInt: bigint): number[] { + const tiles: number[] = []; + for (let i = 0; i < 16; i++) { + const shift = BigInt((15 - i) * 8); + const cellLog = Number((boardBigInt >> shift) & 0xFFn); + tiles.push(cellLog > 0 ? Math.pow(2, cellLog) : 0); + } + return tiles; +} + +function encodeBoard(tiles: number[]): string { + let result = 0n; + for (let i = 0; i < 16; i++) { + const log = tiles[i] > 0 ? Math.log2(tiles[i]) : 0; + result |= BigInt(log) << BigInt((15 - i) * 8); + } + return result.toString(16).padStart(32, '0'); +} + +function getHighestTile(tiles: number[]): number { + return Math.max(...tiles, 0); +} + +function getBoardSum(tiles: number[]): number { + return tiles.reduce((a, b) => a + b, 0); +} + +/** + * Calculate score delta from a move by detecting merged tiles. + * + * Algorithm: + * 1. Count tile values in both boards + * 2. Tiles that decreased in count were merged + * 3. Score = sum of merged result values (2X for each pair of X) + */ +function calculateScoreDelta( + prevTiles: number[], + newTiles: number[] +): number { + // Count occurrences of each tile value + const prevCounts = new Map(); + const newCounts = new Map(); + + for (const tile of prevTiles) { + if (tile > 0) { + prevCounts.set(tile, (prevCounts.get(tile) || 0) + 1); + } + } + + for (const tile of newTiles) { + if (tile > 0) { + newCounts.set(tile, (newCounts.get(tile) || 0) + 1); + } + } + + let scoreDelta = 0; + + // For each tile value, check if count decreased (meaning merges happened) + // A merge of two Xs creates one 2X, score += 2X + for (const [value, prevCount] of prevCounts) { + const newCount = newCounts.get(value) || 0; + const newDoubleCount = newCounts.get(value * 2) || 0; + const prevDoubleCount = prevCounts.get(value * 2) || 0; + + // Number of merges = (prevCount - newCount) / 2 + // But also check that double value increased + const doubleIncrease = newDoubleCount - prevDoubleCount; + if (doubleIncrease > 0 && prevCount > newCount) { + // Each merge of two Xs gives score of 2X + scoreDelta += doubleIncrease * (value * 2); + } + } + + return scoreDelta; +} + +// ============================================================ +// NewGame Handler +// ============================================================ + +Monad2048.NewGame.handler(async ({ event, context }) => { + const { player, id: gameId, board } = event.args; + const txHash = event.transaction.hash; + const gasUsed = BigInt(event.transaction.gasUsed || 150000); + const gasPrice = BigInt(event.transaction.effectiveGasPrice || event.transaction.gasPrice || 0); + const monBurned = gasUsed * gasPrice; + + // Decode final board after move 3 + const tiles = decodeBoard(board); + const highestTile = getHighestTile(tiles); + + // For NewGame, we receive board state after move 3 + // The contract validates boards[0] -> boards[1] -> boards[2] -> boards[3] + // We don't have intermediate boards in the event, so we estimate initial score + // Based on board sum: score ≈ boardSum - initialTiles (rough estimate) + // For accurate score, we'd need to decode the calldata + + // Simplified: assume minimal merges in first 3 moves + // Real implementation would decode transaction input data + const boardSum = getBoardSum(tiles); + const estimatedScore = Math.max(0, boardSum - 4 - 4); // Subtract ~2 initial tiles + + // Create Game entity + context.Game.set({ + id: gameId, + player: player.toLowerCase(), + score: estimatedScore, + highestTile, + moveCount: 3, + latestBoard: encodeBoard(tiles), + totalGasUsed: gasUsed, + totalMonBurned: monBurned, + startedAt: BigInt(event.block.timestamp), + lastMoveAt: BigInt(event.block.timestamp), + isActive: true, + }); + + // Create initial GameMove entry (represents moves 1-3 batched) + context.GameMove.set({ + id: txHash, + gameId: gameId, + moveNumber: 3, + direction: 0, // Unknown for batched moves + boardBefore: "0".repeat(32), // Initial board unknown + boardAfter: encodeBoard(tiles), + scoreDelta: estimatedScore, + gasUsed: gasUsed, + gasPrice: gasPrice, + monBurned: monBurned, + timestamp: BigInt(event.block.timestamp), + txHash: txHash, + }); + + // Update or create Player + const existingPlayer = await context.Player.get(player.toLowerCase()); + if (existingPlayer) { + const isBetter = estimatedScore > existingPlayer.bestScore; + context.Player.set({ + ...existingPlayer, + totalGamesPlayed: existingPlayer.totalGamesPlayed + 1, + totalMovesPlayed: existingPlayer.totalMovesPlayed + 3, + totalMonBurned: existingPlayer.totalMonBurned + monBurned, + bestScore: isBetter ? estimatedScore : existingPlayer.bestScore, + bestGameId: isBetter ? gameId : existingPlayer.bestGameId, + }); + } else { + context.Player.set({ + id: player.toLowerCase(), + totalGamesPlayed: 1, + totalMovesPlayed: 3, + totalMonBurned: monBurned, + bestScore: estimatedScore, + bestGameId: gameId, + }); + } + + // Update indexer status + await updateIndexerStatus(context, event); +}); + +// ============================================================ +// NewMove Handler +// ============================================================ + +Monad2048.NewMove.handler(async ({ event, context }) => { + const { player, id: gameId, move, result } = event.args; + const txHash = event.transaction.hash; + const gasUsed = BigInt(event.transaction.gasUsed || 100000); + const gasPrice = BigInt(event.transaction.effectiveGasPrice || event.transaction.gasPrice || 0); + const monBurned = gasUsed * gasPrice; + + // Get existing game + const game = await context.Game.get(gameId); + if (!game) { + console.warn(`NewMove for unknown game: ${gameId}`); + return; + } + + // Decode boards + const prevTiles = decodeBoard(BigInt("0x" + game.latestBoard)); + const newTiles = decodeBoard(result); + + // Calculate score delta from this move + const scoreDelta = calculateScoreDelta(prevTiles, newTiles); + const newScore = game.score + scoreDelta; + const highestTile = getHighestTile(newTiles); + const newMoveCount = game.moveCount + 1; + + // Update Game entity + context.Game.set({ + ...game, + score: newScore, + highestTile: Math.max(game.highestTile, highestTile), + moveCount: newMoveCount, + latestBoard: encodeBoard(newTiles), + totalGasUsed: game.totalGasUsed + gasUsed, + totalMonBurned: game.totalMonBurned + monBurned, + lastMoveAt: BigInt(event.block.timestamp), + }); + + // Create GameMove entry + context.GameMove.set({ + id: txHash, + gameId: gameId, + moveNumber: newMoveCount, + direction: Number(move), + boardBefore: game.latestBoard, + boardAfter: encodeBoard(newTiles), + scoreDelta: scoreDelta, + gasUsed: gasUsed, + gasPrice: gasPrice, + monBurned: monBurned, + timestamp: BigInt(event.block.timestamp), + txHash: txHash, + }); + + // Update Player stats + const existingPlayer = await context.Player.get(player.toLowerCase()); + if (existingPlayer) { + const isBetter = newScore > existingPlayer.bestScore; + context.Player.set({ + ...existingPlayer, + totalMovesPlayed: existingPlayer.totalMovesPlayed + 1, + totalMonBurned: existingPlayer.totalMonBurned + monBurned, + bestScore: isBetter ? newScore : existingPlayer.bestScore, + bestGameId: isBetter ? gameId : existingPlayer.bestGameId, + }); + } + + // Update indexer status + await updateIndexerStatus(context, event); +}); + +// ============================================================ +// Indexer Status Helper +// ============================================================ + +async function updateIndexerStatus(context: handlerContext, event: any) { + const chainId = event.chainId; + const statusId = `status-${chainId}`; + + const existing = await context.IndexerStatus.get(statusId); + const totalGames = existing ? existing.totalGamesIndexed : 0; + + context.IndexerStatus.set({ + id: statusId, + chainId: chainId, + lastIndexedBlock: BigInt(event.block.number), + lastIndexedTimestamp: BigInt(event.block.timestamp), + totalGamesIndexed: totalGames + (event.eventName === "NewGame" ? 1 : 0), + isBackfilling: false, // Will be true during initial sync + }); +} +``` + +### 5. Configuration + +#### `config.yaml` + +```yaml +name: monad-2048-leaderboard +description: Indexes Monad 2048 game events for leaderboard with score and gas tracking +networks: + - id: 143 # Monad Mainnet + start_block: 0 # Or contract deployment block for faster sync + contracts: + - name: Monad2048 + address: "0x53748668642735CDa45935716525E7DFbC8aAACC" + handler: src/handlers/index.ts + events: + - event: NewGame(address indexed player, bytes32 indexed id, uint256 board) + - event: NewMove(address indexed player, bytes32 indexed id, uint256 move, uint256 result) + +# Enable transaction data for gas tracking +field_selection: + transaction: + - hash + - from + - gasUsed + - effectiveGasPrice + - gasPrice +``` + +--- + +## Frontend Implementation + +### 1. Project Structure Changes + +``` +packages/frontend/src/ +├── components/ +│ ├── Leaderboard/ +│ │ ├── Leaderboard.tsx # Main leaderboard component +│ │ ├── LeaderboardEntry.tsx # Single entry with animation +│ │ ├── LeaderboardSkeleton.tsx # Loading skeleton +│ │ ├── LeaderboardEmpty.tsx # Empty state +│ │ ├── LeaderboardSyncing.tsx # Syncing/backfill state +│ │ ├── LeaderboardError.tsx # Error state +│ │ └── index.ts +│ └── ...existing components +├── hooks/ +│ ├── useLeaderboard.ts # Leaderboard data + polling +│ ├── useIndexerStatus.ts # Indexer sync status +│ └── ...existing hooks +├── lib/ +│ ├── graphql/ +│ │ ├── client.ts # GraphQL client setup +│ │ ├── queries.ts # Leaderboard queries +│ │ └── types.ts # Generated/manual types +│ ├── utils/ +│ │ └── format.ts # Formatting helpers +│ └── ... +└── ... +``` + +### 2. Dependencies to Add + +```json +{ + "dependencies": { + "framer-motion": "^11.x", + "graphql-request": "^6.x" + } +} +``` + +### 3. GraphQL Queries + +#### `lib/graphql/queries.ts` + +```typescript +import { gql } from 'graphql-request'; + +// Main leaderboard query - sorted by score (primary), then moves (secondary) +export const GET_LEADERBOARD = gql` + query GetLeaderboard($limit: Int = 10) { + Game( + order_by: [ + { score: desc }, + { moveCount: asc }, + { lastMoveAt: desc } + ] + limit: $limit + ) { + id + player + score + highestTile + moveCount + totalGasUsed + totalMonBurned + lastMoveAt + isActive + } + } +`; + +// Indexer status for sync state +export const GET_INDEXER_STATUS = gql` + query GetIndexerStatus($chainId: Int!) { + IndexerStatus(where: { chainId: { _eq: $chainId } }) { + lastIndexedBlock + lastIndexedTimestamp + totalGamesIndexed + isBackfilling + } + } +`; + +// Player's games for highlighting current player +export const GET_PLAYER_GAMES = gql` + query GetPlayerGames($player: String!, $limit: Int = 10) { + Game( + where: { player: { _eq: $player } } + order_by: { score: desc } + limit: $limit + ) { + id + score + highestTile + moveCount + } + } +`; + +// Get specific game details +export const GET_GAME_DETAILS = gql` + query GetGameDetails($gameId: ID!) { + Game_by_pk(id: $gameId) { + id + player + score + highestTile + moveCount + totalGasUsed + totalMonBurned + startedAt + lastMoveAt + isActive + } + GameMove( + where: { gameId: { _eq: $gameId } } + order_by: { moveNumber: asc } + ) { + moveNumber + direction + scoreDelta + gasUsed + monBurned + timestamp + } + } +`; +``` + +#### `lib/graphql/types.ts` + +```typescript +export interface LeaderboardEntry { + id: string; + player: string; + score: number; + highestTile: number; + moveCount: number; + totalGasUsed: string; // BigInt as string + totalMonBurned: string; // BigInt as string (wei) + lastMoveAt: string; // BigInt as string + isActive: boolean; + + // Computed client-side + rank?: number; + isNew?: boolean; + isCurrentPlayer?: boolean; +} + +export interface IndexerStatus { + lastIndexedBlock: string; + lastIndexedTimestamp: string; + totalGamesIndexed: number; + isBackfilling: boolean; +} + +export type LeaderboardState = + | 'loading' // Initial load + | 'empty' // No games indexed yet + | 'syncing' // Indexer is backfilling historical data + | 'ready' // Data available, realtime updates active + | 'error'; // Failed to fetch +``` + +### 4. Formatting Utilities + +#### `lib/utils/format.ts` + +```typescript +import { formatEther } from 'viem'; + +/** + * Format wei to MON with appropriate precision + */ +export function formatMonBurned(weiString: string): string { + const mon = Number(formatEther(BigInt(weiString))); + + if (mon < 0.0001) { + return '< 0.0001 MON'; + } else if (mon < 1) { + return `${mon.toFixed(4)} MON`; + } else if (mon < 100) { + return `${mon.toFixed(2)} MON`; + } else { + return `${Math.round(mon).toLocaleString()} MON`; + } +} + +/** + * Format gas used with K/M suffixes + */ +export function formatGas(gasString: string): string { + const gas = Number(gasString); + + if (gas >= 1_000_000) { + return `${(gas / 1_000_000).toFixed(1)}M`; + } else if (gas >= 1_000) { + return `${(gas / 1_000).toFixed(0)}K`; + } else { + return gas.toLocaleString(); + } +} + +/** + * Format address for display + */ +export function formatAddress(address: string): string { + return `${address.slice(0, 6)}...${address.slice(-4)}`; +} + +/** + * Format score with comma separators + */ +export function formatScore(score: number): string { + return score.toLocaleString(); +} + +/** + * Format relative time (e.g., "2m ago", "1h ago") + */ +export function formatRelativeTime(timestamp: string): string { + const now = Date.now(); + const then = Number(timestamp) * 1000; // Convert seconds to ms + const diff = now - then; + + const minutes = Math.floor(diff / 60000); + const hours = Math.floor(diff / 3600000); + const days = Math.floor(diff / 86400000); + + if (minutes < 1) return 'just now'; + if (minutes < 60) return `${minutes}m ago`; + if (hours < 24) return `${hours}h ago`; + return `${days}d ago`; +} +``` + +### 5. Hooks + +#### `hooks/useIndexerStatus.ts` + +```typescript +import { useState, useEffect, useCallback } from 'react'; +import { getGraphQLClient } from '@/lib/graphql/client'; +import { GET_INDEXER_STATUS } from '@/lib/graphql/queries'; +import { IndexerStatus } from '@/lib/graphql/types'; +import { useNetwork } from '@/contexts/NetworkContext'; + +const CHAIN_ID = 143; // Monad Mainnet + +export function useIndexerStatus() { + const [status, setStatus] = useState(null); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(null); + + const fetchStatus = useCallback(async () => { + try { + const client = getGraphQLClient(); + const data = await client.request<{ IndexerStatus: IndexerStatus[] }>( + GET_INDEXER_STATUS, + { chainId: CHAIN_ID } + ); + + setStatus(data.IndexerStatus[0] || null); + setError(null); + } catch (err) { + setError(err as Error); + } finally { + setLoading(false); + } + }, []); + + useEffect(() => { + fetchStatus(); + // Poll status less frequently than leaderboard + const interval = setInterval(fetchStatus, 30000); + return () => clearInterval(interval); + }, [fetchStatus]); + + return { status, loading, error, refetch: fetchStatus }; +} +``` + +#### `hooks/useLeaderboard.ts` + +```typescript +import { useState, useEffect, useCallback, useRef } from 'react'; +import { getGraphQLClient } from '@/lib/graphql/client'; +import { GET_LEADERBOARD } from '@/lib/graphql/queries'; +import { LeaderboardEntry, LeaderboardState } from '@/lib/graphql/types'; +import { useNetwork } from '@/contexts/NetworkContext'; +import { useIndexerStatus } from './useIndexerStatus'; + +const POLL_INTERVAL = 5000; // 5 seconds + +interface UseLeaderboardOptions { + currentPlayerAddress?: string; +} + +export function useLeaderboard(options: UseLeaderboardOptions = {}) { + const { currentPlayerAddress } = options; + const { status: indexerStatus } = useIndexerStatus(); + + const [entries, setEntries] = useState([]); + const [state, setState] = useState('loading'); + const [error, setError] = useState(null); + const previousEntriesRef = useRef([]); + const isFirstFetch = useRef(true); + + const fetchLeaderboard = useCallback(async () => { + try { + const client = getGraphQLClient(); + const data = await client.request<{ Game: LeaderboardEntry[] }>( + GET_LEADERBOARD, + { limit: 10 } + ); + + const games = data.Game || []; + + // Determine state based on data and indexer status + if (games.length === 0) { + if (indexerStatus?.isBackfilling) { + setState('syncing'); + } else if (indexerStatus?.totalGamesIndexed === 0) { + setState('empty'); + } else { + setState('ready'); // Has games but none in top 10 (unlikely) + } + setEntries([]); + return; + } + + // Enrich entries with computed fields + const enrichedEntries = games.map((game, index) => ({ + ...game, + rank: index + 1, + isNew: !isFirstFetch.current && + !previousEntriesRef.current.some(e => e.id === game.id), + isCurrentPlayer: currentPlayerAddress + ? game.player.toLowerCase() === currentPlayerAddress.toLowerCase() + : false, + })); + + previousEntriesRef.current = enrichedEntries; + isFirstFetch.current = false; + setEntries(enrichedEntries); + setState(indexerStatus?.isBackfilling ? 'syncing' : 'ready'); + setError(null); + } catch (err) { + setError(err as Error); + setState('error'); + } + }, [currentPlayerAddress, indexerStatus]); + + // Fetch on mount + useEffect(() => { + isFirstFetch.current = true; + setState('loading'); + fetchLeaderboard(); + }, []); + + // Poll for updates (pause when tab hidden) + useEffect(() => { + const handleVisibilityChange = () => { + if (!document.hidden) { + fetchLeaderboard(); + } + }; + + document.addEventListener('visibilitychange', handleVisibilityChange); + + const interval = setInterval(() => { + if (!document.hidden) { + fetchLeaderboard(); + } + }, POLL_INTERVAL); + + return () => { + document.removeEventListener('visibilitychange', handleVisibilityChange); + clearInterval(interval); + }; + }, [fetchLeaderboard]); + + return { + entries, + state, + error, + refetch: fetchLeaderboard, + indexerStatus + }; +} +``` + +### 6. Leaderboard Components + +#### `components/Leaderboard/LeaderboardEmpty.tsx` + +```tsx +import { Gamepad2 } from 'lucide-react'; + +export function LeaderboardEmpty() { + return ( +
+ +

No Games Yet

+

+ Be the first to play and claim the #1 spot! +

+
+ ); +} +``` + +#### `components/Leaderboard/LeaderboardSyncing.tsx` + +```tsx +import { Loader2, Database } from 'lucide-react'; + +interface LeaderboardSyncingProps { + totalGamesIndexed?: number; + lastBlock?: string; +} + +export function LeaderboardSyncing({ + totalGamesIndexed = 0, + lastBlock +}: LeaderboardSyncingProps) { + return ( +
+
+ + +
+

Syncing Data

+

+ Indexing historical games... +

+
+

{totalGamesIndexed.toLocaleString()} games indexed

+ {lastBlock &&

Block #{Number(lastBlock).toLocaleString()}

} +
+
+ ); +} +``` + +#### `components/Leaderboard/LeaderboardError.tsx` + +```tsx +import { AlertTriangle, RefreshCw } from 'lucide-react'; + +interface LeaderboardErrorProps { + error: Error; + onRetry: () => void; +} + +export function LeaderboardError({ error, onRetry }: LeaderboardErrorProps) { + return ( +
+ +

Failed to Load

+

+ {error.message || 'Unable to fetch leaderboard data'} +

+ +
+ ); +} +``` + +#### `components/Leaderboard/LeaderboardSkeleton.tsx` + +```tsx +export function LeaderboardSkeleton() { + return ( +
+ {Array.from({ length: 5 }).map((_, i) => ( +
+
+
+
+
+
+
+
+ ))} +
+ ); +} +``` + +#### `components/Leaderboard/Leaderboard.tsx` + +```tsx +import { motion, AnimatePresence } from 'framer-motion'; +import { Trophy, Medal, Flame, Fuel, Zap, Loader2 } from 'lucide-react'; +import { useLeaderboard, LeaderboardEntry } from '@/hooks/useLeaderboard'; +import { LeaderboardSkeleton } from './LeaderboardSkeleton'; +import { LeaderboardEmpty } from './LeaderboardEmpty'; +import { LeaderboardSyncing } from './LeaderboardSyncing'; +import { LeaderboardError } from './LeaderboardError'; +import { + formatAddress, + formatScore, + formatGas, + formatMonBurned +} from '@/lib/utils/format'; + +interface LeaderboardProps { + currentPlayerAddress?: string; +} + +function getRankDisplay(rank: number) { + switch (rank) { + case 1: return ; + case 2: return ; + case 3: return ; + default: return ( + + {rank} + + ); + } +} + +function getTileColorClass(tile: number): string { + const colors: Record = { + 2: 'bg-purple-100 text-purple-800', + 4: 'bg-purple-200 text-purple-800', + 8: 'bg-purple-300 text-purple-900', + 16: 'bg-purple-400 text-white', + 32: 'bg-purple-500 text-white', + 64: 'bg-purple-600 text-white', + 128: 'bg-yellow-400 text-yellow-900', + 256: 'bg-yellow-500 text-white', + 512: 'bg-orange-500 text-white', + 1024: 'bg-orange-600 text-white', + 2048: 'bg-red-500 text-white', + 4096: 'bg-red-600 text-white', + 8192: 'bg-red-700 text-white', + }; + return colors[tile] || 'bg-purple-700 text-white'; +} + +export function Leaderboard({ currentPlayerAddress }: LeaderboardProps) { + const { entries, state, error, refetch, indexerStatus } = useLeaderboard({ + currentPlayerAddress, + }); + + return ( +
+ {/* Header */} +
+

+ + Top 10 High Scores +

+ {state === 'ready' && ( +
+ + Live +
+ )} + {state === 'syncing' && ( +
+ + Syncing +
+ )} +
+ + {/* Content based on state */} + {state === 'loading' && } + + {state === 'empty' && } + + {state === 'syncing' && entries.length === 0 && ( + + )} + + {state === 'error' && error && ( + + )} + + {/* Leaderboard entries */} + {(state === 'ready' || (state === 'syncing' && entries.length > 0)) && ( +
+ + {entries.map((entry) => ( + + {/* New entry badge */} + {entry.isNew && ( + + NEW + + )} + +
+ {/* Rank */} +
+ {getRankDisplay(entry.rank!)} +
+ + {/* Player info */} +
+
+ + {formatAddress(entry.player)} + + {entry.isCurrentPlayer && ( + + YOU + + )} +
+ + {/* Stats row */} +
+ + + {entry.moveCount} moves + + + + {formatGas(entry.totalGasUsed)} + + + + {formatMonBurned(entry.totalMonBurned)} + +
+
+ + {/* Score */} +
+ + {formatScore(entry.score)} + +
+ {entry.highestTile} +
+
+
+
+ ))} +
+
+ )} +
+ ); +} +``` + +### 7. Layout Integration + +#### Updated `Container.tsx` + +```tsx +import { Leaderboard } from "@/components/Leaderboard"; +import React from "react"; + +type ContainerProps = { + children: React.ReactNode; + playerAddress?: string; +}; + +export default function Container({ children, playerAddress }: ContainerProps) { + return ( +
+ {/* Header */} +
+

+ 2048 +

+

+ on MONAD +

+
+ + {/* Main content area: Game + Leaderboard */} +
+ {/* Game board - fixed max width, never shrinks */} +
+ {children} +
+ + {/* Leaderboard - right side on desktop, below on mobile */} +
+ +
+
+
+ ); +} +``` + +--- + +## Local Development Setup + +### 1. Indexer Package Structure + +``` +packages/ +├── frontend/ # Existing React app +├── contracts/ # Existing Foundry contracts +└── indexer/ # NEW: Envio HyperIndex + ├── src/ + │ └── handlers/ + │ └── index.ts + ├── schema.graphql + ├── config.yaml + ├── package.json + ├── tsconfig.json + └── .env.example +``` + +### 2. Indexer Package Configuration + +#### `packages/indexer/package.json` + +```json +{ + "name": "indexer", + "version": "1.0.0", + "scripts": { + "dev": "envio dev", + "start": "envio start", + "stop": "envio stop", + "codegen": "envio codegen", + "test": "mocha" + }, + "dependencies": { + "envio": "^2.x" + }, + "devDependencies": { + "@types/node": "^20.x", + "typescript": "^5.x", + "mocha": "^10.x", + "@types/mocha": "^10.x" + } +} +``` + +### 3. Environment Variables + +#### `packages/indexer/.env.example` + +```env +# Envio API Token (get from envio.dev dashboard) +ENVIO_API_TOKEN=your_token_here +``` + +#### `packages/frontend/.env.local` + +```env +# Existing Privy config +VITE_PRIVY_APP_ID=your_privy_app_id + +# Local development (Docker Hasura) +VITE_ENVIO_GRAPHQL_URL=http://localhost:8080/v1/graphql + +# Production (Envio hosted - uncomment when deployed) +# VITE_ENVIO_GRAPHQL_URL=https://indexer.bigdevenergy.link/xxxxx/v1/graphql +``` + +### 4. Quick Start Commands + +```bash +# From project root + +# 1. Install all dependencies +pnpm install + +# 2. Start only the indexer (data pipeline) +pnpm dev:indexer +# → Starts Docker containers: PostgreSQL, Hasura, Indexer +# → Opens Hasura console at http://localhost:8080 (password: testing) +# → Begins indexing from configured start_block + +# 3. In another terminal, start the frontend +pnpm dev:frontend +# → Starts Vite dev server at http://localhost:5173 +# → Connects to local Hasura for leaderboard data + +# OR run both together +pnpm dev +# → Runs indexer and frontend in parallel + +# Stop the indexer and clean up Docker +pnpm indexer:stop +``` + +### 5. Verifying the Setup + +1. **Check Hasura Console**: Open http://localhost:8080 + - Login with password: `testing` + - Navigate to "Data" tab + - Verify tables: `Game`, `GameMove`, `Player`, `IndexerStatus` + +2. **Check Indexer Logs**: Watch the terminal running `pnpm dev:indexer` + - Should show blocks being processed + - Events being indexed + +3. **Test Frontend**: Open http://localhost:5173 + - Leaderboard should show "Syncing" state initially + - Play a game + - Verify new game appears in leaderboard within ~5 seconds + +--- + +## State Handling Matrix + +### Frontend States + +| State | Condition | UI Display | +|-------|-----------|------------| +| `loading` | Initial fetch in progress | Skeleton loader | +| `empty` | Indexer running but no games exist | "No Games Yet" with call-to-action | +| `syncing` | Indexer is backfilling, partial data available | Shows data + "Syncing" indicator | +| `ready` | Indexer caught up, realtime updates active | Full leaderboard + "Live" indicator | +| `error` | GraphQL request failed | Error message + retry button | + +### Indexer States + +| Phase | `isBackfilling` | `totalGamesIndexed` | Frontend Behavior | +|-------|-----------------|---------------------|-------------------| +| Starting | `true` | 0 | Show "Syncing" with progress | +| Backfilling | `true` | Increasing | Show partial data + "Syncing" | +| Caught up | `false` | Stable | Show "Live" indicator | +| Realtime | `false` | Increasing | Animate new entries | + +### Error Recovery + +```typescript +// Exponential backoff for failed requests +const INITIAL_RETRY_DELAY = 1000; +const MAX_RETRY_DELAY = 30000; + +let retryDelay = INITIAL_RETRY_DELAY; + +async function fetchWithRetry() { + try { + await fetchLeaderboard(); + retryDelay = INITIAL_RETRY_DELAY; // Reset on success + } catch (error) { + console.error('Fetch failed, retrying in', retryDelay); + setTimeout(fetchWithRetry, retryDelay); + retryDelay = Math.min(retryDelay * 2, MAX_RETRY_DELAY); + } +} +``` + +--- + +## Implementation Checklist + +### Phase 1: Indexer Setup + +- [ ] Create `packages/indexer` directory structure +- [ ] Add `indexer` to pnpm workspace (`pnpm-workspace.yaml`) +- [ ] Initialize Envio project: `cd packages/indexer && pnpm envio init` +- [ ] Define GraphQL schema with Game, GameMove, Player, IndexerStatus entities +- [ ] Configure `config.yaml` with both networks and transaction fields +- [ ] Implement board decoding utilities +- [ ] Implement score calculation from board transitions +- [ ] Implement NewGame handler with gas tracking +- [ ] Implement NewMove handler with gas tracking +- [ ] Implement IndexerStatus updates +- [ ] Add root-level scripts to `package.json` +- [ ] Test locally with `pnpm dev:indexer` +- [ ] Verify data in Hasura console + +### Phase 2: Frontend - GraphQL Integration + +- [ ] Install dependencies: `pnpm --filter frontend add framer-motion graphql-request` +- [ ] Create `lib/graphql/client.ts` with network-aware endpoints +- [ ] Create `lib/graphql/queries.ts` with all queries +- [ ] Create `lib/graphql/types.ts` with TypeScript interfaces +- [ ] Create `lib/utils/format.ts` with formatting helpers +- [ ] Implement `useIndexerStatus` hook +- [ ] Implement `useLeaderboard` hook with state management + +### Phase 3: Frontend - UI Components + +- [ ] Create `LeaderboardSkeleton` component +- [ ] Create `LeaderboardEmpty` component +- [ ] Create `LeaderboardSyncing` component +- [ ] Create `LeaderboardError` component +- [ ] Create main `Leaderboard` component with all states +- [ ] Add Framer Motion animations +- [ ] Test all state transitions + +### Phase 4: Layout Integration + +- [ ] Update `Container.tsx` for side-by-side desktop layout +- [ ] Pass `playerAddress` prop through component tree +- [ ] Ensure game board doesn't shrink on any viewport +- [ ] Make leaderboard sticky on desktop +- [ ] Test responsive behavior: mobile, tablet, desktop + +### Phase 5: Polish & Testing + +- [ ] Test empty state (fresh indexer) +- [ ] Test syncing state (during backfill) +- [ ] Test realtime updates (play a game, watch it appear) +- [ ] Test error recovery (stop Hasura, verify retry behavior) +- [ ] Test current player highlighting +- [ ] Test new entry animations +- [ ] Test same player multiple entries +- [ ] Performance test animations on mobile + +### Phase 6: Production Deployment + +- [ ] Deploy indexer to Envio hosted service +- [ ] Configure production GraphQL endpoints +- [ ] Update frontend environment variables +- [ ] Test production data flow +- [ ] Monitor indexer sync status +- [ ] Set up alerts for indexer issues + +--- + +## Gas Constants Reference + +| Transaction | Estimated Gas | Notes | +|-------------|---------------|-------| +| `startGame()` | ~150,000 | Validates first 3 moves | +| `play()` | ~100,000 | Single move validation | + +**MON Burned Calculation**: +``` +monBurned = gasUsed × effectiveGasPrice +monBurnedInMon = monBurned / 10^18 +``` + +--- + +## Contract Address Reference + +| Network | Chain ID | Contract Address | +|---------|----------|------------------| +| Monad Mainnet | 143 | `0x53748668642735CDa45935716525E7DFbC8aAACC` | + +## Envio Endpoint Reference + +| Network | HyperSync URL | +|---------|---------------| +| Monad Mainnet | `https://monad.hypersync.xyz` | diff --git a/MIGRATION.md b/MIGRATION.md new file mode 100644 index 0000000..3673861 --- /dev/null +++ b/MIGRATION.md @@ -0,0 +1,133 @@ +# Migration Guide - Monorepo Structure + +This document explains the changes made to convert the 2048-frontend repository into a pnpm monorepo. + +## What Changed + +### Structure Changes + +**Before:** +``` +2048-frontend/ +├── src/ +├── public/ +├── package.json +├── vite.config.ts +├── tsconfig.json +└── ... +``` + +**After:** +``` +2048-monorepo/ +├── packages/ +│ ├── frontend/ # All original frontend files moved here +│ └── contracts/ # New: contracts from 2048-contracts repo +├── package.json # New: root orchestration scripts +├── pnpm-workspace.yaml # New: workspace configuration +└── README.md # Updated with monorepo docs +``` + +### Package Manager + +- **Changed from:** Bun (`bun.lock`) +- **Changed to:** pnpm (`pnpm-lock.yaml`) +- All dependencies remain the same, just managed by pnpm now + +### Running Commands + +**Before:** +```bash +bun dev +bun run build +``` + +**After (from root):** +```bash +pnpm dev # Runs frontend dev server +pnpm build # Builds both packages +pnpm build:frontend # Builds only frontend +pnpm build:contracts # Builds only contracts +``` + +**Or from package directory:** +```bash +cd packages/frontend +pnpm dev +pnpm build +``` + +## Key Benefits + +1. **Single Repository**: Frontend and contracts are now co-located +2. **Unified Commands**: Run builds/tests for all packages from root +3. **Shared Dependencies**: Better dependency management across packages +4. **Easier Development**: No need to switch between repos +5. **Consistent Versioning**: Both packages version together + +## Contract Integration + +The contracts package is now directly accessible from the frontend: + +```typescript +// Contract addresses are still in packages/frontend/src/utils/constants.ts +const TESTNET_ADDRESS = "0xC52d29f79b2552801e95C8Dc7646f59125009904" +const MAINNET_ADDRESS = "0x53748668642735CDa45935716525E7DFbC8aAACC" +``` + +## Environment Variables + +Frontend environment variables remain in the same location: +- `packages/frontend/.env.local` + +No changes needed to existing `.env.local` files - they work as-is. + +## Git Repository + +- The `.git` directory remains at the root +- Both packages share the same git history +- The contracts package was copied from `/Users/krishang/Desktop/code/monad/2048-contracts` (branch: `krishang/deploy`) + +## Workspace Commands + +pnpm supports several workspace-specific commands: + +```bash +# Filter by package +pnpm --filter frontend +pnpm --filter contracts + +# Run recursively (all packages) +pnpm -r + +# Run in specific package directory +cd packages/frontend && pnpm +``` + +## Deployment + +Contract deployment can now be done from the root: + +```bash +pnpm contracts:deploy # With env vars RPC_URL and DEPLOYER_PRIVATE_KEY +pnpm --filter contracts deploy:testnet +pnpm --filter contracts deploy:mainnet +``` + +## No Breaking Changes + +- All frontend code remains exactly the same +- Contract addresses haven't changed +- Build outputs remain in the same locations +- Environment variables work identically +- Development workflow is the same or better + +## Rollback (if needed) + +If you need to rollback to separate repositories: + +1. Copy `packages/frontend/` contents to a new directory +2. Copy `packages/contracts/` contents to a new directory +3. Run `pnpm install` in each directory + +The packages are fully independent and can be separated if needed. diff --git a/README.md b/README.md index 4a2d38f..90f1e3c 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,247 @@ -# Monad 2048 Frontend +# 2048 Onchain Game - Monorepo -**Check out a full writeup of how we built this [here](https://blog.monad.xyz/blog/build-2048).** +A fully onchain implementation of the 2048 game built on Monad. This monorepo contains both the frontend application and the smart contracts that power the game. -Credits: [2048](https://github.com/gabrielecirulli/2048) +## 🏗️ Project Structure -`Monad 2048` is a fully on-chain game implementation of the popular sliding puzzle game 2048. This game connects with a smart contract -on [Monad testnet](https://testnet.monad.xyz/) and records every game and every move on-chain. +``` +2048-monorepo/ +├── packages/ +│ ├── frontend/ # React + Vite frontend application +│ └── contracts/ # Foundry smart contracts +├── package.json # Root package.json with workspace scripts +├── pnpm-workspace.yaml # PNPM workspace configuration +└── README.md +``` + +## 📦 Packages + +### Frontend (`packages/frontend/`) + +React-based web application that provides the user interface for playing 2048 onchain. + +**Tech Stack:** + +- React 19 with TypeScript +- Vite for build tooling +- Tailwind CSS v4 for styling +- Privy for authentication and embedded wallets +- Viem for Ethereum interactions +- Radix UI components + +**Features:** + +- Fully onchain gameplay - each move is a transaction +- Privy embedded wallets (no seed phrases required) +- Network switching (Monad Testnet/Mainnet) +- Real-time game state synchronization with smart contract +- Responsive design with touch support + +### Contracts (`packages/contracts/`) + +Foundry-based smart contracts implementing the 2048 game logic entirely onchain. + +**Tech Stack:** + +- Solidity 0.8.28 +- Foundry (forge, cast, anvil) +- Optimized for gas efficiency + +**Main Contracts:** + +- `Monad2048.sol` - Main game contract with state management +- `LibBoard.sol` - Library for board transformations and move validation + +**Contract Addresses:** + +- **Testnet:** `0xC52d29f79b2552801e95C8Dc7646f59125009904` +- **Mainnet:** `0x53748668642735CDa45935716525E7DFbC8aAACC` + +## 🚀 Getting Started + +### Prerequisites + +- Node.js >= 18 +- pnpm >= 8 +- Foundry (for contracts development) + +### Installation -## Development +1. Clone the repository: -Clone the repo and run the following to install dependencies: +```bash +git clone +cd 2048-frontend +``` + +2. Install dependencies: ```bash -bun install +pnpm install ``` -Set the environment variables in your `.env.local` file (see `.env.local.example`). Then run the following to run the game locally: +This will install dependencies for all workspace packages (frontend and contracts). + +### Development + +Start the frontend development server: ```bash -bun dev +pnpm dev +# or +pnpm dev:frontend ``` -## Feedback +The frontend will be available at `http://localhost:5173` + +## 🛠️ Available Commands + +### Root-Level Commands + +Run commands across all packages or specific packages: + +```bash +# Development +pnpm dev # Start frontend dev server +pnpm dev:frontend # Same as above + +# Build +pnpm build # Build all packages +pnpm build:frontend # Build frontend only +pnpm build:contracts # Build contracts only + +# Test +pnpm test # Run tests for all packages +pnpm test:frontend # Run frontend tests +pnpm test:contracts # Run contract tests + +# Lint +pnpm lint # Lint all packages +pnpm lint:frontend # Lint frontend code +pnpm lint:contracts # Check contract formatting + +# Preview +pnpm preview # Preview frontend production build + +# Contracts +pnpm contracts:deploy # Deploy contracts (requires env vars) +``` + +### Frontend-Specific Commands + +Navigate to `packages/frontend/` and run: + +```bash +pnpm dev # Start dev server +pnpm build # Build for production +pnpm preview # Preview production build +pnpm lint # Lint code +``` + +### Contracts-Specific Commands + +Navigate to `packages/contracts/` and run: + +```bash +pnpm build # Compile contracts +pnpm test # Run tests with verbose output +pnpm test:gas # Run tests with gas report +pnpm lint # Check formatting +pnpm format # Format Solidity code +pnpm clean # Clean build artifacts +pnpm deploy # Deploy with custom RPC_URL +pnpm deploy:testnet # Deploy to Monad testnet +pnpm deploy:mainnet # Deploy to Monad mainnet +``` + +Or use Foundry directly: + +```bash +forge build # Compile contracts +forge test # Run tests +forge test -vvv # Run tests with verbose output +forge fmt # Format contracts +``` + +## 🔧 Configuration + +### Frontend Environment Variables + +Create `packages/frontend/.env.local`: + +```env +VITE_PRIVY_APP_ID=your_privy_app_id +VITE_MONAD_TESTNET_RPC_URL=https://monad-testnet.g.alchemy.com/v2/YOUR_KEY +VITE_MONAD_MAINNET_RPC_URL=https://monad-mainnet.g.alchemy.com/v2/YOUR_KEY +VITE_2048_FAUCET_URL=https://faucet.monad.xyz +``` + +### Contract Deployment + +For contract deployment, set environment variables: + +```bash +export RPC_URL="https://monad-testnet.g.alchemy.com/v2/YOUR_KEY" +export DEPLOYER_PRIVATE_KEY="your_private_key" +pnpm contracts:deploy +``` + +## 📚 How It Works + +### Game Flow + +1. **User Authentication**: Users log in with Privy (Google, Passkey, or Wallet) +2. **Game Start**: First 3 moves are played locally to initialize the board +3. **Initialize Transaction**: After move 3, `initializeGameTransaction` is called with the board states +4. **Subsequent Moves**: Each move after initialization calls `playNewMoveTransaction` +5. **Onchain Validation**: Smart contract validates each move and updates the board state +6. **Game State**: Board is stored onchain and can be queried/resynced at any time + +### Board Encoding + +The board is encoded as a 128-bit integer where each 8-bit segment represents a tile. The value stored is `log₂(tile_value)`, so: + +- Empty tile (0) = 0 +- Tile with 2 = 1 +- Tile with 4 = 2 +- Tile with 2048 = 11 + +## 🧪 Testing + +### Frontend Tests + +```bash +pnpm test:frontend +``` + +### Contract Tests + +```bash +pnpm test:contracts +``` + +The contracts include comprehensive tests for: + +- Board validation and transformations +- Move processing (up, down, left, right) +- Tile merging logic +- Game state management + +## 📝 License + +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. + +## 🤝 Contributing + +1. Fork the repository +2. Create a feature branch (`git checkout -b feature/amazing-feature`) +3. Commit your changes (`git commit -m 'Add amazing feature'`) +4. Push to the branch (`git push origin feature/amazing-feature`) +5. Open a Pull Request + +## 🔗 Links -Please open issues or PRs on this repository for any feedback. +- [Monad Documentation](https://docs.monad.xyz) +- [Privy Documentation](https://docs.privy.io) +- [Foundry Book](https://book.getfoundry.sh) +- [Vite Documentation](https://vitejs.dev) diff --git a/package.json b/package.json index c7792b5..82d33be 100644 --- a/package.json +++ b/package.json @@ -1,43 +1,33 @@ { - "name": "my-app", - "private": true, - "version": "0.0.0", - "type": "module", - "scripts": { - "dev": "vite", - "build": "tsc -b && vite build", - "lint": "eslint .", - "preview": "vite preview" - }, - "dependencies": { - "@privy-io/react-auth": "^2.8.2", - "@radix-ui/react-alert-dialog": "^1.1.11", - "@radix-ui/react-slot": "^1.2.0", - "@tailwindcss/vite": "^4.0.17", - "@types/node": "^22.13.14", - "class-variance-authority": "^0.7.1", - "clsx": "^2.1.1", - "lucide-react": "^0.484.0", - "next-themes": "^0.4.6", - "react": "^19.0.0", - "react-dom": "^19.0.0", - "sonner": "^2.0.3", - "tailwind-merge": "^3.0.2", - "tailwindcss": "^4.0.17", - "tw-animate-css": "^1.2.4", - "viem": "2.43.0" - }, - "devDependencies": { - "@eslint/js": "^9.21.0", - "@types/react": "^19.0.10", - "@types/react-dom": "^19.0.4", - "@vitejs/plugin-react-swc": "^3.8.0", - "eslint": "^9.21.0", - "eslint-plugin-react-hooks": "^5.1.0", - "eslint-plugin-react-refresh": "^0.4.19", - "globals": "^15.15.0", - "typescript": "~5.7.2", - "typescript-eslint": "^8.24.1", - "vite": "^6.2.0" - } + "name": "2048-monorepo", + "version": "1.0.0", + "private": true, + "type": "module", + "scripts": { + "dev": "pnpm run --parallel dev:frontend dev:indexer", + "dev:frontend": "pnpm --filter frontend dev", + "dev:indexer": "pnpm --filter indexer dev", + "build": "pnpm run --parallel build:frontend build:indexer", + "build:frontend": "pnpm --filter frontend build", + "build:contracts": "pnpm --filter contracts build", + "build:indexer": "pnpm --filter indexer codegen", + "indexer:start": "pnpm --filter indexer dev", + "indexer:stop": "pnpm --filter indexer stop", + "indexer:codegen": "pnpm --filter indexer codegen", + "test": "pnpm -r test", + "test:frontend": "pnpm --filter frontend test", + "test:contracts": "pnpm --filter contracts test", + "lint": "pnpm -r lint", + "lint:frontend": "pnpm --filter frontend lint", + "lint:contracts": "pnpm --filter contracts lint", + "preview": "pnpm --filter frontend preview", + "contracts:deploy": "pnpm --filter contracts deploy", + "clean": "pnpm run --parallel clean:frontend clean:indexer", + "clean:frontend": "pnpm --filter frontend clean", + "clean:indexer": "pnpm --filter indexer stop" + }, + "engines": { + "node": ">=18", + "pnpm": ">=9" + } } diff --git a/packages/contracts/.gitignore b/packages/contracts/.gitignore new file mode 100644 index 0000000..85198aa --- /dev/null +++ b/packages/contracts/.gitignore @@ -0,0 +1,14 @@ +# Compiler files +cache/ +out/ + +# Ignores development broadcast logs +!/broadcast +/broadcast/*/31337/ +/broadcast/**/dry-run/ + +# Docs +docs/ + +# Dotenv file +.env diff --git a/packages/contracts/README.md b/packages/contracts/README.md new file mode 100644 index 0000000..81f345c --- /dev/null +++ b/packages/contracts/README.md @@ -0,0 +1,62 @@ +# Play 2048 on Monad + +**Check out a full writeup of how we built this [here](https://blog.monad.xyz/blog/build-2048).** + +Smart contracts that let you play a game of 2048 entirely on-chain. The game is deployed on [Monad testnet](https://testnet.monad.xyz/) to showcase how Monad is well suited for building fast paced games with a high volume of interactions. + +### About the game + +From the [2048 Wikipedia]() page: + +- 2048 is a single-player sliding tile puzzle video game. +- 2048 is played on a plain 4×4 grid, with numbered tiles that slide when a player moves them using the four arrow keys. +- The game begins with two tiles already in the grid, having a value of either 2 or 4, and another such tile appears in a random empty space after each turn. - Tiles with a value of 2 appear 90% of the time, and tiles with a value of 4 appear 10% of the time. +- Tiles slide as far as possible in the chosen direction until they are stopped by either another tile or the edge of the grid. If two tiles of the same number collide while moving, they will merge into a tile with the total value of the two tiles that collided. +- The resulting tile cannot merge with another tile again in the same move. + +## Deployments + +`Monad2048.sol` is deployed on Monad testnet: [0xe0FA8195AE92b9C473c0c0c12c2D6bCbd245De47](https://testnet.monadexplorer.com/address/0xe0FA8195AE92b9C473c0c0c12c2D6bCbd245De47). + +## Development + +This is a Foundry project. You can find installation instructions for foundry, [here](https://book.getfoundry.sh/getting-started/installation). Clone the repository and run the following commands: + +### Install + +```shell +$ forge install +``` + +### Build + +```shell +$ forge build +``` + +### Test + +```shell +$ forge test +``` + +### Format + +```shell +$ forge fmt +``` + +## Documentation + +The `Monad2048.sol` smart contract contains the API to play a game of 2048. + +- `startGame`: Starts a new game of 2048 for a player (`msg.sender`). The player reveals and reserves the first 4 boards of the game and the contract validates that this is a legal game of 2048. +- `play`: Lets a player make a move for a game by providing the game's session ID and the result board or applying a move (UP, DOWN, LEFT or RIGHT) on the latest board of the game. The contract then validates that the player has made a valid move (board transformation). + +The `LiBoard` library implements the logic of board transformations, and other helper functions for extracting information about a given board position. + +The contract has no permissions or privileged actors. + +## Feedback + +Please open issues or PRs on this repositories for any feedback. diff --git a/packages/contracts/broadcast/Deploy.s.sol/10143/run-1743147792.json b/packages/contracts/broadcast/Deploy.s.sol/10143/run-1743147792.json new file mode 100644 index 0000000..c501fe2 --- /dev/null +++ b/packages/contracts/broadcast/Deploy.s.sol/10143/run-1743147792.json @@ -0,0 +1,108 @@ +{ + "transactions": [ + { + "hash": "0x066d9e1b54588c683d10a0ec2518ff085e4909f631b67d52a76970697e1413e6", + "transactionType": "CREATE2", + "contractName": "Board", + "contractAddress": "0x33239dfc579bd6193879a551157cfd8a4ea5095a", + "function": null, + "arguments": null, + "transaction": { + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "gas": "0x2370fa", + "input": "0x0000000000000000000000000000000000000000000000000000000000000000611d6c61004d600b8282823980515f1a6073146041577f4e487b71000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b305f52607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100f3575f3560e01c806337afd9641161009557806365b559b01161006f57806365b559b01461028f5780637b60a804146102bf578063f173e012146102ef578063f54a36eb1461031f576100f3565b806337afd964146102115780633b9f7a1f1461024157806364cd159514610271576100f3565b806324f4ec51116100d157806324f4ec51146101635780632c5f3c4514610181578063312ffe40146101b157806335e37c72146101e1576100f3565b806301df1995146100f757806319c14718146101155780631af4f97014610145575b5f5ffd5b6100ff61034f565b60405161010c9190611860565b60405180910390f35b61012f600480360381019061012a91906118a7565b610354565b60405161013c91906118ec565b60405180910390f35b61014d61045f565b60405161015a9190611860565b60405180910390f35b61016b610464565b6040516101789190611860565b60405180910390f35b61019b600480360381019061019691906118a7565b610468565b6040516101a89190611860565b60405180910390f35b6101cb60048036038101906101c691906118a7565b610798565b6040516101d89190611860565b60405180910390f35b6101fb60048036038101906101f6919061193b565b610ac8565b6040516102089190611988565b60405180910390f35b61022b600480360381019061022691906119d4565b610af3565b6040516102389190611860565b60405180910390f35b61025b600480360381019061025691906118a7565b610d60565b6040516102689190611860565b60405180910390f35b61027961117c565b6040516102869190611860565b60405180910390f35b6102a960048036038101906102a49190611a24565b611181565b6040516102b691906118ec565b60405180910390f35b6102d960048036038101906102d4919061193b565b61135d565b6040516102e691906118ec565b60405180910390f35b61030960048036038101906103049190611a62565b6113aa565b6040516103169190611860565b60405180910390f35b610339600480360381019061033491906118a7565b6113fa565b6040516103469190611860565b60405180910390f35b600181565b5f5f6082600284901b901c14610396576040517f5f23b72600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f5f90505b60108160ff16101561041a575f6103b38583610ac8565b905060038160ff16106103f2576040517f7646c39a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8160ff16111561040c57828061040890611adf565b9350505b50808060010191505061039c565b5060028114610455576040517f7646c39a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001915050919050565b600381565b5f81565b5f5f5f90505b60048160ff16101561078f57610482611826565b5f5f90505b60048160ff1610156104e8576104b485826004866104a59190611b26565b6104af9190611b62565b610ac8565b828260ff16600481106104ca576104c9611b96565b5b602002019060ff16908160ff16815250508080600101915050610487565b506104f1611826565b5f5f90505f5f90505b60048160ff161015610586575f848260ff166004811061051d5761051c611b96565b5b602002015160ff161461057957838160ff16600481106105405761053f611b96565b5b602002015183838061055190611bc3565b945060ff166004811061056757610566611b96565b5b602002019060ff16908160ff16815250505b80806001019150506104fa565b505f5f90505b60038160ff161015610683575f838260ff16600481106105af576105ae611b96565b5b602002015160ff161415801561060a5750826001826105ce9190611b62565b60ff16600481106105e2576105e1611b96565b5b602002015160ff16838260ff1660048110610600576105ff611b96565b5b602002015160ff16145b1561067657828160ff166004811061062557610624611b96565b5b60200201805180919061063790611bc3565b60ff1660ff16815250505f836001836106509190611b62565b60ff166004811061066457610663611b96565b5b602002019060ff16908160ff16815250505b808060010191505061058c565b5061068c611826565b5f91505f5f90505b60048160ff161015610720575f848260ff16600481106106b7576106b6611b96565b5b602002015160ff161461071357838160ff16600481106106da576106d9611b96565b5b60200201518284806106eb90611bc3565b955060ff166004811061070157610700611b96565b5b602002019060ff16908160ff16815250505b8080600101915050610694565b505f5f90505b60048160ff16101561077d5761076e88826004896107449190611b26565b61074e9190611b62565b848460ff166004811061076457610763611b96565b5b60200201516113aa565b97508080600101915050610726565b5050505050808060010191505061046e565b50819050919050565b5f5f5f90505b60048160ff161015610abf576107b2611826565b5f5f90505b60048160ff161015610818576107e485846004846107d59190611b26565b6107df9190611b62565b610ac8565b828260ff16600481106107fa576107f9611b96565b5b602002019060ff16908160ff168152505080806001019150506107b7565b50610821611826565b5f5f90505f5f90505b60048160ff1610156108b6575f848260ff166004811061084d5761084c611b96565b5b602002015160ff16146108a957838160ff16600481106108705761086f611b96565b5b602002015183838061088190611bc3565b945060ff166004811061089757610896611b96565b5b602002019060ff16908160ff16815250505b808060010191505061082a565b505f5f90505b60038160ff1610156109b3575f838260ff16600481106108df576108de611b96565b5b602002015160ff161415801561093a5750826001826108fe9190611b62565b60ff166004811061091257610911611b96565b5b602002015160ff16838260ff16600481106109305761092f611b96565b5b602002015160ff16145b156109a657828160ff166004811061095557610954611b96565b5b60200201805180919061096790611bc3565b60ff1660ff16815250505f836001836109809190611b62565b60ff166004811061099457610993611b96565b5b602002019060ff16908160ff16815250505b80806001019150506108bc565b506109bc611826565b5f91505f5f90505b60048160ff161015610a50575f848260ff16600481106109e7576109e6611b96565b5b602002015160ff1614610a4357838160ff1660048110610a0a57610a09611b96565b5b6020020151828480610a1b90611bc3565b955060ff1660048110610a3157610a30611b96565b5b602002019060ff16908160ff16815250505b80806001019150506109c4565b505f5f90505b60048160ff161015610aad57610a9e8887600484610a749190611b26565b610a7e9190611b62565b848460ff1660048110610a9457610a93611b96565b5b60200201516113aa565b97508080600101915050610a56565b5050505050808060010191505061079e565b50819050919050565b5f60ff600883600f610ada9190611beb565b610ae49190611b26565b60ff1684901c16905092915050565b5f60048310610b2e576040517f35405e3c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8303610b4557610b3e84610798565b9050610b8c565b60018303610b5d57610b56846113fa565b9050610b8b565b60038303610b7557610b6e84610d60565b9050610b8a565b60028303610b8957610b8684610468565b90505b5b5b5b608081901b608085901b03610bcd576040517f35405e3c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f90505f5f90505b60108160ff161015610c11575f610bed8483610ac8565b60ff1603610c04578180610c0090611adf565b9250505b8080600101915050610bd6565b505f811115610d58575f85858486604051602001610c329493929190611c5f565b604051602081830303815290604052805190602001205f1c90505f8267ffffffffffffffff811115610c6757610c66611cac565b5b604051908082528060200260200182016040528015610c955781602001602082028036833780820191505090505b5090505f5f90505f5f90505b60108160ff161015610d04575f610cb88783610ac8565b60ff1603610cf75780838381518110610cd457610cd3611b96565b5b602002602001019060ff16908160ff16815250508180610cf390611adf565b9250505b8080600101915050610ca1565b50610d5285838686610d169190611d06565b81518110610d2757610d26611b96565b5b6020026020010151605a606487610d3e9190611d06565b11610d4a576001610d4d565b60025b6113aa565b94505050505b509392505050565b5f5f5f90505b60048160ff16101561117357610d7a611826565b5f5f90505b60048160ff161015610de057610dac8582600486610d9d9190611b26565b610da79190611b62565b610ac8565b828260ff1660048110610dc257610dc1611b96565b5b602002019060ff16908160ff16815250508080600101915050610d7f565b50610de9611826565b5f5f90505b60048160ff161015610e555782816003610e089190611beb565b60ff1660048110610e1c57610e1b611b96565b5b6020020151828260ff1660048110610e3757610e36611b96565b5b602002019060ff16908160ff16815250508080600101915050610dee565b50610e5e611826565b5f5f90505f5f90505b60048160ff161015610ef3575f848260ff1660048110610e8a57610e89611b96565b5b602002015160ff1614610ee657838160ff1660048110610ead57610eac611b96565b5b6020020151838380610ebe90611bc3565b945060ff1660048110610ed457610ed3611b96565b5b602002019060ff16908160ff16815250505b8080600101915050610e67565b505f5f90505b60038160ff161015610ff0575f838260ff1660048110610f1c57610f1b611b96565b5b602002015160ff1614158015610f77575082600182610f3b9190611b62565b60ff1660048110610f4f57610f4e611b96565b5b602002015160ff16838260ff1660048110610f6d57610f6c611b96565b5b602002015160ff16145b15610fe357828160ff1660048110610f9257610f91611b96565b5b602002018051809190610fa490611bc3565b60ff1660ff16815250505f83600183610fbd9190611b62565b60ff1660048110610fd157610fd0611b96565b5b602002019060ff16908160ff16815250505b8080600101915050610ef9565b50610ff9611826565b5f91505f5f90505b60048160ff16101561108d575f848260ff166004811061102457611023611b96565b5b602002015160ff161461108057838160ff166004811061104757611046611b96565b5b602002015182848061105890611bc3565b955060ff166004811061106e5761106d611b96565b5b602002019060ff16908160ff16815250505b8080600101915050611001565b50611096611826565b5f5f90505b60048160ff16101561110257828160036110b59190611beb565b60ff16600481106110c9576110c8611b96565b5b6020020151828260ff16600481106110e4576110e3611b96565b5b602002019060ff16908160ff1681525050808060010191505061109b565b505f5f90505b60048160ff16101561115f576111508a8260048b6111269190611b26565b6111309190611b62565b848460ff166004811061114657611145611b96565b5b60200201516113aa565b99508080600101915050611108565b505050505050508080600101915050610d66565b50819050919050565b600281565b5f5f6088600885901b901c146111c3576040517f5f23b72600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6088600884901b901c14611204576040517f5f23b72600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f61120f84611816565b90505f8160ff160361122b5761122485610798565b915061127b565b60018160ff16036112465761123f856113fa565b915061127a565b60038160ff16036112615761125a85610d60565b9150611279565b60028160ff16036112785761127585610468565b91505b5b5b5b5f5f90505f5f90505f5f90505b60108160ff1610156112d25761129e8782610ac8565b60ff166112ab8683610ac8565b60ff16146112c55781806112be90611bc3565b9250508092505b8080600101915050611288565b505f6112de8784610ac8565b60ff1690505f6112ee8685610ac8565b60ff161480156112fd57505f81115b80156113095750600381105b8015611318575060018260ff16145b61134e576040517f62417ce600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60019550505050505092915050565b5f5f5f90505b60108160ff1610156113a2575f61137a8583610ac8565b60ff1690508360ff168110611394576001925050506113a4565b508080600101915050611363565b505b92915050565b5f600883600f6113ba9190611beb565b6113c49190611b26565b60ff168260ff16901b600884600f6113dc9190611beb565b6113e69190611b26565b60ff1660ff901b1985161790509392505050565b5f5f5f90505b60048160ff16101561180d57611414611826565b5f5f90505b60048160ff16101561147a5761144685846004846114379190611b26565b6114419190611b62565b610ac8565b828260ff166004811061145c5761145b611b96565b5b602002019060ff16908160ff16815250508080600101915050611419565b50611483611826565b5f5f90505b60048160ff1610156114ef57828160036114a29190611beb565b60ff16600481106114b6576114b5611b96565b5b6020020151828260ff16600481106114d1576114d0611b96565b5b602002019060ff16908160ff16815250508080600101915050611488565b506114f8611826565b5f5f90505f5f90505b60048160ff16101561158d575f848260ff166004811061152457611523611b96565b5b602002015160ff161461158057838160ff166004811061154757611546611b96565b5b602002015183838061155890611bc3565b945060ff166004811061156e5761156d611b96565b5b602002019060ff16908160ff16815250505b8080600101915050611501565b505f5f90505b60038160ff16101561168a575f838260ff16600481106115b6576115b5611b96565b5b602002015160ff16141580156116115750826001826115d59190611b62565b60ff16600481106115e9576115e8611b96565b5b602002015160ff16838260ff166004811061160757611606611b96565b5b602002015160ff16145b1561167d57828160ff166004811061162c5761162b611b96565b5b60200201805180919061163e90611bc3565b60ff1660ff16815250505f836001836116579190611b62565b60ff166004811061166b5761166a611b96565b5b602002019060ff16908160ff16815250505b8080600101915050611593565b50611693611826565b5f91505f5f90505b60048160ff161015611727575f848260ff16600481106116be576116bd611b96565b5b602002015160ff161461171a57838160ff16600481106116e1576116e0611b96565b5b60200201518284806116f290611bc3565b955060ff166004811061170857611707611b96565b5b602002019060ff16908160ff16815250505b808060010191505061169b565b50611730611826565b5f5f90505b60048160ff16101561179c578281600361174f9190611beb565b60ff166004811061176357611762611b96565b5b6020020151828260ff166004811061177e5761177d611b96565b5b602002019060ff16908160ff16815250508080600101915050611735565b505f5f90505b60048160ff1610156117f9576117ea8a896004846117c09190611b26565b6117ca9190611b62565b848460ff16600481106117e0576117df611b96565b5b60200201516113aa565b995080806001019150506117a2565b505050505050508080600101915050611400565b50819050919050565b5f60ff60f883901c169050919050565b6040518060800160405280600490602082028036833780820191505090505090565b5f819050919050565b61185a81611848565b82525050565b5f6020820190506118735f830184611851565b92915050565b5f5ffd5b61188681611848565b8114611890575f5ffd5b50565b5f813590506118a18161187d565b92915050565b5f602082840312156118bc576118bb611879565b5b5f6118c984828501611893565b91505092915050565b5f8115159050919050565b6118e6816118d2565b82525050565b5f6020820190506118ff5f8301846118dd565b92915050565b5f60ff82169050919050565b61191a81611905565b8114611924575f5ffd5b50565b5f8135905061193581611911565b92915050565b5f5f6040838503121561195157611950611879565b5b5f61195e85828601611893565b925050602061196f85828601611927565b9150509250929050565b61198281611905565b82525050565b5f60208201905061199b5f830184611979565b92915050565b5f819050919050565b6119b3816119a1565b81146119bd575f5ffd5b50565b5f813590506119ce816119aa565b92915050565b5f5f5f606084860312156119eb576119ea611879565b5b5f6119f886828701611893565b9350506020611a0986828701611893565b9250506040611a1a868287016119c0565b9150509250925092565b5f5f60408385031215611a3a57611a39611879565b5b5f611a4785828601611893565b9250506020611a5885828601611893565b9150509250929050565b5f5f5f60608486031215611a7957611a78611879565b5b5f611a8686828701611893565b9350506020611a9786828701611927565b9250506040611aa886828701611927565b9150509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611ae982611848565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611b1b57611b1a611ab2565b5b600182019050919050565b5f611b3082611905565b9150611b3b83611905565b9250828202611b4981611905565b9150808214611b5b57611b5a611ab2565b5b5092915050565b5f611b6c82611905565b9150611b7783611905565b9250828201905060ff811115611b9057611b8f611ab2565b5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f611bcd82611905565b915060ff8203611be057611bdf611ab2565b5b600182019050919050565b5f611bf582611905565b9150611c0083611905565b9250828203905060ff811115611c1957611c18611ab2565b5b92915050565b5f819050919050565b611c39611c3482611848565b611c1f565b82525050565b5f819050919050565b611c59611c54826119a1565b611c3f565b82525050565b5f611c6a8287611c28565b602082019150611c7a8286611c28565b602082019150611c8a8285611c28565b602082019150611c9a8284611c48565b60208201915081905095945050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f611d1082611848565b9150611d1b83611848565b925082611d2b57611d2a611cd9565b5b82820690509291505056fea2646970667358221220fb979d40aea8ea7833233787a57ef5b2de8b29208c6b276fe25d2f7ad313641564736f6c634300081c0033", + "nonce": "0x0", + "chainId": "0x279f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x334316f6b6184c1d52b1d9b707796284b617396bc5bedb35c0c3c72d54b61fd8", + "transactionType": "CREATE", + "contractName": "Faucet2048", + "contractAddress": "0x7dbd1b9355e16cff85cfa5d0a6734c880b2cd69e", + "function": null, + "arguments": [ + "0x234828a40de63d21072D1218cFb5D208654C12Bb", + "0", + "11" + ], + "transaction": { + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "gas": "0x208412", + "value": "0x0", + "input": "0x60a06040527f3230343800000000000000000000000000000000000000000000000000000000600155348015610033575f5ffd5b50604051611e34380380611e3483398181016040528101906100559190610218565b8060ff1660808160ff16815250506100728361008160201b60201c565b81600281905550505050610268565b61008f61014d60201b60201c565b156100f4577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3811560ff1b821781555061014a565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3818155505b50565b5f90565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61017e82610155565b9050919050565b61018e81610174565b8114610198575f5ffd5b50565b5f815190506101a981610185565b92915050565b5f819050919050565b6101c1816101af565b81146101cb575f5ffd5b50565b5f815190506101dc816101b8565b92915050565b5f60ff82169050919050565b6101f7816101e2565b8114610201575f5ffd5b50565b5f81519050610212816101ee565b92915050565b5f5f5f6060848603121561022f5761022e610151565b5b5f61023c8682870161019b565b935050602061024d868287016101ce565b925050604061025e86828701610204565b9150509250925092565b608051611bad6102875f395f81816108870152610a850152611bad5ff3fe608060405260043610610169575f3560e01c8063715018a6116100d0578063ac88036c11610089578063ed80526911610063578063ed80526914610509578063f04e283e14610545578063f2fde38b14610561578063fee81cf41461057d576101a7565b8063ac88036c1461047d578063bedb86fb146104b9578063c7bdce0b146104e1576101a7565b8063715018a61461039357806375b238fc1461039d57806376592bee146103c75780637c376d39146103ef5780638da5cb5b146104175780638ea0923614610441576101a7565b80633e98ab54116101225780633e98ab54146102a15780634a4ee7b1146102dd578063514e62fc146102f957806354d1f13d1461033557806364fefbfc1461033f5780636b58d85014610369576101a7565b80630ea30f48146101ab578063183a4f6e146101e75780631c10893f146102035780631cd64df41461021f578063256929621461025b5780632de9480714610265576101a7565b366101a7577fc4c14883ae9fd8e26d5d59e3485ed29fd126d781d7e498a4ca5c54c8268e49363460405161019d9190611499565b60405180910390a1005b5f5ffd5b3480156101b6575f5ffd5b506101d160048036038101906101cc91906114ed565b6105b9565b6040516101de9190611557565b60405180910390f35b61020160048036038101906101fc919061159a565b6105e9565b005b61021d600480360381019061021891906115ef565b6105f6565b005b34801561022a575f5ffd5b50610245600480360381019061024091906115ef565b61060c565b6040516102529190611647565b60405180910390f35b610263610622565b005b348015610270575f5ffd5b5061028b60048036038101906102869190611660565b610673565b6040516102989190611499565b60405180910390f35b3480156102ac575f5ffd5b506102c760048036038101906102c2919061168b565b61068c565b6040516102d49190611499565b60405180910390f35b6102f760048036038101906102f291906115ef565b610a17565b005b348015610304575f5ffd5b5061031f600480360381019061031a91906115ef565b610a2d565b60405161032c9190611647565b60405180910390f35b61033d610a44565b005b34801561034a575f5ffd5b50610353610a7d565b6040516103609190611499565b60405180910390f35b348015610374575f5ffd5b5061037d610a83565b60405161038a91906116e4565b60405180910390f35b61039b610aa7565b005b3480156103a8575f5ffd5b506103b1610aba565b6040516103be9190611499565b60405180910390f35b3480156103d2575f5ffd5b506103ed60048036038101906103e891906116fd565b610abf565b005b3480156103fa575f5ffd5b506104156004803603810190610410919061159a565b610cd5565b005b348015610422575f5ffd5b5061042b610d24565b6040516104389190611557565b60405180910390f35b34801561044c575f5ffd5b50610467600480360381019061046291906114ed565b610d4c565b6040516104749190611647565b60405180910390f35b348015610488575f5ffd5b506104a3600480360381019061049e91906114ed565b610d69565b6040516104b09190611499565b60405180910390f35b3480156104c4575f5ffd5b506104df60048036038101906104da9190611765565b610d7e565b005b3480156104ec575f5ffd5b50610507600480360381019061050291906117f1565b610ddc565b005b348015610514575f5ffd5b5061052f600480360381019061052a91906114ed565b611218565b60405161053c919061185d565b60405180910390f35b61055f600480360381019061055a9190611660565b61122d565b005b61057b60048036038101906105769190611660565b61126b565b005b348015610588575f5ffd5b506105a3600480360381019061059e9190611660565b611294565b6040516105b09190611499565b60405180910390f35b6005602052805f5260405f205f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6105f333826112ad565b50565b6105fe6112bc565b61060882826112f3565b5050565b5f818261061885610673565b1614905092915050565b5f61062b611303565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f5fa250565b5f638b78c6d8600c52815f526020600c20549050919050565b5f5f5f9054906101000a900460ff16156106d2576040517f379a7ed900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b43476001546040516020016106e9939291906118b6565b604051602081830303815290604052805190602001206001819055505f33905060055f8581526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461079e576040517f2db47d5900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60045f8681526020019081526020015f205490505f81116107ec576040517f3a5f7b5700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7333239dfc579bd6193879a551157cfd8a4ea5095a6337afd96482866001546040518463ffffffff1660e01b815260040161082993929190611910565b602060405180830381865af4158015610844573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108689190611959565b92507333239dfc579bd6193879a551157cfd8a4ea5095a637b60a804847f00000000000000000000000000000000000000000000000000000000000000006040518363ffffffff1660e01b81526004016108c3929190611993565b602060405180830381865af41580156108de573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061090291906119ce565b8015610929575060065f8681526020019081526020015f205f9054906101000a900460ff16155b156109a85761093a8260025461130d565b600160065f8781526020019081526020015f205f6101000a81548160ff021916908315150217905550848273ffffffffffffffffffffffffffffffffffffffff167fb961680a5264d838aae8db99673d832d178d5e11548676b8ea11c1d295b1a3d060405160405180910390a35b8260045f8781526020019081526020015f2081905550848273ffffffffffffffffffffffffffffffffffffffff167f14fe4197a69dbcc73d79fcfd259bd1f097640dd2c2fe016ff232c416e17ce8428686604051610a079291906119f9565b60405180910390a3505092915050565b610a1f6112bc565b610a2982826112ad565b5050565b5f5f82610a3985610673565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f5fa2565b60025481565b7f000000000000000000000000000000000000000000000000000000000000000081565b610aaf6112bc565b610ab85f61132a565b565b600181565b5f5f9054906101000a900460ff1615610b04576040517f379a7ed900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b4347600154604051602001610b1b939291906118b6565b604051602081830303815290604052805190602001206001819055505f3390505f5f1b60035f8481526020019081526020015f205414610b87576040517f7e9c457700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff1660055f8581526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610c1c576040517fd5a95a5600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060055f8581526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260035f8481526020019081526020015f2081905550828173ffffffffffffffffffffffffffffffffffffffff167f8d7f42813f395a8a637272e345d1354cccd3d4154c9da23a082e8b393b72d34a84604051610cc8919061185d565b60405180910390a3505050565b6001610ce0816113f0565b816002819055507f3de94b45dcf1466ebddcaf08282a61857b04b206def18513d137c3ce3f4fb459600254604051610d189190611499565b60405180910390a15050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b6006602052805f5260405f205f915054906101000a900460ff1681565b6004602052805f5260405f205f915090505481565b6001610d89816113f0565b815f5f6101000a81548160ff0219169083151502179055507f0e2fb031ee032dc02d8011dc50b816eb450cf856abd8261680dac74f72165bd282604051610dd09190611647565b60405180910390a15050565b5f5f9054906101000a900460ff1615610e21576040517f379a7ed900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b4347600154604051602001610e38939291906118b6565b604051602081830303815290604052805190602001206001819055505f33905060055f8581526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610eed576040517f2db47d5900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60045f8681526020019081526020015f205414610f37576040517f762f260400000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60048383905014610f74576040517f854817c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8383604051602001610f88929190611a92565b6040516020818303038152906040528051906020012090508460035f8381526020019081526020015f205414610fea576040517f854817c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f90505b8484905081101561115b575f8103611096577333239dfc579bd6193879a551157cfd8a4ea5095a6319c1471886868481811061102e5761102d611aaa565b5b905060200201356040518263ffffffff1660e01b81526004016110519190611ad7565b602060405180830381865af415801561106c573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061109091906119ce565b5061114e565b7333239dfc579bd6193879a551157cfd8a4ea5095a6365b559b086866001856110bf9190611b1d565b8181106110cf576110ce611aaa565b5b905060200201358787858181106110e9576110e8611aaa565b5b905060200201356040518363ffffffff1660e01b815260040161110d929190611b50565b602060405180830381865af4158015611128573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061114c91906119ce565b505b8080600101915050610fef565b50838360018686905061116e9190611b1d565b81811061117e5761117d611aaa565b5b9050602002013560045f8781526020019081526020015f2081905550848273ffffffffffffffffffffffffffffffffffffffff167f0d0a2245f107bccacfa55be58c1202917e494b61aae007897d04dc991442408d86866001898990506111e59190611b1d565b8181106111f5576111f4611aaa565b5b905060200201356040516112099190611499565b60405180910390a35050505050565b6003602052805f5260405f205f915090505481565b6112356112bc565b63389a75e1600c52805f526020600c20805442111561125b57636f5e88185f526004601cfd5b5f8155506112688161132a565b50565b6112736112bc565b8060601b61128857637448fbae5f526004601cfd5b6112918161132a565b50565b5f63389a75e1600c52815f526020600c20549050919050565b6112b882825f611425565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739275433146112f1576382b429005f526004601cfd5b565b6112ff82826001611425565b5050565b5f6202a300905090565b5f385f3884865af16113265763b12d13eb5f526004601cfd5b5050565b61133261147d565b15611397577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3811560ff1b82178155506113ed565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3818155505b50565b638b78c6d81954331461142257638b78c6d8600c52335f52806020600c205416611421576382b429005f526004601cfd5b5b50565b638b78c6d8600c52825f526020600c2080548381178361144757848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f5fa3505050505050565b5f90565b5f819050919050565b61149381611481565b82525050565b5f6020820190506114ac5f83018461148a565b92915050565b5f5ffd5b5f5ffd5b5f819050919050565b6114cc816114ba565b81146114d6575f5ffd5b50565b5f813590506114e7816114c3565b92915050565b5f60208284031215611502576115016114b2565b5b5f61150f848285016114d9565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61154182611518565b9050919050565b61155181611537565b82525050565b5f60208201905061156a5f830184611548565b92915050565b61157981611481565b8114611583575f5ffd5b50565b5f8135905061159481611570565b92915050565b5f602082840312156115af576115ae6114b2565b5b5f6115bc84828501611586565b91505092915050565b6115ce81611537565b81146115d8575f5ffd5b50565b5f813590506115e9816115c5565b92915050565b5f5f60408385031215611605576116046114b2565b5b5f611612858286016115db565b925050602061162385828601611586565b9150509250929050565b5f8115159050919050565b6116418161162d565b82525050565b5f60208201905061165a5f830184611638565b92915050565b5f60208284031215611675576116746114b2565b5b5f611682848285016115db565b91505092915050565b5f5f604083850312156116a1576116a06114b2565b5b5f6116ae858286016114d9565b92505060206116bf85828601611586565b9150509250929050565b5f60ff82169050919050565b6116de816116c9565b82525050565b5f6020820190506116f75f8301846116d5565b92915050565b5f5f60408385031215611713576117126114b2565b5b5f611720858286016114d9565b9250506020611731858286016114d9565b9150509250929050565b6117448161162d565b811461174e575f5ffd5b50565b5f8135905061175f8161173b565b92915050565b5f6020828403121561177a576117796114b2565b5b5f61178784828501611751565b91505092915050565b5f5ffd5b5f5ffd5b5f5ffd5b5f5f83601f8401126117b1576117b0611790565b5b8235905067ffffffffffffffff8111156117ce576117cd611794565b5b6020830191508360208202830111156117ea576117e9611798565b5b9250929050565b5f5f5f60408486031215611808576118076114b2565b5b5f611815868287016114d9565b935050602084013567ffffffffffffffff811115611836576118356114b6565b5b6118428682870161179c565b92509250509250925092565b611857816114ba565b82525050565b5f6020820190506118705f83018461184e565b92915050565b5f819050919050565b61189061188b82611481565b611876565b82525050565b5f819050919050565b6118b06118ab826114ba565b611896565b82525050565b5f6118c1828661187f565b6020820191506118d1828561187f565b6020820191506118e1828461189f565b602082019150819050949350505050565b6118fb81611481565b82525050565b61190a816114ba565b82525050565b5f6060820190506119235f8301866118f2565b61193060208301856118f2565b61193d6040830184611901565b949350505050565b5f8151905061195381611570565b92915050565b5f6020828403121561196e5761196d6114b2565b5b5f61197b84828501611945565b91505092915050565b61198d816116c9565b82525050565b5f6040820190506119a65f8301856118f2565b6119b36020830184611984565b9392505050565b5f815190506119c88161173b565b92915050565b5f602082840312156119e3576119e26114b2565b5b5f6119f0848285016119ba565b91505092915050565b5f604082019050611a0c5f83018561148a565b611a19602083018461148a565b9392505050565b5f81905092915050565b5f5ffd5b82818337505050565b5f611a428385611a20565b93507f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115611a7557611a74611a2a565b5b602083029250611a86838584611a2e565b82840190509392505050565b5f611a9e828486611a37565b91508190509392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f602082019050611aea5f8301846118f2565b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611b2782611481565b9150611b3283611481565b9250828203905081811115611b4a57611b49611af0565b5b92915050565b5f604082019050611b635f8301856118f2565b611b7060208301846118f2565b939250505056fea2646970667358221220554d615c74665612f5e07072cb13d570d7f6ef17940dc1b2bafcea7faaceb0c864736f6c634300081c0033000000000000000000000000234828a40de63d21072d1218cfb5d208654c12bb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b", + "nonce": "0x1", + "chainId": "0x279f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x10e1896", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0x066d9e1b54588c683d10a0ec2518ff085e4909f631b67d52a76970697e1413e6", + "transactionIndex": "0x90", + "blockHash": "0x493af32d87206a58c022d1dff1862e4e3f68ac28d04dbf8ff7a665668a681cea", + "blockNumber": "0x9579d6", + "gasUsed": "0x2370fa", + "effectiveGasPrice": "0xba43b7401", + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "contractAddress": null + }, + { + "status": "0x1", + "cumulativeGasUsed": "0xaf2e1f", + "logs": [ + { + "address": "0x7dbd1b9355e16cff85cfa5d0a6734c880b2cd69e", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000234828a40de63d21072d1218cfb5d208654c12bb" + ], + "data": "0x", + "blockHash": "0x88e4becc90f8a01a9076a2eb3ac3ecf5c8364e315b336ed510453a502f211096", + "blockNumber": "0x9579d7", + "blockTimestamp": "0x67e6530e", + "transactionHash": "0x334316f6b6184c1d52b1d9b707796284b617396bc5bedb35c0c3c72d54b61fd8", + "transactionIndex": "0x55", + "logIndex": "0x8f", + "removed": false + } + ], + "logsBloom": "0x00000000100000000000000000000000000000000000000000800000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000420000040000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020800000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0x334316f6b6184c1d52b1d9b707796284b617396bc5bedb35c0c3c72d54b61fd8", + "transactionIndex": "0x55", + "blockHash": "0x88e4becc90f8a01a9076a2eb3ac3ecf5c8364e315b336ed510453a502f211096", + "blockNumber": "0x9579d7", + "gasUsed": "0x208412", + "effectiveGasPrice": "0xba43b7401", + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": null, + "contractAddress": "0x7dbd1b9355e16cff85cfa5d0a6734c880b2cd69e" + } + ], + "libraries": [ + "src/LibBoard.sol:Board:0x33239DFc579bD6193879A551157CfD8a4eA5095A" + ], + "pending": [], + "returns": { + "gameContract": { + "internal_type": "address", + "value": "0x7DBd1B9355e16CFf85cfA5D0A6734C880b2Cd69E" + } + }, + "timestamp": 1743147792, + "chain": 10143, + "commit": "24cf186" +} \ No newline at end of file diff --git a/packages/contracts/broadcast/Deploy.s.sol/10143/run-1743152781.json b/packages/contracts/broadcast/Deploy.s.sol/10143/run-1743152781.json new file mode 100644 index 0000000..9df24bc --- /dev/null +++ b/packages/contracts/broadcast/Deploy.s.sol/10143/run-1743152781.json @@ -0,0 +1,106 @@ +{ + "transactions": [ + { + "hash": "0x5312b1db067c3d897105e51f9e823e3d6f63f1d75678681a2c54295c50185087", + "transactionType": "CREATE2", + "contractName": "Board", + "contractAddress": "0xc08a3e243288827586e0c3a590290593b2977e6b", + "function": null, + "arguments": null, + "transaction": { + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "gas": "0x24f8c1", + "input": "0x0000000000000000000000000000000000000000000000000000000000000000611ebb61004d600b8282823980515f1a6073146041577f4e487b71000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b305f52607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100f3575f3560e01c806337afd9641161009557806365b559b01161006f57806365b559b01461028f5780637e8dbaf6146102bf578063f173e012146102ef578063f54a36eb1461031f576100f3565b806337afd964146102115780633b9f7a1f1461024157806364cd159514610271576100f3565b806324f4ec51116100d157806324f4ec51146101635780632c5f3c4514610181578063312ffe40146101b157806335e37c72146101e1576100f3565b806301df1995146100f757806319c14718146101155780631af4f97014610145575b5f5ffd5b6100ff61034f565b60405161010c919061191d565b60405180910390f35b61012f600480360381019061012a9190611964565b610354565b60405161013c91906119a9565b60405180910390f35b61014d61045f565b60405161015a919061191d565b60405180910390f35b61016b610464565b604051610178919061191d565b60405180910390f35b61019b60048036038101906101969190611964565b610468565b6040516101a8919061191d565b60405180910390f35b6101cb60048036038101906101c69190611964565b610798565b6040516101d8919061191d565b60405180910390f35b6101fb60048036038101906101f691906119f8565b610ac8565b6040516102089190611a45565b60405180910390f35b61022b60048036038101906102269190611a91565b610af3565b604051610238919061191d565b60405180910390f35b61025b60048036038101906102569190611964565b610d60565b604051610268919061191d565b60405180910390f35b61027961117c565b604051610286919061191d565b60405180910390f35b6102a960048036038101906102a49190611ae1565b611181565b6040516102b691906119a9565b60405180910390f35b6102d960048036038101906102d49190611b1f565b61135d565b6040516102e6919061191d565b60405180910390f35b61030960048036038101906103049190611b4a565b611467565b604051610316919061191d565b60405180910390f35b61033960048036038101906103349190611964565b6114b7565b604051610346919061191d565b60405180910390f35b600181565b5f5f6082600284901b901c14610396576040517f5f23b72600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f5f90505b60108160ff16101561041a575f6103b38583610ac8565b905060038160ff16106103f2576040517f7646c39a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8160ff16111561040c57828061040890611bc7565b9350505b50808060010191505061039c565b5060028114610455576040517f7646c39a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001915050919050565b600381565b5f81565b5f5f5f90505b60048160ff16101561078f576104826118e3565b5f5f90505b60048160ff1610156104e8576104b485826004866104a59190611c0e565b6104af9190611c4a565b610ac8565b828260ff16600481106104ca576104c9611c7e565b5b602002019060ff16908160ff16815250508080600101915050610487565b506104f16118e3565b5f5f90505f5f90505b60048160ff161015610586575f848260ff166004811061051d5761051c611c7e565b5b602002015160ff161461057957838160ff16600481106105405761053f611c7e565b5b602002015183838061055190611cab565b945060ff166004811061056757610566611c7e565b5b602002019060ff16908160ff16815250505b80806001019150506104fa565b505f5f90505b60038160ff161015610683575f838260ff16600481106105af576105ae611c7e565b5b602002015160ff161415801561060a5750826001826105ce9190611c4a565b60ff16600481106105e2576105e1611c7e565b5b602002015160ff16838260ff1660048110610600576105ff611c7e565b5b602002015160ff16145b1561067657828160ff166004811061062557610624611c7e565b5b60200201805180919061063790611cab565b60ff1660ff16815250505f836001836106509190611c4a565b60ff166004811061066457610663611c7e565b5b602002019060ff16908160ff16815250505b808060010191505061058c565b5061068c6118e3565b5f91505f5f90505b60048160ff161015610720575f848260ff16600481106106b7576106b6611c7e565b5b602002015160ff161461071357838160ff16600481106106da576106d9611c7e565b5b60200201518284806106eb90611cab565b955060ff166004811061070157610700611c7e565b5b602002019060ff16908160ff16815250505b8080600101915050610694565b505f5f90505b60048160ff16101561077d5761076e88826004896107449190611c0e565b61074e9190611c4a565b848460ff166004811061076457610763611c7e565b5b6020020151611467565b97508080600101915050610726565b5050505050808060010191505061046e565b50819050919050565b5f5f5f90505b60048160ff161015610abf576107b26118e3565b5f5f90505b60048160ff161015610818576107e485846004846107d59190611c0e565b6107df9190611c4a565b610ac8565b828260ff16600481106107fa576107f9611c7e565b5b602002019060ff16908160ff168152505080806001019150506107b7565b506108216118e3565b5f5f90505f5f90505b60048160ff1610156108b6575f848260ff166004811061084d5761084c611c7e565b5b602002015160ff16146108a957838160ff16600481106108705761086f611c7e565b5b602002015183838061088190611cab565b945060ff166004811061089757610896611c7e565b5b602002019060ff16908160ff16815250505b808060010191505061082a565b505f5f90505b60038160ff1610156109b3575f838260ff16600481106108df576108de611c7e565b5b602002015160ff161415801561093a5750826001826108fe9190611c4a565b60ff166004811061091257610911611c7e565b5b602002015160ff16838260ff16600481106109305761092f611c7e565b5b602002015160ff16145b156109a657828160ff166004811061095557610954611c7e565b5b60200201805180919061096790611cab565b60ff1660ff16815250505f836001836109809190611c4a565b60ff166004811061099457610993611c7e565b5b602002019060ff16908160ff16815250505b80806001019150506108bc565b506109bc6118e3565b5f91505f5f90505b60048160ff161015610a50575f848260ff16600481106109e7576109e6611c7e565b5b602002015160ff1614610a4357838160ff1660048110610a0a57610a09611c7e565b5b6020020151828480610a1b90611cab565b955060ff1660048110610a3157610a30611c7e565b5b602002019060ff16908160ff16815250505b80806001019150506109c4565b505f5f90505b60048160ff161015610aad57610a9e8887600484610a749190611c0e565b610a7e9190611c4a565b848460ff1660048110610a9457610a93611c7e565b5b6020020151611467565b97508080600101915050610a56565b5050505050808060010191505061079e565b50819050919050565b5f60ff600883600f610ada9190611cd3565b610ae49190611c0e565b60ff1684901c16905092915050565b5f60048310610b2e576040517f35405e3c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8303610b4557610b3e84610798565b9050610b8c565b60018303610b5d57610b56846114b7565b9050610b8b565b60038303610b7557610b6e84610d60565b9050610b8a565b60028303610b8957610b8684610468565b90505b5b5b5b608081901b608085901b03610bcd576040517f35405e3c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f90505f5f90505b60108160ff161015610c11575f610bed8483610ac8565b60ff1603610c04578180610c0090611bc7565b9250505b8080600101915050610bd6565b505f811115610d58575f85858486604051602001610c329493929190611d47565b604051602081830303815290604052805190602001205f1c90505f8267ffffffffffffffff811115610c6757610c66611d94565b5b604051908082528060200260200182016040528015610c955781602001602082028036833780820191505090505b5090505f5f90505f5f90505b60108160ff161015610d04575f610cb88783610ac8565b60ff1603610cf75780838381518110610cd457610cd3611c7e565b5b602002602001019060ff16908160ff16815250508180610cf390611bc7565b9250505b8080600101915050610ca1565b50610d5285838686610d169190611dee565b81518110610d2757610d26611c7e565b5b6020026020010151605a606487610d3e9190611dee565b11610d4a576001610d4d565b60025b611467565b94505050505b509392505050565b5f5f5f90505b60048160ff16101561117357610d7a6118e3565b5f5f90505b60048160ff161015610de057610dac8582600486610d9d9190611c0e565b610da79190611c4a565b610ac8565b828260ff1660048110610dc257610dc1611c7e565b5b602002019060ff16908160ff16815250508080600101915050610d7f565b50610de96118e3565b5f5f90505b60048160ff161015610e555782816003610e089190611cd3565b60ff1660048110610e1c57610e1b611c7e565b5b6020020151828260ff1660048110610e3757610e36611c7e565b5b602002019060ff16908160ff16815250508080600101915050610dee565b50610e5e6118e3565b5f5f90505f5f90505b60048160ff161015610ef3575f848260ff1660048110610e8a57610e89611c7e565b5b602002015160ff1614610ee657838160ff1660048110610ead57610eac611c7e565b5b6020020151838380610ebe90611cab565b945060ff1660048110610ed457610ed3611c7e565b5b602002019060ff16908160ff16815250505b8080600101915050610e67565b505f5f90505b60038160ff161015610ff0575f838260ff1660048110610f1c57610f1b611c7e565b5b602002015160ff1614158015610f77575082600182610f3b9190611c4a565b60ff1660048110610f4f57610f4e611c7e565b5b602002015160ff16838260ff1660048110610f6d57610f6c611c7e565b5b602002015160ff16145b15610fe357828160ff1660048110610f9257610f91611c7e565b5b602002018051809190610fa490611cab565b60ff1660ff16815250505f83600183610fbd9190611c4a565b60ff1660048110610fd157610fd0611c7e565b5b602002019060ff16908160ff16815250505b8080600101915050610ef9565b50610ff96118e3565b5f91505f5f90505b60048160ff16101561108d575f848260ff166004811061102457611023611c7e565b5b602002015160ff161461108057838160ff166004811061104757611046611c7e565b5b602002015182848061105890611cab565b955060ff166004811061106e5761106d611c7e565b5b602002019060ff16908160ff16815250505b8080600101915050611001565b506110966118e3565b5f5f90505b60048160ff16101561110257828160036110b59190611cd3565b60ff16600481106110c9576110c8611c7e565b5b6020020151828260ff16600481106110e4576110e3611c7e565b5b602002019060ff16908160ff1681525050808060010191505061109b565b505f5f90505b60048160ff16101561115f576111508a8260048b6111269190611c0e565b6111309190611c4a565b848460ff166004811061114657611145611c7e565b5b6020020151611467565b99508080600101915050611108565b505050505050508080600101915050610d66565b50819050919050565b600281565b5f5f6088600885901b901c146111c3576040517f5f23b72600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6088600884901b901c14611204576040517f5f23b72600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f61120f846118d3565b90505f8160ff160361122b5761122485610798565b915061127b565b60018160ff16036112465761123f856114b7565b915061127a565b60038160ff16036112615761125a85610d60565b9150611279565b60028160ff16036112785761127585610468565b91505b5b5b5b5f5f90505f5f90505f5f90505b60108160ff1610156112d25761129e8782610ac8565b60ff166112ab8683610ac8565b60ff16146112c55781806112be90611cab565b9250508092505b8080600101915050611288565b505f6112de8784610ac8565b60ff1690505f6112ee8685610ac8565b60ff161480156112fd57505f81115b80156113095750600381105b8015611318575060018260ff16145b61134e576040517f62417ce600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60019550505050505092915050565b5f5f826040516020016113709190611e1e565b604051602081830303815290604052805190602001205f1c90505f6010826113989190611dee565b9050816040516020016113ab9190611e38565b604051602081830303815290604052805190602001205f1c91505f6010836113d39190611dee565b90505b8181036113fd5760106001826113ec9190611e52565b6113f69190611dee565b90506113d6565b5f5f90505b60108160ff16101561145e57828160ff1614806114215750818160ff16145b156114515761144e8582605a60648861143a9190611dee565b11611446576001611449565b60025b611467565b94505b8080600101915050611402565b50505050919050565b5f600883600f6114779190611cd3565b6114819190611c0e565b60ff168260ff16901b600884600f6114999190611cd3565b6114a39190611c0e565b60ff1660ff901b1985161790509392505050565b5f5f5f90505b60048160ff1610156118ca576114d16118e3565b5f5f90505b60048160ff1610156115375761150385846004846114f49190611c0e565b6114fe9190611c4a565b610ac8565b828260ff166004811061151957611518611c7e565b5b602002019060ff16908160ff168152505080806001019150506114d6565b506115406118e3565b5f5f90505b60048160ff1610156115ac578281600361155f9190611cd3565b60ff166004811061157357611572611c7e565b5b6020020151828260ff166004811061158e5761158d611c7e565b5b602002019060ff16908160ff16815250508080600101915050611545565b506115b56118e3565b5f5f90505f5f90505b60048160ff16101561164a575f848260ff16600481106115e1576115e0611c7e565b5b602002015160ff161461163d57838160ff166004811061160457611603611c7e565b5b602002015183838061161590611cab565b945060ff166004811061162b5761162a611c7e565b5b602002019060ff16908160ff16815250505b80806001019150506115be565b505f5f90505b60038160ff161015611747575f838260ff166004811061167357611672611c7e565b5b602002015160ff16141580156116ce5750826001826116929190611c4a565b60ff16600481106116a6576116a5611c7e565b5b602002015160ff16838260ff16600481106116c4576116c3611c7e565b5b602002015160ff16145b1561173a57828160ff16600481106116e9576116e8611c7e565b5b6020020180518091906116fb90611cab565b60ff1660ff16815250505f836001836117149190611c4a565b60ff166004811061172857611727611c7e565b5b602002019060ff16908160ff16815250505b8080600101915050611650565b506117506118e3565b5f91505f5f90505b60048160ff1610156117e4575f848260ff166004811061177b5761177a611c7e565b5b602002015160ff16146117d757838160ff166004811061179e5761179d611c7e565b5b60200201518284806117af90611cab565b955060ff16600481106117c5576117c4611c7e565b5b602002019060ff16908160ff16815250505b8080600101915050611758565b506117ed6118e3565b5f5f90505b60048160ff161015611859578281600361180c9190611cd3565b60ff16600481106118205761181f611c7e565b5b6020020151828260ff166004811061183b5761183a611c7e565b5b602002019060ff16908160ff168152505080806001019150506117f2565b505f5f90505b60048160ff1610156118b6576118a78a8960048461187d9190611c0e565b6118879190611c4a565b848460ff166004811061189d5761189c611c7e565b5b6020020151611467565b9950808060010191505061185f565b5050505050505080806001019150506114bd565b50819050919050565b5f60ff60f883901c169050919050565b6040518060800160405280600490602082028036833780820191505090505090565b5f819050919050565b61191781611905565b82525050565b5f6020820190506119305f83018461190e565b92915050565b5f5ffd5b61194381611905565b811461194d575f5ffd5b50565b5f8135905061195e8161193a565b92915050565b5f6020828403121561197957611978611936565b5b5f61198684828501611950565b91505092915050565b5f8115159050919050565b6119a38161198f565b82525050565b5f6020820190506119bc5f83018461199a565b92915050565b5f60ff82169050919050565b6119d7816119c2565b81146119e1575f5ffd5b50565b5f813590506119f2816119ce565b92915050565b5f5f60408385031215611a0e57611a0d611936565b5b5f611a1b85828601611950565b9250506020611a2c858286016119e4565b9150509250929050565b611a3f816119c2565b82525050565b5f602082019050611a585f830184611a36565b92915050565b5f819050919050565b611a7081611a5e565b8114611a7a575f5ffd5b50565b5f81359050611a8b81611a67565b92915050565b5f5f5f60608486031215611aa857611aa7611936565b5b5f611ab586828701611950565b9350506020611ac686828701611950565b9250506040611ad786828701611a7d565b9150509250925092565b5f5f60408385031215611af757611af6611936565b5b5f611b0485828601611950565b9250506020611b1585828601611950565b9150509250929050565b5f60208284031215611b3457611b33611936565b5b5f611b4184828501611a7d565b91505092915050565b5f5f5f60608486031215611b6157611b60611936565b5b5f611b6e86828701611950565b9350506020611b7f868287016119e4565b9250506040611b90868287016119e4565b9150509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611bd182611905565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611c0357611c02611b9a565b5b600182019050919050565b5f611c18826119c2565b9150611c23836119c2565b9250828202611c31816119c2565b9150808214611c4357611c42611b9a565b5b5092915050565b5f611c54826119c2565b9150611c5f836119c2565b9250828201905060ff811115611c7857611c77611b9a565b5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f611cb5826119c2565b915060ff8203611cc857611cc7611b9a565b5b600182019050919050565b5f611cdd826119c2565b9150611ce8836119c2565b9250828203905060ff811115611d0157611d00611b9a565b5b92915050565b5f819050919050565b611d21611d1c82611905565b611d07565b82525050565b5f819050919050565b611d41611d3c82611a5e565b611d27565b82525050565b5f611d528287611d10565b602082019150611d628286611d10565b602082019150611d728285611d10565b602082019150611d828284611d30565b60208201915081905095945050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f611df882611905565b9150611e0383611905565b925082611e1357611e12611dc1565b5b828206905092915050565b5f611e298284611d30565b60208201915081905092915050565b5f611e438284611d10565b60208201915081905092915050565b5f611e5c82611905565b9150611e6783611905565b9250828201905080821115611e7f57611e7e611b9a565b5b9291505056fea2646970667358221220fa867ae34d8048e805af2679dd7ddcb1b030217712915ccfb6b220636c10087564736f6c634300081c0033", + "nonce": "0x2", + "chainId": "0x279f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x4e5b8bf263f57523a18296132cd4dfbe75e254e8a942a9a965ebf5f201f74f81", + "transactionType": "CREATE", + "contractName": "Play2048", + "contractAddress": "0xbb9378705e67a5439f4aef160ceaac7d932bf119", + "function": null, + "arguments": [ + "0x234828a40de63d21072D1218cFb5D208654C12Bb" + ], + "transaction": { + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "gas": "0x148ad1", + "value": "0x0", + "input": "0x60806040527f3230343800000000000000000000000000000000000000000000000000000000600155348015610033575f5ffd5b5060405161129f38038061129f83398181016040528101906100559190610198565b6100648161006a60201b60201c565b506101c3565b61007861013660201b60201c565b156100dd577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3811560ff1b8217815550610133565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3818155505b50565b5f90565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6101678261013e565b9050919050565b6101778161015d565b8114610181575f5ffd5b50565b5f815190506101928161016e565b92915050565b5f602082840312156101ad576101ac61013a565b5b5f6101ba84828501610184565b91505092915050565b6110cf806101d05f395ff3fe608060405260043610610113575f3560e01c806354d1f13d1161009f578063bedb86fb11610063578063bedb86fb14610345578063d65ab5f21461036d578063f04e283e14610397578063f2fde38b146103b3578063fee81cf4146103cf57610113565b806354d1f13d146102a1578063715018a6146102ab57806375b238fc146102b55780638da5cb5b146102df578063ac88036c1461030957610113565b806325692962116100e657806325692962146101c75780632de94807146101d15780633e98ab541461020d5780634a4ee7b114610249578063514e62fc1461026557610113565b80630ea30f4814610117578063183a4f6e146101535780631c10893f1461016f5780631cd64df41461018b575b5f5ffd5b348015610122575f5ffd5b5061013d60048036038101906101389190610c8a565b61040b565b60405161014a9190610cf4565b60405180910390f35b61016d60048036038101906101689190610d40565b61043b565b005b61018960048036038101906101849190610d95565b610448565b005b348015610196575f5ffd5b506101b160048036038101906101ac9190610d95565b61045e565b6040516101be9190610ded565b60405180910390f35b6101cf610474565b005b3480156101dc575f5ffd5b506101f760048036038101906101f29190610e06565b6104c5565b6040516102049190610e40565b60405180910390f35b348015610218575f5ffd5b50610233600480360381019061022e9190610e59565b6104de565b6040516102409190610e40565b60405180910390f35b610263600480360381019061025e9190610d95565b610729565b005b348015610270575f5ffd5b5061028b60048036038101906102869190610d95565b61073f565b6040516102989190610ded565b60405180910390f35b6102a9610756565b005b6102b361078f565b005b3480156102c0575f5ffd5b506102c96107a2565b6040516102d69190610e40565b60405180910390f35b3480156102ea575f5ffd5b506102f36107a7565b6040516103009190610cf4565b60405180910390f35b348015610314575f5ffd5b5061032f600480360381019061032a9190610c8a565b6107cf565b60405161033c9190610e40565b60405180910390f35b348015610350575f5ffd5b5061036b60048036038101906103669190610ec1565b6107e4565b005b348015610378575f5ffd5b50610381610842565b60405161038e9190610e40565b60405180910390f35b6103b160048036038101906103ac9190610e06565b610a1c565b005b6103cd60048036038101906103c89190610e06565b610a5a565b005b3480156103da575f5ffd5b506103f560048036038101906103f09190610e06565b610a83565b6040516104029190610e40565b60405180910390f35b6003602052805f5260405f205f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6104453382610a9c565b50565b610450610aab565b61045a8282610ae2565b5050565b5f818261046a856104c5565b1614905092915050565b5f61047d610af2565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f5fa250565b5f638b78c6d8600c52815f526020600c20549050919050565b5f5f5f9054906101000a900460ff1615610524576040517f379a7ed900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b43600154604051602001610539929190610f2c565b604051602081830303815290604052805190602001206001819055505f33905060035f8581526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146105ee576040517f2db47d5900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60025f8681526020019081526020015f205490505f811161063c576040517f3a5f7b5700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73c08a3e243288827586e0c3a590290593b2977e6b6337afd96482866001546040518463ffffffff1660e01b815260040161067993929190610f75565b602060405180830381865af4158015610694573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106b89190610fbe565b92508260025f8781526020019081526020015f2081905550848273ffffffffffffffffffffffffffffffffffffffff167f14fe4197a69dbcc73d79fcfd259bd1f097640dd2c2fe016ff232c416e17ce8428686604051610719929190610fe9565b60405180910390a3505092915050565b610731610aab565b61073b8282610a9c565b5050565b5f5f8261074b856104c5565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f5fa2565b610797610aab565b6107a05f610afc565b565b600181565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b6002602052805f5260405f205f915090505481565b60016107ef81610bc2565b815f5f6101000a81548160ff0219169083151502179055507f0e2fb031ee032dc02d8011dc50b816eb450cf856abd8261680dac74f72165bd2826040516108369190610ded565b60405180910390a15050565b5f5f5f9054906101000a900460ff1615610888576040517f379a7ed900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b4360015460405160200161089d929190610f2c565b604051602081830303815290604052805190602001206001819055505f3390505f33436040516020016108d1929190611055565b6040516020818303038152906040528051906020012090508160035f8381526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555073c08a3e243288827586e0c3a590290593b2977e6b637e8dbaf66001546040518263ffffffff1660e01b81526004016109719190611080565b602060405180830381865af415801561098c573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109b09190610fbe565b92508260025f8381526020019081526020015f2081905550808273ffffffffffffffffffffffffffffffffffffffff167f0d0a2245f107bccacfa55be58c1202917e494b61aae007897d04dc991442408d85604051610a0f9190610e40565b60405180910390a3505090565b610a24610aab565b63389a75e1600c52805f526020600c208054421115610a4a57636f5e88185f526004601cfd5b5f815550610a5781610afc565b50565b610a62610aab565b8060601b610a7757637448fbae5f526004601cfd5b610a8081610afc565b50565b5f63389a75e1600c52815f526020600c20549050919050565b610aa782825f610bf7565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314610ae0576382b429005f526004601cfd5b565b610aee82826001610bf7565b5050565b5f6202a300905090565b610b04610c4f565b15610b69577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3811560ff1b8217815550610bbf565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3818155505b50565b638b78c6d819543314610bf457638b78c6d8600c52335f52806020600c205416610bf3576382b429005f526004601cfd5b5b50565b638b78c6d8600c52825f526020600c20805483811783610c1957848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f5fa3505050505050565b5f90565b5f5ffd5b5f819050919050565b610c6981610c57565b8114610c73575f5ffd5b50565b5f81359050610c8481610c60565b92915050565b5f60208284031215610c9f57610c9e610c53565b5b5f610cac84828501610c76565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610cde82610cb5565b9050919050565b610cee81610cd4565b82525050565b5f602082019050610d075f830184610ce5565b92915050565b5f819050919050565b610d1f81610d0d565b8114610d29575f5ffd5b50565b5f81359050610d3a81610d16565b92915050565b5f60208284031215610d5557610d54610c53565b5b5f610d6284828501610d2c565b91505092915050565b610d7481610cd4565b8114610d7e575f5ffd5b50565b5f81359050610d8f81610d6b565b92915050565b5f5f60408385031215610dab57610daa610c53565b5b5f610db885828601610d81565b9250506020610dc985828601610d2c565b9150509250929050565b5f8115159050919050565b610de781610dd3565b82525050565b5f602082019050610e005f830184610dde565b92915050565b5f60208284031215610e1b57610e1a610c53565b5b5f610e2884828501610d81565b91505092915050565b610e3a81610d0d565b82525050565b5f602082019050610e535f830184610e31565b92915050565b5f5f60408385031215610e6f57610e6e610c53565b5b5f610e7c85828601610c76565b9250506020610e8d85828601610d2c565b9150509250929050565b610ea081610dd3565b8114610eaa575f5ffd5b50565b5f81359050610ebb81610e97565b92915050565b5f60208284031215610ed657610ed5610c53565b5b5f610ee384828501610ead565b91505092915050565b5f819050919050565b610f06610f0182610d0d565b610eec565b82525050565b5f819050919050565b610f26610f2182610c57565b610f0c565b82525050565b5f610f378285610ef5565b602082019150610f478284610f15565b6020820191508190509392505050565b610f6081610d0d565b82525050565b610f6f81610c57565b82525050565b5f606082019050610f885f830186610f57565b610f956020830185610f57565b610fa26040830184610f66565b949350505050565b5f81519050610fb881610d16565b92915050565b5f60208284031215610fd357610fd2610c53565b5b5f610fe084828501610faa565b91505092915050565b5f604082019050610ffc5f830185610e31565b6110096020830184610e31565b9392505050565b5f8160601b9050919050565b5f61102682611010565b9050919050565b5f6110378261101c565b9050919050565b61104f61104a82610cd4565b61102d565b82525050565b5f611060828561103e565b6014820191506110708284610ef5565b6020820191508190509392505050565b5f6020820190506110935f830184610f66565b9291505056fea2646970667358221220076da121549df007ff18bc47594cab292d48362a6178c5268b07a1ed56dd708e64736f6c634300081c0033000000000000000000000000234828a40de63d21072d1218cfb5d208654c12bb", + "nonce": "0x3", + "chainId": "0x279f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x1a93f35", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0x5312b1db067c3d897105e51f9e823e3d6f63f1d75678681a2c54295c50185087", + "transactionIndex": "0x75", + "blockHash": "0xc0324854ff5e70727aa2d8535bd4c8620b99fb1160fa1c4f7dc34df30747a6f9", + "blockNumber": "0x959a27", + "gasUsed": "0x24f8c1", + "effectiveGasPrice": "0xba43b7401", + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "contractAddress": null + }, + { + "status": "0x1", + "cumulativeGasUsed": "0x3061871", + "logs": [ + { + "address": "0xbb9378705e67a5439f4aef160ceaac7d932bf119", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000234828a40de63d21072d1218cfb5d208654c12bb" + ], + "data": "0x", + "blockHash": "0x15d2226870555edb745a544a748c39dfe1c5f1d216a5d864dd96c0564c90aed0", + "blockNumber": "0x959a2a", + "blockTimestamp": "0x67e6668c", + "transactionHash": "0x4e5b8bf263f57523a18296132cd4dfbe75e254e8a942a9a965ebf5f201f74f81", + "transactionIndex": "0x5b", + "logIndex": "0xb4", + "removed": false + } + ], + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000004000000000000008000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000020000040000400000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020800000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0x4e5b8bf263f57523a18296132cd4dfbe75e254e8a942a9a965ebf5f201f74f81", + "transactionIndex": "0x5b", + "blockHash": "0x15d2226870555edb745a544a748c39dfe1c5f1d216a5d864dd96c0564c90aed0", + "blockNumber": "0x959a2a", + "gasUsed": "0x148ad1", + "effectiveGasPrice": "0xba43b7401", + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": null, + "contractAddress": "0xbb9378705e67a5439f4aef160ceaac7d932bf119" + } + ], + "libraries": [ + "src/LibBoard.sol:Board:0xc08a3e243288827586e0c3a590290593b2977e6b" + ], + "pending": [], + "returns": { + "gameContract": { + "internal_type": "address", + "value": "0xBb9378705E67a5439f4AEF160cEAaC7D932BF119" + } + }, + "timestamp": 1743152781, + "chain": 10143, + "commit": "36b502f" +} \ No newline at end of file diff --git a/packages/contracts/broadcast/Deploy.s.sol/10143/run-1743408572.json b/packages/contracts/broadcast/Deploy.s.sol/10143/run-1743408572.json new file mode 100644 index 0000000..da668e2 --- /dev/null +++ b/packages/contracts/broadcast/Deploy.s.sol/10143/run-1743408572.json @@ -0,0 +1,72 @@ +{ + "transactions": [ + { + "hash": "0x4ec9c4d142533240d28ad1c92c374b550d14f26c9656a914dcf61a9b8aee5d24", + "transactionType": "CREATE", + "contractName": "Play2048", + "contractAddress": "0xe1e5f226f8dac0bac6b363c6e0b8a38a5dc7f1fb", + "function": null, + "arguments": [ + "0x234828a40de63d21072D1218cFb5D208654C12Bb" + ], + "transaction": { + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "gas": "0x179d94", + "value": "0x0", + "input": "0x60806040527f3230343800000000000000000000000000000000000000000000000000000000600155348015610033575f5ffd5b5060405161156d38038061156d83398181016040528101906100559190610198565b6100648161006a60201b60201c565b506101c3565b61007861013660201b60201c565b156100dd577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3811560ff1b8217815550610133565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3818155505b50565b5f90565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6101678261013e565b9050919050565b6101778161015d565b8114610181575f5ffd5b50565b5f815190506101928161016e565b92915050565b5f602082840312156101ad576101ac61013a565b5b5f6101ba84828501610184565b91505092915050565b61139d806101d05f395ff3fe60806040526004361061011e575f3560e01c8063715018a61161009f578063d65ab5f211610063578063d65ab5f214610378578063e51b891f146103a2578063f04e283e146103de578063f2fde38b146103fa578063fee81cf4146104165761011e565b8063715018a6146102b657806375b238fc146102c05780638da5cb5b146102ea578063ac88036c14610314578063bedb86fb146103505761011e565b80632de94807116100e65780632de94807146101dc5780633e98ab54146102185780634a4ee7b114610254578063514e62fc1461027057806354d1f13d146102ac5761011e565b80630ea30f4814610122578063183a4f6e1461015e5780631c10893f1461017a5780631cd64df41461019657806325692962146101d2575b5f5ffd5b34801561012d575f5ffd5b5061014860048036038101906101439190610dd5565b610452565b6040516101559190610e3f565b60405180910390f35b61017860048036038101906101739190610e8b565b610482565b005b610194600480360381019061018f9190610ee0565b61048f565b005b3480156101a1575f5ffd5b506101bc60048036038101906101b79190610ee0565b6104a5565b6040516101c99190610f38565b60405180910390f35b6101da6104bb565b005b3480156101e7575f5ffd5b5061020260048036038101906101fd9190610f51565b61050c565b60405161020f9190610f8b565b60405180910390f35b348015610223575f5ffd5b5061023e60048036038101906102399190610fa4565b610525565b60405161024b9190610f8b565b60405180910390f35b61026e60048036038101906102699190610ee0565b610770565b005b34801561027b575f5ffd5b5061029660048036038101906102919190610ee0565b610786565b6040516102a39190610f38565b60405180910390f35b6102b461079d565b005b6102be6107d6565b005b3480156102cb575f5ffd5b506102d46107e9565b6040516102e19190610f8b565b60405180910390f35b3480156102f5575f5ffd5b506102fe6107ee565b60405161030b9190610e3f565b60405180910390f35b34801561031f575f5ffd5b5061033a60048036038101906103359190610dd5565b610816565b6040516103479190610f8b565b60405180910390f35b34801561035b575f5ffd5b506103766004803603810190610371919061100c565b61082b565b005b348015610383575f5ffd5b5061038c610889565b6040516103999190610f8b565b60405180910390f35b3480156103ad575f5ffd5b506103c860048036038101906103c39190610dd5565b610a63565b6040516103d591906110e8565b60405180910390f35b6103f860048036038101906103f39190610f51565b610b44565b005b610414600480360381019061040f9190610f51565b610b82565b005b348015610421575f5ffd5b5061043c60048036038101906104379190610f51565b610bab565b6040516104499190610f8b565b60405180910390f35b6003602052805f5260405f205f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61048c3382610bc4565b50565b610497610bd3565b6104a18282610c0a565b5050565b5f81826104b18561050c565b1614905092915050565b5f6104c4610c1a565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f5fa250565b5f638b78c6d8600c52815f526020600c20549050919050565b5f5f5f9054906101000a900460ff161561056b576040517f379a7ed900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b43600154604051602001610580929190611142565b604051602081830303815290604052805190602001206001819055505f33905060035f8581526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610635576040517f2db47d5900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60025f8681526020019081526020015f205490505f8111610683576040517f3a5f7b5700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73c08a3e243288827586e0c3a590290593b2977e6b6337afd96482866001546040518463ffffffff1660e01b81526004016106c09392919061118b565b602060405180830381865af41580156106db573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106ff91906111d4565b92508260025f8781526020019081526020015f2081905550848273ffffffffffffffffffffffffffffffffffffffff167f14fe4197a69dbcc73d79fcfd259bd1f097640dd2c2fe016ff232c416e17ce84286866040516107609291906111ff565b60405180910390a3505092915050565b610778610bd3565b6107828282610bc4565b5050565b5f5f826107928561050c565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f5fa2565b6107de610bd3565b6107e75f610c24565b565b600181565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b6002602052805f5260405f205f915090505481565b600161083681610cea565b815f5f6101000a81548160ff0219169083151502179055507f0e2fb031ee032dc02d8011dc50b816eb450cf856abd8261680dac74f72165bd28260405161087d9190610f38565b60405180910390a15050565b5f5f5f9054906101000a900460ff16156108cf576040517f379a7ed900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b436001546040516020016108e4929190611142565b604051602081830303815290604052805190602001206001819055505f3390505f334360405160200161091892919061126b565b6040516020818303038152906040528051906020012090508160035f8381526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555073c08a3e243288827586e0c3a590290593b2977e6b637e8dbaf66001546040518263ffffffff1660e01b81526004016109b89190611296565b602060405180830381865af41580156109d3573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109f791906111d4565b92508260025f8381526020019081526020015f2081905550808273ffffffffffffffffffffffffffffffffffffffff167f0d0a2245f107bccacfa55be58c1202917e494b61aae007897d04dc991442408d85604051610a569190610f8b565b60405180910390a3505090565b610a6b610d7b565b5f60025f8481526020019081526020015f205490505f5f90505b60108160ff161015610b3d5773c08a3e243288827586e0c3a590290593b2977e6b6335e37c7283836040518363ffffffff1660e01b8152600401610aca9291906112be565b602060405180830381865af4158015610ae5573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b09919061130f565b838260ff1660108110610b1f57610b1e61133a565b5b602002019060ff16908160ff16815250508080600101915050610a85565b5050919050565b610b4c610bd3565b63389a75e1600c52805f526020600c208054421115610b7257636f5e88185f526004601cfd5b5f815550610b7f81610c24565b50565b610b8a610bd3565b8060601b610b9f57637448fbae5f526004601cfd5b610ba881610c24565b50565b5f63389a75e1600c52815f526020600c20549050919050565b610bcf82825f610d1f565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314610c08576382b429005f526004601cfd5b565b610c1682826001610d1f565b5050565b5f6202a300905090565b610c2c610d77565b15610c91577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3811560ff1b8217815550610ce7565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3818155505b50565b638b78c6d819543314610d1c57638b78c6d8600c52335f52806020600c205416610d1b576382b429005f526004601cfd5b5b50565b638b78c6d8600c52825f526020600c20805483811783610d4157848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f5fa3505050505050565b5f90565b604051806102000160405280601090602082028036833780820191505090505090565b5f5ffd5b5f819050919050565b610db481610da2565b8114610dbe575f5ffd5b50565b5f81359050610dcf81610dab565b92915050565b5f60208284031215610dea57610de9610d9e565b5b5f610df784828501610dc1565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610e2982610e00565b9050919050565b610e3981610e1f565b82525050565b5f602082019050610e525f830184610e30565b92915050565b5f819050919050565b610e6a81610e58565b8114610e74575f5ffd5b50565b5f81359050610e8581610e61565b92915050565b5f60208284031215610ea057610e9f610d9e565b5b5f610ead84828501610e77565b91505092915050565b610ebf81610e1f565b8114610ec9575f5ffd5b50565b5f81359050610eda81610eb6565b92915050565b5f5f60408385031215610ef657610ef5610d9e565b5b5f610f0385828601610ecc565b9250506020610f1485828601610e77565b9150509250929050565b5f8115159050919050565b610f3281610f1e565b82525050565b5f602082019050610f4b5f830184610f29565b92915050565b5f60208284031215610f6657610f65610d9e565b5b5f610f7384828501610ecc565b91505092915050565b610f8581610e58565b82525050565b5f602082019050610f9e5f830184610f7c565b92915050565b5f5f60408385031215610fba57610fb9610d9e565b5b5f610fc785828601610dc1565b9250506020610fd885828601610e77565b9150509250929050565b610feb81610f1e565b8114610ff5575f5ffd5b50565b5f8135905061100681610fe2565b92915050565b5f6020828403121561102157611020610d9e565b5b5f61102e84828501610ff8565b91505092915050565b5f60109050919050565b5f81905092915050565b5f819050919050565b5f60ff82169050919050565b61106981611054565b82525050565b5f61107a8383611060565b60208301905092915050565b5f602082019050919050565b61109b81611037565b6110a58184611041565b92506110b08261104b565b805f5b838110156110e05781516110c7878261106f565b96506110d283611086565b9250506001810190506110b3565b505050505050565b5f610200820190506110fc5f830184611092565b92915050565b5f819050919050565b61111c61111782610e58565b611102565b82525050565b5f819050919050565b61113c61113782610da2565b611122565b82525050565b5f61114d828561110b565b60208201915061115d828461112b565b6020820191508190509392505050565b61117681610e58565b82525050565b61118581610da2565b82525050565b5f60608201905061119e5f83018661116d565b6111ab602083018561116d565b6111b8604083018461117c565b949350505050565b5f815190506111ce81610e61565b92915050565b5f602082840312156111e9576111e8610d9e565b5b5f6111f6848285016111c0565b91505092915050565b5f6040820190506112125f830185610f7c565b61121f6020830184610f7c565b9392505050565b5f8160601b9050919050565b5f61123c82611226565b9050919050565b5f61124d82611232565b9050919050565b61126561126082610e1f565b611243565b82525050565b5f6112768285611254565b601482019150611286828461110b565b6020820191508190509392505050565b5f6020820190506112a95f83018461117c565b92915050565b6112b881611054565b82525050565b5f6040820190506112d15f83018561116d565b6112de60208301846112af565b9392505050565b6112ee81611054565b81146112f8575f5ffd5b50565b5f81519050611309816112e5565b92915050565b5f6020828403121561132457611323610d9e565b5b5f611331848285016112fb565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffdfea26469706673582212206eb2140d818a06e17fbf6832092a2b64520372157ea53bb8f730f02744e7b01664736f6c634300081c0033000000000000000000000000234828a40de63d21072d1218cfb5d208654c12bb", + "nonce": "0x4", + "chainId": "0x279f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x7ed3ce", + "logs": [ + { + "address": "0xe1e5f226f8dac0bac6b363c6e0b8a38a5dc7f1fb", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000234828a40de63d21072d1218cfb5d208654c12bb" + ], + "data": "0x", + "blockHash": "0x51d8694ecc291b0c7c8ba82999a7320a0b893702946a1d6911f0b7cfe82c3d03", + "blockNumber": "0x9c209a", + "blockTimestamp": "0x67ea4db9", + "transactionHash": "0x4ec9c4d142533240d28ad1c92c374b550d14f26c9656a914dcf61a9b8aee5d24", + "transactionIndex": "0x42", + "logIndex": "0x6d", + "removed": false + } + ], + "logsBloom": "0x00000200000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000800800000000000000000000020000040000400000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020800000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0x4ec9c4d142533240d28ad1c92c374b550d14f26c9656a914dcf61a9b8aee5d24", + "transactionIndex": "0x42", + "blockHash": "0x51d8694ecc291b0c7c8ba82999a7320a0b893702946a1d6911f0b7cfe82c3d03", + "blockNumber": "0x9c209a", + "gasUsed": "0x179d94", + "effectiveGasPrice": "0xba43b7401", + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": null, + "contractAddress": "0xe1e5f226f8dac0bac6b363c6e0b8a38a5dc7f1fb" + } + ], + "libraries": [ + "src/LibBoard.sol:Board:0xc08a3e243288827586e0c3a590290593b2977e6b" + ], + "pending": [], + "returns": { + "gameContract": { + "internal_type": "address", + "value": "0xe1E5f226f8DAC0baC6b363c6e0B8A38a5DC7F1fB" + } + }, + "timestamp": 1743408572, + "chain": 10143, + "commit": "331b054" +} \ No newline at end of file diff --git a/packages/contracts/broadcast/Deploy.s.sol/10143/run-1743496583.json b/packages/contracts/broadcast/Deploy.s.sol/10143/run-1743496583.json new file mode 100644 index 0000000..d3174af --- /dev/null +++ b/packages/contracts/broadcast/Deploy.s.sol/10143/run-1743496583.json @@ -0,0 +1,106 @@ +{ + "transactions": [ + { + "hash": "0xd1a1d02447759a99e02254f0c998e24d6ce04ce95bdb88228568c3b037e06518", + "transactionType": "CREATE2", + "contractName": "Board", + "contractAddress": "0x18c3a7837feee1d838dba085611d3a0903ceed72", + "function": null, + "arguments": null, + "transaction": { + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "gas": "0x253d1a", + "input": "0x0000000000000000000000000000000000000000000000000000000000000000611ef761004d600b8282823980515f1a6073146041577f4e487b71000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b305f52607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100f3575f3560e01c806337afd9641161009557806365b559b01161006f57806365b559b01461028f5780637e8dbaf6146102bf578063f173e012146102ef578063f54a36eb1461031f576100f3565b806337afd964146102115780633b9f7a1f1461024157806364cd159514610271576100f3565b806324f4ec51116100d157806324f4ec51146101635780632c5f3c4514610181578063312ffe40146101b157806335e37c72146101e1576100f3565b806301df1995146100f757806319c14718146101155780631af4f97014610145575b5f5ffd5b6100ff61034f565b60405161010c9190611959565b60405180910390f35b61012f600480360381019061012a91906119a0565b610354565b60405161013c91906119e5565b60405180910390f35b61014d61045b565b60405161015a9190611959565b60405180910390f35b61016b610460565b6040516101789190611959565b60405180910390f35b61019b600480360381019061019691906119a0565b610464565b6040516101a89190611959565b60405180910390f35b6101cb60048036038101906101c691906119a0565b610794565b6040516101d89190611959565b60405180910390f35b6101fb60048036038101906101f69190611a34565b610ac4565b6040516102089190611a81565b60405180910390f35b61022b60048036038101906102269190611acd565b610aef565b6040516102389190611959565b60405180910390f35b61025b600480360381019061025691906119a0565b610d66565b6040516102689190611959565b60405180910390f35b610279611182565b6040516102869190611959565b60405180910390f35b6102a960048036038101906102a49190611b1d565b611187565b6040516102b691906119e5565b60405180910390f35b6102d960048036038101906102d49190611b5b565b611399565b6040516102e69190611959565b60405180910390f35b61030960048036038101906103049190611b86565b6114a3565b6040516103169190611959565b60405180910390f35b610339600480360381019061033491906119a0565b6114f3565b6040516103469190611959565b60405180910390f35b600181565b5f5f608083901c14610392576040517f5f23b72600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f5f90505b60108160ff161015610416575f6103af8583610ac4565b905060038160ff16106103ee576040517f7646c39a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8160ff16111561040857828061040490611c03565b9350505b508080600101915050610398565b5060028114610451576040517f7646c39a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001915050919050565b600381565b5f81565b5f5f5f90505b60048160ff16101561078b5761047e61191f565b5f5f90505b60048160ff1610156104e4576104b085826004866104a19190611c4a565b6104ab9190611c86565b610ac4565b828260ff16600481106104c6576104c5611cba565b5b602002019060ff16908160ff16815250508080600101915050610483565b506104ed61191f565b5f5f90505f5f90505b60048160ff161015610582575f848260ff166004811061051957610518611cba565b5b602002015160ff161461057557838160ff166004811061053c5761053b611cba565b5b602002015183838061054d90611ce7565b945060ff166004811061056357610562611cba565b5b602002019060ff16908160ff16815250505b80806001019150506104f6565b505f5f90505b60038160ff16101561067f575f838260ff16600481106105ab576105aa611cba565b5b602002015160ff16141580156106065750826001826105ca9190611c86565b60ff16600481106105de576105dd611cba565b5b602002015160ff16838260ff16600481106105fc576105fb611cba565b5b602002015160ff16145b1561067257828160ff166004811061062157610620611cba565b5b60200201805180919061063390611ce7565b60ff1660ff16815250505f8360018361064c9190611c86565b60ff16600481106106605761065f611cba565b5b602002019060ff16908160ff16815250505b8080600101915050610588565b5061068861191f565b5f91505f5f90505b60048160ff16101561071c575f848260ff16600481106106b3576106b2611cba565b5b602002015160ff161461070f57838160ff16600481106106d6576106d5611cba565b5b60200201518284806106e790611ce7565b955060ff16600481106106fd576106fc611cba565b5b602002019060ff16908160ff16815250505b8080600101915050610690565b505f5f90505b60048160ff1610156107795761076a88826004896107409190611c4a565b61074a9190611c86565b848460ff16600481106107605761075f611cba565b5b60200201516114a3565b97508080600101915050610722565b5050505050808060010191505061046a565b50819050919050565b5f5f5f90505b60048160ff161015610abb576107ae61191f565b5f5f90505b60048160ff161015610814576107e085846004846107d19190611c4a565b6107db9190611c86565b610ac4565b828260ff16600481106107f6576107f5611cba565b5b602002019060ff16908160ff168152505080806001019150506107b3565b5061081d61191f565b5f5f90505f5f90505b60048160ff1610156108b2575f848260ff166004811061084957610848611cba565b5b602002015160ff16146108a557838160ff166004811061086c5761086b611cba565b5b602002015183838061087d90611ce7565b945060ff166004811061089357610892611cba565b5b602002019060ff16908160ff16815250505b8080600101915050610826565b505f5f90505b60038160ff1610156109af575f838260ff16600481106108db576108da611cba565b5b602002015160ff16141580156109365750826001826108fa9190611c86565b60ff166004811061090e5761090d611cba565b5b602002015160ff16838260ff166004811061092c5761092b611cba565b5b602002015160ff16145b156109a257828160ff166004811061095157610950611cba565b5b60200201805180919061096390611ce7565b60ff1660ff16815250505f8360018361097c9190611c86565b60ff16600481106109905761098f611cba565b5b602002019060ff16908160ff16815250505b80806001019150506108b8565b506109b861191f565b5f91505f5f90505b60048160ff161015610a4c575f848260ff16600481106109e3576109e2611cba565b5b602002015160ff1614610a3f57838160ff1660048110610a0657610a05611cba565b5b6020020151828480610a1790611ce7565b955060ff1660048110610a2d57610a2c611cba565b5b602002019060ff16908160ff16815250505b80806001019150506109c0565b505f5f90505b60048160ff161015610aa957610a9a8887600484610a709190611c4a565b610a7a9190611c86565b848460ff1660048110610a9057610a8f611cba565b5b60200201516114a3565b97508080600101915050610a52565b5050505050808060010191505061079a565b50819050919050565b5f60ff600883600f610ad69190611d0f565b610ae09190611c4a565b60ff1684901c16905092915050565b5f60048310610b2a576040517f35405e3c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8303610b4157610b3a84610794565b9050610b88565b60018303610b5957610b52846114f3565b9050610b87565b60038303610b7157610b6a84610d66565b9050610b86565b60028303610b8557610b8284610464565b90505b5b5b5b608081901b608085901b03610bc9576040517f35405e3c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f90505f5f90505b60108160ff161015610c0d575f610be98483610ac4565b60ff1603610c00578180610bfc90611c03565b9250505b8080600101915050610bd2565b505f811115610d54575f85858486604051602001610c2e9493929190611d83565b604051602081830303815290604052805190602001205f1c90505f8267ffffffffffffffff811115610c6357610c62611dd0565b5b604051908082528060200260200182016040528015610c915781602001602082028036833780820191505090505b5090505f5f90505f5f90505b60108160ff161015610d00575f610cb48783610ac4565b60ff1603610cf35780838381518110610cd057610ccf611cba565b5b602002602001019060ff16908160ff16815250508180610cef90611c03565b9250505b8080600101915050610c9d565b50610d4e85838686610d129190611e2a565b81518110610d2357610d22611cba565b5b6020026020010151605a606487610d3a9190611e2a565b11610d46576001610d49565b60025b6114a3565b94505050505b60808083901b901c9150509392505050565b5f5f5f90505b60048160ff16101561117957610d8061191f565b5f5f90505b60048160ff161015610de657610db28582600486610da39190611c4a565b610dad9190611c86565b610ac4565b828260ff1660048110610dc857610dc7611cba565b5b602002019060ff16908160ff16815250508080600101915050610d85565b50610def61191f565b5f5f90505b60048160ff161015610e5b5782816003610e0e9190611d0f565b60ff1660048110610e2257610e21611cba565b5b6020020151828260ff1660048110610e3d57610e3c611cba565b5b602002019060ff16908160ff16815250508080600101915050610df4565b50610e6461191f565b5f5f90505f5f90505b60048160ff161015610ef9575f848260ff1660048110610e9057610e8f611cba565b5b602002015160ff1614610eec57838160ff1660048110610eb357610eb2611cba565b5b6020020151838380610ec490611ce7565b945060ff1660048110610eda57610ed9611cba565b5b602002019060ff16908160ff16815250505b8080600101915050610e6d565b505f5f90505b60038160ff161015610ff6575f838260ff1660048110610f2257610f21611cba565b5b602002015160ff1614158015610f7d575082600182610f419190611c86565b60ff1660048110610f5557610f54611cba565b5b602002015160ff16838260ff1660048110610f7357610f72611cba565b5b602002015160ff16145b15610fe957828160ff1660048110610f9857610f97611cba565b5b602002018051809190610faa90611ce7565b60ff1660ff16815250505f83600183610fc39190611c86565b60ff1660048110610fd757610fd6611cba565b5b602002019060ff16908160ff16815250505b8080600101915050610eff565b50610fff61191f565b5f91505f5f90505b60048160ff161015611093575f848260ff166004811061102a57611029611cba565b5b602002015160ff161461108657838160ff166004811061104d5761104c611cba565b5b602002015182848061105e90611ce7565b955060ff166004811061107457611073611cba565b5b602002019060ff16908160ff16815250505b8080600101915050611007565b5061109c61191f565b5f5f90505b60048160ff16101561110857828160036110bb9190611d0f565b60ff16600481106110cf576110ce611cba565b5b6020020151828260ff16600481106110ea576110e9611cba565b5b602002019060ff16908160ff168152505080806001019150506110a1565b505f5f90505b60048160ff161015611165576111568a8260048b61112c9190611c4a565b6111369190611c86565b848460ff166004811061114c5761114b611cba565b5b60200201516114a3565b9950808060010191505061110e565b505050505050508080600101915050610d6c565b50819050919050565b600281565b5f5f6088600885901b901c146111c9576040517f5f23b72600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6088600884901b901c1461120a576040517f5f23b72600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f6112158461190f565b90505f8160ff16036112315761122a85610794565b91506112b7565b60018160ff160361124c57611245856114f3565b91506112b6565b60038160ff16036112675761126085610d66565b91506112b5565b60028160ff16036112825761127b85610464565b91506112b4565b6040517f35405e3c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b5b5b5f5f90505f5f90505f5f90505b60108160ff16101561130e576112da8782610ac4565b60ff166112e78683610ac4565b60ff16146113015781806112fa90611ce7565b9250508092505b80806001019150506112c4565b505f61131a8784610ac4565b60ff1690505f61132a8685610ac4565b60ff1614801561133957505f81115b80156113455750600381105b8015611354575060018260ff16145b61138a576040517f62417ce600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60019550505050505092915050565b5f5f826040516020016113ac9190611e5a565b604051602081830303815290604052805190602001205f1c90505f6010826113d49190611e2a565b9050816040516020016113e79190611e74565b604051602081830303815290604052805190602001205f1c91505f60108361140f9190611e2a565b90505b8181036114395760106001826114289190611e8e565b6114329190611e2a565b9050611412565b5f5f90505b60108160ff16101561149a57828160ff16148061145d5750818160ff16145b1561148d5761148a8582605a6064886114769190611e2a565b11611482576001611485565b60025b6114a3565b94505b808060010191505061143e565b50505050919050565b5f600883600f6114b39190611d0f565b6114bd9190611c4a565b60ff168260ff16901b600884600f6114d59190611d0f565b6114df9190611c4a565b60ff1660ff901b1985161790509392505050565b5f5f5f90505b60048160ff1610156119065761150d61191f565b5f5f90505b60048160ff1610156115735761153f85846004846115309190611c4a565b61153a9190611c86565b610ac4565b828260ff166004811061155557611554611cba565b5b602002019060ff16908160ff16815250508080600101915050611512565b5061157c61191f565b5f5f90505b60048160ff1610156115e8578281600361159b9190611d0f565b60ff16600481106115af576115ae611cba565b5b6020020151828260ff16600481106115ca576115c9611cba565b5b602002019060ff16908160ff16815250508080600101915050611581565b506115f161191f565b5f5f90505f5f90505b60048160ff161015611686575f848260ff166004811061161d5761161c611cba565b5b602002015160ff161461167957838160ff16600481106116405761163f611cba565b5b602002015183838061165190611ce7565b945060ff166004811061166757611666611cba565b5b602002019060ff16908160ff16815250505b80806001019150506115fa565b505f5f90505b60038160ff161015611783575f838260ff16600481106116af576116ae611cba565b5b602002015160ff161415801561170a5750826001826116ce9190611c86565b60ff16600481106116e2576116e1611cba565b5b602002015160ff16838260ff1660048110611700576116ff611cba565b5b602002015160ff16145b1561177657828160ff166004811061172557611724611cba565b5b60200201805180919061173790611ce7565b60ff1660ff16815250505f836001836117509190611c86565b60ff166004811061176457611763611cba565b5b602002019060ff16908160ff16815250505b808060010191505061168c565b5061178c61191f565b5f91505f5f90505b60048160ff161015611820575f848260ff16600481106117b7576117b6611cba565b5b602002015160ff161461181357838160ff16600481106117da576117d9611cba565b5b60200201518284806117eb90611ce7565b955060ff166004811061180157611800611cba565b5b602002019060ff16908160ff16815250505b8080600101915050611794565b5061182961191f565b5f5f90505b60048160ff16101561189557828160036118489190611d0f565b60ff166004811061185c5761185b611cba565b5b6020020151828260ff166004811061187757611876611cba565b5b602002019060ff16908160ff1681525050808060010191505061182e565b505f5f90505b60048160ff1610156118f2576118e38a896004846118b99190611c4a565b6118c39190611c86565b848460ff16600481106118d9576118d8611cba565b5b60200201516114a3565b9950808060010191505061189b565b5050505050505080806001019150506114f9565b50819050919050565b5f60ff60f883901c169050919050565b6040518060800160405280600490602082028036833780820191505090505090565b5f819050919050565b61195381611941565b82525050565b5f60208201905061196c5f83018461194a565b92915050565b5f5ffd5b61197f81611941565b8114611989575f5ffd5b50565b5f8135905061199a81611976565b92915050565b5f602082840312156119b5576119b4611972565b5b5f6119c28482850161198c565b91505092915050565b5f8115159050919050565b6119df816119cb565b82525050565b5f6020820190506119f85f8301846119d6565b92915050565b5f60ff82169050919050565b611a13816119fe565b8114611a1d575f5ffd5b50565b5f81359050611a2e81611a0a565b92915050565b5f5f60408385031215611a4a57611a49611972565b5b5f611a578582860161198c565b9250506020611a6885828601611a20565b9150509250929050565b611a7b816119fe565b82525050565b5f602082019050611a945f830184611a72565b92915050565b5f819050919050565b611aac81611a9a565b8114611ab6575f5ffd5b50565b5f81359050611ac781611aa3565b92915050565b5f5f5f60608486031215611ae457611ae3611972565b5b5f611af18682870161198c565b9350506020611b028682870161198c565b9250506040611b1386828701611ab9565b9150509250925092565b5f5f60408385031215611b3357611b32611972565b5b5f611b408582860161198c565b9250506020611b518582860161198c565b9150509250929050565b5f60208284031215611b7057611b6f611972565b5b5f611b7d84828501611ab9565b91505092915050565b5f5f5f60608486031215611b9d57611b9c611972565b5b5f611baa8682870161198c565b9350506020611bbb86828701611a20565b9250506040611bcc86828701611a20565b9150509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611c0d82611941565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611c3f57611c3e611bd6565b5b600182019050919050565b5f611c54826119fe565b9150611c5f836119fe565b9250828202611c6d816119fe565b9150808214611c7f57611c7e611bd6565b5b5092915050565b5f611c90826119fe565b9150611c9b836119fe565b9250828201905060ff811115611cb457611cb3611bd6565b5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f611cf1826119fe565b915060ff8203611d0457611d03611bd6565b5b600182019050919050565b5f611d19826119fe565b9150611d24836119fe565b9250828203905060ff811115611d3d57611d3c611bd6565b5b92915050565b5f819050919050565b611d5d611d5882611941565b611d43565b82525050565b5f819050919050565b611d7d611d7882611a9a565b611d63565b82525050565b5f611d8e8287611d4c565b602082019150611d9e8286611d4c565b602082019150611dae8285611d4c565b602082019150611dbe8284611d6c565b60208201915081905095945050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f611e3482611941565b9150611e3f83611941565b925082611e4f57611e4e611dfd565b5b828206905092915050565b5f611e658284611d6c565b60208201915081905092915050565b5f611e7f8284611d4c565b60208201915081905092915050565b5f611e9882611941565b9150611ea383611941565b9250828201905080821115611ebb57611eba611bd6565b5b9291505056fea2646970667358221220f3332bc015a8b02b5587e4d5451954a7c1e1befc72256bf96ca5646438f5bfa764736f6c634300081c0033", + "nonce": "0x6", + "chainId": "0x279f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xcafedab3827c2aeb04a3316ccf04a30d0d465c17597579ddba79f0c69cacb44c", + "transactionType": "CREATE", + "contractName": "Play2048", + "contractAddress": "0x977fb1f92dfbf475df926db7fee64cc705a762bd", + "function": null, + "arguments": [ + "0x234828a40de63d21072D1218cFb5D208654C12Bb" + ], + "transaction": { + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "gas": "0x1c7893", + "value": "0x0", + "input": "0x608060405234801561000f575f5ffd5b50604051611a29380380611a2983398181016040528101906100319190610174565b6100408161004660201b60201c565b5061019f565b61005461011260201b60201c565b156100b9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3811560ff1b821781555061010f565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3818155505b50565b5f90565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6101438261011a565b9050919050565b61015381610139565b811461015d575f5ffd5b50565b5f8151905061016e8161014a565b92915050565b5f6020828403121561018957610188610116565b5b5f61019684828501610160565b91505092915050565b61187d806101ac5f395ff3fe608060405260043610610133575f3560e01c806354d1f13d116100aa578063ac88036c1161006e578063ac88036c146103b5578063bedb86fb146103f1578063e51b891f14610419578063f04e283e14610455578063f2fde38b14610471578063fee81cf41461048d57610133565b806354d1f13d14610311578063715018a61461031b57806375b238fc1461032557806389d355e91461034f5780638da5cb5b1461038b57610133565b806325692962116100fc57806325692962146102235780632de948071461022d57806339b9e19f146102695780633e98ab54146102915780634a4ee7b1146102b9578063514e62fc146102d557610133565b80622a0c3d146101375780630ea30f4814610173578063183a4f6e146101af5780631c10893f146101cb5780631cd64df4146101e7575b5f5ffd5b348015610142575f5ffd5b5061015d600480360381019061015891906111c6565b6104c9565b60405161016a9190611200565b60405180910390f35b34801561017e575f5ffd5b50610199600480360381019061019491906111c6565b6104de565b6040516101a69190611258565b60405180910390f35b6101c960048036038101906101c491906112a4565b61050e565b005b6101e560048036038101906101e091906112f9565b61051b565b005b3480156101f2575f5ffd5b5061020d600480360381019061020891906112f9565b610531565b60405161021a9190611351565b60405180910390f35b61022b610547565b005b348015610238575f5ffd5b50610253600480360381019061024e919061136a565b610598565b60405161026091906113a4565b60405180910390f35b348015610274575f5ffd5b5061028f600480360381019061028a91906113e2565b6105b1565b005b34801561029c575f5ffd5b506102b760048036038101906102b29190611420565b610961565b005b6102d360048036038101906102ce91906112f9565b610bb0565b005b3480156102e0575f5ffd5b506102fb60048036038101906102f691906112f9565b610bc6565b6040516103089190611351565b60405180910390f35b610319610bdd565b005b610323610c16565b005b348015610330575f5ffd5b50610339610c29565b60405161034691906113a4565b60405180910390f35b34801561035a575f5ffd5b50610375600480360381019061037091906111c6565b610c2e565b6040516103829190611200565b60405180910390f35b348015610396575f5ffd5b5061039f610da9565b6040516103ac9190611258565b60405180910390f35b3480156103c0575f5ffd5b506103db60048036038101906103d691906111c6565b610dd1565b6040516103e891906113a4565b60405180910390f35b3480156103fc575f5ffd5b5061041760048036038101906104129190611488565b610de6565b005b348015610424575f5ffd5b5061043f600480360381019061043a91906111c6565b610e44565b60405161044c9190611564565b60405180910390f35b61046f600480360381019061046a919061136a565b610f25565b005b61048b6004803603810190610486919061136a565b610f63565b005b348015610498575f5ffd5b506104b360048036038101906104ae919061136a565b610f8c565b6040516104c091906113a4565b60405180910390f35b6002602052805f5260405f205f915090505481565b6003602052805f5260405f205f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6105183382610fa5565b50565b610523610fb4565b61052d8282610feb565b5050565b5f818261053d85610598565b1614905092915050565b5f610550610ffb565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f5fa250565b5f638b78c6d8600c52815f526020600c20549050919050565b5f5f9054906101000a900460ff16156105f6576040517f379a7ed900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f33905060035f8481526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461068f576040517f11d0328c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8260025f846040516020016106a49190611597565b6040516020818303038152906040528051906020012081526020019081526020015f2054146106ff576040517f41c1ac5700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7318c3a7837feee1d838dba085611d3a0903ceed726319c14718835f6004811061072c5761072b6115b1565b5b60200201356040518263ffffffff1660e01b815260040161074d91906115ed565b602060405180830381865af4158015610768573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061078c919061161a565b6107c2576040517f854817c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f600190505b60048110156108c6577318c3a7837feee1d838dba085611d3a0903ceed726365b559b0846001846107f99190611672565b6004811061080a576108096115b1565b5b6020020135858460048110610822576108216115b1565b5b60200201356040518363ffffffff1660e01b81526004016108449291906116a5565b602060405180830381865af415801561085f573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610883919061161a565b6108b9576040517f854817c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80806001019150506107c8565b50816003600481106108db576108da6115b1565b5b602002013560015f8581526020019081526020015f2081905550828173ffffffffffffffffffffffffffffffffffffffff167f0d0a2245f107bccacfa55be58c1202917e494b61aae007897d04dc991442408d84600360048110610942576109416115b1565b5b602002013560405161095491906113a4565b60405180910390a3505050565b5f5f9054906101000a900460ff16156109a6576040517f379a7ed900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f33905060035f8481526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610a3f576040517f11d0328c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60015f8581526020019081526020015f205490505f8111610a8d576040517f3a5f7b5700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7318c3a7837feee1d838dba085611d3a0903ceed726365b559b082856040518363ffffffff1660e01b8152600401610ac69291906116a5565b602060405180830381865af4158015610ae1573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610b05919061161a565b610b3b576040517f854817c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8260015f8681526020019081526020015f2081905550838273ffffffffffffffffffffffffffffffffffffffff167f14fe4197a69dbcc73d79fcfd259bd1f097640dd2c2fe016ff232c416e17ce842610b9386611005565b86604051610ba2929190611705565b60405180910390a350505050565b610bb8610fb4565b610bc28282610fa5565b5050565b5f5f82610bd285610598565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f5fa2565b610c1e610fb4565b610c275f611015565b565b600181565b5f5f5f9054906101000a900460ff1615610c74576040517f379a7ed900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f3390503343604051602001610c8b929190611791565b6040516020818303038152906040528051906020012091505f5f1b60025f8581526020019081526020015f205414610cef576040517fb47f114500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060035f8481526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508160025f8581526020019081526020015f2081905550818173ffffffffffffffffffffffffffffffffffffffff167f69e448b11dc6d1d2b599edbb4ea0476b0c8c2e107efe06064092199bedaf94aa85604051610d9b9190611200565b60405180910390a350919050565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b6001602052805f5260405f205f915090505481565b6001610df1816110db565b815f5f6101000a81548160ff0219169083151502179055507f0e2fb031ee032dc02d8011dc50b816eb450cf856abd8261680dac74f72165bd282604051610e389190611351565b60405180910390a15050565b610e4c61116c565b5f60015f8481526020019081526020015f205490505f5f90505b60108160ff161015610f1e577318c3a7837feee1d838dba085611d3a0903ceed726335e37c7283836040518363ffffffff1660e01b8152600401610eab9291906117cb565b602060405180830381865af4158015610ec6573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610eea919061181c565b838260ff1660108110610f0057610eff6115b1565b5b602002019060ff16908160ff16815250508080600101915050610e66565b5050919050565b610f2d610fb4565b63389a75e1600c52805f526020600c208054421115610f5357636f5e88185f526004601cfd5b5f815550610f6081611015565b50565b610f6b610fb4565b8060601b610f8057637448fbae5f526004601cfd5b610f8981611015565b50565b5f63389a75e1600c52815f526020600c20549050919050565b610fb082825f611110565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927543314610fe9576382b429005f526004601cfd5b565b610ff782826001611110565b5050565b5f6202a300905090565b5f60ff60f883901c169050919050565b61101d611168565b15611082577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3811560ff1b82178155506110d8565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3818155505b50565b638b78c6d81954331461110d57638b78c6d8600c52335f52806020600c20541661110c576382b429005f526004601cfd5b5b50565b638b78c6d8600c52825f526020600c2080548381178361113257848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f5fa3505050505050565b5f90565b604051806102000160405280601090602082028036833780820191505090505090565b5f5ffd5b5f819050919050565b6111a581611193565b81146111af575f5ffd5b50565b5f813590506111c08161119c565b92915050565b5f602082840312156111db576111da61118f565b5b5f6111e8848285016111b2565b91505092915050565b6111fa81611193565b82525050565b5f6020820190506112135f8301846111f1565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61124282611219565b9050919050565b61125281611238565b82525050565b5f60208201905061126b5f830184611249565b92915050565b5f819050919050565b61128381611271565b811461128d575f5ffd5b50565b5f8135905061129e8161127a565b92915050565b5f602082840312156112b9576112b861118f565b5b5f6112c684828501611290565b91505092915050565b6112d881611238565b81146112e2575f5ffd5b50565b5f813590506112f3816112cf565b92915050565b5f5f6040838503121561130f5761130e61118f565b5b5f61131c858286016112e5565b925050602061132d85828601611290565b9150509250929050565b5f8115159050919050565b61134b81611337565b82525050565b5f6020820190506113645f830184611342565b92915050565b5f6020828403121561137f5761137e61118f565b5b5f61138c848285016112e5565b91505092915050565b61139e81611271565b82525050565b5f6020820190506113b75f830184611395565b92915050565b5f5ffd5b5f819050826020600402820111156113dc576113db6113bd565b5b92915050565b5f5f60a083850312156113f8576113f761118f565b5b5f611405858286016111b2565b9250506020611416858286016113c1565b9150509250929050565b5f5f604083850312156114365761143561118f565b5b5f611443858286016111b2565b925050602061145485828601611290565b9150509250929050565b61146781611337565b8114611471575f5ffd5b50565b5f813590506114828161145e565b92915050565b5f6020828403121561149d5761149c61118f565b5b5f6114aa84828501611474565b91505092915050565b5f60109050919050565b5f81905092915050565b5f819050919050565b5f60ff82169050919050565b6114e5816114d0565b82525050565b5f6114f683836114dc565b60208301905092915050565b5f602082019050919050565b611517816114b3565b61152181846114bd565b925061152c826114c7565b805f5b8381101561155c57815161154387826114eb565b965061154e83611502565b92505060018101905061152f565b505050505050565b5f610200820190506115785f83018461150e565b92915050565b82818337505050565b6115936080838361157e565b5050565b5f6115a28284611587565b60808201915081905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b6115e781611271565b82525050565b5f6020820190506116005f8301846115de565b92915050565b5f815190506116148161145e565b92915050565b5f6020828403121561162f5761162e61118f565b5b5f61163c84828501611606565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61167c82611271565b915061168783611271565b925082820390508181111561169f5761169e611645565b5b92915050565b5f6040820190506116b85f8301856115de565b6116c560208301846115de565b9392505050565b5f819050919050565b5f6116ef6116ea6116e5846114d0565b6116cc565b611271565b9050919050565b6116ff816116d5565b82525050565b5f6040820190506117185f8301856116f6565b6117256020830184611395565b9392505050565b5f8160601b9050919050565b5f6117428261172c565b9050919050565b5f61175382611738565b9050919050565b61176b61176682611238565b611749565b82525050565b5f819050919050565b61178b61178682611271565b611771565b82525050565b5f61179c828561175a565b6014820191506117ac828461177a565b6020820191508190509392505050565b6117c5816114d0565b82525050565b5f6040820190506117de5f8301856115de565b6117eb60208301846117bc565b9392505050565b6117fb816114d0565b8114611805575f5ffd5b50565b5f81519050611816816117f2565b92915050565b5f602082840312156118315761183061118f565b5b5f61183e84828501611808565b9150509291505056fea26469706673582212202b3aaa2fcf77263d57c4e6e446a4302e38aa82a0a5da9122386cd517b03091cd64736f6c634300081c0033000000000000000000000000234828a40de63d21072d1218cfb5d208654c12bb", + "nonce": "0x7", + "chainId": "0x279f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x4bbe5be", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0xd1a1d02447759a99e02254f0c998e24d6ce04ce95bdb88228568c3b037e06518", + "transactionIndex": "0x24b", + "blockHash": "0x3bddb8bf202857554090367bf0273eb8619f320120f98df8865c7538c28a4ff5", + "blockNumber": "0x9e3d23", + "gasUsed": "0x253d1a", + "effectiveGasPrice": "0xba43b7401", + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "contractAddress": null + }, + { + "status": "0x1", + "cumulativeGasUsed": "0x4d85e51", + "logs": [ + { + "address": "0x977fb1f92dfbf475df926db7fee64cc705a762bd", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000234828a40de63d21072d1218cfb5d208654c12bb" + ], + "data": "0x", + "blockHash": "0x3bddb8bf202857554090367bf0273eb8619f320120f98df8865c7538c28a4ff5", + "blockNumber": "0x9e3d23", + "blockTimestamp": "0x67eba583", + "transactionHash": "0xcafedab3827c2aeb04a3316ccf04a30d0d465c17597579ddba79f0c69cacb44c", + "transactionIndex": "0x24c", + "logIndex": "0x305", + "removed": false + } + ], + "logsBloom": "0x00000000000000000000000000000020000000000000000000800000000001000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000020000040000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020800000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0xcafedab3827c2aeb04a3316ccf04a30d0d465c17597579ddba79f0c69cacb44c", + "transactionIndex": "0x24c", + "blockHash": "0x3bddb8bf202857554090367bf0273eb8619f320120f98df8865c7538c28a4ff5", + "blockNumber": "0x9e3d23", + "gasUsed": "0x1c7893", + "effectiveGasPrice": "0xba43b7401", + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": null, + "contractAddress": "0x977fb1f92dfbf475df926db7fee64cc705a762bd" + } + ], + "libraries": [ + "src/LibBoard.sol:Board:0x18c3a7837FEeE1d838DbA085611D3A0903CEEd72" + ], + "pending": [], + "returns": { + "gameContract": { + "internal_type": "address", + "value": "0x977FB1F92DFBf475dF926DB7Fee64cc705A762bD" + } + }, + "timestamp": 1743496583, + "chain": 10143, + "commit": "0d3d2c2" +} \ No newline at end of file diff --git a/packages/contracts/broadcast/Deploy.s.sol/10143/run-1743498025.json b/packages/contracts/broadcast/Deploy.s.sol/10143/run-1743498025.json new file mode 100644 index 0000000..dc893f8 --- /dev/null +++ b/packages/contracts/broadcast/Deploy.s.sol/10143/run-1743498025.json @@ -0,0 +1,72 @@ +{ + "transactions": [ + { + "hash": "0xe8f70907839f066358d5fe8d30e1ddc2fe954c8e89241aa3c9a2bdd2fabb067f", + "transactionType": "CREATE", + "contractName": "Play2048", + "contractAddress": "0xd9d6c523bf597e82d5247ab7ca1104215b73e5bc", + "function": null, + "arguments": [ + "0x234828a40de63d21072D1218cFb5D208654C12Bb" + ], + "transaction": { + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "gas": "0x1c793f", + "value": "0x0", + "input": "0x608060405234801561000f575f5ffd5b50604051611a2b380380611a2b83398181016040528101906100319190610174565b6100408161004660201b60201c565b5061019f565b61005461011260201b60201c565b156100b9577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3811560ff1b821781555061010f565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3818155505b50565b5f90565b5f5ffd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6101438261011a565b9050919050565b61015381610139565b811461015d575f5ffd5b50565b5f8151905061016e8161014a565b92915050565b5f6020828403121561018957610188610116565b5b5f61019684828501610160565b91505092915050565b61187f806101ac5f395ff3fe608060405260043610610133575f3560e01c806354d1f13d116100aa578063bedb86fb1161006e578063bedb86fb146103b5578063e51b891f146103dd578063f04e283e14610419578063f2fde38b14610435578063f3618a2214610451578063fee81cf41461047957610133565b806354d1f13d14610311578063715018a61461031b57806375b238fc146103255780638da5cb5b1461034f578063ac88036c1461037957610133565b806325692962116100fc57806325692962146102235780632de948071461022d57806339b9e19f146102695780633e98ab54146102915780634a4ee7b1146102b9578063514e62fc146102d557610133565b80622a0c3d146101375780630ea30f4814610173578063183a4f6e146101af5780631c10893f146101cb5780631cd64df4146101e7575b5f5ffd5b348015610142575f5ffd5b5061015d6004803603810190610158919061121a565b6104b5565b60405161016a9190611254565b60405180910390f35b34801561017e575f5ffd5b506101996004803603810190610194919061121a565b6104ca565b6040516101a691906112ac565b60405180910390f35b6101c960048036038101906101c491906112f8565b6104fa565b005b6101e560048036038101906101e0919061134d565b610507565b005b3480156101f2575f5ffd5b5061020d6004803603810190610208919061134d565b61051d565b60405161021a91906113a5565b60405180910390f35b61022b610533565b005b348015610238575f5ffd5b50610253600480360381019061024e91906113be565b610584565b60405161026091906113f8565b60405180910390f35b348015610274575f5ffd5b5061028f600480360381019061028a9190611436565b61059d565b005b34801561029c575f5ffd5b506102b760048036038101906102b29190611474565b61094d565b005b6102d360048036038101906102ce919061134d565b610b9c565b005b3480156102e0575f5ffd5b506102fb60048036038101906102f6919061134d565b610bb2565b60405161030891906113a5565b60405180910390f35b610319610bc9565b005b610323610c02565b005b348015610330575f5ffd5b50610339610c15565b60405161034691906113f8565b60405180910390f35b34801561035a575f5ffd5b50610363610c1a565b60405161037091906112ac565b60405180910390f35b348015610384575f5ffd5b5061039f600480360381019061039a919061121a565b610c42565b6040516103ac91906113f8565b60405180910390f35b3480156103c0575f5ffd5b506103db60048036038101906103d691906114dc565b610c57565b005b3480156103e8575f5ffd5b5061040360048036038101906103fe919061121a565b610cb5565b60405161041091906115b8565b60405180910390f35b610433600480360381019061042e91906113be565b610d96565b005b61044f600480360381019061044a91906113be565b610dd4565b005b34801561045c575f5ffd5b50610477600480360381019061047291906115d2565b610dfd565b005b348015610484575f5ffd5b5061049f600480360381019061049a91906113be565b610fe0565b6040516104ac91906113f8565b60405180910390f35b6002602052805f5260405f205f915090505481565b6003602052805f5260405f205f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6105043382610ff9565b50565b61050f611008565b610519828261103f565b5050565b5f818261052985610584565b1614905092915050565b5f61053c61104f565b67ffffffffffffffff164201905063389a75e1600c52335f52806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d5f5fa250565b5f638b78c6d8600c52815f526020600c20549050919050565b5f5f9054906101000a900460ff16156105e2576040517f379a7ed900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f33905060035f8481526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461067b576040517f11d0328c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8260025f846040516020016106909190611629565b6040516020818303038152906040528051906020012081526020019081526020015f2054146106eb576040517f41c1ac5700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7318c3a7837feee1d838dba085611d3a0903ceed726319c14718835f6004811061071857610717611643565b5b60200201356040518263ffffffff1660e01b8152600401610739919061167f565b602060405180830381865af4158015610754573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061077891906116ac565b6107ae576040517f854817c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f600190505b60048110156108b2577318c3a7837feee1d838dba085611d3a0903ceed726365b559b0846001846107e59190611704565b600481106107f6576107f5611643565b5b602002013585846004811061080e5761080d611643565b5b60200201356040518363ffffffff1660e01b8152600401610830929190611737565b602060405180830381865af415801561084b573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061086f91906116ac565b6108a5576040517f854817c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80806001019150506107b4565b50816003600481106108c7576108c6611643565b5b602002013560015f8581526020019081526020015f2081905550828173ffffffffffffffffffffffffffffffffffffffff167f0d0a2245f107bccacfa55be58c1202917e494b61aae007897d04dc991442408d8460036004811061092e5761092d611643565b5b602002013560405161094091906113f8565b60405180910390a3505050565b5f5f9054906101000a900460ff1615610992576040517f379a7ed900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f33905060035f8481526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610a2b576040517f11d0328c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f60015f8581526020019081526020015f205490505f8111610a79576040517f3a5f7b5700000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7318c3a7837feee1d838dba085611d3a0903ceed726365b559b082856040518363ffffffff1660e01b8152600401610ab2929190611737565b602060405180830381865af4158015610acd573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610af191906116ac565b610b27576040517f854817c800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8260015f8681526020019081526020015f2081905550838273ffffffffffffffffffffffffffffffffffffffff167f14fe4197a69dbcc73d79fcfd259bd1f097640dd2c2fe016ff232c416e17ce842610b7f86611059565b86604051610b8e929190611797565b60405180910390a350505050565b610ba4611008565b610bae8282610ff9565b5050565b5f5f82610bbe85610584565b161415905092915050565b63389a75e1600c52335f525f6020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c925f5fa2565b610c0a611008565b610c135f611069565b565b600181565b5f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754905090565b6001602052805f5260405f205f915090505481565b6001610c628161112f565b815f5f6101000a81548160ff0219169083151502179055507f0e2fb031ee032dc02d8011dc50b816eb450cf856abd8261680dac74f72165bd282604051610ca991906113a5565b60405180910390a15050565b610cbd6111c0565b5f60015f8481526020019081526020015f205490505f5f90505b60108160ff161015610d8f577318c3a7837feee1d838dba085611d3a0903ceed726335e37c7283836040518363ffffffff1660e01b8152600401610d1c9291906117cd565b602060405180830381865af4158015610d37573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d5b919061181e565b838260ff1660108110610d7157610d70611643565b5b602002019060ff16908160ff16815250508080600101915050610cd7565b5050919050565b610d9e611008565b63389a75e1600c52805f526020600c208054421115610dc457636f5e88185f526004601cfd5b5f815550610dd181611069565b50565b610ddc611008565b8060601b610df157637448fbae5f526004601cfd5b610dfa81611069565b50565b5f5f9054906101000a900460ff1615610e42576040517f379a7ed900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f3390505f73ffffffffffffffffffffffffffffffffffffffff1660035f8581526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610edb576040517f11d0328c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f1b60025f8481526020019081526020015f205414610f27576040517fb47f114500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8060035f8581526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508260025f8481526020019081526020015f2081905550828173ffffffffffffffffffffffffffffffffffffffff167f69e448b11dc6d1d2b599edbb4ea0476b0c8c2e107efe06064092199bedaf94aa84604051610fd39190611254565b60405180910390a3505050565b5f63389a75e1600c52815f526020600c20549050919050565b61100482825f611164565b5050565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff7487392754331461103d576382b429005f526004601cfd5b565b61104b82826001611164565b5050565b5f6202a300905090565b5f60ff60f883901c169050919050565b6110716111bc565b156110d6577fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3811560ff1b821781555061112c565b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffff748739278160601b60601c91508181547f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e05f5fa3818155505b50565b638b78c6d81954331461116157638b78c6d8600c52335f52806020600c205416611160576382b429005f526004601cfd5b5b50565b638b78c6d8600c52825f526020600c2080548381178361118657848216821890505b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe265f5fa3505050505050565b5f90565b604051806102000160405280601090602082028036833780820191505090505090565b5f5ffd5b5f819050919050565b6111f9816111e7565b8114611203575f5ffd5b50565b5f81359050611214816111f0565b92915050565b5f6020828403121561122f5761122e6111e3565b5b5f61123c84828501611206565b91505092915050565b61124e816111e7565b82525050565b5f6020820190506112675f830184611245565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6112968261126d565b9050919050565b6112a68161128c565b82525050565b5f6020820190506112bf5f83018461129d565b92915050565b5f819050919050565b6112d7816112c5565b81146112e1575f5ffd5b50565b5f813590506112f2816112ce565b92915050565b5f6020828403121561130d5761130c6111e3565b5b5f61131a848285016112e4565b91505092915050565b61132c8161128c565b8114611336575f5ffd5b50565b5f8135905061134781611323565b92915050565b5f5f60408385031215611363576113626111e3565b5b5f61137085828601611339565b9250506020611381858286016112e4565b9150509250929050565b5f8115159050919050565b61139f8161138b565b82525050565b5f6020820190506113b85f830184611396565b92915050565b5f602082840312156113d3576113d26111e3565b5b5f6113e084828501611339565b91505092915050565b6113f2816112c5565b82525050565b5f60208201905061140b5f8301846113e9565b92915050565b5f5ffd5b5f819050826020600402820111156114305761142f611411565b5b92915050565b5f5f60a0838503121561144c5761144b6111e3565b5b5f61145985828601611206565b925050602061146a85828601611415565b9150509250929050565b5f5f6040838503121561148a576114896111e3565b5b5f61149785828601611206565b92505060206114a8858286016112e4565b9150509250929050565b6114bb8161138b565b81146114c5575f5ffd5b50565b5f813590506114d6816114b2565b92915050565b5f602082840312156114f1576114f06111e3565b5b5f6114fe848285016114c8565b91505092915050565b5f60109050919050565b5f81905092915050565b5f819050919050565b5f60ff82169050919050565b61153981611524565b82525050565b5f61154a8383611530565b60208301905092915050565b5f602082019050919050565b61156b81611507565b6115758184611511565b92506115808261151b565b805f5b838110156115b0578151611597878261153f565b96506115a283611556565b925050600181019050611583565b505050505050565b5f610200820190506115cc5f830184611562565b92915050565b5f5f604083850312156115e8576115e76111e3565b5b5f6115f585828601611206565b925050602061160685828601611206565b9150509250929050565b82818337505050565b61162560808383611610565b5050565b5f6116348284611619565b60808201915081905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b611679816112c5565b82525050565b5f6020820190506116925f830184611670565b92915050565b5f815190506116a6816114b2565b92915050565b5f602082840312156116c1576116c06111e3565b5b5f6116ce84828501611698565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61170e826112c5565b9150611719836112c5565b9250828203905081811115611731576117306116d7565b5b92915050565b5f60408201905061174a5f830185611670565b6117576020830184611670565b9392505050565b5f819050919050565b5f61178161177c61177784611524565b61175e565b6112c5565b9050919050565b61179181611767565b82525050565b5f6040820190506117aa5f830185611788565b6117b760208301846113e9565b9392505050565b6117c781611524565b82525050565b5f6040820190506117e05f830185611670565b6117ed60208301846117be565b9392505050565b6117fd81611524565b8114611807575f5ffd5b50565b5f81519050611818816117f4565b92915050565b5f60208284031215611833576118326111e3565b5b5f6118408482850161180a565b9150509291505056fea2646970667358221220ea05155d57f8f0a1a4563a313ce6e5384a237a920df6698c967017492f9b0b9b64736f6c634300081c0033000000000000000000000000234828a40de63d21072d1218cfb5d208654c12bb", + "nonce": "0x8", + "chainId": "0x279f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0xd4ae68", + "logs": [ + { + "address": "0xd9d6c523bf597e82d5247ab7ca1104215b73e5bc", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000234828a40de63d21072d1218cfb5d208654c12bb" + ], + "data": "0x", + "blockHash": "0x02bfe853820f6d0e05b6507ea93ea2f070caddaf3dba217b6c88a5c7d83aa51c", + "blockNumber": "0x9e465f", + "blockTimestamp": "0x67ebab27", + "transactionHash": "0xe8f70907839f066358d5fe8d30e1ddc2fe954c8e89241aa3c9a2bdd2fabb067f", + "transactionIndex": "0x69", + "logIndex": "0xd8", + "removed": false + } + ], + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000001000000000000000000000000000020000000000000000000810000000000000000000020000040000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020800000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0xe8f70907839f066358d5fe8d30e1ddc2fe954c8e89241aa3c9a2bdd2fabb067f", + "transactionIndex": "0x69", + "blockHash": "0x02bfe853820f6d0e05b6507ea93ea2f070caddaf3dba217b6c88a5c7d83aa51c", + "blockNumber": "0x9e465f", + "gasUsed": "0x1c793f", + "effectiveGasPrice": "0xba43b7401", + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": null, + "contractAddress": "0xd9d6c523bf597e82d5247ab7ca1104215b73e5bc" + } + ], + "libraries": [ + "src/LibBoard.sol:Board:0x18c3a7837FEeE1d838DbA085611D3A0903CEEd72" + ], + "pending": [], + "returns": { + "gameContract": { + "internal_type": "address", + "value": "0xD9d6C523BF597e82D5247aB7CA1104215B73e5Bc" + } + }, + "timestamp": 1743498025, + "chain": 10143, + "commit": "11be9e2" +} \ No newline at end of file diff --git a/packages/contracts/broadcast/Deploy.s.sol/10143/run-1745469906.json b/packages/contracts/broadcast/Deploy.s.sol/10143/run-1745469906.json new file mode 100644 index 0000000..dd8df22 --- /dev/null +++ b/packages/contracts/broadcast/Deploy.s.sol/10143/run-1745469906.json @@ -0,0 +1,87 @@ +{ + "transactions": [ + { + "hash": "0x05b57c8bb053fc9268ab43934143ee7a6050b9bd0a1e91513bdfaeffc68a2574", + "transactionType": "CREATE2", + "contractName": "Board", + "contractAddress": "0x3a98ff59f451f16dc5201ad287073202d82aba6e", + "function": null, + "arguments": null, + "transaction": { + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "gas": "0x253d0a", + "input": "0x0000000000000000000000000000000000000000000000000000000000000000611ef761004d600b8282823980515f1a6073146041577f4e487b71000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b305f52607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100f3575f3560e01c806337afd9641161009557806365b559b01161006f57806365b559b01461028f5780637e8dbaf6146102bf578063f173e012146102ef578063f54a36eb1461031f576100f3565b806337afd964146102115780633b9f7a1f1461024157806364cd159514610271576100f3565b806324f4ec51116100d157806324f4ec51146101635780632c5f3c4514610181578063312ffe40146101b157806335e37c72146101e1576100f3565b806301df1995146100f757806319c14718146101155780631af4f97014610145575b5f5ffd5b6100ff61034f565b60405161010c9190611959565b60405180910390f35b61012f600480360381019061012a91906119a0565b610354565b60405161013c91906119e5565b60405180910390f35b61014d61045b565b60405161015a9190611959565b60405180910390f35b61016b610460565b6040516101789190611959565b60405180910390f35b61019b600480360381019061019691906119a0565b610464565b6040516101a89190611959565b60405180910390f35b6101cb60048036038101906101c691906119a0565b610794565b6040516101d89190611959565b60405180910390f35b6101fb60048036038101906101f69190611a34565b610ac4565b6040516102089190611a81565b60405180910390f35b61022b60048036038101906102269190611acd565b610aef565b6040516102389190611959565b60405180910390f35b61025b600480360381019061025691906119a0565b610d66565b6040516102689190611959565b60405180910390f35b610279611182565b6040516102869190611959565b60405180910390f35b6102a960048036038101906102a49190611b1d565b611187565b6040516102b691906119e5565b60405180910390f35b6102d960048036038101906102d49190611b5b565b611399565b6040516102e69190611959565b60405180910390f35b61030960048036038101906103049190611b86565b6114a3565b6040516103169190611959565b60405180910390f35b610339600480360381019061033491906119a0565b6114f3565b6040516103469190611959565b60405180910390f35b600181565b5f5f608083901c14610392576040517ff561181200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f5f90505b60108160ff161015610416575f6103af8583610ac4565b905060038160ff16106103ee576040517f7646c39a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8160ff16111561040857828061040490611c03565b9350505b508080600101915050610398565b5060028114610451576040517f7646c39a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001915050919050565b600381565b5f81565b5f5f5f90505b60048160ff16101561078b5761047e61191f565b5f5f90505b60048160ff1610156104e4576104b085826004866104a19190611c4a565b6104ab9190611c86565b610ac4565b828260ff16600481106104c6576104c5611cba565b5b602002019060ff16908160ff16815250508080600101915050610483565b506104ed61191f565b5f5f90505f5f90505b60048160ff161015610582575f848260ff166004811061051957610518611cba565b5b602002015160ff161461057557838160ff166004811061053c5761053b611cba565b5b602002015183838061054d90611ce7565b945060ff166004811061056357610562611cba565b5b602002019060ff16908160ff16815250505b80806001019150506104f6565b505f5f90505b60038160ff16101561067f575f838260ff16600481106105ab576105aa611cba565b5b602002015160ff16141580156106065750826001826105ca9190611c86565b60ff16600481106105de576105dd611cba565b5b602002015160ff16838260ff16600481106105fc576105fb611cba565b5b602002015160ff16145b1561067257828160ff166004811061062157610620611cba565b5b60200201805180919061063390611ce7565b60ff1660ff16815250505f8360018361064c9190611c86565b60ff16600481106106605761065f611cba565b5b602002019060ff16908160ff16815250505b8080600101915050610588565b5061068861191f565b5f91505f5f90505b60048160ff16101561071c575f848260ff16600481106106b3576106b2611cba565b5b602002015160ff161461070f57838160ff16600481106106d6576106d5611cba565b5b60200201518284806106e790611ce7565b955060ff16600481106106fd576106fc611cba565b5b602002019060ff16908160ff16815250505b8080600101915050610690565b505f5f90505b60048160ff1610156107795761076a88826004896107409190611c4a565b61074a9190611c86565b848460ff16600481106107605761075f611cba565b5b60200201516114a3565b97508080600101915050610722565b5050505050808060010191505061046a565b50819050919050565b5f5f5f90505b60048160ff161015610abb576107ae61191f565b5f5f90505b60048160ff161015610814576107e085846004846107d19190611c4a565b6107db9190611c86565b610ac4565b828260ff16600481106107f6576107f5611cba565b5b602002019060ff16908160ff168152505080806001019150506107b3565b5061081d61191f565b5f5f90505f5f90505b60048160ff1610156108b2575f848260ff166004811061084957610848611cba565b5b602002015160ff16146108a557838160ff166004811061086c5761086b611cba565b5b602002015183838061087d90611ce7565b945060ff166004811061089357610892611cba565b5b602002019060ff16908160ff16815250505b8080600101915050610826565b505f5f90505b60038160ff1610156109af575f838260ff16600481106108db576108da611cba565b5b602002015160ff16141580156109365750826001826108fa9190611c86565b60ff166004811061090e5761090d611cba565b5b602002015160ff16838260ff166004811061092c5761092b611cba565b5b602002015160ff16145b156109a257828160ff166004811061095157610950611cba565b5b60200201805180919061096390611ce7565b60ff1660ff16815250505f8360018361097c9190611c86565b60ff16600481106109905761098f611cba565b5b602002019060ff16908160ff16815250505b80806001019150506108b8565b506109b861191f565b5f91505f5f90505b60048160ff161015610a4c575f848260ff16600481106109e3576109e2611cba565b5b602002015160ff1614610a3f57838160ff1660048110610a0657610a05611cba565b5b6020020151828480610a1790611ce7565b955060ff1660048110610a2d57610a2c611cba565b5b602002019060ff16908160ff16815250505b80806001019150506109c0565b505f5f90505b60048160ff161015610aa957610a9a8887600484610a709190611c4a565b610a7a9190611c86565b848460ff1660048110610a9057610a8f611cba565b5b60200201516114a3565b97508080600101915050610a52565b5050505050808060010191505061079a565b50819050919050565b5f60ff600883600f610ad69190611d0f565b610ae09190611c4a565b60ff1684901c16905092915050565b5f60048310610b2a576040517f35405e3c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8303610b4157610b3a84610794565b9050610b88565b60018303610b5957610b52846114f3565b9050610b87565b60038303610b7157610b6a84610d66565b9050610b86565b60028303610b8557610b8284610464565b90505b5b5b5b608081901b608085901b03610bc9576040517f35405e3c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f90505f5f90505b60108160ff161015610c0d575f610be98483610ac4565b60ff1603610c00578180610bfc90611c03565b9250505b8080600101915050610bd2565b505f811115610d54575f85858486604051602001610c2e9493929190611d83565b604051602081830303815290604052805190602001205f1c90505f8267ffffffffffffffff811115610c6357610c62611dd0565b5b604051908082528060200260200182016040528015610c915781602001602082028036833780820191505090505b5090505f5f90505f5f90505b60108160ff161015610d00575f610cb48783610ac4565b60ff1603610cf35780838381518110610cd057610ccf611cba565b5b602002602001019060ff16908160ff16815250508180610cef90611c03565b9250505b8080600101915050610c9d565b50610d4e85838686610d129190611e2a565b81518110610d2357610d22611cba565b5b6020026020010151605a606487610d3a9190611e2a565b11610d46576001610d49565b60025b6114a3565b94505050505b60808083901b901c9150509392505050565b5f5f5f90505b60048160ff16101561117957610d8061191f565b5f5f90505b60048160ff161015610de657610db28582600486610da39190611c4a565b610dad9190611c86565b610ac4565b828260ff1660048110610dc857610dc7611cba565b5b602002019060ff16908160ff16815250508080600101915050610d85565b50610def61191f565b5f5f90505b60048160ff161015610e5b5782816003610e0e9190611d0f565b60ff1660048110610e2257610e21611cba565b5b6020020151828260ff1660048110610e3d57610e3c611cba565b5b602002019060ff16908160ff16815250508080600101915050610df4565b50610e6461191f565b5f5f90505f5f90505b60048160ff161015610ef9575f848260ff1660048110610e9057610e8f611cba565b5b602002015160ff1614610eec57838160ff1660048110610eb357610eb2611cba565b5b6020020151838380610ec490611ce7565b945060ff1660048110610eda57610ed9611cba565b5b602002019060ff16908160ff16815250505b8080600101915050610e6d565b505f5f90505b60038160ff161015610ff6575f838260ff1660048110610f2257610f21611cba565b5b602002015160ff1614158015610f7d575082600182610f419190611c86565b60ff1660048110610f5557610f54611cba565b5b602002015160ff16838260ff1660048110610f7357610f72611cba565b5b602002015160ff16145b15610fe957828160ff1660048110610f9857610f97611cba565b5b602002018051809190610faa90611ce7565b60ff1660ff16815250505f83600183610fc39190611c86565b60ff1660048110610fd757610fd6611cba565b5b602002019060ff16908160ff16815250505b8080600101915050610eff565b50610fff61191f565b5f91505f5f90505b60048160ff161015611093575f848260ff166004811061102a57611029611cba565b5b602002015160ff161461108657838160ff166004811061104d5761104c611cba565b5b602002015182848061105e90611ce7565b955060ff166004811061107457611073611cba565b5b602002019060ff16908160ff16815250505b8080600101915050611007565b5061109c61191f565b5f5f90505b60048160ff16101561110857828160036110bb9190611d0f565b60ff16600481106110cf576110ce611cba565b5b6020020151828260ff16600481106110ea576110e9611cba565b5b602002019060ff16908160ff168152505080806001019150506110a1565b505f5f90505b60048160ff161015611165576111568a8260048b61112c9190611c4a565b6111369190611c86565b848460ff166004811061114c5761114b611cba565b5b60200201516114a3565b9950808060010191505061110e565b505050505050508080600101915050610d6c565b50819050919050565b600281565b5f5f6088600885901b901c146111c9576040517ff561181200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6088600884901b901c1461120a576040517ff561181200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f6112158461190f565b90505f8160ff16036112315761122a85610794565b91506112b7565b60018160ff160361124c57611245856114f3565b91506112b6565b60038160ff16036112675761126085610d66565b91506112b5565b60028160ff16036112825761127b85610464565b91506112b4565b6040517f35405e3c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5b5b5b5f5f90505f5f90505f5f90505b60108160ff16101561130e576112da8782610ac4565b60ff166112e78683610ac4565b60ff16146113015781806112fa90611ce7565b9250508092505b80806001019150506112c4565b505f61131a8784610ac4565b60ff1690505f61132a8685610ac4565b60ff1614801561133957505f81115b80156113455750600381105b8015611354575060018260ff16145b61138a576040517f62417ce600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60019550505050505092915050565b5f5f826040516020016113ac9190611e5a565b604051602081830303815290604052805190602001205f1c90505f6010826113d49190611e2a565b9050816040516020016113e79190611e74565b604051602081830303815290604052805190602001205f1c91505f60108361140f9190611e2a565b90505b8181036114395760106001826114289190611e8e565b6114329190611e2a565b9050611412565b5f5f90505b60108160ff16101561149a57828160ff16148061145d5750818160ff16145b1561148d5761148a8582605a6064886114769190611e2a565b11611482576001611485565b60025b6114a3565b94505b808060010191505061143e565b50505050919050565b5f600883600f6114b39190611d0f565b6114bd9190611c4a565b60ff168260ff16901b600884600f6114d59190611d0f565b6114df9190611c4a565b60ff1660ff901b1985161790509392505050565b5f5f5f90505b60048160ff1610156119065761150d61191f565b5f5f90505b60048160ff1610156115735761153f85846004846115309190611c4a565b61153a9190611c86565b610ac4565b828260ff166004811061155557611554611cba565b5b602002019060ff16908160ff16815250508080600101915050611512565b5061157c61191f565b5f5f90505b60048160ff1610156115e8578281600361159b9190611d0f565b60ff16600481106115af576115ae611cba565b5b6020020151828260ff16600481106115ca576115c9611cba565b5b602002019060ff16908160ff16815250508080600101915050611581565b506115f161191f565b5f5f90505f5f90505b60048160ff161015611686575f848260ff166004811061161d5761161c611cba565b5b602002015160ff161461167957838160ff16600481106116405761163f611cba565b5b602002015183838061165190611ce7565b945060ff166004811061166757611666611cba565b5b602002019060ff16908160ff16815250505b80806001019150506115fa565b505f5f90505b60038160ff161015611783575f838260ff16600481106116af576116ae611cba565b5b602002015160ff161415801561170a5750826001826116ce9190611c86565b60ff16600481106116e2576116e1611cba565b5b602002015160ff16838260ff1660048110611700576116ff611cba565b5b602002015160ff16145b1561177657828160ff166004811061172557611724611cba565b5b60200201805180919061173790611ce7565b60ff1660ff16815250505f836001836117509190611c86565b60ff166004811061176457611763611cba565b5b602002019060ff16908160ff16815250505b808060010191505061168c565b5061178c61191f565b5f91505f5f90505b60048160ff161015611820575f848260ff16600481106117b7576117b6611cba565b5b602002015160ff161461181357838160ff16600481106117da576117d9611cba565b5b60200201518284806117eb90611ce7565b955060ff166004811061180157611800611cba565b5b602002019060ff16908160ff16815250505b8080600101915050611794565b5061182961191f565b5f5f90505b60048160ff16101561189557828160036118489190611d0f565b60ff166004811061185c5761185b611cba565b5b6020020151828260ff166004811061187757611876611cba565b5b602002019060ff16908160ff1681525050808060010191505061182e565b505f5f90505b60048160ff1610156118f2576118e38a896004846118b99190611c4a565b6118c39190611c86565b848460ff16600481106118d9576118d8611cba565b5b60200201516114a3565b9950808060010191505061189b565b5050505050505080806001019150506114f9565b50819050919050565b5f60ff60f883901c169050919050565b6040518060800160405280600490602082028036833780820191505090505090565b5f819050919050565b61195381611941565b82525050565b5f60208201905061196c5f83018461194a565b92915050565b5f5ffd5b61197f81611941565b8114611989575f5ffd5b50565b5f8135905061199a81611976565b92915050565b5f602082840312156119b5576119b4611972565b5b5f6119c28482850161198c565b91505092915050565b5f8115159050919050565b6119df816119cb565b82525050565b5f6020820190506119f85f8301846119d6565b92915050565b5f60ff82169050919050565b611a13816119fe565b8114611a1d575f5ffd5b50565b5f81359050611a2e81611a0a565b92915050565b5f5f60408385031215611a4a57611a49611972565b5b5f611a578582860161198c565b9250506020611a6885828601611a20565b9150509250929050565b611a7b816119fe565b82525050565b5f602082019050611a945f830184611a72565b92915050565b5f819050919050565b611aac81611a9a565b8114611ab6575f5ffd5b50565b5f81359050611ac781611aa3565b92915050565b5f5f5f60608486031215611ae457611ae3611972565b5b5f611af18682870161198c565b9350506020611b028682870161198c565b9250506040611b1386828701611ab9565b9150509250925092565b5f5f60408385031215611b3357611b32611972565b5b5f611b408582860161198c565b9250506020611b518582860161198c565b9150509250929050565b5f60208284031215611b7057611b6f611972565b5b5f611b7d84828501611ab9565b91505092915050565b5f5f5f60608486031215611b9d57611b9c611972565b5b5f611baa8682870161198c565b9350506020611bbb86828701611a20565b9250506040611bcc86828701611a20565b9150509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611c0d82611941565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611c3f57611c3e611bd6565b5b600182019050919050565b5f611c54826119fe565b9150611c5f836119fe565b9250828202611c6d816119fe565b9150808214611c7f57611c7e611bd6565b5b5092915050565b5f611c90826119fe565b9150611c9b836119fe565b9250828201905060ff811115611cb457611cb3611bd6565b5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f611cf1826119fe565b915060ff8203611d0457611d03611bd6565b5b600182019050919050565b5f611d19826119fe565b9150611d24836119fe565b9250828203905060ff811115611d3d57611d3c611bd6565b5b92915050565b5f819050919050565b611d5d611d5882611941565b611d43565b82525050565b5f819050919050565b611d7d611d7882611a9a565b611d63565b82525050565b5f611d8e8287611d4c565b602082019150611d9e8286611d4c565b602082019150611dae8285611d4c565b602082019150611dbe8284611d6c565b60208201915081905095945050505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f611e3482611941565b9150611e3f83611941565b925082611e4f57611e4e611dfd565b5b828206905092915050565b5f611e658284611d6c565b60208201915081905092915050565b5f611e7f8284611d4c565b60208201915081905092915050565b5f611e9882611941565b9150611ea383611941565b9250828201905080821115611ebb57611eba611bd6565b5b9291505056fea264697066735822122081c4f02de77760543541f4da94bd17b5c1b08600a7b2b25c36652ccc9f957fdd64736f6c634300081c0033", + "nonce": "0x3d", + "chainId": "0x279f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xbda58aa32e7c0b48f95b2994726c126d67fd385b388263546b5abf5daa5b83cb", + "transactionType": "CREATE", + "contractName": "Monad2048", + "contractAddress": "0x8d9fd1cffe6e549803285c3ff990faec1d49ee7f", + "function": null, + "arguments": null, + "transaction": { + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "gas": "0xff8ed", + "value": "0x0", + "input": "0x6080604052348015600e575f5ffd5b50610da28061001c5f395ff3fe608060405234801561000f575f5ffd5b5060043610610060575f3560e01c806339b9e19f146100645780633e98ab541461008057806379cbd2331461009c578063ac88036c146100cc578063e51b891f146100fc578063ed8052691461012c575b5f5ffd5b61007e600480360381019061007991906108c5565b61015c565b005b61009a60048036038101906100959190610936565b610531565b005b6100b660048036038101906100b19190610974565b6106fc565b6040516100c391906109ae565b60405180910390f35b6100e660048036038101906100e19190610974565b610711565b6040516100f391906109d6565b60405180910390f35b61011660048036038101906101119190610974565b610726565b6040516101239190610aa0565b60405180910390f35b61014660048036038101906101419190610974565b610807565b6040516101539190610af9565b60405180910390f35b5f3390505f73ffffffffffffffffffffffffffffffffffffffff165f5f8581526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146101f4576040517f25434c8300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f826040516020016102069190610b2b565b6040516020818303038152906040528051906020012090505f5f1b60025f8381526020019081526020015f20541461026a576040517f6e3ca80500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b733a98ff59f451f16dc5201ad287073202d82aba6e6319c14718845f6004811061029757610296610b45565b5b60200201356040518263ffffffff1660e01b81526004016102b89190610b81565b602060405180830381865af41580156102d3573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102f79190610bcf565b61032d576040517f2b977ce300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f600190505b600481101561043157733a98ff59f451f16dc5201ad287073202d82aba6e6365b559b0856001846103649190610c27565b6004811061037557610374610b45565b5b602002013586846004811061038d5761038c610b45565b5b60200201356040518363ffffffff1660e01b81526004016103af929190610c5a565b602060405180830381865af41580156103ca573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103ee9190610bcf565b610424576040517f2b977ce300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8080600101915050610333565b50815f5f8681526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508360025f8381526020019081526020015f2081905550826003600481106104aa576104a9610b45565b5b602002013560015f8681526020019081526020015f2081905550838273ffffffffffffffffffffffffffffffffffffffff167f3d6c02e74ba05913874ba8d477497510df840bf93bfa5a2a8d8943766678a0e38560036004811061051157610510610b45565b5b602002013560405161052391906109d6565b60405180910390a350505050565b5f3390505f5f8481526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146105c9576040517faed8b1cf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b733a98ff59f451f16dc5201ad287073202d82aba6e6365b559b060015f8681526020019081526020015f2054846040518363ffffffff1660e01b8152600401610613929190610c5a565b602060405180830381865af415801561062e573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106529190610bcf565b610688576040517f2b977ce300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8160015f8581526020019081526020015f2081905550828173ffffffffffffffffffffffffffffffffffffffff167f14fe4197a69dbcc73d79fcfd259bd1f097640dd2c2fe016ff232c416e17ce8426106e085610836565b856040516106ef929190610cba565b60405180910390a3505050565b6002602052805f5260405f205f915090505481565b6001602052805f5260405f205f915090505481565b61072e610846565b5f60015f8481526020019081526020015f205490505f5f90505b60108160ff16101561080057733a98ff59f451f16dc5201ad287073202d82aba6e6335e37c7283836040518363ffffffff1660e01b815260040161078d929190610cf0565b602060405180830381865af41580156107a8573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906107cc9190610d41565b838260ff16601081106107e2576107e1610b45565b5b602002019060ff16908160ff16815250508080600101915050610748565b5050919050565b5f602052805f5260405f205f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f60ff60f883901c169050919050565b604051806102000160405280601090602082028036833780820191505090505090565b5f5ffd5b5f819050919050565b61087f8161086d565b8114610889575f5ffd5b50565b5f8135905061089a81610876565b92915050565b5f5ffd5b5f819050826020600402820111156108bf576108be6108a0565b5b92915050565b5f5f60a083850312156108db576108da610869565b5b5f6108e88582860161088c565b92505060206108f9858286016108a4565b9150509250929050565b5f819050919050565b61091581610903565b811461091f575f5ffd5b50565b5f813590506109308161090c565b92915050565b5f5f6040838503121561094c5761094b610869565b5b5f6109598582860161088c565b925050602061096a85828601610922565b9150509250929050565b5f6020828403121561098957610988610869565b5b5f6109968482850161088c565b91505092915050565b6109a88161086d565b82525050565b5f6020820190506109c15f83018461099f565b92915050565b6109d081610903565b82525050565b5f6020820190506109e95f8301846109c7565b92915050565b5f60109050919050565b5f81905092915050565b5f819050919050565b5f60ff82169050919050565b610a2181610a0c565b82525050565b5f610a328383610a18565b60208301905092915050565b5f602082019050919050565b610a53816109ef565b610a5d81846109f9565b9250610a6882610a03565b805f5b83811015610a98578151610a7f8782610a27565b9650610a8a83610a3e565b925050600181019050610a6b565b505050505050565b5f61020082019050610ab45f830184610a4a565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610ae382610aba565b9050919050565b610af381610ad9565b82525050565b5f602082019050610b0c5f830184610aea565b92915050565b82818337505050565b610b2760808383610b12565b5050565b5f610b368284610b1b565b60808201915081905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b610b7b81610903565b82525050565b5f602082019050610b945f830184610b72565b92915050565b5f8115159050919050565b610bae81610b9a565b8114610bb8575f5ffd5b50565b5f81519050610bc981610ba5565b92915050565b5f60208284031215610be457610be3610869565b5b5f610bf184828501610bbb565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f610c3182610903565b9150610c3c83610903565b9250828203905081811115610c5457610c53610bfa565b5b92915050565b5f604082019050610c6d5f830185610b72565b610c7a6020830184610b72565b9392505050565b5f819050919050565b5f610ca4610c9f610c9a84610a0c565b610c81565b610903565b9050919050565b610cb481610c8a565b82525050565b5f604082019050610ccd5f830185610cab565b610cda60208301846109c7565b9392505050565b610cea81610a0c565b82525050565b5f604082019050610d035f830185610b72565b610d106020830184610ce1565b9392505050565b610d2081610a0c565b8114610d2a575f5ffd5b50565b5f81519050610d3b81610d17565b92915050565b5f60208284031215610d5657610d55610869565b5b5f610d6384828501610d2d565b9150509291505056fea2646970667358221220ff08ee24743ce9fae6f450cf1e77bcc4b1ef9440b44868c00f27e1696ee4cc8464736f6c634300081c0033", + "nonce": "0x3e", + "chainId": "0x279f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0xabef24", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0x05b57c8bb053fc9268ab43934143ee7a6050b9bd0a1e91513bdfaeffc68a2574", + "transactionIndex": "0x45", + "blockHash": "0x8c9f210e1de95b1656512f2751c43bcb36e53f8da77e7e725e63aa3138896fbf", + "blockNumber": "0xd137a7", + "gasUsed": "0x253d0a", + "effectiveGasPrice": "0xba43b7401", + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "contractAddress": null + }, + { + "status": "0x1", + "cumulativeGasUsed": "0xbbe811", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0xbda58aa32e7c0b48f95b2994726c126d67fd385b388263546b5abf5daa5b83cb", + "transactionIndex": "0x46", + "blockHash": "0x8c9f210e1de95b1656512f2751c43bcb36e53f8da77e7e725e63aa3138896fbf", + "blockNumber": "0xd137a7", + "gasUsed": "0xff8ed", + "effectiveGasPrice": "0xba43b7401", + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": null, + "contractAddress": "0x8d9fd1cffe6e549803285c3ff990faec1d49ee7f" + } + ], + "libraries": [ + "src/LibBoard.sol:Board:0x3A98ff59F451f16DC5201Ad287073202d82abA6e" + ], + "pending": [], + "returns": { + "gameContract": { + "internal_type": "address", + "value": "0x8d9fD1cFFe6e549803285C3Ff990faec1D49eE7f" + } + }, + "timestamp": 1745469906, + "chain": 10143, + "commit": "58bbd3d" +} \ No newline at end of file diff --git a/packages/contracts/broadcast/Deploy.s.sol/10143/run-1745556899.json b/packages/contracts/broadcast/Deploy.s.sol/10143/run-1745556899.json new file mode 100644 index 0000000..7162d65 --- /dev/null +++ b/packages/contracts/broadcast/Deploy.s.sol/10143/run-1745556899.json @@ -0,0 +1,87 @@ +{ + "transactions": [ + { + "hash": "0x16bd9f5d4a735cd2928e2ad6fc6aa0f32a0ed359b6efc6ae860540ea9ebf4db3", + "transactionType": "CREATE2", + "contractName": "Board", + "contractAddress": "0x71a332c446d06a33a12e7f5c42b5bdd2c74aea64", + "function": null, + "arguments": null, + "transaction": { + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "gas": "0x22c4b9", + "input": "0x0000000000000000000000000000000000000000000000000000000000000000611cd761004d600b8282823980515f1a6073146041577f4e487b71000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b305f52607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100f3575f3560e01c806335e37c72116100955780637e8dbaf61161006f5780637e8dbaf61461028f578063f173e012146102bf578063f3750466146102ef578063f54a36eb1461031f576100f3565b806335e37c72146102115780633b9f7a1f1461024157806364cd159514610271576100f3565b80631af4f970116100d15780631af4f9701461017557806324f4ec51146101935780632c5f3c45146101b1578063312ffe40146101e1576100f3565b806301df1995146100f757806303ee233d1461011557806319c1471814610145575b5f5ffd5b6100ff61034f565b60405161010c91906117c4565b60405180910390f35b61012f600480360381019061012a919061180b565b610354565b60405161013c9190611875565b60405180910390f35b61015f600480360381019061015a919061188e565b610404565b60405161016c9190611875565b60405180910390f35b61017d61050b565b60405161018a91906117c4565b60405180910390f35b61019b610510565b6040516101a891906117c4565b60405180910390f35b6101cb60048036038101906101c6919061188e565b610514565b6040516101d891906117c4565b60405180910390f35b6101fb60048036038101906101f6919061188e565b610844565b60405161020891906117c4565b60405180910390f35b61022b600480360381019061022691906118ef565b610b74565b604051610238919061193c565b60405180910390f35b61025b6004803603810190610256919061188e565b610b9f565b60405161026891906117c4565b60405180910390f35b610279610fbb565b60405161028691906117c4565b60405180910390f35b6102a960048036038101906102a49190611988565b610fc0565b6040516102b691906117c4565b60405180910390f35b6102d960048036038101906102d491906119b3565b6110ca565b6040516102e691906117c4565b60405180910390f35b6103096004803603810190610304919061180b565b61111a565b60405161031691906117c4565b60405180910390f35b6103396004803603810190610334919061188e565b61135e565b60405161034691906117c4565b60405180910390f35b600181565b5f5f6088600886901b901c14610396576040517ff561181200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6088600885901b901c146103d7576040517ff561181200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6103ee856103e58661177a565b60ff168561111a565b905060088085901b901c81149150509392505050565b5f5f608083901c14610442576040517ff561181200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f5f90505b60108160ff1610156104c6575f61045f8583610b74565b905060038160ff161061049e576040517f7646c39a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8160ff1611156104b85782806104b490611a30565b9350505b508080600101915050610448565b5060028114610501576040517f7646c39a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001915050919050565b600381565b5f81565b5f5f5f90505b60048160ff16101561083b5761052e61178a565b5f5f90505b60048160ff1610156105945761056085826004866105519190611a77565b61055b9190611ab3565b610b74565b828260ff166004811061057657610575611ae7565b5b602002019060ff16908160ff16815250508080600101915050610533565b5061059d61178a565b5f5f90505f5f90505b60048160ff161015610632575f848260ff16600481106105c9576105c8611ae7565b5b602002015160ff161461062557838160ff16600481106105ec576105eb611ae7565b5b60200201518383806105fd90611b14565b945060ff166004811061061357610612611ae7565b5b602002019060ff16908160ff16815250505b80806001019150506105a6565b505f5f90505b60038160ff16101561072f575f838260ff166004811061065b5761065a611ae7565b5b602002015160ff16141580156106b657508260018261067a9190611ab3565b60ff166004811061068e5761068d611ae7565b5b602002015160ff16838260ff16600481106106ac576106ab611ae7565b5b602002015160ff16145b1561072257828160ff16600481106106d1576106d0611ae7565b5b6020020180518091906106e390611b14565b60ff1660ff16815250505f836001836106fc9190611ab3565b60ff16600481106107105761070f611ae7565b5b602002019060ff16908160ff16815250505b8080600101915050610638565b5061073861178a565b5f91505f5f90505b60048160ff1610156107cc575f848260ff166004811061076357610762611ae7565b5b602002015160ff16146107bf57838160ff166004811061078657610785611ae7565b5b602002015182848061079790611b14565b955060ff16600481106107ad576107ac611ae7565b5b602002019060ff16908160ff16815250505b8080600101915050610740565b505f5f90505b60048160ff1610156108295761081a88826004896107f09190611a77565b6107fa9190611ab3565b848460ff16600481106108105761080f611ae7565b5b60200201516110ca565b975080806001019150506107d2565b5050505050808060010191505061051a565b50819050919050565b5f5f5f90505b60048160ff161015610b6b5761085e61178a565b5f5f90505b60048160ff1610156108c45761089085846004846108819190611a77565b61088b9190611ab3565b610b74565b828260ff16600481106108a6576108a5611ae7565b5b602002019060ff16908160ff16815250508080600101915050610863565b506108cd61178a565b5f5f90505f5f90505b60048160ff161015610962575f848260ff16600481106108f9576108f8611ae7565b5b602002015160ff161461095557838160ff166004811061091c5761091b611ae7565b5b602002015183838061092d90611b14565b945060ff166004811061094357610942611ae7565b5b602002019060ff16908160ff16815250505b80806001019150506108d6565b505f5f90505b60038160ff161015610a5f575f838260ff166004811061098b5761098a611ae7565b5b602002015160ff16141580156109e65750826001826109aa9190611ab3565b60ff16600481106109be576109bd611ae7565b5b602002015160ff16838260ff16600481106109dc576109db611ae7565b5b602002015160ff16145b15610a5257828160ff1660048110610a0157610a00611ae7565b5b602002018051809190610a1390611b14565b60ff1660ff16815250505f83600183610a2c9190611ab3565b60ff1660048110610a4057610a3f611ae7565b5b602002019060ff16908160ff16815250505b8080600101915050610968565b50610a6861178a565b5f91505f5f90505b60048160ff161015610afc575f848260ff1660048110610a9357610a92611ae7565b5b602002015160ff1614610aef57838160ff1660048110610ab657610ab5611ae7565b5b6020020151828480610ac790611b14565b955060ff1660048110610add57610adc611ae7565b5b602002019060ff16908160ff16815250505b8080600101915050610a70565b505f5f90505b60048160ff161015610b5957610b4a8887600484610b209190611a77565b610b2a9190611ab3565b848460ff1660048110610b4057610b3f611ae7565b5b60200201516110ca565b97508080600101915050610b02565b5050505050808060010191505061084a565b50819050919050565b5f60ff600883600f610b869190611b3c565b610b909190611a77565b60ff1684901c16905092915050565b5f5f5f90505b60048160ff161015610fb257610bb961178a565b5f5f90505b60048160ff161015610c1f57610beb8582600486610bdc9190611a77565b610be69190611ab3565b610b74565b828260ff1660048110610c0157610c00611ae7565b5b602002019060ff16908160ff16815250508080600101915050610bbe565b50610c2861178a565b5f5f90505b60048160ff161015610c945782816003610c479190611b3c565b60ff1660048110610c5b57610c5a611ae7565b5b6020020151828260ff1660048110610c7657610c75611ae7565b5b602002019060ff16908160ff16815250508080600101915050610c2d565b50610c9d61178a565b5f5f90505f5f90505b60048160ff161015610d32575f848260ff1660048110610cc957610cc8611ae7565b5b602002015160ff1614610d2557838160ff1660048110610cec57610ceb611ae7565b5b6020020151838380610cfd90611b14565b945060ff1660048110610d1357610d12611ae7565b5b602002019060ff16908160ff16815250505b8080600101915050610ca6565b505f5f90505b60038160ff161015610e2f575f838260ff1660048110610d5b57610d5a611ae7565b5b602002015160ff1614158015610db6575082600182610d7a9190611ab3565b60ff1660048110610d8e57610d8d611ae7565b5b602002015160ff16838260ff1660048110610dac57610dab611ae7565b5b602002015160ff16145b15610e2257828160ff1660048110610dd157610dd0611ae7565b5b602002018051809190610de390611b14565b60ff1660ff16815250505f83600183610dfc9190611ab3565b60ff1660048110610e1057610e0f611ae7565b5b602002019060ff16908160ff16815250505b8080600101915050610d38565b50610e3861178a565b5f91505f5f90505b60048160ff161015610ecc575f848260ff1660048110610e6357610e62611ae7565b5b602002015160ff1614610ebf57838160ff1660048110610e8657610e85611ae7565b5b6020020151828480610e9790611b14565b955060ff1660048110610ead57610eac611ae7565b5b602002019060ff16908160ff16815250505b8080600101915050610e40565b50610ed561178a565b5f5f90505b60048160ff161015610f415782816003610ef49190611b3c565b60ff1660048110610f0857610f07611ae7565b5b6020020151828260ff1660048110610f2357610f22611ae7565b5b602002019060ff16908160ff16815250508080600101915050610eda565b505f5f90505b60048160ff161015610f9e57610f8f8a8260048b610f659190611a77565b610f6f9190611ab3565b848460ff1660048110610f8557610f84611ae7565b5b60200201516110ca565b99508080600101915050610f47565b505050505050508080600101915050610ba5565b50819050919050565b600281565b5f5f82604051602001610fd39190611b90565b604051602081830303815290604052805190602001205f1c90505f601082610ffb9190611bd7565b90508160405160200161100e9190611c27565b604051602081830303815290604052805190602001205f1c91505f6010836110369190611bd7565b90505b81810361106057601060018261104f9190611c41565b6110599190611bd7565b9050611039565b5f5f90505b60108160ff1610156110c157828160ff1614806110845750818160ff16145b156110b4576110b18582605a60648861109d9190611bd7565b116110a95760016110ac565b60025b6110ca565b94505b8080600101915050611065565b50505050919050565b5f600883600f6110da9190611b3c565b6110e49190611a77565b60ff168260ff16901b600884600f6110fc9190611b3c565b6111069190611a77565b60ff1660ff901b1985161790509392505050565b5f60048310611155576040517f35405e3c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f830361116c5761116584610844565b90506111b3565b600183036111845761117d8461135e565b90506111b2565b6003830361119c5761119584610b9f565b90506111b1565b600283036111b0576111ad84610514565b90505b5b5b5b608081901b608085901b036111f4576040517f35405e3c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f90505f5f90505b60108160ff161015611238575f6112148483610b74565b60ff160361122b57818061122790611a30565b9250505b80806001019150506111fd565b505f81111561134c575f8167ffffffffffffffff81111561125c5761125b611c74565b5b60405190808252806020026020018201604052801561128a5781602001602082028036833780820191505090505b5090505f5f90505f5f90505b60108160ff1610156112f9575f6112ad8683610b74565b60ff16036112ec57808383815181106112c9576112c8611ae7565b5b602002602001019060ff16908160ff168152505081806112e890611a30565b9250505b8080600101915050611296565b506113478483858861130b9190611bd7565b8151811061131c5761131b611ae7565b5b6020026020010151605a6064896113339190611bd7565b1161133f576001611342565b60025b6110ca565b935050505b60808083901b901c9150509392505050565b5f5f5f90505b60048160ff1610156117715761137861178a565b5f5f90505b60048160ff1610156113de576113aa858460048461139b9190611a77565b6113a59190611ab3565b610b74565b828260ff16600481106113c0576113bf611ae7565b5b602002019060ff16908160ff1681525050808060010191505061137d565b506113e761178a565b5f5f90505b60048160ff16101561145357828160036114069190611b3c565b60ff166004811061141a57611419611ae7565b5b6020020151828260ff166004811061143557611434611ae7565b5b602002019060ff16908160ff168152505080806001019150506113ec565b5061145c61178a565b5f5f90505f5f90505b60048160ff1610156114f1575f848260ff166004811061148857611487611ae7565b5b602002015160ff16146114e457838160ff16600481106114ab576114aa611ae7565b5b60200201518383806114bc90611b14565b945060ff16600481106114d2576114d1611ae7565b5b602002019060ff16908160ff16815250505b8080600101915050611465565b505f5f90505b60038160ff1610156115ee575f838260ff166004811061151a57611519611ae7565b5b602002015160ff16141580156115755750826001826115399190611ab3565b60ff166004811061154d5761154c611ae7565b5b602002015160ff16838260ff166004811061156b5761156a611ae7565b5b602002015160ff16145b156115e157828160ff16600481106115905761158f611ae7565b5b6020020180518091906115a290611b14565b60ff1660ff16815250505f836001836115bb9190611ab3565b60ff16600481106115cf576115ce611ae7565b5b602002019060ff16908160ff16815250505b80806001019150506114f7565b506115f761178a565b5f91505f5f90505b60048160ff16101561168b575f848260ff166004811061162257611621611ae7565b5b602002015160ff161461167e57838160ff166004811061164557611644611ae7565b5b602002015182848061165690611b14565b955060ff166004811061166c5761166b611ae7565b5b602002019060ff16908160ff16815250505b80806001019150506115ff565b5061169461178a565b5f5f90505b60048160ff16101561170057828160036116b39190611b3c565b60ff16600481106116c7576116c6611ae7565b5b6020020151828260ff16600481106116e2576116e1611ae7565b5b602002019060ff16908160ff16815250508080600101915050611699565b505f5f90505b60048160ff16101561175d5761174e8a896004846117249190611a77565b61172e9190611ab3565b848460ff166004811061174457611743611ae7565b5b60200201516110ca565b99508080600101915050611706565b505050505050508080600101915050611364565b50819050919050565b5f60ff60f883901c169050919050565b6040518060800160405280600490602082028036833780820191505090505090565b5f819050919050565b6117be816117ac565b82525050565b5f6020820190506117d75f8301846117b5565b92915050565b5f5ffd5b6117ea816117ac565b81146117f4575f5ffd5b50565b5f81359050611805816117e1565b92915050565b5f5f5f60608486031215611822576118216117dd565b5b5f61182f868287016117f7565b9350506020611840868287016117f7565b9250506040611851868287016117f7565b9150509250925092565b5f8115159050919050565b61186f8161185b565b82525050565b5f6020820190506118885f830184611866565b92915050565b5f602082840312156118a3576118a26117dd565b5b5f6118b0848285016117f7565b91505092915050565b5f60ff82169050919050565b6118ce816118b9565b81146118d8575f5ffd5b50565b5f813590506118e9816118c5565b92915050565b5f5f60408385031215611905576119046117dd565b5b5f611912858286016117f7565b9250506020611923858286016118db565b9150509250929050565b611936816118b9565b82525050565b5f60208201905061194f5f83018461192d565b92915050565b5f819050919050565b61196781611955565b8114611971575f5ffd5b50565b5f813590506119828161195e565b92915050565b5f6020828403121561199d5761199c6117dd565b5b5f6119aa84828501611974565b91505092915050565b5f5f5f606084860312156119ca576119c96117dd565b5b5f6119d7868287016117f7565b93505060206119e8868287016118db565b92505060406119f9868287016118db565b9150509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f611a3a826117ac565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203611a6c57611a6b611a03565b5b600182019050919050565b5f611a81826118b9565b9150611a8c836118b9565b9250828202611a9a816118b9565b9150808214611aac57611aab611a03565b5b5092915050565b5f611abd826118b9565b9150611ac8836118b9565b9250828201905060ff811115611ae157611ae0611a03565b5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f611b1e826118b9565b915060ff8203611b3157611b30611a03565b5b600182019050919050565b5f611b46826118b9565b9150611b51836118b9565b9250828203905060ff811115611b6a57611b69611a03565b5b92915050565b5f819050919050565b611b8a611b8582611955565b611b70565b82525050565b5f611b9b8284611b79565b60208201915081905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f611be1826117ac565b9150611bec836117ac565b925082611bfc57611bfb611baa565b5b828206905092915050565b5f819050919050565b611c21611c1c826117ac565b611c07565b82525050565b5f611c328284611c10565b60208201915081905092915050565b5f611c4b826117ac565b9150611c56836117ac565b9250828201905080821115611c6e57611c6d611a03565b5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffdfea2646970667358221220b39a864d6d2d2a7a8e5f00ccf0b77940d19dc2b9fe937acf5c466c45f6d11f0864736f6c634300081c0033", + "nonce": "0x51", + "chainId": "0x279f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xb6f0df98cf0eafde5111bdcf2d62326697dea923943e30b8a462cdf71478725e", + "transactionType": "CREATE", + "contractName": "Monad2048", + "contractAddress": "0xd58a47b87a49d260a437693d330dfb59d379b74a", + "function": null, + "arguments": null, + "transaction": { + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "gas": "0x121444", + "value": "0x0", + "input": "0x6080604052348015600e575f5ffd5b50610f8d8061001c5f395ff3fe608060405234801561000f575f5ffd5b506004361061007b575f3560e01c80639a987475116100595780639a987475146100e7578063ac88036c14610117578063e51b891f14610147578063ed805269146101785761007b565b806339b9e19f1461007f5780633e98ab541461009b57806379cbd233146100b7575b5f5ffd5b610099600480360381019061009491906109e1565b6101a8565b005b6100b560048036038101906100b09190610a52565b6105c0565b005b6100d160048036038101906100cc9190610a90565b6107ee565b6040516100de9190610aca565b60405180910390f35b61010160048036038101906100fc9190610a90565b610803565b60405161010e9190610af2565b60405180910390f35b610131600480360381019061012c9190610a90565b610818565b60405161013e9190610af2565b60405180910390f35b610161600480360381019061015c9190610a90565b61082d565b60405161016f929190610bbc565b60405180910390f35b610192600480360381019061018d9190610a90565b610923565b60405161019f9190610c24565b60405180910390f35b5f3390505f73ffffffffffffffffffffffffffffffffffffffff165f5f8581526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610240576040517f25434c8300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f826040516020016102529190610c56565b6040516020818303038152906040528051906020012090505f5f1b60035f8381526020019081526020015f2054146102b6576040517f6e3ca80500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7371a332c446d06a33a12e7f5c42b5bdd2c74aea646319c14718845f600481106102e3576102e2610c70565b5b60200201356040518263ffffffff1660e01b81526004016103049190610cac565b602060405180830381865af415801561031f573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906103439190610cfa565b610379576040517f2b977ce300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f600190505b60048110156104a9577371a332c446d06a33a12e7f5c42b5bdd2c74aea646303ee233d856001846103b09190610d52565b600481106103c1576103c0610c70565b5b60200201358684600481106103d9576103d8610c70565b5b602002013588856040516020016103f1929190610dc5565b604051602081830303815290604052805190602001205f1c6040518463ffffffff1660e01b815260040161042793929190610df0565b602060405180830381865af4158015610442573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906104669190610cfa565b61049c576040517f2b977ce300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b808060010191505061037f565b50815f5f8681526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600460025f8681526020019081526020015f20819055508360035f8381526020019081526020015f20819055508260036004811061053957610538610c70565b5b602002013560015f8681526020019081526020015f2081905550838273ffffffffffffffffffffffffffffffffffffffff167f3d6c02e74ba05913874ba8d477497510df840bf93bfa5a2a8d8943766678a0e3856003600481106105a05761059f610c70565b5b60200201356040516105b29190610af2565b60405180910390a350505050565b5f3390505f5f8481526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610658576040517faed8b1cf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b7371a332c446d06a33a12e7f5c42b5bdd2c74aea646303ee233d60015f8681526020019081526020015f2054848660025f8981526020019081526020015f20546040516020016106a9929190610dc5565b604051602081830303815290604052805190602001205f1c6040518463ffffffff1660e01b81526004016106df93929190610df0565b602060405180830381865af41580156106fa573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061071e9190610cfa565b610754576040517f2b977ce300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8160015f8581526020019081526020015f208190555060025f8481526020019081526020015f205f81548092919061078b90610e25565b9190505550828173ffffffffffffffffffffffffffffffffffffffff167f14fe4197a69dbcc73d79fcfd259bd1f097640dd2c2fe016ff232c416e17ce8426107d285610952565b856040516107e1929190610ea5565b60405180910390a3505050565b6003602052805f5260405f205f915090505481565b6002602052805f5260405f205f915090505481565b6001602052805f5260405f205f915090505481565b610835610962565b5f5f60015f8581526020019081526020015f205490505f5f90505b60108160ff161015610908577371a332c446d06a33a12e7f5c42b5bdd2c74aea646335e37c7283836040518363ffffffff1660e01b8152600401610895929190610edb565b602060405180830381865af41580156108b0573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108d49190610f2c565b848260ff16601081106108ea576108e9610c70565b5b602002019060ff16908160ff16815250508080600101915050610850565b5060025f8581526020019081526020015f2054915050915091565b5f602052805f5260405f205f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f60ff60f883901c169050919050565b604051806102000160405280601090602082028036833780820191505090505090565b5f5ffd5b5f819050919050565b61099b81610989565b81146109a5575f5ffd5b50565b5f813590506109b681610992565b92915050565b5f5ffd5b5f819050826020600402820111156109db576109da6109bc565b5b92915050565b5f5f60a083850312156109f7576109f6610985565b5b5f610a04858286016109a8565b9250506020610a15858286016109c0565b9150509250929050565b5f819050919050565b610a3181610a1f565b8114610a3b575f5ffd5b50565b5f81359050610a4c81610a28565b92915050565b5f5f60408385031215610a6857610a67610985565b5b5f610a75858286016109a8565b9250506020610a8685828601610a3e565b9150509250929050565b5f60208284031215610aa557610aa4610985565b5b5f610ab2848285016109a8565b91505092915050565b610ac481610989565b82525050565b5f602082019050610add5f830184610abb565b92915050565b610aec81610a1f565b82525050565b5f602082019050610b055f830184610ae3565b92915050565b5f60109050919050565b5f81905092915050565b5f819050919050565b5f60ff82169050919050565b610b3d81610b28565b82525050565b5f610b4e8383610b34565b60208301905092915050565b5f602082019050919050565b610b6f81610b0b565b610b798184610b15565b9250610b8482610b1f565b805f5b83811015610bb4578151610b9b8782610b43565b9650610ba683610b5a565b925050600181019050610b87565b505050505050565b5f61022082019050610bd05f830185610b66565b610bde610200830184610ae3565b9392505050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610c0e82610be5565b9050919050565b610c1e81610c04565b82525050565b5f602082019050610c375f830184610c15565b92915050565b82818337505050565b610c5260808383610c3d565b5050565b5f610c618284610c46565b60808201915081905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b610ca681610a1f565b82525050565b5f602082019050610cbf5f830184610c9d565b92915050565b5f8115159050919050565b610cd981610cc5565b8114610ce3575f5ffd5b50565b5f81519050610cf481610cd0565b92915050565b5f60208284031215610d0f57610d0e610985565b5b5f610d1c84828501610ce6565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f610d5c82610a1f565b9150610d6783610a1f565b9250828203905081811115610d7f57610d7e610d25565b5b92915050565b5f819050919050565b610d9f610d9a82610989565b610d85565b82525050565b5f819050919050565b610dbf610dba82610a1f565b610da5565b82525050565b5f610dd08285610d8e565b602082019150610de08284610dae565b6020820191508190509392505050565b5f606082019050610e035f830186610c9d565b610e106020830185610c9d565b610e1d6040830184610c9d565b949350505050565b5f610e2f82610a1f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610e6157610e60610d25565b5b600182019050919050565b5f819050919050565b5f610e8f610e8a610e8584610b28565b610e6c565b610a1f565b9050919050565b610e9f81610e75565b82525050565b5f604082019050610eb85f830185610e96565b610ec56020830184610ae3565b9392505050565b610ed581610b28565b82525050565b5f604082019050610eee5f830185610c9d565b610efb6020830184610ecc565b9392505050565b610f0b81610b28565b8114610f15575f5ffd5b50565b5f81519050610f2681610f02565b92915050565b5f60208284031215610f4157610f40610985565b5b5f610f4e84828501610f18565b9150509291505056fea26469706673582212206910acfb4b24932d85f52ba1d30ae8ff1ad231bd7ab3fe1d7d714d5754147c2764736f6c634300081c0033", + "nonce": "0x52", + "chainId": "0x279f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0xd4a4a9", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0x16bd9f5d4a735cd2928e2ad6fc6aa0f32a0ed359b6efc6ae860540ea9ebf4db3", + "transactionIndex": "0x55", + "blockHash": "0x01092e4362a1c77f17357b54288d7dd573f7b659e4640fd9d9d058abf3aae4d3", + "blockNumber": "0xd39cb7", + "gasUsed": "0x22c4b9", + "effectiveGasPrice": "0xba43b7401", + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "contractAddress": null + }, + { + "status": "0x1", + "cumulativeGasUsed": "0xe6b8ed", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0xb6f0df98cf0eafde5111bdcf2d62326697dea923943e30b8a462cdf71478725e", + "transactionIndex": "0x56", + "blockHash": "0x01092e4362a1c77f17357b54288d7dd573f7b659e4640fd9d9d058abf3aae4d3", + "blockNumber": "0xd39cb7", + "gasUsed": "0x121444", + "effectiveGasPrice": "0xba43b7401", + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": null, + "contractAddress": "0xd58a47b87a49d260a437693d330dfb59d379b74a" + } + ], + "libraries": [ + "src/LibBoard.sol:Board:0x71A332C446d06A33A12e7f5C42B5BdD2c74AEa64" + ], + "pending": [], + "returns": { + "gameContract": { + "internal_type": "address", + "value": "0xd58A47b87A49D260A437693D330dFb59d379B74a" + } + }, + "timestamp": 1745556899, + "chain": 10143, + "commit": "8d121b9" +} \ No newline at end of file diff --git a/packages/contracts/broadcast/Deploy.s.sol/10143/run-1746797402.json b/packages/contracts/broadcast/Deploy.s.sol/10143/run-1746797402.json new file mode 100644 index 0000000..1b91435 --- /dev/null +++ b/packages/contracts/broadcast/Deploy.s.sol/10143/run-1746797402.json @@ -0,0 +1,87 @@ +{ + "transactions": [ + { + "hash": "0x8554f0cf080cbd8c7785e0ad0794bd4762d19fc709856ee89dd743a539f70a49", + "transactionType": "CREATE2", + "contractName": "Board", + "contractAddress": "0x8fa02ad884b2a60f47ccf5850e242e72f5131450", + "function": null, + "arguments": null, + "transaction": { + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "gas": "0x149572", + "input": "0x0000000000000000000000000000000000000000000000000000000000000000610fbc61004d600b8282823980515f1a6073146041577f4e487b71000000000000000000000000000000000000000000000000000000005f525f60045260245ffd5b305f52607381538281f3fe73000000000000000000000000000000000000000030146080604052600436106100b2575f3560e01c80632e1a2b221161007a5780632e1a2b221461017057806335e37c72146101a057806364cd1595146101d05780637e8dbaf6146101ee578063f173e0121461021e578063f37504661461024e576100b2565b806301df1995146100b657806303ee233d146100d457806319c14718146101045780631af4f9701461013457806324f4ec5114610152575b5f5ffd5b6100be61027e565b6040516100cb9190610aa4565b60405180910390f35b6100ee60048036038101906100e99190610aeb565b610283565b6040516100fb9190610b55565b60405180910390f35b61011e60048036038101906101199190610b6e565b610333565b60405161012b9190610b55565b60405180910390f35b61013c61043a565b6040516101499190610aa4565b60405180910390f35b61015a61043f565b6040516101679190610aa4565b60405180910390f35b61018a60048036038101906101859190610bc3565b610443565b6040516101979190610aa4565b60405180910390f35b6101ba60048036038101906101b59190610c49565b610512565b6040516101c79190610c96565b60405180910390f35b6101d861053d565b6040516101e59190610aa4565b60405180910390f35b61020860048036038101906102039190610ce2565b610542565b6040516102159190610aa4565b60405180910390f35b61023860048036038101906102339190610d0d565b61063a565b6040516102459190610aa4565b60405180910390f35b61026860048036038101906102639190610aeb565b61068a565b6040516102759190610aa4565b60405180910390f35b600181565b5f5f6088600886901b901c146102c5576040517ff561181200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6088600885901b901c14610306576040517ff561181200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f61031d85610314866107f2565b60ff168561068a565b905060088085901b901c81149150509392505050565b5f5f608083901c14610371576040517ff561181200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f5f5f90505b60108160ff1610156103f5575f61038e8583610512565b905060038160ff16106103cd576040517f7646c39a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f8160ff1611156103e75782806103e390610d8a565b9350505b508080600101915050610377565b5060028114610430576040517f7646c39a00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001915050919050565b600381565b5f81565b5f5f5f90506fffffffffffffffffffffffffffffffff8016851694505f8461046f5763ffffffff61047e565b6cff000000ff000000ff000000ff5b6cffffffffffffffffffffffffff1690505f5f90505b6004811015610508575f6104ab8884168888610802565b90505f6104b98289896108f8565b90508481901b86179550876104cf5760206104d2565b60085b60ff16856104e09190610dd1565b9450876104ee5760206104f1565b60085b60ff1689901c985050508080600101915050610494565b5050509392505050565b5f60ff600883600f6105249190610e04565b61052e9190610e38565b60ff1684901c16905092915050565b600281565b5f5f826040516020016105559190610e94565b604051602081830303815290604052805190602001205f1c90505f60108261057d9190610edb565b9050816040516020016105909190610f2b565b604051602081830303815290604052805190602001205f1c91505f600f836105b89190610edb565b90508181106105d05780806105cc90610d8a565b9150505b5f5f90505b60108160ff16101561063157828160ff1614806105f45750818160ff16145b15610624576106218582605a60648861060d9190610edb565b1161061957600161061c565b60025b61063a565b94505b80806001019150506105d5565b50505050919050565b5f600883600f61064a9190610e04565b6106549190610e38565b60ff168260ff16901b600884600f61066c9190610e04565b6106769190610e38565b60ff1660ff901b1985161790509392505050565b5f600483106106c5576040517f35405e3c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6106e28460018511155f6002876106dc9190610edb565b14610443565b9050608081901b608085901b03610725576040517f35405e3c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f6fff00000000000000000000000000000090505f5f5f5b5f8414610788575f8486160361076e57818061075890610d8a565b925060086107669190610f45565b81901b831792505b600884901c9350808061078090610d8a565b91505061073d565b5f8211156107dd575f60ff838861079f9190610edb565b60086107ab9190610f45565b85901c1690506107d98682605a60648b6107c59190610edb565b116107d15760016107d4565b60025b61063a565b9550505b60808086901b901c9450505050509392505050565b5f60ff60f883901c169050919050565b5f5f83610810576008610813565b60205b60ff1690505f836108255760ff610844565b846108345763ff000000610843565b6cff0000000000000000000000005b5b6cffffffffffffffffffffffffff1690505f856108655763ffffffff610874565b6cff000000ff000000ff000000ff5b6cffffffffffffffffffffffffff1690505b5f821415801561089657505f8714155b156108ee575b5f8188161180156108ae57505f828816145b156108cd57846108c1578287901c6108c6565b8287901b5b965061089c565b81871684179350846108e2578282901b6108e7565b8282901c5b9150610886565b5050509392505050565b5f5f83610906576008610909565b60205b60ff1690505f8361091b5760ff61093a565b8461092a5763ff000000610939565b6cff0000000000000000000000005b5b6cffffffffffffffffffffffffff1690505f8561095b5763ffffffff61096a565b6cff000000ff000000ff000000ff5b6cffffffffffffffffffffffffff1690505f8561098a578383901b61098f565b8383901c5b90505f8661099e5760016109bd565b876109ad5763010000006109bc565b6c010000000000000000000000005b5b6cffffffffffffffffffffffffff1690505b5f89841614610a80575f876109e95785838b16901c6109f0565b85838b16901b5b905080858b1603610a1f5787610a0957858a901c610a0e565b858a901b5b9950818a610a1c9190610dd1565b99505b848a168717965087610a34578585901b610a39565b8585901c5b945087610a49578583901b610a4e565b8583901c5b925087610a5e578582901b610a63565b8582901c5b915087610a73578584901b610a78565b8584901c5b9350506109cf565b50505050509392505050565b5f819050919050565b610a9e81610a8c565b82525050565b5f602082019050610ab75f830184610a95565b92915050565b5f5ffd5b610aca81610a8c565b8114610ad4575f5ffd5b50565b5f81359050610ae581610ac1565b92915050565b5f5f5f60608486031215610b0257610b01610abd565b5b5f610b0f86828701610ad7565b9350506020610b2086828701610ad7565b9250506040610b3186828701610ad7565b9150509250925092565b5f8115159050919050565b610b4f81610b3b565b82525050565b5f602082019050610b685f830184610b46565b92915050565b5f60208284031215610b8357610b82610abd565b5b5f610b9084828501610ad7565b91505092915050565b610ba281610b3b565b8114610bac575f5ffd5b50565b5f81359050610bbd81610b99565b92915050565b5f5f5f60608486031215610bda57610bd9610abd565b5b5f610be786828701610ad7565b9350506020610bf886828701610baf565b9250506040610c0986828701610baf565b9150509250925092565b5f60ff82169050919050565b610c2881610c13565b8114610c32575f5ffd5b50565b5f81359050610c4381610c1f565b92915050565b5f5f60408385031215610c5f57610c5e610abd565b5b5f610c6c85828601610ad7565b9250506020610c7d85828601610c35565b9150509250929050565b610c9081610c13565b82525050565b5f602082019050610ca95f830184610c87565b92915050565b5f819050919050565b610cc181610caf565b8114610ccb575f5ffd5b50565b5f81359050610cdc81610cb8565b92915050565b5f60208284031215610cf757610cf6610abd565b5b5f610d0484828501610cce565b91505092915050565b5f5f5f60608486031215610d2457610d23610abd565b5b5f610d3186828701610ad7565b9350506020610d4286828701610c35565b9250506040610d5386828701610c35565b9150509250925092565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f610d9482610a8c565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610dc657610dc5610d5d565b5b600182019050919050565b5f610ddb82610a8c565b9150610de683610a8c565b9250828201905080821115610dfe57610dfd610d5d565b5b92915050565b5f610e0e82610c13565b9150610e1983610c13565b9250828203905060ff811115610e3257610e31610d5d565b5b92915050565b5f610e4282610c13565b9150610e4d83610c13565b9250828202610e5b81610c13565b9150808214610e6d57610e6c610d5d565b5b5092915050565b5f819050919050565b610e8e610e8982610caf565b610e74565b82525050565b5f610e9f8284610e7d565b60208201915081905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f610ee582610a8c565b9150610ef083610a8c565b925082610f0057610eff610eae565b5b828206905092915050565b5f819050919050565b610f25610f2082610a8c565b610f0b565b82525050565b5f610f368284610f14565b60208201915081905092915050565b5f610f4f82610a8c565b9150610f5a83610a8c565b9250828202610f6881610a8c565b91508282048414831517610f7f57610f7e610d5d565b5b509291505056fea26469706673582212207a69099fdb98d08816a23c71ad6b6619a446a1f429dcce2bd59508ec3ecbc24564736f6c634300081c0033", + "nonce": "0x72", + "chainId": "0x279f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0x7993fa7ab600911367fd2042fdf8c7dfd162c1b02de6256c1271343c244513e2", + "transactionType": "CREATE", + "contractName": "Monad2048", + "contractAddress": "0x01bccdccdecafe3f357e8df9ae5b9af002939d1c", + "function": null, + "arguments": null, + "transaction": { + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "gas": "0x10cfd1", + "value": "0x0", + "input": "0x6080604052348015600e575f5ffd5b50610e678061001c5f395ff3fe608060405234801561000f575f5ffd5b5060043610610060575f3560e01c806339b9e19f146100645780633e98ab541461008057806379cbd2331461009c5780639a987475146100cc578063ac88036c146100fc578063e51b891f1461012c575b5f5ffd5b61007e60048036038101906100799190610913565b61015d565b005b61009a60048036038101906100959190610984565b61054a565b005b6100b660048036038101906100b191906109c2565b610751565b6040516100c391906109fc565b60405180910390f35b6100e660048036038101906100e191906109c2565b610766565b6040516100f39190610a24565b60405180910390f35b610116600480360381019061011191906109c2565b61077b565b6040516101239190610a24565b60405180910390f35b610146600480360381019061014191906109c2565b61078f565b604051610154929190610aee565b60405180910390f35b33826060815f1c901c73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146101ca576040517faed8b1cf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f3390505f5f5f8781526020019081526020015f205414610217576040517f25434c8300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f846040516020016102299190610b30565b6040516020818303038152906040528051906020012090505f5f1b60025f8381526020019081526020015f20541461028d576040517f6e3ca80500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b738fa02ad884b2a60f47ccf5850e242e72f51314506319c14718865f600481106102ba576102b9610b4a565b5b60200201356040518263ffffffff1660e01b81526004016102db9190610b86565b602060405180830381865af41580156102f6573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061031a9190610bd4565b610350576040517f2b977ce300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f600190505b600481101561048057738fa02ad884b2a60f47ccf5850e242e72f51314506303ee233d876001846103879190610c2c565b6004811061039857610397610b4a565b5b60200201358884600481106103b0576103af610b4a565b5b60200201358a856040516020016103c8929190610c9f565b604051602081830303815290604052805190602001205f1c6040518463ffffffff1660e01b81526004016103fe93929190610cca565b602060405180830381865af4158015610419573d5f5f3e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061043d9190610bd4565b610473576040517f2b977ce300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8080600101915050610356565b50600460015f8881526020019081526020015f20819055508560025f8381526020019081526020015f2081905550846003600481106104c2576104c1610b4a565b5b60200201355f5f8881526020019081526020015f2081905550858273ffffffffffffffffffffffffffffffffffffffff167f3d6c02e74ba05913874ba8d477497510df840bf93bfa5a2a8d8943766678a0e38760036004811061052857610527610b4a565b5b602002013560405161053a9190610a24565b60405180910390a3505050505050565b33826060815f1c901c73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146105b7576040517faed8b1cf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f339050738fa02ad884b2a60f47ccf5850e242e72f51314506303ee233d5f5f8881526020019081526020015f2054868860015f8b81526020019081526020015f205460405160200161060b929190610c9f565b604051602081830303815290604052805190602001205f1c6040518463ffffffff1660e01b815260040161064193929190610cca565b602060405180830381865af415801561065c573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106809190610bd4565b6106b6576040517f2b977ce300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b835f5f8781526020019081526020015f208190555060015f8681526020019081526020015f205f8154809291906106ec90610cff565b9190505550848173ffffffffffffffffffffffffffffffffffffffff167f14fe4197a69dbcc73d79fcfd259bd1f097640dd2c2fe016ff232c416e17ce84261073387610884565b87604051610742929190610d7f565b60405180910390a35050505050565b6002602052805f5260405f205f915090505481565b6001602052805f5260405f205f915090505481565b5f602052805f5260405f205f915090505481565b610797610894565b5f5f5f5f8581526020019081526020015f205490505f5f90505b60108160ff16101561086957738fa02ad884b2a60f47ccf5850e242e72f51314506335e37c7283836040518363ffffffff1660e01b81526004016107f6929190610db5565b602060405180830381865af4158015610811573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108359190610e06565b848260ff166010811061084b5761084a610b4a565b5b602002019060ff16908160ff168152505080806001019150506107b1565b5060015f8581526020019081526020015f2054915050915091565b5f60ff60f883901c169050919050565b604051806102000160405280601090602082028036833780820191505090505090565b5f5ffd5b5f819050919050565b6108cd816108bb565b81146108d7575f5ffd5b50565b5f813590506108e8816108c4565b92915050565b5f5ffd5b5f8190508260206004028201111561090d5761090c6108ee565b5b92915050565b5f5f60a08385031215610929576109286108b7565b5b5f610936858286016108da565b9250506020610947858286016108f2565b9150509250929050565b5f819050919050565b61096381610951565b811461096d575f5ffd5b50565b5f8135905061097e8161095a565b92915050565b5f5f6040838503121561099a576109996108b7565b5b5f6109a7858286016108da565b92505060206109b885828601610970565b9150509250929050565b5f602082840312156109d7576109d66108b7565b5b5f6109e4848285016108da565b91505092915050565b6109f6816108bb565b82525050565b5f602082019050610a0f5f8301846109ed565b92915050565b610a1e81610951565b82525050565b5f602082019050610a375f830184610a15565b92915050565b5f60109050919050565b5f81905092915050565b5f819050919050565b5f60ff82169050919050565b610a6f81610a5a565b82525050565b5f610a808383610a66565b60208301905092915050565b5f602082019050919050565b610aa181610a3d565b610aab8184610a47565b9250610ab682610a51565b805f5b83811015610ae6578151610acd8782610a75565b9650610ad883610a8c565b925050600181019050610ab9565b505050505050565b5f61022082019050610b025f830185610a98565b610b10610200830184610a15565b9392505050565b82818337505050565b610b2c60808383610b17565b5050565b5f610b3b8284610b20565b60808201915081905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b610b8081610951565b82525050565b5f602082019050610b995f830184610b77565b92915050565b5f8115159050919050565b610bb381610b9f565b8114610bbd575f5ffd5b50565b5f81519050610bce81610baa565b92915050565b5f60208284031215610be957610be86108b7565b5b5f610bf684828501610bc0565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f610c3682610951565b9150610c4183610951565b9250828203905081811115610c5957610c58610bff565b5b92915050565b5f819050919050565b610c79610c74826108bb565b610c5f565b82525050565b5f819050919050565b610c99610c9482610951565b610c7f565b82525050565b5f610caa8285610c68565b602082019150610cba8284610c88565b6020820191508190509392505050565b5f606082019050610cdd5f830186610b77565b610cea6020830185610b77565b610cf76040830184610b77565b949350505050565b5f610d0982610951565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610d3b57610d3a610bff565b5b600182019050919050565b5f819050919050565b5f610d69610d64610d5f84610a5a565b610d46565b610951565b9050919050565b610d7981610d4f565b82525050565b5f604082019050610d925f830185610d70565b610d9f6020830184610a15565b9392505050565b610daf81610a5a565b82525050565b5f604082019050610dc85f830185610b77565b610dd56020830184610da6565b9392505050565b610de581610a5a565b8114610def575f5ffd5b50565b5f81519050610e0081610ddc565b92915050565b5f60208284031215610e1b57610e1a6108b7565b5b5f610e2884828501610df2565b9150509291505056fea26469706673582212204407ab850bb713c8f65c96ab9b993b3f15a6884bd6dbedac751a114ffce6420c64736f6c634300081c0033", + "nonce": "0x73", + "chainId": "0x279f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0xb2bbf9", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0x8554f0cf080cbd8c7785e0ad0794bd4762d19fc709856ee89dd743a539f70a49", + "transactionIndex": "0x2f", + "blockHash": "0x4466c9bfaacd7db50fd939b8f0f5af1df1d88aaf2851a96787cc07f64ef37197", + "blockNumber": "0xf4db1a", + "gasUsed": "0x149572", + "effectiveGasPrice": "0xba43b7401", + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "contractAddress": null + }, + { + "status": "0x1", + "cumulativeGasUsed": "0x7eaa8b", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0x7993fa7ab600911367fd2042fdf8c7dfd162c1b02de6256c1271343c244513e2", + "transactionIndex": "0x24", + "blockHash": "0x2f095e1d762c94987e0e53a327ddca24f100c2fe455705dabcc98d3f0cae5851", + "blockNumber": "0xf4db1b", + "gasUsed": "0x10cfd1", + "effectiveGasPrice": "0xba43b7401", + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": null, + "contractAddress": "0x01bccdccdecafe3f357e8df9ae5b9af002939d1c" + } + ], + "libraries": [ + "src/LibBoard.sol:Board:0x8fa02Ad884b2a60f47ccf5850E242e72F5131450" + ], + "pending": [], + "returns": { + "gameContract": { + "internal_type": "address", + "value": "0x01BCCDccDEcAFe3F357e8DF9aE5b9aF002939D1c" + } + }, + "timestamp": 1746797402, + "chain": 10143, + "commit": "80040d4" +} \ No newline at end of file diff --git a/packages/contracts/broadcast/Deploy.s.sol/10143/run-1747028257.json b/packages/contracts/broadcast/Deploy.s.sol/10143/run-1747028257.json new file mode 100644 index 0000000..ff8655e --- /dev/null +++ b/packages/contracts/broadcast/Deploy.s.sol/10143/run-1747028257.json @@ -0,0 +1,87 @@ +{ + "transactions": [ + { + "hash": "0x7ead7b3b3c7cfac064d2445ffb4aeef5936c7b4247c66cbd1edfd878361f6c79", + "transactionType": "CREATE2", + "contractName": "Board", + "contractAddress": "0xa3fd3e8866875524e08fb158a7287c642da53fa8", + "function": null, + "arguments": null, + "transaction": { + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "gas": "0x125701", + "input": "0x000000000000000000000000000000000000000000000000000000000000000060808060405234601957610de6908161001e823930815050f35b5f80fdfe6080806040526004361015610012575f80fd5b5f3560e01c90816301df1995146104c7575080630be27a04146104435780631af4f9701461040f57806324f4ec51146103dc5780632b2f6a121461039657806354c30fd91461032e57806364cd1595146102fa5780637e8dbaf6146101a65780638def51a11461014f578063918a2a65146100fb57639aff28fe14610095575f80fd5b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f75760206100dd6100cc6104f9565b6100d4610518565b60443591610ba6565b6fffffffffffffffffffffffffffffffff60405191168152f35b5f80fd5b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f75761012d6104f9565b610135610518565b9060443560ff811681036100f7576020926100dd92610b36565b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f7576101816104f9565b6024359081151582036100f75760443580151581036100f7576020926100dd92610656565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f75760405160208101906004358252602081526040810181811067ffffffffffffffff8211176102cd57604052519020600f81169060101c60ff600f820616908282101561028c575b906020926fffffffffffffffffffffffffffffffff605a60646100dd95061192835f1461027c5760ff6102636102568260025b61025b610256876105fe565b61060f565b5016936105fe565b161b16911561027457600291610b36565b600191610b36565b60ff61026361025682600161024a565b60ff82146102a05760019190910190610217565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f757602060405160028152f35b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f75760206103626104f9565b60ff80610378610256610373610518565b6105fe565b166fffffffffffffffffffffffffffffffff6040519316901c168152f35b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f75760206103d26103cd6104f9565b610528565b6040519015158152f35b5f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f75760206040515f8152f35b5f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f757602060405160038152f35b60807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f7576104756104f9565b61047d610518565b90604435906fffffffffffffffffffffffffffffffff82168092036100f7576104bd6fffffffffffffffffffffffffffffffff9160209460643591610ba6565b1614604051908152f35b5f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f75780600160209252f35b600435906fffffffffffffffffffffffffffffffff821682036100f757565b6024359060ff821682036100f757565b6ffcfcfcfcfcfcfcfcfcfcfcfcfcfcfcfc8116158015906105dd575b6105d8575f905b6fffffffffffffffffffffffffffffffff811680156105d0577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01906fffffffffffffffffffffffffffffffff82116102a05716907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146102a0576001019061054b565b505060021490565b505f90565b50600181901c81166f7fffffffffffffffffffffffffffffff161515610544565b60ff16600f039060ff82116102a057565b60031b906107f860f88316921682036102a057565b906fffffffffffffffffffffffffffffffff809116911601906fffffffffffffffffffffffffffffffff82116102a057565b5f93928492908115610b28576cff000000ff000000ff000000ff929391935b5f925b6004841061068857505050505050565b90919294966cffffffffffffffffffffffffff838698961616915f93895f14610b1f5760ff60205b16978615610b0a578a15610af2576cffffffffffffffffffffffffff6cff0000000000000000000000005b169a8015610ae4576cff000000ff000000ff000000ff989590955b6fffffffffffffffffffffffffffffffff8d169b8c151580610ac9575b156107bb57915b808b166cffffffffffffffffffffffffff1615158e8161079e575b5015610767576fffffffffffffffffffffffffffffffff80918b5f1461075e57168c1b1661071a565b168c1c1661071a565b96919b976fffffffffffffffffffffffffffffffff919d88161797895f14610796578b1c165b9b9590956106f6565b8b1b1661078d565b6fffffffffffffffffffffffffffffffff9150821616158e610735565b99509a505093959491995096505f90855f14610ac05760ff60205b168515610aab578615610a93576cffffffffffffffffffffffffff6cff0000000000000000000000005b16918715610a7b576cffffffffffffffffffffffffff6cff000000ff000000ff000000ff5b168715610a61576fffffffffffffffffffffffffffffffff84841c165b8815610a48578915610a30576cffffffffffffffffffffffffff6c010000000000000000000000005b908a969392915b16925b6fffffffffffffffffffffffffffffffff858416166108fa57505050505050506108ca6001926fffffffffffffffffffffffffffffffff80809416818d161b161799865f146108f15760ff60085b1690610624565b9685156108e65760ff826008925b1691161c1691019294610678565b60ff826020926108d8565b60ff60206108c3565b8697875f14610a0f5786886fffffffffffffffffffffffffffffffff8080878b1616841b165b166fffffffffffffffffffffffffffffffff858a1616146109bc575b50506fffffffffffffffffffffffffffffffff8080809581808781989782988e16179f5f146109b357168c1c165b9b156109aa5716891c165b958d156109a15716871c165b928b156109985716851c165b918995929192610875565b16851b1661098d565b16871b16610981565b16891b16610975565b168c1b1661096a565b6fffffffffffffffffffffffffffffffff809581808781989c976109f28d84809b9a81809c819c5f14610a065716901b16610624565b9d509750975050509550505050868861093c565b16901c16610624565b86886fffffffffffffffffffffffffffffffff8080878b1616841c16610920565b6cffffffffffffffffffffffffff630100000061086b565b889491906cffffffffffffffffffffffffff6001610872565b6fffffffffffffffffffffffffffffffff84841b16610842565b6cffffffffffffffffffffffffff63ffffffff610825565b6cffffffffffffffffffffffffff63ff000000610800565b6cffffffffffffffffffffffffff60ff610800565b60ff60086107d6565b506fffffffffffffffffffffffffffffffff83161515610713565b63ffffffff989590956106f6565b6cffffffffffffffffffffffffff63ff0000006106db565b6cffffffffffffffffffffffffff60ff6106db565b60ff60086106b0565b63ffffffff92939193610675565b6fffffffffffffffffffffffffffffffff809260ff610b6c61025682858180610b61610256896105fe565b161b169816936105fe565b161b16921916161790565b6fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff81146102a05760010190565b92919060ff81166004811015610d8857600180610bc893161591111585610656565b926fffffffffffffffffffffffffffffffff808516911614610d88575f80806fff0000000000000000000000000000005b6fffffffffffffffffffffffffffffffff8116610cef5750506fffffffffffffffffffffffffffffffff1680158015610c33575b50505050565b5f959293949550610cc2578306927f1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841684036102a057610c9f93605a606460ff9306115f14610ca9576fffffffffffffffffffffffffffffffff6002945b169060031b1c1690610b36565b905f808080610c2d565b6fffffffffffffffffffffffffffffffff600194610c92565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b6fffffffffffffffffffffffffffffffff8188161615610d2e575b6effffffffffffffffffffffffffffff610d289160081c1691610b77565b90610bf9565b92610d3883610b77565b9260031b7007fffffffffffffffffffffffffffffff86ffffffffffffffffffffffffffffffff88216911681036102a0576fffffffffffffffffffffffffffffffff83811690911b161792610d0a565b7f35405e3c000000000000000000000000000000000000000000000000000000005f5260045ffdfea264697066735822122070d2381bf6b7305009885b5d725b8c1ff99d3898b0fb599b437862fde33fd38464736f6c634300081c0033", + "nonce": "0x74", + "chainId": "0x279f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xb4da45a9779ecbe40764ea86e96a0a34df76a9388b1af1cf0a7338cb86c7290a", + "transactionType": "CREATE", + "contractName": "Monad2048", + "contractAddress": "0xe0fa8195ae92b9c473c0c0c12c2d6bcbd245de47", + "function": null, + "arguments": null, + "transaction": { + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "gas": "0xd16d0", + "value": "0x0", + "input": "0x60808060405234601557610b06908161001a8239f35b5f80fdfe6080806040526004361015610012575f80fd5b5f3560e01c90816325c09963146107e35750806361d585da1461077657806379cbd2331461072e5780639a987475146106d3578063ac88036c14610689578063bb9df307146101eb5763e51b891f14610069575f80fd5b3461017d5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261017d576040516102006004356100ab8284610a29565b81368437805f525f60205260405f205460801c905f9173a3fd3e8866875524e08fb158a7287c642da53fa8925b60ff8116601081101561019457604051907f54c30fd90000000000000000000000000000000000000000000000000000000082528360048301526024820152602081604481885af4908115610189575f91610149575b5060ff918260019216611fe08260051b1689015201166100d8565b90506020813d8211610181575b8161016360209383610a29565b8101031261017d575160ff8116810361017d5760ff61012e565b5f80fd5b3d9150610156565b6040513d5f823e3d90fd5b8686855f525f6020526effffffffffffffffffffffffffffff60405f205460081c1660405191825f905b601082106101d25750506102209350820152f35b60208060019260ff8951168152019601910190946101be565b3461017d576101007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261017d576004353660a41161017d57366101041161017d578060601c330361066157805f525f60205260405f205460801c6106395760405160208101905f6024835b60048310610607575050506080815261027360a082610a29565b519020805f52600160205260405f20546105df5773a3fd3e8866875524e08fb158a7287c642da53fa86024356fffffffffffffffffffffffffffffffff81169081810361017d5750604051907f2b2f6a120000000000000000000000000000000000000000000000000000000082526004820152602081602481855af4908115610189575f916105c0575b50156105105760015b600481106104015750505f5260016020528060405f205560e43560ff81169081810361017d5750610336610a94565b60405191610343836109e0565b825260208201600481526fffffffffffffffffffffffffffffffff6040840192168252835f525f6020527fffffffffffffffffffffffffffffffff000000000000000000000000000000006fffffffffffffffffffffffffffffff0060ff60405f20955116925160081b16925160801b1691171790556103c1610a94565b6fffffffffffffffffffffffffffffffff604051911681527f3d6c02e74ba05913874ba8d477497510df840bf93bfa5a2a8d8943766678a0e360203392a3005b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81018181116105935761043c61043782610a82565b610ab3565b9060038110156105665760051b60a4013560ff8116810361017d5760209061046661043785610a82565b926104ef604051848101908a825287604082015260408152610489606082610a29565b51902060405195869485947f0be27a0400000000000000000000000000000000000000000000000000000000865260048601909493926fffffffffffffffffffffffffffffffff9060ff6060948360808601991685521660208401521660408201520152565b0381865af4908115610189575f91610538575b501561051057600101610307565b7f2b977ce3000000000000000000000000000000000000000000000000000000005f5260045ffd5b610559915060203d811161055f575b6105518183610a29565b810190610a6a565b85610502565b503d610547565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b6105d9915060203d60201161055f576105518183610a29565b846102fe565b7f6e3ca805000000000000000000000000000000000000000000000000000000005f5260045ffd5b8135906fffffffffffffffffffffffffffffffff821680920361017d5760208160019382935201920192019190610259565b7f25434c83000000000000000000000000000000000000000000000000000000005f5260045ffd5b7faed8b1cf000000000000000000000000000000000000000000000000000000005f5260045ffd5b3461017d5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261017d576004355f525f602052602060405f205460801c604051908152f35b3461017d5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261017d576004355f525f60205260206effffffffffffffffffffffffffffff60405f205460081c16604051908152f35b3461017d5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261017d576004355f526001602052602060405f2054604051908152f35b3461017d5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261017d576004355f525f602052606060405f20546040519060ff811682526effffffffffffffffffffffffffffff8160081c16602083015260801c6040820152f35b3461017d5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261017d576004359060243560ff81169182820361017d576044356fffffffffffffffffffffffffffffffff81169283820361017d578560601c330361066157602090865f525f825260406108b2815f20610867876109e0565b549560ff871681526effffffffffffffffffffffffffffff8760081c16908581019782895260801c9384910152604051858101918b8352604082015260408152610489606082610a29565b038173a3fd3e8866875524e08fb158a7287c642da53fa85af4908115610189575f916109c1575b5015610510576effffffffffffffffffffffffffffff6001915116016effffffffffffffffffffffffffffff81116105935760405190610918826109e0565b8382526effffffffffffffffffffffffffffff60208301911681526040820190838252855f525f6020527fffffffffffffffffffffffffffffffff000000000000000000000000000000006fffffffffffffffffffffffffffffff0060ff60405f20955116925160081b16925160801b16911717905560405191825260208201527f14fe4197a69dbcc73d79fcfd259bd1f097640dd2c2fe016ff232c416e17ce84260403392a3005b6109da915060203d60201161055f576105518183610a29565b856108d9565b6060810190811067ffffffffffffffff8211176109fc57604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176109fc57604052565b9081602091031261017d5751801515810361017d5790565b60048110156105665760051b60240190565b6084356fffffffffffffffffffffffffffffffff8116810361017d5790565b356fffffffffffffffffffffffffffffffff8116810361017d579056fea2646970667358221220969a7f7c514aa734f294aa96245a7452aa46ed6a1a3ce4c0584d3af116f7bc9264736f6c634300081c0033", + "nonce": "0x75", + "chainId": "0x279f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x738dea", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0x7ead7b3b3c7cfac064d2445ffb4aeef5936c7b4247c66cbd1edfd878361f6c79", + "transactionIndex": "0x1d", + "blockHash": "0x6bd47e8728e72317d73af02f6e77e3da404f771620b34fe265f7b80cb0ec474e", + "blockNumber": "0xfb8abb", + "gasUsed": "0x125701", + "effectiveGasPrice": "0xba43b7401", + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "contractAddress": null + }, + { + "status": "0x1", + "cumulativeGasUsed": "0x8fe6fa", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0xb4da45a9779ecbe40764ea86e96a0a34df76a9388b1af1cf0a7338cb86c7290a", + "transactionIndex": "0x1f", + "blockHash": "0x6bd47e8728e72317d73af02f6e77e3da404f771620b34fe265f7b80cb0ec474e", + "blockNumber": "0xfb8abb", + "gasUsed": "0xd16d0", + "effectiveGasPrice": "0xba43b7401", + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": null, + "contractAddress": "0xe0fa8195ae92b9c473c0c0c12c2d6bcbd245de47" + } + ], + "libraries": [ + "src/LibBoard.sol:Board:0xa3Fd3e8866875524E08FB158A7287c642dA53fA8" + ], + "pending": [], + "returns": { + "gameContract": { + "internal_type": "address", + "value": "0xe0FA8195AE92b9C473c0c0c12c2D6bCbd245De47" + } + }, + "timestamp": 1747028257, + "chain": 10143, + "commit": "d3c1d31" +} \ No newline at end of file diff --git a/packages/contracts/broadcast/Deploy.s.sol/10143/run-latest.json b/packages/contracts/broadcast/Deploy.s.sol/10143/run-latest.json new file mode 100644 index 0000000..ff8655e --- /dev/null +++ b/packages/contracts/broadcast/Deploy.s.sol/10143/run-latest.json @@ -0,0 +1,87 @@ +{ + "transactions": [ + { + "hash": "0x7ead7b3b3c7cfac064d2445ffb4aeef5936c7b4247c66cbd1edfd878361f6c79", + "transactionType": "CREATE2", + "contractName": "Board", + "contractAddress": "0xa3fd3e8866875524e08fb158a7287c642da53fa8", + "function": null, + "arguments": null, + "transaction": { + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "gas": "0x125701", + "input": "0x000000000000000000000000000000000000000000000000000000000000000060808060405234601957610de6908161001e823930815050f35b5f80fdfe6080806040526004361015610012575f80fd5b5f3560e01c90816301df1995146104c7575080630be27a04146104435780631af4f9701461040f57806324f4ec51146103dc5780632b2f6a121461039657806354c30fd91461032e57806364cd1595146102fa5780637e8dbaf6146101a65780638def51a11461014f578063918a2a65146100fb57639aff28fe14610095575f80fd5b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f75760206100dd6100cc6104f9565b6100d4610518565b60443591610ba6565b6fffffffffffffffffffffffffffffffff60405191168152f35b5f80fd5b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f75761012d6104f9565b610135610518565b9060443560ff811681036100f7576020926100dd92610b36565b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f7576101816104f9565b6024359081151582036100f75760443580151581036100f7576020926100dd92610656565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f75760405160208101906004358252602081526040810181811067ffffffffffffffff8211176102cd57604052519020600f81169060101c60ff600f820616908282101561028c575b906020926fffffffffffffffffffffffffffffffff605a60646100dd95061192835f1461027c5760ff6102636102568260025b61025b610256876105fe565b61060f565b5016936105fe565b161b16911561027457600291610b36565b600191610b36565b60ff61026361025682600161024a565b60ff82146102a05760019190910190610217565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b5f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f757602060405160028152f35b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f75760206103626104f9565b60ff80610378610256610373610518565b6105fe565b166fffffffffffffffffffffffffffffffff6040519316901c168152f35b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f75760206103d26103cd6104f9565b610528565b6040519015158152f35b5f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f75760206040515f8152f35b5f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f757602060405160038152f35b60807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f7576104756104f9565b61047d610518565b90604435906fffffffffffffffffffffffffffffffff82168092036100f7576104bd6fffffffffffffffffffffffffffffffff9160209460643591610ba6565b1614604051908152f35b5f7ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100f75780600160209252f35b600435906fffffffffffffffffffffffffffffffff821682036100f757565b6024359060ff821682036100f757565b6ffcfcfcfcfcfcfcfcfcfcfcfcfcfcfcfc8116158015906105dd575b6105d8575f905b6fffffffffffffffffffffffffffffffff811680156105d0577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01906fffffffffffffffffffffffffffffffff82116102a05716907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146102a0576001019061054b565b505060021490565b505f90565b50600181901c81166f7fffffffffffffffffffffffffffffff161515610544565b60ff16600f039060ff82116102a057565b60031b906107f860f88316921682036102a057565b906fffffffffffffffffffffffffffffffff809116911601906fffffffffffffffffffffffffffffffff82116102a057565b5f93928492908115610b28576cff000000ff000000ff000000ff929391935b5f925b6004841061068857505050505050565b90919294966cffffffffffffffffffffffffff838698961616915f93895f14610b1f5760ff60205b16978615610b0a578a15610af2576cffffffffffffffffffffffffff6cff0000000000000000000000005b169a8015610ae4576cff000000ff000000ff000000ff989590955b6fffffffffffffffffffffffffffffffff8d169b8c151580610ac9575b156107bb57915b808b166cffffffffffffffffffffffffff1615158e8161079e575b5015610767576fffffffffffffffffffffffffffffffff80918b5f1461075e57168c1b1661071a565b168c1c1661071a565b96919b976fffffffffffffffffffffffffffffffff919d88161797895f14610796578b1c165b9b9590956106f6565b8b1b1661078d565b6fffffffffffffffffffffffffffffffff9150821616158e610735565b99509a505093959491995096505f90855f14610ac05760ff60205b168515610aab578615610a93576cffffffffffffffffffffffffff6cff0000000000000000000000005b16918715610a7b576cffffffffffffffffffffffffff6cff000000ff000000ff000000ff5b168715610a61576fffffffffffffffffffffffffffffffff84841c165b8815610a48578915610a30576cffffffffffffffffffffffffff6c010000000000000000000000005b908a969392915b16925b6fffffffffffffffffffffffffffffffff858416166108fa57505050505050506108ca6001926fffffffffffffffffffffffffffffffff80809416818d161b161799865f146108f15760ff60085b1690610624565b9685156108e65760ff826008925b1691161c1691019294610678565b60ff826020926108d8565b60ff60206108c3565b8697875f14610a0f5786886fffffffffffffffffffffffffffffffff8080878b1616841b165b166fffffffffffffffffffffffffffffffff858a1616146109bc575b50506fffffffffffffffffffffffffffffffff8080809581808781989782988e16179f5f146109b357168c1c165b9b156109aa5716891c165b958d156109a15716871c165b928b156109985716851c165b918995929192610875565b16851b1661098d565b16871b16610981565b16891b16610975565b168c1b1661096a565b6fffffffffffffffffffffffffffffffff809581808781989c976109f28d84809b9a81809c819c5f14610a065716901b16610624565b9d509750975050509550505050868861093c565b16901c16610624565b86886fffffffffffffffffffffffffffffffff8080878b1616841c16610920565b6cffffffffffffffffffffffffff630100000061086b565b889491906cffffffffffffffffffffffffff6001610872565b6fffffffffffffffffffffffffffffffff84841b16610842565b6cffffffffffffffffffffffffff63ffffffff610825565b6cffffffffffffffffffffffffff63ff000000610800565b6cffffffffffffffffffffffffff60ff610800565b60ff60086107d6565b506fffffffffffffffffffffffffffffffff83161515610713565b63ffffffff989590956106f6565b6cffffffffffffffffffffffffff63ff0000006106db565b6cffffffffffffffffffffffffff60ff6106db565b60ff60086106b0565b63ffffffff92939193610675565b6fffffffffffffffffffffffffffffffff809260ff610b6c61025682858180610b61610256896105fe565b161b169816936105fe565b161b16921916161790565b6fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff81146102a05760010190565b92919060ff81166004811015610d8857600180610bc893161591111585610656565b926fffffffffffffffffffffffffffffffff808516911614610d88575f80806fff0000000000000000000000000000005b6fffffffffffffffffffffffffffffffff8116610cef5750506fffffffffffffffffffffffffffffffff1680158015610c33575b50505050565b5f959293949550610cc2578306927f1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841684036102a057610c9f93605a606460ff9306115f14610ca9576fffffffffffffffffffffffffffffffff6002945b169060031b1c1690610b36565b905f808080610c2d565b6fffffffffffffffffffffffffffffffff600194610c92565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b6fffffffffffffffffffffffffffffffff8188161615610d2e575b6effffffffffffffffffffffffffffff610d289160081c1691610b77565b90610bf9565b92610d3883610b77565b9260031b7007fffffffffffffffffffffffffffffff86ffffffffffffffffffffffffffffffff88216911681036102a0576fffffffffffffffffffffffffffffffff83811690911b161792610d0a565b7f35405e3c000000000000000000000000000000000000000000000000000000005f5260045ffdfea264697066735822122070d2381bf6b7305009885b5d725b8c1ff99d3898b0fb599b437862fde33fd38464736f6c634300081c0033", + "nonce": "0x74", + "chainId": "0x279f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xb4da45a9779ecbe40764ea86e96a0a34df76a9388b1af1cf0a7338cb86c7290a", + "transactionType": "CREATE", + "contractName": "Monad2048", + "contractAddress": "0xe0fa8195ae92b9c473c0c0c12c2d6bcbd245de47", + "function": null, + "arguments": null, + "transaction": { + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "gas": "0xd16d0", + "value": "0x0", + "input": "0x60808060405234601557610b06908161001a8239f35b5f80fdfe6080806040526004361015610012575f80fd5b5f3560e01c90816325c09963146107e35750806361d585da1461077657806379cbd2331461072e5780639a987475146106d3578063ac88036c14610689578063bb9df307146101eb5763e51b891f14610069575f80fd5b3461017d5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261017d576040516102006004356100ab8284610a29565b81368437805f525f60205260405f205460801c905f9173a3fd3e8866875524e08fb158a7287c642da53fa8925b60ff8116601081101561019457604051907f54c30fd90000000000000000000000000000000000000000000000000000000082528360048301526024820152602081604481885af4908115610189575f91610149575b5060ff918260019216611fe08260051b1689015201166100d8565b90506020813d8211610181575b8161016360209383610a29565b8101031261017d575160ff8116810361017d5760ff61012e565b5f80fd5b3d9150610156565b6040513d5f823e3d90fd5b8686855f525f6020526effffffffffffffffffffffffffffff60405f205460081c1660405191825f905b601082106101d25750506102209350820152f35b60208060019260ff8951168152019601910190946101be565b3461017d576101007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261017d576004353660a41161017d57366101041161017d578060601c330361066157805f525f60205260405f205460801c6106395760405160208101905f6024835b60048310610607575050506080815261027360a082610a29565b519020805f52600160205260405f20546105df5773a3fd3e8866875524e08fb158a7287c642da53fa86024356fffffffffffffffffffffffffffffffff81169081810361017d5750604051907f2b2f6a120000000000000000000000000000000000000000000000000000000082526004820152602081602481855af4908115610189575f916105c0575b50156105105760015b600481106104015750505f5260016020528060405f205560e43560ff81169081810361017d5750610336610a94565b60405191610343836109e0565b825260208201600481526fffffffffffffffffffffffffffffffff6040840192168252835f525f6020527fffffffffffffffffffffffffffffffff000000000000000000000000000000006fffffffffffffffffffffffffffffff0060ff60405f20955116925160081b16925160801b1691171790556103c1610a94565b6fffffffffffffffffffffffffffffffff604051911681527f3d6c02e74ba05913874ba8d477497510df840bf93bfa5a2a8d8943766678a0e360203392a3005b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81018181116105935761043c61043782610a82565b610ab3565b9060038110156105665760051b60a4013560ff8116810361017d5760209061046661043785610a82565b926104ef604051848101908a825287604082015260408152610489606082610a29565b51902060405195869485947f0be27a0400000000000000000000000000000000000000000000000000000000865260048601909493926fffffffffffffffffffffffffffffffff9060ff6060948360808601991685521660208401521660408201520152565b0381865af4908115610189575f91610538575b501561051057600101610307565b7f2b977ce3000000000000000000000000000000000000000000000000000000005f5260045ffd5b610559915060203d811161055f575b6105518183610a29565b810190610a6a565b85610502565b503d610547565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b6105d9915060203d60201161055f576105518183610a29565b846102fe565b7f6e3ca805000000000000000000000000000000000000000000000000000000005f5260045ffd5b8135906fffffffffffffffffffffffffffffffff821680920361017d5760208160019382935201920192019190610259565b7f25434c83000000000000000000000000000000000000000000000000000000005f5260045ffd5b7faed8b1cf000000000000000000000000000000000000000000000000000000005f5260045ffd5b3461017d5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261017d576004355f525f602052602060405f205460801c604051908152f35b3461017d5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261017d576004355f525f60205260206effffffffffffffffffffffffffffff60405f205460081c16604051908152f35b3461017d5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261017d576004355f526001602052602060405f2054604051908152f35b3461017d5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261017d576004355f525f602052606060405f20546040519060ff811682526effffffffffffffffffffffffffffff8160081c16602083015260801c6040820152f35b3461017d5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc36011261017d576004359060243560ff81169182820361017d576044356fffffffffffffffffffffffffffffffff81169283820361017d578560601c330361066157602090865f525f825260406108b2815f20610867876109e0565b549560ff871681526effffffffffffffffffffffffffffff8760081c16908581019782895260801c9384910152604051858101918b8352604082015260408152610489606082610a29565b038173a3fd3e8866875524e08fb158a7287c642da53fa85af4908115610189575f916109c1575b5015610510576effffffffffffffffffffffffffffff6001915116016effffffffffffffffffffffffffffff81116105935760405190610918826109e0565b8382526effffffffffffffffffffffffffffff60208301911681526040820190838252855f525f6020527fffffffffffffffffffffffffffffffff000000000000000000000000000000006fffffffffffffffffffffffffffffff0060ff60405f20955116925160081b16925160801b16911717905560405191825260208201527f14fe4197a69dbcc73d79fcfd259bd1f097640dd2c2fe016ff232c416e17ce84260403392a3005b6109da915060203d60201161055f576105518183610a29565b856108d9565b6060810190811067ffffffffffffffff8211176109fc57604052565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff8211176109fc57604052565b9081602091031261017d5751801515810361017d5790565b60048110156105665760051b60240190565b6084356fffffffffffffffffffffffffffffffff8116810361017d5790565b356fffffffffffffffffffffffffffffffff8116810361017d579056fea2646970667358221220969a7f7c514aa734f294aa96245a7452aa46ed6a1a3ce4c0584d3af116f7bc9264736f6c634300081c0033", + "nonce": "0x75", + "chainId": "0x279f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x738dea", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0x7ead7b3b3c7cfac064d2445ffb4aeef5936c7b4247c66cbd1edfd878361f6c79", + "transactionIndex": "0x1d", + "blockHash": "0x6bd47e8728e72317d73af02f6e77e3da404f771620b34fe265f7b80cb0ec474e", + "blockNumber": "0xfb8abb", + "gasUsed": "0x125701", + "effectiveGasPrice": "0xba43b7401", + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "contractAddress": null + }, + { + "status": "0x1", + "cumulativeGasUsed": "0x8fe6fa", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0xb4da45a9779ecbe40764ea86e96a0a34df76a9388b1af1cf0a7338cb86c7290a", + "transactionIndex": "0x1f", + "blockHash": "0x6bd47e8728e72317d73af02f6e77e3da404f771620b34fe265f7b80cb0ec474e", + "blockNumber": "0xfb8abb", + "gasUsed": "0xd16d0", + "effectiveGasPrice": "0xba43b7401", + "from": "0x234828a40de63d21072d1218cfb5d208654c12bb", + "to": null, + "contractAddress": "0xe0fa8195ae92b9c473c0c0c12c2d6bcbd245de47" + } + ], + "libraries": [ + "src/LibBoard.sol:Board:0xa3Fd3e8866875524E08FB158A7287c642dA53fA8" + ], + "pending": [], + "returns": { + "gameContract": { + "internal_type": "address", + "value": "0xe0FA8195AE92b9C473c0c0c12c2D6bCbd245De47" + } + }, + "timestamp": 1747028257, + "chain": 10143, + "commit": "d3c1d31" +} \ No newline at end of file diff --git a/packages/contracts/broadcast/Deploy.s.sol/143/run-1769605008553.json b/packages/contracts/broadcast/Deploy.s.sol/143/run-1769605008553.json new file mode 100644 index 0000000..872ef00 --- /dev/null +++ b/packages/contracts/broadcast/Deploy.s.sol/143/run-1769605008553.json @@ -0,0 +1,87 @@ +{ + "transactions": [ + { + "hash": "0x7846172decf613bc039de94c6ca646bdfe4f5e2816f8264458bbed26cdaa5237", + "transactionType": "CREATE2", + "contractName": "Board", + "contractAddress": "0x140fd93a53218f93ec8b0ecbfb05db73cf5c10d3", + "function": null, + "arguments": null, + "transaction": { + "from": "0xcbc2d8fe511e38f99512bd41b06698628aa8e267", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "gas": "0x1176a1", + "input": "0x000000000000000000000000000000000000000000000000000000000000000060808060405234601957610e08908161001f823930815050f35b600080fdfe608080604052600436101561001357600080fd5b60003560e01c90816301df1995146104d4575080630be27a04146104505780631af4f9701461041b57806324f4ec51146103e65780632b2f6a12146103a057806354c30fd91461033857806364cd1595146103035780637e8dbaf6146101aa5780638def51a114610153578063918a2a65146100ff57639aff28fe1461009857600080fd5b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa5760206100e06100cf610507565b6100d7610526565b60443591610bc2565b6fffffffffffffffffffffffffffffffff60405191168152f35b600080fd5b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa57610131610507565b610139610526565b9060443560ff811681036100fa576020926100e092610b52565b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa57610185610507565b6024359081151582036100fa5760443580151581036100fa576020926100e092610666565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa5760405160208101906004358252602081526040810181811067ffffffffffffffff8211176102d457604052519020600f81169060101c60ff600f8206169082821015610291575b906020926fffffffffffffffffffffffffffffffff605a60646100e095061192836000146102815760ff61026861025b8260025b61026061025b8761060e565b61061f565b50169361060e565b161b16911561027957600291610b52565b600191610b52565b60ff61026861025b82600161024f565b60ff82146102a5576001919091019061021b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa57602060405160028152f35b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa57602061036c610507565b60ff8061038261025b61037d610526565b61060e565b166fffffffffffffffffffffffffffffffff6040519316901c168152f35b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa5760206103dc6103d7610507565b610536565b6040519015158152f35b60007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa57602060405160008152f35b60007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa57602060405160038152f35b60807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa57610482610507565b61048a610526565b90604435906fffffffffffffffffffffffffffffffff82168092036100fa576104ca6fffffffffffffffffffffffffffffffff9160209460643591610bc2565b1614604051908152f35b60007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa5780600160209252f35b600435906fffffffffffffffffffffffffffffffff821682036100fa57565b6024359060ff821682036100fa57565b6ffcfcfcfcfcfcfcfcfcfcfcfcfcfcfcfc8116158015906105ed575b6105e7576000905b6fffffffffffffffffffffffffffffffff811680156105df577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01906fffffffffffffffffffffffffffffffff82116102a55716907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146102a5576001019061055a565b505060021490565b50600090565b50600181901c81166f7fffffffffffffffffffffffffffffff161515610552565b60ff16600f039060ff82116102a557565b60031b906107f860f88316921682036102a557565b906fffffffffffffffffffffffffffffffff809116911601906fffffffffffffffffffffffffffffffff82116102a557565b600093928492908115610b44576cff000000ff000000ff000000ff929391935b6000925b6004841061069a57505050505050565b90919294966cffffffffffffffffffffffffff8386989616169160009389600014610b3b5760ff60205b16978615610b26578a15610b0e576cffffffffffffffffffffffffff6cff0000000000000000000000005b169a8015610b00576cff000000ff000000ff000000ff989590955b6fffffffffffffffffffffffffffffffff8d169b8c151580610ae5575b156107d157915b808b166cffffffffffffffffffffffffff1615158e816107b4575b501561077c576fffffffffffffffffffffffffffffffff80918b60001461077357168c1b1661072e565b168c1c1661072e565b96919b976fffffffffffffffffffffffffffffffff919d88161797896000146107ac578b1c165b9b95909561070a565b8b1b166107a3565b6fffffffffffffffffffffffffffffffff9150821616158e610749565b99509a5050939594919950965060009085600014610adc5760ff60205b168515610ac7578615610aaf576cffffffffffffffffffffffffff6cff0000000000000000000000005b16918715610a97576cffffffffffffffffffffffffff6cff000000ff000000ff000000ff5b168715610a7d576fffffffffffffffffffffffffffffffff84841c165b8815610a64578915610a4c576cffffffffffffffffffffffffff6c010000000000000000000000005b908a969392915b16925b6fffffffffffffffffffffffffffffffff8584161661091357505050505050506108e36001926fffffffffffffffffffffffffffffffff80809416818d161b1617998660001461090a5760ff60085b1690610634565b9685156108ff5760ff826008925b1691161c169101929461068a565b60ff826020926108f1565b60ff60206108dc565b869787600014610a2b5786886fffffffffffffffffffffffffffffffff8080878b1616841b165b166fffffffffffffffffffffffffffffffff858a1616146109d7575b50506fffffffffffffffffffffffffffffffff8080809581808781989782988e16179f6000146109ce57168c1c165b9b156109c55716891c165b958d156109bc5716871c165b928b156109b35716851c165b91899592919261088d565b16851b166109a8565b16871b1661099c565b16891b16610990565b168c1b16610985565b6fffffffffffffffffffffffffffffffff809581808781989c97610a0e8d84809b9a81809c819c600014610a225716901b16610634565b9d5097509750505095505050508688610956565b16901c16610634565b86886fffffffffffffffffffffffffffffffff8080878b1616841c1661093a565b6cffffffffffffffffffffffffff6301000000610883565b889491906cffffffffffffffffffffffffff600161088a565b6fffffffffffffffffffffffffffffffff84841b1661085a565b6cffffffffffffffffffffffffff63ffffffff61083d565b6cffffffffffffffffffffffffff63ff000000610818565b6cffffffffffffffffffffffffff60ff610818565b60ff60086107ee565b506fffffffffffffffffffffffffffffffff83161515610727565b63ffffffff9895909561070a565b6cffffffffffffffffffffffffff63ff0000006106ef565b6cffffffffffffffffffffffffff60ff6106ef565b60ff60086106c4565b63ffffffff92939193610686565b6fffffffffffffffffffffffffffffffff809260ff610b8861025b82858180610b7d61025b8961060e565b161b1698169361060e565b161b16921916161790565b6fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff81146102a55760010190565b92919060ff81166004811015610da857600180610be493161591111585610666565b926fffffffffffffffffffffffffffffffff808516911614610da857600080806fff0000000000000000000000000000005b6fffffffffffffffffffffffffffffffff8116610d0f5750506fffffffffffffffffffffffffffffffff1680158015610c50575b50505050565b6000959293949590610ce257508306927f1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841684036102a557610cbf93605a606460ff930611600014610cc9576fffffffffffffffffffffffffffffffff6002945b169060031b1c1690610b52565b9038808080610c4a565b6fffffffffffffffffffffffffffffffff600194610cb2565b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526012600452fd5b6fffffffffffffffffffffffffffffffff8188161615610d4e575b6effffffffffffffffffffffffffffff610d489160081c1691610b93565b90610c16565b92610d5883610b93565b9260031b7007fffffffffffffffffffffffffffffff86ffffffffffffffffffffffffffffffff88216911681036102a5576fffffffffffffffffffffffffffffffff83811690911b161792610d2a565b7f35405e3c0000000000000000000000000000000000000000000000000000000060005260046000fdfea264697066735822122051cde6e8ba62922ad92fd11aa9d1b1fd8a44b62804e0348088bde5c42fc0e6e464736f6c634300081c0033", + "nonce": "0x12", + "chainId": "0x8f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xb214424e5e6649d5a9f2e82f0d7ffa3567bf18a5a405491e0cffc33eb7695118", + "transactionType": "CREATE", + "contractName": "Monad2048", + "contractAddress": "0x53748668642735cda45935716525e7dfbc8aaacc", + "function": null, + "arguments": null, + "transaction": { + "from": "0xcbc2d8fe511e38f99512bd41b06698628aa8e267", + "gas": "0xdc875", + "value": "0x0", + "input": "0x60808060405234601557610baf908161001b8239f35b600080fdfe608080604052600436101561001357600080fd5b60003560e01c90816325c09963146108545750806361d585da146107e457806379cbd2331461079a5780639a9874751461073c578063ac88036c146106ef578063bb9df307146102015763e51b891f1461006c57600080fd5b346101fc5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101fc57604051610200906004356100af8383610aa3565b8236833780600052600060205260406000205460801c9060009173140fd93a53218f93ec8b0ecbfb05db73cf5c10d3925b60ff811660108110156101a157604051907f54c30fd90000000000000000000000000000000000000000000000000000000082528360048301526024820152602081604481885af490811561019557600091610152575b5060ff918260019216611fe08260051b1688015201166100e0565b6020813d821161018d575b8161016a60209383610aa3565b8101031261018957519060ff82168203610186575060ff610137565b80fd5b5080fd5b3d915061015d565b6040513d6000823e3d90fd5b85878560005260006020526effffffffffffffffffffffffffffff60406000205460081c1660405191826000905b601082106101e35750506102209350820152f35b60208060019260ff8951168152019601910190946101cf565b600080fd5b346101fc576101007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101fc576004353660a4116101fc5736610104116101fc578060601c33036106c55780600052600060205260406000205460801c61069b57604051602081019060006024835b60048310610669575050506080815261028d60a082610aa3565b51902080600052600160205260406000205461063f5773140fd93a53218f93ec8b0ecbfb05db73cf5c10d36024356fffffffffffffffffffffffffffffffff8116908181036101fc5750604051907f2b2f6a120000000000000000000000000000000000000000000000000000000082526004820152602081602481855af490811561019557600091610620575b50156105f65760015b6004811061042357505060005260016020528060406000205560e43560ff8116908181036101fc5750610355610b3d565b6040519161036283610a58565b825260208201600481526fffffffffffffffffffffffffffffffff60408401921682528360005260006020527fffffffffffffffffffffffffffffffff000000000000000000000000000000006fffffffffffffffffffffffffffffff0060ff6040600020955116925160081b16925160801b1691171790556103e3610b3d565b6fffffffffffffffffffffffffffffffff604051911681527f3d6c02e74ba05913874ba8d477497510df840bf93bfa5a2a8d8943766678a0e360203392a3005b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81018181116105c75761045e61045982610afc565b610b5c565b600091600381101561059a5760051b60a4013560ff811681036105965760209061048a61045986610afc565b92610513604051848101908b8252886040820152604081526104ad606082610aa3565b51902060405195869485947f0be27a0400000000000000000000000000000000000000000000000000000000865260048601909493926fffffffffffffffffffffffffffffffff9060ff6060948360808601991685521660208401521660408201520152565b0381875af490811561058b57829161055d575b50156105355750600101610324565b807f2b977ce30000000000000000000000000000000000000000000000000000000060049252fd5b61057e915060203d8111610584575b6105768183610aa3565b810190610ae4565b86610526565b503d61056c565b6040513d84823e3d90fd5b8280fd5b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f2b977ce30000000000000000000000000000000000000000000000000000000060005260046000fd5b610639915060203d602011610584576105768183610aa3565b8461031b565b7f6e3ca8050000000000000000000000000000000000000000000000000000000060005260046000fd5b8135906fffffffffffffffffffffffffffffffff82168092036101fc5760208160019382935201920192019190610273565b7f25434c830000000000000000000000000000000000000000000000000000000060005260046000fd5b7faed8b1cf0000000000000000000000000000000000000000000000000000000060005260046000fd5b346101fc5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101fc576004356000526000602052602060406000205460801c604051908152f35b346101fc5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101fc57600435600052600060205260206effffffffffffffffffffffffffffff60406000205460081c16604051908152f35b346101fc5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101fc5760043560005260016020526020604060002054604051908152f35b346101fc5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101fc57600435600052600060205260606040600020546040519060ff811682526effffffffffffffffffffffffffffff8160081c16602083015260801c6040820152f35b346101fc5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101fc576004359060243560ff8116918282036101fc576044356fffffffffffffffffffffffffffffffff8116928382036101fc578560601c33036106c55760209086600052600082526040610926816000206108db87610a58565b549560ff871681526effffffffffffffffffffffffffffff8760081c16908581019782895260801c9384910152604051858101918b83526040820152604081526104ad606082610aa3565b038173140fd93a53218f93ec8b0ecbfb05db73cf5c10d35af490811561019557600091610a39575b50156105f6576effffffffffffffffffffffffffffff6001915116016effffffffffffffffffffffffffffff81116105c7576040519061098d82610a58565b8382526effffffffffffffffffffffffffffff602083019116815260408201908382528560005260006020527fffffffffffffffffffffffffffffffff000000000000000000000000000000006fffffffffffffffffffffffffffffff0060ff6040600020955116925160081b16925160801b16911717905560405191825260208201527f14fe4197a69dbcc73d79fcfd259bd1f097640dd2c2fe016ff232c416e17ce84260403392a3005b610a52915060203d602011610584576105768183610aa3565b8561094e565b6060810190811067ffffffffffffffff821117610a7457604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117610a7457604052565b908160209103126101fc575180151581036101fc5790565b6004811015610b0e5760051b60240190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6084356fffffffffffffffffffffffffffffffff811681036101fc5790565b356fffffffffffffffffffffffffffffffff811681036101fc579056fea264697066735822122072394165c674c3a78888db5a18fb970ca6b082cc30bbea93c0e25ba9f71a062f64736f6c634300081c0033", + "nonce": "0x13", + "chainId": "0x8f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x15d38a", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0x7846172decf613bc039de94c6ca646bdfe4f5e2816f8264458bbed26cdaa5237", + "transactionIndex": "0x2", + "blockHash": "0x34305062ffc35ee4978cd23d87435aae58b59408ca27771395a3610d8d1eabcb", + "blockNumber": "0x3147450", + "gasUsed": "0x1176a1", + "effectiveGasPrice": "0x18904a3f00", + "from": "0xcbc2d8fe511e38f99512bd41b06698628aa8e267", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "contractAddress": null + }, + { + "status": "0x1", + "cumulativeGasUsed": "0x239bff", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0xb214424e5e6649d5a9f2e82f0d7ffa3567bf18a5a405491e0cffc33eb7695118", + "transactionIndex": "0x3", + "blockHash": "0x34305062ffc35ee4978cd23d87435aae58b59408ca27771395a3610d8d1eabcb", + "blockNumber": "0x3147450", + "gasUsed": "0xdc875", + "effectiveGasPrice": "0x18904a3f00", + "from": "0xcbc2d8fe511e38f99512bd41b06698628aa8e267", + "to": null, + "contractAddress": "0x53748668642735cda45935716525e7dfbc8aaacc" + } + ], + "libraries": [ + "src/LibBoard.sol:Board:0x140fD93a53218F93Ec8b0ECbFB05db73cf5C10D3" + ], + "pending": [], + "returns": { + "gameContract": { + "internal_type": "address", + "value": "0x53748668642735CDa45935716525E7DFbC8aAACC" + } + }, + "timestamp": 1769605008553, + "chain": 143, + "commit": "11f3680" +} \ No newline at end of file diff --git a/packages/contracts/broadcast/Deploy.s.sol/143/run-latest.json b/packages/contracts/broadcast/Deploy.s.sol/143/run-latest.json new file mode 100644 index 0000000..872ef00 --- /dev/null +++ b/packages/contracts/broadcast/Deploy.s.sol/143/run-latest.json @@ -0,0 +1,87 @@ +{ + "transactions": [ + { + "hash": "0x7846172decf613bc039de94c6ca646bdfe4f5e2816f8264458bbed26cdaa5237", + "transactionType": "CREATE2", + "contractName": "Board", + "contractAddress": "0x140fd93a53218f93ec8b0ecbfb05db73cf5c10d3", + "function": null, + "arguments": null, + "transaction": { + "from": "0xcbc2d8fe511e38f99512bd41b06698628aa8e267", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "gas": "0x1176a1", + "input": "0x000000000000000000000000000000000000000000000000000000000000000060808060405234601957610e08908161001f823930815050f35b600080fdfe608080604052600436101561001357600080fd5b60003560e01c90816301df1995146104d4575080630be27a04146104505780631af4f9701461041b57806324f4ec51146103e65780632b2f6a12146103a057806354c30fd91461033857806364cd1595146103035780637e8dbaf6146101aa5780638def51a114610153578063918a2a65146100ff57639aff28fe1461009857600080fd5b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa5760206100e06100cf610507565b6100d7610526565b60443591610bc2565b6fffffffffffffffffffffffffffffffff60405191168152f35b600080fd5b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa57610131610507565b610139610526565b9060443560ff811681036100fa576020926100e092610b52565b60607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa57610185610507565b6024359081151582036100fa5760443580151581036100fa576020926100e092610666565b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa5760405160208101906004358252602081526040810181811067ffffffffffffffff8211176102d457604052519020600f81169060101c60ff600f8206169082821015610291575b906020926fffffffffffffffffffffffffffffffff605a60646100e095061192836000146102815760ff61026861025b8260025b61026061025b8761060e565b61061f565b50169361060e565b161b16911561027957600291610b52565b600191610b52565b60ff61026861025b82600161024f565b60ff82146102a5576001919091019061021b565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa57602060405160028152f35b60407ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa57602061036c610507565b60ff8061038261025b61037d610526565b61060e565b166fffffffffffffffffffffffffffffffff6040519316901c168152f35b60207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa5760206103dc6103d7610507565b610536565b6040519015158152f35b60007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa57602060405160008152f35b60007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa57602060405160038152f35b60807ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa57610482610507565b61048a610526565b90604435906fffffffffffffffffffffffffffffffff82168092036100fa576104ca6fffffffffffffffffffffffffffffffff9160209460643591610bc2565b1614604051908152f35b60007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126100fa5780600160209252f35b600435906fffffffffffffffffffffffffffffffff821682036100fa57565b6024359060ff821682036100fa57565b6ffcfcfcfcfcfcfcfcfcfcfcfcfcfcfcfc8116158015906105ed575b6105e7576000905b6fffffffffffffffffffffffffffffffff811680156105df577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01906fffffffffffffffffffffffffffffffff82116102a55716907fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146102a5576001019061055a565b505060021490565b50600090565b50600181901c81166f7fffffffffffffffffffffffffffffff161515610552565b60ff16600f039060ff82116102a557565b60031b906107f860f88316921682036102a557565b906fffffffffffffffffffffffffffffffff809116911601906fffffffffffffffffffffffffffffffff82116102a557565b600093928492908115610b44576cff000000ff000000ff000000ff929391935b6000925b6004841061069a57505050505050565b90919294966cffffffffffffffffffffffffff8386989616169160009389600014610b3b5760ff60205b16978615610b26578a15610b0e576cffffffffffffffffffffffffff6cff0000000000000000000000005b169a8015610b00576cff000000ff000000ff000000ff989590955b6fffffffffffffffffffffffffffffffff8d169b8c151580610ae5575b156107d157915b808b166cffffffffffffffffffffffffff1615158e816107b4575b501561077c576fffffffffffffffffffffffffffffffff80918b60001461077357168c1b1661072e565b168c1c1661072e565b96919b976fffffffffffffffffffffffffffffffff919d88161797896000146107ac578b1c165b9b95909561070a565b8b1b166107a3565b6fffffffffffffffffffffffffffffffff9150821616158e610749565b99509a5050939594919950965060009085600014610adc5760ff60205b168515610ac7578615610aaf576cffffffffffffffffffffffffff6cff0000000000000000000000005b16918715610a97576cffffffffffffffffffffffffff6cff000000ff000000ff000000ff5b168715610a7d576fffffffffffffffffffffffffffffffff84841c165b8815610a64578915610a4c576cffffffffffffffffffffffffff6c010000000000000000000000005b908a969392915b16925b6fffffffffffffffffffffffffffffffff8584161661091357505050505050506108e36001926fffffffffffffffffffffffffffffffff80809416818d161b1617998660001461090a5760ff60085b1690610634565b9685156108ff5760ff826008925b1691161c169101929461068a565b60ff826020926108f1565b60ff60206108dc565b869787600014610a2b5786886fffffffffffffffffffffffffffffffff8080878b1616841b165b166fffffffffffffffffffffffffffffffff858a1616146109d7575b50506fffffffffffffffffffffffffffffffff8080809581808781989782988e16179f6000146109ce57168c1c165b9b156109c55716891c165b958d156109bc5716871c165b928b156109b35716851c165b91899592919261088d565b16851b166109a8565b16871b1661099c565b16891b16610990565b168c1b16610985565b6fffffffffffffffffffffffffffffffff809581808781989c97610a0e8d84809b9a81809c819c600014610a225716901b16610634565b9d5097509750505095505050508688610956565b16901c16610634565b86886fffffffffffffffffffffffffffffffff8080878b1616841c1661093a565b6cffffffffffffffffffffffffff6301000000610883565b889491906cffffffffffffffffffffffffff600161088a565b6fffffffffffffffffffffffffffffffff84841b1661085a565b6cffffffffffffffffffffffffff63ffffffff61083d565b6cffffffffffffffffffffffffff63ff000000610818565b6cffffffffffffffffffffffffff60ff610818565b60ff60086107ee565b506fffffffffffffffffffffffffffffffff83161515610727565b63ffffffff9895909561070a565b6cffffffffffffffffffffffffff63ff0000006106ef565b6cffffffffffffffffffffffffff60ff6106ef565b60ff60086106c4565b63ffffffff92939193610686565b6fffffffffffffffffffffffffffffffff809260ff610b8861025b82858180610b7d61025b8961060e565b161b1698169361060e565b161b16921916161790565b6fffffffffffffffffffffffffffffffff166fffffffffffffffffffffffffffffffff81146102a55760010190565b92919060ff81166004811015610da857600180610be493161591111585610666565b926fffffffffffffffffffffffffffffffff808516911614610da857600080806fff0000000000000000000000000000005b6fffffffffffffffffffffffffffffffff8116610d0f5750506fffffffffffffffffffffffffffffffff1680158015610c50575b50505050565b6000959293949590610ce257508306927f1fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff841684036102a557610cbf93605a606460ff930611600014610cc9576fffffffffffffffffffffffffffffffff6002945b169060031b1c1690610b52565b9038808080610c4a565b6fffffffffffffffffffffffffffffffff600194610cb2565b807f4e487b7100000000000000000000000000000000000000000000000000000000602492526012600452fd5b6fffffffffffffffffffffffffffffffff8188161615610d4e575b6effffffffffffffffffffffffffffff610d489160081c1691610b93565b90610c16565b92610d5883610b93565b9260031b7007fffffffffffffffffffffffffffffff86ffffffffffffffffffffffffffffffff88216911681036102a5576fffffffffffffffffffffffffffffffff83811690911b161792610d2a565b7f35405e3c0000000000000000000000000000000000000000000000000000000060005260046000fdfea264697066735822122051cde6e8ba62922ad92fd11aa9d1b1fd8a44b62804e0348088bde5c42fc0e6e464736f6c634300081c0033", + "nonce": "0x12", + "chainId": "0x8f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + }, + { + "hash": "0xb214424e5e6649d5a9f2e82f0d7ffa3567bf18a5a405491e0cffc33eb7695118", + "transactionType": "CREATE", + "contractName": "Monad2048", + "contractAddress": "0x53748668642735cda45935716525e7dfbc8aaacc", + "function": null, + "arguments": null, + "transaction": { + "from": "0xcbc2d8fe511e38f99512bd41b06698628aa8e267", + "gas": "0xdc875", + "value": "0x0", + "input": "0x60808060405234601557610baf908161001b8239f35b600080fdfe608080604052600436101561001357600080fd5b60003560e01c90816325c09963146108545750806361d585da146107e457806379cbd2331461079a5780639a9874751461073c578063ac88036c146106ef578063bb9df307146102015763e51b891f1461006c57600080fd5b346101fc5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101fc57604051610200906004356100af8383610aa3565b8236833780600052600060205260406000205460801c9060009173140fd93a53218f93ec8b0ecbfb05db73cf5c10d3925b60ff811660108110156101a157604051907f54c30fd90000000000000000000000000000000000000000000000000000000082528360048301526024820152602081604481885af490811561019557600091610152575b5060ff918260019216611fe08260051b1688015201166100e0565b6020813d821161018d575b8161016a60209383610aa3565b8101031261018957519060ff82168203610186575060ff610137565b80fd5b5080fd5b3d915061015d565b6040513d6000823e3d90fd5b85878560005260006020526effffffffffffffffffffffffffffff60406000205460081c1660405191826000905b601082106101e35750506102209350820152f35b60208060019260ff8951168152019601910190946101cf565b600080fd5b346101fc576101007ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101fc576004353660a4116101fc5736610104116101fc578060601c33036106c55780600052600060205260406000205460801c61069b57604051602081019060006024835b60048310610669575050506080815261028d60a082610aa3565b51902080600052600160205260406000205461063f5773140fd93a53218f93ec8b0ecbfb05db73cf5c10d36024356fffffffffffffffffffffffffffffffff8116908181036101fc5750604051907f2b2f6a120000000000000000000000000000000000000000000000000000000082526004820152602081602481855af490811561019557600091610620575b50156105f65760015b6004811061042357505060005260016020528060406000205560e43560ff8116908181036101fc5750610355610b3d565b6040519161036283610a58565b825260208201600481526fffffffffffffffffffffffffffffffff60408401921682528360005260006020527fffffffffffffffffffffffffffffffff000000000000000000000000000000006fffffffffffffffffffffffffffffff0060ff6040600020955116925160081b16925160801b1691171790556103e3610b3d565b6fffffffffffffffffffffffffffffffff604051911681527f3d6c02e74ba05913874ba8d477497510df840bf93bfa5a2a8d8943766678a0e360203392a3005b7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81018181116105c75761045e61045982610afc565b610b5c565b600091600381101561059a5760051b60a4013560ff811681036105965760209061048a61045986610afc565b92610513604051848101908b8252886040820152604081526104ad606082610aa3565b51902060405195869485947f0be27a0400000000000000000000000000000000000000000000000000000000865260048601909493926fffffffffffffffffffffffffffffffff9060ff6060948360808601991685521660208401521660408201520152565b0381875af490811561058b57829161055d575b50156105355750600101610324565b807f2b977ce30000000000000000000000000000000000000000000000000000000060049252fd5b61057e915060203d8111610584575b6105768183610aa3565b810190610ae4565b86610526565b503d61056c565b6040513d84823e3d90fd5b8280fd5b6024837f4e487b710000000000000000000000000000000000000000000000000000000081526032600452fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f2b977ce30000000000000000000000000000000000000000000000000000000060005260046000fd5b610639915060203d602011610584576105768183610aa3565b8461031b565b7f6e3ca8050000000000000000000000000000000000000000000000000000000060005260046000fd5b8135906fffffffffffffffffffffffffffffffff82168092036101fc5760208160019382935201920192019190610273565b7f25434c830000000000000000000000000000000000000000000000000000000060005260046000fd5b7faed8b1cf0000000000000000000000000000000000000000000000000000000060005260046000fd5b346101fc5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101fc576004356000526000602052602060406000205460801c604051908152f35b346101fc5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101fc57600435600052600060205260206effffffffffffffffffffffffffffff60406000205460081c16604051908152f35b346101fc5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101fc5760043560005260016020526020604060002054604051908152f35b346101fc5760207ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101fc57600435600052600060205260606040600020546040519060ff811682526effffffffffffffffffffffffffffff8160081c16602083015260801c6040820152f35b346101fc5760607ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc3601126101fc576004359060243560ff8116918282036101fc576044356fffffffffffffffffffffffffffffffff8116928382036101fc578560601c33036106c55760209086600052600082526040610926816000206108db87610a58565b549560ff871681526effffffffffffffffffffffffffffff8760081c16908581019782895260801c9384910152604051858101918b83526040820152604081526104ad606082610aa3565b038173140fd93a53218f93ec8b0ecbfb05db73cf5c10d35af490811561019557600091610a39575b50156105f6576effffffffffffffffffffffffffffff6001915116016effffffffffffffffffffffffffffff81116105c7576040519061098d82610a58565b8382526effffffffffffffffffffffffffffff602083019116815260408201908382528560005260006020527fffffffffffffffffffffffffffffffff000000000000000000000000000000006fffffffffffffffffffffffffffffff0060ff6040600020955116925160081b16925160801b16911717905560405191825260208201527f14fe4197a69dbcc73d79fcfd259bd1f097640dd2c2fe016ff232c416e17ce84260403392a3005b610a52915060203d602011610584576105768183610aa3565b8561094e565b6060810190811067ffffffffffffffff821117610a7457604052565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b90601f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0910116810190811067ffffffffffffffff821117610a7457604052565b908160209103126101fc575180151581036101fc5790565b6004811015610b0e5760051b60240190565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6084356fffffffffffffffffffffffffffffffff811681036101fc5790565b356fffffffffffffffffffffffffffffffff811681036101fc579056fea264697066735822122072394165c674c3a78888db5a18fb970ca6b082cc30bbea93c0e25ba9f71a062f64736f6c634300081c0033", + "nonce": "0x13", + "chainId": "0x8f" + }, + "additionalContracts": [], + "isFixedGasLimit": false + } + ], + "receipts": [ + { + "status": "0x1", + "cumulativeGasUsed": "0x15d38a", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0x7846172decf613bc039de94c6ca646bdfe4f5e2816f8264458bbed26cdaa5237", + "transactionIndex": "0x2", + "blockHash": "0x34305062ffc35ee4978cd23d87435aae58b59408ca27771395a3610d8d1eabcb", + "blockNumber": "0x3147450", + "gasUsed": "0x1176a1", + "effectiveGasPrice": "0x18904a3f00", + "from": "0xcbc2d8fe511e38f99512bd41b06698628aa8e267", + "to": "0x4e59b44847b379578588920ca78fbf26c0b4956c", + "contractAddress": null + }, + { + "status": "0x1", + "cumulativeGasUsed": "0x239bff", + "logs": [], + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "type": "0x2", + "transactionHash": "0xb214424e5e6649d5a9f2e82f0d7ffa3567bf18a5a405491e0cffc33eb7695118", + "transactionIndex": "0x3", + "blockHash": "0x34305062ffc35ee4978cd23d87435aae58b59408ca27771395a3610d8d1eabcb", + "blockNumber": "0x3147450", + "gasUsed": "0xdc875", + "effectiveGasPrice": "0x18904a3f00", + "from": "0xcbc2d8fe511e38f99512bd41b06698628aa8e267", + "to": null, + "contractAddress": "0x53748668642735cda45935716525e7dfbc8aaacc" + } + ], + "libraries": [ + "src/LibBoard.sol:Board:0x140fD93a53218F93Ec8b0ECbFB05db73cf5C10D3" + ], + "pending": [], + "returns": { + "gameContract": { + "internal_type": "address", + "value": "0x53748668642735CDa45935716525E7DFbC8aAACC" + } + }, + "timestamp": 1769605008553, + "chain": 143, + "commit": "11f3680" +} \ No newline at end of file diff --git a/packages/contracts/foundry.lock b/packages/contracts/foundry.lock new file mode 100644 index 0000000..eb556a9 --- /dev/null +++ b/packages/contracts/foundry.lock @@ -0,0 +1,8 @@ +{ + "lib/forge-std": { + "rev": "3b20d60d14b343ee4f908cb8079495c07f5e8981" + }, + "lib/solady": { + "rev": "c9e079c0ca836dcc52777a1fa7227ef28e3537b3" + } +} \ No newline at end of file diff --git a/packages/contracts/foundry.toml b/packages/contracts/foundry.toml new file mode 100644 index 0000000..bed7539 --- /dev/null +++ b/packages/contracts/foundry.toml @@ -0,0 +1,14 @@ +[profile.default] +src = "src" +out = "out" +libs = ["lib"] +solc_version = "0.8.28" +optimizer = true +optimizer_runs = 2000000 +via_ir = true +evm_version = "paris" + +[fmt] +line_length = 120 +tab_width = 4 +bracket_spacing = false diff --git a/packages/contracts/package.json b/packages/contracts/package.json new file mode 100644 index 0000000..45be39d --- /dev/null +++ b/packages/contracts/package.json @@ -0,0 +1,19 @@ +{ + "name": "contracts", + "version": "1.0.0", + "private": true, + "description": "Foundry smart contracts for 2048 game", + "scripts": { + "build": "forge build", + "test": "forge test -vvv", + "test:gas": "forge test --gas-report", + "lint": "forge fmt --check", + "format": "forge fmt", + "deploy": "forge script script/Deploy.s.sol --rpc-url $RPC_URL --broadcast --private-key $DEPLOYER_PRIVATE_KEY", + "deploy:testnet": "forge script script/Deploy.s.sol --rpc-url https://monad-testnet.g.alchemy.com/v2/vuj1yGtSbRRZJ_d8xTfeF --broadcast --chain-id 10143", + "deploy:mainnet": "forge script script/Deploy.s.sol --rpc-url https://monad-mainnet.g.alchemy.com/v2/vuj1yGtSbRRZJ_d8xTfeF --broadcast --chain-id 143", + "clean": "forge clean" + }, + "keywords": ["foundry", "solidity", "smart-contracts", "2048", "monad"], + "devDependencies": {} +} diff --git a/packages/contracts/script/Deploy.s.sol b/packages/contracts/script/Deploy.s.sol new file mode 100644 index 0000000..01629bb --- /dev/null +++ b/packages/contracts/script/Deploy.s.sol @@ -0,0 +1,21 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity >=0.8.28 <0.9.0; + +// Base +import {Script} from "lib/forge-std/src/Script.sol"; +import {StdUtils} from "lib/forge-std/src/StdUtils.sol"; + +// Targets +import {Monad2048} from "src/Monad2048.sol"; + +contract Deploy is StdUtils, Script { + uint256 internal deployerPrivateKey = vm.envUint("DEPLOYER_PRIVATE_KEY"); + + function run() public returns (address gameContract) { + address deployer = vm.addr(deployerPrivateKey); + + vm.startBroadcast(deployer); + gameContract = address(new Monad2048()); + vm.stopBroadcast(); + } +} diff --git a/packages/contracts/src/LibBoard.sol b/packages/contracts/src/LibBoard.sol new file mode 100644 index 0000000..a118ebb --- /dev/null +++ b/packages/contracts/src/LibBoard.sol @@ -0,0 +1,166 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.28; + +import {console} from "lib/forge-std/src/Test.sol"; + +library Board { + // =============================================================// + // ERRORS // + // =============================================================// + + error MoveInvalid(); + + // =============================================================// + // CONSTANTS // + // =============================================================// + + uint8 public constant UP = 0; + uint8 public constant DOWN = 1; + uint8 public constant LEFT = 2; + uint8 public constant RIGHT = 3; + + // =============================================================// + // START // + // =============================================================// + + function getStartPosition(bytes32 seed) public pure returns (uint128 position) { + // Generate pseudo-random seed and get first tile to populate. + uint256 rseed = uint256(keccak256(abi.encodePacked(seed))); + uint8 pos1 = uint8(rseed % 16); + rseed >>= 16; + + // Get second tile to populate. + uint8 pos2 = uint8(rseed % 15); + if (pos2 >= pos1) { + pos2++; + } + + position = setTile(setTile(position, pos2, (rseed % 100) > 90 ? 2 : 1), pos1, (rseed % 100) > 90 ? 2 : 1); + } + + // =============================================================// + // VALIDATIONS // + // =============================================================// + + function validateStartPosition(uint128 board) public pure returns (bool) { + uint128 mask = 0x03030303030303030303030303030303; + + // any bit except last two bits in a slot cannot be active + // also, both of the last two cannot be active at the same time + if (board & ~mask != 0 || board & (board >> 1) != 0) { + return false; + } + + uint256 count; + while (board != 0) { + // eliminate last active bit + board &= board - 1; + count++; + } + + return count == 2; + } + + function validateTransformation(uint128 prevBoard, uint8 move, uint128 nextBoard, uint256 seed) + public + pure + returns (bool) + { + return processMove(prevBoard, move, seed) == nextBoard; + } + + // =============================================================// + // TRANSFORMATIONS // + // =============================================================// + + function processMove(uint128 board, uint8 move, uint256 seed) public pure returns (uint128 result) { + // Check: the move is valid. + require(move < 4, MoveInvalid()); + + // Perform transformation on board to get resultant + result = processMove(board, move <= DOWN, move % 2 == 0); + + // Check: the move is playable. + require(board != result, MoveInvalid()); + + uint128 slotMask = 0xFF000000000000000000000000000000; + + uint128 emptyIndices; + uint128 emptySlots; + uint128 index; + + while (slotMask != 0) { + if (result & slotMask == 0) { + emptyIndices |= index << (8 * emptySlots++); + } + slotMask >>= 8; + index++; + } + + if (emptySlots > 0) { + // Set a 2 (90% probability) or a 4 (10% probability) on the randomly chosen tile. + uint8 tile = uint8((emptyIndices >> (8 * (seed % emptySlots))) & 0xFF); + result = setTile(result, tile, (seed % 100) > 90 ? 2 : 1); + } + } + + function processMove(uint128 board, bool isVertical, bool isLeft) public pure returns (uint128 result) { + uint128 shift = 0; + uint128 extractMask = isVertical ? 0x000000FF000000FF000000FF000000FF : 0xFFFFFFFF; + for (uint256 i = 0; i < 4; i++) { + uint128 compressed = compress(extractMask & board, isVertical, isLeft); + uint128 merged = merge(compressed, isVertical, isLeft); + + result |= (merged << shift); + shift += isVertical ? 8 : 32; + + board >>= isVertical ? 8 : 32; + } + } + + function compress(uint128 data, bool isVertical, bool isLeft) internal pure returns (uint128 compressed) { + uint128 shift = isVertical ? 32 : 8; + uint128 mask = isLeft ? (isVertical ? 0x000000FF000000000000000000000000 : 0xFF000000) : 0xFF; + uint128 reminderMask = isVertical ? 0x000000FF000000FF000000FF000000FF : 0xFFFFFFFF; + while (mask != 0 && data != 0) { + while (data & reminderMask > 0 && data & mask == 0) { + data = isLeft ? data << shift : data >> shift; + } + compressed |= data & mask; + mask = isLeft ? mask >> shift : mask << shift; + } + } + + function merge(uint128 compressed, bool isVertical, bool isLeft) internal pure returns (uint128 merged) { + uint128 shift = isVertical ? 32 : 8; + + uint128 mask = isLeft ? (isVertical ? 0x000000FF000000000000000000000000 : 0xFF000000) : 0xFF; + uint128 reminderMask = isVertical ? 0x000000FF000000FF000000FF000000FF : 0xFFFFFFFF; + uint128 frontMask = isLeft ? mask >> shift : mask << shift; + uint128 addition = isLeft ? (isVertical ? 0x00000001000000000000000000000000 : 0x01000000) : 0x01; + + while (reminderMask & compressed != 0) { + uint128 front = isLeft ? (compressed & frontMask) << shift : (compressed & frontMask) >> shift; + if (compressed & mask == front) { + compressed = isLeft ? compressed << shift : compressed >> shift; + compressed += addition; + } + merged |= (compressed & mask); + + mask = isLeft ? mask >> shift : mask << shift; + frontMask = isLeft ? frontMask >> shift : frontMask << shift; + addition = isLeft ? addition >> shift : addition << shift; + reminderMask = isLeft ? reminderMask >> shift : reminderMask << shift; + } + } + + function getTile(uint128 board, uint8 pos) public pure returns (uint8) { + return uint8((board >> ((15 - pos) * 8)) & 0xFF); + } + + function setTile(uint128 board, uint8 pos, uint8 value) public pure returns (uint128) { + uint128 mask = uint128(0xFF) << ((15 - pos) * 8); + uint128 tile = uint128(value) << ((15 - pos) * 8); + return (board & ~mask) | tile; + } +} diff --git a/packages/contracts/src/Monad2048.sol b/packages/contracts/src/Monad2048.sol new file mode 100644 index 0000000..99f84a5 --- /dev/null +++ b/packages/contracts/src/Monad2048.sol @@ -0,0 +1,149 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.28; + +import {Board} from "src/LibBoard.sol"; + +struct GameState { + uint8 move; + uint120 nextMove; + uint128 board; +} + +/** + * @title Monad 2048 + * @author Monad Foundation (github.com/monad-developers) + * @notice Play 2048 onchain! Also read: https://blog.monad.xyz + */ +contract Monad2048 { + // =============================================================// + // ERRORS // + // =============================================================// + + /// @dev Emitted when starting a game with a used ID. + error GameIdUsed(); + /// @dev Emitted when starting a game that has already been played. + error GamePlayed(); + /// @dev Emitted when submitting an invalid game board. + error GameBoardInvalid(); + /// @dev Emitted when someone other than a game's player makes a move. + error GamePlayerInvalid(); + + // =============================================================// + // EVENT // + // =============================================================// + + /// @dev Emitted when a game is started. + event NewGame(address indexed player, bytes32 indexed id, uint256 board); + /// @dev Emitted when a new valid move is played. + event NewMove(address indexed player, bytes32 indexed id, uint256 move, uint256 result); + + // =============================================================// + // STORAGE // + // =============================================================// + + /// @notice Mapping from game ID to the latest board state. + mapping(bytes32 gameId => GameState state) public state; + /// @notice Mapping from a hash of start position plus first 3 moves to game ID. + mapping(bytes32 gameHash => bytes32 gameId) public gameHashOf; + + // =============================================================// + // MODIFIERS // + // =============================================================// + + modifier correctGameId(address player, bytes32 gameId) { + require(player == address(uint160(uint256(gameId) >> 96)), GamePlayerInvalid()); + _; + } + + // =============================================================// + // VIEW // + // =============================================================// + + function nextMove(bytes32 gameId) public view returns (uint120) { + return state[gameId].nextMove; + } + + function latestBoard(bytes32 gameId) public view returns (uint128) { + return state[gameId].board; + } + + /** + * @notice Returns the latest board position of a game. + * @dev Each array position stores the log_2 of that tile's value. + * @param gameId The unique ID of a game. + */ + function getBoard(bytes32 gameId) external view returns (uint8[16] memory boardArr, uint256 nextMoveNumber) { + uint128 b = latestBoard(gameId); + for (uint8 i = 0; i < 16; i++) { + boardArr[i] = Board.getTile(b, i); + } + nextMoveNumber = nextMove(gameId); + } + + // =============================================================// + // EXTERNAL // + // =============================================================// + + /** + * @notice Starts a new game for a player. + * + * @param gameId The unique ID of the game. + * @param boards An ordered series of a start board and the result boards + * of the first three moves. + */ + function startGame(bytes32 gameId, uint128[4] calldata boards, uint8[3] calldata moves) + external + correctGameId(msg.sender, gameId) + { + require(state[gameId].board == 0, GameIdUsed()); + + // Check: this exact sequence of boards has not been played. + bytes32 hashedBoards = keccak256(abi.encodePacked(boards)); + require(gameHashOf[hashedBoards] == bytes32(0), GamePlayed()); + + // Check: game has a valid start board. + require(Board.validateStartPosition(boards[0]), GameBoardInvalid()); + + // Check: game has valid board transformations. + for (uint256 i = 1; i < 4; i++) { + require( + Board.validateTransformation( + boards[i - 1], moves[i - 1], boards[i], uint256(keccak256(abi.encodePacked(gameId, i))) + ), + GameBoardInvalid() + ); + } + + // Mark the game-start as played. + gameHashOf[hashedBoards] = gameId; + + state[gameId] = GameState({move: moves[2], nextMove: uint120(4), board: boards[3]}); + + emit NewGame(msg.sender, gameId, boards[3]); + } + + /** + * @notice Makes a new move in a game. + * @param gameId The unique ID of the game. + * @param resultBoard The result of applying a move on the latest board. + */ + function play(bytes32 gameId, uint8 move, uint128 resultBoard) external correctGameId(msg.sender, gameId) { + GameState memory latestState = state[gameId]; + + // Check: playing a valid move. + require( + Board.validateTransformation( + latestState.board, + move, + resultBoard, + uint256(keccak256(abi.encodePacked(gameId, uint256(latestState.nextMove)))) + ), + GameBoardInvalid() + ); + + // Update board. + state[gameId] = GameState({move: move, nextMove: latestState.nextMove + 1, board: resultBoard}); + + emit NewMove(msg.sender, gameId, move, resultBoard); + } +} diff --git a/packages/contracts/test/LibBoardTest.t.sol b/packages/contracts/test/LibBoardTest.t.sol new file mode 100644 index 0000000..6cd276c --- /dev/null +++ b/packages/contracts/test/LibBoardTest.t.sol @@ -0,0 +1,570 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.28; + +import {Test} from "lib/forge-std/src/Test.sol"; +import {Board} from "src/LibBoard.sol"; + +contract LibBoardTest is Test { + // Helper function to print values for debugging. + function boardBitsToArray(uint256 b) internal pure returns (uint8[16] memory boardArr) { + for (uint8 i = 0; i < 16; i++) { + boardArr[i] = uint8((b >> (120 - (i * 8))) & 0xFF); + } + } + + // Helper function to print values for debugging. + function boardArrayToBits(uint8[16] memory b) internal pure returns (uint128 result) { + for (uint8 i = 0; i < 16; i++) { + result <<= 8; + result |= b[i]; + } + } + + function testValidateStartBoard() public { + /** + * [0,0,0,0] + * [0,0,0,0] + * [0,2,0,0] + * [0,0,2,0] + */ + uint8[16] memory goodBoard1 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0]; + + /** + * [0,0,4,0] + * [0,0,0,0] + * [0,2,0,0] + * [0,0,0,0] + */ + uint8[16] memory goodBoard2 = [0, 0, 2, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0]; + + /** + * [0,0,4,0] + * [0,0,0,0] + * [0,4,0,0] + * [0,0,0,0] + */ + uint8[16] memory goodBoard3 = [0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0]; + + assertTrue(Board.validateStartPosition(boardArrayToBits(goodBoard1))); + assertTrue(Board.validateStartPosition(boardArrayToBits(goodBoard2))); + assertTrue(Board.validateStartPosition(boardArrayToBits(goodBoard3))); + + /** + * [0,0,2,0] + * [0,0,0,0] + * [0,2,0,0] + * [0,0,2,0] + */ + uint8[16] memory badBoard1 = [0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0]; + + assertEq(Board.validateStartPosition(boardArrayToBits(badBoard1)), false); + + /** + * [0,0,0,0] + * [0,0,0,0] + * [0,0,0,0] + * [0,0,0,0] + */ + uint8[16] memory badBoard2 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + + assertEq(Board.validateStartPosition(boardArrayToBits(badBoard2)), false); + } + + function testValidateTransformation() public pure { + /** + * [0,0,1,1] + * [0,0,2,4] + * [2,1,3,2] + * [0,1,3,2] + */ + uint8[16] memory board = [0, 0, 1, 1, 0, 0, 2, 4, 2, 1, 3, 2, 0, 1, 3, 2]; + + /** + * [0,0,0,0] + * [0,0,1,1] + * [0,0,2,4] + * [2,2,4,3] + */ + uint8[16] memory expectedResultDown = [0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 2, 4, 2, 2, 4, 3]; + + // Populate random tile. + uint256 seed = uint256(keccak256("random")); + uint8[] memory emptyIndices = new uint8[](8); + uint256 idx = 0; + for (uint8 i = 0; i < 16; i++) { + if (expectedResultDown[i] == 0) { + emptyIndices[idx] = i; + idx++; + } + } + expectedResultDown[emptyIndices[seed % emptyIndices.length]] = (seed % 100) > 90 ? 2 : 1; + + assertTrue( + Board.validateTransformation(boardArrayToBits(board), 0x01, boardArrayToBits(expectedResultDown), seed) + ); + } + + function testGameOver() public { + /** + * [1,2,3,4] + * [2,3,4,1] + * [3,4,1,2] + * [4,1,2,3] + */ + uint8[16] memory board = [1, 2, 3, 4, 2, 3, 4, 1, 3, 4, 1, 2, 4, 1, 2, 3]; + + vm.expectRevert(Board.MoveInvalid.selector); + Board.processMove(boardArrayToBits(board), Board.UP, uint256(keccak256("random"))); + + vm.expectRevert(Board.MoveInvalid.selector); + Board.processMove(boardArrayToBits(board), Board.DOWN, uint256(keccak256("random"))); + + vm.expectRevert(Board.MoveInvalid.selector); + Board.processMove(boardArrayToBits(board), Board.LEFT, uint256(keccak256("random"))); + + vm.expectRevert(Board.MoveInvalid.selector); + Board.processMove(boardArrayToBits(board), Board.RIGHT, uint256(keccak256("random"))); + } + + function testValidateProcessMovesUpSimple() public pure { + /** + * [0,0,0,0] + * [0,0,2,0] + * [0,0,2,0] + * [0,0,0,0] + */ + uint8[16] memory board1 = [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0]; + assertTrue(Board.validateStartPosition(boardArrayToBits(board1))); + + // Move: UP + /** + * [0,0,4,0] + * [0,0,0,0] + * [0,0,0,0] + * [0,0,0,0] + */ + uint8[16] memory expectedResultUp = [0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; + + // Populate random tile. + uint256 seed = uint256(keccak256("random")); + uint8[] memory emptyIndices = new uint8[](15); + uint256 idx = 0; + for (uint8 i = 0; i < 16; i++) { + if (expectedResultUp[i] == 0) { + emptyIndices[idx] = i; + idx++; + } + } + expectedResultUp[emptyIndices[seed % emptyIndices.length]] = (seed % 100) > 90 ? 2 : 1; + + uint128 result = Board.processMove(boardArrayToBits(board1), Board.UP, seed); + assertEq(boardArrayToBits(expectedResultUp), result); + } + + function testValidateProcessMovesUpComplexMerges() public pure { + /** + * [2,4,1,0] + * [3,2,0,0] + * [1,2,1,0] + * [0,0,0,0] + */ + uint8[16] memory board1 = [2, 4, 1, 0, 3, 2, 0, 0, 1, 2, 1, 0, 0, 0, 0, 0]; + + // Move: UP + /** + * [2,4,2,0] + * [3,3,0,0] + * [1,0,0,0] + * [0,0,0,0] + */ + uint8[16] memory expectedResultUp = [2, 4, 2, 0, 3, 3, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]; + + // Populate random tile. + uint256 seed = uint256(keccak256("random")); + uint8[] memory emptyIndices = new uint8[](10); + uint256 idx = 0; + for (uint8 i = 0; i < 16; i++) { + if (expectedResultUp[i] == 0) { + emptyIndices[idx] = i; + idx++; + } + } + expectedResultUp[emptyIndices[seed % emptyIndices.length]] = (seed % 100) > 90 ? 2 : 1; + + uint256 result = Board.processMove(boardArrayToBits(board1), Board.UP, seed); + assertEq(boardArrayToBits(expectedResultUp), result); + } + + function testValidateProcessMovesUpComplexNoMerges() public pure { + /** + * [0,0,0,0] + * [0,0,1,4] + * [0,0,3,2] + * [0,1,2,1] + */ + uint8[16] memory board1 = [0, 0, 0, 0, 0, 0, 1, 4, 0, 0, 3, 2, 0, 1, 2, 1]; + + // Move: UP + /** + * [0,1,1,4] + * [0,0,3,2] + * [0,0,2,1] + * [0,0,0,0] + */ + uint8[16] memory expectedResultUp = [0, 1, 1, 4, 0, 0, 3, 2, 0, 0, 2, 1, 0, 0, 0, 0]; + + // Populate random tile. + uint256 seed = uint256(keccak256("random")); + uint8[] memory emptyIndices = new uint8[](9); + uint256 idx = 0; + for (uint8 i = 0; i < 16; i++) { + if (expectedResultUp[i] == 0) { + emptyIndices[idx] = i; + idx++; + } + } + expectedResultUp[emptyIndices[seed % emptyIndices.length]] = (seed % 100) > 90 ? 2 : 1; + + uint256 result = Board.processMove(boardArrayToBits(board1), Board.UP, seed); + assertEq(boardArrayToBits(expectedResultUp), result); + } + + function testValidateProcessMovesDownSimple() public pure { + /** + * [0,0,0,0] + * [2,0,0,0] + * [0,0,2,0] + * [0,0,0,0] + */ + uint8[16] memory board1 = [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]; + assertTrue(Board.validateStartPosition(boardArrayToBits(board1))); + + // Move: DOWN + /** + * [0,0,0,0] + * [0,0,0,0] + * [0,0,0,0] + * [2,0,2,0] + */ + uint8[16] memory expectedResultDown = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0]; + + // Populate random tile. + uint256 seed = uint256(keccak256("random")); + uint8[] memory emptyIndices = new uint8[](14); + uint256 idx = 0; + for (uint8 i = 0; i < 16; i++) { + if (expectedResultDown[i] == 0) { + emptyIndices[idx] = i; + idx++; + } + } + expectedResultDown[emptyIndices[seed % emptyIndices.length]] = (seed % 100) > 90 ? 2 : 1; + + uint256 result = Board.processMove(boardArrayToBits(board1), Board.DOWN, seed); + assertEq(boardArrayToBits(expectedResultDown), result); + } + + function testValidateProcessMovesDownComplexNoMerges() public pure { + /** + * [1,1,3,1] + * [0,2,0,2] + * [0,0,0,1] + * [0,0,0,0] + */ + uint8[16] memory board1 = [1, 1, 3, 1, 0, 2, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0]; + + // Move: DOWN + /** + * [0,0,0,0] + * [0,0,0,1] + * [0,1,0,2] + * [1,2,3,1] + */ + uint8[16] memory expectedResultDown = [0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 2, 1, 2, 3, 1]; + + // Populate random tile. + uint256 seed = uint256(keccak256("random")); + uint8[] memory emptyIndices = new uint8[](9); + uint256 idx = 0; + for (uint8 i = 0; i < 16; i++) { + if (expectedResultDown[i] == 0) { + emptyIndices[idx] = i; + idx++; + } + } + expectedResultDown[emptyIndices[seed % emptyIndices.length]] = (seed % 100) > 90 ? 2 : 1; + + uint256 result = Board.processMove(boardArrayToBits(board1), Board.DOWN, seed); + assertEq(boardArrayToBits(expectedResultDown), result); + } + + function testValidateProcessMovesDownComplexMerges() public pure { + /** + * [0,0,1,1] + * [0,0,2,4] + * [2,1,3,2] + * [0,1,3,2] + */ + uint8[16] memory board1 = [0, 0, 1, 1, 0, 0, 2, 4, 2, 1, 3, 2, 0, 1, 3, 2]; + + // Move: DOWN + /** + * [0,0,0,0] + * [0,0,1,1] + * [0,0,2,4] + * [2,2,4,3] + */ + uint8[16] memory expectedResultDown = [0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 2, 4, 2, 2, 4, 3]; + + // Populate random tile. + uint256 seed = uint256(keccak256("random")); + uint8[] memory emptyIndices = new uint8[](8); + uint256 idx = 0; + for (uint8 i = 0; i < 16; i++) { + if (expectedResultDown[i] == 0) { + emptyIndices[idx] = i; + idx++; + } + } + expectedResultDown[emptyIndices[seed % emptyIndices.length]] = (seed % 100) > 90 ? 2 : 1; + + uint256 result = Board.processMove(boardArrayToBits(board1), Board.DOWN, seed); + assertEq(boardArrayToBits(expectedResultDown), result); + } + + function testValidateProcessMovesRightSimple() public pure { + /** + * [0,0,0,0] + * [2,0,0,0] + * [0,0,2,0] + * [0,0,0,0] + */ + uint8[16] memory board1 = [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]; + assertTrue(Board.validateStartPosition(boardArrayToBits(board1))); + + // Move: DOWN + /** + * [0,0,0,0] + * [0,0,0,2] + * [0,0,0,2] + * [0,0,0,0] + */ + uint8[16] memory expectedResultRight = [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0]; + + // Populate random tile. + uint256 seed = uint256(keccak256("random")); + uint8[] memory emptyIndices = new uint8[](14); + uint256 idx = 0; + for (uint8 i = 0; i < 16; i++) { + if (expectedResultRight[i] == 0) { + emptyIndices[idx] = i; + idx++; + } + } + expectedResultRight[emptyIndices[seed % emptyIndices.length]] = (seed % 100) > 90 ? 2 : 1; + + uint256 result = Board.processMove(boardArrayToBits(board1), Board.RIGHT, seed); + assertEq(boardArrayToBits(expectedResultRight), result); + } + + function testValidateProcessMovesRightComplexNoMerges() public pure { + /** + * [1,2,0,1] + * [0,1,0,2] + * [0,0,0,1] + * [0,3,0,0] + */ + uint8[16] memory board1 = [1, 2, 0, 1, 0, 1, 0, 2, 0, 0, 0, 1, 0, 3, 0, 0]; + + /** + * [0,1,2,1] + * [0,0,1,2] + * [0,0,0,1] + * [0,0,0,3] + */ + uint8[16] memory expectedResultRight = [0, 1, 2, 1, 0, 0, 1, 2, 0, 0, 0, 1, 0, 0, 0, 3]; + + // Populate random tile. + uint256 seed = uint256(keccak256("random")); + uint8[] memory emptyIndices = new uint8[](9); + uint256 idx = 0; + for (uint8 i = 0; i < 16; i++) { + if (expectedResultRight[i] == 0) { + emptyIndices[idx] = i; + idx++; + } + } + expectedResultRight[emptyIndices[seed % emptyIndices.length]] = (seed % 100) > 90 ? 2 : 1; + + uint256 result = Board.processMove(boardArrayToBits(board1), Board.RIGHT, seed); + assertEq(boardArrayToBits(expectedResultRight), result); + } + + function testValidateProcessMovesRightComplexMerges() public pure { + /** + * [1,1,3,1] + * [0,2,0,2] + * [0,0,0,1] + * [0,0,0,0] + */ + uint8[16] memory board1 = [1, 1, 3, 1, 0, 2, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0]; + + /** + * [0,2,3,1] + * [0,0,0,3] + * [0,0,0,1] + * [0,0,0,0] + */ + uint8[16] memory expectedResultRight = [0, 2, 3, 1, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0]; + + // Populate random tile. + uint256 seed = uint256(keccak256("random")); + uint8[] memory emptyIndices = new uint8[](11); + uint256 idx = 0; + for (uint8 i = 0; i < 16; i++) { + if (expectedResultRight[i] == 0) { + emptyIndices[idx] = i; + idx++; + } + } + expectedResultRight[emptyIndices[seed % emptyIndices.length]] = (seed % 100) > 90 ? 2 : 1; + + uint256 result = Board.processMove(boardArrayToBits(board1), Board.RIGHT, seed); + assertEq(boardArrayToBits(expectedResultRight), result); + } + + function testValidateProcessMovesLeftSimple() public pure { + /** + * [0,0,0,0] + * [2,0,0,0] + * [0,0,2,0] + * [0,0,0,0] + */ + uint8[16] memory board1 = [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]; + assertTrue(Board.validateStartPosition(boardArrayToBits(board1))); + + // Move: DOWN + /** + * [0,0,0,0] + * [2,0,0,0] + * [2,0,0,0] + * [0,0,0,0] + */ + uint8[16] memory expectedResultLeft = [0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]; + + // Populate random tile. + uint256 seed = uint256(keccak256("random")); + uint8[] memory emptyIndices = new uint8[](14); + uint256 idx = 0; + for (uint8 i = 0; i < 16; i++) { + if (expectedResultLeft[i] == 0) { + emptyIndices[idx] = i; + idx++; + } + } + expectedResultLeft[emptyIndices[seed % emptyIndices.length]] = (seed % 100) > 90 ? 2 : 1; + + uint256 result = Board.processMove(boardArrayToBits(board1), Board.LEFT, seed); + assertEq(boardArrayToBits(expectedResultLeft), result); + } + + function testValidateProcessMovesLeftComplexNoMerges() public pure { + /** + * [1,2,0,1] + * [0,1,0,2] + * [0,0,0,1] + * [0,3,0,0] + */ + uint8[16] memory board1 = [1, 2, 0, 1, 0, 1, 0, 2, 0, 0, 0, 1, 0, 3, 0, 0]; + + /** + * [1,2,1,0] + * [1,2,0,0] + * [1,0,0,0] + * [3,0,0,0] + */ + uint8[16] memory expectedResultLeft = [1, 2, 1, 0, 1, 2, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0]; + + // Populate random tile. + uint256 seed = uint256(keccak256("random")); + uint8[] memory emptyIndices = new uint8[](9); + uint256 idx = 0; + for (uint8 i = 0; i < 16; i++) { + if (expectedResultLeft[i] == 0) { + emptyIndices[idx] = i; + idx++; + } + } + expectedResultLeft[emptyIndices[seed % emptyIndices.length]] = (seed % 100) > 90 ? 2 : 1; + + uint256 result = Board.processMove(boardArrayToBits(board1), Board.LEFT, seed); + assertEq(boardArrayToBits(expectedResultLeft), result); + } + + function testValidateProcessMovesLeftComplexMerges() public pure { + /** + * [1,1,3,1] + * [0,2,0,2] + * [0,0,0,1] + * [0,0,0,0] + */ + uint8[16] memory board1 = [1, 1, 3, 1, 0, 2, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0]; + + /** + * [2,3,1,0] + * [3,0,0,0] + * [1,0,0,0] + * [0,0,0,0] + */ + uint8[16] memory expectedResultLeft = [2, 3, 1, 0, 3, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0]; + + // Populate random tile. + uint256 seed = uint256(keccak256("random")); + uint8[] memory emptyIndices = new uint8[](11); + uint256 idx = 0; + for (uint8 i = 0; i < 16; i++) { + if (expectedResultLeft[i] == 0) { + emptyIndices[idx] = i; + idx++; + } + } + expectedResultLeft[emptyIndices[seed % emptyIndices.length]] = (seed % 100) > 90 ? 2 : 1; + + uint256 result = Board.processMove(boardArrayToBits(board1), Board.LEFT, seed); + assertEq(boardArrayToBits(expectedResultLeft), result); + } + + function testCompressRow() public pure { + assertEq(Board.compress(0x00010001, false, true), 0x01010000); + assertEq(Board.compress(0x00020101, false, true), 0x02010100); + assertEq(Board.compress(0x02010201, false, true), 0x02010201); + assertEq(Board.compress(0x00010001, false, false), 0x00000101); + assertEq(Board.compress(0x00020101, false, false), 0x00020101); + assertEq(Board.compress(0x02010201, false, false), 0x02010201); + assertEq(Board.compress(0, false, true), 0); + assertEq(Board.compress(0, false, false), 0); + } + + function testMergeRowTiles() public pure { + assertEq(Board.merge(0x01010000, false, true), 0x02000000); + assertEq(Board.merge(0x02010100, false, true), 0x02020000); + assertEq(Board.merge(0x01000000, false, true), 0x01000000); + assertEq(Board.merge(0x00000101, false, false), 0x00000002); + assertEq(Board.merge(0x00020101, false, false), 0x00000202); + assertEq(Board.merge(0x00000001, false, false), 0x00000001); + assertEq(Board.merge(0, false, true), 0); + assertEq(Board.merge(0, false, false), 0); + } + + function testCompressColumn() public pure { + assertEq(Board.compress(0x00000001000000000000000000000001, true, true), 0x00000001000000010000000000000000); + assertEq(Board.compress(0x00000001000000000000000100000000, true, false), 0x00000000000000000000000100000001); + } + + function testMergeColumnTiles() public pure { + assertEq(Board.merge(0x00000001000000010000000000000000, true, true), 0x00000002000000000000000000000000); + assertEq(Board.merge(0x00000000000000000000000100000001, true, false), 0x00000000000000000000000000000002); + } + + //0x000000FF000000FF000000FF000000FF +} diff --git a/packages/contracts/test/Monad2048Test.t.sol b/packages/contracts/test/Monad2048Test.t.sol new file mode 100644 index 0000000..dd3f106 --- /dev/null +++ b/packages/contracts/test/Monad2048Test.t.sol @@ -0,0 +1,108 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.28; + +import {Test, console} from "lib/forge-std/src/Test.sol"; +import {Monad2048} from "src/Monad2048.sol"; +import {Board} from "src/LibBoard.sol"; + +contract Monad2048Test is Test { + // Target game contract. + Monad2048 internal game; + + // Game player + address player; + + function setUp() public { + // Setup actors. + player = makeAddr("Player"); + + // Deploy game. + game = new Monad2048(); + } + + function testShowcase() public { + // Come up with a game ID. + bytes32 gameId = + bytes32((uint256(uint160(player)) << 96) + (uint256(keccak256(abi.encodePacked(player, "random"))) >> 160)); + + uint8[3] memory moves = [Board.UP, Board.DOWN, Board.RIGHT]; + uint128[4] memory boards; + + // The new tile on every move uses the seed `uint256(keccak256(abi.encodePacked(gameId, moveNumber)))` where moveNumber starts at `1`. + boards[0] = Board.getStartPosition(bytes32("random")); + boards[1] = Board.processMove(boards[0], moves[0], uint256(keccak256(abi.encodePacked(gameId, uint256(1))))); + boards[2] = Board.processMove(boards[1], moves[1], uint256(keccak256(abi.encodePacked(gameId, uint256(2))))); + boards[3] = Board.processMove(boards[2], moves[2], uint256(keccak256(abi.encodePacked(gameId, uint256(3))))); + + bytes32 gameHash = keccak256(abi.encodePacked(boards)); + + assertEq(game.gameHashOf(gameHash), bytes32(0)); + + // Start game by revealing commited boards. + vm.prank(player); + game.startGame(gameId, boards, moves); + + assertEq(game.gameHashOf(gameHash), gameId); + + assertEq(game.latestBoard(gameId), boards[3]); + + // Play move. + uint128 board4 = + Board.processMove(boards[3], Board.LEFT, uint256(keccak256(abi.encodePacked(gameId, uint256(4))))); + + // Submit move for validation. + vm.prank(player); + game.play(gameId, Board.LEFT, board4); + + assertEq(game.latestBoard(gameId), board4); + } + + function testLongerGame() public { + // Come up with a game ID. + bytes32 gameId = + bytes32((uint256(uint160(player)) << 96) + (uint256(keccak256(abi.encodePacked(player, "random"))) >> 160)); + + uint8[3] memory moves = [Board.UP, Board.DOWN, Board.RIGHT]; + uint128[4] memory boards; + + // The new tile on every move uses the seed `uint256(keccak256(abi.encodePacked(gameId, moveNumber)))` where moveNumber starts at `1`. + boards[0] = Board.getStartPosition(bytes32("random")); + boards[1] = Board.processMove(boards[0], moves[0], uint256(keccak256(abi.encodePacked(gameId, uint256(1))))); + boards[2] = Board.processMove(boards[1], moves[1], uint256(keccak256(abi.encodePacked(gameId, uint256(2))))); + boards[3] = Board.processMove(boards[2], moves[2], uint256(keccak256(abi.encodePacked(gameId, uint256(3))))); + + bytes32 gameHash = keccak256(abi.encodePacked(boards)); + assertEq(game.gameHashOf(gameHash), bytes32(0)); + + // Start game by revealing committed boards. + vm.prank(player); + game.startGame(gameId, boards, moves); + + uint128 boardState = boards[3]; + uint256 movesTotal = 4; + uint8[4] memory playMoves = [Board.DOWN, Board.LEFT, Board.UP, Board.RIGHT]; + bool gameOver; + while (!gameOver) { + assertEq(game.latestBoard(gameId), boardState); + + uint256 i = 0; + + // find move + while ( + i < 4 && boardState == Board.processMove(boardState, playMoves[i] <= Board.DOWN, playMoves[i] % 2 == 0) + ) { + i++; + } + + if (i < 4) { + boardState = Board.processMove( + boardState, playMoves[i], uint256(keccak256(abi.encodePacked(gameId, movesTotal++))) + ); + vm.prank(player); + game.play(gameId, playMoves[i], boardState); + } else { + gameOver = true; + } + } + } +} diff --git a/packages/frontend/.env.local.example b/packages/frontend/.env.local.example new file mode 100644 index 0000000..9d95302 --- /dev/null +++ b/packages/frontend/.env.local.example @@ -0,0 +1,7 @@ +VITE_PRIVY_APP_ID= +VITE_MONAD_MAINNET_RPC_URL= + +# Leaderboard GraphQL endpoint +# For local development (Docker Hasura): http://localhost:8080/v1/graphql +# For production (Envio hosted): https://indexer.bigdevenergy.link/xxxxx/v1/graphql +VITE_ENVIO_GRAPHQL_URL=http://localhost:8080/v1/graphql diff --git a/packages/frontend/.gitignore b/packages/frontend/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/packages/frontend/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/LICENSE b/packages/frontend/LICENSE similarity index 100% rename from LICENSE rename to packages/frontend/LICENSE diff --git a/packages/frontend/README.md b/packages/frontend/README.md new file mode 100644 index 0000000..4a2d38f --- /dev/null +++ b/packages/frontend/README.md @@ -0,0 +1,26 @@ +# Monad 2048 Frontend + +**Check out a full writeup of how we built this [here](https://blog.monad.xyz/blog/build-2048).** + +Credits: [2048](https://github.com/gabrielecirulli/2048) + +`Monad 2048` is a fully on-chain game implementation of the popular sliding puzzle game 2048. This game connects with a smart contract +on [Monad testnet](https://testnet.monad.xyz/) and records every game and every move on-chain. + +## Development + +Clone the repo and run the following to install dependencies: + +```bash +bun install +``` + +Set the environment variables in your `.env.local` file (see `.env.local.example`). Then run the following to run the game locally: + +```bash +bun dev +``` + +## Feedback + +Please open issues or PRs on this repository for any feedback. diff --git a/components.json b/packages/frontend/components.json similarity index 100% rename from components.json rename to packages/frontend/components.json diff --git a/eslint.config.js b/packages/frontend/eslint.config.js similarity index 100% rename from eslint.config.js rename to packages/frontend/eslint.config.js diff --git a/index.html b/packages/frontend/index.html similarity index 100% rename from index.html rename to packages/frontend/index.html diff --git a/packages/frontend/package.json b/packages/frontend/package.json new file mode 100644 index 0000000..6c913a4 --- /dev/null +++ b/packages/frontend/package.json @@ -0,0 +1,47 @@ +{ + "name": "frontend", + "private": true, + "version": "1.0.0", + "description": "Frontend for onchain 2048 game", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc -b && vite build", + "lint": "eslint .", + "preview": "vite preview" + }, + "dependencies": { + "@privy-io/react-auth": "^2.8.2", + "@radix-ui/react-alert-dialog": "^1.1.11", + "@radix-ui/react-slot": "^1.2.0", + "@tailwindcss/vite": "^4.0.17", + "@types/node": "^22.13.14", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", + "framer-motion": "^11.18.0", + "graphql": "^16.10.0", + "graphql-request": "^7.1.2", + "lucide-react": "^0.484.0", + "next-themes": "^0.4.6", + "react": "^19.0.0", + "react-dom": "^19.0.0", + "sonner": "^2.0.3", + "tailwind-merge": "^3.0.2", + "tailwindcss": "^4.0.17", + "tw-animate-css": "^1.2.4", + "viem": "2.43.0" + }, + "devDependencies": { + "@eslint/js": "^9.21.0", + "@types/react": "^19.0.10", + "@types/react-dom": "^19.0.4", + "@vitejs/plugin-react-swc": "^3.8.0", + "eslint": "^9.21.0", + "eslint-plugin-react-hooks": "^5.1.0", + "eslint-plugin-react-refresh": "^0.4.19", + "globals": "^15.15.0", + "typescript": "~5.7.2", + "typescript-eslint": "^8.24.1", + "vite": "^6.2.0" + } +} diff --git a/public/monad-logo.svg b/packages/frontend/public/monad-logo.svg similarity index 100% rename from public/monad-logo.svg rename to packages/frontend/public/monad-logo.svg diff --git a/src/App.tsx b/packages/frontend/src/App.tsx similarity index 97% rename from src/App.tsx rename to packages/frontend/src/App.tsx index 6c9b97f..43cb415 100644 --- a/src/App.tsx +++ b/packages/frontend/src/App.tsx @@ -14,7 +14,6 @@ import Board from "./components/Board"; import Container from "./components/Container"; import { FaucetDialog } from "./components/FaucetDialog"; import LoginButton, { PlayerInfo } from "./components/LoginButton"; -import NetworkToggle from "./components/NetworkToggle"; import Scorecard from "./components/Scorecard"; import { useTransactions } from "./hooks/useTransactions"; @@ -76,19 +75,6 @@ export default function Game2048() { }); const [resetBoards, setResetBoards] = useState([]); - const hasActiveGame = activeGameId !== "0x" && boardState.tiles.length > 0; - - const handleNetworkChange = () => { - setActiveGameId("0x"); - setEncodedMoves([]); - setPlayedMovesCount(0); - setBoardState({ tiles: [], score: 0 }); - setResetBoards([]); - setGameOver(false); - setGameError(false); - setGameErrorText(""); - }; - // =============================================================// // Detect and execute moves // // =============================================================// @@ -192,6 +178,7 @@ export default function Game2048() { container.removeEventListener("touchstart", handleTouchStart); container.removeEventListener("touchend", handleTouchEnd); }; + // eslint-disable-next-line react-hooks/exhaustive-deps }, [boardState, gameOver, isAnimating, faucetModalOpen]); // Move tiles in the specified direction @@ -255,8 +242,10 @@ export default function Game2048() { // Add the merged tile newBoardState.tiles.push(mergedTile); - // Update the score + // Only count score once the game has started on-chain (after move 3) + if (currentMove > 3) { newBoardState.score += mergedTile.value; + } moved = true; } @@ -386,6 +375,18 @@ export default function Game2048() { setGameOver(false); }; + // Clear game state on logout + const clearGameState = () => { + setBoardState({ tiles: [], score: 0 }); + setActiveGameId("0x"); + setEncodedMoves([]); + setPlayedMovesCount(0); + setResetBoards([]); + setGameOver(false); + setGameError(false); + setGameErrorText(""); + }; + function randomIDForAddress(address: string): Hex { if (!isAddress(address)) { throw new Error("Invalid Ethereum address"); @@ -715,21 +716,13 @@ export default function Game2048() { }, []); return ( - +
- + 3} />
- {user && ( - <> - - - - )} + {user && }
diff --git a/src/components/Board.tsx b/packages/frontend/src/components/Board.tsx similarity index 99% rename from src/components/Board.tsx rename to packages/frontend/src/components/Board.tsx index ad78a21..63476dd 100644 --- a/src/components/Board.tsx +++ b/packages/frontend/src/components/Board.tsx @@ -10,7 +10,7 @@ type Tile = { }; type BoardProps = { - containerRef: any; + containerRef: React.RefObject; score: number; tiles: Tile[]; gameOver: boolean; diff --git a/packages/frontend/src/components/Container.tsx b/packages/frontend/src/components/Container.tsx new file mode 100644 index 0000000..16a0f36 --- /dev/null +++ b/packages/frontend/src/components/Container.tsx @@ -0,0 +1,36 @@ +import React from "react"; +import { Leaderboard } from "@/components/Leaderboard"; + +type ContainerProps = { + children: React.ReactNode; + playerAddress?: string; +}; + +export default function Container({ children, playerAddress }: ContainerProps) { + return ( +
+ {/* Left side: Header + Game */} +
+ {/* Header */} +
+

+ 2048 +

+

+ on MONAD +

+
+ + {/* Game board */} +
+ {children} +
+
+ + {/* Right side: Leaderboard - pinned to right */} +
+ +
+
+ ); +} diff --git a/src/components/FaucetDialog.tsx b/packages/frontend/src/components/FaucetDialog.tsx similarity index 94% rename from src/components/FaucetDialog.tsx rename to packages/frontend/src/components/FaucetDialog.tsx index 1d67014..8f400cd 100644 --- a/src/components/FaucetDialog.tsx +++ b/packages/frontend/src/components/FaucetDialog.tsx @@ -27,7 +27,7 @@ export function FaucetDialog({ resyncGame, }: FaucetDialogProps) { const { user } = usePrivy(); - const { publicClient, network } = useNetwork(); + const { publicClient } = useNetwork(); const [address, setAddress] = useState(""); const [balance, setBalance] = useState(0n); @@ -76,7 +76,8 @@ export function FaucetDialog({ useEffect(() => { if (!isOpen) return; setupUser(); - }, [user, isOpen, network]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [user, isOpen]); const abbreviatedAddress = address ? `${address.slice(0, 4)}...${address.slice(-2)}` @@ -132,8 +133,8 @@ export function FaucetDialog({

- Fund your player address with testnet MON directly via your - external wallet, or get 0.5 MON from the game faucet. + Fund your player address with MON directly via your external + wallet.

@@ -154,12 +155,12 @@ export function FaucetDialog({ asChild > -

Fund via faucet

+

Get MON

diff --git a/src/components/FunPurpleButton.tsx b/packages/frontend/src/components/FunPurpleButton.tsx similarity index 100% rename from src/components/FunPurpleButton.tsx rename to packages/frontend/src/components/FunPurpleButton.tsx diff --git a/packages/frontend/src/components/Leaderboard/Leaderboard.tsx b/packages/frontend/src/components/Leaderboard/Leaderboard.tsx new file mode 100644 index 0000000..29246e0 --- /dev/null +++ b/packages/frontend/src/components/Leaderboard/Leaderboard.tsx @@ -0,0 +1,193 @@ +import { motion, AnimatePresence } from 'framer-motion'; +import { Trophy, Medal, Flame, Fuel, Zap, Loader2 } from 'lucide-react'; +import { useLeaderboard } from '@/hooks/useLeaderboard'; +import { LeaderboardSkeleton } from './LeaderboardSkeleton'; +import { LeaderboardEmpty } from './LeaderboardEmpty'; +import { LeaderboardSyncing } from './LeaderboardSyncing'; +import { LeaderboardError } from './LeaderboardError'; +import { + formatAddress, + formatScore, + formatGas, + formatMonBurned +} from '@/lib/format'; + +interface LeaderboardProps { + currentPlayerAddress?: string; +} + +function getRankDisplay(rank: number) { + switch (rank) { + case 1: return ; + case 2: return ; + case 3: return ; + default: return ( + + {rank} + + ); + } +} + +function getTileColorClass(tile: number): string { + const colors: Record = { + 2: 'bg-purple-100 text-purple-800', + 4: 'bg-purple-200 text-purple-800', + 8: 'bg-purple-300 text-purple-900', + 16: 'bg-purple-400 text-white', + 32: 'bg-purple-500 text-white', + 64: 'bg-purple-600 text-white', + 128: 'bg-yellow-400 text-yellow-900', + 256: 'bg-yellow-500 text-white', + 512: 'bg-orange-500 text-white', + 1024: 'bg-orange-600 text-white', + 2048: 'bg-red-500 text-white', + 4096: 'bg-red-600 text-white', + 8192: 'bg-red-700 text-white', + }; + return colors[tile] || 'bg-purple-700 text-white'; +} + +export function Leaderboard({ currentPlayerAddress }: LeaderboardProps) { + const { entries, state, error, refetch, indexerStatus } = useLeaderboard({ + currentPlayerAddress, + }); + + return ( +
+ {/* Header */} +
+

+ + Top 10 High Scores +

+ {state === 'ready' && ( +
+ + Live +
+ )} + {state === 'syncing' && ( +
+ + Syncing +
+ )} +
+ + {/* Content based on state */} + {state === 'loading' && } + + {state === 'empty' && } + + {state === 'syncing' && entries.length === 0 && ( + + )} + + {state === 'error' && error && ( + + )} + + {/* Leaderboard entries */} + {(state === 'ready' || (state === 'syncing' && entries.length > 0)) && ( +
+ + {entries.map((entry) => ( + + {/* New entry badge */} + {entry.isNew && ( + + NEW + + )} + +
+ {/* Rank */} +
+ {getRankDisplay(entry.rank!)} +
+ + {/* Player info */} +
+
+ + {formatAddress(entry.player)} + + {entry.isCurrentPlayer && ( + + YOU + + )} +
+ + {/* Stats row */} +
+ + + {entry.moveCount} moves + + + + {formatGas(entry.totalGasUsed)} + + + + {formatMonBurned(entry.totalMonBurned)} + +
+
+ + {/* Score */} +
+ + {formatScore(entry.score)} + +
+ {entry.highestTile} +
+
+
+
+ ))} +
+
+ )} +
+ ); +} diff --git a/packages/frontend/src/components/Leaderboard/LeaderboardEmpty.tsx b/packages/frontend/src/components/Leaderboard/LeaderboardEmpty.tsx new file mode 100644 index 0000000..98b3de1 --- /dev/null +++ b/packages/frontend/src/components/Leaderboard/LeaderboardEmpty.tsx @@ -0,0 +1,13 @@ +import { Gamepad2 } from 'lucide-react'; + +export function LeaderboardEmpty() { + return ( +
+ +

No Games Yet

+

+ Be the first to play and claim the #1 spot! +

+
+ ); +} diff --git a/packages/frontend/src/components/Leaderboard/LeaderboardError.tsx b/packages/frontend/src/components/Leaderboard/LeaderboardError.tsx new file mode 100644 index 0000000..ed1832d --- /dev/null +++ b/packages/frontend/src/components/Leaderboard/LeaderboardError.tsx @@ -0,0 +1,25 @@ +import { AlertTriangle, RefreshCw } from 'lucide-react'; + +interface LeaderboardErrorProps { + error: Error; + onRetry: () => void; +} + +export function LeaderboardError({ error, onRetry }: LeaderboardErrorProps) { + return ( +
+ +

Failed to Load

+

+ {error.message || 'Unable to fetch leaderboard data'} +

+ +
+ ); +} diff --git a/packages/frontend/src/components/Leaderboard/LeaderboardSkeleton.tsx b/packages/frontend/src/components/Leaderboard/LeaderboardSkeleton.tsx new file mode 100644 index 0000000..84cb66e --- /dev/null +++ b/packages/frontend/src/components/Leaderboard/LeaderboardSkeleton.tsx @@ -0,0 +1,20 @@ +export function LeaderboardSkeleton() { + return ( +
+ {Array.from({ length: 5 }).map((_, i) => ( +
+
+
+
+
+
+
+
+ ))} +
+ ); +} diff --git a/packages/frontend/src/components/Leaderboard/LeaderboardSyncing.tsx b/packages/frontend/src/components/Leaderboard/LeaderboardSyncing.tsx new file mode 100644 index 0000000..102ca8c --- /dev/null +++ b/packages/frontend/src/components/Leaderboard/LeaderboardSyncing.tsx @@ -0,0 +1,28 @@ +import { Loader2, Database } from 'lucide-react'; + +interface LeaderboardSyncingProps { + totalGamesIndexed?: number; + lastBlock?: string; +} + +export function LeaderboardSyncing({ + totalGamesIndexed = 0, + lastBlock +}: LeaderboardSyncingProps) { + return ( +
+
+ + +
+

Syncing Data

+

+ Indexing historical games... +

+
+

{totalGamesIndexed.toLocaleString()} games indexed

+ {lastBlock &&

Block #{Number(lastBlock).toLocaleString()}

} +
+
+ ); +} diff --git a/packages/frontend/src/components/Leaderboard/index.ts b/packages/frontend/src/components/Leaderboard/index.ts new file mode 100644 index 0000000..17321af --- /dev/null +++ b/packages/frontend/src/components/Leaderboard/index.ts @@ -0,0 +1,5 @@ +export { Leaderboard } from './Leaderboard'; +export { LeaderboardSkeleton } from './LeaderboardSkeleton'; +export { LeaderboardEmpty } from './LeaderboardEmpty'; +export { LeaderboardSyncing } from './LeaderboardSyncing'; +export { LeaderboardError } from './LeaderboardError'; diff --git a/src/components/LoginButton.tsx b/packages/frontend/src/components/LoginButton.tsx similarity index 91% rename from src/components/LoginButton.tsx rename to packages/frontend/src/components/LoginButton.tsx index 273f1dc..c4c4015 100644 --- a/src/components/LoginButton.tsx +++ b/packages/frontend/src/components/LoginButton.tsx @@ -45,10 +45,19 @@ export default function LoginButton({ resetGame }: LoginButtonProps) { ); } -export function PlayerInfo() { +type PlayerInfoProps = { + onLogout: () => void; +}; + +export function PlayerInfo({ onLogout }: PlayerInfoProps) { const { logout } = useLogout(); const { user } = usePrivy(); + const handleLogout = () => { + onLogout(); + logout(); + }; + const [address, setAddress] = useState(""); useEffect(() => { if (!user) { @@ -97,7 +106,7 @@ export function PlayerInfo() { diff --git a/src/components/Scorecard.tsx b/packages/frontend/src/components/Scorecard.tsx similarity index 67% rename from src/components/Scorecard.tsx rename to packages/frontend/src/components/Scorecard.tsx index d4a2f67..116ed01 100644 --- a/src/components/Scorecard.tsx +++ b/packages/frontend/src/components/Scorecard.tsx @@ -6,12 +6,32 @@ import { Card } from "./ui/card"; type ScorecardProps = { score: number; + isGameStarted?: boolean; }; -export default function Scorecard({ score }: ScorecardProps) { +function LoadingIndicator() { + return ( +
+ {[0, 1, 2, 3].map((i) => ( +
+ ))} +
+ ); +} + +export default function Scorecard({ score, isGameStarted = true }: ScorecardProps) { const [displayScore, setDisplayScore] = useState(0); useEffect(() => { + if (!isGameStarted) return; + const targetScore = score; if (displayScore !== targetScore) { const duration = 150; // Total animation duration in ms @@ -36,14 +56,18 @@ export default function Scorecard({ score }: ScorecardProps) { requestAnimationFrame(animate); } - }, [score, displayScore]); + }, [score, displayScore, isGameStarted]); return (

SCORE

-

- {displayScore} -

+ {isGameStarted ? ( +

+ {displayScore} +

+ ) : ( + + )}