IROJIContractRegistryFacet

IROJIContractRegistryFacet

This is a facet that is added to the ROJIVerseDiamond contract. The events are emitted by the diamond. The purpose of this facet is to provide a registry for contracts that are created on the ROJI platform, either as proxies or as diamonds directly.

NotAContract

error NotAContract(address adr)

Error emitted when an address passed as a parameter is not a contract.

ContractRegistryContractRegistered

event ContractRegistryContractRegistered(address proxyOrContract, address baseContract, address creator, uint256 data)

Emitted when a new contract has been created and added to the registry

Parameters

Name
Type
Description

proxyOrContract

address

Address of the added proxy or contract.

baseContract

address

If proxyOrContract is a proxy, this is the address of the base contract. Otherwise, it must be identical to proxyOrContract.

creator

address

Address of the creator of the proxy.

data

uint256

Data identifying the contract. This is for future use.

contractRegistryRegisterContract

function contractRegistryRegisterContract(address proxyOrContract, address baseContract, address creator, uint256 data) external

Registers a contract. This is called by the proxy factories or manually on the platform for contracts that are non proxies.

Parameters

Name
Type
Description

proxyOrContract

address

Address of the added proxy or contract.

baseContract

address

If proxyOrContract is a proxy, this is the address of the base contract. Otherwise, it must be identical to proxyOrContract.

creator

address

Address of the creator of the proxy.

data

uint256

Data identifying the contract. This is for future use.

contractRegistryGetRegisteredContractsLength

function contractRegistryGetRegisteredContractsLength() external view returns (uint256)

returns the total length of the registry array

contractRegistryGetRegisteredContract

function contractRegistryGetRegisteredContract(uint256 idx) external view returns (struct ROJIContractRegistryInfo)

returns the contract info at the given index'

Parameters

Name
Type
Description

idx

uint256

The index of the contract to return. use contractRegistryGetRegisteredContractsLength to get the total length of the array

Was this helpful?