KlimaStaking

Git Source

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

NameTypeDescription
_amountuint256uint
_recipientaddress

Returns

NameTypeDescription
<none>boolbool

claim

retrieve sKLIMA from warmup

function claim(address _recipient) public;

Parameters

NameTypeDescription
_recipientaddressaddress

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

NameTypeDescription
_amountuint256uint
_triggerboolbool

index

returns the sKLIMA index, which tracks rebase growth

function index() public view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint

rebase

trigger rebase if epoch over

function rebase() public;

contractBalance

returns contract KLIMA holdings, including bonuses provided

function contractBalance() public view returns (uint256);

Returns

NameTypeDescription
<none>uint256uint

giveLockBonus

provide bonus to locked staking contract

function giveLockBonus(uint256 _amount) external;

Parameters

NameTypeDescription
_amountuint256uint

returnLockBonus

reclaim bonus from locked staking contract

function returnLockBonus(uint256 _amount) external;

Parameters

NameTypeDescription
_amountuint256uint

setContract

sets the contract address for LP staking

function setContract(CONTRACTS _contract, address _address) external onlyManager;

Parameters

NameTypeDescription
_contractCONTRACTSaddress
_addressaddress

setWarmup

set warmup period for new stakers

function setWarmup(uint256 _warmupPeriod) external onlyManager;

Parameters

NameTypeDescription
_warmupPerioduint256uint

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
}