⬅️ Contracts

Core

Source of truth for Fei Protocol

Author: Fei Protocol

maintains roles, access control, fei, tribe, genesisGroup, and the TRIBE treasury

Mainnet implementations

Name Address
core 0x8d5ED43dCa8C2F7dFB20CF7b53CC7E593635d7b9

CollateralizationOracleGuardian, Fei, BalancerLBPSwapper, OwnableTimedMinter, PCVEquityMinter, PCVGuardian, RatioPCVControllerV2, Tribe, TribeMinter, FeiDAOTimelock, OptimisticTimelock, PCVDripController, BAMMDeposit, PriceBoundPSM, MintRedeemPausePSM, FeiSkimmer, TribeReserveStabilizer, AavePCVDeposit, AngleUniswapPCVDeposit, BalancerPCVDepositWeightedPool, ERC20CompoundPCVDeposit, EthCompoundPCVDeposit, ConvexPCVDeposit, CurvePCVDepositPlainPool, UniswapPCVDeposit, EthLidoPCVDeposit, EthTokemakPCVDeposit, SnapshotDelegatorPCVDeposit, ERC20TokemakPCVDeposit, CollateralizationOracle, CollateralizationOracleWrapper, NamedStaticPCVDepositWrapper, CompositeOracle, ChainlinkOracleWrapper, ConstantOracle, CollateralizationOracleKeeper, AutoRewardsDistributor, ERC20Dripper, TribalChief, FuseAdmin, FuseGuardian, RestrictedPermissions

Events

FeiUpdate

event FeiUpdate(address)
Params
Param Type Notes
_fei address indexed

GenesisGroupUpdate

event GenesisGroupUpdate(address)
Params
Param Type Notes
_genesisGroup address indexed

GenesisPeriodComplete

event GenesisPeriodComplete(uint256)
Params
Param Type Notes
_timestamp uint256

RoleAdminChanged

event RoleAdminChanged(bytes32,bytes32,bytes32)
Params
Param Type Notes
role bytes32 indexed
previousAdminRole bytes32 indexed
newAdminRole bytes32 indexed

RoleGranted

event RoleGranted(bytes32,address,address)
Params
Param Type Notes
role bytes32 indexed
account address indexed
sender address indexed

RoleRevoked

event RoleRevoked(bytes32,address,address)
Params
Param Type Notes
role bytes32 indexed
account address indexed
sender address indexed

TribeAllocation

event TribeAllocation(address,uint256)
Params
Param Type Notes
_to address indexed
_amount uint256

TribeUpdate

event TribeUpdate(address)
Params
Param Type Notes
_tribe address indexed

Methods

BURNER_ROLE

function BURNER_ROLE() view returns(bytes32)
Returns
Param Type Notes
bytes32

DEFAULT_ADMIN_ROLE

function DEFAULT_ADMIN_ROLE() view returns(bytes32)
Returns
Param Type Notes
bytes32

GOVERN_ROLE

function GOVERN_ROLE() view returns(bytes32)
Returns
Param Type Notes
bytes32

GUARDIAN_ROLE

function GUARDIAN_ROLE() view returns(bytes32)
Returns
Param Type Notes
bytes32

MINTER_ROLE

function MINTER_ROLE() view returns(bytes32)
Returns
Param Type Notes
bytes32

PCV_CONTROLLER_ROLE

function PCV_CONTROLLER_ROLE() view returns(bytes32)
Returns
Param Type Notes
bytes32

allocateTribe

function allocateTribe(address,uint256) nonpayable

sends TRIBE tokens from treasury to an address

Params
Param Type Notes
to address the address to send TRIBE to
amount uint256 the amount of TRIBE to send

createRole

function createRole(bytes32,bytes32) nonpayable

creates a new role to be maintained

can also be used to update admin of existing role

Params
Param Type Notes
role bytes32 the new role id
adminRole bytes32 the admin role id for role

fei

function fei() view returns(address)

the address of the FEI contract

Returns
Param Type Notes
address

getRoleAdmin

function getRoleAdmin(bytes32) view returns(bytes32)

Returns the admin role that controls role. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.

Params
Param Type Notes
role bytes32
Returns
Param Type Notes
bytes32

getRoleMember

function getRoleMember(bytes32,uint256) view returns(address)

Returns one of the accounts that have role. index must be a value between 0 and {getRoleMemberCount}, non-inclusive. Role bearers are not sorted in any particular way, and their ordering may change at any point. WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure you perform all queries on the same block. See the following https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] for more information.

Params
Param Type Notes
role bytes32
index uint256
Returns
Param Type Notes
address

getRoleMemberCount

function getRoleMemberCount(bytes32) view returns(uint256)

Returns the number of accounts that have role. Can be used together with {getRoleMember} to enumerate all bearers of a role.

Params
Param Type Notes
role bytes32
Returns
Param Type Notes
uint256

grantBurner

function grantBurner(address) nonpayable

grants burner role to address

Params
Param Type Notes
burner address new burner

grantGovernor

function grantGovernor(address) nonpayable

grants governor role to address

Params
Param Type Notes
governor address new governor

grantGuardian

function grantGuardian(address) nonpayable

grants guardian role to address

Params
Param Type Notes
guardian address new guardian

grantMinter

function grantMinter(address) nonpayable

grants minter role to address

Params
Param Type Notes
minter address new minter

grantPCVController

function grantPCVController(address) nonpayable

grants controller role to address

Params
Param Type Notes
pcvController address new controller

grantRole

function grantRole(bytes32,address) nonpayable

Grants role to account. If account had not been already granted role, emits a {RoleGranted} event. Requirements: - the caller must have role's admin role.

Params
Param Type Notes
role bytes32
account address

hasRole

function hasRole(bytes32,address) view returns(bool)

Returns true if account has been granted role.

Params
Param Type Notes
role bytes32
account address
Returns
Param Type Notes
bool

init

function init() nonpayable

isBurner

function isBurner(address) view returns(bool)

checks if address is a burner

Params
Param Type Notes
_address address address to check
Returns
Param Type Notes
bool true _address is a burner

isGovernor

function isGovernor(address) view returns(bool)

checks if address is a governor

Params
Param Type Notes
_address address address to check
Returns
Param Type Notes
bool true _address is a governor

isGuardian

function isGuardian(address) view returns(bool)

checks if address is a guardian

Params
Param Type Notes
_address address address to check
Returns
Param Type Notes
bool true _address is a guardian

isMinter

function isMinter(address) view returns(bool)

checks if address is a minter

Params
Param Type Notes
_address address address to check
Returns
Param Type Notes
bool true _address is a minter

isPCVController

function isPCVController(address) view returns(bool)

checks if address is a controller

Params
Param Type Notes
_address address address to check
Returns
Param Type Notes
bool true _address is a controller

renounceRole

function renounceRole(bytes32,address) nonpayable

Revokes role from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked role, emits a {RoleRevoked} event. Requirements: - the caller must be account.

Params
Param Type Notes
role bytes32
account address

revokeBurner

function revokeBurner(address) nonpayable

revokes burner role from address

Params
Param Type Notes
burner address ex burner

revokeGovernor

function revokeGovernor(address) nonpayable

revokes governor role from address

Params
Param Type Notes
governor address ex governor

revokeGuardian

function revokeGuardian(address) nonpayable

revokes guardian role from address

Params
Param Type Notes
guardian address ex guardian

revokeMinter

function revokeMinter(address) nonpayable

revokes minter role from address

Params
Param Type Notes
minter address ex minter

revokeOverride

function revokeOverride(bytes32,address) nonpayable

revokes a role from address

Params
Param Type Notes
role bytes32 the role to revoke
account address the address to revoke the role from

revokePCVController

function revokePCVController(address) nonpayable

revokes pcvController role from address

Params
Param Type Notes
pcvController address ex pcvController

revokeRole

function revokeRole(bytes32,address) nonpayable

Revokes role from account. If account had been granted role, emits a {RoleRevoked} event. Requirements: - the caller must have role's admin role.

Params
Param Type Notes
role bytes32
account address

setFei

function setFei(address) nonpayable

sets Fei address to a new address

Params
Param Type Notes
token address new fei address

setTribe

function setTribe(address) nonpayable

sets Tribe address to a new address

Params
Param Type Notes
token address new tribe address

supportsInterface

function supportsInterface(bytes4) view returns(bool)

See {IERC165-supportsInterface}.

Params
Param Type Notes
interfaceId bytes4
Returns
Param Type Notes
bool

tribe

function tribe() view returns(address)

the address of the TRIBE contract

Returns
Param Type Notes
address

⬅️ Contracts