Reference
Smart Contracts
All contracts open-source, verified on Basescan. Solidity 0.8.26.
Contract Addresses
Deployed on Base Sepolia testnet. Mainnet after audit.
| Contract | Address | Purpose |
|---|---|---|
| RAIL20Vault | 0x... | Main vault, commitment tree |
| Verifier | 0x... | PLONK verifier |
| FeeRouter | 0x... | Revenue distribution |
| UsernameRegistry | 0x... | .rail20 names |
| RAIL20Token | 0x... | $RAIL20 (Clanker) |
RAIL20Vault
solidity
// Deposit B20 into privacy pool
function shield(address token, uint256 amount, uint256 commitment) external;
// Private transfer via ZK proof
function privateTransfer(
address token,
uint256[24] calldata proof,
uint256[6] calldata pubSignals
) external;
// Withdraw to public address
function unshield(
address token,
uint256[24] calldata proof,
uint256[6] calldata pubSignals,
address to, uint256 amount
) external;Verifier
solidity
function verifyProof(
uint256[24] calldata _proof,
uint256[6] calldata _pubSignals
) external view returns (bool);FeeRouter
solidity
// 50% treasury, 30% broadcasters, 20% buyback & burn
function distribute(address token, uint256 amount) external;UsernameRegistry
solidity
function register(string calldata name, bytes32 shieldedAddress) external payable;
function resolve(string calldata name) external view returns (bool, bytes32);Integration Guide
typescript
import { createPublicClient, http } from "viem";
import { baseSepolia } from "viem/chains";
const client = createPublicClient({ chain: baseSepolia, transport: http() });
const [found, addr] = await client.readContract({
address: USERNAME_REGISTRY,
abi: registryAbi,
functionName: "resolve",
args: ["alice"],
});Was this page helpful?