Skip to main content

PCVGuardian

PCV Guardian is a contract to safeguard protocol funds by being able to withdraw whitelisted PCV deposits to an immutable safe address

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

NameTypeDescription
_0bytes32undefined

addWhitelistAddress

function addWhitelistAddress(address pcvDeposit) external nonpayable

governor-only method to whitelist a pcvDeposit address to withdraw funds from

Parameters

NameTypeDescription
pcvDepositaddressthe address to whitelist

addWhitelistAddresses

function addWhitelistAddresses(address[] _whitelistAddresses) external nonpayable

batch version of addWhiteListaddress

Parameters

NameTypeDescription
_whitelistAddressesaddress[]the addresses to whitelist, as calldata

core

function core() external view returns (contract ICore)

address of the Core contract referenced

Returns

NameTypeDescription
_0contract ICoreICore implementation address

getWhitelistAddresses

function getWhitelistAddresses() external view returns (address[])

returns all whitelisted pcvDeposit addresses

Returns

NameTypeDescription
_0address[]undefined

isContractAdmin

function isContractAdmin(address _admin) external view returns (bool)

returns whether a given address has the admin role for this contract

Parameters

NameTypeDescription
_adminaddressundefined

Returns

NameTypeDescription
_0boolundefined

isWhitelistAddress

function isWhitelistAddress(address pcvDeposit) external view returns (bool)

returns true if the the provided address is a valid destination to withdraw funds from

Parameters

NameTypeDescription
pcvDepositaddressthe pcvDeposit address to check if whitelisted

Returns

NameTypeDescription
_0boolundefined

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

NameTypeDescription
_0boolundefined

removeWhitelistAddress

function removeWhitelistAddress(address pcvDeposit) external nonpayable

governor-or-guardian-only method to remove pcvDeposit address from the whitelist to withdraw funds from

Parameters

NameTypeDescription
pcvDepositaddressthe address to remove from whitelist

removeWhitelistAddresses

function removeWhitelistAddresses(address[] _whitelistAddresses) external nonpayable

batch version of removeWhitelistAddress

Parameters

NameTypeDescription
_whitelistAddressesaddress[]the addresses to remove from whitelist

safeAddress

function safeAddress() external view returns (address)

safe address where PCV funds can be withdrawn to

Returns

NameTypeDescription
_0addressundefined

setContractAdminRole

function setContractAdminRole(bytes32 newContractAdminRole) external nonpayable

sets a new admin role for this contract

Parameters

NameTypeDescription
newContractAdminRolebytes32undefined

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

NameTypeDescription
_0contract IERC20IERC20 implementation address

vconBalance

function vconBalance() external view returns (uint256)

vcon balance of contract

Returns

NameTypeDescription
_0uint256vcon amount held

volt

function volt() external view returns (contract IVolt)

address of the Fei contract referenced by Core

Returns

NameTypeDescription
_0contract IVoltIFei implementation address

voltBalance

function voltBalance() external view returns (uint256)

volt balance of contract

Returns

NameTypeDescription
_0uint256volt amount held

withdrawAllERC20ToSafeAddress

function withdrawAllERC20ToSafeAddress(address pcvDeposit, address token) external nonpayable

governor-or-guardian-or-pcv-guard method to withdraw all of an ERC20 balance from a pcv deposit, by calling the withdrawERC20() method on it

Parameters

NameTypeDescription
pcvDepositaddressthe deposit to pull funds from
tokenaddressthe address of the token to withdraw

withdrawAllToSafeAddress

function withdrawAllToSafeAddress(address pcvDeposit) external nonpayable

governor-or-guardian-or-pcv-guard method to withdraw all at once funds from a pcv deposit, by calling the withdraw() method on it

Parameters

NameTypeDescription
pcvDepositaddressthe address of the pcv deposit contract

withdrawERC20ToSafeAddress

function withdrawERC20ToSafeAddress(address pcvDeposit, address token, uint256 amount) external nonpayable

governor-or-guardian-or-pcv-guard method to withdraw an ERC20 from a pcv deposit, by calling the withdrawERC20() method on it

Parameters

NameTypeDescription
pcvDepositaddressthe deposit to pull funds from
tokenaddressthe address of the token to withdraw
amountuint256the amount of funds to withdraw

withdrawToSafeAddress

function withdrawToSafeAddress(address pcvDeposit, uint256 amount) external nonpayable

governor-or-guardian-or-pcv-guard method to withdraw funds from a pcv deposit, by calling the withdraw() method on it

Parameters

NameTypeDescription
pcvDepositaddressthe address of the pcv deposit contract
amountuint256the amount to withdraw

Events

ContractAdminRoleUpdate

event ContractAdminRoleUpdate(bytes32 indexed oldContractAdminRole, bytes32 indexed newContractAdminRole)

Parameters

NameTypeDescription
oldContractAdminRole indexedbytes32undefined
newContractAdminRole indexedbytes32undefined

CoreUpdate

event CoreUpdate(address indexed oldCore, address indexed newCore)

Parameters

NameTypeDescription
oldCore indexedaddressundefined
newCore indexedaddressundefined

PCVGuardianERC20Withdrawal

event PCVGuardianERC20Withdrawal(address indexed pcvDeposit, address indexed token, uint256 amount)

Parameters

NameTypeDescription
pcvDeposit indexedaddressundefined
token indexedaddressundefined
amountuint256undefined

PCVGuardianWithdrawal

event PCVGuardianWithdrawal(address indexed pcvDeposit, uint256 amount)

Parameters

NameTypeDescription
pcvDeposit indexedaddressundefined
amountuint256undefined

Paused

event Paused(address account)

Parameters

NameTypeDescription
accountaddressundefined

Unpaused

event Unpaused(address account)

Parameters

NameTypeDescription
accountaddressundefined

WhitelistAddressAdded

event WhitelistAddressAdded(address indexed pcvDeposit)

Parameters

NameTypeDescription
pcvDeposit indexedaddressundefined

WhitelistAddressRemoved

event WhitelistAddressRemoved(address indexed pcvDeposit)

Parameters

NameTypeDescription
pcvDeposit indexedaddressundefined