Skip to main content

Solidity API

DAppIntegration​

DAppIntegration handles the integration of dApps and their signatories within the Atlas protocol.

ATLAS​

address ATLAS

L2_GAS_CALCULATOR​

address L2_GAS_CALCULATOR

S_signatories​

mapping(bytes32 => bool) S_signatories

S_dAppSignatories​

mapping(address => address[]) S_dAppSignatories

constructor​

constructor(address atlas, address l2GasCalculator) public

initializeGovernance​

function initializeGovernance(address control) external

Permissionlessly integrates a new dApp into the Atlas protocol.

Parameters​

NameTypeDescription
controladdressThe address of the DAppControl contract.

addSignatory​

function addSignatory(address control, address signatory) external

Adds a new signatory to a dApp's list of approved signatories.

Parameters​

NameTypeDescription
controladdressThe address of the DAppControl contract.
signatoryaddressThe address of the new signatory.

removeSignatory​

function removeSignatory(address control, address signatory) external

Removes a signatory from a dApp's list of approved signatories.

Parameters​

NameTypeDescription
controladdressThe address of the DAppControl contract.
signatoryaddress

changeDAppGovernance​

function changeDAppGovernance(address oldGovernance, address newGovernance) external

Called by the DAppControl contract on acceptGovernance when governance is transferred.

Must be called by the DAppControl contract concerned and Atlas must be in an unlocked state.

Parameters​

NameTypeDescription
oldGovernanceaddressThe address of the old governance.
newGovernanceaddressThe address of the new governance.

disableDApp​

function disableDApp(address control) external

Disables a dApp from the Atlas protocol.

Parameters​

NameTypeDescription
controladdressThe address of the DAppControl contract.

_isDAppSignatory​

function _isDAppSignatory(address control, address signatory) internal view returns (bool)

Returns whether a specified address is a signatory for a specified DAppControl contract.

Parameters​

NameTypeDescription
controladdressThe address of the DAppControl contract.
signatoryaddressThe address to check.

Return Values​

NameTypeDescription
[0]boolA boolean indicating whether the specified address is a signatory for the specified DAppControl contract.

_addSignatory​

function _addSignatory(address control, address signatory) internal

Adds a new signatory to a dApp's list of approved signatories.

Parameters​

NameTypeDescription
controladdressThe address of the DAppControl contract.
signatoryaddressThe address of the new signatory.

_removeSignatory​

function _removeSignatory(address control, address signatory) internal

Removes a signatory from a dApp's list of approved signatories.

If the signatory is not actually registered as a signatory of the DAppControl contract, this function should not revert, but also should not make any changes to state. This prevents it from blocking the transfer of governance triggered by the acceptGovernance function on a DAppControl contract, when the old governance address has already been removed as a signatory.

Parameters​

NameTypeDescription
controladdressThe address of the DAppControl contract.
signatoryaddressThe address of the signatory to be removed.

_checkAtlasIsUnlocked​

function _checkAtlasIsUnlocked() internal view

Checks if the Atlas protocol is in an unlocked state. Will revert if not.

getGovFromControl​

function getGovFromControl(address control) external view returns (address)

Returns the governance address of a specified DAppControl contract.

Parameters​

NameTypeDescription
controladdressThe address of the DAppControl contract.

Return Values​

NameTypeDescription
[0]addressThe governance address of the specified DAppControl contract.

isDAppSignatory​

function isDAppSignatory(address control, address signatory) external view returns (bool)

Returns whether a specified address is a signatory for a specified DAppControl contract.

Parameters​

NameTypeDescription
controladdressThe address of the DAppControl contract.
signatoryaddressThe address to check.

Return Values​

NameTypeDescription
[0]boolA boolean indicating whether the specified address is a signatory for the specified DAppControl contract.

signatories​

function signatories(bytes32 key) external view returns (bool)

dAppSignatories​

function dAppSignatories(address control) external view returns (address[])

Returns an array of signatories for a specified DAppControl contract.

Parameters​

NameTypeDescription
controladdressThe address of the DAppControl contract.

Return Values​

NameTypeDescription
[0]address[]address[] An array of signatories for the specified DAppControl contract.