Saffron Mojito Auto Compounder

Introduction

This contract interfaces between Mojito Staking and the Saffron Adapter to provide auto compounding behavior and increase earnings

Miscellaneous State Variables

TypeVisibilityNameDescription

IMojitoChef

public

mojito_cheff

Mojito chef address

address

public

lp

LP token to auto compound into

uint256

public

pid

Pool ID in farm's pool array

bool

public

autocompound_enabled

If auto compounding is enabled

ISaffron_Mojito_AdapterV2

public

adapter

Saffron Adapter to interact with underlying platform

Constructor

constructor(address _adapter_address, address _lp_address, uint256 _pid, address _router_address, address _farm_address)
TypeNameDescription

address

_adapter_address

Address of Saffron Adapter

address

_lp_address

Address of LP Asset being staked

address

_router_address

Address of MojitoSwap router for trading assets

address

_farm_address

Address of Mojito Staking contract

reset_approvals()

Reset LP token approvals to max value for use by AutoCompounder contracts

function reset_approvals() external

blend()

Transfer LP assets to Mojito Staking

function blend(uint256 amount_qlp) external
TypeNameDescription

uint256

amount_qlp

Amount (wei) of LP Assets to be staked in Mojito

spill()

Transfer LP assets out from Mojito Staking

function spill(uint256 amount, address to) external
TypeNameDescription

uint256

amount

Amount (wei) of LP Assets to be staked in Mojito

address

to

Address to receive the withdrawn assets

autocompound()

Redeem Mojito Staking rewards, convert to LP tokens, deposit earnings

function autocompound() external nonReentrant

get_autocompounder_holdings()

Return adapter balance staked in Mojito Swap

function get_autocompounder_holdings() external view returns (uint256)

get_mojito_chef_holdings()

Return adapter balance staked in Mojito Swap

function get_mojito_chef_holdings() external view returns (uint256)

set_mojito_chef()

Update Mojito Chef contract address

function set_mojito_chef(address _mojito_chef) external
TypeNameDescription

address

_mojito_chef

New Mojito Chef address

set_autocompound_enabled()

Enable or disable auto compounding upon interaction with

function set_autocompound_enabled(bool _enabled) external
TypeNameDescription

bool

_enabled

emergency_withdraw()

In case of emergency directly transfer LP assets out of Mojito Staking

function emergency_withdraw(uint256 _pid, uint256 _amount) external
TypeNameDescription

uint256

_pid

Mojito Staking pool ID to withdraw from

uint256

amount

Amount (wei) of LP Assets to be withdrawn from Mojito

Last updated