-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathSafeConfig.sol
96 lines (89 loc) · 3.92 KB
/
SafeConfig.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
85
86
87
88
89
90
91
92
93
94
95
96
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.25;
import {ItoA} from "src/utils/ItoA.sol";
library SafeConfig {
function _isTestnet() internal view returns (bool) {
if (
block.chainid == 10143 // monad testnet
|| block.chainid == 11155111 // sepolia
) {
return true;
}
if (
block.chainid == 1 // mainnet
|| block.chainid == 10 // optimism
|| block.chainid == 56 // bnb
|| block.chainid == 100 // gnosis
|| block.chainid == 137 // polygon
|| block.chainid == 146 // sonic
|| block.chainid == 480 // worldchain
|| block.chainid == 5000 // mantle
|| block.chainid == 8453 // base
|| block.chainid == 34443 // mode
|| block.chainid == 42161 // arbitrum
|| block.chainid == 43114 // avalanche
|| block.chainid == 57073 // ink
|| block.chainid == 59144 // linea
|| block.chainid == 81457 // blast
|| block.chainid == 167000 // taiko
|| block.chainid == 534352 // scroll
) {
return false;
}
revert(string.concat("Unrecognized chainid ", ItoA.itoa(block.chainid)));
}
function _isMainnet() internal view returns (bool) {
if (block.chainid == 1) {
return true;
}
if (
block.chainid == 10 // optimism
|| block.chainid == 56 // bnb
|| block.chainid == 100 // gnosis
|| block.chainid == 137 // polygon
|| block.chainid == 146 // sonic
|| block.chainid == 480 // worldchain
|| block.chainid == 5000 // mantle
|| block.chainid == 8453 // base
|| block.chainid == 10143 // monad testnet
|| block.chainid == 34443 // mode
|| block.chainid == 42161 // arbitrum
|| block.chainid == 43114 // avalanche
|| block.chainid == 57073 // ink
|| block.chainid == 59144 // linea
|| block.chainid == 81457 // blast
|| block.chainid == 167000 // taiko
|| block.chainid == 534352 // scroll
|| block.chainid == 11155111 // sepolia
) {
return false;
}
revert(string.concat("Unrecognized chainid ", ItoA.itoa(block.chainid)));
}
uint256 internal constant upgradeSafeThreshold = 2;
function getUpgradeSafeSigners() internal view returns (address[] memory) {
address[] memory result = new address[](4);
result[0] = 0x257619B7155d247e43c8B6d90C8c17278Ae481F0; // Will
result[1] = 0xD6B66609E5C05210BE0A690aB3b9788BA97aFa60; // Duncan
if (_isMainnet()) {
result[2] = 0x5ee2a00F8f01d099451844Af7F894f26A57FCbF2; // Amir
result[3] = 0x269984C978bFA5693D5915201e4dd1B7686aA6F7; // Jacob
} else {
result[2] = 0x9E4496adE6096b000C856219C27734F4f89A5210; // Amir
result[3] = 0x5A9d540A07a96a2bfC8a8dfd638359778C72526f; // Jacob
}
return result;
}
uint256 internal constant deploymentSafeThreshold = 2;
// forgefmt: disable-next-line
function getDeploymentSafeSigners() internal view returns (address[] memory) { // this is non-pure (view) on purpose
address[] memory result = new address[](6);
result[0] = 0x24420bC8C760787F3eEF3b809e81f44d31a9c5A2; // Jacob
result[1] = 0x6879fAb591ed0d62537A3Cac9D7cd41218445a84; // Sav
result[2] = 0x052809d05DC83F317b2f578710411e6cbF88AC5a; // Josh
result[3] = 0xDCa4ee0070b4aa44b30D8af22F3CBbb2cC859dAf; // Kevin
result[4] = 0xD6B66609E5C05210BE0A690aB3b9788BA97aFa60; // Duncan
result[5] = 0xEC3E1F7aC9Df42c31570b02068f2e7500915e557; // Andy
return result;
}
}