-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathArbOwner.sol
More file actions
295 lines (243 loc) · 10.4 KB
/
ArbOwner.sol
File metadata and controls
295 lines (243 loc) · 10.4 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
// Copyright 2021-2024, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro-contracts/blob/main/LICENSE
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.4.21 <0.9.0;
import {ArbResourceConstraintsTypes} from "./ArbResourceConstraintsTypes.sol";
/**
* @title Provides owners with tools for managing the rollup.
* @notice Calls by non-owners will always revert.
* Most of Arbitrum Classic's owner methods have been removed since they no longer make sense in Nitro:
* - What were once chain parameters are now parts of ArbOS's state, and those that remain are set at genesis.
* - ArbOS upgrades happen with the rest of the system rather than being independent
* - Exemptions to address aliasing are no longer offered. Exemptions were intended to support backward compatibility for contracts deployed before aliasing was introduced, but no exemptions were ever requested.
* Precompiled contract that exists in every Arbitrum chain at 0x0000000000000000000000000000000000000070.
*
*/
interface ArbOwner {
/// @notice Add account as a chain owner
function addChainOwner(
address newOwner
) external;
/// @notice Remove account from the list of chain owners
function removeChainOwner(
address ownerToRemove
) external;
/// @notice See if the user is a chain owner
function isChainOwner(
address addr
) external view returns (bool);
/// @notice Retrieves the list of chain owners
function getAllChainOwners() external view returns (address[] memory);
/// @notice Sets the NativeTokenManagementFrom time
/// @notice Available in ArbOS version 41 and above
function setNativeTokenManagementFrom(
uint64 timestamp
) external;
/// @notice Add account as a native token owner
/// @notice Available in ArbOS version 41 and above
function addNativeTokenOwner(
address newOwner
) external;
/// @notice Remove account from the list of native token owners
/// @notice Available in ArbOS version 41 and above
function removeNativeTokenOwner(
address ownerToRemove
) external;
/// @notice See if the user is a native token owner
/// @notice Available in ArbOS version 41 and above
function isNativeTokenOwner(
address addr
) external view returns (bool);
/// @notice Retrieves the list of native token owners
/// @notice Available in ArbOS version 41 and above
function getAllNativeTokenOwners() external view returns (address[] memory);
/// @notice Set how slowly ArbOS updates its estimate of the L1 basefee
function setL1BaseFeeEstimateInertia(
uint64 inertia
) external;
/// @notice Set the L2 basefee directly, bypassing the pool calculus
function setL2BaseFee(
uint256 priceInWei
) external;
/// @notice Set the minimum basefee needed for a transaction to succeed
function setMinimumL2BaseFee(
uint256 priceInWei
) external;
/// @notice Set the computational speed limit for the chain
function setSpeedLimit(
uint64 limit
) external;
/// @notice Set the maximum size a tx can be
function setMaxTxGasLimit(
uint64 limit
) external;
/// @notice Set the maximum size a block can be
/// @notice Available in ArbOS version 50 and above
function setMaxBlockGasLimit(
uint64 limit
) external;
/// @notice Set the L2 gas pricing inertia
function setL2GasPricingInertia(
uint64 sec
) external;
/// @notice Set the L2 gas backlog tolerance
function setL2GasBacklogTolerance(
uint64 sec
) external;
/// @notice Get the network fee collector
function getNetworkFeeAccount() external view returns (address);
/// @notice Get the infrastructure fee collector
/// @notice Available in ArbOS version 5 and above
function getInfraFeeAccount() external view returns (address);
/// @notice Set the network fee collector
function setNetworkFeeAccount(
address newNetworkFeeAccount
) external;
/// @notice Set the infrastructure fee collector
/// @notice Available in ArbOS version 5 and above
function setInfraFeeAccount(
address newInfraFeeAccount
) external;
/// @notice Upgrades ArbOS to the requested version at the requested timestamp
function scheduleArbOSUpgrade(uint64 newVersion, uint64 timestamp) external;
/// @notice Sets equilibration units parameter for L1 price adjustment algorithm
function setL1PricingEquilibrationUnits(
uint256 equilibrationUnits
) external;
/// @notice Sets inertia parameter for L1 price adjustment algorithm
function setL1PricingInertia(
uint64 inertia
) external;
/// @notice Sets reward recipient address for L1 price adjustment algorithm
function setL1PricingRewardRecipient(
address recipient
) external;
/// @notice Sets reward amount for L1 price adjustment algorithm, in wei per unit
function setL1PricingRewardRate(
uint64 weiPerUnit
) external;
/// @notice Set how much ArbOS charges per L1 gas spent on transaction data.
function setL1PricePerUnit(
uint256 pricePerUnit
) external;
/// @notice Set how much L1 charges per non-zero byte of calldata
/// @notice Available in ArbOS version 50 and above
function setParentGasFloorPerToken(
uint64 floorPerToken
) external;
/// @notice Sets the base charge (in L1 gas) attributed to each data batch in the calldata pricer
function setPerBatchGasCharge(
int64 cost
) external;
/// @notice Sets the Brotli compression level used for fast compression
/// @notice Available in ArbOS version 20 and above
function setBrotliCompressionLevel(
uint64 level
) external;
/// @notice Sets the cost amortization cap in basis points
function setAmortizedCostCapBips(
uint64 cap
) external;
/// @notice Releases surplus funds from L1PricerFundsPoolAddress for use
/// @notice Available in ArbOS version 10 and above
function releaseL1PricerSurplusFunds(
uint256 maxWeiToRelease
) external returns (uint256);
/// @notice Sets the amount of ink 1 gas buys
/// @notice Available in ArbOS version 30 and above
/// @param price the conversion rate (must fit in a uint24)
function setInkPrice(
uint32 price
) external;
/// @notice Sets the maximum depth (in wasm words) a wasm stack may grow
/// @notice Available in ArbOS version 30 and above
function setWasmMaxStackDepth(
uint32 depth
) external;
/// @notice Sets the number of free wasm pages a tx gets
/// @notice Available in ArbOS version 30 and above
function setWasmFreePages(
uint16 pages
) external;
/// @notice Sets the base cost of each additional wasm page
/// @notice Available in ArbOS version 30 and above
function setWasmPageGas(
uint16 gas
) external;
/// @notice Sets the maximum number of pages a wasm may allocate
/// @notice Available in ArbOS version 30 and above
function setWasmPageLimit(
uint16 limit
) external;
/// @notice Sets the maximum size of the uncompressed wasm code in bytes
/// @notice Available in ArbOS version 30 and above
function setWasmMaxSize(
uint32 size
) external;
/// @notice Sets the minimum costs to invoke a program
/// @notice Available in ArbOS version 30 and above
/// @param gas amount of gas paid in increments of 256 when not the program is not cached
/// @param cached amount of gas paid in increments of 64 when the program is cached
function setWasmMinInitGas(uint8 gas, uint16 cached) external;
/// @notice Sets the linear adjustment made to program init costs.
/// @notice Available in ArbOS version 30 and above
/// @param percent the adjustment (100% = no adjustment).
function setWasmInitCostScalar(
uint64 percent
) external;
/// @notice Sets the number of days after which programs deactivate
/// @notice Available in ArbOS version 30 and above
function setWasmExpiryDays(
uint16 _days
) external;
/// @notice Sets the age a program must be to perform a keepalive
/// @notice Available in ArbOS version 30 and above
function setWasmKeepaliveDays(
uint16 _days
) external;
/// @notice Sets the number of extra programs ArbOS caches during a given block
/// @notice Available in ArbOS version 30 and above
function setWasmBlockCacheSize(
uint16 count
) external;
/// @notice Adds account as a wasm cache manager
/// @notice Available in ArbOS version 30 and above
function addWasmCacheManager(
address manager
) external;
/// @notice Removes account from the list of wasm cache managers
/// @notice Available in ArbOS version 30 and above
function removeWasmCacheManager(
address manager
) external;
/// @notice Sets serialized chain config in ArbOS state
/// @notice Available in ArbOS version 11 and above
function setChainConfig(
string calldata chainConfig
) external;
/// @notice Sets the increased calldata price feature on or off (EIP-7623)
/// @notice Available in ArbOS version 40 and above with default as false
function setCalldataPriceIncrease(
bool enable
) external;
/// @notice Adds or updates a resource constraint
/// @notice Available on ArbOS version 60 and above
/// @param resources an array of resource–weight pairs (see Nitro documentation for the list of resources)
/// @param periodSecs the time window for the constraint
/// @param targetPerSec allowed usage per second across weighted resources
function setResourceConstraint(
ArbResourceConstraintsTypes.ResourceWeight[] calldata resources,
uint32 periodSecs,
uint64 targetPerSec
) external;
/// @notice Removes a resource constraint
/// @notice Available on ArbOS version 60 and above
/// @param resources the list of resource kinds to be removed (see Nitro documentation for the list of resources)
/// @param periodSecs the time window for the constraint
function clearConstraint(
ArbResourceConstraintsTypes.ResourceKind[] calldata resources,
uint32 periodSecs
) external;
/// Emitted when a successful call is made to this precompile
event OwnerActs(bytes4 indexed method, address indexed owner, bytes data);
}