Andromeda
Ask or search…
K

Address List

Introduction

The Address List ADO is a smart contract that can be used to store a list of addresses. It is one of the Andromeda modules that can be attached to ADOs that accept modules.
These addresses can be set as one of the following:
  • Whitelist: The addresses are given whitelist privilege, allowing them to interact/execute with the ADO that has the module attached . If a whitelist of addresses is set, then any other address is considered as a blacklist.
  • Blacklist: The addresses are given blacklist restriction, preventing them to interact/execute with the ADO that has the module attached. If a blacklist of addresses is set, then any other address is considered as a whitelist.
Blacklisted addresses are restricted from performing any execute message, but they can still query from the ADO.
Ado_type: address-list

InstantiateMsg

Rust
JSON
pub struct InstantiateMsg {
pub is_inclusive: bool,
pub kernel_address: String,
pub owner: Option<String>
}
{
"is_inclusive": false,
"kernel_address":"andr1..."
}
Name
Type
Description
is_inclusive
bool
Whether or not the address list is inclusive. If true the address list is a whitelist, if false the address list is a blacklist.
kernel_address
String
Contract address of the kernel contract to be used for AMP messaging. Kernel contract address can be found in our deployed contracts.
owner
Option<String>
Optional address to specify as the owner of the ADO being created. Defaults to the sender if not specified.

ExecuteMsg

AddAddress

Adds an address to the address list.
Only Owner/Operators can execute AddAddress.
Rust
JSON
pub enum ExecuteMsg {
AddAddress { address: String },
}
{
"add_address": {
"address": "andr1..."
}
}
Name
Type
Description
address
String
The address to add to the list.

RemoveAddress

Removes an address from the address list.
Only Owner/Operators can execute RemoveAddress.
Rust
JSON
pub enum ExecuteMsg {
RemoveAddress { address: String },
}
{
"remove_address": {
"address": "andr1..."
}
}
Name
Type
Description
address
String
The address to remove from the list.

AddAddresses

Add multiple addresses to the address list.
Rust
JSON
pub enum ExecuteMsg {
AddAddresses { addresses: Vec<String> },
}
{
"add_addresses":{
"addresses":["andr1...","andr1...",...]
}
}
Name
Type
Description
addresses
Vec<String>
A vector containing all the addresses to add to the address list.

Base Executes

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

QueryMsg

IncludesAddress

Checks if an address is included in the address list.
Rust
JSON
pub enum QueryMsg {
#[returns(IncludesAddressResponse)]
IncludesAddress{
address: String
},
}
{
"includes_address": {
"address": "andr1..."
}
}
Name
Type
Description
address
String
The address for which to query inclusion.

IncludesAddressResponse

Rust
JSON
pub struct IncludesAddressResponse {
pub included: bool,
}
{
"included": false
}
Name
Type
Description
included
Bool
Whether the address is included.

IsInclusive

Checks if the address list is a whitelist or a blacklist.
Rust
JSON
pub enum QueryMsg {
#[returns(bool)]
IsInclusive {},
}
{
"is_inclusive":{}
}
Returns a bool with the result. If true, the address list is a whitelist. Otherwise the address list is a blacklist.

Base Queries

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