Add Token
When DINX RPC is enabled, you can add your inscription assets to your asset list .
You can add assets manually by entering the token address in metamask

Also you can programmatically add
await window.ethereum.request({
"method": "wallet_watchAsset",
"params": {
type: "ERC20",
options: {
address: "0x8ada557a6a1cdf21a0794ab3394e0ab745ca2259",
symbol: "ETHI",
decimals: 8,
image: "https://app.ierc20.com/static/images/logos/ethi.png"
}
},
});
You can also try a one-click add at https://explorer.dinx.io
to add
Calculation of virtual contract addresses
All current and future protocol tokens can be calculated using DINX's virtual contract address calculation. The principle of the calculation is as follows
package main
import (
"crypto/sha3"
"encoding/hex"
"fmt"
"strings"
)
// Function to compute keccak256 hash of a string
func keccak256(input string) string {
hasher := sha3.NewLegacyKeccak256()
hasher.Write([]byte(input))
hash := hasher.Sum(nil)
return hex.EncodeToString(hash)
}
// Function to convert a hash to an Ethereum address
func hashToAddress(hash string) string {
// Extract the last 20 bytes (40 hex characters)
last20Bytes := hash[len(hash)-40:]
return "0x" + strings.ToLower(last20Bytes)
}
func main() {
// Define the input string
inputString := "ierc:ethi"
// Compute the keccak256 hash of the input string
hash := keccak256(inputString)
fmt.Println("Keccak256 Hash:", hash)
// Extract the Ethereum address from the hash
address := hashToAddress(hash)
// Output the results
fmt.Println("Ethereum Address (Lowercase):", address)
}
Currently Supported Protocols
IERC20
yes.
Ethereum
BRC20
Not for a while.
BTC,Requires wallet association
Facet
Not for a while.
Ethereum
Bnbs
Not for a while.
Bsc
Sols
Not for a while.
Solana,Requires wallet association
Pols
Not for a while.
Polygon
Avas
Not for a while.
Avalanche
IERC20 Token Contract Mapping (eg.)
ETHI
0x8ada557a6a1cdf21a0794ab3394e0ab745ca2259
ETHPI
0xfca7fdce880d3a328bd03e5c4271b195685c1eaa
Future support for more protocols can be derived from the virtual contract address calculations.
ERC-20 Standard Interface
Core Functions:
totalSupply()
: Returns the total number of tokens in existence.balanceOf(address account)
: Provides the token balance of a specific account.transfer(address recipient, uint256 amount)
: Transfers a specified amount of tokens from the caller's account to a recipient.approve(address spender, uint256 amount)
: Authorizes another account (the spender) to spend a certain amount of tokens on behalf of the caller.allowance(address owner, address spender)
: Returns the remaining number of tokens that the spender is permitted to spend on behalf of the owner.transferFrom(address sender, address recipient, uint256 amount)
: Facilitates the transfer of tokens from one account to another, utilizing the allowance mechanism.
Events:
Transfer(address indexed from, address indexed to, uint256 value)
: Emitted when tokens are transferred, including zero-value transfers.Approval(address indexed owner, address indexed spender, uint256 value)
: Emitted when an account's allowance for a spender is set by a call toapprove
.
⚠️ Currently DINX RPC only supports read type operations, not write operations.
Last updated