What is the standard way to delay the payment of an ERC20 token?
Context:
I am looking for a way that a user would pay for my ERC20 token in ETH, then an arbitrary number of days later, lets say 7 days
, they would receive the tokens.
How is this usually achieved in Solidity?
I have read in the docs that that date/time handling is done with block.timestamp
Some example code I have found is:
function f(uint start, uint daysAfter) {
if (now >= start + daysAfter * 1 days) {
// ...
}
}
but I am unsure on how to use it to trigger payment to a user after x
days.