From 9df707e419f1e3789ebcf30dcb4e851dc5def811 Mon Sep 17 00:00:00 2001 From: Uladzislau Hubar Date: Wed, 24 Apr 2024 09:02:53 +0200 Subject: [PATCH] Fixed active operator fee getters, redeployed NodeOperatorFeesStorage on Devnet/Testnet --- contracts/v2/storage/NodeOperatorFeesStorage.sol | 10 +++++----- deployments/gnosis_chiado_dev_contracts.json | 10 +++++----- deployments/gnosis_chiado_test_contracts.json | 10 +++++----- deployments/otp_devnet_contracts.json | 12 ++++++------ deployments/otp_testnet_contracts.json | 10 +++++----- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/contracts/v2/storage/NodeOperatorFeesStorage.sol b/contracts/v2/storage/NodeOperatorFeesStorage.sol index 9a9326fa..b42e10d0 100644 --- a/contracts/v2/storage/NodeOperatorFeesStorage.sol +++ b/contracts/v2/storage/NodeOperatorFeesStorage.sol @@ -76,7 +76,7 @@ contract NodeOperatorFeesStorage is Named, Versioned, HubDependent { ) external onlyContracts { if ( operatorFees[identityId].length == 0 || - block.timestamp <= operatorFees[identityId][operatorFees[identityId].length - 1].effectiveDate + block.timestamp > operatorFees[identityId][operatorFees[identityId].length - 1].effectiveDate ) { revert NodeOperatorErrors.NoPendingOperatorFee(); } @@ -117,7 +117,7 @@ contract NodeOperatorFeesStorage is Named, Versioned, HubDependent { } function getActiveOperatorFee(uint72 identityId) external view returns (NodeOperatorStructs.OperatorFee memory) { - if (block.timestamp <= operatorFees[identityId][operatorFees[identityId].length - 1].effectiveDate) { + if (block.timestamp > operatorFees[identityId][operatorFees[identityId].length - 1].effectiveDate) { return operatorFees[identityId][operatorFees[identityId].length - 1]; } else { return operatorFees[identityId][operatorFees[identityId].length - 2]; @@ -148,7 +148,7 @@ contract NodeOperatorFeesStorage is Named, Versioned, HubDependent { return 0; } - if (block.timestamp <= operatorFees[identityId][operatorFees[identityId].length - 1].effectiveDate) { + if (block.timestamp > operatorFees[identityId][operatorFees[identityId].length - 1].effectiveDate) { return operatorFees[identityId][operatorFees[identityId].length - 1].feePercentage; } else { return operatorFees[identityId][operatorFees[identityId].length - 2].feePercentage; @@ -182,7 +182,7 @@ contract NodeOperatorFeesStorage is Named, Versioned, HubDependent { return 0; } - if (block.timestamp <= operatorFees[identityId][operatorFees[identityId].length - 1].effectiveDate) { + if (block.timestamp > operatorFees[identityId][operatorFees[identityId].length - 1].effectiveDate) { return operatorFees[identityId][operatorFees[identityId].length - 1].effectiveDate; } else { return operatorFees[identityId][operatorFees[identityId].length - 2].effectiveDate; @@ -191,7 +191,7 @@ contract NodeOperatorFeesStorage is Named, Versioned, HubDependent { function isOperatorFeeChangePending(uint72 identityId) external view returns (bool) { return (operatorFees[identityId].length != 0 && - block.timestamp > operatorFees[identityId][operatorFees[identityId].length - 1].effectiveDate); + block.timestamp <= operatorFees[identityId][operatorFees[identityId].length - 1].effectiveDate); } function setDelayFreePeriodEnd(uint256 timestamp) external onlyHubOwner onlyOnce { diff --git a/deployments/gnosis_chiado_dev_contracts.json b/deployments/gnosis_chiado_dev_contracts.json index e81cc8e8..af837671 100644 --- a/deployments/gnosis_chiado_dev_contracts.json +++ b/deployments/gnosis_chiado_dev_contracts.json @@ -247,12 +247,12 @@ "deployed": true }, "NodeOperatorFeesStorage": { - "evmAddress": "0xBf75658BC1001c3E2579A7d3c0208A6BD154Ff8D", + "evmAddress": "0x9537742FD433D07362878359074c437C305C8889", "version": "2.0.0", - "gitBranch": "deployment/4.2.6", - "gitCommitHash": "70460ee20705bcbc21677f2e96341103548843f9", - "deploymentBlock": 9328116, - "deploymentTimestamp": 1713448336305, + "gitBranch": "fix/active-node-operator-fee", + "gitCommitHash": "26d06f055165991b60936cad3dfb14ba3b2afe9b", + "deploymentBlock": 9415082, + "deploymentTimestamp": 1713883722633, "deployed": true }, "ContentAsset": { diff --git a/deployments/gnosis_chiado_test_contracts.json b/deployments/gnosis_chiado_test_contracts.json index d028c230..dda0e2d5 100644 --- a/deployments/gnosis_chiado_test_contracts.json +++ b/deployments/gnosis_chiado_test_contracts.json @@ -247,12 +247,12 @@ "deployed": true }, "NodeOperatorFeesStorage": { - "evmAddress": "0xb9C5fFBfDE59987fF1de2D57C6CcdCF84eEbc022", + "evmAddress": "0x692b3CC200BccF4c6ee0969818Da6c1a88A8cBC7", "version": "2.0.0", - "gitBranch": "main", - "gitCommitHash": "ce3b55f823e0c2163b7e2a0b4ab227c3fd334a7b", - "deploymentBlock": 9327937, - "deploymentTimestamp": 1713447438189, + "gitBranch": "fix/active-node-operator-fee", + "gitCommitHash": "26d06f055165991b60936cad3dfb14ba3b2afe9b", + "deploymentBlock": 9415093, + "deploymentTimestamp": 1713883778621, "deployed": true }, "Staking": { diff --git a/deployments/otp_devnet_contracts.json b/deployments/otp_devnet_contracts.json index c7c99ab1..f6c12e40 100644 --- a/deployments/otp_devnet_contracts.json +++ b/deployments/otp_devnet_contracts.json @@ -175,13 +175,13 @@ "deployed": true }, "NodeOperatorFeesStorage": { - "evmAddress": "0x15faaDfcFbbc80F8cfa996304e6bFE965e62C68f", - "substrateAddress": "5EMjsczQaZgq6b1ZX4J4VP9MSYeeQyCdcbqZxtsx6hftLAgQ", + "evmAddress": "0xC8d84aB47730D16Fe6c27125B951144a2d74EfD6", + "substrateAddress": "5EMjsd12RGxjpVwhRMNy4MD2SL3DkWGTahKGCLiU5csvJSkn", "version": "2.0.0", - "gitBranch": "deployment/4.2.6", - "gitCommitHash": "70460ee20705bcbc21677f2e96341103548843f9", - "deploymentBlock": 4440819, - "deploymentTimestamp": 1713448266610, + "gitBranch": "main", + "gitCommitHash": "26d06f055165991b60936cad3dfb14ba3b2afe9b", + "deploymentBlock": 4475892, + "deploymentTimestamp": 1713883340850, "deployed": true }, "ScoringProxy": { diff --git a/deployments/otp_testnet_contracts.json b/deployments/otp_testnet_contracts.json index 676c8632..571d5238 100644 --- a/deployments/otp_testnet_contracts.json +++ b/deployments/otp_testnet_contracts.json @@ -173,13 +173,13 @@ "deployed": true }, "NodeOperatorFeesStorage": { - "evmAddress": "0x2cdaF2895090163F81065901BF5542A9f4892Ca3", - "substrateAddress": "5EMjsczVARPziWmub9Yhg8RhhWXodyh6QP1SZtAerFbKD8MB", + "evmAddress": "0xb3803E859d6f31a8107A575B014063cd0aF07698", + "substrateAddress": "5EMjsczx9DyhD3UfbjYrjcPVALvEhCpkYb8BX9Jb3otsSqkD", "version": "2.0.0", "gitBranch": "main", - "gitCommitHash": "ce3b55f823e0c2163b7e2a0b4ab227c3fd334a7b", - "deploymentBlock": 3801282, - "deploymentTimestamp": 1713447640299, + "gitCommitHash": "26d06f055165991b60936cad3dfb14ba3b2afe9b", + "deploymentBlock": 3831272, + "deploymentTimestamp": 1713883609933, "deployed": true }, "ScoringProxy": {