From ea0ebb0ad672fdd12c5b3893840bdbb46430b931 Mon Sep 17 00:00:00 2001 From: fala13 Date: Sat, 1 Jun 2024 23:35:57 +0200 Subject: [PATCH] deployed address --- package.json | 1 + packages/hardhat/hardhat.config.ts | 3 +- .../nextjs/contracts/deployedContracts.ts | 601 +++++++++++++++++- .../subgraph/abis/localhost_Think2Earn.json | 20 +- packages/subgraph/networks.json | 2 +- packages/subgraph/subgraph.yaml | 2 +- 6 files changed, 605 insertions(+), 24 deletions(-) diff --git a/package.json b/package.json index 8348809..e14dbaf 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,7 @@ "node": ">=18.17.0" }, "dependencies": { + "@graphprotocol/graph-cli": "^0.73.0", "framer-motion": "^11.2.10", "react-icons": "^5.2.1", "sass": "^1.77.4" diff --git a/packages/hardhat/hardhat.config.ts b/packages/hardhat/hardhat.config.ts index d165b65..76b8910 100644 --- a/packages/hardhat/hardhat.config.ts +++ b/packages/hardhat/hardhat.config.ts @@ -17,7 +17,8 @@ const providerApiKey = process.env.ALCHEMY_API_KEY || "oKxs-03sij-U_N0iOlrSsZFr2 const deployerPrivateKey = process.env.DEPLOYER_PRIVATE_KEY ?? "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"; // If not set, it uses ours Etherscan default API key. -const etherscanApiKey = process.env.ETHERSCAN_API_KEY || "DNXJA8RX2Q3VZ4URQIWP7Z68CJXQZSC6AW"; +// const etherscanApiKey = process.env.ETHERSCAN_API_KEY || "DNXJA8RX2Q3VZ4URQIWP7Z68CJXQZSC6AW"; +const etherscanApiKey = process.env.ETHERSCAN_API_KEY || "XCSJK4YG6SCWW48HYPZ22N349DDGMP89MA"; const config: HardhatUserConfig = { solidity: { diff --git a/packages/nextjs/contracts/deployedContracts.ts b/packages/nextjs/contracts/deployedContracts.ts index d09a996..d21d0b9 100644 --- a/packages/nextjs/contracts/deployedContracts.ts +++ b/packages/nextjs/contracts/deployedContracts.ts @@ -7,7 +7,7 @@ import { GenericContractsDeclaration } from "~~/utils/scaffold-eth/contract"; const deployedContracts = { 31337: { Think2Earn: { - address: "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9", + address: "0x5FbDB2315678afecb367f032d93F642f64180aa3", abi: [ { inputs: [], @@ -117,9 +117,9 @@ const deployedContracts = { }, { indexed: false, - internalType: "bytes32", + internalType: "bytes", name: "eegDataHash", - type: "bytes32", + type: "bytes", }, ], name: "EEGDataSubmitted", @@ -210,7 +210,586 @@ const deployedContracts = { }, { internalType: "string", - name: "mediaURIHash", + name: "mediaURI", + type: "string", + }, + { + internalType: "uint256", + name: "reward", + type: "uint256", + }, + { + internalType: "uint256", + name: "duration", + type: "uint256", + }, + { + internalType: "uint256", + name: "judgeTime", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxProgress", + type: "uint256", + }, + { + internalType: "uint256", + name: "creationBlock", + type: "uint256", + }, + { + internalType: "address", + name: "creator", + type: "address", + }, + { + internalType: "bool", + name: "isActive", + type: "bool", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "bountyCount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_bountyId", + type: "uint256", + }, + { + internalType: "uint256[]", + name: "acceptedSubmissions", + type: "uint256[]", + }, + ], + name: "completeBounty", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "string", + name: "_name", + type: "string", + }, + { + internalType: "string", + name: "_description", + type: "string", + }, + { + internalType: "string", + name: "_mediaURI", + type: "string", + }, + { + internalType: "uint256", + name: "_duration", + type: "uint256", + }, + { + internalType: "uint256", + name: "_judgeTime", + type: "uint256", + }, + { + internalType: "uint256", + name: "_maxProgress", + type: "uint256", + }, + ], + name: "createBounty", + outputs: [], + stateMutability: "payable", + type: "function", + }, + { + inputs: [], + name: "getActiveBounties", + outputs: [ + { + internalType: "uint256[]", + name: "", + type: "uint256[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getBounties", + outputs: [ + { + components: [ + { + internalType: "string", + name: "name", + type: "string", + }, + { + internalType: "string", + name: "description", + type: "string", + }, + { + internalType: "string", + name: "mediaURI", + type: "string", + }, + { + internalType: "uint256", + name: "reward", + type: "uint256", + }, + { + internalType: "uint256", + name: "duration", + type: "uint256", + }, + { + internalType: "uint256", + name: "judgeTime", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxProgress", + type: "uint256", + }, + { + internalType: "uint256", + name: "creationBlock", + type: "uint256", + }, + { + internalType: "address", + name: "creator", + type: "address", + }, + { + internalType: "bool", + name: "isActive", + type: "bool", + }, + { + components: [ + { + internalType: "address", + name: "submitter", + type: "address", + }, + { + internalType: "bytes", + name: "eegDataHash", + type: "bytes", + }, + ], + internalType: "struct Think2EarnBountyFactoryV1.Submission[]", + name: "submissions", + type: "tuple[]", + }, + ], + internalType: "struct Think2Earn.Bounty[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getBountyCount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_bountyId", + type: "uint256", + }, + ], + name: "getBountyDetails", + outputs: [ + { + internalType: "string", + name: "name", + type: "string", + }, + { + internalType: "string", + name: "description", + type: "string", + }, + { + internalType: "string", + name: "mediaURI", + type: "string", + }, + { + internalType: "uint256", + name: "reward", + type: "uint256", + }, + { + internalType: "uint256", + name: "duration", + type: "uint256", + }, + { + internalType: "uint256", + name: "judgeTime", + type: "uint256", + }, + { + internalType: "uint256", + name: "maxProgress", + type: "uint256", + }, + { + internalType: "address", + name: "creator", + type: "address", + }, + { + internalType: "uint256", + name: "creationBlock", + type: "uint256", + }, + { + internalType: "bool", + name: "isActive", + type: "bool", + }, + { + internalType: "uint256", + name: "submissionsLength", + type: "uint256", + }, + { + internalType: "uint256", + name: "currentProgress", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_bountyId", + type: "uint256", + }, + { + internalType: "uint256", + name: "_submissionId", + type: "uint256", + }, + ], + name: "getBountySubmissions", + outputs: [ + { + components: [ + { + internalType: "address", + name: "submitter", + type: "address", + }, + { + internalType: "bytes", + name: "eegDataHash", + type: "bytes", + }, + ], + internalType: "struct Think2EarnBountyFactoryV1.Submission", + name: "", + type: "tuple", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "getVersion", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_bountyId", + type: "uint256", + }, + { + internalType: "bytes", + name: "_eegDataHash", + type: "bytes", + }, + ], + name: "submitEEGData", + outputs: [ + { + internalType: "uint256", + name: "submissionId", + type: "uint256", + }, + ], + stateMutability: "nonpayable", + type: "function", + }, + { + stateMutability: "payable", + type: "receive", + }, + ], + inheritedFunctions: {}, + }, + }, + 11155420: { + Think2Earn: { + address: "0x5B6260d9dB1e105c829704FcDC2b65E1399807Ee", + abi: [ + { + inputs: [], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "bountyId", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "numAcceptedSubmissions", + type: "uint256", + }, + ], + name: "BountyCompleted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "bountyId", + type: "uint256", + }, + { + indexed: false, + internalType: "string", + name: "name", + type: "string", + }, + { + indexed: false, + internalType: "string", + name: "description", + type: "string", + }, + { + indexed: false, + internalType: "string", + name: "mediaURI", + type: "string", + }, + { + indexed: false, + internalType: "uint256", + name: "reward", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "duration", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "judgeTime", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "maxProgress", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "creator", + type: "address", + }, + ], + name: "BountyCreated", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "bountyId", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "submissionId", + type: "uint256", + }, + { + indexed: false, + internalType: "address", + name: "submitter", + type: "address", + }, + { + indexed: false, + internalType: "bytes", + name: "eegDataHash", + type: "bytes", + }, + ], + name: "EEGDataSubmitted", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "address", + name: "sender", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "EtherDeposited", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: false, + internalType: "uint256", + name: "bountyId", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "submissionId", + type: "uint256", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "PaymentMade", + type: "event", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "activeBountyIds", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + name: "bounties", + outputs: [ + { + internalType: "string", + name: "name", + type: "string", + }, + { + internalType: "string", + name: "description", + type: "string", + }, + { + internalType: "string", + name: "mediaURI", type: "string", }, { @@ -352,7 +931,7 @@ const deployedContracts = { }, { internalType: "string", - name: "mediaURIHash", + name: "mediaURI", type: "string", }, { @@ -398,9 +977,9 @@ const deployedContracts = { type: "address", }, { - internalType: "bytes32", + internalType: "bytes", name: "eegDataHash", - type: "bytes32", + type: "bytes", }, ], internalType: "struct Think2EarnBountyFactoryV1.Submission[]", @@ -526,9 +1105,9 @@ const deployedContracts = { type: "address", }, { - internalType: "bytes32", + internalType: "bytes", name: "eegDataHash", - type: "bytes32", + type: "bytes", }, ], internalType: "struct Think2EarnBountyFactoryV1.Submission", @@ -560,9 +1139,9 @@ const deployedContracts = { type: "uint256", }, { - internalType: "bytes32", + internalType: "bytes", name: "_eegDataHash", - type: "bytes32", + type: "bytes", }, ], name: "submitEEGData", diff --git a/packages/subgraph/abis/localhost_Think2Earn.json b/packages/subgraph/abis/localhost_Think2Earn.json index e73c549..1adb83e 100644 --- a/packages/subgraph/abis/localhost_Think2Earn.json +++ b/packages/subgraph/abis/localhost_Think2Earn.json @@ -107,9 +107,9 @@ }, { "indexed": false, - "internalType": "bytes32", + "internalType": "bytes", "name": "eegDataHash", - "type": "bytes32" + "type": "bytes" } ], "name": "EEGDataSubmitted", @@ -200,7 +200,7 @@ }, { "internalType": "string", - "name": "mediaURIHash", + "name": "mediaURI", "type": "string" }, { @@ -342,7 +342,7 @@ }, { "internalType": "string", - "name": "mediaURIHash", + "name": "mediaURI", "type": "string" }, { @@ -388,9 +388,9 @@ "type": "address" }, { - "internalType": "bytes32", + "internalType": "bytes", "name": "eegDataHash", - "type": "bytes32" + "type": "bytes" } ], "internalType": "struct Think2EarnBountyFactoryV1.Submission[]", @@ -516,9 +516,9 @@ "type": "address" }, { - "internalType": "bytes32", + "internalType": "bytes", "name": "eegDataHash", - "type": "bytes32" + "type": "bytes" } ], "internalType": "struct Think2EarnBountyFactoryV1.Submission", @@ -550,9 +550,9 @@ "type": "uint256" }, { - "internalType": "bytes32", + "internalType": "bytes", "name": "_eegDataHash", - "type": "bytes32" + "type": "bytes" } ], "name": "submitEEGData", diff --git a/packages/subgraph/networks.json b/packages/subgraph/networks.json index 2afb4c1..2c058db 100644 --- a/packages/subgraph/networks.json +++ b/packages/subgraph/networks.json @@ -4,7 +4,7 @@ "address": "0x5FbDB2315678afecb367f032d93F642f64180aa3" }, "Think2Earn": { - "address": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9" + "address": "0x5FbDB2315678afecb367f032d93F642f64180aa3" } } } \ No newline at end of file diff --git a/packages/subgraph/subgraph.yaml b/packages/subgraph/subgraph.yaml index e1f7fd3..052c33e 100644 --- a/packages/subgraph/subgraph.yaml +++ b/packages/subgraph/subgraph.yaml @@ -9,7 +9,7 @@ dataSources: network: localhost source: abi: Think2Earn - address: "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9" + address: "0x5FbDB2315678afecb367f032d93F642f64180aa3" mapping: kind: ethereum/events apiVersion: 0.0.6