T-REX Gateway Interface

The T-REX Gateway interface defines the set of functions and events used to manage and control the deployment of T-REX tokens. This page provides a detailed breakdown of each function and event, explaining its purpose, source, and functionality. Additionally, the TokenDetails, ClaimDetails, and Fee structs are defined to ensure a comprehensive understanding of how to interact with the T-REX Gateway contract.

Structs

TokenDetails

Description: Holds all 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: Holds all 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
}

Fee

Description: Holds the details for deployment fees.

FactorySet

Event

Description: Emitted when the factory variable is set or modified.


PublicDeploymentStatusSet

Event

Description: Emitted when the public deployment status is set or modified.


DeploymentFeeSet

Event

Description: Emitted when the deployment fees details are set or modified.


DeploymentFeeEnabled

Event

Description: Emitted when the deployment fees are enabled or disabled.


DeployerAdded

Event

Description: Emitted when an address is flagged as a deployer.


DeployerRemoved

Event

Description: Emitted when a deployer address loses deployment privileges.


FeeDiscountApplied

Event

Description: Emitted when a discount on deployment fees is granted for an address.


GatewaySuiteDeploymentProcessed

Event

Description: Emitted whenever a TREX token has been deployed by the TREX factory through the use of the Gateway.


setFactory

Description: Sets the factory contract address used for deploying TREX smart contracts. Only the owner can call this method. Emits a FactorySet event upon successful execution.


setPublicDeploymentStatus

Description: Sets the status for public deployments of TREX contracts. Enables or disables public deployments. Only the owner can call this method. Emits a PublicDeploymentStatusSet event upon successful execution.


transferFactoryOwnership

Description: Transfers the ownership of the Factory contract. Only the owner can call this method.


enableDeploymentFee

Description: Toggles the deployment fee status for TREX contracts. Enables or disables the deployment fees. Only the owner can call this method. Emits a DeploymentFeeEnabled event upon successful execution.


setDeploymentFee

Description: Sets the deployment fee details for TREX contracts. Establishes the amount, token type, and collector address for the deployment fee. Only the owner can call this method. Emits a DeploymentFeeSet event upon successful execution.


addDeployer

Description: Adds an address to the list of approved deployers. Only an admin (owner or agent) can call this method. Emits a DeployerAdded event upon successful addition.


batchAddDeployer

Description: Adds multiple addresses to the list of approved deployers in a single transaction. Only an admin (owner or agent) can call this method. Emits a DeployerAdded event for each successfully added deployer.


removeDeployer

Description: Removes an address from the list of approved deployers. Only an admin (owner or agent) can call this method. Emits a DeployerRemoved event upon successful removal.


batchRemoveDeployer

Description: Removes multiple addresses from the list of approved deployers in a single transaction. Only an admin (owner or agent) can call this method. Emits a DeployerRemoved event for each successfully removed deployer.


applyFeeDiscount

Description: Applies a fee discount to a specific deployer's address. Only an admin (owner or agent) can call this method. The fee discount is expressed per 10,000 (10000 = 100%, 1000 = 10%, etc.). Emits a FeeDiscountApplied event upon successful application.


batchApplyFeeDiscount

Description: Applies fee discounts to multiple deployers in a single transaction. Only an admin (owner or agent) can call this method. Emits a FeeDiscountApplied event for each successfully applied discount.


deployTREXSuite

Description: Deploys a TREX suite of contracts using provided token and claim details. If public deployments are disabled, only approved deployers can execute this function. If public deployments are enabled, an external entity can deploy only on its behalf and not for other addresses unless it's an approved deployer. If deployment fees are enabled and applicable (after considering any discounts for the deployer), the fee is collected from the deployer's address. Emits a GatewaySuiteDeploymentProcessed event upon successful deployment.


batchDeployTREXSuite

Description: Deploys multiple TREX suites of contracts in a single transaction using provided arrays of token and claim details. This batch function allows deploying up to 5 TREX suites at once. Performs the same checks as deployTREXSuite for each suite. Emits a GatewaySuiteDeploymentProcessed event for each deployed suite.


getPublicDeploymentStatus

Description: Retrieves the current public deployment status.


getFactory

Description:

Retrieves the address of the current Factory contract.


getDeploymentFee

Description: Retrieves the current deployment fee details.


isDeploymentFeeEnabled

Description: Checks if the deployment fee is currently enabled.


isDeployer

Description: Checks if the provided address is an approved deployer.


calculateFee

Description: Calculates the deployment fee for a given deployer after accounting for any discounts.

Last updated