-
Notifications
You must be signed in to change notification settings - Fork 1
/
MultiSigWalletUpgradeable.sol
84 lines (76 loc) · 2.81 KB
/
MultiSigWalletUpgradeable.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import { UUPSUpgradeable } from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
import { MultiSigWalletBase } from "./base/MultiSigWalletBase.sol";
/**
* @title MultiSigWalletUpgradeable contract
* @author CloudWalk Inc.
* @dev The implementation of the upgradeable multi-signature wallet contract.
*/
contract MultiSigWalletUpgradeable is Initializable, UUPSUpgradeable, MultiSigWalletBase {
/**
* @dev Constructor that prohibits the initialization of the implementation of the upgradable contract.
*
* See details
* https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable#initializing_the_implementation_contract
*
* @custom:oz-upgrades-unsafe-allow constructor
*/
constructor() {
_disableInitializers();
}
/**
* @dev The initializer of the upgradable contract.
*
* See details https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable
*
* Requirements:
*
* - The array of wallet owners must not be empty.
* - The number of required approvals must not be zero and must not exceed the length of the wallet owners array.
*
* @param newOwners An array of wallet owners.
* @param newRequiredApprovals The number of required approvals to execute a transaction.
*/
function initialize(address[] memory newOwners, uint16 newRequiredApprovals) external initializer {
__Multisig_init(newOwners, newRequiredApprovals);
}
/**
* @dev The internal initializer of the upgradable contract.
*
* See {MultiSigWalletUpgradeable-initialize}.
*/
function __Multisig_init(address[] memory newOwners, uint16 newRequiredApprovals) internal onlyInitializing {
__Multisig_init_unchained(newOwners, newRequiredApprovals);
}
/**
* @dev The unchained internal initializer of the upgradable contract.
*
* See {MultiSigWalletUpgradeable-initialize}.
*/
function __Multisig_init_unchained(address[] memory newOwners, uint16 newRequiredApprovals)
internal
onlyInitializing
{
__UUPSUpgradeable_init_unchained();
_configureExpirationTime(10 days);
_configureOwners(newOwners, newRequiredApprovals);
}
/**
* @dev Upgrade authorization function.
*
* See details: https://docs.openzeppelin.com/upgrades-plugins/1.x/writing-upgradeable
*
* @param newImplementation The address of the new implementation
*
* Requirements:
*
* - The caller must be the multisig itself.
*/
function _authorizeUpgrade(address newImplementation)
internal
onlySelfCall
override
{}
}