Skip to main content

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

NameTypeDescription
_0addressundefined
_1uint112undefined
_2uint112undefined

addAddressAsMinter

function addAddressAsMinter(address) external nonpayable

add an authorized contract, its per second replenishment and buffer set to the non governor caps

Parameters

NameTypeDescription
_0addressundefined

getBufferCap

function getBufferCap(address) external view returns (uint256)

the cap of the buffer that can be used at once

Parameters

NameTypeDescription
_0addressundefined

Returns

NameTypeDescription
_0uint256undefined

getLastBufferUsedTime

function getLastBufferUsedTime(address) external view returns (uint256)

the last time the buffer was used by each address

Parameters

NameTypeDescription
_0addressundefined

Returns

NameTypeDescription
_0uint256undefined

getRateLimitPerSecond

function getRateLimitPerSecond(address) external view returns (uint256)

the rate per second for each address

Parameters

NameTypeDescription
_0addressundefined

Returns

NameTypeDescription
_0uint256undefined

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

NameTypeDescription
_0addressundefined

Returns

NameTypeDescription
_0uint112undefined

removeAddress

function removeAddress(address) external nonpayable

remove an authorized contract

Parameters

NameTypeDescription
_0addressundefined

updateAddress

function updateAddress(address, uint112, uint112) external nonpayable

update an authorized contract

Parameters

NameTypeDescription
_0addressundefined
_1uint112undefined
_2uint112undefined

updateMaxBufferCap

function updateMaxBufferCap(uint256 newBufferCap) external nonpayable

update the non gov max buffer cap

Parameters

NameTypeDescription
newBufferCapuint256undefined

updateMaxRateLimitPerSecond

function updateMaxRateLimitPerSecond(uint256 newMaxRateLimitPerSecond) external nonpayable

update the non gov max rate limit per second

Parameters

NameTypeDescription
newMaxRateLimitPerSeconduint256undefined

Events

IndividualBufferUsed

event IndividualBufferUsed(address rateLimitedAddress, uint256 amountUsed, uint256 bufferRemaining)

emitted when a buffer is eaten into

Parameters

NameTypeDescription
rateLimitedAddressaddressundefined
amountUseduint256undefined
bufferRemaininguint256undefined

IndividualRateLimitPerSecondUpdate

event IndividualRateLimitPerSecondUpdate(address rateLimitedAddress, uint256 oldRateLimitPerSecond, uint256 newRateLimitPerSecond)

emitted when rate limit is updated

Parameters

NameTypeDescription
rateLimitedAddressaddressundefined
oldRateLimitPerSeconduint256undefined
newRateLimitPerSeconduint256undefined

MultiBufferCapUpdate

event MultiBufferCapUpdate(uint256 oldBufferCap, uint256 newBufferCap)

emitted when the non gov buffer cap max is updated

Parameters

NameTypeDescription
oldBufferCapuint256undefined
newBufferCapuint256undefined

MultiMaxRateLimitPerSecondUpdate

event MultiMaxRateLimitPerSecondUpdate(uint256 oldMaxRateLimitPerSecond, uint256 newMaxRateLimitPerSecond)

emitted when the non gov buffer rate limit per second max is updated

Parameters

NameTypeDescription
oldMaxRateLimitPerSeconduint256undefined
newMaxRateLimitPerSeconduint256undefined