Address List

The address list ADO is a smart contract that facilitates setting up permissions for ADOs. Instead of setting up the permission on the ADO itself, the owner can reference this ADO instead.

Permissioning allows ADO owners to give/restrict access to addresses to execute messages on their ADOs.

ADO_type: address-list

Version: 2.0.2-beta.1

InstantiateMsg

pub struct InstantiateMsg {
    pub actor_permission: Option<ActorPermission>,
    pub kernel_address: String,
    pub owner: Option<String>
}

ActionPermission

pub struct ActorPermission {
    pub actor: Addr,
    pub permission: Permission,
}

Permission

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

Expiration defaults to Never if not provided.

pub enum Permission {
    Blacklisted(Option<Expiry>),
    Limited {
        expiration: Option<Expiry>,
        uses: u32,
    },
    Whitelisted(Option<Expiry>),
}
  • 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.

ExecuteMsg

AddActorPermission

Only available to the ADO owner.

Add permissioning to the specified list of actors (Addresses).

pub enum ExecuteMsg {
PermissionActors {
        actors: Vec<AndrAddr>,
        permission: LocalPermission,
    },
 }

RemoveActorPermission

Only available to the ADO owner.

Removes previously set permission on the specified actors.

pub enum ExecuteMsg {
  RemovePermissions {
        actors: Vec<AndrAddr>
    },
}

Base Executes

The rest of the execute messages can be found in the ADO Base section.

QueryMsg

IncludesActor

Checks if the specified actor has any permissions applied.

pub enum QueryMsg {
    #[returns(IncludesActorResponse)]
    IncludesActor { actor: Addr },
    }

Returns true if the address has any permissions and false otherwise.

ActorPermission

Queries the permission applied on the specified actor.

pub enum QueryMsg {
   #[returns(ActorPermissionResponse)]
    ActorPermission { actor: Addr },
    }

Returns a Permission struct with the type of permission.

Base Queries

The rest of the query messages can be found in the ADO Base section.

Additional Resources

GithubWebsite