Reflect libriften 9e3456d4 (feat(ido): native BCH xToken) in the indexer. An IDO priced in native BCH sets offer.xTokenCategory = null: proceeds ride as satoshi value and the permanent pool is a single-UTXO tokenbch-delegation pool (BCH reserve in value + oToken as the CashToken) instead of a two-leg tokentoken pool. The sibling tokenbch-delegation AMM (libriften 7b7cd569) is NOT indexed here — deferred per Hossein. - xTokenCategory is now Option<Vec<u8>> (serde Option<Hex>): native = None -> JSON null, matching libriften indexer-types (Hex | null). Old rows (always a hex string) deserialize to Some, so no migration. - Announcement parse: an all-zero category normalizes to None; dropped the now-obsolete "must be non-native" rejection. - build_offering_bytecode + PartialPostlaunchParameters take Option<&[u8]> and bake an empty (0x -> OP_0) push for native, matching encodeIdoXTokenCategory. - Recompiled IDO_POSTLAUNCH_CONTRACT 1627 -> 2309 bytes (native collect/run branches); all three IDO contract hexes now byte-match ido.json. - ACTIVE buy: native uses the offering's XWNT path — the entry XWNT flag is now required-iff-native (was always rejected); supply_amount is the entry output's value (no xToken storage output); a freshly minted owner nft shifts #3 -> #2. - POSTLAUNCH run: native single-UTXO pool leg read from output#0 (xTokenAmount = its value in sats, oTokenAmount = its token); collector xToken share read from output#3 value. The platform xToken share is BCH folded into output#5's value, so it is recovered as earnedAmount - output#0.value - output#3.value (the offering layer charges no IDO fee, so earnedAmount is the full xToken proceeds entering run); platformBchPayout excludes that share, leaving just the pot. No cargo this session (project constraint) — verified via rustfmt. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| bcmr | ||
| cashaddr | ||
| crc20 | ||
| db | ||
| rpc | ||
| chain.rs | ||
| def.rs | ||
| electrum.rs | ||
| index.rs | ||
| main.rs | ||
| signal.rs | ||
| timeutil.rs | ||
| utiltest.rs | ||
| utiltoken.rs | ||
| utiltx.rs | ||