šŸŽ‰ Welcome to PartyFinance documentation!
Protocol
Contracts
facets
VersionFacet

VersionFacet

Facet that handles the unsupervised upgrades of Party's facets

VersionDiamondCut

event VersionDiamondCut(struct IDiamondCut.FacetCut[] _diamondCut, address updater)

getRequiredState

function getRequiredState() internal view returns (address feeCollector, uint256 fee, address sentinel)

Retrieves the platform required state from the PartyFactory

checkEnsureState

function checkEnsureState() external view returns (bool areEqual)

Checks if the Party has the platform required state up-to-date

Verifies the Party platform variables against the PartyFactory

Return Values

NameTypeDescription
areEqualboolWhether if the Party's Platform state is up-to-date

ensureState

function ensureState() external

Ensures that the Party platform variables are the same as the PartyFactory

This will change the Platform Fee collector, Platform Fee and Platform Sentinel on the Party if needed

getRequiredCut

function getRequiredCut() internal view returns (struct IDiamondCut.FacetCut[] requiredCut)

Retrieves the required cut established in the PartyFactory

It excludes the DiamondCutFacet, since its handled after so that its always included as a required facet.

checkEnsureVersion

function checkEnsureVersion() external view returns (bool areEqual, struct IDiamondLoupe.Facet[] currentFacets, struct IDiamondCut.FacetCut[] modelDiamondCut)

Checks if the Party need an upgrade (diamondCut)

Return Values

NameTypeDescription
areEqualboolIf Party's facets are equal with required by the PartyFactory
currentFacetsstruct IDiamondLoupe.Facet[]Current Party's facets
modelDiamondCutstruct IDiamondCut.FacetCut[]Required DiamondCut by the PartyFactory

ensureDiamond

function ensureDiamond() external

Clones the functions from a Diamond model and overwrites the current Diamond functions

Calling this function will guarantee that the function selectors are the same as the Diamond implementation