Skip to main content

PCVSplitter

Functions

constructor

function constructor(
address[] _pcvDeposits,
uint256[] _ratios
) internal

PCVSplitter constructor

Parameters

NameTypeDescription
_pcvDepositsaddress[]list of PCV Deposits to split to
_ratiosuint256[]ratios for splitting PCV Deposit allocations

checkAllocation

function checkAllocation(
address[] _pcvDeposits,
uint256[] _ratios
) public

make sure an allocation has matching lengths and totals the ALLOCATION_GRANULARITY

Parameters

NameTypeDescription
_pcvDepositsaddress[]new list of pcv deposits to send to
_ratiosuint256[]new ratios corresponding to the PCV deposits

getAllocation

function getAllocation() public returns (address[], uint256[])

gets the pcvDeposits and ratios of the splitter

setAllocation

function setAllocation(
address[] _allocations,
uint256[] _ratios
) external

sets the allocation of held PCV

Parameters

NameTypeDescription
_allocationsaddress[]
_ratiosuint256[]

_allocateSingle

function _allocateSingle(
uint256 amount,
address pcvDeposit
) internal

distribute funds to single PCV deposit

Parameters

NameTypeDescription
amountuint256amount of funds to send
pcvDepositaddressthe pcv deposit to send funds

_setAllocation

function _setAllocation(
address[] _pcvDeposits,
uint256[] _ratios
) internal

sets a new allocation for the splitter

Parameters

NameTypeDescription
_pcvDepositsaddress[]new list of pcv deposits to send to
_ratiosuint256[]new ratios corresponding to the PCV deposits. Must total ALLOCATION_GRANULARITY

_allocate

function _allocate(
uint256 total
) internal

distribute funds to all pcv deposits at specified allocation ratios

Parameters

NameTypeDescription
totaluint256amount of funds to send

Events

AllocationUpdate

event AllocationUpdate(
address[] oldPCVDeposits,
uint256[] oldRatios,
address[] newPCVDeposits,
uint256[] newRatios
)

Parameters

NameTypeDescription
oldPCVDepositsaddress[]
oldRatiosuint256[]
newPCVDepositsaddress[]
newRatiosuint256[]

Allocate

event Allocate(
address caller,
uint256 amount
)

Parameters

NameTypeDescription
calleraddress
amountuint256