IMultiRateLimited
Volt Protocol
interface for putting a rate limit on how fast a contract can perform an action, e.g. Minting
Methods
addAddress
function addAddress(address, uint112, uint112) external nonpayable
add an authorized contract, its per second replenishment and buffer
Parameters
Name | Type | Description |
---|
_0 | address | undefined |
_1 | uint112 | undefined |
_2 | uint112 | undefined |
addAddressAsMinter
function addAddressAsMinter(address) external nonpayable
add an authorized contract, its per second replenishment and buffer set to the non governor caps
Parameters
Name | Type | Description |
---|
_0 | address | undefined |
getBufferCap
function getBufferCap(address) external view returns (uint256)
the cap of the buffer that can be used at once
Parameters
Name | Type | Description |
---|
_0 | address | undefined |
Returns
Name | Type | Description |
---|
_0 | uint256 | undefined |
getLastBufferUsedTime
function getLastBufferUsedTime(address) external view returns (uint256)
the last time the buffer was used by each address
Parameters
Name | Type | Description |
---|
_0 | address | undefined |
Returns
Name | Type | Description |
---|
_0 | uint256 | undefined |
getRateLimitPerSecond
function getRateLimitPerSecond(address) external view returns (uint256)
the rate per second for each address
Parameters
Name | Type | Description |
---|
_0 | address | undefined |
Returns
Name | Type | Description |
---|
_0 | uint256 | undefined |
individualBuffer
function individualBuffer(address) external view returns (uint112)
the amount of action that can be used before hitting limit
replenishes at rateLimitPerSecond per second up to bufferCap
Parameters
Name | Type | Description |
---|
_0 | address | undefined |
Returns
Name | Type | Description |
---|
_0 | uint112 | undefined |
removeAddress
function removeAddress(address) external nonpayable
remove an authorized contract
Parameters
Name | Type | Description |
---|
_0 | address | undefined |
updateAddress
function updateAddress(address, uint112, uint112) external nonpayable
update an authorized contract
Parameters
Name | Type | Description |
---|
_0 | address | undefined |
_1 | uint112 | undefined |
_2 | uint112 | undefined |
updateMaxBufferCap
function updateMaxBufferCap(uint256 newBufferCap) external nonpayable
update the non gov max buffer cap
Parameters
Name | Type | Description |
---|
newBufferCap | uint256 | undefined |
updateMaxRateLimitPerSecond
function updateMaxRateLimitPerSecond(uint256 newMaxRateLimitPerSecond) external nonpayable
update the non gov max rate limit per second
Parameters
Name | Type | Description |
---|
newMaxRateLimitPerSecond | uint256 | undefined |
Events
IndividualBufferUsed
event IndividualBufferUsed(address rateLimitedAddress, uint256 amountUsed, uint256 bufferRemaining)
emitted when a buffer is eaten into
Parameters
Name | Type | Description |
---|
rateLimitedAddress | address | undefined |
amountUsed | uint256 | undefined |
bufferRemaining | uint256 | undefined |
IndividualRateLimitPerSecondUpdate
event IndividualRateLimitPerSecondUpdate(address rateLimitedAddress, uint256 oldRateLimitPerSecond, uint256 newRateLimitPerSecond)
emitted when rate limit is updated
Parameters
Name | Type | Description |
---|
rateLimitedAddress | address | undefined |
oldRateLimitPerSecond | uint256 | undefined |
newRateLimitPerSecond | uint256 | undefined |
MultiBufferCapUpdate
event MultiBufferCapUpdate(uint256 oldBufferCap, uint256 newBufferCap)
emitted when the non gov buffer cap max is updated
Parameters
Name | Type | Description |
---|
oldBufferCap | uint256 | undefined |
newBufferCap | uint256 | undefined |
MultiMaxRateLimitPerSecondUpdate
event MultiMaxRateLimitPerSecondUpdate(uint256 oldMaxRateLimitPerSecond, uint256 newMaxRateLimitPerSecond)
emitted when the non gov buffer rate limit per second max is updated
Parameters
Name | Type | Description |
---|
oldMaxRateLimitPerSecond | uint256 | undefined |
newMaxRateLimitPerSecond | uint256 | undefined |