Function payInvoiceERC20
Last updated
Last updated
The payInvoiceERC20
function enables everyone to make an early payment and start earning. The due date of the payment needs to be passed as an argument.
See `` if you want to make an escrow payment without due date. The payment can be released at a later date.
_payee
The receiver of the principal amount.
_feeAddress
In case you want to charge an extra fee, this is the receiving address of the fee.
_dueDate
_amount
The fee amount in wei. Make sure to double-check the number of decimals of the baseAsset.
_feeAmount
The fee amount in wei. Make sure to double-check the number of decimals of the baseAsset.
_paymentReference
Reference of the related payment. Make sure to add salt to and hash the _paymentReference to increase privacy and prevent double references.
_shouldPayOutViaRequestNetwork
This is a uint8 parameter. Pass a value != 0 if you want the payout of the invoice routed through Request Network's ERC20FeeProxy contract.
The _amount
and _feeAmount
total are transferred to Compound Finance's Comet contract, to earn yield.
The payment details are stored in the paymentMapping.
Parameter _shouldPayOutViaRequestNetwork
is a uint8 to save on gas fees (compared to a bool). You can pass a value of 0 if you don't want the payment to be routed through Request Network.
The due date of the payment in time.