Smart Contract ABI
Complete Application Binary Interface documentation for all ReserveBTC smart contracts, including function signatures, events, and integration examples.
Contract Addresses
Oracle Aggregator Contract
0xEcCC1Bf6Ad2e875152eE65DC365F90d07da7aEAc
Verified
rBTC-SYNTH Token Contract
0x5b9375b4ac0f61C7D5af32374aCCe0d058cE6F58
Verified
wrBTC Token Contract
0xa10FC332f12d102Dddf431F8136E4E89279EFF87
Verified
Fee Vault Contract
0x1384d3A60a910B5b402ee09457b3eBfCC964FD4f
Verified
Fee Policy Contract
0xc10fD3a2DF480CFAE8a7aBC2862a9c5724f5f4b4
Verified
Core Functions
Main protocol functions for minting, burning, and managing synthetic Bitcoin tokens.
Events & Logs
Complete event definitions for monitoring and indexing protocol activities.
Oracle Aggregator Contract ABI
Oracle Functions
// Sync user's Bitcoin balance (Oracle only) function sync( address user, uint64 newBalanceSats, uint32 height, uint64 timestamp ) external; // Get user's last synchronized balance function lastSats(address user) external view returns (uint64); // Get oracle committee address function committee() external view returns (address); // Get minimum confirmations required function minConfirmations() external view returns (uint256); // Get maximum fee per sync function maxFeePerSyncWei() external view returns (uint256);
rBTC-SYNTH Token Functions
// ERC20 View Functions function balanceOf(address owner) external view returns (uint256); function totalSupply() external view returns (uint256); function decimals() external view returns (uint8); function name() external view returns (string); function symbol() external view returns (string); // Oracle mint/burn (Oracle only) function oracleMint(address to, uint64 amount) external; function oracleBurn(address from, uint64 amount) external; // Soulbound - transfers are blocked function transfer(address to, uint256 amount) external pure returns (bool); // Always reverts function approve(address spender, uint256 amount) external pure returns (bool); // Always reverts
Fee System Functions
// Fee Policy Contract function pctBps() external view returns (uint256); // Fee percentage in basis points function fixedWei() external view returns (uint256); // Fixed fee in wei function weiPerSat() external view returns (uint256); // Wei per satoshi rate function quoteFees(address user, int64 deltaSats) external view returns (uint256); // Fee Vault Contract function depositETH(address user) external payable; // Deposit ETH for fees function balances(address user) external view returns (uint256); // Get user's fee balance
Events
Oracle Events
// Oracle Aggregator Events event Synced( address indexed user, uint64 newBalanceSats, int64 deltaSats, uint256 feeWei, uint32 height, uint64 timestamp ); event NeedsTopUp( address indexed user );
Token Events
// ERC20 Transfer Events (both rBTC-SYNTH and wrBTC) event Transfer( address indexed from, address indexed to, uint256 value ); // ERC20 Approval Event (wrBTC only, rBTC-SYNTH reverts) event Approval( address indexed owner, address indexed spender, uint256 value ); // Fee Vault Events event Deposit( address indexed user, uint256 amount );
Usage Examples
JavaScript/Web3.js
// Initialize contracts const web3 = new Web3('https://carrot.megaeth.com/rpc'); const synthContract = new web3.eth.Contract( RBTC_SYNTH_ABI, "0x5b9375b4ac0f61C7D5af32374aCCe0d058cE6F58" ); const oracleContract = new web3.eth.Contract( ORACLE_ABI, "0xEcCC1Bf6Ad2e875152eE65DC365F90d07da7aEAc" ); // Query user's rBTC-SYNTH balance const balance = await synthContract.methods.balanceOf(userAddress).call(); console.log('rBTC-SYNTH Balance:', balance); // Listen to Oracle sync events oracleContract.events.Synced() .on('data', (event) => { console.log('Balance synced:', event.returnValues); });
Ethers.js
// Initialize provider and contracts const provider = new ethers.JsonRpcProvider('https://carrot.megaeth.com/rpc'); const synthContract = new ethers.Contract( "0x5b9375b4ac0f61C7D5af32374aCCe0d058cE6F58", RBTC_SYNTH_ABI, provider ); const oracleContract = new ethers.Contract( "0xEcCC1Bf6Ad2e875152eE65DC365F90d07da7aEAc", ORACLE_ABI, provider ); // Query last synchronized Bitcoin balance const lastSats = await oracleContract.lastSats(userAddress); console.log('Last synced Bitcoin balance:', lastSats.toString(), 'satoshis'); // Get rBTC-SYNTH token info const name = await synthContract.name(); const symbol = await synthContract.symbol(); const decimals = await synthContract.decimals(); console.log(`Token: ${name} (${symbol}) - ${decimals} decimals`);
⚠️Important: Oracle-Based Architecture
ReserveBTC uses an Oracle-based system where token minting and burning is controlled by the Oracle, not directly by users.
- Users prove Bitcoin ownership through BIP-322 signatures via the web interface
- The Oracle monitors Bitcoin addresses and automatically syncs balances
- rBTC-SYNTH tokens are automatically minted/burned based on Bitcoin balance changes
- Only the authorized Oracle committee can call mint/burn functions
Download ABI Files
Download the complete ABI files for integration with your applications.