diff --git a/README.md b/README.md index e7761c8..4b0161a 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,7 @@ This project uses Ankr RPC to deploy the game smart contracts. See the hardhat c ### Aztec A contract written in Noir is used to verify the validity of the challenger's committed strategy. By providing a proof generated by Noir, the game smart contract can use the on-chain verifier to ensure the strategy is valid. The Noir verifier checks if the fighter exists and if the moves are valid. -[Noir circuits](https://github.com/arjanjohan/scroll-fighter/tree/main/packages/noir) +[Noir circuit](https://github.com/arjanjohan/scroll-fighter/blob/main/packages/noir/src/main.nr) [UltraVerifier on Scroll Sepolia](https://sepolia.scrollscan.com/address/0xc15BC025d57bec9FA39e18701b4f0b3b5a067B6C#code) ### The Graph @@ -33,7 +33,6 @@ Due to the limited time, I could not complete everything I set out to do. Additi - Overview of current games, using The Graph to query existing games. - Create open games (anyone can join/accept) -- Using NFT's as fighters ## Links diff --git a/packages/graph/schema.graphql b/packages/graph/schema.graphql index e919dd1..8a39858 100644 --- a/packages/graph/schema.graphql +++ b/packages/graph/schema.graphql @@ -53,3 +53,17 @@ type GameProposed @entity(immutable: true) { blockTimestamp: BigInt! transactionHash: Bytes! } + +type Game @entity { + id: BigInt! # uint256 + wageredAmount: BigInt! # uint256 + player1: Bytes! # address + player2: Bytes! # address + winner: Bytes! # address + fighterIds: [BigInt!]! # uint256 + moves: [[BigInt!]!]! # uint256 + state: String! + blockNumber: BigInt! + blockTimestamp: BigInt! + transactionHash: Bytes! +} diff --git a/packages/graph/src/contract.ts b/packages/graph/src/contract.ts index 542dfdb..988e650 100644 --- a/packages/graph/src/contract.ts +++ b/packages/graph/src/contract.ts @@ -92,4 +92,5 @@ export function handleGameProposed(event: GameProposedEvent): void { entity.transactionHash = event.transaction.hash entity.save() + }