Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "mining-cli"
version = "1.3.0"
version = "1.3.1"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
16 changes: 16 additions & 0 deletions src/services/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,13 @@ use crate::{
utils::{config::Settings, time::sleep_for},
};
use alloy::primitives::{B256, U256};
use chrono::TimeZone as _;
use claim::claim_task;
use mining::mining_task;
use utils::{await_until_graph_syncs, is_address_used};

const DEPOSIT_CLOSE_TIMESTAMP: u64 = 1751068800; // 2025-06-28 00:00:00 UTC

pub mod assets_status;
pub mod balance_transfer;
pub mod claim;
Expand Down Expand Up @@ -48,9 +51,22 @@ pub async fn mining_loop(
await_until_graph_syncs(&state.graph_client).await?;
let assets_status = state.sync_and_fetch_assets(&key).await?;
let is_qualified = !get_circulation(key.deposit_address).await?.is_excluded;
let is_open = (chrono::Utc::now().timestamp() as u64) < DEPOSIT_CLOSE_TIMESTAMP;

let will_deposit = assets_status.effective_deposit_times() < mining_times as usize
&& assets_status.pending_indices.is_empty()
&& is_qualified;
if will_deposit && !is_open {
print_warning(format!(
"Deposit closed on {}.
You can still withdraw your deposits but cannot make new deposits.",
chrono::Utc
.timestamp_opt(DEPOSIT_CLOSE_TIMESTAMP as i64, 0)
.unwrap()
.format("%Y-%m-%d %H:%M:%S"),
));
}
let will_deposit = will_deposit && is_open;

// skip deposit address if no remaining deposits, and will not deposit
if assets_status.no_remaining() && !will_deposit {
Expand Down
Loading