diff --git a/abi/ParanetsRegistry.json b/abi/ParanetsRegistry.json index b9e6e7ef..4810d44e 100644 --- a/abi/ParanetsRegistry.json +++ b/abi/ParanetsRegistry.json @@ -39,6 +39,11 @@ "internalType": "uint72", "name": "identityId", "type": "uint72" + }, + { + "internalType": "bytes", + "name": "nodeId", + "type": "bytes" } ], "name": "addCuratedNode", @@ -220,9 +225,21 @@ "name": "getCuratedNodes", "outputs": [ { - "internalType": "uint72[]", + "components": [ + { + "internalType": "uint72", + "name": "identityId", + "type": "uint72" + }, + { + "internalType": "bytes", + "name": "nodeId", + "type": "bytes" + } + ], + "internalType": "struct ParanetStructs.Node[]", "name": "", - "type": "uint72[]" + "type": "tuple[]" } ], "stateMutability": "view", diff --git a/contracts/v2/paranets/Paranet.sol b/contracts/v2/paranets/Paranet.sol index 6907879e..80d7aaef 100644 --- a/contracts/v2/paranets/Paranet.sol +++ b/contracts/v2/paranets/Paranet.sol @@ -264,7 +264,7 @@ contract Paranet is Named, Versioned, ContractStatusV2, Initializable { revert ParanetErrors.ParanetCuratedNodeHasAlreadyBeenAdded(paranetId, identityIds[i]); } - pr.addCuratedNode(paranetId, identityIds[i]); + pr.addCuratedNode(paranetId, identityIds[i], ps.getNodeId(identityIds[i])); emit ParanetCuratedNodeAdded(paranetKAStorageContract, paranetKATokenId, identityIds[i]); @@ -410,7 +410,7 @@ contract Paranet is Named, Versioned, ContractStatusV2, Initializable { paranetNodeJoinRequests.length - 1, ParanetStructs.RequestStatus.APPROVED ); - pr.addCuratedNode(paranetId, identityId); + pr.addCuratedNode(paranetId, identityId, profileStorage.getNodeId(identityId)); emit ParanetCuratedNodeJoinRequestAccepted(paranetKAStorageContract, paranetKATokenId, identityId); emit ParanetCuratedNodeAdded(paranetKAStorageContract, paranetKATokenId, identityId); diff --git a/contracts/v2/storage/paranets/ParanetsRegistry.sol b/contracts/v2/storage/paranets/ParanetsRegistry.sol index 522cc7b3..ef044d3f 100644 --- a/contracts/v2/storage/paranets/ParanetsRegistry.sol +++ b/contracts/v2/storage/paranets/ParanetsRegistry.sol @@ -193,23 +193,23 @@ contract ParanetsRegistry is Named, Versioned, HubDependentV2 { return paranets[paranetId].paranetNodeJoinRequests[identityId].length; } - function addCuratedNode(bytes32 paranetId, uint72 identityId) external onlyContracts { + function addCuratedNode(bytes32 paranetId, uint72 identityId, bytes calldata nodeId) external onlyContracts { paranets[paranetId].curatedNodesIndexes[identityId] = paranets[paranetId].curatedNodes.length; - paranets[paranetId].curatedNodes.push(identityId); + paranets[paranetId].curatedNodes.push(ParanetStructs.Node({identityId: identityId, nodeId: nodeId})); } function removeCuratedNode(bytes32 paranetId, uint72 identityId) external onlyContracts { paranets[paranetId].curatedNodes[paranets[paranetId].curatedNodesIndexes[identityId]] = paranets[paranetId] .curatedNodes[paranets[paranetId].curatedNodes.length - 1]; paranets[paranetId].curatedNodesIndexes[ - paranets[paranetId].curatedNodes[paranets[paranetId].curatedNodes.length - 1] + paranets[paranetId].curatedNodes[paranets[paranetId].curatedNodes.length - 1].identityId ] = paranets[paranetId].curatedNodesIndexes[identityId]; delete paranets[paranetId].curatedNodesIndexes[identityId]; paranets[paranetId].curatedNodes.pop(); } - function getCuratedNodes(bytes32 paranetId) external view returns (uint72[] memory) { + function getCuratedNodes(bytes32 paranetId) external view returns (ParanetStructs.Node[] memory) { return paranets[paranetId].curatedNodes; } @@ -219,7 +219,8 @@ contract ParanetsRegistry is Named, Versioned, HubDependentV2 { function isCuratedNode(bytes32 paranetId, uint72 identityId) external view returns (bool) { return (paranets[paranetId].curatedNodes.length != 0 && - paranets[paranetId].curatedNodes[paranets[paranetId].curatedNodesIndexes[identityId]] == identityId); + paranets[paranetId].curatedNodes[paranets[paranetId].curatedNodesIndexes[identityId]].identityId == + identityId); } function getIncentivesPoolAddress( diff --git a/contracts/v2/structs/paranets/ParanetStructs.sol b/contracts/v2/structs/paranets/ParanetStructs.sol index c1f8a550..21d500c5 100644 --- a/contracts/v2/structs/paranets/ParanetStructs.sol +++ b/contracts/v2/structs/paranets/ParanetStructs.sol @@ -24,6 +24,11 @@ library ParanetStructs { OPEN } + struct Node { + uint72 identityId; + bytes nodeId; + } + enum RequestStatus { NONE, PENDING, @@ -55,7 +60,7 @@ library ParanetStructs { KnowledgeAssetsAccessPolicy knowledgeAssetsAccessPolicy; uint96 cumulativeKnowledgeValue; UnorderedNamedContractDynamicSetStructs.Set incentivesPools; - uint72[] curatedNodes; + Node[] curatedNodes; // Identity ID => Index in the array mapping(uint72 => uint256) curatedNodesIndexes; // Identity ID => Requests Array diff --git a/deployments/base_sepolia_dev_contracts.json b/deployments/base_sepolia_v8_dev_contracts.json similarity index 100% rename from deployments/base_sepolia_dev_contracts.json rename to deployments/base_sepolia_v8_dev_contracts.json diff --git a/deployments/base_sepolia_v8_stable_dev_contracts.json b/deployments/base_sepolia_v8_stable_dev_contracts.json new file mode 100644 index 00000000..5e0f9c81 --- /dev/null +++ b/deployments/base_sepolia_v8_stable_dev_contracts.json @@ -0,0 +1,323 @@ +{ + "contracts": { + "Token": { + "deployed": true, + "evmAddress": "0x4ead53ee0aaeB0bE5920DC2DAA7AD93F11cA5207" + }, + "Hub": { + "evmAddress": "0xAB4A4794Fc1F415C24807B947280aCa8dC492238", + "version": "2.0.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791507, + "deploymentTimestamp": 1727351309594, + "deployed": true + }, + "HubController": { + "evmAddress": "0xd12cE57C28c164c7eBA742e3683a790BACe6851B", + "version": "1.0.2", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791511, + "deploymentTimestamp": 1727351313153, + "deployed": true + }, + "ParametersStorage": { + "evmAddress": "0xb780B7A0531B871f47BbeB3CB2A235D62c3f0374", + "version": "1.1.1", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791516, + "deploymentTimestamp": 1727351322901, + "deployed": true + }, + "WhitelistStorage": { + "evmAddress": "0x7d43Fa0A793d6759eE09b56d358B26d71C5F7758", + "version": "1.0.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791525, + "deploymentTimestamp": 1727351345743, + "deployed": true + }, + "HashingProxy": { + "evmAddress": "0xf1FaFc1378A441AC467186a98a98775818465480", + "version": "1.0.1", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791530, + "deploymentTimestamp": 1727351350864, + "deployed": true + }, + "SHA256": { + "evmAddress": "0x73Ad3e7A56D68fF2C074e57539B4040c807AC2d4", + "version": null, + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791533, + "deploymentTimestamp": 1727351360404, + "deployed": true + }, + "ScoringProxy": { + "evmAddress": "0x9Fdb04CFc7fc43789C3B4eba7b160085DA4EfE8a", + "version": "2.0.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791537, + "deploymentTimestamp": 1727351364586, + "deployed": true + }, + "LinearSum": { + "evmAddress": "0xcE515a978593d625fD916cB2f850dA5C197BFE18", + "version": null, + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791540, + "deploymentTimestamp": 1727351374426, + "deployed": true + }, + "AssertionStorage": { + "evmAddress": "0x1B2736d909AA0e35B3c75f38Ac28A4BC095A7251", + "version": "1.0.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791546, + "deploymentTimestamp": 1727351382970, + "deployed": true + }, + "IdentityStorage": { + "evmAddress": "0x621Edf029F050b6fe343d960116efF6Ebfef8cCb", + "version": "2.0.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791549, + "deploymentTimestamp": 1727351393051, + "deployed": true + }, + "ShardingTableStorage": { + "evmAddress": "0x5109f4c57D6F7ffabD0854e5D470fA51Be3998A5", + "version": "2.0.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791554, + "deploymentTimestamp": 1727351403372, + "deployed": true + }, + "StakingStorage": { + "evmAddress": "0xa5CB92049217AD78b160a82F3eD9783D57cd145D", + "version": "1.0.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791559, + "deploymentTimestamp": 1727351409128, + "deployed": true + }, + "ProfileStorage": { + "evmAddress": "0x71E82E0055bd367522a8574159C8b982c0121816", + "version": "1.0.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791562, + "deploymentTimestamp": 1727351418964, + "deployed": true + }, + "ServiceAgreementStorageV1": { + "evmAddress": "0x46b3265115466B3aa8Ee84D9500a7D7510081C87", + "version": "1.0.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791567, + "deploymentTimestamp": 1727351424670, + "deployed": true + }, + "ServiceAgreementStorageV1U1": { + "evmAddress": "0x19C1Fdd0766aA7A6F721E203cBD53F7139678E38", + "version": "1.0.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791570, + "deploymentTimestamp": 1727351435749, + "deployed": true + }, + "ServiceAgreementStorageProxy": { + "evmAddress": "0x65a64382307756AE0c2fCeE76Af6030B1b61529a", + "version": "1.0.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791575, + "deploymentTimestamp": 1727351441180, + "deployed": true + }, + "ContentAssetStorage": { + "evmAddress": "0x318c174B9E568Fe1FA4F5Ad57D7896688c492008", + "version": "2.0.1", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791578, + "deploymentTimestamp": 1727351451833, + "deployed": true + }, + "UnfinalizedStateStorage": { + "evmAddress": "0xdEb91AC85a811ff54936c5c5EB7e2F1A6FA8e225", + "version": "1.0.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791583, + "deploymentTimestamp": 1727351457464, + "deployed": true + }, + "ParanetsRegistry": { + "evmAddress": "0xC9d393BdffDD468EAC68A0DCB1869ddF84244d6C", + "version": "2.2.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791586, + "deploymentTimestamp": 1727351462733, + "deployed": true + }, + "ParanetServicesRegistry": { + "evmAddress": "0x11089dadA70EaD3aE06De0B8d73F2a64930d8AA2", + "version": "2.1.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791589, + "deploymentTimestamp": 1727351472934, + "deployed": true + }, + "ParanetKnowledgeAssetsRegistry": { + "evmAddress": "0x1A9F9A234713C11254C674c5Df853b1BAD156F55", + "version": "2.0.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791594, + "deploymentTimestamp": 1727351483370, + "deployed": true + }, + "ParanetKnowledgeMinersRegistry": { + "evmAddress": "0xC1E5c7BcE3CcB0fE9A0579e6c522753da91B1d89", + "version": "2.0.1", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791599, + "deploymentTimestamp": 1727351493410, + "deployed": true + }, + "Assertion": { + "evmAddress": "0xa27bd17c46fEf6d5286886FCA126F2b37eBFF21F", + "version": "1.0.1", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791604, + "deploymentTimestamp": 1727351503415, + "deployed": true + }, + "Identity": { + "evmAddress": "0x0A3c324FF55888D68Ea0768814e280681B19ffc6", + "version": "1.1.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791609, + "deploymentTimestamp": 1727351509585, + "deployed": true + }, + "ShardingTable": { + "evmAddress": "0xbBFA7AA273296D450B08f042cca905b3D7e1e218", + "version": "2.0.1", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791612, + "deploymentTimestamp": 1727351515111, + "deployed": true + }, + "NodeOperatorFeesStorage": { + "evmAddress": "0x2687Bb24F8d35777d6B0D472A426208c091f4f9F", + "version": "2.0.2", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791616, + "deploymentTimestamp": 1727351526685, + "deployed": true + }, + "Staking": { + "evmAddress": "0xa3aB2007dd4E38aEdA3c6360C04061E81d40c060", + "version": "2.2.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791621, + "deploymentTimestamp": 1727351537118, + "deployed": true + }, + "Profile": { + "evmAddress": "0x6ce50cC46c14fb48e752Fc42d252C2AeC4d614a1", + "version": "1.2.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791626, + "deploymentTimestamp": 1727351547663, + "deployed": true + }, + "CommitManagerV1": { + "evmAddress": "0xB16fcBE3e46Df5bbB2DF0159c2d94Be9091287B0", + "version": "2.0.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791631, + "deploymentTimestamp": 1727351553084, + "deployed": true + }, + "CommitManagerV1U1": { + "evmAddress": "0x3dA5419246753C969cc135e1A992b6cB7f3eF8E9", + "version": "2.0.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791635, + "deploymentTimestamp": 1727351561192, + "deployed": true + }, + "ProofManagerV1": { + "evmAddress": "0x7F0770e7bE82D6ee7Bb7dd9eEBa0e8a8a1C1deE5", + "version": "1.0.3", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791640, + "deploymentTimestamp": 1727351575634, + "deployed": true + }, + "ProofManagerV1U1": { + "evmAddress": "0x29e64f8Ef6438D534aE8365c7a7E22FA908166dC", + "version": "1.0.3", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791646, + "deploymentTimestamp": 1727351583414, + "deployed": true + }, + "ServiceAgreementV1": { + "evmAddress": "0xBcf47dbF6186fF117a53CDE20d0669e88A357479", + "version": "1.1.1", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791651, + "deploymentTimestamp": 1727351597123, + "deployed": true + }, + "ContentAsset": { + "evmAddress": "0xb7EA5D780638e71C78622865439BdF1e1B392e40", + "version": "2.1.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791656, + "deploymentTimestamp": 1727351603382, + "deployed": true + }, + "Paranet": { + "evmAddress": "0xeEC264Cf4BDa4bD386847B26d2c6A2A36e597326", + "version": "2.2.0", + "gitBranch": "improvement/curated-paranet-nodes", + "gitCommitHash": "de5edfde0f044d13bcdec8a33baaec934e2b62c4", + "deploymentBlock": 15791659, + "deploymentTimestamp": 1727351609154, + "deployed": true + } + } +} diff --git a/hardhat.config.ts b/hardhat.config.ts index 8b5278e4..568e8d3f 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -31,24 +31,6 @@ extendEnvironment((hre: HardhatRuntimeEnvironment) => { config.networks = { ...config.networks, - otp_alphanet: { - environment: 'devnet', - chainId: 2043, - url: rpc('otp_alphanet'), - gas: 10_000_000, // Gas limit used for deployments - gasPrice: 20, - accounts: accounts('otp_alphanet'), - saveDeployments: false, - }, - otp_devnet: { - environment: 'devnet', - chainId: 2160, - url: rpc('otp_devnet'), - gas: 10_000_000, // Gas limit used for deployments - gasPrice: 1_000_000, - accounts: accounts('otp_devnet'), - saveDeployments: false, - }, otp_testnet: { environment: 'testnet', chainId: 20430, @@ -67,14 +49,6 @@ config.networks = { accounts: accounts('otp_mainnet'), saveDeployments: false, }, - gnosis_chiado_dev: { - environment: 'devnet', - chainId: 10200, - url: rpc('gnosis_chiado_dev'), - gasPrice: 1_000_000_000, - accounts: accounts('gnosis_chiado_dev'), - saveDeployments: false, - }, gnosis_chiado_test: { environment: 'testnet', chainId: 10200, @@ -90,12 +64,20 @@ config.networks = { accounts: accounts('gnosis_mainnet'), saveDeployments: false, }, - base_sepolia_dev: { + base_sepolia_v8_dev: { + environment: 'devnet', + chainId: 84532, + url: rpc('base_sepolia_v8_dev'), + gasPrice: 1_000_000_000, + accounts: accounts('base_sepolia_v8_dev'), + saveDeployments: false, + }, + base_sepolia_v8_stable_dev: { environment: 'devnet', chainId: 84532, - url: rpc('base_sepolia_dev'), + url: rpc('base_sepolia_v8_stable_dev'), gasPrice: 1_000_000_000, - accounts: accounts('base_sepolia_dev'), + accounts: accounts('base_sepolia_v8_stable_dev'), saveDeployments: false, }, base_sepolia_test: { diff --git a/package.json b/package.json index 1446c74d..16cb73fb 100644 --- a/package.json +++ b/package.json @@ -88,15 +88,14 @@ "deploy:v1:otp_mainnet": "hardhat deploy --network otp_mainnet --tags v1", "deploy:v1:otp_testnet": "hardhat deploy --network otp_testnet --tags v1", "deploy:v1": "hardhat deploy --tags v1", - "deploy:v2:base_sepolia_dev": "hardhat deploy --network base_sepolia_dev --tags v1,v2", + "deploy:v2:base_sepolia_v8_dev": "hardhat deploy --network base_sepolia_v8_dev --tags v1,v2", + "deploy:v2:base_sepolia_v8_stable_dev": "hardhat deploy --network base_sepolia_v8_stable_dev --tags v1,v2", "deploy:v2:base_sepolia_test": "hardhat deploy --network base_sepolia_test --tags v1,v2", "deploy:v2:base_mainnet": "hardhat deploy --network base_mainnet --tags v1,v2", - "deploy:v2:gnosis_chiado_dev": "hardhat deploy --network gnosis_chiado_dev --tags v1,v2", "deploy:v2:gnosis_chiado_test": "hardhat deploy --network gnosis_chiado_test --tags v1,v2", "deploy:v2:gnosis_mainnet": "hardhat deploy --network gnosis_mainnet --tags v1,v2", "deploy:v2:localhost": "hardhat deploy --network hardhat --tags v1,v2", "deploy:v2:otp_alphanet": "hardhat deploy --network otp_alphanet --tags v1,v2", - "deploy:v2:otp_devnet": "hardhat deploy --network otp_devnet --tags v1,v2", "deploy:v2:otp_mainnet": "hardhat deploy --network otp_mainnet --tags v1,v2", "deploy:v2:otp_testnet": "hardhat deploy --network otp_testnet --tags v1,v2", "deploy:v2": "hardhat deploy --tags v1,v2",