Skip to content

[docs] Document ERC-2470 and predictable EVM contract deployments on Nibiru #2698

Description

@Unique-Divine

Context

Nibiru#2697 adds the canonical ERC-2470 Singleton Factory to Nibiru's default EVM genesis. We should document how developers can use ERC-2470 and CREATE2 for predictable EVM contract addresses on Nibiru.

Scope

  • Explain the CREATE2 address formula and the inputs that must match:
    • factory/deployer address
    • salt
    • complete creation bytecode (initCode), including constructor arguments
  • Document the canonical ERC-2470 factory address and its deploy(bytes,bytes32) interface.
  • Show how to predict an address before deployment and verify it through EVM JSON-RPC.
  • Explain that Nibiru includes the factory in default EVM genesis for new chains and that the same pattern is conventional across many EVM networks.
  • Include practical examples for Foundry/cast or equivalent tooling.
  • Call out important caveats:
    • constructor msg.sender is the factory
    • constructor arguments affect the address
    • initialization should be atomic where possible
    • salts are namespaces, not secrets
    • CREATE2 does not itself guarantee identical runtime behavior if init code is chain-dependent
  • Link to PR feat(evm): Add ERC-2470 Singleton Factory to Default EVM Genesis #2697 and the official ERC-2470 specification.

Acceptance Criteria

  • Nibiru developer documentation has a dedicated ERC-2470/CREATE2 section.
  • A reader can calculate a predicted address, deploy through the factory, and verify the result using documented commands.
  • The docs distinguish deterministic address calculation from proxy upgradeability and from Wasm instantiate2.
  • Examples work against Nibiru localnet and identify the mainnet/testnet RPC endpoints or endpoint configuration pattern.

Metadata

Metadata

Assignees

Labels

prio-p2-normalPriority: Normalx: evmRelates to Nibiru EVM or the EVM Module

Type

No type

Projects

Status
⚡ Building 🧱

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions