FEI (Fei USD)

The Fei USD stablecoin

Contract

Fei.sol implements IFei.sol, CoreRef, ERC20Burnable

Description

FEI is a regular ERC-20 token, based on the OpenZeppelin ERC-20Burnable code with the following modifications:

Minting and burning to any address are uncapped and accessible by any address with the Minter💰and Burner🔥 role, respectively.

At each transfer (or transferFrom) the following addresses are checked for a mapped incentive contract:

  • FEI sender

  • FEI receiver

  • FEI operator (msg.sender) - commonly the same as the sender unless using transferFrom with an approved contract

  • the zero address - represens an incentive to be applied on ALL transfers

If an incentive contract is found, it is called with all of the transfer parameters. Any incentive is applied after the token balances update from the transfer.

Events

Minting
Burning
IncentiveContractUpdate
Minting

Minting FEI to an address

type

param

description

address indexed

_to

The recipient of the minted FEI

address indexed

_minter

The contract that minted the FEI

uint256

_amount

The amount of FEI minted

Burning

Burning FEI from an address

type

param

description

address indexed

_to

The target of the burned FEI

address indexed

_burner

The contract that burned the FEI

uint256

_amount

The amount of FEI minted

IncentiveContractUpdate

setting or unsetting an incentive contract for an incentivized address

type

param

description

address indexed

_incentivized

The incentivized address

address indexed

_incentiveContract

The new incentive contract. address(0) to unset

Read-Only Functions

incentiveContract

function incentiveContract(address account) external view returns (address);

returns the mapped incentive contract if account is an incentivized address, otherwise returns the 0 address.

if the 0 address has a mapped incentive contract, then this incentive contract is called for every single FEI transfer.

Burner-Only🔥 State-Changing Functions

burnFrom

function burnFrom(address account, uint256 amount) external;

Burns amount FEI from account. Reverts if the FEI balance of account is less than amount

emits Burning

Minter-Only💰 State-Changing Functions

mint

function mint(address account, uint256 amount) external;

Mints amount FEI to account

emits Minting

Governor-Only⚖️ State-Changing Functions

setIncentiveContract

function setIncentiveContract(address account, address incentive) external;

Sets the incentive contract incentive for account. If incentive is the 0 address this functions as an unset.

emits IncentiveContractUpdate

Public State-Changing Functions

burn

function burn(uint256 amount) external;

Burns amount FEI from msg.sender. Reverts if the FEI balance of msg.sender is less than amount

emits Burning

permit

function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;

Sets the allowance for a spender for value FEI from owner via signature. Reverts if called after deadline

ABIs