Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
0x000000000000000000000000000000000000DdDD
interface IUniswapV2Pair {
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
}
interface IUniswapV2Router01 {
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
Use this precompile to interact with the nft
runtime pallet to create an ERC-721 collection.
0x00000000000000000000000000000000000006b9
interface TRNNFT is IERC165 {
event InitializeCollection(address indexed collectionOwner, address precompileAddress);
function initializeCollection(address owner, bytes calldata name, uint32 maxIssuance, bytes calldata metadataPath, address[] calldata royaltyAddresses, uint32[] calldata royaltyEntitlements) external returns (address, uint32);
}
The ERC-721 contract address for The Root Network native non-fungible token uses the following format:
0xAAAAAAAA[4-byte-collection-id]000000000000000000000000
To make things easier, the @therootnetwork/evm
provides a handy function to convert token asset ID to its equivalent contract address.
import { collectionIdToERC721Address } from "@therootnetwork/evm";
const COLLECTION_ID = 1;
const COLLECTION_CONTRACT_ADDRESS = collectionIdToERC721Address(COLLECTION_ID);
interface IERC721 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
function balanceOf(address owner) external view returns (uint256 balance);
function ownerOf(uint256 tokenId) external view returns (address owner);
function safeTransferFrom(address from, address to, uint256 tokenId) external;
function transferFrom(address from, address to, uint256 tokenId) external;
function approve(address to, uint256 tokenId) external;
function getApproved(uint256 tokenId) external view returns (address operator);
function setApprovalForAll(address operator, bool _approved) external;
function isApprovedForAll(address owner, address operator) external view returns (bool);
function safeTransferFrom(address from,address to,uint256 tokenId,bytes calldata data) external;
}
interface IERC721Metadata is IERC721 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function tokenURI(uint256 tokenId) external view returns (string memory);
}
interface TRN721 is IERC165 {
event MaxSupplyUpdated(uint32 maxSupply);
event BaseURIUpdated(string baseURI);
function totalSupply() external view returns (uint256);
function mint(address owner, uint32 quantity) external;
function setMaxSupply(uint32 maxSupply) external;
function setBaseURI(bytes calldata baseURI) external;
function ownedTokens(address who, uint16 limit, uint32 cursor) external view returns (uint32, uint32, uint32[] memory);
}
interface Ownable is IERC165 {
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function owner() external view returns (address);
function renounceOwnership() external;
function transferOwnership(address owner) external;
}
The ERC-20 contract address for The Root Network native tokens uses the following format:
0xCCCCCCCC[4-byte-token-id]000000000000000000000000
To make things easier, the @therootnetwork/evm
provides a handy function to convert token asset ID to its equivalent contract address.
import { assetIdToERC20Address } from "@therootnetwork/evm";
const ROOT_ASSET_ID = 1;
const ROOT_CONTRACT_ADDRESS = assetIdToERC20Address(ROOT_ASSET_ID);
interface IERC20 is IERC165 {
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address to, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address from, address to, uint256 amount) external returns (bool);
}
interface IERC20Metadata is IERC20 {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
}
0x00000000000000000000000000000000000004bb
interface FeeProxy {
function callWithFeePreferences(address asset, uint128 maxPayment, address target, bytes input)
}
0x000000000000000000000000000000000000FFFF
interface FuturePassRegistrar {
event FuturepassCreated(address indexed futurepass, address owner);
function futurepassOf(address owner) external view returns (address);
function create(address owner) external returns (address);
}
0xFFFFFFFF[16-byte-futurepass-id]
interface FuturePass {
event FuturepassDelegateRegistered(address indexed futurepass, address indexed delegate, uint8 proxyType);
event FuturepassDelegateUnregistered(address indexed futurepass, address delegate);
event Executed(uint8 indexed callType, address indexed target, uint256 indexed value, bytes4 data);
event ContractCreated(uint8 indexed callType, address indexed contractAddress, uint256 indexed value, bytes32 salt);
function delegateType(address delegate) external view returns (uint8);
function registerDelegate(address delegate, uint8 proxyType) external;
function unregisterDelegate(address delegate) external;
function proxyCall(uint8 callType, address callTo, uint256 value, bytes memory callData) external payable;
}
interface Ownable is IERC165 {
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function owner() external view returns (address);
function renounceOwnership() external;
function transferOwnership(address owner) external;
}
Use this precompile to interact with the sft
runtime pallet to create an ERC-1155 collection.
0x00000000000000000000000000000000000006c3
interface TRNSFT is IERC165 {
event InitializeSftCollection(address indexed collectionOwner, address indexed precompileAddress);
function initializeCollection(address owner, bytes calldata name, bytes calldata metadataPath, address[] calldata royaltyAddresses, uint32[] calldata royaltyEntitlements) external returns (address, uint32);
}
The ERC-1155 contract address for The Root Network native semi-fungible tokens uses the following format:
0xBBBBBBBB[4-byte-collection-id]000000000000000000000000
To make things easier, the @therootnetwork/evm
provides a handy function to convert token asset ID to its equivalent contract address.
import { collectionIdToERC1155Address } from "@therootnetwork/evm";
const COLLECTION_ID = 1;
const COLLECTION_CONTRACT_ADDRESS = collectionIdToERC1155Address(COLLECTION_ID);
interface IERC1155 is IERC165 {
event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);
event TransferBatch(address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values);
event ApprovalForAll(address indexed account, address indexed operator, bool approved);
function balanceOf(address owner, uint256 id) external view returns (uint256);
function balanceOfBatch(address[] calldata owners, uint256[] calldata ids) external view returns (uint256[] memory);
function setApprovalForAll(address operator, bool approved) external;
function isApprovedForAll(address account, address operator) external view returns (bool);
function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes calldata data) external;
function safeBatchTransferFrom(address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data) external;
}
interface IERC1155Burnable is IERC1155 {
function burn(address account, uint256 id, uint256 value) external;
function burnBatch(address account, uint256[] calldata ids, uint256[] calldata values) external;
}
interface IERC1155Supply is IERC1155 {
function totalSupply(uint256 id) external view returns (uint256);
function exists(uint256 id) external view returns (bool);
}
interface IERC1155MetadataURI is IERC1155 {
function uri(uint256 id) external view returns (string memory);
}
interface TRN1155 is IERC165 {
event TokenCreated(uint32 indexed serialNumber);
event MaxSupplyUpdated(uint128 indexed maxSupply);
event BaseURIUpdated(string baseURI);
function createToken(bytes calldata name, uint128 initialIssuance, uint128 maxIssuance, address tokenOwner) external returns (uint32);
function mint(address owner, uint256 id, uint256 amount) external;
function mintBatch(address owner, uint256[] calldata ids, uint256[] calldata amounts) external;
function setMaxSupply(uint256 id, uint32 maxSupply) external;
function setBaseURI(bytes calldata baseURI) external;
}
interface Ownable is IERC165 {
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
function owner() external view returns (address);
function renounceOwnership() external;
function transferOwnership(address owner) external;
}