Skip to content

BGTStaker

0x44F07Ce5AfeCbCC406e6beFD40cc2998eEb8c7C6

A contract for staking BGT tokens without transferring them. BGT delegators stake in this contract and receive dApp fees.

Functions

notifyRewardAmount

Notify the staker of a new reward amount.

Can only be called by the fee collector.

solidity
function notifyRewardAmount(uint256 reward) external;

Parameters

NameTypeDescription
rewarduint256The amount of reward to notify.

recoverERC20

Recover ERC20 tokens.

Revert if the tokenAddress is the reward token.

Can only be called by the owner.

solidity
function recoverERC20(address tokenAddress, uint256 tokenAmount) external;

Parameters

NameTypeDescription
tokenAddressaddressThe address of the token to recover.
tokenAmountuint256The amount of token to recover.

setRewardsDuration

Set the rewards duration.

Revert if the reward cycle has started.

Can only be called by the owner.

solidity
function setRewardsDuration(uint256 _rewardsDuration) external;

Parameters

NameTypeDescription
_rewardsDurationuint256The rewards duration.

stake

Stake BGT tokens.

Can only be called by the BGT contract.

solidity
function stake(address account, uint256 amount) external;

Parameters

NameTypeDescription
accountaddressThe account to stake for.
amountuint256The amount of BGT to stake.

withdraw

Withdraw BGT tokens.

Can only be called by the BGT contract.

solidity
function withdraw(address account, uint256 amount) external;

Parameters

NameTypeDescription
accountaddressThe account to withdraw for.
amountuint256The amount of BGT to withdraw.

getReward

Get the reward.

Get the reward for the caller.

solidity
function getReward() external returns (uint256);

Returns

NameTypeDescription
<none>uint256The reward amount.

Events

Recovered

Emitted when a token has been recovered.

solidity
event Recovered(address token, uint256 amount);

Parameters

NameTypeDescription
tokenaddressThe token that has been recovered.
amountuint256The amount of token recovered.