@ensuro/access-managed-proxy 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -2
- package/build/build-info.json +1 -1
- package/build/contracts/AMPUtils.sol/AMPUtils.json +22 -0
- package/build/contracts/amps/AccessManagedProxyS25.sol/AccessManagedProxyS25.json +123 -0
- package/build/contracts/amps/AccessManagedProxyS26.sol/AccessManagedProxyS26.json +123 -0
- package/build/contracts/amps/AccessManagedProxyS27.sol/AccessManagedProxyS27.json +123 -0
- package/build/contracts/amps/AccessManagedProxyS28.sol/AccessManagedProxyS28.json +123 -0
- package/build/contracts/amps/AccessManagedProxyS29.sol/AccessManagedProxyS29.json +123 -0
- package/build/contracts/amps/AccessManagedProxyS30.sol/AccessManagedProxyS30.json +123 -0
- package/build/contracts/amps/AccessManagedProxyS31.sol/AccessManagedProxyS31.json +123 -0
- package/build/contracts/amps/AccessManagedProxyS32.sol/AccessManagedProxyS32.json +123 -0
- package/build/contracts/amps/AccessManagedProxyS33.sol/AccessManagedProxyS33.json +123 -0
- package/build/contracts/amps/AccessManagedProxyS34.sol/AccessManagedProxyS34.json +123 -0
- package/build/contracts/amps/AccessManagedProxyS35.sol/AccessManagedProxyS35.json +123 -0
- package/build/contracts/amps/AccessManagedProxyS36.sol/AccessManagedProxyS36.json +123 -0
- package/build/contracts/amps/AccessManagedProxyS37.sol/AccessManagedProxyS37.json +123 -0
- package/build/contracts/amps/AccessManagedProxyS38.sol/AccessManagedProxyS38.json +123 -0
- package/build/contracts/amps/AccessManagedProxyS39.sol/AccessManagedProxyS39.json +123 -0
- package/build/contracts/amps/AccessManagedProxyS40.sol/AccessManagedProxyS40.json +123 -0
- package/contracts/AMPUtils.sol +37 -0
- package/contracts/amps/AccessManagedProxyS25.sol +159 -0
- package/contracts/amps/AccessManagedProxyS26.sol +163 -0
- package/contracts/amps/AccessManagedProxyS27.sol +167 -0
- package/contracts/amps/AccessManagedProxyS28.sol +171 -0
- package/contracts/amps/AccessManagedProxyS29.sol +175 -0
- package/contracts/amps/AccessManagedProxyS30.sol +179 -0
- package/contracts/amps/AccessManagedProxyS31.sol +183 -0
- package/contracts/amps/AccessManagedProxyS32.sol +187 -0
- package/contracts/amps/AccessManagedProxyS33.sol +191 -0
- package/contracts/amps/AccessManagedProxyS34.sol +195 -0
- package/contracts/amps/AccessManagedProxyS35.sol +199 -0
- package/contracts/amps/AccessManagedProxyS36.sol +203 -0
- package/contracts/amps/AccessManagedProxyS37.sol +207 -0
- package/contracts/amps/AccessManagedProxyS38.sol +211 -0
- package/contracts/amps/AccessManagedProxyS39.sol +215 -0
- package/contracts/amps/AccessManagedProxyS40.sol +219 -0
- package/js/deployProxy.js +75 -0
- package/package.json +1 -1
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_format": "hh-sol-artifact-1",
|
|
3
|
+
"contractName": "AccessManagedProxyS40",
|
|
4
|
+
"sourceName": "contracts/amps/AccessManagedProxyS40.sol",
|
|
5
|
+
"abi": [
|
|
6
|
+
{
|
|
7
|
+
"inputs": [
|
|
8
|
+
{
|
|
9
|
+
"internalType": "address",
|
|
10
|
+
"name": "implementation",
|
|
11
|
+
"type": "address"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"internalType": "bytes",
|
|
15
|
+
"name": "_data",
|
|
16
|
+
"type": "bytes"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"internalType": "contract IAccessManager",
|
|
20
|
+
"name": "manager",
|
|
21
|
+
"type": "address"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"internalType": "bytes4[40]",
|
|
25
|
+
"name": "passThruMethods",
|
|
26
|
+
"type": "bytes4[40]"
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"stateMutability": "payable",
|
|
30
|
+
"type": "constructor"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"inputs": [
|
|
34
|
+
{
|
|
35
|
+
"internalType": "address",
|
|
36
|
+
"name": "caller",
|
|
37
|
+
"type": "address"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"name": "AccessManagedUnauthorized",
|
|
41
|
+
"type": "error"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"inputs": [
|
|
45
|
+
{
|
|
46
|
+
"internalType": "address",
|
|
47
|
+
"name": "target",
|
|
48
|
+
"type": "address"
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"name": "AddressEmptyCode",
|
|
52
|
+
"type": "error"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"inputs": [
|
|
56
|
+
{
|
|
57
|
+
"internalType": "address",
|
|
58
|
+
"name": "implementation",
|
|
59
|
+
"type": "address"
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"name": "ERC1967InvalidImplementation",
|
|
63
|
+
"type": "error"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"inputs": [],
|
|
67
|
+
"name": "ERC1967NonPayable",
|
|
68
|
+
"type": "error"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"inputs": [],
|
|
72
|
+
"name": "FailedCall",
|
|
73
|
+
"type": "error"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"anonymous": false,
|
|
77
|
+
"inputs": [
|
|
78
|
+
{
|
|
79
|
+
"indexed": true,
|
|
80
|
+
"internalType": "address",
|
|
81
|
+
"name": "implementation",
|
|
82
|
+
"type": "address"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"name": "Upgraded",
|
|
86
|
+
"type": "event"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"stateMutability": "payable",
|
|
90
|
+
"type": "fallback"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"inputs": [],
|
|
94
|
+
"name": "ACCESS_MANAGER",
|
|
95
|
+
"outputs": [
|
|
96
|
+
{
|
|
97
|
+
"internalType": "contract IAccessManager",
|
|
98
|
+
"name": "",
|
|
99
|
+
"type": "address"
|
|
100
|
+
}
|
|
101
|
+
],
|
|
102
|
+
"stateMutability": "view",
|
|
103
|
+
"type": "function"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"inputs": [],
|
|
107
|
+
"name": "PASS_THRU_METHODS",
|
|
108
|
+
"outputs": [
|
|
109
|
+
{
|
|
110
|
+
"internalType": "bytes4[]",
|
|
111
|
+
"name": "methods",
|
|
112
|
+
"type": "bytes4[]"
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
"stateMutability": "view",
|
|
116
|
+
"type": "function"
|
|
117
|
+
}
|
|
118
|
+
],
|
|
119
|
+
"bytecode": "0x6105a060405260405161231e38038061231e8339810160408190526100239161050a565b8383838282610032828261022a565b50506001600160a01b0316608090815283516001600160e01b031990811660a09081526020860151821660c09081526040870151831660e0908152606088015184166101009081529488015184166101209081529288015184166101409081529188015184166101609081529088015184166101809081529488015184166101a09081529288015184166101c09081529188015184166101e09081529088015184166102009081529488015184166102209081529288015184166102409081529188015184166102609081529088015184166102809081529488015184166102a09081529288015184166102c09081529188015184166102e09081529088015184166103009081529488015184166103209081529288015184166103409081529188015184166103609081529088015184166103809081529488015184166103a09081529288015184166103c09081529188015184166103e09081529088015184166104009081529488015184166104209081529288015184166104409081529188015184166104609081529088015184166104809081529488015184166104a09081529288015184166104c09081529188015184166104e090815290880151841661050052938701518316610520529086015182166105405285015181166105605293015190921661058052506105e89350505050565b61023382610288565b6040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b905f90a280511561027c576102778282610303565b505050565b610284610376565b5050565b806001600160a01b03163b5f036102c257604051634c9c8ce360e01b81526001600160a01b03821660048201526024015b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b60605f5f846001600160a01b03168460405161031f91906105d2565b5f60405180830381855af49150503d805f8114610357576040519150601f19603f3d011682016040523d82523d5f602084013e61035c565b606091505b50909250905061036d858383610397565b95945050505050565b34156103955760405163b398979f60e01b815260040160405180910390fd5b565b6060826103ac576103a7826103f6565b6103ef565b81511580156103c357506001600160a01b0384163b155b156103ec57604051639996b31560e01b81526001600160a01b03851660048201526024016102b9565b50805b9392505050565b80511561040557805160208201fd5b60405163d6bda27560e01b815260040160405180910390fd5b50565b6001600160a01b038116811461041e575f5ffd5b634e487b7160e01b5f52604160045260245ffd5b604051601f8201601f191681016001600160401b038111828210171561047157610471610435565b604052919050565b805161048481610421565b919050565b5f82601f830112610498575f5ffd5b60405161050081016001600160401b03811182821017156104bb576104bb610435565b604052806105008401858111156104d0575f5ffd5b845b818110156104ff5780516001600160e01b0319811681146104f1575f5ffd5b8352602092830192016104d2565b509195945050505050565b5f5f5f5f610560858703121561051e575f5ffd5b845161052981610421565b60208601519094506001600160401b03811115610544575f5ffd5b8501601f81018713610554575f5ffd5b80516001600160401b0381111561056d5761056d610435565b610580601f8201601f1916602001610449565b818152886020838501011115610594575f5ffd5b8160208401602083015e5f602083830101528095505050506105b860408601610479565b91506105c78660608701610489565b905092959194509250565b5f82518060208501845e5f920191825250919050565b60805160a05160c05160e05161010051610120516101405161016051610180516101a0516101c0516101e05161020051610220516102405161026051610280516102a0516102c0516102e05161030051610320516103405161036051610380516103a0516103c0516103e05161040051610420516104405161046051610480516104a0516104c0516104e0516105005161052051610540516105605161058051611a746108aa5f395f8181610def01526118e101525f8181610d9901526118a301525f8181610d43015261186501525f8181610ced015261182701525f8181610c9701526117e901525f8181610c4101526117ab01525f8181610beb015261176d01525f8181610b97015261172f01525f8181610b4901526116f101525f8181610af301526116b301525f8181610a9d015261167501525f8181610a47015261163701525f81816109f101526115f901525f818161099b01526115bb01525f8181610945015261157d01525f81816108ef015261153f01525f8181610899015261150101525f818161084301526114c301525f81816107ed015261148501525f8181610797015261144701525f8181610741015261140901525f81816106eb01526113cb01525f8181610695015261138d01525f818161063f015261134f01525f81816105e9015261131101525f818161059301526112d301525f818161053d015261129501525f81816104e7015261125701525f8181610491015261121901525f818161043b01526111db01525f81816103e5015261119d01525f818161038f015261115f01525f8181610339015261112101525f81816102e301526110e301525f818161028d01526110a501525f8181610237015261106701525f81816101e1015261102901525f818161018b0152610feb01525f81816101350152610fad01525f818160e00152610f7001525f8181606d0152610ec90152611a745ff3fe608060405260043610610028575f3560e01c806314416c03146100325780633a7b7a391461005c575b6100306100a7565b005b34801561003d575f5ffd5b506100466100b9565b604051610053919061193b565b60405180910390f35b348015610067575f5ffd5b5061008f7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610053565b6100b76100b2610e3d565b610e74565b565b604080516028808252610520820190925260609160208201610500803683370190505090507f0000000000000000000000000000000000000000000000000000000000000000815f8151811061011157610111611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160018151811061016757610167611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f0000000000000000000000000000000000000000000000000000000000000000816002815181106101bd576101bd611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160038151811061021357610213611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160048151811061026957610269611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f0000000000000000000000000000000000000000000000000000000000000000816005815181106102bf576102bf611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160068151811061031557610315611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160078151811061036b5761036b611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f0000000000000000000000000000000000000000000000000000000000000000816008815181106103c1576103c1611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160098151811061041757610417611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081600a8151811061046d5761046d611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081600b815181106104c3576104c3611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081600c8151811061051957610519611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081600d8151811061056f5761056f611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081600e815181106105c5576105c5611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081600f8151811061061b5761061b611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160108151811061067157610671611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f0000000000000000000000000000000000000000000000000000000000000000816011815181106106c7576106c7611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160128151811061071d5761071d611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160138151811061077357610773611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f0000000000000000000000000000000000000000000000000000000000000000816014815181106107c9576107c9611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160158151811061081f5761081f611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160168151811061087557610875611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f0000000000000000000000000000000000000000000000000000000000000000816017815181106108cb576108cb611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160188151811061092157610921611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160198151811061097757610977611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081601a815181106109cd576109cd611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081601b81518110610a2357610a23611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081601c81518110610a7957610a79611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081601d81518110610acf57610acf611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081601e81518110610b2557610b25611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081601f81518110610b7b57610b7b611987565b6001600160e01b031990921660209283029190910182015281517f00000000000000000000000000000000000000000000000000000000000000009183918110610bc757610bc7611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081602181518110610c1d57610c1d611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081602281518110610c7357610c73611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081602381518110610cc957610cc9611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081602481518110610d1f57610d1f611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081602581518110610d7557610d75611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081602681518110610dcb57610dcb611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081602781518110610e2157610e21611987565b6001600160e01b03199092166020928302919091019091015290565b5f610e6f7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b5f610e82600482368161199b565b610e8b916119c2565b90505f610e9782610f6d565b905080610f5f5760405163b700961360e01b81523360048201523060248201526001600160e01b0319831660448201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b7009613906064016040805180830381865afa158015610f15573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f3991906119fa565b50905080610f5f5760405162d1953b60e31b815233600482015260240160405180910390fd5b610f688361191d565b505050565b5f7f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b0319161480610fe357507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061102157507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061105f57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061109d57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806110db57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061111957507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061115757507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061119557507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806111d357507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061121157507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061124f57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061128d57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806112cb57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061130957507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061134757507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061138557507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806113c357507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061140157507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061143f57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061147d57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806114bb57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806114f957507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061153757507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061157557507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806115b357507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806115f157507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061162f57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061166d57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806116ab57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806116e957507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061172757507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061176557507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806117a357507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806117e157507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061181f57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061185d57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061189b57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806118d957507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061191757507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b92915050565b365f5f375f5f365f845af43d5f5f3e808015611937573d5ff35b3d5ffd5b602080825282518282018190525f918401906040840190835b8181101561197c5783516001600160e01b031916835260209384019390920191600101611954565b509095945050505050565b634e487b7160e01b5f52603260045260245ffd5b5f5f858511156119a9575f5ffd5b838611156119b5575f5ffd5b5050820193919092039150565b80356001600160e01b031981169060048410156119f3576001600160e01b0319600485900360031b81901b82161691505b5092915050565b5f5f60408385031215611a0b575f5ffd5b82518015158114611a1a575f5ffd5b602084015190925063ffffffff81168114611a33575f5ffd5b80915050925092905056fea26469706673582212201770189f493021e9ead2c567d42fc86706a7302153dbc9bf872db8769f9e84a164736f6c634300081c0033",
|
|
120
|
+
"deployedBytecode": "0x608060405260043610610028575f3560e01c806314416c03146100325780633a7b7a391461005c575b6100306100a7565b005b34801561003d575f5ffd5b506100466100b9565b604051610053919061193b565b60405180910390f35b348015610067575f5ffd5b5061008f7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610053565b6100b76100b2610e3d565b610e74565b565b604080516028808252610520820190925260609160208201610500803683370190505090507f0000000000000000000000000000000000000000000000000000000000000000815f8151811061011157610111611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160018151811061016757610167611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f0000000000000000000000000000000000000000000000000000000000000000816002815181106101bd576101bd611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160038151811061021357610213611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160048151811061026957610269611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f0000000000000000000000000000000000000000000000000000000000000000816005815181106102bf576102bf611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160068151811061031557610315611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160078151811061036b5761036b611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f0000000000000000000000000000000000000000000000000000000000000000816008815181106103c1576103c1611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160098151811061041757610417611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081600a8151811061046d5761046d611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081600b815181106104c3576104c3611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081600c8151811061051957610519611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081600d8151811061056f5761056f611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081600e815181106105c5576105c5611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081600f8151811061061b5761061b611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160108151811061067157610671611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f0000000000000000000000000000000000000000000000000000000000000000816011815181106106c7576106c7611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160128151811061071d5761071d611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160138151811061077357610773611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f0000000000000000000000000000000000000000000000000000000000000000816014815181106107c9576107c9611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160158151811061081f5761081f611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160168151811061087557610875611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f0000000000000000000000000000000000000000000000000000000000000000816017815181106108cb576108cb611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160188151811061092157610921611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f00000000000000000000000000000000000000000000000000000000000000008160198151811061097757610977611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081601a815181106109cd576109cd611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081601b81518110610a2357610a23611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081601c81518110610a7957610a79611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081601d81518110610acf57610acf611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081601e81518110610b2557610b25611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081601f81518110610b7b57610b7b611987565b6001600160e01b031990921660209283029190910182015281517f00000000000000000000000000000000000000000000000000000000000000009183918110610bc757610bc7611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081602181518110610c1d57610c1d611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081602281518110610c7357610c73611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081602381518110610cc957610cc9611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081602481518110610d1f57610d1f611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081602581518110610d7557610d75611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081602681518110610dcb57610dcb611987565b60200260200101906001600160e01b03191690816001600160e01b031916815250507f000000000000000000000000000000000000000000000000000000000000000081602781518110610e2157610e21611987565b6001600160e01b03199092166020928302919091019091015290565b5f610e6f7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b5f610e82600482368161199b565b610e8b916119c2565b90505f610e9782610f6d565b905080610f5f5760405163b700961360e01b81523360048201523060248201526001600160e01b0319831660448201527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063b7009613906064016040805180830381865afa158015610f15573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f3991906119fa565b50905080610f5f5760405162d1953b60e31b815233600482015260240160405180910390fd5b610f688361191d565b505050565b5f7f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b0319161480610fe357507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061102157507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061105f57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061109d57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806110db57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061111957507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061115757507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061119557507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806111d357507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061121157507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061124f57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061128d57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806112cb57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061130957507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061134757507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061138557507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806113c357507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061140157507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061143f57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061147d57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806114bb57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806114f957507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061153757507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061157557507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806115b357507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806115f157507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061162f57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061166d57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806116ab57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806116e957507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061172757507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061176557507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806117a357507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806117e157507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061181f57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061185d57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061189b57507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b806118d957507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b8061191757507f00000000000000000000000000000000000000000000000000000000000000006001600160e01b031916826001600160e01b031916145b92915050565b365f5f375f5f365f845af43d5f5f3e808015611937573d5ff35b3d5ffd5b602080825282518282018190525f918401906040840190835b8181101561197c5783516001600160e01b031916835260209384019390920191600101611954565b509095945050505050565b634e487b7160e01b5f52603260045260245ffd5b5f5f858511156119a9575f5ffd5b838611156119b5575f5ffd5b5050820193919092039150565b80356001600160e01b031981169060048410156119f3576001600160e01b0319600485900360031b81901b82161691505b5092915050565b5f5f60408385031215611a0b575f5ffd5b82518015158114611a1a575f5ffd5b602084015190925063ffffffff81168114611a33575f5ffd5b80915050925092905056fea26469706673582212201770189f493021e9ead2c567d42fc86706a7302153dbc9bf872db8769f9e84a164736f6c634300081c0033",
|
|
121
|
+
"linkReferences": {},
|
|
122
|
+
"deployedLinkReferences": {}
|
|
123
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import {AccessManagedProxy} from "./AccessManagedProxy.sol";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @title AMPUtils
|
|
8
|
+
* @dev Utility functions for doing custom access control rules, for contracts deployed
|
|
9
|
+
* with AccessManagedProxy
|
|
10
|
+
* @author Ensuro
|
|
11
|
+
*/
|
|
12
|
+
library AMPUtils {
|
|
13
|
+
// Error copied from IAccessManaged
|
|
14
|
+
error AccessManagedUnauthorized(address caller);
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* @dev Checks if the user can call a particular selector, assuming the calling contract was deployed as an AMP.
|
|
18
|
+
*
|
|
19
|
+
* @param user The user for which you want to check the access, typically msg.sender
|
|
20
|
+
* @param selector The selector of the method called (or a fake selector generated with makeSelector or another way)
|
|
21
|
+
*/
|
|
22
|
+
function checkCanCall(address user, bytes4 selector) internal view {
|
|
23
|
+
(bool immediate, ) = AccessManagedProxy(payable(address(this))).ACCESS_MANAGER().canCall(
|
|
24
|
+
user,
|
|
25
|
+
address(this),
|
|
26
|
+
selector
|
|
27
|
+
);
|
|
28
|
+
require(immediate, AccessManagedUnauthorized(user));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* @dev Standard way of creating "fake selectors" (not necessarily tied to a method call) for specific permissions
|
|
33
|
+
*/
|
|
34
|
+
function makeSelector(bytes memory something) internal pure returns (bytes4) {
|
|
35
|
+
return bytes4(keccak256(something));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import {AccessManagedProxy} from "../AccessManagedProxy.sol";
|
|
5
|
+
import {IAccessManager} from "@openzeppelin/contracts/access/manager/IAccessManager.sol";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @title AccessManagedProxyS25
|
|
9
|
+
* @notice Specialization of AccessManagedProxy with pass thru (skips AM) for some messages for gas optimization
|
|
10
|
+
*
|
|
11
|
+
* @custom:security-contact security@ensuro.co
|
|
12
|
+
* @author Ensuro
|
|
13
|
+
*/
|
|
14
|
+
contract AccessManagedProxyS25 is AccessManagedProxy {
|
|
15
|
+
bytes4 internal immutable PASS_THRU_METHODS_0;
|
|
16
|
+
bytes4 internal immutable PASS_THRU_METHODS_1;
|
|
17
|
+
bytes4 internal immutable PASS_THRU_METHODS_2;
|
|
18
|
+
bytes4 internal immutable PASS_THRU_METHODS_3;
|
|
19
|
+
bytes4 internal immutable PASS_THRU_METHODS_4;
|
|
20
|
+
bytes4 internal immutable PASS_THRU_METHODS_5;
|
|
21
|
+
bytes4 internal immutable PASS_THRU_METHODS_6;
|
|
22
|
+
bytes4 internal immutable PASS_THRU_METHODS_7;
|
|
23
|
+
bytes4 internal immutable PASS_THRU_METHODS_8;
|
|
24
|
+
bytes4 internal immutable PASS_THRU_METHODS_9;
|
|
25
|
+
bytes4 internal immutable PASS_THRU_METHODS_10;
|
|
26
|
+
bytes4 internal immutable PASS_THRU_METHODS_11;
|
|
27
|
+
bytes4 internal immutable PASS_THRU_METHODS_12;
|
|
28
|
+
bytes4 internal immutable PASS_THRU_METHODS_13;
|
|
29
|
+
bytes4 internal immutable PASS_THRU_METHODS_14;
|
|
30
|
+
bytes4 internal immutable PASS_THRU_METHODS_15;
|
|
31
|
+
bytes4 internal immutable PASS_THRU_METHODS_16;
|
|
32
|
+
bytes4 internal immutable PASS_THRU_METHODS_17;
|
|
33
|
+
bytes4 internal immutable PASS_THRU_METHODS_18;
|
|
34
|
+
bytes4 internal immutable PASS_THRU_METHODS_19;
|
|
35
|
+
bytes4 internal immutable PASS_THRU_METHODS_20;
|
|
36
|
+
bytes4 internal immutable PASS_THRU_METHODS_21;
|
|
37
|
+
bytes4 internal immutable PASS_THRU_METHODS_22;
|
|
38
|
+
bytes4 internal immutable PASS_THRU_METHODS_23;
|
|
39
|
+
bytes4 internal immutable PASS_THRU_METHODS_24;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @notice Constructor of the proxy, defining the implementation and the access manager
|
|
43
|
+
* @dev Initializes the upgradeable proxy with an initial implementation specified by `implementation` and
|
|
44
|
+
* with `manager` as the ACCESS_MANAGER that will handle access control.
|
|
45
|
+
*
|
|
46
|
+
* @param implementation The initial implementation contract.
|
|
47
|
+
* @param _data If nonempty, it's used as data in a delegate call to `implementation`. This will typically be an
|
|
48
|
+
* encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.
|
|
49
|
+
* @param manager The access manager that will handle access control
|
|
50
|
+
* @param passThruMethods The selector of methods that will skip the access control validation, typically used for
|
|
51
|
+
* views and other methods for gas optimization.
|
|
52
|
+
*
|
|
53
|
+
* Requirements:
|
|
54
|
+
*
|
|
55
|
+
* - If `data` is empty, `msg.value` must be zero.
|
|
56
|
+
*/
|
|
57
|
+
constructor(
|
|
58
|
+
address implementation,
|
|
59
|
+
bytes memory _data,
|
|
60
|
+
IAccessManager manager,
|
|
61
|
+
bytes4[25] memory passThruMethods
|
|
62
|
+
) payable AccessManagedProxy(implementation, _data, manager) {
|
|
63
|
+
PASS_THRU_METHODS_0 = passThruMethods[0];
|
|
64
|
+
PASS_THRU_METHODS_1 = passThruMethods[1];
|
|
65
|
+
PASS_THRU_METHODS_2 = passThruMethods[2];
|
|
66
|
+
PASS_THRU_METHODS_3 = passThruMethods[3];
|
|
67
|
+
PASS_THRU_METHODS_4 = passThruMethods[4];
|
|
68
|
+
PASS_THRU_METHODS_5 = passThruMethods[5];
|
|
69
|
+
PASS_THRU_METHODS_6 = passThruMethods[6];
|
|
70
|
+
PASS_THRU_METHODS_7 = passThruMethods[7];
|
|
71
|
+
PASS_THRU_METHODS_8 = passThruMethods[8];
|
|
72
|
+
PASS_THRU_METHODS_9 = passThruMethods[9];
|
|
73
|
+
PASS_THRU_METHODS_10 = passThruMethods[10];
|
|
74
|
+
PASS_THRU_METHODS_11 = passThruMethods[11];
|
|
75
|
+
PASS_THRU_METHODS_12 = passThruMethods[12];
|
|
76
|
+
PASS_THRU_METHODS_13 = passThruMethods[13];
|
|
77
|
+
PASS_THRU_METHODS_14 = passThruMethods[14];
|
|
78
|
+
PASS_THRU_METHODS_15 = passThruMethods[15];
|
|
79
|
+
PASS_THRU_METHODS_16 = passThruMethods[16];
|
|
80
|
+
PASS_THRU_METHODS_17 = passThruMethods[17];
|
|
81
|
+
PASS_THRU_METHODS_18 = passThruMethods[18];
|
|
82
|
+
PASS_THRU_METHODS_19 = passThruMethods[19];
|
|
83
|
+
PASS_THRU_METHODS_20 = passThruMethods[20];
|
|
84
|
+
PASS_THRU_METHODS_21 = passThruMethods[21];
|
|
85
|
+
PASS_THRU_METHODS_22 = passThruMethods[22];
|
|
86
|
+
PASS_THRU_METHODS_23 = passThruMethods[23];
|
|
87
|
+
PASS_THRU_METHODS_24 = passThruMethods[24];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/*
|
|
91
|
+
* @notice Skips the access control if the method called is one of the passThruMethods
|
|
92
|
+
* @dev See {PASS_THRU_METHODS()}
|
|
93
|
+
* @param selector The selector of the method called
|
|
94
|
+
* @return Whether the access control using ACCESS_MANAGER should be skipped or not
|
|
95
|
+
*/
|
|
96
|
+
function _skipAC(bytes4 selector) internal view override returns (bool) {
|
|
97
|
+
return
|
|
98
|
+
selector == PASS_THRU_METHODS_0 ||
|
|
99
|
+
selector == PASS_THRU_METHODS_1 ||
|
|
100
|
+
selector == PASS_THRU_METHODS_2 ||
|
|
101
|
+
selector == PASS_THRU_METHODS_3 ||
|
|
102
|
+
selector == PASS_THRU_METHODS_4 ||
|
|
103
|
+
selector == PASS_THRU_METHODS_5 ||
|
|
104
|
+
selector == PASS_THRU_METHODS_6 ||
|
|
105
|
+
selector == PASS_THRU_METHODS_7 ||
|
|
106
|
+
selector == PASS_THRU_METHODS_8 ||
|
|
107
|
+
selector == PASS_THRU_METHODS_9 ||
|
|
108
|
+
selector == PASS_THRU_METHODS_10 ||
|
|
109
|
+
selector == PASS_THRU_METHODS_11 ||
|
|
110
|
+
selector == PASS_THRU_METHODS_12 ||
|
|
111
|
+
selector == PASS_THRU_METHODS_13 ||
|
|
112
|
+
selector == PASS_THRU_METHODS_14 ||
|
|
113
|
+
selector == PASS_THRU_METHODS_15 ||
|
|
114
|
+
selector == PASS_THRU_METHODS_16 ||
|
|
115
|
+
selector == PASS_THRU_METHODS_17 ||
|
|
116
|
+
selector == PASS_THRU_METHODS_18 ||
|
|
117
|
+
selector == PASS_THRU_METHODS_19 ||
|
|
118
|
+
selector == PASS_THRU_METHODS_20 ||
|
|
119
|
+
selector == PASS_THRU_METHODS_21 ||
|
|
120
|
+
selector == PASS_THRU_METHODS_22 ||
|
|
121
|
+
selector == PASS_THRU_METHODS_23 ||
|
|
122
|
+
selector == PASS_THRU_METHODS_24;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* @notice Gives observability to the methods that are skipped from access control
|
|
127
|
+
* @dev This list is fixed and defined on contract construction
|
|
128
|
+
* @return methods The list of method selectors that skip ACCESS_MANAGER access control
|
|
129
|
+
*/
|
|
130
|
+
// solhint-disable-next-line func-name-mixedcase
|
|
131
|
+
function PASS_THRU_METHODS() external view returns (bytes4[] memory methods) {
|
|
132
|
+
methods = new bytes4[](25);
|
|
133
|
+
methods[0] = PASS_THRU_METHODS_0;
|
|
134
|
+
methods[1] = PASS_THRU_METHODS_1;
|
|
135
|
+
methods[2] = PASS_THRU_METHODS_2;
|
|
136
|
+
methods[3] = PASS_THRU_METHODS_3;
|
|
137
|
+
methods[4] = PASS_THRU_METHODS_4;
|
|
138
|
+
methods[5] = PASS_THRU_METHODS_5;
|
|
139
|
+
methods[6] = PASS_THRU_METHODS_6;
|
|
140
|
+
methods[7] = PASS_THRU_METHODS_7;
|
|
141
|
+
methods[8] = PASS_THRU_METHODS_8;
|
|
142
|
+
methods[9] = PASS_THRU_METHODS_9;
|
|
143
|
+
methods[10] = PASS_THRU_METHODS_10;
|
|
144
|
+
methods[11] = PASS_THRU_METHODS_11;
|
|
145
|
+
methods[12] = PASS_THRU_METHODS_12;
|
|
146
|
+
methods[13] = PASS_THRU_METHODS_13;
|
|
147
|
+
methods[14] = PASS_THRU_METHODS_14;
|
|
148
|
+
methods[15] = PASS_THRU_METHODS_15;
|
|
149
|
+
methods[16] = PASS_THRU_METHODS_16;
|
|
150
|
+
methods[17] = PASS_THRU_METHODS_17;
|
|
151
|
+
methods[18] = PASS_THRU_METHODS_18;
|
|
152
|
+
methods[19] = PASS_THRU_METHODS_19;
|
|
153
|
+
methods[20] = PASS_THRU_METHODS_20;
|
|
154
|
+
methods[21] = PASS_THRU_METHODS_21;
|
|
155
|
+
methods[22] = PASS_THRU_METHODS_22;
|
|
156
|
+
methods[23] = PASS_THRU_METHODS_23;
|
|
157
|
+
methods[24] = PASS_THRU_METHODS_24;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity ^0.8.0;
|
|
3
|
+
|
|
4
|
+
import {AccessManagedProxy} from "../AccessManagedProxy.sol";
|
|
5
|
+
import {IAccessManager} from "@openzeppelin/contracts/access/manager/IAccessManager.sol";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @title AccessManagedProxyS26
|
|
9
|
+
* @notice Specialization of AccessManagedProxy with pass thru (skips AM) for some messages for gas optimization
|
|
10
|
+
*
|
|
11
|
+
* @custom:security-contact security@ensuro.co
|
|
12
|
+
* @author Ensuro
|
|
13
|
+
*/
|
|
14
|
+
contract AccessManagedProxyS26 is AccessManagedProxy {
|
|
15
|
+
bytes4 internal immutable PASS_THRU_METHODS_0;
|
|
16
|
+
bytes4 internal immutable PASS_THRU_METHODS_1;
|
|
17
|
+
bytes4 internal immutable PASS_THRU_METHODS_2;
|
|
18
|
+
bytes4 internal immutable PASS_THRU_METHODS_3;
|
|
19
|
+
bytes4 internal immutable PASS_THRU_METHODS_4;
|
|
20
|
+
bytes4 internal immutable PASS_THRU_METHODS_5;
|
|
21
|
+
bytes4 internal immutable PASS_THRU_METHODS_6;
|
|
22
|
+
bytes4 internal immutable PASS_THRU_METHODS_7;
|
|
23
|
+
bytes4 internal immutable PASS_THRU_METHODS_8;
|
|
24
|
+
bytes4 internal immutable PASS_THRU_METHODS_9;
|
|
25
|
+
bytes4 internal immutable PASS_THRU_METHODS_10;
|
|
26
|
+
bytes4 internal immutable PASS_THRU_METHODS_11;
|
|
27
|
+
bytes4 internal immutable PASS_THRU_METHODS_12;
|
|
28
|
+
bytes4 internal immutable PASS_THRU_METHODS_13;
|
|
29
|
+
bytes4 internal immutable PASS_THRU_METHODS_14;
|
|
30
|
+
bytes4 internal immutable PASS_THRU_METHODS_15;
|
|
31
|
+
bytes4 internal immutable PASS_THRU_METHODS_16;
|
|
32
|
+
bytes4 internal immutable PASS_THRU_METHODS_17;
|
|
33
|
+
bytes4 internal immutable PASS_THRU_METHODS_18;
|
|
34
|
+
bytes4 internal immutable PASS_THRU_METHODS_19;
|
|
35
|
+
bytes4 internal immutable PASS_THRU_METHODS_20;
|
|
36
|
+
bytes4 internal immutable PASS_THRU_METHODS_21;
|
|
37
|
+
bytes4 internal immutable PASS_THRU_METHODS_22;
|
|
38
|
+
bytes4 internal immutable PASS_THRU_METHODS_23;
|
|
39
|
+
bytes4 internal immutable PASS_THRU_METHODS_24;
|
|
40
|
+
bytes4 internal immutable PASS_THRU_METHODS_25;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @notice Constructor of the proxy, defining the implementation and the access manager
|
|
44
|
+
* @dev Initializes the upgradeable proxy with an initial implementation specified by `implementation` and
|
|
45
|
+
* with `manager` as the ACCESS_MANAGER that will handle access control.
|
|
46
|
+
*
|
|
47
|
+
* @param implementation The initial implementation contract.
|
|
48
|
+
* @param _data If nonempty, it's used as data in a delegate call to `implementation`. This will typically be an
|
|
49
|
+
* encoded function call, and allows initializing the storage of the proxy like a Solidity constructor.
|
|
50
|
+
* @param manager The access manager that will handle access control
|
|
51
|
+
* @param passThruMethods The selector of methods that will skip the access control validation, typically used for
|
|
52
|
+
* views and other methods for gas optimization.
|
|
53
|
+
*
|
|
54
|
+
* Requirements:
|
|
55
|
+
*
|
|
56
|
+
* - If `data` is empty, `msg.value` must be zero.
|
|
57
|
+
*/
|
|
58
|
+
constructor(
|
|
59
|
+
address implementation,
|
|
60
|
+
bytes memory _data,
|
|
61
|
+
IAccessManager manager,
|
|
62
|
+
bytes4[26] memory passThruMethods
|
|
63
|
+
) payable AccessManagedProxy(implementation, _data, manager) {
|
|
64
|
+
PASS_THRU_METHODS_0 = passThruMethods[0];
|
|
65
|
+
PASS_THRU_METHODS_1 = passThruMethods[1];
|
|
66
|
+
PASS_THRU_METHODS_2 = passThruMethods[2];
|
|
67
|
+
PASS_THRU_METHODS_3 = passThruMethods[3];
|
|
68
|
+
PASS_THRU_METHODS_4 = passThruMethods[4];
|
|
69
|
+
PASS_THRU_METHODS_5 = passThruMethods[5];
|
|
70
|
+
PASS_THRU_METHODS_6 = passThruMethods[6];
|
|
71
|
+
PASS_THRU_METHODS_7 = passThruMethods[7];
|
|
72
|
+
PASS_THRU_METHODS_8 = passThruMethods[8];
|
|
73
|
+
PASS_THRU_METHODS_9 = passThruMethods[9];
|
|
74
|
+
PASS_THRU_METHODS_10 = passThruMethods[10];
|
|
75
|
+
PASS_THRU_METHODS_11 = passThruMethods[11];
|
|
76
|
+
PASS_THRU_METHODS_12 = passThruMethods[12];
|
|
77
|
+
PASS_THRU_METHODS_13 = passThruMethods[13];
|
|
78
|
+
PASS_THRU_METHODS_14 = passThruMethods[14];
|
|
79
|
+
PASS_THRU_METHODS_15 = passThruMethods[15];
|
|
80
|
+
PASS_THRU_METHODS_16 = passThruMethods[16];
|
|
81
|
+
PASS_THRU_METHODS_17 = passThruMethods[17];
|
|
82
|
+
PASS_THRU_METHODS_18 = passThruMethods[18];
|
|
83
|
+
PASS_THRU_METHODS_19 = passThruMethods[19];
|
|
84
|
+
PASS_THRU_METHODS_20 = passThruMethods[20];
|
|
85
|
+
PASS_THRU_METHODS_21 = passThruMethods[21];
|
|
86
|
+
PASS_THRU_METHODS_22 = passThruMethods[22];
|
|
87
|
+
PASS_THRU_METHODS_23 = passThruMethods[23];
|
|
88
|
+
PASS_THRU_METHODS_24 = passThruMethods[24];
|
|
89
|
+
PASS_THRU_METHODS_25 = passThruMethods[25];
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/*
|
|
93
|
+
* @notice Skips the access control if the method called is one of the passThruMethods
|
|
94
|
+
* @dev See {PASS_THRU_METHODS()}
|
|
95
|
+
* @param selector The selector of the method called
|
|
96
|
+
* @return Whether the access control using ACCESS_MANAGER should be skipped or not
|
|
97
|
+
*/
|
|
98
|
+
function _skipAC(bytes4 selector) internal view override returns (bool) {
|
|
99
|
+
return
|
|
100
|
+
selector == PASS_THRU_METHODS_0 ||
|
|
101
|
+
selector == PASS_THRU_METHODS_1 ||
|
|
102
|
+
selector == PASS_THRU_METHODS_2 ||
|
|
103
|
+
selector == PASS_THRU_METHODS_3 ||
|
|
104
|
+
selector == PASS_THRU_METHODS_4 ||
|
|
105
|
+
selector == PASS_THRU_METHODS_5 ||
|
|
106
|
+
selector == PASS_THRU_METHODS_6 ||
|
|
107
|
+
selector == PASS_THRU_METHODS_7 ||
|
|
108
|
+
selector == PASS_THRU_METHODS_8 ||
|
|
109
|
+
selector == PASS_THRU_METHODS_9 ||
|
|
110
|
+
selector == PASS_THRU_METHODS_10 ||
|
|
111
|
+
selector == PASS_THRU_METHODS_11 ||
|
|
112
|
+
selector == PASS_THRU_METHODS_12 ||
|
|
113
|
+
selector == PASS_THRU_METHODS_13 ||
|
|
114
|
+
selector == PASS_THRU_METHODS_14 ||
|
|
115
|
+
selector == PASS_THRU_METHODS_15 ||
|
|
116
|
+
selector == PASS_THRU_METHODS_16 ||
|
|
117
|
+
selector == PASS_THRU_METHODS_17 ||
|
|
118
|
+
selector == PASS_THRU_METHODS_18 ||
|
|
119
|
+
selector == PASS_THRU_METHODS_19 ||
|
|
120
|
+
selector == PASS_THRU_METHODS_20 ||
|
|
121
|
+
selector == PASS_THRU_METHODS_21 ||
|
|
122
|
+
selector == PASS_THRU_METHODS_22 ||
|
|
123
|
+
selector == PASS_THRU_METHODS_23 ||
|
|
124
|
+
selector == PASS_THRU_METHODS_24 ||
|
|
125
|
+
selector == PASS_THRU_METHODS_25;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
* @notice Gives observability to the methods that are skipped from access control
|
|
130
|
+
* @dev This list is fixed and defined on contract construction
|
|
131
|
+
* @return methods The list of method selectors that skip ACCESS_MANAGER access control
|
|
132
|
+
*/
|
|
133
|
+
// solhint-disable-next-line func-name-mixedcase
|
|
134
|
+
function PASS_THRU_METHODS() external view returns (bytes4[] memory methods) {
|
|
135
|
+
methods = new bytes4[](26);
|
|
136
|
+
methods[0] = PASS_THRU_METHODS_0;
|
|
137
|
+
methods[1] = PASS_THRU_METHODS_1;
|
|
138
|
+
methods[2] = PASS_THRU_METHODS_2;
|
|
139
|
+
methods[3] = PASS_THRU_METHODS_3;
|
|
140
|
+
methods[4] = PASS_THRU_METHODS_4;
|
|
141
|
+
methods[5] = PASS_THRU_METHODS_5;
|
|
142
|
+
methods[6] = PASS_THRU_METHODS_6;
|
|
143
|
+
methods[7] = PASS_THRU_METHODS_7;
|
|
144
|
+
methods[8] = PASS_THRU_METHODS_8;
|
|
145
|
+
methods[9] = PASS_THRU_METHODS_9;
|
|
146
|
+
methods[10] = PASS_THRU_METHODS_10;
|
|
147
|
+
methods[11] = PASS_THRU_METHODS_11;
|
|
148
|
+
methods[12] = PASS_THRU_METHODS_12;
|
|
149
|
+
methods[13] = PASS_THRU_METHODS_13;
|
|
150
|
+
methods[14] = PASS_THRU_METHODS_14;
|
|
151
|
+
methods[15] = PASS_THRU_METHODS_15;
|
|
152
|
+
methods[16] = PASS_THRU_METHODS_16;
|
|
153
|
+
methods[17] = PASS_THRU_METHODS_17;
|
|
154
|
+
methods[18] = PASS_THRU_METHODS_18;
|
|
155
|
+
methods[19] = PASS_THRU_METHODS_19;
|
|
156
|
+
methods[20] = PASS_THRU_METHODS_20;
|
|
157
|
+
methods[21] = PASS_THRU_METHODS_21;
|
|
158
|
+
methods[22] = PASS_THRU_METHODS_22;
|
|
159
|
+
methods[23] = PASS_THRU_METHODS_23;
|
|
160
|
+
methods[24] = PASS_THRU_METHODS_24;
|
|
161
|
+
methods[25] = PASS_THRU_METHODS_25;
|
|
162
|
+
}
|
|
163
|
+
}
|