Skip to main content

DAppIntegration

The DAppIntegration contract facilitates the integration of decentralized applications (dApps) and their authorized signatories within the Atlas Protocol. It allows dApps to establish governance, manage signatories, and handle the lifecycle of their integration, ensuring secure and controlled interactions within the protocol.

initializeGovernance

function initializeGovernance(address control) external;

Description

Integrates a new dApp into the Atlas Protocol by initializing its governance structure. This function sets the initial governance signatory for the specified DAppControl contract, ensuring that only authorized governance entities can manage the dApp's integration within the protocol.

Parameters

NameTypeDescription
controladdressThe address of the DAppControl contract to integrate.

Return Values

None

Requirements

  • Unlocked State: The Atlas protocol must be in an unlocked state. If it is locked, the function reverts with AtlasErrors.AlreadyInitialized().
  • Authorized Caller: Only the governance address retrieved from IDAppControl(control).getDAppSignatory() can call this function. If msg.sender is not the governance address, the function reverts with AtlasErrors.OnlyGovernance().
  • Single Initialization: The function cannot be called multiple times for the same DAppControl contract. Attempting to reinitialize will result in AtlasErrors.AlreadyInitialized().

Events Emitted

NewDAppSignatory

event NewDAppSignatory(address indexed control, address indexed oldSignatory, address indexed newSignatory, uint32 callConfig);

Emitted when a new signatory is added to a dApp's governance.

Usage Notes

  • Governance Setup: Essential for establishing the governance framework of a new dApp within the Atlas Protocol.
  • Security: Ensures that only authorized governance entities can initialize and manage dApp integrations, maintaining protocol integrity.

addSignatory

function addSignatory(address control, address signatory) external;

Description

Adds a new signatory to a dApp's list of approved signatories. This function enables governance entities to delegate signing authority to additional addresses, enhancing flexibility and security in managing dApp operations within the Atlas Protocol.

Parameters

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

Return Values

None

Requirements

  • Unlocked State: The Atlas protocol must be in an unlocked state. If it is locked, the function reverts with AtlasErrors.AlreadyInitialized().
  • Authorized Caller: Only the governance address retrieved from IDAppControl(control).getDAppSignatory() can call this function. If msg.sender is not the governance address, the function reverts with AtlasErrors.OnlyGovernance().
  • Unique Signatory: The signatory must not already be an active signatory for the specified DAppControl contract. If the signatory is already active, the function reverts with AtlasErrors.SignatoryActive().

Events Emitted

NewDAppSignatory

event NewDAppSignatory(address indexed control, address indexed oldSignatory, address indexed newSignatory, uint32 callConfig);

Emitted when a new signatory is added to a dApp's governance.

Usage Notes

  • Governance Flexibility: Allows dApp governance to expand or modify its set of authorized signatories as needed.
  • Security: Prevents unauthorized addition of signatories by enforcing strict caller authorization and uniqueness checks.

removeSignatory

function removeSignatory(address control, address signatory) external;

Description

Removes an existing signatory from a dApp's list of approved signatories. This function allows governance entities or the signatory themselves to revoke signing authority, ensuring that only authorized addresses maintain control over dApp operations within the Atlas Protocol.

Parameters

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

Return Values

None

Requirements

  • Unlocked State: The Atlas protocol must be in an unlocked state. If it is locked, the function reverts with AtlasErrors.AlreadyInitialized().
  • Authorized Caller: Only the governance address retrieved from IDAppControl(control).getDAppSignatory() or the signatory being removed can call this function. If msg.sender is neither, the function reverts with AtlasErrors.InvalidCaller().
  • Existing Signatory: The signatory must be an active signatory for the specified DAppControl contract. If the signatory is not active, the function reverts with AtlasErrors.InvalidSignatory().

Events Emitted

RemovedDAppSignatory

event RemovedDAppSignatory(address indexed control, address indexed oldSignatory, address indexed removedSignatory, uint32 callConfig);

Emitted when a signatory is removed from a dApp's governance.

Usage Notes

  • Governance Control: Enables dynamic management of signatories, allowing governance to revoke or update authorized signatories as necessary.
  • Security: Ensures that only authorized entities or the signatory themselves can initiate the removal, preventing unauthorized modifications.

changeDAppGovernance

function changeDAppGovernance(address oldGovernance, address newGovernance) external;

Description

Handles the transfer of governance authority from an old governance address to a new governance address for a specified dApp. This function ensures that governance changes are securely managed and that the new governance address is properly authorized within the protocol.

Parameters

NameTypeDescription
oldGovernanceaddressThe address of the current (old) governance entity.
newGovernanceaddressThe address of the new governance entity to be assigned.

Return Values

None

Requirements

  • Unlocked State: The Atlas protocol must be in an unlocked state. If it is locked, the function reverts with AtlasErrors.AlreadyInitialized().
  • Authorized Caller: Only the DAppControl contract associated with the governance can call this function. If msg.sender is not the DAppControl contract, the function reverts with AtlasErrors.InvalidCaller().
  • Existing Governance: The oldGovernance must be an active signatory for the specified DAppControl contract. If not, the function reverts with AtlasErrors.InvalidSignatory().

Events Emitted

DAppGovernanceChanged

event DAppGovernanceChanged(address indexed control, address indexed oldGovernance, address indexed newGovernance, uint32 callConfig);

Emitted when governance authority is transferred from an old governance address to a new one.

Usage Notes

  • Governance Transition: Facilitates seamless and secure transition of governance authority, ensuring that dApp management remains uninterrupted.
  • Security: Prevents unauthorized governance changes by enforcing strict caller authorization and verifying existing governance status.

disableDApp

function disableDApp(address control) external;

Description

Disables a dApp's integration within the Atlas Protocol. This function removes the governance signatory and effectively revokes all authorized signatories associated with the specified DAppControl contract, ensuring that the dApp can no longer interact with the protocol.

Parameters

NameTypeDescription
controladdressThe address of the DAppControl contract to disable.

Return Values

None

Requirements

  • Unlocked State: The Atlas protocol must be in an unlocked state. If it is locked, the function reverts with AtlasErrors.AlreadyInitialized().
  • Authorized Caller: Only the governance address retrieved from IDAppControl(control).getDAppSignatory() can call this function. If msg.sender is not the governance address, the function reverts with AtlasErrors.OnlyGovernance().

Events Emitted

DAppDisabled

event DAppDisabled(address indexed control, address indexed oldGovernance, uint32 callConfig);

Emitted when a dApp is disabled within the Atlas Protocol.

Usage Notes

  • Protocol Integrity: Ensures that disabled dApps can no longer interact with the protocol, maintaining security and preventing unauthorized operations.
  • Governance Control: Empowers governance entities to revoke dApp integrations as needed, responding to changes in dApp status or compliance requirements.

getGovFromControl

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

Description

Retrieves the governance address associated with a specified DAppControl contract. This function ensures that the specified DAppControl is enabled within the protocol and returns its current governance address.

Parameters

NameTypeDescription
controladdressThe address of the DAppControl contract.

Return Values

NameTypeDescription
addressaddressThe governance address of the specified DAppControl contract.

Requirements

  • Enabled DAppControl: The specified DAppControl contract must be enabled within the protocol. If it is not enabled, the function reverts with AtlasErrors.DAppNotEnabled().

Usage Notes

  • Governance Verification: Useful for verifying the current governance entity associated with a dApp's control contract.
  • Protocol Monitoring: Facilitates auditing and monitoring of dApp governance structures within the Atlas Protocol.

isDAppSignatory

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

Description

Checks whether a specified address is an authorized signatory for a given DAppControl contract. This function enables verification of signatory roles, ensuring that only approved addresses can interact wi