From 5756f47b75b5c1e9503ecbb3c905fac3ba7f75ea Mon Sep 17 00:00:00 2001 From: Uladzislau Hubar Date: Wed, 14 Feb 2024 12:26:02 +0100 Subject: [PATCH 1/2] Fixed unchecked initial operator fee in the Profile, redeployed contracts for Gnosis Mainnet --- abi/Profile.json | 17 + contracts/v1/Profile.sol | 15 +- contracts/v1/errors/ProfileErrors.sol | 1 + deploy/001_deploy_hub_v2.ts | 3 +- deploy/002_deploy_hub.ts | 3 +- deployments/gnosis_mainnet_contracts.json | 389 ++++++++++++---------- test/v1/unit/Profile.test.ts | 4 +- utils/helpers.ts | 11 + 8 files changed, 264 insertions(+), 179 deletions(-) diff --git a/abi/Profile.json b/abi/Profile.json index 5e67e6fa..5826a464 100644 --- a/abi/Profile.json +++ b/abi/Profile.json @@ -96,6 +96,17 @@ "name": "OnlyWhitelistedAddressesFunction", "type": "error" }, + { + "inputs": [ + { + "internalType": "uint8", + "name": "operatorFee", + "type": "uint8" + } + ], + "name": "OperatorFeeOutOfRange", + "type": "error" + }, { "inputs": [ { @@ -211,6 +222,12 @@ "internalType": "address", "name": "sharesContractAddress", "type": "address" + }, + { + "indexed": false, + "internalType": "uint8", + "name": "initialOperatorFee", + "type": "uint8" } ], "name": "ProfileCreated", diff --git a/contracts/v1/Profile.sol b/contracts/v1/Profile.sol index bfded4b1..1ecffd3f 100644 --- a/contracts/v1/Profile.sol +++ b/contracts/v1/Profile.sol @@ -22,12 +22,18 @@ import {UnorderedIndexableContractDynamicSetLib} from "./utils/UnorderedIndexabl import {ADMIN_KEY, OPERATIONAL_KEY} from "./constants/IdentityConstants.sol"; contract Profile is Named, Versioned, ContractStatus, Initializable { - event ProfileCreated(uint72 indexed identityId, bytes nodeId, address adminWallet, address sharesContractAddress); + event ProfileCreated( + uint72 indexed identityId, + bytes nodeId, + address adminWallet, + address sharesContractAddress, + uint8 initialOperatorFee + ); event ProfileDeleted(uint72 indexed identityId); event AskUpdated(uint72 indexed identityId, bytes nodeId, uint96 ask); string private constant _NAME = "Profile"; - string private constant _VERSION = "1.1.0"; + string private constant _VERSION = "1.1.1"; HashingProxy public hashingProxy; Identity public identityContract; @@ -119,6 +125,9 @@ contract Profile is Named, Versioned, ContractStatus, Initializable { if (ps.sharesSymbols(sharesTokenSymbol)) { revert ProfileErrors.SharesTokenSymbolAlreadyExists(sharesTokenSymbol); } + if (initialOperatorFee > 100) { + revert ProfileErrors.OperatorFeeOutOfRange(initialOperatorFee); + } uint72 identityId = id.createIdentity(msg.sender, adminWallet); id.addOperationalWallets(identityId, operationalWallets); @@ -129,7 +138,7 @@ contract Profile is Named, Versioned, ContractStatus, Initializable { stakingStorage.setOperatorFee(identityId, initialOperatorFee); - emit ProfileCreated(identityId, nodeId, adminWallet, address(sharesContract)); + emit ProfileCreated(identityId, nodeId, adminWallet, address(sharesContract), initialOperatorFee); } function setAsk(uint72 identityId, uint96 ask) external onlyIdentityOwner(identityId) { diff --git a/contracts/v1/errors/ProfileErrors.sol b/contracts/v1/errors/ProfileErrors.sol index 146e821f..09c5ce22 100644 --- a/contracts/v1/errors/ProfileErrors.sol +++ b/contracts/v1/errors/ProfileErrors.sol @@ -11,6 +11,7 @@ library ProfileErrors { error EmptySharesTokenSymbol(); error SharesTokenNameAlreadyExists(string tokenName); error SharesTokenSymbolAlreadyExists(string tokenSymbol); + error OperatorFeeOutOfRange(uint8 operatorFee); error ZeroAsk(); error NoOperatorFees(uint72 identityId); error ProfileDoesntExist(uint72 identityId); diff --git a/deploy/001_deploy_hub_v2.ts b/deploy/001_deploy_hub_v2.ts index 0da15b52..a1ecf231 100644 --- a/deploy/001_deploy_hub_v2.ts +++ b/deploy/001_deploy_hub_v2.ts @@ -19,7 +19,8 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const Hub = await hre.deployments.deploy('Hub', { contract: 'HubV2', from: deployer, log: true }); - hre.helpers.updateDeploymentsJson('Hub', Hub.address); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + hre.helpers.updateDeploymentsJson('Hub', Hub.address, Hub.receipt!.blockNumber); } } diff --git a/deploy/002_deploy_hub.ts b/deploy/002_deploy_hub.ts index fb372910..a4196ae8 100644 --- a/deploy/002_deploy_hub.ts +++ b/deploy/002_deploy_hub.ts @@ -19,7 +19,8 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) { const Hub = await hre.deployments.deploy('Hub', { from: deployer, log: true }); - hre.helpers.updateDeploymentsJson('Hub', Hub.address); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + hre.helpers.updateDeploymentsJson('Hub', Hub.address, Hub.receipt!.blockNumber); } } diff --git a/deployments/gnosis_mainnet_contracts.json b/deployments/gnosis_mainnet_contracts.json index 170bdb7e..30db8fb9 100644 --- a/deployments/gnosis_mainnet_contracts.json +++ b/deployments/gnosis_mainnet_contracts.json @@ -1,240 +1,285 @@ { "contracts": { - "Assertion": { + "Hub": { "deployed": true, - "deploymentTimestamp": 1703023107033, - "evmAddress": "0xB86D4A6deB4e507DF21A29efa00b908d39f730B3", + "deploymentTimestamp": 1703022869550, + "evmAddress": "0xbEF14fc04F870c2dD65c13Df4faB6ba01A9c746b", "gitBranch": "main", "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.1" + "version": "2.0.0" }, - "AssertionStorage": { + "HubController": { "deployed": true, - "deploymentTimestamp": 1703022989141, - "evmAddress": "0xff1c0D62eAC3fE4Fd69e42e587107fb5EaBf6836", + "deploymentTimestamp": 1703022879509, + "evmAddress": "0x48EA24e5C817C13215B3121bd6Fcc6B93D3c0caC", "gitBranch": "main", "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.0" + "version": "1.0.2" }, - "CommitManagerV1": { + "Token": { "deployed": true, - "deploymentTimestamp": 1703023158518, - "evmAddress": "0xa4809dFDD80DF5D79fE938d9e01E795A84E014CA", + "evmAddress": "0xEddd81E0792E764501AaE206EB432399a0268DB5" + }, + "ParametersStorage": { + "evmAddress": "0xce472e665287cDa46AE63696AE6d06A2ab2c041b", + "version": "1.1.1", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.1" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446787, + "deploymentTimestamp": 1707908232710, + "deployed": true }, - "CommitManagerV1U1": { - "deployed": true, - "deploymentTimestamp": 1703023188102, - "evmAddress": "0x40bb23901022b9b3B055bee49cCcd462c1756Db2", + "WhitelistStorage": { + "evmAddress": "0x50342047B2015E9ABe4d1a1f8748216F34017462", + "version": "1.0.0", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.1" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446791, + "deploymentTimestamp": 1707908266619, + "deployed": true }, - "ContentAsset": { - "deployed": true, - "deploymentTimestamp": 1703023247599, - "evmAddress": "0xa51BA17e7bE776ccf1FBe5177f7356b63486c54F", + "HashingProxy": { + "evmAddress": "0x6f67914ADA921383B0Caa7Ac6379d8b7eEfaaa51", + "version": "1.0.1", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.2" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446794, + "deploymentTimestamp": 1707908272894, + "deployed": true }, - "ContentAssetStorage": { - "deployed": true, - "deploymentTimestamp": 1703023075721, - "evmAddress": "0x9157595f26F6069A7c29e988c4249bA98A53c697", + "SHA256": { + "evmAddress": "0x5f47719edb91da6d0182Dd6eFbFCaBFF838d2E5D", + "version": null, "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "2.0.1" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446796, + "deploymentTimestamp": 1707908299324, + "deployed": true }, - "HashingProxy": { - "deployed": true, - "deploymentTimestamp": 1703022944891, - "evmAddress": "0xEAE9dE9AA95AFc43CAB20970f1883c4857bC4a16", + "ScoringProxy": { + "evmAddress": "0x54604eCee27f99ccA7eCd354F2524A2B9459b615", + "version": "2.0.0", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.1" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446800, + "deploymentTimestamp": 1707908309923, + "deployed": true }, - "Hub": { - "deployed": true, - "deploymentTimestamp": 1703022869550, - "evmAddress": "0xbEF14fc04F870c2dD65c13Df4faB6ba01A9c746b", + "Log2PLDSF": { + "evmAddress": "0xF0623380b172250e204cd6ab151Be2e51E47A0D3", + "version": null, "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "2.0.0" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446802, + "deploymentTimestamp": 1707908320008, + "deployed": true }, - "HubController": { - "deployed": true, - "deploymentTimestamp": 1703022879509, - "evmAddress": "0x48EA24e5C817C13215B3121bd6Fcc6B93D3c0caC", + "LinearSum": { + "evmAddress": "0x9E4474E2D161aC88Ea2064208630D9674dD465F0", + "version": null, "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.2" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446803, + "deploymentTimestamp": 1707908339610, + "deployed": true }, - "Identity": { - "deployed": true, - "deploymentTimestamp": 1703023115582, - "evmAddress": "0xd821411AA4347906CF3FB6B6F65391Ef3976ff2d", + "AssertionStorage": { + "evmAddress": "0x22FAF11FF0a3182B57067c88149f4F9f5633cf4c", + "version": "1.0.0", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.1" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446811, + "deploymentTimestamp": 1707908370080, + "deployed": true }, "IdentityStorage": { - "deployed": true, - "deploymentTimestamp": 1703022999913, - "evmAddress": "0x85f868877Ccd88e1cd7936443ceD093f7E67BA37", + "evmAddress": "0xe369328795B24853C53132186DE45757105f79e4", + "version": "2.0.0", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "2.0.0" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446832, + "deploymentTimestamp": 1707908485534, + "deployed": true }, - "Log2PLDSF": { - "deployed": true, - "deploymentTimestamp": 1703025999344, - "evmAddress": "0xcA9f750Cd07ACd2F1Ca9cB1d1Dfdcf19e2E9773e", - "gitBranch": "gnosis-mainnet-deployment", - "gitCommitHash": "e1347318d5badad802c1b802f3aa270be7843e26", - "version": null + "ShardingTableStorage": { + "evmAddress": "0xC6425168794Cb62B7E4288CF8bEa69e4EEB245Ae", + "version": "2.0.0", + "gitBranch": "main", + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446835, + "deploymentTimestamp": 1707908492282, + "deployed": true }, - "ParametersStorage": { - "deployed": true, - "deploymentTimestamp": 1703022903732, - "evmAddress": "0x394e73722B13F162778d9F9Ad0ce49f02aB51210", + "StakingStorage": { + "evmAddress": "0xC317969a8fBC36E3fD70351eC6Dd816662ABadCF", + "version": "1.0.0", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.1.0" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446837, + "deploymentTimestamp": 1707908502792, + "deployed": true }, - "Profile": { - "deployed": true, - "deploymentTimestamp": 1703023151472, - "evmAddress": "0x3Bb0F09B3625eF43afe1e590e4C41F63db7fF0C1", + "NodeOperatorFeeChangesStorage": { + "evmAddress": "0x1DB35c492dfe89AF6e808c3c85B694983Bb372c9", + "version": "2.0.0", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.2" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446839, + "deploymentTimestamp": 1707908520006, + "deployed": true }, "ProfileStorage": { - "deployed": true, - "deploymentTimestamp": 1703023027670, - "evmAddress": "0x8E24940cA87B23a742E70Ca93BD43a13211B2c4d", + "evmAddress": "0x5b52765a7A46196f7a8c7dBec234D3Df23248BB4", + "version": "1.0.0", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.0" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446841, + "deploymentTimestamp": 1707908531490, + "deployed": true }, - "ProofManagerV1": { - "deployed": true, - "deploymentTimestamp": 1703023171376, - "evmAddress": "0x3d2f4a8c4d33D21415bCC107cE65cEbC0108326b", + "ServiceAgreementStorageV1": { + "evmAddress": "0xF24DE7884A55DcD71c43f68BF2F174F1106fE1Dd", + "version": "1.0.0", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.2" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446843, + "deploymentTimestamp": 1707908537778, + "deployed": true }, - "ProofManagerV1U1": { - "deployed": true, - "deploymentTimestamp": 1703023211461, - "evmAddress": "0xa606689669BABb9C0D48A9B9C5C37cb874ACda4D", + "ServiceAgreementStorageV1U1": { + "evmAddress": "0xa97A72D0d59EA811d5B8Ba7393176654FE7729e5", + "version": "1.0.0", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.2" - }, - "SHA256": { - "deployed": true, - "deploymentTimestamp": 1703025987942, - "evmAddress": "0x01BF84f88861294Dc6FcAF14f6cAA9FAe604A528", - "gitBranch": "gnosis-mainnet-deployment", - "gitCommitHash": "e1347318d5badad802c1b802f3aa270be7843e26", - "version": null + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446845, + "deploymentTimestamp": 1707908548273, + "deployed": true }, - "ScoringProxy": { - "deployed": true, - "deploymentTimestamp": 1703022965121, - "evmAddress": "0xC7C52e75bc43147779A2F4C065324C3A0f7AfbEe", + "ServiceAgreementStorageProxy": { + "evmAddress": "0x58B014Ee9296C4BE5dec056a7577Df2d18aa5974", + "version": "1.0.0", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.1" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446848, + "deploymentTimestamp": 1707908569673, + "deployed": true }, - "ServiceAgreementStorageProxy": { - "deployed": true, - "deploymentTimestamp": 1703023064603, - "evmAddress": "0x8f8430045Fc2CAbD37cc744633987e1dBFfA1A7C", + "ContentAssetStorage": { + "evmAddress": "0xf81a8C0008DE2DCdb73366Cf78F2b178616d11DD", + "version": "2.0.1", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.0" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446850, + "deploymentTimestamp": 1707908581380, + "deployed": true }, - "ServiceAgreementStorageV1": { - "deployed": true, - "deploymentTimestamp": 1703023042140, - "evmAddress": "0xb3db60d04D2Ea88c21C4A27960665e0e1eEE8c28", + "UnfinalizedStateStorage": { + "evmAddress": "0x896CCbCEB7a5B30f8a68ec02bee79A50007095Ba", + "version": "1.0.0", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.0" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446852, + "deploymentTimestamp": 1707908588808, + "deployed": true }, - "ServiceAgreementStorageV1U1": { - "deployed": true, - "deploymentTimestamp": 1703023053866, - "evmAddress": "0xC2bf77D0A4C5B6EfE2D0A37cb45B9e31C3E49a58", + "Assertion": { + "evmAddress": "0xe0eb7A3cd98cAD1a5AE744a3B70BA767c88C23a3", + "version": "1.0.1", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.0" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446854, + "deploymentTimestamp": 1707908607100, + "deployed": true }, - "ServiceAgreementV1": { - "deployed": true, - "deploymentTimestamp": 1703023240311, - "evmAddress": "0xC20dC8df633b049e9C227f1161548C6FA99c1d02", + "Identity": { + "evmAddress": "0x16A170D7552D5A14be0dAc2AC25456B720cdee59", + "version": "1.1.0", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.1.1" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446891, + "deploymentTimestamp": 1707908802696, + "deployed": true }, "ShardingTable": { - "deployed": true, - "deploymentTimestamp": 1703023127708, - "evmAddress": "0xd8B622e5D98d358C0DC730e90d749B3371054655", + "evmAddress": "0x0cD31e3Ca36cff2EFBDda27B1D40c36928a4b594", + "version": "2.0.0", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.1" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446893, + "deploymentTimestamp": 1707908815590, + "deployed": true }, - "ShardingTableStorage": { - "deployed": true, - "deploymentTimestamp": 1703023010069, - "evmAddress": "0xFD9B5c2221f4c248761710020edb8b565A7f220a", + "Staking": { + "evmAddress": "0x34fdD017567300b0891Fa03673338E14b564C3CC", + "version": "2.0.0", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.0" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446895, + "deploymentTimestamp": 1707908831259, + "deployed": true }, - "Staking": { - "deployed": true, - "deploymentTimestamp": 1703023140241, - "evmAddress": "0x0ea866cB43BF4088F5ECC94bd6eD588154e8b972", + "Profile": { + "evmAddress": "0x5deb369B8C0930853cD192d85f1389151e009CF4", + "version": "1.1.1", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.2" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446897, + "deploymentTimestamp": 1707908838740, + "deployed": true }, - "StakingStorage": { - "deployed": true, - "deploymentTimestamp": 1703023020919, - "evmAddress": "0xBA854b8d7052fcE6ff58D04818D68B9dC0718Fdd", + "CommitManagerV1": { + "evmAddress": "0x3E8C4B4EfC5BE76812d598449BA010E206516eB9", + "version": "2.0.0", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.0" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446899, + "deploymentTimestamp": 1707908865673, + "deployed": true }, - "Token": { - "deployed": true, - "evmAddress": "0xEddd81E0792E764501AaE206EB432399a0268DB5" + "CommitManagerV1U1": { + "evmAddress": "0xaf496a2840d15Ee4E07962682EE4bE26C7932391", + "version": "2.0.0", + "gitBranch": "main", + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446904, + "deploymentTimestamp": 1707908873240, + "deployed": true }, - "UnfinalizedStateStorage": { - "deployed": true, - "deploymentTimestamp": 1703023096226, - "evmAddress": "0x22617263B5a2cab82d7c6f2956867eb4CDd29F6a", + "ProofManagerV1": { + "evmAddress": "0xdDA3c01E795881C27A6B796e935061829E5F66Ce", + "version": "1.0.3", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.0" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446907, + "deploymentTimestamp": 1707908897432, + "deployed": true }, - "WhitelistStorage": { - "deployed": true, - "deploymentTimestamp": 1703022936712, - "evmAddress": "0xa1238eD2C1DCe4EA5c51038396404114ACA7DdBF", + "ProofManagerV1U1": { + "evmAddress": "0xA1Af6Edf76aBBab6B255892F6337f1365B3B73d7", + "version": "1.0.3", "gitBranch": "main", - "gitCommitHash": "c993c8564d17e5b8fbab770b020d7c926608ea24", - "version": "1.0.0" + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446910, + "deploymentTimestamp": 1707908908676, + "deployed": true + }, + "ServiceAgreementV1": { + "evmAddress": "0x9A8d89d653aa4E040577a78760435638Feb174Ec", + "version": "1.1.1", + "gitBranch": "main", + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446912, + "deploymentTimestamp": 1707908922271, + "deployed": true + }, + "ContentAsset": { + "evmAddress": "0x4b4f6961d8e6Fb119a5247e48b9c8aCEcE53b995", + "version": "1.0.2", + "gitBranch": "main", + "gitCommitHash": "26881f1a79eaf41f13d1c48a2c5952d0a1d14274", + "deploymentBlock": 32446915, + "deploymentTimestamp": 1707908933093, + "deployed": true } } } diff --git a/test/v1/unit/Profile.test.ts b/test/v1/unit/Profile.test.ts index 66ea735f..3b0b2226 100644 --- a/test/v1/unit/Profile.test.ts +++ b/test/v1/unit/Profile.test.ts @@ -75,8 +75,8 @@ describe('@v1 @unit Profile contract', function () { expect(await Profile.name()).to.equal('Profile'); }); - it('The contract is version "1.1.0"', async () => { - expect(await Profile.version()).to.equal('1.1.0'); + it('The contract is version "1.1.1"', async () => { + expect(await Profile.version()).to.equal('1.1.1'); }); it('Create a profile with whitelisted node, expect to pass', async () => { diff --git a/utils/helpers.ts b/utils/helpers.ts index dcf67fc0..687a7657 100644 --- a/utils/helpers.ts +++ b/utils/helpers.ts @@ -215,6 +215,17 @@ export class Helpers { // eslint-disable-next-line @typescript-eslint/no-non-null-assertion await this.updateDeploymentsJson(nameInHub, newContract.address, newContract.receipt!.blockNumber); + this.saveDeploymentsJson('deployments'); + + console.log('-------------------------------------------------------------------------'); + console.log(`New or redeployed contracts: ${JSON.stringify(this.newContracts)}`); + console.log(`New or redeployed Asset Storage contracts: ${JSON.stringify(this.newAssetStorageContracts)}`); + console.log(`New or redeployed hash functions set in the proxy: ${JSON.stringify(this.newHashFunctions)}`); + console.log(`New or redeployed score functions set in the proxy: ${JSON.stringify(this.newScoreFunctions)}`); + console.log(`Initialized contracts: ${JSON.stringify(this.contractsForReinitialization)}`); + console.log(`Encoded data for parameters settings: ${JSON.stringify(this.setParametersEncodedData)}`); + console.log('-------------------------------------------------------------------------'); + return await this.hre.ethers.getContractAt(this.getAbi(newContractName), newContract.address, deployer); } From e6d0b1ac1e8d385290cc8ba9e87ebec641227c87 Mon Sep 17 00:00:00 2001 From: Uladzislau Hubar Date: Wed, 14 Feb 2024 15:56:11 +0100 Subject: [PATCH 2/2] Redeployed logic contract on Neuroweb Mainnet --- deployments/otp_mainnet_contracts.json | 75 ++++++++++++++------------ 1 file changed, 40 insertions(+), 35 deletions(-) diff --git a/deployments/otp_mainnet_contracts.json b/deployments/otp_mainnet_contracts.json index 031b8568..e5a52e3b 100644 --- a/deployments/otp_mainnet_contracts.json +++ b/deployments/otp_mainnet_contracts.json @@ -15,22 +15,24 @@ "substrateAddress": "5EMjsczQYos6eg1jtTqPi8GQ1VcNswLPcVaBz7n522r9iF4X" }, "CommitManagerV1": { - "deployed": true, - "deploymentTimestamp": 1703088416280, - "evmAddress": "0x110D4098b474a4f88A75859e0659e8900098d968", - "gitBranch": "main", - "gitCommitHash": "56fd79b5ed1d45284edba9f3f88fe7d14c8c2287", - "substrateAddress": "5EMjsczPbJKG8N6fzYRadZt9MqTbPdLe9nCHrDTfe7trhU4z", - "version": "1.0.1" + "evmAddress": "0x683b2c3DaDb048265e6e68384b70472CeCC82a23", + "substrateAddress": "5EMjsczh4Tzp74KsC3WVBKv4ZUim6VoXKSCiLA8a7C7BcKpX", + "version": "1.0.2", + "gitBranch": "gnosis-mainnet-delegations", + "gitCommitHash": "5756f47b75b5c1e9503ecbb3c905fac3ba7f75ea", + "deploymentBlock": 4319957, + "deploymentTimestamp": 1707917858791, + "deployed": true }, "CommitManagerV1U1": { - "deployed": true, - "deploymentTimestamp": 1703088463592, - "evmAddress": "0x4816D8314552FD198286AaFc91d0fD71ba4d08bC", - "gitBranch": "main", - "gitCommitHash": "56fd79b5ed1d45284edba9f3f88fe7d14c8c2287", - "substrateAddress": "5EMjsczacvb7NQEqwvFDdiP1dK4wqpVUYML5Vs9ba32ET4UB", - "version": "1.0.1" + "evmAddress": "0x7e18a80325d4C91b8d2D964606c400E9a065dD11", + "substrateAddress": "5EMjsczmSaKbQCG2BFnDWH2in2QgK7hMLq66AcRXE4QPhKnT", + "version": "1.0.2", + "gitBranch": "gnosis-mainnet-delegations", + "gitCommitHash": "5756f47b75b5c1e9503ecbb3c905fac3ba7f75ea", + "deploymentBlock": 4319962, + "deploymentTimestamp": 1707917924369, + "deployed": true }, "ContentAsset": { "deployed": true, @@ -66,13 +68,14 @@ "version": "1.0.2" }, "Identity": { - "deployed": true, - "deploymentTimestamp": 1703088322715, - "evmAddress": "0xCBECb2781A40825A23C166Dbe6825f51D08db8f3", - "gitBranch": "main", - "gitCommitHash": "56fd79b5ed1d45284edba9f3f88fe7d14c8c2287", - "substrateAddress": "5EMjsd1334rVcvDeZ6wz5fTb6GYfLwpht8aYCyuZi8TkvpcF", - "version": "1.0.1" + "evmAddress": "0x8B5d66e363CF622E1448670F344f887C5eb2411f", + "substrateAddress": "5EMjsczp6n3UXMnkZq7Yb92MXqb3w5ZqztjVq1zcESNMYydq", + "version": "1.1.0", + "gitBranch": "gnosis-mainnet-delegations", + "gitCommitHash": "5756f47b75b5c1e9503ecbb3c905fac3ba7f75ea", + "deploymentBlock": 4319953, + "deploymentTimestamp": 1707917812243, + "deployed": true }, "IdentityStorage": { "deployed": true, @@ -89,22 +92,24 @@ "version": null }, "ParametersStorage": { - "deployed": true, - "deploymentTimestamp": 1703088171089, - "evmAddress": "0x8Bfe40FFAa1a204a7A2D60365640A85e48FA951e", - "gitBranch": "main", - "gitCommitHash": "56fd79b5ed1d45284edba9f3f88fe7d14c8c2287", - "substrateAddress": "5EMjsczpE5a5PPW2fV5BnxvaoNxNGneDyS88zUtLBbcXuTPr", - "version": "1.1.0" + "evmAddress": "0x45ca950f69663DDCD98B66D3a2d4F590cCe84bb1", + "substrateAddress": "5EMjsczaADgKRgqA5d5yXjY5ADoduwVUc5EihPvKyebYYC82", + "version": "1.1.1", + "gitBranch": "gnosis-mainnet-delegations", + "gitCommitHash": "5756f47b75b5c1e9503ecbb3c905fac3ba7f75ea", + "deploymentBlock": 4319951, + "deploymentTimestamp": 1707917780095, + "deployed": true }, "Profile": { - "deployed": true, - "deploymentTimestamp": 1703088390972, - "evmAddress": "0xE2A60D19bD09E2a853F196Ff00d9b3802E0Fc989", - "gitBranch": "main", - "gitCommitHash": "56fd79b5ed1d45284edba9f3f88fe7d14c8c2287", - "substrateAddress": "5EMjsd17bA6vjNf88YituZXLYXWVbXbHPc9P9CrgDi1ksGYv", - "version": "1.0.2" + "evmAddress": "0x1Bb47313044B50b69b54cf4E4652B367c5614e99", + "substrateAddress": "5EMjsczRj76gftzPKgLtT7cJBjkFbYYrt3p815eUExwvnqqK", + "version": "1.1.1", + "gitBranch": "gnosis-mainnet-delegations", + "gitCommitHash": "5756f47b75b5c1e9503ecbb3c905fac3ba7f75ea", + "deploymentBlock": 4319955, + "deploymentTimestamp": 1707917833454, + "deployed": true }, "ProfileStorage": { "deployed": true,