Skip to content

ArbNativeToken precompile #335

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
27 changes: 27 additions & 0 deletions src/precompiles/ArbNativeToken.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2021-2025, 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;

/**
* @title Enables minting and burning native tokens.
* @notice Authorized callers are added/removed through ArbOwner precompile.
*/
interface ArbNativeToken {
/**
* @notice In case the caller is authorized,
* mints some amount of the native gas token for this chain to the caller.
*/
function mintNativeToken(
uint256 amount
) external;

/**
* @notice In case the caller is authorized,
* burns some amount of the native gas token for this chain from the caller.
*/
function burnNativeToken(
uint256 amount
) external;
}
18 changes: 18 additions & 0 deletions src/precompiles/ArbOwner.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,24 @@ interface ArbOwner {
/// @notice Retrieves the list of chain owners
function getAllChainOwners() external view returns (address[] memory);

/// @notice Add account as a native token owner
function addNativeTokenOwner(
address newOwner
) external;

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

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

/// @notice Retrieves the list of native token owners
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
Loading