Andromeda
ADO LibraryBuild AppsDevelop ADOsCLIWeb Application Docs
Andromeda Archives
Andromeda Archives
  • Platform and Framework
    • Introduction to AndromedaOS
    • ADO Classes
    • Andromeda Messaging Protocol
      • Kernel
      • ADO Database
      • Economics Engine
      • Virtual File System
    • ADO Base
      • AndromedaMsg V1.0.0
      • AndromedaQuery V1.0.0
    • Common Types
    • Deployed Contracts
  • Andromeda Digital Objects
    • Introduction to ADOs
    • Auction V1.0.0
    • App V1.0.1
    • Crowdfund V1.0.0
    • CW20 V1.0.0
    • CW20 Staking V1.0.0
    • CW721 V1.0.0
    • CW20 Exchange V1.0.0
    • Lockdrop V1.0.0
    • Marketplace V1.0.0
    • Merkle-Airdrop V1.0.0
    • Rate Limiting Withdrawals V1.0.0
    • Splitter V1.0.0
    • Timelock V1.0.0
  • Andromeda Apps
    • Introduction to Apps
    • Crowdfunding App
    • Auctioning App
    • Cw20 Staking App
    • Marketplace App
  • Developing an ADO
    • Getting Started
      • Instantiation
      • Execution
      • Queries
      • Testing
    • ADO Example
    • ADO Submissions
  • Andromeda CLI
    • Introduction
    • Help and Shortcuts
    • ADO
    • Bank
    • Chain
    • Env
    • Gql
    • Tx
    • OS
    • Wallet
    • Wasm
    • Clearing CLI Data
    • Clear and Exit
  • Chain
    • Running a Node
    • Staking and Rewards
  • Andromeda Dashboard
    • Tokenomics Dashboard
    • Dashboard API
  • Additional Resources
    • GitHub
    • Website
    • White Paper
Powered by GitBook

Additional Resources

  • Github
  • Website

Community

  • Discord
  • Telegram

Socials

  • Twitter
  • Medium
  • Youtube
On this page
  • AndromedaMsg
  • Ownership
  • UpdateOwner
  • AcceptOwnership
  • RevokeOwnershipOffer
  • Disown
  • UpdateAppContract
  • UpdateKernelAddress
  • AMPReceive
  • Permissioning
  • PermissionAction
  • SetPermission
  • RemovePermission
  • DisableActionPermissioning

Was this helpful?

  1. Platform and Framework
  2. ADO Base

AndromedaMsg V1.0.0

The set of execute messages common to all ADOs in the Andromeda Logic Library.

AndromedaMsg

All of the ADOs can call most of the base execute messages found in the AndromedaMsg enum.

AMP ADOs are the only ADOs that do not implement the AndromedaMsg base executes.

#[cw_serde]
pub enum AndromedaMsg {
    Ownership(OwnershipMessage),
    
    UpdateAppContract {
        address: String,
    },
    
    UpdateKernelAddress {
        address: Addr,
    },
    
    #[serde(rename = "amp_receive")]
    AMPReceive(AMPPkt),
    Permissioning(PermissioningMessage),
    }
}

All the ADOs can execute:

Ownership

Messages related to the ownership of an ADO.

pub enum AndromedaMsg {
   Ownership(OwnershipMessage),
}

OwnershipMessage

The enum containing the different ownership message options.

pub enum OwnershipMessage {
    UpdateOwner {
        new_owner: Addr,
        expiration: Option<MillisecondsExpiration>,
    },
    RevokeOwnershipOffer,
    AcceptOwnership,
    Disown,
}

UpdateOwner

Offers the ADO's ownership to the specified new_owner. Once the offer has been made, the new_owner address can call AcceptOwnership to accept becoming the owner of the ADO.

Only available to the current ADO owner.

Only one offer can be made at a time.

pub enum OwnershipMessage {
  UpdateOwner {
        new_owner: Addr,
        expiration: Option<MillisecondsExpiration>,
    },
 }
{
"ownership":{
    "update_owner":{
        "new_owner":"andr1...",
        "expiration": 173493923498234
        }
    }
}
Name
Type
Description

new_owner

Addr

The address to offer ownership to.

expiration

An optional expiration to the ownership offer. Uses a Timestamp in milliseconds.

AcceptOwnership

Accepts the offer to become the new owner of the ADO.

Only an address that has an offer can accept it.

pub enum OwnershipMessage {
 AcceptOwnership
}
{
"ownership":{
    "accept_ownership":{}
   }
}

RevokeOwnershipOffer

Removes any previously placed offer by the current ADO owner.

Only available to the current ADO owner.

pub enum OwnershipMessage {
 RevokeOwnershipOffer 
}
{
"ownership":{
    "revoke_ownership_offer":{}
   }
}

Disown

Removes ownership from the current ADO owner.

Only available to the contract owner.

Once disowned, an ADO can never have an owner again.

pub enum OwnershipMessage {
 Disown 
}
{
"ownership":{
    "disown":{}
    }
}

UpdateAppContract

Updates the referenced App contract of an ADO. This allows the ADO to reference by name the components of the new App contract.

Only available to the ADO owner.

pub enum AndromedaMsg {
  UpdateAppContract {
        address: String,
        },
    }
{
"update_app_contract":{
    "address":"andr1..."
    }
}
Name
Type
Description

address

String

The address of the new App contract.

UpdateKernelAddress

Updates the Kernel used by the ADO.

Only available to the ADO owner.

pub enum AndromedaMsg {
    UpdateKernelAddress {
        address: Addr,
    }
}
{
"update_kernel_address":{
    "address":"andr1..."
    }
}
Name
Type
Description

address

Addr

The contract address of the new kernel to be used by the ADO.

AMPReceive

  1. The origin matches the sender

  2. The sender is the kernel

  3. The sender has a code ID stored within the ADODB (and as such is a valid ADO)

Permissioning

Messages related to the permissioning of an ADO.

pub enum AndromedaMsg {
   Permissioning(PermissioningMessage),
}

PermissioningMessage

pub enum PermissioningMessage {
  PermissionAction {
        action: String,
    },
    SetPermission {
        actor: AndrAddr,
        action: String,
        permission: Permission,
    },
    RemovePermission {
        action: String,
        actor: AndrAddr,
    },
    DisableActionPermissioning {
        action: String,
    },
}

PermissionAction

Enables permissioning on an action.

By actions, we are reffering to execute messages.

Only available to the ADO owner.

Permissioning an action will allow you to call SetPermission on that action.

pub enum PermissioningMessage {
      PermissionAction {
        action: String,
    },
}
{
"permissioning":{
    "permission_action":{
        "action":"Mint"
    }
  }
}
Name
Type
Description

action

String

The action/execute message to permission.

SetPermission

Assigns permissions to the specified actor. The action needs to be permissioned by calling PermissionAction before

Only availabe to the ADO owner.

pub enum PermissioningMessage {
  SetPermission {
        actor: AndrAddr,
        action: String,
        permission: Permission,
    },
 }
{
"permissioning"{
    "set_permission":{
        "actor"::"andr1...",
        "action":"Mint",
        "permission":{
            "limited":{
                "uses": 5
                }
            }
        }
    }
}
Name
Type
Description

actor

The address to assign permissions for.

action

String

The execute message to assign a permission for. Action needs to be capitalized i.e. "UpdateSale" to specify the UpdateSale execute.

permission

Permission

The type of permission assigned.

Permission

An enum to represent a user's permission for an action:

Expiration defaults to Never if not provided.

pub enum Permission {
    Blacklisted(Option<MillisecondsExpiration>),
    Limited {
        expiration: Option<MillisecondsExpiration>,
        uses: u32,
    },
    Whitelisted(Option<MillisecondsExpiration>),
}
  • Blacklisted: The user cannot perform the action until after the provided expiration.

  • Limited: The user can perform the action while uses are remaining and before the provided expiration.

  • Whitelisted: The user can perform the action until the provided expiration.

RemovePermission

Remove a previously assigned permission for the specified actor.

Only available to the ADO owner.

pub enum PermissioningMessage {
     RemovePermission {
        action: String,
        actor: AndrAddr,
    },
 }
{
"permissioning":{
    "remove_permission":{
        "actor":"andr1...",
        "action":"Mint"
        }
    }
}
Name
Type
Description

actor

The address that you want to remove permissions for.

action

String

The execute message to have its permission removed for the specified actor.

DisableActionPermissioning

Disables permissioning on an action.

This message is the reverse of a PermissionAction message.

Only available to the ADO owner.

pub enum PermissioningMessage {
      DisableActionPermissioning {
        action: String,
    },
}
{
"permissioning":{
    "disable_action_permissioning":{
        "action":"Mint"
    }
  }
}
Name
Type
Description

action

String

The action/execute message to remove permissioning for.

PreviousADO BaseNextAndromedaQuery V1.0.0

Last updated 1 year ago

Was this helpful?

Option<>

This message is not called by the user, but is the case that handles receiving from the . It first verifies the AMP packet and then proceeds to execute the attached execute messges. The AMP packet is verified by checking the following:

The action needs to be permissioned by calling to be able to set a permission for it.

All expirations are set as a timestamp in milliseconds using the type.

AMP messsages
Kernel
Ownership messages
UpdateAppContract
UpdateKernelAddress
AMPReceive
Permissioning messages
PermissionAction
MillisecondsExpiration
MillisecondsExpiration
AndrAddr
AndrAddr