PureTokenAdapter

assetManager

address assetManager

The address of the AssetManager

floorMap

mapping(address => uint256) floorMap

Mapping of token address to floor balance

ceilingMap

mapping(address => uint256) ceilingMap

Mapping of token address to ceiling balance

__PureTokenAdapter_init

function __PureTokenAdapter_init(address _assetManager) public

TokenNotSupported

error TokenNotSupported()

SenderNotAssetManager

error SenderNotAssetManager()

checkTokenSupported

modifier checkTokenSupported(address tokenAddress)

Check supplied token address is supported

onlyAssetManager

modifier onlyAssetManager()

Check sender is the asset manager

setAssetManager

function setAssetManager(address _assetManager) external

Set the asset manager contract

Parameters

Name
Type
Description

_assetManager

address

The AssetManager

setFloor

function setFloor(address tokenAddress, uint256 floor) external

Set the floor balance for this token. When assets are deposited into adapters the floors are filled first

Parameters

Name
Type
Description

tokenAddress

address

The Token address

floor

uint256

Floor balance

setCeiling

function setCeiling(address tokenAddress, uint256 ceiling) external

Set the ceiling balance for this token. The ceiling is the max balance we want to be managed by this adapter

Parameters

Name
Type
Description

tokenAddress

address

The Token address

ceiling

uint256

Ceiling balance

getRate

function getRate(address) external pure returns (uint256)

Get the underlying market rate The PureAdapter doesn't have an underlying market so we return 0

getSupply

function getSupply(address tokenAddress) external view returns (uint256)

Get total supply of this Contracts

Parameters

Name
Type
Description

tokenAddress

address

The token to check supply for

getSupplyView

function getSupplyView(address tokenAddress) external view returns (uint256)

Get total supply of this Contracts including any balance that has been deposited into the underlying market. As the PureAdapter doesn't have an underlying market this is the same as getSupply

Parameters

Name
Type
Description

tokenAddress

address

The token to check supply for

supportsToken

function supportsToken(address tokenAddress) external view returns (bool)

Check if this token is supported

Parameters

Name
Type
Description

tokenAddress

address

The token to check

deposit

function deposit(address tokenAddress) external

Deposits the given amount of tokens in the underlying money market.

withdraw

function withdraw(address tokenAddress, address recipient, uint256 tokenAmount) external

Withdraw tokens from this adapter Only callable by the AssetManager

Parameters

Name
Type
Description

tokenAddress

address

Token to withdraw

recipient

address

Recieved by

tokenAmount

uint256

Amount of tokens to withdraw

withdrawAll

function withdrawAll(address tokenAddress, address recipient) external

Withdraw entire balance of this token Only callable by AssetManager

Parameters

Name
Type
Description

tokenAddress

address

Token to withdraw

recipient

address

Recieved by

claimRewards

function claimRewards(address tokenAddress, address recipient) external

_supportsToken

function _supportsToken(address tokenAddress) internal view returns (bool)

_getSupply

function _getSupply(address tokenAddress) internal view returns (uint256)

Last updated