Skip to content

DexFactoryAuth ​

Git Source

Inherits:DexFactoryCore

Implements Dex Factory auth-only callable methods. Owner / auths can set various config values and can define the allow-listed deployers.

Functions ​

setDeployer ​

Sets an address (deployer_) as allowed deployer or not. This function can only be called by the owner.

solidity
function setDeployer(address deployer_, bool allowed_) external onlyOwner validAddress(deployer_);

Parameters

NameTypeDescription
deployer_addressThe address to be set as deployer.
allowed_boolA boolean indicating whether the specified address is allowed to deploy dexes.

setGlobalAuth ​

Sets an address (globalAuth_) as a global authorization or not. This function can only be called by the owner.

solidity
function setGlobalAuth(address globalAuth_, bool allowed_) external onlyOwner validAddress(globalAuth_);

Parameters

NameTypeDescription
globalAuth_addressThe address to be set as global authorization.
allowed_boolA boolean indicating whether the specified address is allowed to update any dex config.

setDexAuth ​

Sets an address (dexAuth_) as allowed dex authorization or not for a specific dex (dex_). This function can only be called by the owner.

solidity
function setDexAuth(address dex_, address dexAuth_, bool allowed_) external onlyOwner validAddress(dexAuth_);

Parameters

NameTypeDescription
dex_addressThe address of the dex for which the authorization is being set.
dexAuth_addressThe address to be set as dex authorization.
allowed_boolA boolean indicating whether the specified address is allowed to update the specific dex config.

setDexDeploymentLogic ​

Sets an address as allowed dex deployment logic (deploymentLogic_) contract or not. This function can only be called by the owner.

solidity
function setDexDeploymentLogic(address deploymentLogic_, bool allowed_)
    public
    onlyOwner
    validAddress(deploymentLogic_);

Parameters

NameTypeDescription
deploymentLogic_addressThe address of the dex deployment logic contract to be set.
allowed_boolA boolean indicating whether the specified address is allowed to deploy new type of dex.

spell ​

Spell allows owner aka governance to do any arbitrary call on factory

solidity
function spell(address target_, bytes memory data_) external onlyOwner returns (bytes memory response_);

Parameters

NameTypeDescription
target_addressAddress to which the call needs to be delegated
data_bytesData to execute at the delegated address

isDeployer ​

Checks if the provided address (deployer_) is authorized as a deployer.

solidity
function isDeployer(address deployer_) public view returns (bool);

Parameters

NameTypeDescription
deployer_addressThe address to be checked for deployer authorization.

Returns

NameTypeDescription
<none>boolReturns true if the address is a deployer, otherwise false.

isGlobalAuth ​

Checks if the provided address (globalAuth_) has global dex authorization privileges.

solidity
function isGlobalAuth(address globalAuth_) public view returns (bool);

Parameters

NameTypeDescription
globalAuth_addressThe address to be checked for global authorization privileges.

Returns

NameTypeDescription
<none>boolReturns true if the given address has global authorization privileges, otherwise false.

isDexAuth ​

Checks if the provided address (dexAuth_) has dex authorization privileges for the specified dex (dex_).

solidity
function isDexAuth(address dex_, address dexAuth_) public view returns (bool);

Parameters

NameTypeDescription
dex_addressThe address of the dex to check.
dexAuth_addressThe address to be checked for dex authorization privileges.

Returns

NameTypeDescription
<none>boolReturns true if the given address has dex authorization privileges for the specified dex, otherwise false.

isDexDeploymentLogic ​

Checks if the provided (dexDeploymentLogic_) address has authorization for dex deployment.

solidity
function isDexDeploymentLogic(address dexDeploymentLogic_) public view returns (bool);

Parameters

NameTypeDescription
dexDeploymentLogic_addressThe address of the dex deploy logic to check for authorization privileges.

Returns

NameTypeDescription
<none>boolReturns true if the given address has authorization privileges for dex deployment, otherwise false.