-
Since this project uses Chainlink oracles testing the project requires an infura/alchemy/geth node
-
To set your node add the
GETH_NODE
env variable in.env
-
Provided node will be used to spawn a local mainnet fork
npm install npx hardhat test
_addToken(address tokenAddress, address oracleAddress)
- adds the corresponding ChainLink oracle address
delegatePausable(uint streamId, address delegate) onlyPayerOrDelegated(streamId)
- Delegates pausable capability to
address delegate
- Delegates pausable capability to
claimable (uint streamId)
- returns accrued amount in USD (18 decimals) for
streamId
- returns accrued amount in USD (18 decimals) for
claimableToken (uint streamId)
- returns accrued amount in
token
value using Chainlink' oracle
- returns accrued amount in
getStreamsCount()
- return total no. of streams: useful for looping through
streams
usinggetStream(id)
- return total no. of streams: useful for looping through
-
A payment stream is a per-Ethereum-block drip stream of abstract USD to a payee address.
-
A payer may create, start, or stop payment streams to a payee address.
-
Each payment stream is associated with a token , and has received an ERC20 approval from the funding address.
-
Payees may Claim the unlocked, unclaimed USD balance of the payment stream.
-
A Claim will consult an on-chain price oracle USDC/XYZ, calculate the amount of XYZ coins to be paid, and transfer that amount of XYZ to the payee.
Create a new payment stream from payer to payee. Funds may be from any account; funding account must approve this contract debiting this amount.
Stop the drip.
Restart the drip.
Change stream payee address.
Change stream funding rate.
Change stream funding address.
Payee receives nnnn.nn XYZ tokens, derived from a calculation of accumulated-but-not-claimed USD balance. The amount of XYZ tokens is calculated from an on-chain XYZ/USDC price oracle at claim time.