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

Source Code

Type
Visibility
Name
Description

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

Source Code

constructor(address _adapter_address, address _lp_address, uint256 _pid, address _router_address, address _farm_address)
Type
Name
Description

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()

Source Code

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

function reset_approvals() external

blend()

Source Code

Transfer LP assets to Mojito Staking

function blend(uint256 amount_qlp) external
Type
Name
Description

uint256

amount_qlp

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

spill()

Source Code

Transfer LP assets out from Mojito Staking

function spill(uint256 amount, address to) external
Type
Name
Description

uint256

amount

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

address

to

Address to receive the withdrawn assets

autocompound()

Source Code

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

function autocompound() external nonReentrant

get_autocompounder_holdings()

Source Code

Return adapter balance staked in Mojito Swap

function get_autocompounder_holdings() external view returns (uint256)

get_mojito_chef_holdings()

Source Code

Return adapter balance staked in Mojito Swap

function get_mojito_chef_holdings() external view returns (uint256)

set_mojito_chef()

Source Code

Update Mojito Chef contract address

function set_mojito_chef(address _mojito_chef) external
Type
Name
Description

address

_mojito_chef

New Mojito Chef address

set_autocompound_enabled()

Source Code

Enable or disable auto compounding upon interaction with

function set_autocompound_enabled(bool _enabled) external
Type
Name
Description

bool

_enabled

emergency_withdraw()

Source Code

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

function emergency_withdraw(uint256 _pid, uint256 _amount) external
Type
Name
Description

uint256

_pid

Mojito Staking pool ID to withdraw from

uint256

amount

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

Last updated

Was this helpful?