Skip to main content

NamedStaticPCVDepositWrapper

a contract to report static PCV data to cover PCV not held with a reliable oracle or on-chain reading @author Fei Protocol

Returns PCV in USD terms

Functions

constructor

function constructor(
address _core,
struct NamedStaticPCVDepositWrapper.DepositInfo[] newPCVDeposits
) public

Parameters

NameTypeDescription
_coreaddress
newPCVDepositsstruct NamedStaticPCVDepositWrapper.DepositInfo[]

_addDeposit

function _addDeposit(
struct NamedStaticPCVDepositWrapper.DepositInfo newPCVDeposit
) internal

helper method to add a PCV deposit

Parameters

NameTypeDescription
newPCVDepositstruct NamedStaticPCVDepositWrapper.DepositInfo

_editDeposit

function _editDeposit(
uint256 index,
string depositName,
uint256 usdAmount,
uint256 feiAmount,
uint256 underlyingTokenAmount,
address underlyingToken
) internal

helper method to edit a PCV deposit

Parameters

NameTypeDescription
indexuint256
depositNamestring
usdAmountuint256
feiAmountuint256
underlyingTokenAmountuint256
underlyingTokenaddress

_removeDeposit

function _removeDeposit(
uint256 index
) internal

helper method to delete a PCV deposit

Parameters

NameTypeDescription
indexuint256

addDeposit

function addDeposit(
struct NamedStaticPCVDepositWrapper.DepositInfo newPCVDeposit
) external

function to add a deposit

Parameters

NameTypeDescription
newPCVDepositstruct NamedStaticPCVDepositWrapper.DepositInfo

bulkAddDeposits

function bulkAddDeposits(
struct NamedStaticPCVDepositWrapper.DepositInfo[] newPCVDeposits
) external

function to bulk add deposits

Parameters

NameTypeDescription
newPCVDepositsstruct NamedStaticPCVDepositWrapper.DepositInfo[]

removeDeposit

function removeDeposit(
uint256 index
) external

function to remove a PCV Deposit

Parameters

NameTypeDescription
indexuint256

editDeposit

function editDeposit(
uint256 index,
uint256 usdAmount,
uint256 feiAmount,
uint256 underlyingTokenAmount,
string depositName,
address underlying
) external

function to edit an existing deposit

Parameters

NameTypeDescription
indexuint256
usdAmountuint256
feiAmountuint256
underlyingTokenAmountuint256
depositNamestring
underlyingaddress

numDeposits

function numDeposits() public returns (uint256)

returns the current number of PCV deposits

resistantBalanceAndFei

function resistantBalanceAndFei() public returns (uint256, uint256)

returns the resistant balance and FEI in the deposit

balanceReportedIn

function balanceReportedIn() public returns (address)

display the related token of the balance reported

getAllUnderlying

function getAllUnderlying() public returns (address[])

function to return all of the different tokens deposited into this contract

Events

BalanceUpdate

event BalanceUpdate(
uint256 oldBalance,
uint256 newBalance,
uint256 oldFEIBalance,
uint256 newFEIBalance
)

event to update fei and usd balance

Parameters

NameTypeDescription
oldBalanceuint256
newBalanceuint256
oldFEIBalanceuint256
newFEIBalanceuint256

DepositRemoved

event DepositRemoved(
uint256 index
)

event to remove a deposit

Parameters

NameTypeDescription
indexuint256

DepositAdded

event DepositAdded(
uint256 index,
string depositName
)

event to add a new deposit

Parameters

NameTypeDescription
indexuint256
depositNamestring

DepositChanged

event DepositChanged(
uint256 index,
string depositName
)

event emitted when a deposit is edited

Parameters

NameTypeDescription
indexuint256
depositNamestring