croncat_agents/
state.rs

1use crate::distributor::AgentTaskDistributor;
2use crate::msg::*;
3use cosmwasm_std::{Addr, Empty};
4use croncat_sdk_agents::types::{AgentNominationStatus, Config};
5use cw_storage_plus::{Deque, Item, Map};
6
7/// Contract config, just the owner address for now, preferably dao
8pub const CONFIG: Item<Config> = Item::new("agents_config");
9
10/// Controls whether or not the contract is paused. Can only be changed to TRUE by
11/// the pause_admin, can only be unpaused by DAO/owner_addr
12pub const PAUSED: Item<bool> = Item::new("paused");
13
14pub(crate) const DEFAULT_NOMINATION_BLOCK_DURATION: u16 = 10;
15pub(crate) const DEFAULT_MIN_TASKS_PER_AGENT: u64 = 3;
16pub(crate) const DEFAULT_MIN_COINS_FOR_AGENT_REGISTRATION: u64 = 200_000;
17
18pub const AGENTS: Map<&Addr, Agent> = Map::new("agents");
19pub const AGENTS_ACTIVE: Item<Vec<Addr>> = Item::new("agents_active");
20pub const AGENTS_PENDING: Deque<Addr> = Deque::new("agents_pending");
21pub const AGENT_STATS: Map<&Addr, AgentStats> = Map::new("agent_stats");
22/// Due to the absence of a Set data structure, we use a Map that points to Empty
23/// This will only be used if the Config's `public_registration` value is false
24pub const APPROVED_AGENTS: Map<&Addr, Empty> = Map::new("approved_agents");
25pub const AGENT_NOMINATION_STATUS: Item<AgentNominationStatus> =
26    Item::new("agent_nomination_status");
27
28pub const AGENT_TASK_DISTRIBUTOR: AgentTaskDistributor = AgentTaskDistributor::new();
29pub const DEFAULT_AGENTS_EJECT_THRESHOLD: u64 = 600;
30pub const DEFAULT_MIN_ACTIVE_AGENT_COUNT: u16 = 1;
31pub const DEFAULT_PUBLIC_REGISTRATION_ENABLED: bool = false;