Account Creation
As was covered in the section on Account Architecture an Account
is just a single smart-contract that can act as a wallet. This means that creating an Account
is as simple as instantiating a smart-contract.
Account Parameters
Accounts are created by instantiating an Account
contract that has been registered with the registry
contract. The registry
contract is a contract that keeps track of all the modules and account code-ids and addresses on the Abstract platform.
The Account
contract takes the following parameters:
pub struct InstantiateMsg<Authenticator = Empty> {
/// The ownership structure of the Account.
pub owner: GovernanceDetails<String>,
/// Optionally specify an account-id for this account.
/// If provided must be between (u32::MAX/2)..u32::MAX range.
pub account_id: Option<AccountId>,
/// Optional authenticator for use with the `abstractaccount` cosmos-sdk module.
pub authenticator: Option<Authenticator>,
/// Optionally claim a namespace on instantiation.
/// Any fees will be deducted from the account and should be provided on instantiation.
pub namespace: Option<String>,
/// Optionally install modules on instantiation.
/// Any fees will be deducted from the account and should be provided on instantiation.
#[serde(default)]
pub install_modules: Vec<ModuleInstallConfig>,
/// Optional account name.
pub name: Option<String>,
/// Optional account description.
pub description: Option<String>,
/// Optional account link.
pub link: Option<String>,
}
The account can be instantiated using the normal instantiate
function or instantiate2
, which allows you to claim deterministic addresses.
During the instantiation process the account will self-register on the registry
contract, making it queryable by its account-id.