KlimaStaking
Inherits: Ownable
State Variables
KLIMA
address public immutable KLIMA;
sKLIMA
address public immutable sKLIMA;
epoch
Epoch public epoch;
distributor
address public distributor;
locker
address public locker;
totalBonus
uint256 public totalBonus;
warmupContract
address public warmupContract;
warmupPeriod
uint256 public warmupPeriod;
warmupInfo
mapping(address => Claim) public warmupInfo;
Functions
constructor
constructor(address _KLIMA, address _sKLIMA, uint256 _epochLength, uint256 _firstEpochNumber, uint256 _firstEpochBlock);
stake
stake KLIMA to enter warmup
function stake(uint256 _amount, address _recipient) external returns (bool);
Parameters
Name | Type | Description |
---|---|---|
_amount | uint256 | uint |
_recipient | address |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | bool |
claim
retrieve sKLIMA from warmup
function claim(address _recipient) public;
Parameters
Name | Type | Description |
---|---|---|
_recipient | address | address |
forfeit
forfeit sKLIMA in warmup and retrieve KLIMA
function forfeit() external;
toggleDepositLock
prevent new deposits to address (protection from malicious activity)
function toggleDepositLock() external;
unstake
redeem sKLIMA for KLIMA
function unstake(uint256 _amount, bool _trigger) external;
Parameters
Name | Type | Description |
---|---|---|
_amount | uint256 | uint |
_trigger | bool | bool |
index
returns the sKLIMA index, which tracks rebase growth
function index() public view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | uint |
rebase
trigger rebase if epoch over
function rebase() public;
contractBalance
returns contract KLIMA holdings, including bonuses provided
function contractBalance() public view returns (uint256);
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | uint |
giveLockBonus
provide bonus to locked staking contract
function giveLockBonus(uint256 _amount) external;
Parameters
Name | Type | Description |
---|---|---|
_amount | uint256 | uint |
returnLockBonus
reclaim bonus from locked staking contract
function returnLockBonus(uint256 _amount) external;
Parameters
Name | Type | Description |
---|---|---|
_amount | uint256 | uint |
setContract
sets the contract address for LP staking
function setContract(CONTRACTS _contract, address _address) external onlyManager;
Parameters
Name | Type | Description |
---|---|---|
_contract | CONTRACTS | address |
_address | address |
setWarmup
set warmup period for new stakers
function setWarmup(uint256 _warmupPeriod) external onlyManager;
Parameters
Name | Type | Description |
---|---|---|
_warmupPeriod | uint256 | uint |
Structs
Epoch
struct Epoch {
uint256 length;
uint256 number;
uint256 endBlock;
uint256 distribute;
}
Claim
struct Claim {
uint256 deposit;
uint256 gons;
uint256 expiry;
bool lock;
}
Enums
CONTRACTS
enum CONTRACTS {
DISTRIBUTOR,
WARMUP,
LOCKER
}