Saffron Mojito Adapter v2

Introduction

This contract interfaces with Mojito Swap and provides a common SaffronAdapter interface expected for use by Saffron Pool contracts.

Miscellaneous State Variables

TypeVisibilityNameDescription

address

public

governance

Governance address

address

public

new_governance

Pending governance address if accepted

address

public

saffron_pool

Saffron Pool which owns this adapter

IERC20

public

MLP

MLP address (Uni-V2 LP token)

SaffronMojitoAutocompounder

public

autocompounder

Auto-Compounder for this adapter/platform

string

public

platform

Platform name

string

public

name

Adapter name

Constructor

  constructor(address _lp_address, string memory _name)
TypeNameDescription

address

_lp_address

Address of LP asset to be managed

string

_name

deploy_capital()

Add funds to underlying protocol. Called from pool's deposit function

function deploy_capital(uint256 lp_amount) external override nonReentrant
TypeNameDescription

uint256

lp_amount

Amount (wei) of LP Assets to be deployed to underlying platform

return_capital()

Return funds to user. Called from pool's withdraw function

function return_capital(uint256 lp_amount, address to) external override nonReentrant
TypeNameDescription

uint256

lp_amount

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

address

to

Address to receive withdrawn funds

get_holdings()

Return balance of Auto Compounder holdings

function get_holdings() external override nonReentrant returns(uint256 holdings)

get_holdings_view()

Return balance of Auto Compounder holdings (read-only/view)

function get_holdings_view() external override view returns(uint256 holdings)

set_autocompounder()

Set a new Saffron autocompounder address

function set_autocompounder(address _autocompounder) external
TypeNameDescription

address

_autocompounder

Address of new Saffron Auto Compounder contract

set_pool()

Set a new Saffron Pool address

function set_pool(address pool) external override
TypeNameDescription

address

pool

Address of new Saffron Pool contract

set_lp()

Set new LP token address

function set_lp(address addr) external override
TypeNameDescription

address

addr

Address of new LP token

propose_governance()

Propose transfer of governance to new address

function propose_governance(address to) external override
TypeNameDescription

address

to

Address of proposed new governance

accept_governance()

Accept the role of governance (must be called by previously proposed candidate)

function accept_governance() external override

sweep_erc()

Transfer LP assets to Mojito Staking

function sweep_erc(address _token, address _to) external
TypeNameDescription

address

amount_qlp

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

address

to

Address to receive swept assets

Last updated