DCAFactory
The DCA Factory allows users to deploy an Account contract from a safe soruce. Each Factory will be iteratable with each version of Account Contract, meaning that DCAFactoryV1 will persist. It will only be paused from generating new accounts if there is a security issue.
Methods
CreateAccount
function CreateAccount() external nonpayableWill create a new DCAAccount with the sender as the initial owner.
Creates a new DCAAccount
SWAP_ROUTER
function SWAP_ROUTER() external view returns (address)The swap router address
Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | The swap router address |
accountsCreated
function accountsCreated() external view returns (uint256)The total deployed accounts
Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | The total deployed accounts |
getActiveExecutorAddress
function getActiveExecutorAddress() external view returns (address)Gets the executor address
Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | The executor address |
getDCAAccountsOfUser
function getDCAAccountsOfUser(address _user) external view returns (address[])Gets all DCAAccounts created by a user
Parameters
| Name | Type | Description |
|---|---|---|
| _user | address | The address of the user |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | address[] | The addresses of the DCAAccounts created by the user |
getFactoryActiveState
function getFactoryActiveState() external view returns (bool)Gets the active state of the factory
Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | The active state of the factory |
getTotalDeployedAccounts
function getTotalDeployedAccounts() external view returns (uint256)Gets the total deployed accounts
Returns
| Name | Type | Description |
|---|---|---|
| _0 | uint256 | The total deployed accounts |
isActive
function isActive() external view returns (bool)Returns the active state of the contract
Returns
| Name | Type | Description |
|---|---|---|
| _0 | bool | True if the contract is active, false otherwise |
owner
function owner() external view returns (address)Returns the address of the current owner.
Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
reInvestLogicContract
function reInvestLogicContract() external view returns (address)The reinvest logic contract address
Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | The reinvest logic contract address |
renounceOwnership
function renounceOwnership() external nonpayableLeaves the contract without owner. It will not be possible to call onlyOwner functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.
transferOwnership
function transferOwnership(address newOwner) external nonpayableTransfers ownership of the contract to a new account (newOwner). Can only be called by the current owner.
Parameters
| Name | Type | Description |
|---|---|---|
| newOwner | address | undefined |
updateExecutorAddress
function updateExecutorAddress(address _newExecutorAddress) external nonpayableUpdates the executor address
Parameters
| Name | Type | Description |
|---|---|---|
| _newExecutorAddress | address | The address of the new executor |
updateReinvestLibraryAddress
function updateReinvestLibraryAddress(address newAddress_) external nonpayableUpdates the reinvest library address
Parameters
| Name | Type | Description |
|---|---|---|
| newAddress_ | address | The address of the new reinvest library |
userDCAAccounts
function userDCAAccounts(address, uint256) external view returns (address)Parameters
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
| _1 | uint256 | undefined |
Returns
| Name | Type | Description |
|---|---|---|
| _0 | address | undefined |
Events
AccountCreated
event AccountCreated(address indexed owner, address indexed dcaAccount)Emitted when a new DCAAccount is created.
Parameters
| Name | Type | Description |
|---|---|---|
owner indexed | address | The owner of the DCAAccount |
dcaAccount indexed | address | The address of the DCAAccount |
ContractActiveStateChange
event ContractActiveStateChange(bool indexed active_)Emitted when the active state of the contract is changed
Parameters
| Name | Type | Description |
|---|---|---|
active_ indexed | bool | The new active state |
ExecutorChanged
event ExecutorChanged(address indexed newAddress)Emitted when the DCAExecutor address is changed.
Parameters
| Name | Type | Description |
|---|---|---|
newAddress indexed | address | The new address of the DCAExecutor |
OwnershipTransferred
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner)Parameters
| Name | Type | Description |
|---|---|---|
previousOwner indexed | address | undefined |
newOwner indexed | address | undefined |
ReinvestLibraryChanged
event ReinvestLibraryChanged(address indexed newLibraryAddress)Emitted when the DCAReinvestContract address is changed.
Parameters
| Name | Type | Description |
|---|---|---|
newLibraryAddress indexed | address | The new address of the DCAReinvestContract |
Errors
ContractIsPaused
error ContractIsPaused()Error thrown when the contract is paused
OwnableInvalidOwner
error OwnableInvalidOwner(address owner)The owner is not a valid owner account. (eg. address(0))
Parameters
| Name | Type | Description |
|---|---|---|
| owner | address | undefined |
OwnableUnauthorizedAccount
error OwnableUnauthorizedAccount(address account)The caller account is not authorized to perform an operation.
Parameters
| Name | Type | Description |
|---|---|---|
| account | address | undefined |