Skip to content

DexFactoryDeployment ​

Git Source

Inherits:DexFactoryCore, DexFactoryAuth

implements DexFactory deploy dex related methods.

Functions ​

_deploy ​

Deploys a contract using the CREATE opcode with the provided bytecode (bytecode_). This is an internal function, meant to be used within the contract to facilitate the deployment of other contracts.

solidity
function _deploy(bytes memory bytecode_) internal returns (address address_);

Parameters

NameTypeDescription
bytecode_bytesThe bytecode of the contract to be deployed.

Returns

NameTypeDescription
address_addressReturns the address of the deployed contract.

deployDex ​

Deploys a new dex using the specified deployment logic dexDeploymentLogic_ and data dexDeploymentData_. Only accounts with deployer access or the owner can deploy a new dex.

solidity
function deployDex(address dexDeploymentLogic_, bytes calldata dexDeploymentData_) external returns (address dex_);

Parameters

NameTypeDescription
dexDeploymentLogic_addressThe address of the dex deployment logic contract.
dexDeploymentData_bytesThe data to be used for dex deployment.

Returns

NameTypeDescription
dex_addressReturns the address of the newly deployed dex.

getDexAddress ​

Computes the address of a dex based on its given ID (dexId_).

solidity
function getDexAddress(uint256 dexId_) public view returns (address dex_);

Parameters

NameTypeDescription
dexId_uint256The ID of the dex.

Returns

NameTypeDescription
dex_addressReturns the computed address of the dex.

isDex ​

Checks if a given address (dex_) corresponds to a valid dex.

solidity
function isDex(address dex_) public view returns (bool);

Parameters

NameTypeDescription
dex_addressThe dex address to check.

Returns

NameTypeDescription
<none>boolReturns true if the given address corresponds to a valid dex, otherwise false.

totalDexes ​

Returns the total number of dexes deployed by the factory.

solidity
function totalDexes() external view returns (uint256);

Returns

NameTypeDescription
<none>uint256Returns the total number of dexes.