Skip to content

ArbNativeToken precompile #3186

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 13 commits into
base: master
Choose a base branch
from
Draft

ArbNativeToken precompile #3186

wants to merge 13 commits into from

Conversation

diegoximenes
Copy link
Contributor

@diegoximenes diegoximenes commented Apr 28, 2025

Resolves NIT-3298

  • Adds ArbNativeToken precompile
  • Adds native token owner "CRUD" to ArbOwner

Pulls OffchainLabs/go-ethereum#447 and OffchainLabs/nitro-contracts#335

Other TODOs:

  • Add ArbNativeToken to nitro-testnode's blockscout (doesn't seem a hard requirement right now)

@diegoximenes diegoximenes marked this pull request as ready for review April 29, 2025 18:50
@diegoximenes diegoximenes marked this pull request as draft April 30, 2025 21:16
@diegoximenes diegoximenes changed the title ArbOwner's MintNativeToken and BurnNativeToken ArbNativeToken precompile Apr 30, 2025
if c.State.ArbOSVersion() < params.ArbosVersion_41 {
return fmt.Errorf("minting native token is not supported in ArbOS version %d", c.State.ArbOSVersion())
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to add gas cost (to both)
This is done with c.Burn, see examples in e.g. ArbRetryableTx

@@ -57,6 +61,46 @@ func (con ArbOwner) GetAllChainOwners(c ctx, evm mech) ([]common.Address, error)
return c.State.ChainOwners().AllMembers(65536)
}

// AddChainOwner adds account as a native token owner
func (con ArbOwner) AddNativeTokenOwner(c ctx, evm mech, newOwner addr) error {
if c.State.ArbOSVersion() < params.ArbosVersion_41 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(note: Acces to ArbosState has code that deals with burning Gas as appropriate, so it doesn't need to be done explicitly)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants