Skip to main content

Thix

THIX is an ERC20 token with the ERC1363 "Payable Token" extension and the ability to payout rewards and burn tokens to pay for fees.

Functions

transferAndCall

function transferAndCall(address to, uint256 amount) external returns (bool)

Transfer tokens from msg.sender to another address and then call onTransferReceived on receiver.

Parameters

NameTypeDescription
toaddressaddress The address which you want to transfer to
amountuint256The amount of tokens to be transferred

Return Values

NameTypeDescription
[0]booltrue unless throwing

transferAndCall

function transferAndCall(address to, uint256 amount, bytes data) external returns (bool)

Transfer tokens from msg.sender to another address and then call onTransferReceived on receiver.

Parameters

NameTypeDescription
toaddressaddress The address which you want to transfer to
amountuint256The amount of tokens to be transferred
databytesbytes Additional data with no specified format, sent in call to to

Return Values

NameTypeDescription
[0]booltrue unless throwing

transferFromAndCall

function transferFromAndCall(address from, address to, uint256 amount) external returns (bool)

Transfer tokens from one address to another and then call onTransferReceived on receiver.

Parameters

NameTypeDescription
fromaddressaddress The address which you want to send tokens from
toaddressaddress The address which you want to transfer to
amountuint256The amount of tokens to be transferred

Return Values

NameTypeDescription
[0]booltrue unless throwing

transferFromAndCall

function transferFromAndCall(address from, address to, uint256 amount, bytes data) external returns (bool)

Transfer tokens from one address to another and then call onTransferReceived on receiver.

Parameters

NameTypeDescription
fromaddressaddress The address which you want to send tokens from
toaddressaddress The address which you want to transfer to
amountuint256The amount of tokens to be transferred
databytesbytes Additional data with no specified format, sent in call to to

Return Values

NameTypeDescription
[0]booltrue unless throwing

approveAndCall

function approveAndCall(address spender, uint256 amount) external returns (bool)

Approve the passed address to spend the specified amount of tokens on behalf of msg.sender and then call onApprovalReceived on spender. Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729

Parameters

NameTypeDescription
spenderaddressaddress The address which will spend the funds
amountuint256uint256 The amount of tokens to be spent

approveAndCall

function approveAndCall(address spender, uint256 amount, bytes data) external returns (bool)

Approve the passed address to spend the specified amount of tokens on behalf of msg.sender and then call onApprovalReceived on spender. Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729

Parameters

NameTypeDescription
spenderaddressaddress The address which will spend the funds
amountuint256uint256 The amount of tokens to be spent
databytesbytes Additional data with no specified format, sent in call to spender

supportsInterface

function supportsInterface(bytes4 interfaceId) external view returns (bool)

_Returns true if this contract implements the interface defined by interfaceId. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created.

This function call must use less than 30 000 gas._

totalRewardsPaid

function totalRewardsPaid(address account) external view returns (uint256)

total amount of THIX token rewards that are paid to account

Parameters

NameTypeDescription
accountaddressusers address

Return Values

NameTypeDescription
[0]uint256amount of tokens that are already minted for the user

payRewards

function payRewards(address to, uint256 amount) external

pay amount of tokens rewards to to. On success the ERC20 Transfer event is raised with the from set to the zero account.

only whitelisted accounts can call this function.

Parameters

NameTypeDescription
toaddressaccount to pay the minted tokens to
amountuint256amount of tokens to mint

payRewardsAndCall

function payRewardsAndCall(address to, uint256 amount) external

pay amount of tokens rewards to to and call the onTransferReceived callback on received with the from address set to the zero adress. On success the ERC20 Transfer event is raised with the from set to the zero account.

only whitelisted accounts can call this function.

Parameters

NameTypeDescription
toaddressaccount to pay the minted tokens to
amountuint256amount of tokens to mint

payRewardsAndCall

function payRewardsAndCall(address to, uint256 amount, bytes data) external

pay amount of tokens rewards to to and call the onTransferReceived callback on received with the from address set to the zero adress. On success the ERC20 Transfer event is raised with the from set to the zero account.

only whitelisted accounts can call this function.

Parameters

NameTypeDescription
toaddressaccount to pay the minted tokens to
amountuint256amount of tokens to mint
databytesdata passed when the onTransferReceived is called

burnDelegated

function burnDelegated(address from, uint256 amount) external

burn amount of tokens in from wallet. On success the ERC20 Transfer event is raised with the to set to the zero address.

only whitelisted accounts can call this function.

Parameters

NameTypeDescription
fromaddressaccount to burn the tokens from
amountuint256tokens to burn

name

function name() external view returns (string)

Returns the name of the token.

symbol

function symbol() external view returns (string)

Returns the symbol of the token.

decimals

function decimals() external view returns (uint8)

Returns the decimals places of the token.

totalSupply

function totalSupply() external view returns (uint256)

Returns the amount of tokens in existence.

balanceOf

function balanceOf(address account) external view returns (uint256)

Returns the amount of tokens owned by account.

transfer

function transfer(address to, uint256 amount) external returns (bool)

_Moves amount tokens from the caller's account to to.

Returns a boolean value indicating whether the operation succeeded.

Emits a {Transfer} event._

allowance

function allowance(address owner, address spender) external view returns (uint256)

_Returns the remaining number of tokens that spender will be allowed to spend on behalf of owner through {transferFrom}. This is zero by default.

This value changes when {approve} or {transferFrom} are called._

approve

function approve(address spender, uint256 amount) external returns (bool)

_Sets amount as the allowance of spender over the caller's tokens.

Returns a boolean value indicating whether the operation succeeded.

IMPORTANT: Beware that changing an allowance with this method brings the risk that someone may use both the old and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729

Emits an {Approval} event._

transferFrom

function transferFrom(address from, address to, uint256 amount) external returns (bool)

_Moves amount tokens from from to to using the allowance mechanism. amount is then deducted from the caller's allowance.

Returns a boolean value indicating whether the operation succeeded.

Emits a {Transfer} event._

Events

Transfer

event Transfer(address from, address to, uint256 value)

_Emitted when value tokens are moved from one account (from) to another (to).

Note that value may be zero._

Approval

event Approval(address owner, address spender, uint256 value)

Emitted when the allowance of a spender for an owner is set by a call to {approve}. value is the new allowance.