Module 0x2::deny_list
Defines the DenyList type. The DenyList shared object is used to restrict access to instances of certain core types from being used as inputs by specified addresses in the deny list.
- Resource
DenyList
- Resource
PerTypeList
- Constants
- Function
add
- Function
per_type_list_add
- Function
remove
- Function
per_type_list_remove
- Function
contains
- Function
per_type_list_contains
- Function
create
- Function
per_type_list
use 0x1::vector;
use 0x2::bag;
use 0x2::object;
use 0x2::table;
use 0x2::transfer;
use 0x2::tx_context;
use 0x2::vec_set;
Resource DenyList
A shared object that stores the addresses that are blocked for a given core type.
struct DenyList has key
Fields
- id: object::UID
- lists: bag::Bag
- The individual deny lists.
Resource PerTypeList
Stores the addresses that are denied for a given core type.
struct PerTypeList has store, key
Fields
- id: object::UID
- denied_count: table::Table<address, u64>
- Number of object types that have been banned for a given address. Used to quickly skip checks for most addresses.
- denied_addresses: table::Table<vector<u8>, vec_set::VecSet<address>>
- Set of addresses that are banned for a given type. For example with sui::coin::Coin: If addresses A and B are banned from using "0...0123::my_coin::MY_COIN", this will be "0...0123::my_coin::MY_COIN" -> {A, B}.
Constants
Trying to create a deny list object when not called by the system address.
const ENotSystemAddress: u64 = 0;
The index into the deny list vector for the sui::coin::Coin type.
const COIN_INDEX: u64 = 0;
The specified address is cannot be added to the deny list.
const EInvalidAddress: u64 = 1;
The specified address to be removed is not already in the deny list.
const ENotDenied: u64 = 1;
These addresses are reserved and cannot be added to the deny list.
const RESERVED: vector<address> = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1027, 57065];