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
@@ -17,6 +17,8 @@ namespace Decentralized.Domain
|
||||
/// <summary>参考价:改价时按它重算标价。</summary>
|
||||
public long Ref;
|
||||
public int ListPrice;
|
||||
/// <summary>上架时付费的钱包地址:回款进这里。</summary>
|
||||
public string Wallet;
|
||||
public int ListedDay, PayDay;
|
||||
public SaleState State = SaleState.Listed;
|
||||
/// <summary>成交后扣掉抽成的货款(信用点)与其中带的污点。</summary>
|
||||
@@ -73,7 +75,7 @@ namespace Decentralized.Domain
|
||||
double share = total > 0 ? Math.Min(1, ListFee(listPrice) / total) : 0;
|
||||
w.Taint -= w.Taint * share; w.Basis -= w.Basis * share;
|
||||
w.Add(feeAsset, -qty);
|
||||
var s = new BmSale { Item = item, Model = model, FakeOf = fakeOf, Health = health, Ref = refValue, Mult = m, ListPrice = listPrice, ListedDay = day };
|
||||
var s = new BmSale { Item = item, Model = model, FakeOf = fakeOf, Health = health, Ref = refValue, Mult = m, ListPrice = listPrice, ListedDay = day, Wallet = w.Address };
|
||||
Sales.Add(s);
|
||||
return s;
|
||||
}
|
||||
@@ -104,7 +106,7 @@ namespace Decentralized.Domain
|
||||
public double HeldSales => Sales.Where(x => x.State == SaleState.Sold).Sum(x => (double)x.Proceeds);
|
||||
|
||||
/// <summary>每晚推进出售:上架的货按概率成交(假卡可能被看穿退货),成交的货款托管到期后进钱包。镇压期间平台下线,不推进。</summary>
|
||||
private void SalesNight(int day, bool crackdown, Wallet w, Func<string, double> price, Rng rng, List<BmEvent> ev)
|
||||
private void SalesNight(int day, bool crackdown, Func<string, Wallet> wallet, Func<string, double> price, Rng rng, List<BmEvent> ev)
|
||||
{
|
||||
if (crackdown) return;
|
||||
foreach (var s in Sales.Where(x => x.State == SaleState.Listed && x.ListedDay < day).ToList())
|
||||
@@ -130,6 +132,7 @@ namespace Decentralized.Domain
|
||||
{
|
||||
double p = price(Assets.CRT);
|
||||
if (p <= 0) continue;
|
||||
var w = wallet(s.Wallet);
|
||||
w.Add(Assets.CRT, s.Proceeds / p);
|
||||
w.Taint += s.Taint;
|
||||
w.Basis += s.Proceeds;
|
||||
|
||||
Reference in new issue
Block a user