Skip to main content

RatioPCVControllerV2

v2 includes methods for transferring approved ERC20 balances and wrapping and unwrapping WETH in transit

Functions

constructor

function constructor(
address _core
) public

PCV controller constructor

Parameters

NameTypeDescription
_coreaddressFei Core for reference

receive

function receive() external

withdrawRatio

function withdrawRatio(
contract IPCVDeposit pcvDeposit,
address to,
uint256 basisPoints
) public

withdraw tokens from the input PCV deposit in basis points terms

Parameters

NameTypeDescription
pcvDepositcontract IPCVDepositPCV deposit to withdraw from
toaddressthe address to send PCV to
basisPointsuint256ratio of PCV to withdraw in basis points terms (1/10000)

withdrawRatioUnwrapWETH

function withdrawRatioUnwrapWETH(
contract IPCVDeposit pcvDeposit,
address payable to,
uint256 basisPoints
) public

withdraw WETH from the input PCV deposit in basis points terms and send as ETH

Parameters

NameTypeDescription
pcvDepositcontract IPCVDepositPCV deposit to withdraw from
toaddress payablethe address to send PCV to
basisPointsuint256ratio of PCV to withdraw in basis points terms (1/10000)

withdrawRatioWrapETH

function withdrawRatioWrapETH(
contract IPCVDeposit pcvDeposit,
address to,
uint256 basisPoints
) public

withdraw ETH from the input PCV deposit in basis points terms and send as WETH

Parameters

NameTypeDescription
pcvDepositcontract IPCVDepositPCV deposit to withdraw from
toaddressthe address to send PCV to
basisPointsuint256ratio of PCV to withdraw in basis points terms (1/10000)

withdrawUnwrapWETH

function withdrawUnwrapWETH(
contract IPCVDeposit pcvDeposit,
address payable to,
uint256 amount
) public

withdraw WETH from the input PCV deposit and send as ETH

Parameters

NameTypeDescription
pcvDepositcontract IPCVDepositPCV deposit to withdraw from
toaddress payablethe address to send PCV to
amountuint256raw amount of PCV to withdraw

withdrawWrapETH

function withdrawWrapETH(
contract IPCVDeposit pcvDeposit,
address to,
uint256 amount
) public

withdraw ETH from the input PCV deposit and send as WETH

Parameters

NameTypeDescription
pcvDepositcontract IPCVDepositPCV deposit to withdraw from
toaddressthe address to send PCV to
amountuint256raw amount of PCV to withdraw

withdrawRatioERC20

function withdrawRatioERC20(
contract IPCVDeposit pcvDeposit,
address token,
address to,
uint256 basisPoints
) public

withdraw a specific ERC20 token from the input PCV deposit in basis points terms

Parameters

NameTypeDescription
pcvDepositcontract IPCVDepositPCV deposit to withdraw from
tokenaddressthe ERC20 token to withdraw
toaddressthe address to send tokens to
basisPointsuint256ratio of PCV to withdraw in basis points terms (1/10000)

transferFromRatio

function transferFromRatio(
address from,
contract IERC20 token,
address to,
uint256 basisPoints
) public

transfer a specific ERC20 token from the input PCV deposit in basis points terms

Parameters

NameTypeDescription
fromaddressaddress to withdraw from
tokencontract IERC20the ERC20 token to withdraw
toaddressthe address to send tokens to
basisPointsuint256ratio of PCV to withdraw in basis points terms (1/10000)

transferFrom

function transferFrom(
address from,
contract IERC20 token,
address to,
uint256 amount
) public

transfer a specific ERC20 token from the input PCV deposit

Parameters

NameTypeDescription
fromaddressaddress to withdraw from
tokencontract IERC20the ERC20 token to withdraw
toaddressthe address to send tokens to
amountuint256of tokens to transfer

transferETHAsWETH

function transferETHAsWETH(
address to
) public

send ETH as WETH

Parameters

NameTypeDescription
toaddressdestination

transferWETHAsETH

function transferWETHAsETH(
address payable to
) public

send WETH as ETH

Parameters

NameTypeDescription
toaddress payabledestination

transferERC20

function transferERC20(
contract IERC20 token,
address to
) public

send away ERC20 held on this contract, to avoid having any stuck.

Parameters

NameTypeDescription
tokencontract IERC20sent
toaddressdestination

_withdrawRatio

function _withdrawRatio(
contract IPCVDeposit pcvDeposit,
address to,
uint256 basisPoints
) internal returns (uint256)

Parameters

NameTypeDescription
pcvDepositcontract IPCVDeposit
toaddress
basisPointsuint256

_transferETHAsWETH

function _transferETHAsWETH(
address to,
uint256 amount
) internal

Parameters

NameTypeDescription
toaddress
amountuint256

_transferWETHAsETH

function _transferWETHAsETH(
address payable to,
uint256 amount
) internal

Parameters

NameTypeDescription
toaddress payable
amountuint256