Saffron Insurance Fund

Introduction

Saffron Insurance Fund

Miscellaneous State Variables

Source Code

Type
Visibility
Name
Description

address

public

treasury

Saffron treasury to collect fees

address

public

insurance_asset

Asset to insure the pool's senior tranche with

address

public

pool_base_asset

Base asset to accumulate from pool

SaffronPoolV2

public

pool

SaffronPoolV2 this contract insures

SaffronPositionNFT

public

NFT

Saffron Position NFT

uint256

public

TRANCHE

Tranche indicated in NFT storage value

uint256

public

total_supply_lp

Total balance of all user LP tokens

uint256

private

_update_status

Internal state for reentrancy guard

Constructor

Source Code

constructor(address _insurance_asset, address _pool_base_asset)
Type
Name
Description

address

_lp_address

Address of LP asset to be managed

string

_name

deposit()

Source Code

Deposit insurance_assets into the insurance fund

function deposit(uint256 principal) external nonReentrant
Type
Name
Description

uint256

principal

Amount (wei) of Insurance Assets to be deposited

withdraw()

Source Code

Withdraw users principal and earnings by redeeming their Saffron Position NFT

function withdraw(uint256 token_id) external nonReentrant
Type
Name
Description

uint256

token_id

Position NFT ID to be withdrawn

emergency_withdraw()

Source Code

Emergency withdraw with as few interactions / state changes as possible / BUT still have to wait for expiration

function emergency_withdraw(uint256 token_id) external
Type
Name
Description

uint256

token_id

Position NFT ID to be withdrawn

update()

Source Code

Update state and accumulated assets_per_share

function update() public non_reentrant_update

total_principal()

Source Code

Get total amount of Insurance Assets held by pool

function total_principal() external view returns(uint256)

set_pool()

Source Code

Set a new Saffron Pool address

function set_pool(address _pool) external
Type
Name
Description

address

_pool

Address of new pool

set_treasury()

Source Code

Set a new Saffron Treasury address

function set_treasury(address _treasury) external
Type
Name
Description

address

_treasury

Address of new treasury

pending_earnings()

Source Code

Get pending earnings for a given Saffron Position NFT

function pending_earnings(uint256 token_id) external view returns(uint256)
Type
Name
Description

uint256

token_id

Position NFT ID to be checked

Last updated

Was this helpful?