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.
- 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)
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 {}
}
First, install dependencies:
npm install
Run the development server:
npm run dev
Open http://localhost:3000 with your browser to see the result.
- Connect Safe: The app automatically connects to your Safe wallet
- View Balances: See your NIBI and stNIBI balances
- Liquid Stake: Click "Liquid Stake" to deposit NIBI and receive stNIBI
- Unstake: Click "Unstake" to queue stNIBI for redemption
- Redeem: Click "Redeem" when tokens are ready to be redeemed
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
Run tests:
npm test
Run tests in watch mode:
npm run test:watch
Build the application:
npm run build