BGTStaker
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
Name | Type | Description |
---|---|---|
reward | uint256 | The 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
Name | Type | Description |
---|---|---|
tokenAddress | address | The address of the token to recover. |
tokenAmount | uint256 | The 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
Name | Type | Description |
---|---|---|
_rewardsDuration | uint256 | The rewards duration. |
stake
Stake BGT tokens.
Can only be called by the BGT contract.
solidity
function stake(address account, uint256 amount) external;
Parameters
Name | Type | Description |
---|---|---|
account | address | The account to stake for. |
amount | uint256 | The 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
Name | Type | Description |
---|---|---|
account | address | The account to withdraw for. |
amount | uint256 | The amount of BGT to withdraw. |
getReward
Get the reward.
Get the reward for the caller.
solidity
function getReward() external returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | The reward amount. |
Events
Recovered
Emitted when a token has been recovered.
solidity
event Recovered(address token, uint256 amount);
Parameters
Name | Type | Description |
---|---|---|
token | address | The token that has been recovered. |
amount | uint256 | The amount of token recovered. |