Skip to main content

CoreFacet

Asset Tokenization Studio Team

CoreFacet

Diamond facet for the Core domain. Registers the 8 selectors that define the base identity of the token (ERC20 metadata readers, ERC3643 name/symbol setters and version).

Methods​

decimals​

function decimals() external view returns (uint8)

Returns the decimals simulating non-triggered decimal adjustments up until current timestamp.

Returns​

NameTypeDescription
_0uint8The number of decimals used for token amounts.

getERC20Metadata​

function getERC20Metadata() external view returns (struct ICore.ERC20Metadata)

Returns the full metadata struct of the security token.

Returns​

NameTypeDescription
_0ICore.ERC20MetadataThe persisted ERC20Metadata.

getStaticFunctionSelectors​

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

Gets all function selectors of a facet

Returns​

NameTypeDescription
_0bytes4[]Face functions selectors

getStaticInterfaceIds​

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

Gets all interfaces ids of a facet.

Returns​

NameTypeDescription
_0bytes4[]Face interface ids

getStaticResolverKey​

function getStaticResolverKey() external pure returns (bytes32 staticResolverKey_)

Gets the static resolver key

Returns​

NameTypeDescription
staticResolverKey_bytes32Static resolver key

initializeCore​

function initializeCore(ICore.ERC20Metadata metadata) external nonpayable

Parameters​

NameTypeDescription
metadataICore.ERC20Metadataundefined

name​

function name() external view returns (string)

Returns the name of the security token.

Returns​

NameTypeDescription
_0stringThe token name string.

setName​

function setName(string _name) external nonpayable

Updates the token name. Restricted to the TREX owner role.

Parameters​

NameTypeDescription
_namestringNew name to assign to the token.

setSymbol​

function setSymbol(string _symbol) external nonpayable

Updates the token symbol. Restricted to the TREX owner role.

Parameters​

NameTypeDescription
_symbolstringNew symbol to assign to the token.

symbol​

function symbol() external view returns (string)

Returns the symbol of the security token.

Returns​

NameTypeDescription
_0stringThe token symbol string.

version​

function version() external view returns (string)

Returns the ERC3643 version string of the token.

Returns​

NameTypeDescription
_0stringThe version string (e.g. "4.0.0").

Events​

CoreInitialized​

event CoreInitialized(ICore.ERC20Metadata metadata)

Emitted once when the core ERC-20 metadata is initialised on a token.

Fires exclusively from initializeCore after the storage write succeeds.

Parameters​

NameTypeDescription
metadataICore.ERC20MetadataThe ERC-20 metadata persisted at initialisation.

UpdatedTokenInformation​

event UpdatedTokenInformation(string indexed newName, string indexed newSymbol, uint8 newDecimals, string newVersion, address indexed newOnchainID)

Emitted when core token metadata is updated.

Parameters​

NameTypeDescription
newName indexedstringNew token name.
newSymbol indexedstringNew token symbol.
newDecimalsuint8New decimal precision.
newVersionstringNew token version string.
newOnchainID indexedaddressNew onchainID address associated with the token.

Errors​

AccountHasNoRole​

error AccountHasNoRole(address account, bytes32 role)

Thrown when an account does not hold a required role.

Parameters​

NameTypeDescription
accountaddressThe account that lacks the role.
rolebytes32The role that is not held.

AssetNotOperational​

error AssetNotOperational(bytes32 configId, uint256 versionId)

Raised by InitializerStorageWrapper.checkOperational (and the related isConfigVersionOperational helper) when an operation is attempted on a configuration version that has not yet been marked operational.

Parameters​

NameTypeDescription
configIdbytes32Resolver-proxy configuration whose operational status was checked.
versionIduint256Configuration version whose operational status was checked.

Deactivated​

error Deactivated()

Thrown when an operation guarded by onlyActivated is attempted on a token whose deactivation flag has already been set.

FacetAlreadyRegistered​

error FacetAlreadyRegistered(bytes32 facetId, uint256 lastVersion)

Raised when an initialiser tries to register a facet that already has a non-zero last registered version (i.e. the facet is being re-initialised on a fresh install).

Parameters​

NameTypeDescription
facetIdbytes32Identifier of the offending facet.
lastVersionuint256Last version recorded for that facet at the time of the check.

IsPaused​

error IsPaused()

Thrown when an operation that requires the token to be unpaused is attempted while the token is paused (own flag or any external pause contract).

UnrecognizedResolverProxyVersion​

error UnrecognizedResolverProxyVersion(bytes8 _resolverProxyVersion)

Thrown when the provided proxy version does not match any BLR compatible standard.

Parameters​

NameTypeDescription
_resolverProxyVersionbytes8proxy version that is not compatible with the BLR.

WalletRecovered​

error WalletRecovered()

Thrown when attempting to recover a wallet that has already been recovered.