Skip to content

Commit

Permalink
add apk initialize
Browse files Browse the repository at this point in the history
  • Loading branch information
KeaneHh committed Dec 25, 2024
1 parent 6b6f5eb commit b7ae61a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/bls/BLSApkRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ contract BLSApkRegistry is Initializable, OwnableUpgradeable, IBLSApkRegistry, B
_transferOwnership(_initialOwner);
finalityRelayerManager = _finalityRelayerManager;
relayerManager = _relayerManager;
_initializeApk();
}

function registerOperator(
Expand Down Expand Up @@ -222,4 +223,14 @@ contract BLSApkRegistry is Initializable, OwnableUpgradeable, IBLSApkRegistry, B
);
}

function _initializeApk() internal {
require(apkHistory.length == 0, "BLSApkRegistry.initializeApk: apk already exists");

apkHistory.push(ApkUpdate({
apkHash: bytes24(0),
updateBlockNumber: uint32(block.number),
nextUpdateBlockNumber: 0
}));
}

}
1 change: 1 addition & 0 deletions src/interfaces/IBLSApkRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,5 @@ interface IBLSApkRegistry {
function addOrRemoveBlsRegisterWhitelist(address operator, bool isAdd) external;

function pubkeyRegistrationMessageHash(address operator) external view returns (BN254.G1Point memory);

}

0 comments on commit b7ae61a

Please sign in to comment.