Skip to content

protofire/nibiru-staking-app

Repository files navigation

Nibiru Liquid Staking Safe App

A Safe app for interacting with the Nibiru EVM staking contract on Nibiru. This application allows users to stake NIBI tokens, unstake stNIBI tokens, and redeem unstaked tokens through the Safe multisig interface.

Features

  • Stake: Deposit NIBI to stake and mint stNIBI
  • Unstake: Queue stNIBI to unstake for later redemption
  • Redeem: Redeem unstaked stNIBI for NIBI principal + accrued rewards (converted to WNIBI)

Contract Integration

The app integrates with the Nibiru EVM contract which provides three main functions:

contract NibiruEvm {
  /// @notice Deposit NIBI to stake and mint stNIBI.
  function liquidStake(uint256 amount) external {}

  /// @notice Queue to unstake stNIBI to later redeem it for the principal and
  /// accrued rewards from staking.
  function unstake(uint256 stAmount) external {}

  /// @notice Redeem any stNIBI that has finished unstaking to receive the NIBI
  /// principal and any accrued rewards from staking. NIBI received is
  /// converted to WNIBI.
  function redeem() external {}
}

Getting Started

First, install dependencies:

npm install

Run the development server:

npm run dev

Open http://localhost:3000 with your browser to see the result.

Usage

  1. Connect Safe: The app automatically connects to your Safe wallet
  2. View Balances: See your NIBI and stNIBI balances
  3. Liquid Stake: Click "Liquid Stake" to deposit NIBI and receive stNIBI
  4. Unstake: Click "Unstake" to queue stNIBI for redemption
  5. Redeem: Click "Redeem" when tokens are ready to be redeemed

Development

The project structure:

  • /src/config/nibiruEvm.ts - Contract addresses and configuration
  • /src/utils/nibiruEvm.ts - Contract interaction utilities
  • /src/hooks/useLoadNibiruEvm.ts - React hook for loading contract data
  • /src/components/tx-flow/flows/ - Transaction flow components
  • /src/app/page.tsx - Main application interface

Testing

Run tests:

npm test

Run tests in watch mode:

npm run test:watch

Building

Build the application:

npm run build

About

A user-friendly safe application for staking NIBI tokens on the Nibiru blockchain.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published