Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
The Root Network uses a dual token system - governance token ROOT and a fee token XRP. The native currency used by Ethereum RPCs on The Root Network for balances, paying gas fees, and value transfers is XRP.
XRP is a 6dp token, while Ethereum tooling like MetaMask and Solidity expect native token amounts in wei or 18dp units. To keep compatibility simple, The Root Network protocol takes care of scaling inputs down by 1e-12
and scaling up outputs by 1e12
. Any fractional amounts < 1e12
/ 0.000001 XRP
are always rounded up only by adding 1e12
.
ROOT token is available as an ERC-20 token at 0xcCcCCccC00000001000000000000000000000000
. ROOT is also a 6dp token but requires no special handling as per the ERC20 standard.
Tip: The @therootnetwork/evm
package exports a handy method assetIdToERC20Address
that converts the native asset id to EVM contract address. In ROOT case, it's effectively assetIdToERC20Address(1)
with ROOT asset id is 1
.
Transfers 1 XRP
to receiver
Transfers 1.00001 XRP
to receiver
(i.e. rounds up by 0.00001 XRP
)
Similarly, the following will transfer 0.00001 XRP
to receiver
or transfer 1.2 XRP
to receiver
Recap:
XRP is the default "native" currency
Input and output amounts for XRP on EVM are expressed in wei
(18dp) as normal
Amounts transferred < 1e12
are always rounded up
The Root Network supports EIP-1559 and legacy transaction fee models. Ethereum tooling is able to query fee estimation info accurately out of the box without any special handling required. The eth_feeHistory
RPC is provided for this purpose. See eth_feeHistory - Ethereum documentation for more details.
Fees are charged for deploying and executing smart contracts on The Root Network.
Executing a smart contract on The Root Network costs a minimal transaction fee, typically a few XRPs.
Deploying a smart contract is slightly more expensive than executing it. This is because each contract deployed to the EVM will be stored on the chain forever. It requires storage space.
EVM contract developers on The Root Network can use existing Ethereum wallets and addresses without any changes. The network supports ECDSA addresses by default.
The Root Network supports Solidity version v8.20.0 (Shanghai)
and below, with future support for newer version is underway.
A utility package that simplifies EVM development on The Root Network.
Import and initialize the functionalities you need:
function assetIdToERC20Address(assetId: string | number)
Converts native asset ID to ERC-20 contract address
function collectionIdToERC721Address(collectionId: string | number)
Converts native NFT collection ID to ERC-721 contract address
function getPublicProviderUrl(network: NetworkName): HttpProviderUrl
Returns the Public RPC URls for the corresponding network
Info: The precompile addresses are identical across all networks, including Mainnet, Devnet, and Porcini.
Note: All exported ABIs are in human-readable format.
Constant | Description | Address |
---|---|---|
Constant | Description |
---|---|
NFT_PRECOMPILE_ADDRESS: string
Precompile address for nft
pallet
0x00000000000000000000000000000000000006b9
SFT_PRECOMPILE_ADDRESS: string
Precompile address for sft
pallet
0x00000000000000000000000000000000000006c3
FUTUREPASS_REGISTRAR_PRECOMPILE_ADDRESS: string
Precompile address for futurepass
pallet
0x000000000000000000000000000000000000FFFF
PEG_PRECOMPILE_ADDRESS: string
Precompile address for erc20Peg
and nftPeg
pallets
0x0000000000000000000000000000000000000793
DEX_PRECOMPILE_ADDRESS: string
Precompile address for dex
pallet
0x000000000000000000000000000000000000DdDD
FEE_PROXY_PRECOMPILE_ADDRESS
Precompile address for feeProxy
pallet
0x00000000000000000000000000000000000004BB
ERC20_ABI: string[]
ABI for the ERC-20 standard
ERC721_ABI: string[]
ABI for the ERC-721 standard
ERC1155_ABI: string[]
ABI for the ERC-1155 standard
NFT_PRECOMPILE_ABI: string[]
ABI for the nft
pallet
SFT_PRECOMPILE_ABI: string[]
ABI for the sft
pallet
FEE_PROXY_PRECOMPILE_ABI: string[]
ABI for feeProxy
pallet
FUTUREPASS_PRECOMPILE_ABI: string[]
ABI for futurepass
account
FUTUREPASS_REGISTRAR_PRECOMPILE_ABI: string[]
ABI for futurepass
pallet
DEX_PRECOMPILE_ABI: string[]
ABI for the dex
pallet
Use this precompile to interact with the nft
runtime pallet to create an ERC-721 collection.
The ERC-721 contract address for The Root Network native non-fungible token uses the following format:
To make things easier, the @therootnetwork/evm
provides a handy function to convert token asset ID to its equivalent contract address.
Use this precompile to interact with the sft
runtime pallet to create an ERC-1155 collection.
The ERC-1155 contract address for The Root Network native semi-fungible tokens uses the following format:
To make things easier, the @therootnetwork/evm
provides a handy function to convert token asset ID to its equivalent contract address.