-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: deploy Blobstream at a custom nonce
- Loading branch information
Showing
5 changed files
with
80 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,28 +101,20 @@ contract Blobstream is IDAOracle, Initializable, UUPSUpgradeable, OwnableUpgrade | |
/// @param _nonce Initial event nonce. | ||
/// @param _powerThreshold Initial voting power that is needed to approve | ||
/// operations. | ||
/// @param _validatorSetHash Initial validator set hash. This does not need | ||
/// @param _validatorSetCheckpoint Initial validator set domainSeparateValidatorSetHash. This does not need | ||
/// to be the genesis validator set of the bridged chain, only the initial | ||
/// validator set of the bridge. | ||
/// @dev DO NOT REMOVE THE INITIALIZER! It is mandatory for upgradability. | ||
function initialize(uint256 _nonce, uint256 _powerThreshold, bytes32 _validatorSetHash) public initializer { | ||
// CHECKS | ||
|
||
bytes32 newCheckpoint = domainSeparateValidatorSetHash(_nonce, _powerThreshold, _validatorSetHash); | ||
|
||
function initialize(uint256 _nonce, uint256 _powerThreshold, bytes32 _validatorSetCheckpoint) public initializer { | ||
Check warning Code scanning / Slither Conformance to Solidity naming conventions Warning
Parameter Blobstream.initialize(uint256,uint256,bytes32)._validatorSetCheckpoint is not in mixedCase
Check warning Code scanning / Slither Conformance to Solidity naming conventions Warning
Parameter Blobstream.initialize(uint256,uint256,bytes32)._nonce is not in mixedCase
Check warning Code scanning / Slither Conformance to Solidity naming conventions Warning
Parameter Blobstream.initialize(uint256,uint256,bytes32)._powerThreshold is not in mixedCase
|
||
// EFFECTS | ||
|
||
state_eventNonce = _nonce; | ||
state_lastValidatorSetCheckpoint = newCheckpoint; | ||
state_lastValidatorSetCheckpoint = _validatorSetCheckpoint; | ||
state_powerThreshold = _powerThreshold; | ||
|
||
/// @dev Initialize the OwnableUpgradeable explicitly. | ||
/// DO NOT REMOVE! It is mandatory for allowing the owner to upgrade. | ||
__Ownable_init(_msgSender()); | ||
|
||
// LOGS | ||
|
||
emit ValidatorSetUpdatedEvent(_nonce, _powerThreshold, _validatorSetHash); | ||
} | ||
|
||
/// @dev only authorize the upgrade for the owner of the contract. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters