T-REX Factory Interface
The T-REX Factory interface defines the set of functions and events used to deploy and manage the T-REX suite of contracts. Below is a detailed breakdown of each function and event, explaining its purpose, source, and functionality. Additionally, the structs TokenDetails
and ClaimDetails
are defined to provide a comprehensive understanding of how to interact with the T-REX Factory contract.
Structs
TokenDetails
Description: This struct holds all the necessary details for deploying a new T-REX token and its associated contracts.
struct TokenDetails {
address owner; // Address of the owner of all contracts
string name; // Name of the token
string symbol; // Symbol / ticker of the token
uint8 decimals; // Decimals of the token (can be between 0 and 18)
address irs; // Identity registry storage address
address ONCHAINID; // ONCHAINID of the token
address[] irAgents; // List of agents of the identity registry
address[] tokenAgents; // List of agents of the token
address[] complianceModules; // Modules to bind to the compliance
bytes[] complianceSettings; // Settings calls for compliance modules
}
ClaimDetails
Description: This struct holds all the necessary details regarding the claims and claim issuers.
struct ClaimDetails {
uint256[] claimTopics; // Claim topics required
address[] issuers; // Trusted issuers addresses
uint256[][] issuerClaims; // Claims that issuers are allowed to emit
}
Deployed
Event
Description: Emitted whenever a single contract is deployed by the factory.
event Deployed(address indexed _addr);
IdFactorySet
Event
Description: Emitted when the Identity Factory is set.
event IdFactorySet(address _idFactory);
ImplementationAuthoritySet
Event
Description: Emitted when the implementation authority of the factory contract is set.
event ImplementationAuthoritySet(address _implementationAuthority);
TREXSuiteDeployed
Event
Description: Emitted by the factory when a full suite of T-REX contracts is deployed.
event TREXSuiteDeployed(address indexed _token, address _ir, address _irs, address _tir, address _ctr, address _mc, string indexed _salt);
setImplementationAuthority
Source: ITREXFactory
Description: Sets the implementation authority contract address. This contract contains the addresses of all implementation contracts. The proxies created by the factory will use the different implementations available in the implementation authority contract. Only callable by the owner of the T-REX Factory contract. Emits an ImplementationAuthoritySet
event.
function setImplementationAuthority(address _implementationAuthority) external;
setIdFactory
Source: ITREXFactory
Description: Sets the identity factory contract address. The identity factory contract is used by the T-REX Factory to deploy the ONCHAINID of the token in case the ONCHAINID is not specified. Only callable by the owner of the T-REX Factory contract. Emits an IdFactorySet
event.
function setIdFactory(address _idFactory) external;
deployTREXSuite
Source: ITREXFactory
Description: Deploys a new T-REX token and sets all the parameters as required by the issuer paperwork. This function will deploy and set the Token, Identity Registry (IR), Identity Registry Storage (IRS), Claim Topics Registry (CTR), Trusted Issuers Registry (TIR), and Compliance contracts. All contracts are deployed using the CREATE2 opcode, ensuring that they are deployed at a predetermined address. Only callable by the owner of the T-REX Factory contract. Emits a TREXSuiteDeployed
event.
function deployTREXSuite(
string memory _salt,
TokenDetails calldata _tokenDetails,
ClaimDetails calldata _claimDetails
) external;
recoverContractOwnership
Source: ITREXFactory
Description: Recovers the ownership of contracts owned by the factory. Typically used for IRS contracts owned by the factory. Only callable by the owner of the T-REX Factory contract.
function recoverContractOwnership(address _contract, address _newOwner) external;
getImplementationAuthority
Source: ITREXFactory
Description: Returns the address of the implementation authority contract.
function getImplementationAuthority() external view returns(address);
getIdFactory
Source: ITREXFactory
Description: Returns the address of the identity factory contract.
function getIdFactory() external view returns(address);
getToken
Source: ITREXFactory
Description: Returns the address of the token corresponding to a given salt string.
function getToken(string calldata _salt) external view returns(address);
Last updated