From f563b34592f68016bd90df62caea477104329641 Mon Sep 17 00:00:00 2001 From: xhad Date: Mon, 1 Apr 2024 01:47:32 -0400 Subject: [PATCH 1/2] chore: Deploy new registry subgraph v0.0.2 --- README.md | 39 +- subgraphs/chamber/abis/Chamber.json | 663 +++++----------------------- 2 files changed, 106 insertions(+), 596 deletions(-) diff --git a/README.md b/README.md index ea66865..c4fb842 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,15 @@ ## Loreum Subgraphs -You will need to have a local docker engine running. -1. Open three terminals: - -*terminal 1* - -Start the docker stack. -```shell -# for intel machines -yarn intel -# for macs -yarn mac ``` -NOTE: You should see blocks ticking on local evm - -*terminal 2* - -Compile and deploy the contracts in loreum-org/loreum-nft -```shell -yarn compile -yarn deploy:local -yarn cycle -``` - -*terminal 3* - -Compile and deploy the subgraph -```shell -cd subgraphs/loreum-nft +yarn install +yarn build yarn codegen -yarn build:local yarn test -yarn create:local -yarn deploy:local +yarn format +yarn lint ``` -NOTE: If your evm isn't ticking or functionality is off, you may need to prune your docker images: -`docker system prune --volumes` \ No newline at end of file +| Release | Subgraph | URL | +| --------- | ------------------------- | ---------------------------------------------------------------------------| +| vX.X.X | loreum-registry-sepolia | https://api.studio.thegraph.com/query/67520/loreum-registry-sepolia/v0.0.2 | diff --git a/subgraphs/chamber/abis/Chamber.json b/subgraphs/chamber/abis/Chamber.json index 492cd75..130026e 100644 --- a/subgraphs/chamber/abis/Chamber.json +++ b/subgraphs/chamber/abis/Chamber.json @@ -1,60 +1,24 @@ [ - { - "type": "constructor", - "inputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "fallback", - "stateMutability": "payable" - }, - { - "type": "receive", - "stateMutability": "payable" - }, + { "type": "constructor", "inputs": [], "stateMutability": "nonpayable" }, + { "type": "fallback", "stateMutability": "payable" }, + { "type": "receive", "stateMutability": "payable" }, { "type": "function", "name": "accountDelegation", "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } + { "name": "", "type": "address", "internalType": "address" }, + { "name": "", "type": "uint256", "internalType": "uint256" } ], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "approve", "inputs": [ - { - "name": "proposalId", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "tokenId", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "signature", - "type": "bytes", - "internalType": "bytes" - } + { "name": "proposalId", "type": "uint256", "internalType": "uint256" }, + { "name": "tokenId", "type": "uint256", "internalType": "uint256" }, + { "name": "signature", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" @@ -62,13 +26,7 @@ { "type": "function", "name": "cancel", - "inputs": [ - { - "name": "proposalId", - "type": "uint256", - "internalType": "uint256" - } - ], + "inputs": [{ "name": "proposalId", "type": "uint256", "internalType": "uint256" }], "outputs": [], "stateMutability": "nonpayable" }, @@ -76,45 +34,19 @@ "type": "function", "name": "constructMessageHash", "inputs": [ - { - "name": "proposalId", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "tokenId", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } + { "name": "proposalId", "type": "uint256", "internalType": "uint256" }, + { "name": "tokenId", "type": "uint256", "internalType": "uint256" } ], + "outputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }], "stateMutability": "view" }, { "type": "function", "name": "create", "inputs": [ - { - "name": "targets", - "type": "address[]", - "internalType": "address[]" - }, - { - "name": "values", - "type": "uint256[]", - "internalType": "uint256[]" - }, - { - "name": "datas", - "type": "bytes[]", - "internalType": "bytes[]" - } + { "name": "targets", "type": "address[]", "internalType": "address[]" }, + { "name": "values", "type": "uint256[]", "internalType": "uint256[]" }, + { "name": "datas", "type": "bytes[]", "internalType": "bytes[]" } ], "outputs": [], "stateMutability": "nonpayable" @@ -123,16 +55,8 @@ "type": "function", "name": "demote", "inputs": [ - { - "name": "amount", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "tokenId", - "type": "uint256", - "internalType": "uint256" - } + { "name": "amount", "type": "uint256", "internalType": "uint256" }, + { "name": "tokenId", "type": "uint256", "internalType": "uint256" } ], "outputs": [], "stateMutability": "nonpayable" @@ -141,34 +65,16 @@ "type": "function", "name": "domainSeparator", "inputs": [], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], + "outputs": [{ "name": "", "type": "bytes32", "internalType": "bytes32" }], "stateMutability": "view" }, { "type": "function", "name": "execute", "inputs": [ - { - "name": "proposalId", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "tokenId", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "signature", - "type": "bytes", - "internalType": "bytes" - } + { "name": "proposalId", "type": "uint256", "internalType": "uint256" }, + { "name": "tokenId", "type": "uint256", "internalType": "uint256" }, + { "name": "signature", "type": "bytes", "internalType": "bytes" } ], "outputs": [], "stateMutability": "nonpayable" @@ -178,16 +84,8 @@ "name": "getLeaderboard", "inputs": [], "outputs": [ - { - "name": "", - "type": "uint256[]", - "internalType": "uint256[]" - }, - { - "name": "", - "type": "uint256[]", - "internalType": "uint256[]" - } + { "name": "", "type": "uint256[]", "internalType": "uint256[]" }, + { "name": "", "type": "uint256[]", "internalType": "uint256[]" } ], "stateMutability": "view" }, @@ -195,29 +93,15 @@ "type": "function", "name": "govToken", "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], + "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "initialize", "inputs": [ - { - "name": "_memberToken", - "type": "address", - "internalType": "address" - }, - { - "name": "_govToken", - "type": "address", - "internalType": "address" - } + { "name": "_memberToken", "type": "address", "internalType": "address" }, + { "name": "_govToken", "type": "address", "internalType": "address" } ], "outputs": [], "stateMutability": "nonpayable" @@ -225,187 +109,75 @@ { "type": "function", "name": "leaderboard", - "inputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], + "inputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "locked", "inputs": [], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], + "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "memberToken", "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], + "outputs": [{ "name": "", "type": "address", "internalType": "address" }], "stateMutability": "view" }, { "type": "function", "name": "nonce", "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "onERC1155BatchReceived", "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - }, - { - "name": "", - "type": "address", - "internalType": "address" - }, - { - "name": "", - "type": "uint256[]", - "internalType": "uint256[]" - }, - { - "name": "", - "type": "uint256[]", - "internalType": "uint256[]" - }, - { - "name": "", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes4", - "internalType": "bytes4" - } + { "name": "", "type": "address", "internalType": "address" }, + { "name": "", "type": "address", "internalType": "address" }, + { "name": "", "type": "uint256[]", "internalType": "uint256[]" }, + { "name": "", "type": "uint256[]", "internalType": "uint256[]" }, + { "name": "", "type": "bytes", "internalType": "bytes" } ], + "outputs": [{ "name": "", "type": "bytes4", "internalType": "bytes4" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "onERC1155Received", "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - }, - { - "name": "", - "type": "address", - "internalType": "address" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes4", - "internalType": "bytes4" - } + { "name": "", "type": "address", "internalType": "address" }, + { "name": "", "type": "address", "internalType": "address" }, + { "name": "", "type": "uint256", "internalType": "uint256" }, + { "name": "", "type": "uint256", "internalType": "uint256" }, + { "name": "", "type": "bytes", "internalType": "bytes" } ], + "outputs": [{ "name": "", "type": "bytes4", "internalType": "bytes4" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "onERC721Received", "inputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - }, - { - "name": "", - "type": "address", - "internalType": "address" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes4", - "internalType": "bytes4" - } + { "name": "", "type": "address", "internalType": "address" }, + { "name": "", "type": "address", "internalType": "address" }, + { "name": "", "type": "uint256", "internalType": "uint256" }, + { "name": "", "type": "bytes", "internalType": "bytes" } ], + "outputs": [{ "name": "", "type": "bytes4", "internalType": "bytes4" }], "stateMutability": "nonpayable" }, { "type": "function", "name": "promote", "inputs": [ - { - "name": "amount", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "tokenId", - "type": "uint256", - "internalType": "uint256" - } + { "name": "amount", "type": "uint256", "internalType": "uint256" }, + { "name": "tokenId", "type": "uint256", "internalType": "uint256" } ], "outputs": [], "stateMutability": "nonpayable" @@ -413,222 +185,87 @@ { "type": "function", "name": "proposal", - "inputs": [ - { - "name": "proposalId", - "type": "uint256", - "internalType": "uint256" - } - ], + "inputs": [{ "name": "proposalId", "type": "uint256", "internalType": "uint256" }], "outputs": [ - { - "name": "approvals", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "state", - "type": "uint8", - "internalType": "enum IChamber.State" - } + { "name": "approvals", "type": "uint256", "internalType": "uint256" }, + { "name": "state", "type": "uint8", "internalType": "enum IChamber.State" } ], "stateMutability": "view" }, { "type": "function", "name": "setGuard", - "inputs": [ - { - "name": "guard", - "type": "address", - "internalType": "address" - } - ], + "inputs": [{ "name": "guard", "type": "address", "internalType": "address" }], "outputs": [], "stateMutability": "nonpayable" }, { "type": "function", "name": "supportsInterface", - "inputs": [ - { - "name": "interfaceId", - "type": "bytes4", - "internalType": "bytes4" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], + "inputs": [{ "name": "interfaceId", "type": "bytes4", "internalType": "bytes4" }], + "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "totalDelegation", - "inputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], + "inputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], + "outputs": [{ "name": "", "type": "uint256", "internalType": "uint256" }], "stateMutability": "view" }, { "type": "function", "name": "verifySignature", "inputs": [ - { - "name": "proposalId", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "tokenId", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "signature", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } + { "name": "proposalId", "type": "uint256", "internalType": "uint256" }, + { "name": "tokenId", "type": "uint256", "internalType": "uint256" }, + { "name": "signature", "type": "bytes", "internalType": "bytes" } ], + "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "function", "name": "voted", "inputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } + { "name": "", "type": "uint256", "internalType": "uint256" }, + { "name": "", "type": "uint256", "internalType": "uint256" } ], + "outputs": [{ "name": "", "type": "bool", "internalType": "bool" }], "stateMutability": "view" }, { "type": "event", "name": "ApprovedProposal", "inputs": [ - { - "name": "proposalId", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "tokenId", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "approvals", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } + { "name": "proposalId", "type": "uint256", "indexed": false, "internalType": "uint256" }, + { "name": "tokenId", "type": "uint256", "indexed": false, "internalType": "uint256" }, + { "name": "approvals", "type": "uint256", "indexed": false, "internalType": "uint256" } ], "anonymous": false }, { "type": "event", "name": "CanceledProposal", - "inputs": [ - { - "name": "proposalId", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], + "inputs": [{ "name": "proposalId", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "ChangedGuard", - "inputs": [ - { - "name": "guard", - "type": "address", - "indexed": true, - "internalType": "address" - } - ], + "inputs": [{ "name": "guard", "type": "address", "indexed": true, "internalType": "address" }], "anonymous": false }, { "type": "event", "name": "CreatedProposal", "inputs": [ - { - "name": "proposalId", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "target", - "type": "address[]", - "indexed": false, - "internalType": "address[]" - }, - { - "name": "value", - "type": "uint256[]", - "indexed": false, - "internalType": "uint256[]" - }, - { - "name": "data", - "type": "bytes[]", - "indexed": false, - "internalType": "bytes[]" - }, - { - "name": "voters", - "type": "uint256[5]", - "indexed": false, - "internalType": "uint256[5]" - }, - { - "name": "nonce", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } + { "name": "proposalId", "type": "uint256", "indexed": false, "internalType": "uint256" }, + { "name": "target", "type": "address[]", "indexed": false, "internalType": "address[]" }, + { "name": "value", "type": "uint256[]", "indexed": false, "internalType": "uint256[]" }, + { "name": "data", "type": "bytes[]", "indexed": false, "internalType": "bytes[]" }, + { "name": "voters", "type": "uint256[5]", "indexed": false, "internalType": "uint256[5]" }, + { "name": "nonce", "type": "uint256", "indexed": false, "internalType": "uint256" } ], "anonymous": false }, @@ -636,75 +273,31 @@ "type": "event", "name": "Demotion", "inputs": [ - { - "name": "demoter", - "type": "address", - "indexed": false, - "internalType": "address" - }, - { - "name": "amt", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "tokenId", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } + { "name": "demoter", "type": "address", "indexed": false, "internalType": "address" }, + { "name": "amt", "type": "uint256", "indexed": false, "internalType": "uint256" }, + { "name": "tokenId", "type": "uint256", "indexed": false, "internalType": "uint256" } ], "anonymous": false }, { "type": "event", "name": "ExecutedProposal", - "inputs": [ - { - "name": "proposalId", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], + "inputs": [{ "name": "proposalId", "type": "uint256", "indexed": false, "internalType": "uint256" }], "anonymous": false }, { "type": "event", "name": "Initialized", - "inputs": [ - { - "name": "version", - "type": "uint8", - "indexed": false, - "internalType": "uint8" - } - ], + "inputs": [{ "name": "version", "type": "uint8", "indexed": false, "internalType": "uint8" }], "anonymous": false }, { "type": "event", "name": "Promotion", "inputs": [ - { - "name": "promoter", - "type": "address", - "indexed": false, - "internalType": "address" - }, - { - "name": "amt", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "tokenId", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } + { "name": "promoter", "type": "address", "indexed": false, "internalType": "address" }, + { "name": "amt", "type": "uint256", "indexed": false, "internalType": "uint256" }, + { "name": "tokenId", "type": "uint256", "indexed": false, "internalType": "uint256" } ], "anonymous": false }, @@ -712,18 +305,8 @@ "type": "event", "name": "ReceivedEther", "inputs": [ - { - "name": "sender", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "value", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } + { "name": "sender", "type": "address", "indexed": true, "internalType": "address" }, + { "name": "value", "type": "uint256", "indexed": false, "internalType": "uint256" } ], "anonymous": false }, @@ -731,70 +314,22 @@ "type": "event", "name": "ReceivedFallback", "inputs": [ - { - "name": "sender", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "value", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } + { "name": "sender", "type": "address", "indexed": true, "internalType": "address" }, + { "name": "value", "type": "uint256", "indexed": false, "internalType": "uint256" } ], "anonymous": false }, - { - "type": "error", - "name": "executionFailed", - "inputs": [] - }, - { - "type": "error", - "name": "insufficientBalance", - "inputs": [] - }, + { "type": "error", "name": "executionFailed", "inputs": [] }, + { "type": "error", "name": "insufficientBalance", "inputs": [] }, { "type": "error", "name": "invalidApproval", - "inputs": [ - { - "name": "message", - "type": "string", - "internalType": "string" - } - ] - }, - { - "type": "error", - "name": "invalidChangeAmount", - "inputs": [] - }, - { - "type": "error", - "name": "invalidDemotion", - "inputs": [] - }, - { - "type": "error", - "name": "invalidPromotion", - "inputs": [] - }, - { - "type": "error", - "name": "invalidProposalState", - "inputs": [] - }, - { - "type": "error", - "name": "invalidTokenOwner", - "inputs": [] - }, - { - "type": "error", - "name": "invalidVote", - "inputs": [] - } + "inputs": [{ "name": "message", "type": "string", "internalType": "string" }] + }, + { "type": "error", "name": "invalidChangeAmount", "inputs": [] }, + { "type": "error", "name": "invalidDemotion", "inputs": [] }, + { "type": "error", "name": "invalidPromotion", "inputs": [] }, + { "type": "error", "name": "invalidProposalState", "inputs": [] }, + { "type": "error", "name": "invalidTokenOwner", "inputs": [] }, + { "type": "error", "name": "invalidVote", "inputs": [] } ] From 62750013d5d8de343e55765fabdd2bea3a22b247 Mon Sep 17 00:00:00 2001 From: xhad Date: Mon, 1 Apr 2024 01:54:58 -0400 Subject: [PATCH 2/2] chore: Deploys sepolia --- subgraphs/chamber/subgraph.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subgraphs/chamber/subgraph.yaml b/subgraphs/chamber/subgraph.yaml index 9a33bbb..72b5230 100644 --- a/subgraphs/chamber/subgraph.yaml +++ b/subgraphs/chamber/subgraph.yaml @@ -4,11 +4,11 @@ schema: dataSources: - kind: ethereum name: Registry - network: holesky + network: sepolia source: abi: Registry - address: "0x5ed9315ab0274B0C546b71ed5a7ABE9982FF1E8D" - startBlock: 1175645 + address: "0x46A49D4391F2F220D3661b2a2BFe4b306EE18845" + startBlock: 5433794 mapping: kind: ethereum/events apiVersion: 0.0.7 @@ -30,7 +30,7 @@ dataSources: templates: - kind: ethereum name: Chamber - network: holesky + network: sepolia source: abi: Chamber mapping: