Skip to main content

RateLimitedV2

abstract contract for putting a rate limit on how fast a contrac can perform an action e.g. Minting

Methods

CONTRACT_ADMIN_ROLE

function CONTRACT_ADMIN_ROLE() external view returns (bytes32)

a role used with a subset of governor permissions for this contract only

Returns

NameTypeDescription
_0bytes32undefined

MAX_RATE_LIMIT_PER_SECOND

function MAX_RATE_LIMIT_PER_SECOND() external view returns (uint256)

maximum rate limit per second governance can set for this contract

Returns

NameTypeDescription
_0uint256undefined

buffer

function buffer() external view returns (uint256)

the amount of action used before hitting limit

replenishes at rateLimitPerSecond per second up to bufferCap

Returns

NameTypeDescription
_0uint256undefined

bufferCap

function bufferCap() external view returns (uint128)

the cap of the buffer that can be used at once

Returns

NameTypeDescription
_0uint128undefined

bufferStored

function bufferStored() external view returns (uint224)

the buffer at the timestamp of lastBufferUsedTime

Returns

NameTypeDescription
_0uint224undefined

core

function core() external view returns (contract ICore)

address of the Core contract referenced

Returns

NameTypeDescription
_0contract ICoreICore implementation address

isContractAdmin

function isContractAdmin(address _admin) external view returns (bool)

returns whether a given address has the admin role for this contract

Parameters

NameTypeDescription
_adminaddressundefined

Returns

NameTypeDescription
_0boolundefined

lastBufferUsedTime

function lastBufferUsedTime() external view returns (uint32)

the last time the buffer was used by the contract

Returns

NameTypeDescription
_0uint32undefined

pause

function pause() external nonpayable

set pausable methods to paused

paused

function paused() external view returns (bool)

Returns true if the contract is paused, and false otherwise.

Returns

NameTypeDescription
_0boolundefined

rateLimitPerSecond

function rateLimitPerSecond() external view returns (uint128)

the rate per second for this contract

Returns

NameTypeDescription
_0uint128undefined

setBufferCap

function setBufferCap(uint128 newBufferCap) external nonpayable

set the buffer cap

Parameters

NameTypeDescription
newBufferCapuint128undefined

setContractAdminRole

function setContractAdminRole(bytes32 newContractAdminRole) external nonpayable

sets a new admin role for this contract

Parameters

NameTypeDescription
newContractAdminRolebytes32undefined

setRateLimitPerSecond

function setRateLimitPerSecond(uint128 newRateLimitPerSecond) external nonpayable

set the rate limit per second

Parameters

NameTypeDescription
newRateLimitPerSeconduint128undefined

unpause

function unpause() external nonpayable

set pausable methods to unpaused

vcon

function vcon() external view returns (contract IERC20)

address of the Tribe contract referenced by Core

Returns

NameTypeDescription
_0contract IERC20IERC20 implementation address

vconBalance

function vconBalance() external view returns (uint256)

vcon balance of contract

Returns

NameTypeDescription
_0uint256vcon amount held

volt

function volt() external view returns (contract IVolt)

address of the Fei contract referenced by Core

Returns

NameTypeDescription
_0contract IVoltIFei implementation address

voltBalance

function voltBalance() external view returns (uint256)

volt balance of contract

Returns

NameTypeDescription
_0uint256volt amount held

Events

BufferCapUpdate

event BufferCapUpdate(uint256 oldBufferCap, uint256 newBufferCap)

event emitted when buffer cap is updated

Parameters

NameTypeDescription
oldBufferCapuint256undefined
newBufferCapuint256undefined

BufferReplenished

event BufferReplenished(uint256 amountReplenished, uint256 bufferRemaining)

event emitted when buffer gets replenished

Parameters

NameTypeDescription
amountReplenisheduint256undefined
bufferRemaininguint256undefined

BufferUsed

event BufferUsed(uint256 amountUsed, uint256 bufferRemaining)

event emitted when buffer gets eaten into

Parameters

NameTypeDescription
amountUseduint256undefined
bufferRemaininguint256undefined

ContractAdminRoleUpdate

event ContractAdminRoleUpdate(bytes32 indexed oldContractAdminRole, bytes32 indexed newContractAdminRole)

Parameters

NameTypeDescription
oldContractAdminRole indexedbytes32undefined
newContractAdminRole indexedbytes32undefined

CoreUpdate

event CoreUpdate(address indexed oldCore, address indexed newCore)

Parameters

NameTypeDescription
oldCore indexedaddressundefined
newCore indexedaddressundefined

Paused

event Paused(address account)

Parameters

NameTypeDescription
accountaddressundefined

RateLimitPerSecondUpdate

event RateLimitPerSecondUpdate(uint256 oldRateLimitPerSecond, uint256 newRateLimitPerSecond)

event emitted when rate limit per second is updated

Parameters

NameTypeDescription
oldRateLimitPerSeconduint256undefined
newRateLimitPerSeconduint256undefined

Unpaused

event Unpaused(address account)

Parameters

NameTypeDescription
accountaddressundefined