Skip to main content

StakeableTokenWrapper

A wrapper for an ERC-20 that can be staked and withdrawn.

In this contract, staked tokens don't do anything- instead other contracts can inherit from this one to add functionality. / c

Functions#

constructor#

function constructor(
contract IERC20 _stakedToken
) public

Creates a new StakeableTokenWrapper with given _stakedToken address

Parameters:#

NameTypeDescription
_stakedTokencontract IERC20address of a token that will be used to stake

/

balanceOf#

function balanceOf(
address account
) external returns (uint256)

Read how much account has staked in this contract

Parameters:#

NameTypeDescription
accountaddressaddress of an account

Return Values:#

NameTypeDescription
amountaddressof total staked ERC20(this.stakedToken) by account

/

stake#

function stake(
uint256 amount
) external

Stakes given amount in this contract

Parameters:#

NameTypeDescription
amountuint256amount of ERC20(this.stakedToken) to stake

/

withdraw#

function withdraw(
uint256 amount
) external

Withdraws given amount from this contract

Parameters:#

NameTypeDescription
amountuint256amount of ERC20(this.stakedToken) to withdraw

/

Events#

Staked#

event Staked(
)

Withdrawn#

event Withdrawn(
)