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

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

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

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

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

supportsToken

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

Check if this token is supported

Parameters

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

withdrawAll

function withdrawAll(address tokenAddress, address recipient) external

Withdraw entire balance of this token Only callable by AssetManager

Parameters

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