⬅️ Contracts
Fei Protocol's Collateralization Oracle Guardian
Author: Fei Protocol This contract needs to be granted the ORACLE_ADMIN role The guardian can leverage this contract to make small bounded changes to CR This is intended to be used only in emergencies when the base CollateralizationOracle is compromised The guardian should be able to approximate manual changes to CR via this contract without retaining too much power
Mainnet implementations
Core, CollateralizationOracleWrapper
Events
ContractAdminRoleUpdate
event ContractAdminRoleUpdate(bytes32,bytes32)
Params
| Param |
Type |
Notes |
| oldContractAdminRole |
bytes32 indexed |
|
| newContractAdminRole |
bytes32 indexed |
|
CoreUpdate
event CoreUpdate(address,address)
Params
| Param |
Type |
Notes |
| oldCore |
address indexed |
|
| newCore |
address indexed |
|
DeviationThresholdUpdate
event DeviationThresholdUpdate(uint256,uint256)
Params
| Param |
Type |
Notes |
| oldDeviationThresholdBasisPoints |
uint256 |
|
| newDeviationThresholdBasisPoints |
uint256 |
|
DurationUpdate
event DurationUpdate(uint256,uint256)
Params
| Param |
Type |
Notes |
| oldDuration |
uint256 |
|
| newDuration |
uint256 |
|
Paused
event Paused(address)
Params
| Param |
Type |
Notes |
| account |
address |
|
TimerReset
event TimerReset(uint256)
Params
| Param |
Type |
Notes |
| startTime |
uint256 |
|
Unpaused
event Unpaused(address)
Params
| Param |
Type |
Notes |
| account |
address |
|
Methods
CONTRACT_ADMIN_ROLE
function CONTRACT_ADMIN_ROLE() view returns(bytes32)
a role used with a subset of governor permissions for this contract only
Returns
calculateDeviationThresholdBasisPoints
function calculateDeviationThresholdBasisPoints(uint256,uint256) pure returns(uint256)
return the percent deviation between a and b in basis points terms
Params
| Param |
Type |
Notes |
| a |
uint256 |
|
| b |
uint256 |
|
Returns
core
function core() view returns(address)
address of the Core contract referenced
Returns
| Param |
Type |
Notes |
|
address |
ICore implementation address |
deviationThresholdBasisPoints
function deviationThresholdBasisPoints() view returns(uint256)
the maximum update size relative to current, measured in basis points (1/10000)
Returns
duration
function duration() view returns(uint256)
the duration of the timed period
Returns
fei
function fei() view returns(address)
address of the Fei contract referenced by Core
Returns
| Param |
Type |
Notes |
|
address |
IFei implementation address |
feiBalance
function feiBalance() view returns(uint256)
fei balance of contract
Returns
| Param |
Type |
Notes |
|
uint256 |
fei amount held |
isContractAdmin
function isContractAdmin(address) view returns(bool)
returns whether a given address has the admin role for this contract
Params
| Param |
Type |
Notes |
| _admin |
address |
|
Returns
isTimeEnded
function isTimeEnded() view returns(bool)
return true if time period has ended
Returns
isTimeStarted
function isTimeStarted() view returns(bool)
Returns
oracleWrapper
function oracleWrapper() view returns(address)
the oracle wrapper to update
Returns
pause
function pause() nonpayable
set pausable methods to paused
paused
function paused() view returns(bool)
Returns true if the contract is paused, and false otherwise.
Returns
remainingTime
function remainingTime() view returns(uint256)
number of seconds remaining until time is up
Returns
| Param |
Type |
Notes |
|
uint256 |
remaining |
setCache
function setCache(uint256,uint256) nonpayable
guardian set the cache values on collateralization oracle
make sure to pause the CR oracle wrapper or else the set value would be overwritten on next update
Params
| Param |
Type |
Notes |
| protocolControlledValue |
uint256 |
new PCV value |
| userCirculatingFei |
uint256 |
new user FEI value |
setContractAdminRole
function setContractAdminRole(bytes32) nonpayable
sets a new admin role for this contract
Params
| Param |
Type |
Notes |
| newContractAdminRole |
bytes32 |
|
setCore
function setCore(address) nonpayable
set new Core reference address
Params
| Param |
Type |
Notes |
| newCore |
address |
the new core address |
setDeviationThresholdBasisPoints
function setDeviationThresholdBasisPoints(uint256) nonpayable
governance setter for maximum deviation the guardian can change per update
Params
| Param |
Type |
Notes |
| newDeviationThresholdBasisPoints |
uint256 |
|
startTime
function startTime() view returns(uint256)
the start timestamp of the timed period
Returns
timeSinceStart
function timeSinceStart() view returns(uint256)
number of seconds since contract was initialized
will be less than or equal to duration
Returns
| Param |
Type |
Notes |
|
uint256 |
timestamp |
tribe
function tribe() view returns(address)
address of the Tribe contract referenced by Core
Returns
| Param |
Type |
Notes |
|
address |
IERC20 implementation address |
tribeBalance
function tribeBalance() view returns(uint256)
tribe balance of contract
Returns
| Param |
Type |
Notes |
|
uint256 |
tribe amount held |
unpause
function unpause() nonpayable
set pausable methods to unpaused
⬅️ Contracts