Loading...
Loading...
Compare original and translation side by side
defineChainfees.estimateFeesPerGas()createPublicClientcreateWalletClientwatchContractEventgetLogswatchBlockNumber@radiustechsystems/sdkdefineChaincreateConfiginjected()useAccountuseConnectuseSendTransactionuseWaitForTransactionReceiptforge createforge scriptcast callcast send| Setting | Testnet | Mainnet |
|---|---|---|
| Chain ID | | |
| RPC | | |
| Native currency | RUSD (18 decimals) | RUSD (18 decimals) |
| SBC token (ERC-20) | — | |
| Explorer | | |
| Faucet | | Not available |
| Transaction cost API | | |
9.85998816e-10eth_gasPriceeth_maxPriorityFeePerGas0x0defineChainfees.estimateFeesPerGas()createPublicClientcreateWalletClientwatchContractEventgetLogswatchBlockNumber@radiustechsystems/sdkdefineChaincreateConfiginjected()useAccountuseConnectuseSendTransactionuseWaitForTransactionReceiptforge createforge scriptcast callcast send| 配置项 | 测试网 | 主网 |
|---|---|---|
| 链ID | | |
| RPC地址 | | |
| 原生代币 | RUSD(18位小数) | RUSD(18位小数) |
| SBC代币(ERC-20) | — | |
| 区块浏览器 | | |
| 水龙头 | | 无 |
| 交易成本API | | |
9.85998816e-10eth_gasPriceeth_maxPriorityFeePerGas0x0fees.estimateFeesPerGas()import { defineChain } from 'viem';
export const radiusTestnet = defineChain({
id: 72344,
name: 'Radius Testnet',
nativeCurrency: { decimals: 18, name: 'RUSD', symbol: 'RUSD' },
rpcUrls: { default: { http: ['https://rpc.testnet.radiustech.xyz'] } },
blockExplorers: {
default: { name: 'Radius Explorer', url: 'https://testnet.radiustech.xyz' },
},
fees: {
async estimateFeesPerGas() {
const res = await fetch(
'https://testnet.radiustech.xyz/api/v1/network/transaction-cost'
);
const { gas_price_wei } = await res.json();
return { gasPrice: BigInt(gas_price_wei) };
},
},
});
export const radiusMainnet = defineChain({
id: 723,
name: 'Radius Network',
nativeCurrency: { decimals: 18, name: 'RUSD', symbol: 'RUSD' },
rpcUrls: { default: { http: ['https://rpc.radiustech.xyz'] } },
blockExplorers: {
default: { name: 'Radius Explorer', url: 'https://network.radiustech.xyz' },
},
fees: {
async estimateFeesPerGas() {
const res = await fetch(
'https://network.radiustech.xyz/api/v1/network/transaction-cost'
);
const { gas_price_wei } = await res.json();
return { gasPrice: BigInt(gas_price_wei) };
},
},
});fees.estimateFeesPerGas()import { defineChain } from 'viem';
export const radiusTestnet = defineChain({
id: 72344,
name: 'Radius Testnet',
nativeCurrency: { decimals: 18, name: 'RUSD', symbol: 'RUSD' },
rpcUrls: { default: { http: ['https://rpc.testnet.radiustech.xyz'] } },
blockExplorers: {
default: { name: 'Radius Explorer', url: 'https://testnet.radiustech.xyz' },
},
fees: {
async estimateFeesPerGas() {
const res = await fetch(
'https://testnet.radiustech.xyz/api/v1/network/transaction-cost'
);
const { gas_price_wei } = await res.json();
return { gasPrice: BigInt(gas_price_wei) };
},
},
});
export const radiusMainnet = defineChain({
id: 723,
name: 'Radius Network',
nativeCurrency: { decimals: 18, name: 'RUSD', symbol: 'RUSD' },
rpcUrls: { default: { http: ['https://rpc.radiustech.xyz'] } },
blockExplorers: {
default: { name: 'Radius Explorer', url: 'https://network.radiustech.xyz' },
},
fees: {
async estimateFeesPerGas() {
const res = await fetch(
'https://network.radiustech.xyz/api/v1/network/transaction-cost'
);
const { gas_price_wei } = await res.json();
return { gasPrice: BigInt(gas_price_wei) };
},
},
});| Feature | Ethereum | Radius |
|---|---|---|
| Fee model | Market-based ETH gas bids | Fixed ~0.0001 USD via Turnstile |
| Settlement | ~12 minutes (12+ confirmations) | Sub-second (~500ms finality) |
| Failed txs | Charge gas even if reverted | Charge only on success |
| Required token | Must hold ETH for gas | Stablecoins only (USD) |
| Reorgs | Possible | Impossible |
| Market rate | Fixed gas price (~986M wei) |
| Suggested priority fee | Always |
| Native ETH balance | Native + convertible USD balance |
| Monotonic block height | Current timestamp in milliseconds |
| Block hash | Hash of block header | Equals block number (timestamp-based) |
| Position in block | Can be |
| SBC decimals | — | 6 decimals (NOT 18) |
// DON'T — native balance behaves differently on Radius
require(address(this).balance > 0);
// DO — use ERC-20 balance instead
require(IERC20(feeToken).balanceOf(address(this)) > 0);import { parseUnits, formatUnits } from 'viem';
// CORRECT
const amount = parseUnits('1.0', 6); // 1_000_000n
const display = formatUnits(balance, 6); // "1.0"
// WRONG — this is the most common mistake
const wrong = parseUnits('1.0', 18); // 1_000_000_000_000_000_000n (1e12x too large!)| 特性 | 以太坊 | Radius |
|---|---|---|
| 手续费模型 | 基于市场的ETH Gas竞价 | 通过Turnstile收取固定约0.0001美元 |
| 结算时间 | ~12分钟(12+次确认) | 亚秒级(约500ms最终确定性) |
| 失败交易 | 即使回滚也收取Gas费 | 仅成功交易收取费用 |
| 必需代币 | 必须持有ETH用于Gas费 | 仅需稳定币(USD) |
| 链重组 | 可能发生 | 不可能发生 |
| 市场价格 | 固定Gas价格(约986M wei) |
| 建议优先级费用 | 始终返回 |
| 原生ETH余额 | 原生代币+可转换USD余额 |
| 单调递增的区块高度 | 当前时间戳(毫秒级) |
| 区块哈希 | 区块头的哈希值 | 等于区块编号(基于时间戳) |
| 交易在区块中的位置 | 同一毫秒内的多笔交易可能均为 |
| SBC小数位 | — | 6位小数(非18位) |
// 错误示例——Radius上的原生代币余额表现不同
require(address(this).balance > 0);
// 正确示例——改用ERC-20余额
require(IERC20(feeToken).balanceOf(address(this)) > 0);import { parseUnits, formatUnits } from 'viem';
// 正确写法
const amount = parseUnits('1.0', 6); // 1_000_000n
const display = formatUnits(balance, 6); // "1.0"
// 错误写法——这是最常见的错误
const wrong = parseUnits('1.0', 18); // 1_000_000_000_000_000_000n(比实际大1e12倍!)defineChaincreatePublicClientcreateWalletClientdefineChainforgecastdefineChaincreatePublicClientcreateWalletClientdefineChainforgecastdefineChainfees.estimateFeesPerGas()createPublicClientcreateWalletClientparseUnits(amount, 6)parseEtherparseEtherdefineChainfees.estimateFeesPerGas()createPublicClientcreateWalletClientparseUnits(amount, 6)parseEtherparseEther{ name: "SBC", version: "1" }{ name: "SBC", version: "1" }forge testhttps://testnet.radiustech.xyz/testnet/faucetcast code <address> --rpc-url https://rpc.testnet.radiustech.xyzforge testhttps://testnet.radiustech.xyz/testnet/faucetcast code <address> --rpc-url https://rpc.testnet.radiustech.xyz