Skip to content
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
989db40
refactor: remove arbos 41 methods
gzeoneth Jul 10, 2025
ec31fac
refactor: remove arbos 40 methods
gzeoneth Jul 10, 2025
4ddeb72
refactor: remove arbos 31 methods
gzeoneth Jul 10, 2025
d7184ef
refactor: remove arbos 30 methods
gzeoneth Jul 10, 2025
6064abc
refactor: remove arbos 20 methods
gzeoneth Jul 10, 2025
be196c0
refactor: remove arbos 11 methods
gzeoneth Jul 10, 2025
72ec09b
refactor: remove arbos 10 methods
gzeoneth Jul 10, 2025
6bbba43
refactor: remove arbos 5 methods
gzeoneth Jul 10, 2025
32a62c9
docs: add LICENSE.md
gzeoneth Jul 10, 2025
14059d3
chore: set up repo and ci
gzeoneth Jul 10, 2025
56ccaf3
docs: add README.md
gzeoneth Jul 10, 2025
08f6926
ci: push
gzeoneth Jul 10, 2025
8aa7df3
ci: fix wrong path
gzeoneth Jul 10, 2025
3880ef4
chore: commit yarn lock
gzeoneth Jul 10, 2025
59ed2e3
feat: add arbos 5 methods
gzeoneth Jul 10, 2025
55dd82e
feat: add arbos 10 methods
gzeoneth Jul 10, 2025
99f7f7d
feat: add arbos 11 methods
gzeoneth Jul 10, 2025
0d1f1b0
feat: add arbos 20 methods
gzeoneth Jul 10, 2025
ff94e82
feat: add arbos 30 methods
gzeoneth Jul 10, 2025
9d2bfdc
feat: add arbos 31 methods
gzeoneth Jul 10, 2025
949eff7
chore: keep cacheCodehash
gzeoneth Jul 10, 2025
4b11ae6
format: fix
gzeoneth Jul 11, 2025
68ca341
Merge branch 'retag-history' into arbos-5
gzeoneth Jul 11, 2025
8fa7fb5
chore: 5.0.0
gzeoneth Jul 11, 2025
ae5a872
Merge branch 'arbos-5' into arbos-10
gzeoneth Jul 11, 2025
67139d0
chore: 10.0.0
gzeoneth Jul 11, 2025
095c3f2
Merge branch 'arbos-10' into arbos-11
gzeoneth Jul 11, 2025
dbae8f6
chore: 11.0.0
gzeoneth Jul 11, 2025
0b6fc52
Merge branch 'arbos-11' into arbos-20
gzeoneth Jul 11, 2025
dbdc36b
chore: 20.0.0
gzeoneth Jul 11, 2025
7d48c91
Merge branch 'arbos-20' into arbos-30
gzeoneth Jul 11, 2025
a1b73a8
chore: 30.0.0
gzeoneth Jul 11, 2025
55d5b35
Merge branch 'arbos-30' into arbos-31
gzeoneth Jul 11, 2025
4a50c7a
chore: 31.0.0
gzeoneth Jul 11, 2025
3c1291f
Merge remote-tracking branch 'origin/main' into arbos-31
gzeoneth Jul 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/contract-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: CI

on:
workflow_dispatch:
pull_request:
push:
branches:
- main

jobs:
test-format:
name: Test format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: stable
cache: false

- name: Setup node/yarn
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'yarn'
cache-dependency-path: '**/yarn.lock'

- name: Install packages
run: yarn

- name: Check Contracts Format
run: yarn format --check

- name: Make sure contracts can be built
run: yarn build
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cache
out
lib
node_modules
1 change: 1 addition & 0 deletions ArbDebug.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ interface ArbDebug {
uint64 number
) external pure;

/// @notice Available in ArbOS version 30 and above
function panic() external;

function legacyError() external pure;
Expand Down
15 changes: 8 additions & 7 deletions ArbGasInfo.sol
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ interface ArbGasInfo {
function getL1BaseFeeEstimateInertia() external view returns (uint64);

/// @notice Get the L1 pricer reward rate, in wei per unit
/// Available in ArbOS version 11
/// @notice Available in ArbOS version 11 and above
function getL1RewardRate() external view returns (uint64);

/// @notice Get the L1 pricer reward recipient
/// Available in ArbOS version 11
/// @notice Available in ArbOS version 11 and above
function getL1RewardRecipient() external view returns (address);

/// @notice Deprecated -- Same as getL1BaseFeeEstimate()
Expand Down Expand Up @@ -94,25 +94,26 @@ interface ArbGasInfo {
function getAmortizedCostCapBips() external view returns (uint64);

/// @notice Returns the available funds from L1 fees
/// @notice Available in ArbOS version 10 and above
function getL1FeesAvailable() external view returns (uint256);

/// @notice Returns the equilibration units parameter for L1 price adjustment algorithm
/// Available in ArbOS version 20
/// @notice Available in ArbOS version 20 and above
function getL1PricingEquilibrationUnits() external view returns (uint256);

/// @notice Returns the last time the L1 calldata pricer was updated.
/// Available in ArbOS version 20
/// @notice Available in ArbOS version 20 and above
function getLastL1PricingUpdateTime() external view returns (uint64);

/// @notice Returns the amount of L1 calldata payments due for rewards (per the L1 reward rate)
/// Available in ArbOS version 20
/// @notice Available in ArbOS version 20 and above
function getL1PricingFundsDueForRewards() external view returns (uint256);

/// @notice Returns the amount of L1 calldata posted since the last update.
/// Available in ArbOS version 20
/// @notice Available in ArbOS version 20 and above
function getL1PricingUnitsSinceUpdate() external view returns (uint64);

/// @notice Returns the L1 pricing surplus as of the last update (may be negative).
/// Available in ArbOS version 20
/// @notice Available in ArbOS version 20 and above
function getLastL1PricingSurplus() external view returns (int256);
}
39 changes: 0 additions & 39 deletions ArbNativeTokenManager.sol

This file was deleted.

59 changes: 19 additions & 40 deletions ArbOwner.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,6 @@ interface ArbOwner {
/// @notice Retrieves the list of chain owners
function getAllChainOwners() external view returns (address[] memory);

/// @notice Sets the NativeTokenManagementFrom time
/// Available in ArbOS version 41
function setNativeTokenManagementFrom(
uint64 timestamp
) external;

/// @notice Add account as a native token owner
/// Available in ArbOS version 41
function addNativeTokenOwner(
address newOwner
) external;

/// @notice Remove account from the list of native token owners
/// Available in ArbOS version 41
function removeNativeTokenOwner(
address ownerToRemove
) external;

/// @notice See if the user is a native token owner
/// Available in ArbOS version 41
function isNativeTokenOwner(
address addr
) external view returns (bool);

/// @notice Retrieves the list of native token owners
/// Available in ArbOS version 41
function getAllNativeTokenOwners() external view returns (address[] memory);

/// @notice Set how slowly ArbOS updates its estimate of the L1 basefee
function setL1BaseFeeEstimateInertia(
uint64 inertia
Expand Down Expand Up @@ -100,6 +72,7 @@ interface ArbOwner {
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
Expand All @@ -108,6 +81,7 @@ interface ArbOwner {
) external;

/// @notice Set the infrastructure fee collector
/// @notice Available in ArbOS version 5 and above
function setInfraFeeAccount(
address newInfraFeeAccount
) external;
Expand Down Expand Up @@ -145,10 +119,8 @@ interface ArbOwner {
int64 cost
) external;

/**
* @notice Sets the Brotli compression level used for fast compression
* Available in ArbOS version 12 with default level as 1
*/
/// @notice Sets the Brotli compression level used for fast compression
/// @notice Available in ArbOS version 20 and above
function setBrotliCompressionLevel(
uint64 level
) external;
Expand All @@ -159,90 +131,97 @@ interface ArbOwner {
) 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)
* Available in ArbOS version 40 with default as false
*/
function setCalldataPriceIncrease(
bool enable
) external;

/// Emitted when a successful call is made to this precompile
event OwnerActs(bytes4 indexed method, address indexed owner, bytes data);
}
29 changes: 6 additions & 23 deletions ArbOwnerPublic.sol
Original file line number Diff line number Diff line change
Expand Up @@ -12,50 +12,33 @@ interface ArbOwnerPublic {
address addr
) external view returns (bool);

/**
* @notice Rectify the list of chain owners
* If successful, emits ChainOwnerRectified event
* Available in ArbOS version 11
*/
/// @notice Rectify the list of chain owners
/// @notice If successful, emits ChainOwnerRectified event
/// @notice Available in ArbOS version 11 and above
function rectifyChainOwner(
address ownerToRectify
) external;

/// @notice Retrieves the list of chain owners
function getAllChainOwners() external view returns (address[] memory);

/// @notice See if the user is a native token owner
/// Available in ArbOS version 41
function isNativeTokenOwner(
address addr
) external view returns (bool);

/// @notice Retrieves the list of native token owners
/// Available in ArbOS version 41
function getAllNativeTokenOwners() external view returns (address[] memory);

/// @notice Gets the network fee collector
function getNetworkFeeAccount() external view returns (address);

/// @notice Get the infrastructure fee collector
function getInfraFeeAccount() external view returns (address);

/// @notice Get the Brotli compression level used for fast compression
/// @notice Available in ArbOS version 20 and above
function getBrotliCompressionLevel() external view returns (uint64);

/// @notice Get the next scheduled ArbOS version upgrade and its activation timestamp.
/// Returns (0, 0) if no ArbOS upgrade is scheduled.
/// Available in ArbOS version 20.
/// @notice Returns (0, 0) if no ArbOS upgrade is scheduled.
/// @notice Available in ArbOS version 20 and above
function getScheduledUpgrade()
external
view
returns (uint64 arbosVersion, uint64 scheduledForTimestamp);

/**
* @notice Checks if the increased calldata price feature (EIP-7623) is enabled
* Available in ArbOS version 40 with default as false
*/
function isCalldataPriceIncreaseEnabled() external view returns (bool);

event ChainOwnerRectified(address rectifiedOwner);
}
1 change: 1 addition & 0 deletions ArbWasm.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ pragma solidity >=0.4.21 <0.9.0;
/**
* @title Methods for managing user programs
* @notice Precompiled contract that exists in every Arbitrum chain at 0x0000000000000000000000000000000000000071.
* @notice Available in ArbOS version 30 and above
*/
interface ArbWasm {
/// @notice Activate a wasm program
Expand Down
3 changes: 3 additions & 0 deletions ArbWasmCache.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ 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.
Expand All @@ -19,6 +20,7 @@ interface ArbWasmCache {
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;
Expand All @@ -27,6 +29,7 @@ interface ArbWasmCache {
/// @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;
Expand Down
Loading