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
Name | Type | Description |
---|
_0 | bytes32 | undefined |
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
Name | Type | Description |
---|
_0 | uint256 | undefined |
buffer
function buffer() external view returns (uint256)
the amount of action used before hitting limit
replenishes at rateLimitPerSecond per second up to bufferCap
Returns
Name | Type | Description |
---|
_0 | uint256 | undefined |
bufferCap
function bufferCap() external view returns (uint128)
the cap of the buffer that can be used at once
Returns
Name | Type | Description |
---|
_0 | uint128 | undefined |
bufferStored
function bufferStored() external view returns (uint224)
the buffer at the timestamp of lastBufferUsedTime
Returns
Name | Type | Description |
---|
_0 | uint224 | undefined |
core
function core() external view returns (contract ICore)
address of the Core contract referenced
Returns
Name | Type | Description |
---|
_0 | contract ICore | ICore implementation address |
isContractAdmin
function isContractAdmin(address _admin) external view returns (bool)
returns whether a given address has the admin role for this contract
Parameters
Name | Type | Description |
---|
_admin | address | undefined |
Returns
Name | Type | Description |
---|
_0 | bool | undefined |
lastBufferUsedTime
function lastBufferUsedTime() external view returns (uint32)
the last time the buffer was used by the contract
Returns
Name | Type | Description |
---|
_0 | uint32 | undefined |
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
Name | Type | Description |
---|
_0 | bool | undefined |
rateLimitPerSecond
function rateLimitPerSecond() external view returns (uint128)
the rate per second for this contract
Returns
Name | Type | Description |
---|
_0 | uint128 | undefined |
setBufferCap
function setBufferCap(uint128 newBufferCap) external nonpayable
set the buffer cap
Parameters
Name | Type | Description |
---|
newBufferCap | uint128 | undefined |
setContractAdminRole
function setContractAdminRole(bytes32 newContractAdminRole) external nonpayable
sets a new admin role for this contract
Parameters
Name | Type | Description |
---|
newContractAdminRole | bytes32 | undefined |
setRateLimitPerSecond
function setRateLimitPerSecond(uint128 newRateLimitPerSecond) external nonpayable
set the rate limit per second
Parameters
Name | Type | Description |
---|
newRateLimitPerSecond | uint128 | undefined |
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
Name | Type | Description |
---|
_0 | contract IERC20 | IERC20 implementation address |
vconBalance
function vconBalance() external view returns (uint256)
vcon balance of contract
Returns
Name | Type | Description |
---|
_0 | uint256 | vcon amount held |
volt
function volt() external view returns (contract IVolt)
address of the Fei contract referenced by Core
Returns
Name | Type | Description |
---|
_0 | contract IVolt | IFei implementation address |
voltBalance
function voltBalance() external view returns (uint256)
volt balance of contract
Returns
Name | Type | Description |
---|
_0 | uint256 | volt amount held |
Events
BufferCapUpdate
event BufferCapUpdate(uint256 oldBufferCap, uint256 newBufferCap)
event emitted when buffer cap is updated
Parameters
Name | Type | Description |
---|
oldBufferCap | uint256 | undefined |
newBufferCap | uint256 | undefined |
BufferReplenished
event BufferReplenished(uint256 amountReplenished, uint256 bufferRemaining)
event emitted when buffer gets replenished
Parameters
Name | Type | Description |
---|
amountReplenished | uint256 | undefined |
bufferRemaining | uint256 | undefined |
BufferUsed
event BufferUsed(uint256 amountUsed, uint256 bufferRemaining)
event emitted when buffer gets eaten into
Parameters
Name | Type | Description |
---|
amountUsed | uint256 | undefined |
bufferRemaining | uint256 | undefined |
ContractAdminRoleUpdate
event ContractAdminRoleUpdate(bytes32 indexed oldContractAdminRole, bytes32 indexed newContractAdminRole)
Parameters
Name | Type | Description |
---|
oldContractAdminRole indexed | bytes32 | undefined |
newContractAdminRole indexed | bytes32 | undefined |
CoreUpdate
event CoreUpdate(address indexed oldCore, address indexed newCore)
Parameters
Name | Type | Description |
---|
oldCore indexed | address | undefined |
newCore indexed | address | undefined |
Paused
event Paused(address account)
Parameters
Name | Type | Description |
---|
account | address | undefined |
RateLimitPerSecondUpdate
event RateLimitPerSecondUpdate(uint256 oldRateLimitPerSecond, uint256 newRateLimitPerSecond)
event emitted when rate limit per second is updated
Parameters
Name | Type | Description |
---|
oldRateLimitPerSecond | uint256 | undefined |
newRateLimitPerSecond | uint256 | undefined |
Unpaused
event Unpaused(address account)
Parameters
Name | Type | Description |
---|
account | address | undefined |