Skip to content

Commit

Permalink
gm god mode version. Test WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
peersky committed Aug 31, 2023
1 parent ca96c77 commit c31b8f4
Show file tree
Hide file tree
Showing 14 changed files with 980 additions and 1,007 deletions.
93 changes: 33 additions & 60 deletions abi/hardhat-diamond-abi/HardhatDiamondABI.sol/BestOfDiamond.json
Original file line number Diff line number Diff line change
Expand Up @@ -1374,21 +1374,15 @@
},
{
"indexed": false,
"internalType": "bytes",
"name": "gmSignature",
"type": "bytes"
"internalType": "bytes32",
"name": "commitmentHash",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "string",
"name": "proposalEncryptedByGM",
"type": "string"
},
{
"indexed": false,
"internalType": "bytes32",
"name": "proposalHash",
"type": "bytes32"
}
],
"name": "ProposalSubmitted",
Expand Down Expand Up @@ -1420,24 +1414,6 @@
"internalType": "uint256[]",
"name": "scores",
"type": "uint256[]"
},
{
"indexed": true,
"internalType": "bytes32",
"name": "turnSalt",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "address[]",
"name": "voters",
"type": "address[]"
},
{
"indexed": false,
"internalType": "uint256[3][]",
"name": "votesRevealed",
"type": "uint256[3][]"
}
],
"name": "TurnEnded",
Expand Down Expand Up @@ -1479,30 +1455,20 @@
"name": "gameId",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "turnSalt",
"type": "bytes32"
},
{
"internalType": "address[]",
"name": "voters",
"type": "address[]"
},
{
"internalType": "uint256[3][]",
"name": "votesRevealed",
"name": "votes",
"type": "uint256[3][]"
},
{
"internalType": "string[]",
"name": "ProposalsRevealed",
"name": "newProposals",
"type": "string[]"
},
{
"internalType": "address[]",
"name": "prevProposersRevealed",
"type": "address[]"
"internalType": "uint256[]",
"name": "proposerIndicies",
"type": "uint256[]"
}
],
"name": "endTurn",
Expand Down Expand Up @@ -1537,24 +1503,31 @@
{
"inputs": [
{
"internalType": "uint256",
"name": "gameId",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "gmSignature",
"type": "bytes"
},
{
"internalType": "string",
"name": "encryptedByGMProposal",
"type": "string"
},
{
"internalType": "bytes32",
"name": "proposalHash",
"type": "bytes32"
"components": [
{
"internalType": "uint256",
"name": "gameId",
"type": "uint256"
},
{
"internalType": "string",
"name": "encryptedProposal",
"type": "string"
},
{
"internalType": "bytes32",
"name": "commitmentHash",
"type": "bytes32"
},
{
"internalType": "address",
"name": "proposer",
"type": "address"
}
],
"internalType": "struct GameMastersFacet.ProposalParams",
"name": "proposalData",
"type": "tuple"
}
],
"name": "submitProposal",
Expand Down
93 changes: 33 additions & 60 deletions abi/src/facets/gameMastersFacet.sol/GameMastersFacet.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,15 @@
},
{
"indexed": false,
"internalType": "bytes",
"name": "gmSignature",
"type": "bytes"
"internalType": "bytes32",
"name": "commitmentHash",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "string",
"name": "proposalEncryptedByGM",
"type": "string"
},
{
"indexed": false,
"internalType": "bytes32",
"name": "proposalHash",
"type": "bytes32"
}
],
"name": "ProposalSubmitted",
Expand Down Expand Up @@ -119,24 +113,6 @@
"internalType": "uint256[]",
"name": "scores",
"type": "uint256[]"
},
{
"indexed": true,
"internalType": "bytes32",
"name": "turnSalt",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "address[]",
"name": "voters",
"type": "address[]"
},
{
"indexed": false,
"internalType": "uint256[3][]",
"name": "votesRevealed",
"type": "uint256[3][]"
}
],
"name": "TurnEnded",
Expand Down Expand Up @@ -178,30 +154,20 @@
"name": "gameId",
"type": "uint256"
},
{
"internalType": "bytes32",
"name": "turnSalt",
"type": "bytes32"
},
{
"internalType": "address[]",
"name": "voters",
"type": "address[]"
},
{
"internalType": "uint256[3][]",
"name": "votesRevealed",
"name": "votes",
"type": "uint256[3][]"
},
{
"internalType": "string[]",
"name": "ProposalsRevealed",
"name": "newProposals",
"type": "string[]"
},
{
"internalType": "address[]",
"name": "prevProposersRevealed",
"type": "address[]"
"internalType": "uint256[]",
"name": "proposerIndicies",
"type": "uint256[]"
}
],
"name": "endTurn",
Expand Down Expand Up @@ -236,24 +202,31 @@
{
"inputs": [
{
"internalType": "uint256",
"name": "gameId",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "gmSignature",
"type": "bytes"
},
{
"internalType": "string",
"name": "encryptedByGMProposal",
"type": "string"
},
{
"internalType": "bytes32",
"name": "proposalHash",
"type": "bytes32"
"components": [
{
"internalType": "uint256",
"name": "gameId",
"type": "uint256"
},
{
"internalType": "string",
"name": "encryptedProposal",
"type": "string"
},
{
"internalType": "bytes32",
"name": "commitmentHash",
"type": "bytes32"
},
{
"internalType": "address",
"name": "proposer",
"type": "address"
}
],
"internalType": "struct GameMastersFacet.ProposalParams",
"name": "proposalData",
"type": "tuple"
}
],
"name": "submitProposal",
Expand Down
21 changes: 14 additions & 7 deletions deploy/01_deployRankToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,20 @@ const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
const { deploy, diamond } = deployments;

const { deployer } = await getNamedAccounts();
if (!process.env.IPFS_GATEWAY_URL || !process.env.RANK_TOKEN_PATH)
throw new Error(
"env variables not set: export IPFS_GATEWAY_URL / RANK_TOKEN_PATH"
);
const URI = process.env.IPFS_GATEWAY_URL + process.env.RANK_TOKEN_PATH;
const ContractURI =
process.env.IPFS_GATEWAY_URL + process.env.RANK_TOKEN_CONTRACT_PATH;
let URI: string, ContractURI: string;
if (process.env.NODE_ENV !== "TEST") {
if (!process.env.IPFS_GATEWAY_URL || !process.env.RANK_TOKEN_PATH)
throw new Error(
"env variables not set: export IPFS_GATEWAY_URL / RANK_TOKEN_PATH"
);
URI = process.env.IPFS_GATEWAY_URL + process.env.RANK_TOKEN_PATH;
ContractURI =
process.env.IPFS_GATEWAY_URL + process.env.RANK_TOKEN_CONTRACT_PATH;
} else {
URI = "URI";
ContractURI = "CURI";
}

await deploy("RankToken", {
from: deployer,
args: [URI, deployer, ContractURI],
Expand Down
1 change: 1 addition & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import "@nomiclabs/hardhat-truffle5";
import "@nomiclabs/hardhat-web3";
import "@nomiclabs/hardhat-ethers";
import "hardhat-diamond-abi";
import "@nomicfoundation/hardhat-toolbox";
import "@typechain/hardhat";
import "hardhat-abi-exporter";
import { toSignature, isIncluded } from "./scripts/diamond";
Expand Down
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"author": "Tim Pechersky (@Peersky)",
"license": "MIT",
"devDependencies": {
"hardhat-deploy": "^0.11.24",
"@nomicfoundation/hardhat-chai-matchers": "^1.0.1",
"@nomicfoundation/hardhat-toolbox": "^2.0.2",
"@nomiclabs/buidler": "^1.4.8",
"@nomiclabs/buidler-web3": "^1.3.4",
"@nomiclabs/hardhat-ethers": "^2.0.6",
Expand All @@ -31,8 +31,10 @@
"@typechain/hardhat": "^6.0.0",
"@typechain/web3-v1": "^6.0.1",
"@types/cli-table": "^0.3.0",
"@types/crypto-js": "^4.1.1",
"@types/node-fetch": "^2.6.2",
"chai": "^4.3.6",
"crypto-js": "^4.1.1",
"eslint": "^8.34.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^8.6.0",
Expand All @@ -42,16 +44,15 @@
"hardhat": "^2.10.0",
"hardhat-abi-exporter": "^2.9.0",
"hardhat-contract-sizer": "^2.6.1",
"hardhat-deploy": "^0.11.24",
"hardhat-diamond-abi": "^3.0.0",
"ipfs-http-client": "60.0.1",
"keccak": "^3.0.1",
"mocha": "^10.0.0",
"prettier-plugin-solidity": "^1.0.0-beta.19",
"solidity-coverage": "^0.7.21",
"typechain": "^8.0.0",
"web3": "^1.8.2",
"ipfs-http-client": "60.0.1",
"crypto-js": "^4.1.1",
"@types/crypto-js": "^4.1.1"
"web3": "^1.8.2"
},
"dependencies": {
"@openzeppelin/contracts": "^4.7.0",
Expand Down
Loading

0 comments on commit c31b8f4

Please sign in to comment.