sKLIMAv2
Inherits: ERC20Permit, Ownable
State Variables
stakingContract
address public stakingContract;
initializer
address public initializer;
rebases
Rebase[] public rebases;
INDEX
uint256 public INDEX;
MAX_UINT256
uint256 private constant MAX_UINT256 = ~uint256(0);
INITIAL_FRAGMENTS_SUPPLY
uint256 private constant INITIAL_FRAGMENTS_SUPPLY = 5_000_000 * 10 ** 9;
TOTAL_GONS
uint256 private constant TOTAL_GONS = MAX_UINT256 - (MAX_UINT256 % INITIAL_FRAGMENTS_SUPPLY);
MAX_SUPPLY
uint256 private constant MAX_SUPPLY = ~uint128(0);
_gonsPerFragment
uint256 private _gonsPerFragment;
_gonBalances
mapping(address => uint256) private _gonBalances;
_allowedValue
mapping(address => mapping(address => uint256)) private _allowedValue;
Functions
onlyStakingContract
modifier onlyStakingContract();
constructor
constructor() ERC20("Staked Klima", "sKLIMA", 9) ERC20Permit();
initialize
function initialize(address stakingContract_) external returns (bool);
setIndex
function setIndex(uint256 _INDEX) external onlyManager returns (bool);
rebase
increases sKLIMA supply to increase staking balances relative to profit_
function rebase(uint256 profit_, uint256 epoch_) public onlyStakingContract returns (uint256);
Parameters
Name | Type | Description |
---|---|---|
profit_ | uint256 | uint256 |
epoch_ | uint256 |
Returns
Name | Type | Description |
---|---|---|
<none> | uint256 | uint256 |
_storeRebase
emits event with data about rebase
function _storeRebase(uint256 previousCirculating_, uint256 profit_, uint256 epoch_) internal returns (bool);
Parameters
Name | Type | Description |
---|---|---|
previousCirculating_ | uint256 | uint |
profit_ | uint256 | uint |
epoch_ | uint256 | uint |
Returns
Name | Type | Description |
---|---|---|
<none> | bool | bool |
balanceOf
function balanceOf(address who) public view override returns (uint256);
gonsForBalance
function gonsForBalance(uint256 amount) public view returns (uint256);
balanceForGons
function balanceForGons(uint256 gons) public view returns (uint256);
circulatingSupply
function circulatingSupply() public view returns (uint256);
index
function index() public view returns (uint256);
transfer
function transfer(address to, uint256 value) public override returns (bool);
allowance
function allowance(address owner_, address spender) public view override returns (uint256);
transferFrom
function transferFrom(address from, address to, uint256 value) public override returns (bool);
approve
function approve(address spender, uint256 value) public override returns (bool);
_approve
function _approve(address owner, address spender, uint256 value) internal virtual override;
increaseAllowance
function increaseAllowance(address spender, uint256 addedValue) public override returns (bool);
decreaseAllowance
function decreaseAllowance(address spender, uint256 subtractedValue) public override returns (bool);
Events
LogSupply
event LogSupply(uint256 indexed epoch, uint256 timestamp, uint256 totalSupply);
LogRebase
event LogRebase(uint256 indexed epoch, uint256 rebase, uint256 index);
LogStakingContractUpdated
event LogStakingContractUpdated(address stakingContract);
Structs
Rebase
struct Rebase {
uint256 epoch;
uint256 rebase;
uint256 totalStakedBefore;
uint256 totalStakedAfter;
uint256 amountRebased;
uint256 index;
uint256 blockNumberOccured;
}