Skip to content
This repository has been archived by the owner on Oct 6, 2023. It is now read-only.

Commit

Permalink
Update MultiSigGeneric.initialize to use onlyInitializing modifier (
Browse files Browse the repository at this point in the history
#347)

* Add comments to APTeamMultiSig.initializeAPTeam

* Remove redundant 'initializer' modifier from child MS contracts

* Update MS initializers to 'external'

* Revert "Remove redundant 'initializer' modifier from child MS contracts"

This reverts commit e445eaf.

* Use onlyInitializing modifier on MultiSigGeneric.initialize
  • Loading branch information
Nenad Misic authored Aug 28, 2023
1 parent ec22d38 commit dc37705
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
7 changes: 6 additions & 1 deletion contracts/multisigs/APTeamMultiSig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@ pragma solidity ^0.8.19;
import {MultiSigGeneric} from "./MultiSigGeneric.sol";

contract APTeamMultiSig is MultiSigGeneric {
/// @dev Initializes MultiSig's state variables.
/// @param owners List of initial owners.
/// @param _approvalsRequired Number of required confirmations.
/// @param _requireExecution setting for if an explicit execution call is required
/// @param _transactionExpiry Proposal expiry time in seconds
function initializeAPTeam(
address[] memory owners,
uint256 _approvalsRequired,
bool _requireExecution,
uint256 _transactionExpiry
) public initializer {
) external initializer {
super.initialize(owners, _approvalsRequired, _requireExecution, _transactionExpiry);
}
}
2 changes: 1 addition & 1 deletion contracts/multisigs/CharityApplications.sol
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ contract CharityApplications is MultiSigGeneric, StorageApplications, ICharityAp
uint256 _seedSplitToLiquid,
address _seedAsset,
uint256 _seedAmount
) public override initializer {
) external override initializer {
require(Validator.addressChecker(_accountsContract), "Invalid Accounts contract");
require(Validator.addressChecker(_seedAsset), "Invalid seed asset");
require(
Expand Down
2 changes: 1 addition & 1 deletion contracts/multisigs/MultiSigGeneric.sol
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ contract MultiSigGeneric is
uint256 _approvalsRequired,
bool _requireExecution,
uint256 _transactionExpiry
) internal initializer validApprovalsRequirement(owners.length, _approvalsRequired) {
) internal onlyInitializing validApprovalsRequirement(owners.length, _approvalsRequired) {
require(owners.length > 0, "Must pass at least one owner address");
for (uint256 i = 0; i < owners.length; i++) {
require(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ contract EndowmentMultiSig is MultiSigGeneric {
uint256 _required,
bool _requireExecution,
uint256 _transactionExpiry
) public initializer {
) external initializer {
require(Validator.addressChecker(_emitter), "Invalid Emitter Address");
ENDOWMENT_ID = _endowmentId;
EMITTER_ADDRESS = _emitter;
Expand Down
2 changes: 1 addition & 1 deletion contracts/multisigs/interfaces/ICharityApplications.sol
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ abstract contract ICharityApplications {
uint256 _seedSplitToLiquid,
address _seedAsset,
uint256 _seedAmount
) public virtual;
) external virtual;

function proposeApplication(
AccountMessages.CreateEndowmentRequest memory application,
Expand Down

0 comments on commit dc37705

Please sign in to comment.