Skip to main content

IDiamondCut

Asset Tokenization Studio Team

IDiamondCut

Interface for upgrading the Diamond proxy's Business Logic Resolver (BLR), configuration identifier, and version in a single or multi-step operation.

Methods​

getConfigInfo​

function getConfigInfo() external view returns (address resolver_, bytes8 proxyVersion_, bytes32 configurationId_, uint256 configurationVersion_, bool replacementEnabled_)

Returns the active resolver address, configuration identifier, and version.

Returns​

NameTypeDescription
resolver_addressAddress of the current Business Logic Resolver.
proxyVersion_bytes8proxy version.
configurationId_bytes32Identifier of the active configuration.
configurationVersion_uint256Version number of the active configuration.
replacementEnabled_boolWhether replacement is enabled.

getStaticFunctionSelectors​

function getStaticFunctionSelectors() external pure returns (bytes4[] staticFunctionSelectors_)

Gets all function selectors of a facet

Returns​

NameTypeDescription
staticFunctionSelectors_bytes4[]Face functions selectors

getStaticInterfaceIds​

function getStaticInterfaceIds() external pure returns (bytes4[] staticInterfaceIds_)

Gets all interfaces ids of a facet.

Returns​

NameTypeDescription
staticInterfaceIds_bytes4[]Face interface ids

getStaticResolverKey​

function getStaticResolverKey() external pure returns (bytes32 staticResolverKey_)

Gets the static resolver key

Returns​

NameTypeDescription
staticResolverKey_bytes32Static resolver key

updateConfig​

function updateConfig(bytes32 _newConfigurationId, uint256 _newVersion) external nonpayable

For the current BLR, update its configuration identifier and version.

Parameters​

NameTypeDescription
_newConfigurationIdbytes32The new configuration identifier to apply.
_newVersionuint256The version number associated with the new configuration.

updateConfigVersion​

function updateConfigVersion(uint256 _newVersion) external nonpayable

For the current BLR and configuration, update the used version.

Parameters​

NameTypeDescription
_newVersionuint256The new version number to set for the current configuration.

updateReplacementEnabled​

function updateReplacementEnabled(bool _newReplacementEnabled) external nonpayable

For the current BLR update its configuration

Parameters​

NameTypeDescription
_newReplacementEnabledboolThe replacement enabled flag to set*

updateResolver​

function updateResolver(contract IBusinessLogicResolver _newResolver, bytes32 _newConfigurationId, uint256 _newVersion, bool _newReplacementEnabled) external nonpayable

Replaces the Business Logic Resolver with a new one, setting configuration and version.

Parameters​

NameTypeDescription
_newResolvercontract IBusinessLogicResolverThe new BLR contract address to wire into the proxy.
_newConfigurationIdbytes32The configuration identifier to activate on the new resolver.
_newVersionuint256The version number associated with the new configuration.
_newReplacementEnabledboolThe replacement enabled flag to set.

Events​

ConfigUpdated​

event ConfigUpdated(address indexed caller, bytes32 oldConfigurationId, bytes32 newConfigurationId, uint256 oldConfigurationVersion, uint256 newConfigurationVersion)

Emitted when the active configuration identifier is replaced.

updateConfig() combines an id change and a version change in one call; both get a complete old/new pair here.

Parameters​

NameTypeDescription
caller indexedaddressAccount that performed the update.
oldConfigurationIdbytes32Previous configuration identifier.
newConfigurationIdbytes32New configuration identifier.
oldConfigurationVersionuint256Previous configuration version.
newConfigurationVersionuint256Version activated for the new configuration.

ConfigVersionUpdated​

event ConfigVersionUpdated(address indexed caller, uint256 oldConfigurationVersion, uint256 newConfigurationVersion)

Emitted when the pinned version of the active configuration is replaced.

Parameters​

NameTypeDescription
caller indexedaddressAccount that performed the update.
oldConfigurationVersionuint256Previous configuration version.
newConfigurationVersionuint256New configuration version.

ReplacementEnabledUpdated​

event ReplacementEnabledUpdated(address indexed caller, bool oldReplacementEnabled, bool newReplacementEnabled)

Emitted when the replacement-enabled flag is replaced.

Parameters​

NameTypeDescription
caller indexedaddressAccount that performed the update.
oldReplacementEnabledboolPrevious replacement-enabled flag.
newReplacementEnabledboolNew replacement-enabled flag.

ResolverUpdated​

event ResolverUpdated(address indexed caller, address oldResolver, address newResolver, bytes32 oldConfigurationId, bytes32 newConfigurationId, uint256 oldConfigurationVersion, uint256 newConfigurationVersion, bool oldReplacementEnabled, bool newReplacementEnabled)

Emitted when the resolver-proxy's Business Logic Resolver is replaced.

updateResolver() combines four changes in one call; every one of them gets a complete old/new pair here rather than only the fields that happen to differ.

Parameters​

NameTypeDescription
caller indexedaddressAccount that performed the update.
oldResolveraddressPrevious Business Logic Resolver address.
newResolveraddressNew Business Logic Resolver address.
oldConfigurationIdbytes32Previous configuration identifier.
newConfigurationIdbytes32Configuration identifier activated on the new resolver.
oldConfigurationVersionuint256Previous configuration version.
newConfigurationVersionuint256Configuration version activated on the new resolver.
oldReplacementEnabledboolPrevious replacement-enabled flag.
newReplacementEnabledboolReplacement-enabled flag activated on the new resolver.

Errors​

InvalidBusinessLogicResolver​

error InvalidBusinessLogicResolver(address invalidResolver)

Thrown when a candidate resolver is the zero address or fails the isBusinessLogicResolver() identity check.

Parameters​

NameTypeDescription
invalidResolveraddressThe address that failed validation.