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:
Name Type Description _marketFactory address The 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:
Name Type Description [0] address The account address.
getAccount
function getAccount(address accountAddress) internal view returns (address)
Retrieves the address of a user's account.
Parameters:
Name Type Description accountAddress address The address of the user's account. Return Values:
Name Type Description [0] address The address of the user's account.