core staking contracts
SDL Token Contract (StakingAllowance)
SDL is a staking allowance token which enables stakers to earn a percentage of protocol rewards and grants stakers the right to priority staking access over non SDL holders.
ERC20 Functions
Section titled “ERC20 Functions”All standard ERC20 functions are implemented for StakingAllowance
Write Functions
Section titled “Write Functions”Mints tokens to an account
function mint(address _account, uint256 _amount) publicParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| _account | address | Address to mint to |
| _amount | uint256 | Amount of tokens to mint |
mintToContract
Section titled “mintToContract”Mints tokens to a contract on behalf of an account via ERC677
function mintToContract(address _contract, address _account, uint256 _amount, bytes _calldata) publicParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| _contract | address | Address of contract to send tokens to |
| _account | address | Address to mint to |
| _amount | uint256 | Amount of tokens to mint |
| _calldata | bytes |
Burns tokens from the sender
function burn(uint256 _amount) publicParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| _amount | uint256 | Amount of tokens to burn |
burnFrom
Section titled “burnFrom”Burns _amount tokens from _account, deducting from the sender’s allowance
function burnFrom(address account, uint256 amount) publicParameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| _account | address | Address to burn from |
| _amount | uint256 | Amount of tokens to burn |
transferAndCall
Section titled “transferAndCall”Transfers tokens to an address and calls onTokenTransfer with additional data if the recipient is a contract
function transferAndCall(address _to, uint256 _value, bytes _data) external returns (bool)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| _to | address | Address to send the tokens to |
| _value | uint256 | Value of token transfer |
| _data | bytes | Calldata included in the transfer |
transferAndCallWithSender
Section titled “transferAndCallWithSender”Similar to transferAndCall but allows the caller to specify a custom sender (used to mint allowance on behalf of an address and send to a contract fallback)
function transferAndCallWithSender(address _sender, address _to, uint256 _value, bytes _data) private returns (bool)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| _sender | address | Specified sender of the tokens, the party who ‘receives’ them into a contract |
| _to | address | Contract address to send the tokens to |
| _value | uint256 | Value of token transfer |
| _data | bytes | Calldata included in the transfer |