Skip to content

A lightweight example project demonstrating how to integrate with the R2 Protocol smart contracts, including provider setup, ABI usage, and common contract method calls.

Notifications You must be signed in to change notification settings

R2Yield/r2protocol-integration-example

Repository files navigation

r2protocol-integration-example

A lightweight example project demonstrating how to integrate with the R2 Protocol smart contracts, including provider setup, ABI usage, and common contract method calls.

R2 Yield Testing Guide

📦 Prerequisites

  • Node.js 18+
  • pnpm / yarn / npm
  • RPC endpoint (e.g., Infura / Alchemy / local node)
  • Your private key without the 0x prefix

🔧 Environment Setup

Create .env:

RPC_URL=https://your_rpc_here
PRIVATE_KEY=xxxxxxxxxxxxxxxxxxxxxxxx

🚀 Commands

1. Deposit

Send underlying tokens (USDC) and mint sR2USD/sR2USD+:

npm run deposit

2. Redeem

Burn sR2USD/sR2USD+ and receive underlying tokens (USDC):

npm run redeem

📝 Notes

  • Ensure your wallet has enough gas.
  • All amounts should follow the token’s decimals.

About

A lightweight example project demonstrating how to integrate with the R2 Protocol smart contracts, including provider setup, ABI usage, and common contract method calls.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published