Skip to main content

AccountFactory.sol

AccountFactory​

Abstract contract for creating and managing user accounts.

accountBase​

contract ChromaticAccount accountBase

OnlyAccessableByDao​

error OnlyAccessableByDao()

Throws an error indicating that the caller is not the DAO.

onlyDao​

modifier onlyDao()

Modifier to restrict access to only the DAO. Throws an OnlyAccessableByDao error if the caller is not the DAO.

constructor​

constructor(address _marketFactory) internal

Initializes the AccountFactory contract with the provided router and market factory addresses.

  • Parameters:

    NameTypeDescription
    _marketFactoryaddressThe address of the market factory contract.

createAccount​

function createAccount() external

Creates a new user account.

Only one account can be created per user. Emits an AccountCreated event upon successful creation.

getAccount​

function getAccount() external view returns (address)

Retrieves the account of the caller.

  • Return Values:

    NameTypeDescription
    [0]addressThe account address.

getAccount​

function getAccount(address accountAddress) internal view returns (address)

Retrieves the address of a user's account.

  • Parameters:

    NameTypeDescription
    accountAddressaddressThe address of the user's account.
  • Return Values:

    NameTypeDescription
    [0]addressThe address of the user's account.