Multiple hardware wallets: per-wallet devices, wallets page, Poinbase custodial account, PLEDGER item with supply-chain poisoning
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
add61a6b5e
commit
783f73989d
19 files changed
+557
-199
No files matched your search
@@ -13,6 +13,8 @@ namespace Decentralized.Domain
|
||||
public double Taint, Basis;
|
||||
public int Rounds;
|
||||
public int ReadyDay;
|
||||
/// <summary>存入的钱包地址:到期提回这里。</summary>
|
||||
public string Wallet;
|
||||
}
|
||||
|
||||
/// <summary>一笔混币结束时的结果,供夜间日志使用。</summary>
|
||||
@@ -56,7 +58,7 @@ namespace Decentralized.Domain
|
||||
w.Add(asset, -amount);
|
||||
w.Taint -= taint;
|
||||
w.Basis -= basis;
|
||||
var d = new MixDeposit { Asset = asset, Amount = amount, Taint = taint, Basis = basis, Rounds = rounds, ReadyDay = day + rounds };
|
||||
var d = new MixDeposit { Asset = asset, Amount = amount, Taint = taint, Basis = basis, Rounds = rounds, ReadyDay = day + rounds, Wallet = w.Address };
|
||||
Pending.Add(d);
|
||||
return d;
|
||||
}
|
||||
@@ -68,7 +70,10 @@ namespace Decentralized.Domain
|
||||
}
|
||||
|
||||
/// <summary>每晚:到期的存入提回钱包(污点按轮数降低),在途的各有小概率跑路。</summary>
|
||||
public List<MixResult> Night(Wallet w, int day, Func<string, double> price, Rng rng)
|
||||
public List<MixResult> Night(Wallet w, int day, Func<string, double> price, Rng rng) => Night(_ => w, day, price, rng);
|
||||
|
||||
/// <summary>每晚(多钱包):到期的存入按存入时的地址提回原钱包。</summary>
|
||||
public List<MixResult> Night(Func<string, Wallet> wallet, int day, Func<string, double> price, Rng rng)
|
||||
{
|
||||
var results = new List<MixResult>();
|
||||
foreach (var d in Pending.ToList())
|
||||
@@ -85,6 +90,7 @@ namespace Decentralized.Domain
|
||||
double taint = d.Taint * Math.Pow(1 - rate, d.Rounds);
|
||||
double amount = d.Amount * Math.Pow(1 - Tuning.MixerFee, d.Rounds);
|
||||
bool flagged = Sanctioned(day);
|
||||
var w = wallet(d.Wallet);
|
||||
w.Add(d.Asset, amount);
|
||||
w.Taint += taint;
|
||||
w.Basis += d.Basis;
|
||||
|
||||
Reference in new issue
Block a user