Quickstart

Get up and running with RealSafe in minutes. This guide covers basic setup, deployment, and usage for both V2 and V3 lockers.

Prerequisites

Required Tools

# Install Foundry
curl -L https://foundry.paradigm.xyz | bash
foundryup

# Verify installation
forge --version
cast --version

Environment Setup

Create a .env file in the contracts/ directory:

# Private key (without 0x prefix)
PRIVATE_KEY=your_private_key_here

# RPC URLs
MONAD_TESTNET_RPC=https://testnet-rpc.monad.xyz

# Block explorers (optional)
MONAD_EXPLORER_API_KEY=your_api_key

Installation

Deployment

Deploy on Monad Testnet

Usage Examples

Example 1: Lock a V3 Position

Step 1: Create a Pool and Position

Step 2: Lock the Position

Run the script:

Example 2: Lock V2 LP Tokens

Example 3: Claim Fees from Locked V3 Position

Note: This only applies to V3 positions. V2 LP tokens don't have a separate fee claiming function because trading fees automatically accrue to the LP token's value. You receive all accrued fees when you unlock your V2 LP tokens.

Using Cast (Command Line)

Get Your Lock IDs

Check Lock Details

Check if You Can Unlock

Unlock Your Position

Testing

Run All Tests

Test V3 Locker

Test V2 Locker

Verification

Verify on Monad Explorer

Common Issues & Solutions

Issue: "Insufficient Creation Fee"

Solution: Check the current creation fee:

Send the correct amount with --value flag.

Issue: "NFT Transfer Failed"

Solution: Approve the NFT first:

Issue: "Lock Not Unlocked"

Solution: Check the unlock time:

Next Steps

Support

Last updated