DexFactoryDeployment ​
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
| Name | Type | Description |
|---|---|---|
bytecode_ | bytes | The bytecode of the contract to be deployed. |
Returns
| Name | Type | Description |
|---|---|---|
address_ | address | Returns 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
| Name | Type | Description |
|---|---|---|
dexDeploymentLogic_ | address | The address of the dex deployment logic contract. |
dexDeploymentData_ | bytes | The data to be used for dex deployment. |
Returns
| Name | Type | Description |
|---|---|---|
dex_ | address | Returns 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
| Name | Type | Description |
|---|---|---|
dexId_ | uint256 | The ID of the dex. |
Returns
| Name | Type | Description |
|---|---|---|
dex_ | address | Returns 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
| Name | Type | Description |
|---|---|---|
dex_ | address | The dex address to check. |
Returns
| Name | Type | Description |
|---|---|---|
<none> | bool | Returns 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
| Name | Type | Description |
|---|---|---|
<none> | uint256 | Returns the total number of dexes. |

