Skip to content

Commit

Permalink
build working
Browse files Browse the repository at this point in the history
  • Loading branch information
kamalbuilds committed Aug 13, 2024
1 parent 7ccdd01 commit 96f87c2
Show file tree
Hide file tree
Showing 32 changed files with 1,409 additions and 16 deletions.
2 changes: 2 additions & 0 deletions frontend/app/leaderboard/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @ts-nocheck
"use client";
import { useState, useEffect } from 'react';

export default function Leaderboard() {
Expand Down
2 changes: 1 addition & 1 deletion frontend/app/page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function CreateGamePage() {
<div className='text-white font-black text-right text-6xl'>CREATE A GAME</div>
<div className='text-white font-black text-right'>
Choose the settings for you new match.<br/>
The power's in your hands.
The power&apos;s in your hands.
</div>

<div className='text-right'>
Expand Down
25 changes: 19 additions & 6 deletions frontend/app/play/page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
// @ts-nocheck
"use client";

import { useState, useEffect } from 'react';
import { ethers } from 'ethers';
import { Button, Card, Alert, Modal } from 'shadcn/ui';
import ZkShuffleGameABI from '../artifacts/contracts/ZkShuffleGame.sol/ZkShuffleGame.json';
import {
Alert,
AlertDescription,
AlertTitle,
} from "@/components/ui/alert"
import { Button } from "@/components/ui/button";
import {
Card,
CardContent,
CardDescription,
CardFooter,
CardHeader,
CardTitle,
} from "@/components/ui/card"

import ZkShuffleGameABI from '@/artifacts/contracts/ZkShuffleGame.sol/ZkShuffleGame.json';

const zkShuffleGameAddress = '';

export default function Home() {
const [provider, setProvider] = useState<ethers.providers.Web3Provider | null>(null);
const [gameContract, setGameContract] = useState<ethers.Contract | null>(null);
const [players, setPlayers] = useState<string[]>([]);
const [pot, setPot] = useState<number>(0);
Expand All @@ -18,7 +32,6 @@ export default function Home() {
useEffect(() => {
if (typeof window.ethereum !== 'undefined') {
const newProvider = new ethers.providers.Web3Provider(window.ethereum);
setProvider(newProvider);

const contract = new ethers.Contract(
zkShuffleGameAddress,
Expand Down Expand Up @@ -82,9 +95,9 @@ export default function Home() {
</ul>
</Card>
</div>
<Modal show={showModal} onClose={() => setShowModal(false)}>
<div show={showModal} onClose={() => setShowModal(false)}>
<Alert variant="success">Game Finished!</Alert>
</Modal>
</div>
</div>
);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "..\\..\\..\\..\\build-info\\f4cdb34146d9c1946c4d354d9b639ea4.json"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "Ownable",
"sourceName": "@openzeppelin/contracts/access/Ownable.sol",
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "owner",
"type": "address"
}
],
"name": "OwnableInvalidOwner",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "account",
"type": "address"
}
],
"name": "OwnableUnauthorizedAccount",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "previousOwner",
"type": "address"
},
{
"indexed": true,
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "OwnershipTransferred",
"type": "event"
},
{
"inputs": [],
"name": "owner",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "renounceOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newOwner",
"type": "address"
}
],
"name": "transferOwnership",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
}
],
"bytecode": "0x",
"deployedBytecode": "0x",
"linkReferences": {},
"deployedLinkReferences": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "..\\..\\..\\..\\build-info\\f4cdb34146d9c1946c4d354d9b639ea4.json"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "Context",
"sourceName": "@openzeppelin/contracts/utils/Context.sol",
"abi": [],
"bytecode": "0x",
"deployedBytecode": "0x",
"linkReferences": {},
"deployedLinkReferences": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "..\\..\\..\\..\\..\\build-info\\f4cdb34146d9c1946c4d354d9b639ea4.json"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "EnumerableSet",
"sourceName": "@openzeppelin/contracts/utils/structs/EnumerableSet.sol",
"abi": [],
"bytecode": "0x60566050600b82828239805160001a6073146043577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220fc5d1723b91d94412ddf31a27681e58d7fea5f8cde80092c9e6170733b5de0ff64736f6c63430008180033",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220fc5d1723b91d94412ddf31a27681e58d7fea5f8cde80092c9e6170733b5de0ff64736f6c63430008180033",
"linkReferences": {},
"deployedLinkReferences": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "..\\..\\..\\..\\..\\build-info\\f4cdb34146d9c1946c4d354d9b639ea4.json"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "BitMaps",
"sourceName": "@zk-shuffle/contracts/contracts/shuffle/BitMaps.sol",
"abi": [],
"bytecode": "0x60566050600b82828239805160001a6073146043577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122059f164d95775776683027f6c5c04c61d2d04def6767b22b64b9dd0555555cac464736f6c63430008180033",
"deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea264697066735822122059f164d95775776683027f6c5c04c61d2d04def6767b22b64b9dd0555555cac464736f6c63430008180033",
"linkReferences": {},
"deployedLinkReferences": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "..\\..\\..\\..\\..\\build-info\\f4cdb34146d9c1946c4d354d9b639ea4.json"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "IDecryptVerifier",
"sourceName": "@zk-shuffle/contracts/contracts/shuffle/Deck.sol",
"abi": [
{
"inputs": [
{
"internalType": "uint256[2]",
"name": "a",
"type": "uint256[2]"
},
{
"internalType": "uint256[2][2]",
"name": "b",
"type": "uint256[2][2]"
},
{
"internalType": "uint256[2]",
"name": "c",
"type": "uint256[2]"
},
{
"internalType": "uint256[]",
"name": "input",
"type": "uint256[]"
}
],
"name": "verifyProof",
"outputs": [],
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x",
"deployedBytecode": "0x",
"linkReferences": {},
"deployedLinkReferences": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "..\\..\\..\\..\\..\\build-info\\f4cdb34146d9c1946c4d354d9b639ea4.json"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"_format": "hh-sol-artifact-1",
"contractName": "IShuffleEncryptVerifier",
"sourceName": "@zk-shuffle/contracts/contracts/shuffle/Deck.sol",
"abi": [
{
"inputs": [
{
"internalType": "uint256[2]",
"name": "a",
"type": "uint256[2]"
},
{
"internalType": "uint256[2][2]",
"name": "b",
"type": "uint256[2][2]"
},
{
"internalType": "uint256[2]",
"name": "c",
"type": "uint256[2]"
},
{
"internalType": "uint256[]",
"name": "input",
"type": "uint256[]"
}
],
"name": "verifyProof",
"outputs": [],
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x",
"deployedBytecode": "0x",
"linkReferences": {},
"deployedLinkReferences": {}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"_format": "hh-sol-dbg-1",
"buildInfo": "..\\..\\..\\..\\..\\build-info\\f4cdb34146d9c1946c4d354d9b639ea4.json"
}
Loading

0 comments on commit 96f87c2

Please sign in to comment.