-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathArbWasmCache.sol
More file actions
49 lines (41 loc) · 1.8 KB
/
ArbWasmCache.sol
File metadata and controls
49 lines (41 loc) · 1.8 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
// Copyright 2022-2024, Offchain Labs, Inc.
// For license information, see https://github.com/OffchainLabs/nitro/blob/master/LICENSE
// SPDX-License-Identifier: BUSL-1.1
pragma solidity >=0.4.21 <0.9.0;
/**
* @title Methods for managing Stylus caches
* @notice Precompiled contract that exists in every Arbitrum chain at 0x0000000000000000000000000000000000000072.
* @notice Available in ArbOS version 30 and above
*/
interface ArbWasmCache {
/// @notice See if the user is a cache manager.
function isCacheManager(
address manager
) external view returns (bool);
/// @notice Retrieve all address managers.
/// @return managers the list of managers.
function allCacheManagers() external view returns (address[] memory managers);
/// @dev Deprecated, replaced with cacheProgram
/// @notice Available in ArbOS version 30 only
function cacheCodehash(
bytes32 codehash
) external;
/// @notice Caches all programs with a codehash equal to the given address.
/// @notice Reverts if the programs have expired.
/// @notice Caller must be a cache manager or chain owner.
/// @notice If you're looking for how to bid for position, interact with the chain's cache manager contract.
/// @notice Available in ArbOS version 31 and above
function cacheProgram(
address addr
) external;
/// @notice Evicts all programs with the given codehash.
/// @notice Caller must be a cache manager or chain owner.
function evictCodehash(
bytes32 codehash
) external;
/// @notice Gets whether a program is cached. Note that the program may be expired.
function codehashIsCached(
bytes32 codehash
) external view returns (bool);
event UpdateProgramCache(address indexed manager, bytes32 indexed codehash, bool cached);
}