Version 2 Released! Our biggest documentation upgrade to date.

Smart Contract Addresses

This page provides verified contract addresses and practical integration examples for all Tharwa protocol deployments. Each contract is explained with its purpose, key functions, and real-world usage patterns.

Ethereum Mainnet

All core Tharwa contracts are deployed and operational on Ethereum Mainnet:

Contract
Address
Etherscan
Purpose

thUSD

0x76972F054aB43829064d31fF5f3AcC5Fabe57FE8

RWA-backed stablecoin

sthUSD

0xf7Af0A8079F12F19533B0DF69ce7ee6718b0C46f

Yield-bearing staked thUSD

thBonds

0xAc02FF90bC709A134cD4Ad0b50BaB8be9e0f504e

Fixed-term bond vaults

TRWA

0x7b10d50b5885bE4c7985A88408265c109bd1EeC8

Governance token

thUSDSwap

0x7b930eaD88e7DAD023af9eaDb5D2AC817096c2Bc

thUSD/USDC stableswap

thUSD/USDC LP

0xF88dE5987a4a114Fab1Fe98E681f83216F4b6E76

Liquidity pool token

Network Details

  • Chain ID: 1

  • RPC: https://mainnet.infura.io/v3/YOUR_KEY

  • Block Explorer: Etherscan


Sepolia Testnet

Development and testing environment for Tharwa protocol:

Contract
Address
Etherscan
Purpose

thUSD

0xBDa089250C2bd31db65C99a99D4862d6BAC4446A

Testnet stablecoin

sthUSD

0xBDa089250C2bd31db65C99a99D4862d6BAC4446A

Testnet staked thUSD

thBonds

0x716430d4321d05a82bdF8e59AFA96026f0c7ca06

Testnet bonds

thUSDSwap

0xdc2cf4bec47e2192a04d88986b3f781f6721b7fe

Testnet stableswap

MockDAI

0x5574a42Bed488430Fe9F2B901dfB2B98AC2Cf939

Test token

Network Details


Contract Verification

All contracts are verified on Etherscan with:

  • Source code published

  • Constructor arguments verified

  • Proxy implementation verified (where applicable)

  • ABI available for integration

Verification Status

Contract
Mainnet
Sepolia
Compiler

thUSD

✅ Verified

✅ Verified

Solidity 0.8.24

sthUSD

✅ Verified

✅ Verified

Solidity 0.8.24

thBonds

✅ Verified

✅ Verified

Solidity 0.8.24

TRWA

✅ Verified

✅ Verified

Solidity 0.8.24

thUSDSwap

✅ Verified

✅ Verified

Solidity 0.8.24


Integration Examples: Real-World Usage

Basic Integration: Checking User Balances

Most integrations start with reading user balances across Tharwa's ecosystem:

const Web3 = require('web3');
const web3 = new Web3('https://mainnet.infura.io/v3/YOUR_KEY');

// Contract instances
const thUSD = new web3.eth.Contract(thUSDABI, '0x76972F054aB43829064d31fF5f3AcC5Fabe57FE8');
const sthUSD = new web3.eth.Contract(sthUSDABI, '0xf7Af0A8079F12F19533B0DF69ce7ee6718b0C46f');

// Get user's complete Tharwa position
async function getUserPosition(userAddress) {
    const [thUSDBalance, sthUSDShares, sthUSDValue] = await Promise.all([
        thUSD.methods.balanceOf(userAddress).call(),
        sthUSD.methods.balanceOf(userAddress).call(),
        sthUSD.methods.convertToAssets(await sthUSD.methods.balanceOf(userAddress).call()).call()
    ]);
    
    return {
        thUSD: thUSDBalance,
        sthUSDShares: sthUSDShares,
        sthUSDValue: sthUSDValue,
        totalValue: BigInt(thUSDBalance) + BigInt(sthUSDValue)
    };
}

Advanced Integration: Complete Tharwa Interaction

Here's how to build a complete integration that handles the full Tharwa ecosystem:

// Complete staking flow with error handling
async function stakeThUSD(amount, userAddress, signer) {
    try {
        // 1. Check user's thUSD balance
        const balance = await thUSD.balanceOf(userAddress);
        if (balance.lt(amount)) throw new Error('Insufficient thUSD balance');
        
        // 2. Check allowance
        const allowance = await thUSD.allowance(userAddress, sthUSD.address);
        if (allowance.lt(amount)) {
            // Approve sthUSD to spend thUSD
            const approveTx = await thUSD.connect(signer).approve(sthUSD.address, amount);
            await approveTx.wait();
        }
        
        // 3. Preview the deposit to show user expected shares
        const expectedShares = await sthUSD.previewDeposit(amount);
        console.log(`You will receive ${ethers.utils.formatEther(expectedShares)} sthUSD shares`);
        
        // 4. Execute the stake
        const stakeTx = await sthUSD.connect(signer).deposit(amount, userAddress);
        const receipt = await stakeTx.wait();
        
        // 5. Confirm success
        const newBalance = await sthUSD.balanceOf(userAddress);
        console.log(`Staking successful! New sthUSD balance: ${ethers.utils.formatEther(newBalance)}`);
        
        return receipt;
    } catch (error) {
        console.error('Staking failed:', error.message);
        throw error;
    }
}

Future Deployments

Planned Networks

  • Arbitrum: TBA

  • Polygon: TBA

  • Base: TBA

  • Optimism: TBA

All future deployments will use LayerZero's OFT standard for seamless cross-chain functionality.


Developer Resources

Last updated