Add throttle interface

This commit is contained in:
lash
2023-08-04 18:17:23 +01:00
parent db35d389ec
commit b1c03932ad
6 changed files with 97 additions and 0 deletions

View File

@@ -654,6 +654,36 @@ Use cases of sealing include:
<https://git.grassecon.net/cicnet/erc20-demurrage-token.git>
### Throttle
An backend contract to limit access to a resource by time.
The smart contract managing the resource calls have(address) on this
contract to check if it can be made use of at the current point in time.
This also implements [ACL](#acl).
When the resource is made use of, it calls poke(address) method to
register when it has been made use of.
#### ERC165 Interface identifier
8f5bc7bf
#### Solidity interface definition
interface IThrottle {
// Returns true if the given address is authorized to make use of the resource at the current moment.
// Implements ACL
function have(address _address) external view returns(bool);
// Must be called when the resource is being used.
function poke(address _address) external returns(bool);
}
#### Reference implementation
<git://holbrook.no/eth-faucet.git> (PeriodSimple contract)
### TokenLimit
Define limits of value amounts of tokens that individual addresses can