|
4 | 4 |
|
5 | 5 | pragma solidity >=0.4.21 <0.9.0; |
6 | 6 |
|
| 7 | +import {ArbResourceConstraintsTypes} from "./ArbResourceConstraintsTypes.sol"; |
| 8 | + |
7 | 9 | /** |
8 | 10 | * @title Provides owners with tools for managing the rollup. |
9 | 11 | * @notice Calls by non-owners will always revert. |
@@ -256,30 +258,22 @@ interface ArbOwner { |
256 | 258 | bool enable |
257 | 259 | ) external; |
258 | 260 |
|
259 | | - /// @notice A pair representing a resource kind and its weight in constraint calculations. |
260 | | - /// @param resource the resource kind (see Nitro documentation for list of resources) |
261 | | - /// @param weight the relative weight of this resource in the constraint |
262 | | - struct ResourceWeight { |
263 | | - uint8 resource; |
264 | | - uint64 weight; |
265 | | - } |
266 | | - |
267 | 261 | /// @notice Adds or updates a resource constraint |
268 | 262 | /// @notice Available on ArbOS version 50 and above |
269 | | - /// @param resources an array of (resource, weight) pairs |
| 263 | + /// @param resources an array of resource–weight pairs (see Nitro documentation for the list of resources) |
270 | 264 | /// @param periodSecs the time window for the constraint |
271 | 265 | /// @param targetPerSec allowed usage per second across weighted resources |
272 | 266 | function setResourceConstraint( |
273 | | - ResourceWeight[] calldata resources, |
| 267 | + ArbResourceConstraintsTypes.ResourceWeight[] calldata resources, |
274 | 268 | uint32 periodSecs, |
275 | 269 | uint64 targetPerSec |
276 | 270 | ) external; |
277 | 271 |
|
278 | 272 | /// @notice Removes a resource constraint |
279 | 273 | /// @notice Available on ArbOS version 50 and above |
280 | | - /// @param resource the resource kind (see Nitro documentation for the list of resources) |
| 274 | + /// @param resources the list of resource kinds to be removed (see Nitro documentation for the list of resources) |
281 | 275 | /// @param periodSecs the time window for the constraint |
282 | | - function clearConstraint(uint8 resource, uint32 periodSecs) external; |
| 276 | + function clearConstraint(uint8[] calldata resources, uint32 periodSecs) external; |
283 | 277 |
|
284 | 278 | /// Emitted when a successful call is made to this precompile |
285 | 279 | event OwnerActs(bytes4 indexed method, address indexed owner, bytes data); |
|
0 commit comments