App
Introduction
The App ADO is a smart contract that is used to bundle up ADOs that will be interacting with each other into what we call an "App". It also offers a naming system that allows the contracts to reference each other by their assigned names rather than contract addresses.
An ADO in the App is called an AppComponent. Every App would be composed of many of these components (up to 50). Each component is assigned a name which can be used by other components to reference each other. The App ADO allows us to instantiate all of these components in one go.
To reference a component from the another component when instantiating an App, you would need to speciy "./<component-name>. You will see examples of this in our Andromeda Apps section.
At instantiation, we specify the address of the Kernel ADO . This Kernel will have a reference to the ADODB which has the code Ids of all the Andromeda ADOs saved. The Kernel ADO for each chain is already deployed and the addresses can be found in our deployed contracts section. You can learn to deploy your first app here.
Our Apps support cross-chain components or ADOs, meaning an App can contain several ADOs each located on a different chain. This is specified by using the CrossChain
component type.
The App registers all its components in the Virtual File System upon instantiation and assigns to them the names specified by the user upon instantiation of the App.
Crosschain Apps are currently disabled.
Ado_type: app-contract
Version: 1.1.1-beta.1
InstantiateMsg
The maximum number of app components is 50.
You cannot have 2 Apps with the same name instantiated by the same address.
The instantiator address is given ownership over all the components of the App at instantiation.
Name | Type | Description |
---|---|---|
| Vec<AppComponent> | The vector of AppComponent containing all the ADOs of the app. |
| String | The name of the app. |
| Option<Vec<ChainInfo>> | A vector containing the chain information describing the chains that will be used in the App. To be able to deploy a CrossChain component, the chain_info for that chain need to be specified. |
| String | Contract address of the kernel contract to be used for AMP messaging. Kernel contract address can be found in our deployed contracts. |
| Option<String> | Optional address to specify as the owner of the ADO being created. Defaults to the sender if not specified. |
AppComponent
The ADO to be a part of the App.
The name
field is case sensitive and needs to be unique for each component.
Component name characters should be alphanumeric.
Component name cannot be a single dot "."
Name | Type | Description |
---|---|---|
| String. | The name of the ADO component. The names can be used later on to reference the coponent. |
| String | The type of the ADO. |
| Specifies the type of component. The components types are discussed below. |
ComponentType
An enum containing the different component types that can be instantiated.
In order to create a CrossChain component, chain_info
field (Found in instantiation message of the App ADO) needs be specified for the chain to deploy the component on. For example, if I want to create a NFT component on Stargaze from an App on the Andromeda chain, I need to specify the chain info for the stargaze chain for it to be successfull.
CrossChain Components are currently disabled.
There are three types of components:
New: Provide a base64 encoded binary of the instantiation message of the component to add.
Symlink: Provide a valid Symlink that resolves to the address of the component to add.
CrossChain: Provide a base64 encoded binary of the instantiation message of the component to add as well as the chain. The component will be instantiated on the specified chain. This option is currently disabled.
CrossChainComponent
The instantiate_msg
should be base64 encoded and not raw binary.
Name | Type | Description |
---|---|---|
| Binary | base64 binary representation of the instantiation message of the comopnent. |
| String | The chain to create the component on. |
ChainInfo
Information on the chains that will be part of the App. Need to be specified to be able to use CrossChain components.
Name | Type | Description |
---|---|---|
| String | The name of the chain. |
| String | The address of the owner of the components that will be created on the specified chain. |
ExecuteMsg
AddAppComponent
Adds an ADO component to the app.
Only available to the contract owner.
Name | Type | Description |
---|---|---|
| The ADO component to add to the app. |
ClaimOwnership
Sends an ownership request to the specified new_owner
for a component owned by the App.
Only available to the contract owner.
Name | Type | Description |
---|---|---|
| Option<String> | Optional name for the component to claim. If not set, will claim all ADO components in the app. |
| Option<Addr> | Optional address to get the ownership request. Defaults to the sender if not specified. |
ProxyMessage
Sends a message to the ADO with the specified name
. This is used in the case the app contract has specific operation privileges (Is the owner) over a component.
Only available to the contract owner.
Name | Type | Description |
---|---|---|
| String | The name of the ADO to execute on. |
| Binary | The msg to excecute. This is a base64 encoded binary of the JSON representation of the message. |
UpdateAddress
Sets a new contract address for the ADO with the specified name
.
Only available to the contract owner or the ADO component with the specified name.
Name | Type | Description |
---|---|---|
| String | The name of the ADO component to update the address for. This needs to be the name of one of the components in the App. |
| String | The new contract address to be associated with the specified name. |
Base Executes
The rest of the execute messages can be found in the ADO Base section.
QueryMsg
GetAddress
Queries the contract address of a component name.
Name | Type | Description |
---|---|---|
| String | The name of the component to get the contract address for. |
Returns a String
of the component address.
GetAddressesWithNames
Queries all the components returning the name along with the address for each.
ComponentAddress
GetComponents
Returns a Vec<
AppComponent
>
which contains all the components of the app.
Config
Queries the configuration of the app.
ConfigResponse
ComponentExists
Checks if a component with the specified name
exists.
Name | Type | Description |
---|---|---|
| String | The name of the component to check. |
Returns a bool response.
Base Queries
The rest of the query messages can be found in the ADO Base section.