DarknodePaymentStore
Contract: DarknodePaymentStore
​
DarknodePaymentStore is responsible for tracking balances which have been allocated to the darknodes. It is also responsible for holding the tokens to be paid out to darknodes.
Inherits from:
Claimable
Ownable
Context
Initializable
Variables​
VERSION
: string
​
ETHEREUM
: address
​
darknodeBalances
: mapping(address => mapping(address => uint256))
​
lockedBalances
: mapping(address => uint256)
​
Functions​
constructor
(string _VERSION)
(public)​
Params
_VERSION
: A string defining the contract version.
The contract constructor.
fallback
()
(external)​
Allow direct ETH payments to be made to the DarknodePaymentStore.
totalBalance
(address _token) → uint256
(public)​
Params
_token
: The token to check balance of.
Returns
The
: total balance of the contract.
Get the total balance of the contract for a particular token.
availableBalance
(address _token) → uint256
(public)​
Params
_token
: The token to check balance of.
Returns
The
: available balance of the contract.
Get the available balance of the contract for a particular token This is the free amount which has not yet been allocated to darknodes.
incrementDarknodeBalance
(address _darknode, address _token, uint256 _amount)
(external)​
Params
_darknode
: The address of the darknode to increase balance of._token
: The token which the balance should be incremented._amount
: The amount that the balance should be incremented by.
Increments the amount of funds allocated to a particular darknode.
transfer
(address _darknode, address _token, uint256 _amount, address payable _recipient)
(external)​
Params
_darknode
: The address of the darknode._token
: Which token to transfer._amount
: The amount to transfer._recipient
: The address to withdraw it to.
Transfers an amount out of balance to a specified address.