Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed active operator fee getters #253

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions contracts/v2/storage/NodeOperatorFeesStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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 {
Expand Down
10 changes: 5 additions & 5 deletions deployments/gnosis_chiado_dev_contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
10 changes: 5 additions & 5 deletions deployments/gnosis_chiado_test_contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
12 changes: 6 additions & 6 deletions deployments/otp_devnet_contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
10 changes: 5 additions & 5 deletions deployments/otp_testnet_contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Loading