Skip to content

Commit

Permalink
allow foundation validators to change their pubkey unlimited number o…
Browse files Browse the repository at this point in the history
…f times
  • Loading branch information
uprendis committed Jul 1, 2024
1 parent 6a4b836 commit c950937
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions contracts/sfc/SFC.sol
Original file line number Diff line number Diff line change
Expand Up @@ -128,11 +128,11 @@ contract SFC is SFCBase, Version {
require(getValidator[1].auth == 0x541E408443A592C38e01Bed0cB31f9De8c1322d0, "not mainnet");
require(pubkey.length == 66 && pubkey[0] == 0xc0, "malformed pubkey");
uint256 validatorID = getValidatorID[msg.sender];
require(validatorID <= 59, "not legacy validator");
require(validatorID <= 59 || validatorID == 64, "not legacy validator");
require(_validatorExists(validatorID), "validator doesn't exist");
require(keccak256(pubkey) != keccak256(getValidatorPubkey[validatorID]), "same pubkey");
require(pubkeyHashToValidatorID[keccak256(pubkey)] == 0, "already used");
require(validatorPubkeyChanges[validatorID] == 0, "allowed only once");
require(validatorPubkeyChanges[validatorID] == 0 || validatorID == 64 || validatorID <= 12, "allowed only once");

validatorPubkeyChanges[validatorID]++;
pubkeyHashToValidatorID[keccak256(pubkey)] = validatorID;
Expand Down

0 comments on commit c950937

Please sign in to comment.