Rubric red flag 4 sharpened (Marty 2026-11-16): forced High only when earlier buyers are paid from later buyers' payments; sponsor commissions on a delivered product are disclosed and scored, not auto-flagged
Deterministic payout read (chain/payouts.py): every payout matched to the buyer of the same tx and classed operator / referral line / earlier buyer outside the line. Earlier-buyer payouts = VERIFIED red flag 4. A model red flag 4 is INFERRED, must cite evidence, and is not applied when the chain shows only operator and referral-line payouts (shown on the report as 'Considered and not applied'). Same test for every contract. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+11
-1
@@ -368,7 +368,7 @@ def main():
|
||||
'in_creation_tx': bool(creation_tx and l['transactionHash'].lower() == creation_tx)})
|
||||
E['admin_events'] = adm[:80]
|
||||
# decode the contract's own events with the verified ABI (static fields only): counts, sums of number fields, top addresses
|
||||
dec_ev = {}
|
||||
dec_ev = {}; dec_rows = {}
|
||||
abi_events = {keccak.topic(abi_sig(f)): f for f in abi if isinstance(f, dict) and f.get('type') == 'event' and f.get('name') and not f.get('anonymous')}
|
||||
for t, f in abi_events.items():
|
||||
if t in ADMIN_EVENTS or t in (TRANSFER, APPROVAL): continue
|
||||
@@ -392,6 +392,7 @@ def main():
|
||||
else: v = raw
|
||||
row[nm] = v
|
||||
if len(samples) < 5: samples.append({'block': int(l['blockNumber'], 16), 'tx': l['transactionHash'].lower(), 'fields': row})
|
||||
dec_rows.setdefault(abi_sig(f), []).append((int(l['blockNumber'], 16), int(l['logIndex'], 16), l['transactionHash'].lower(), row))
|
||||
dec_ev[abi_sig(f)] = {'count': len(ls), 'uint_field_sums_raw': dict(sums), 'top_addresses': {k: v.most_common(8) for k, v in addrs.items()}, 'first_samples': samples}
|
||||
E['decoded_events'] = dec_ev
|
||||
ups = [x for x in adm if x['event'] == 'Upgraded(address)']
|
||||
@@ -497,6 +498,15 @@ def main():
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# ---- who gets paid when someone buys (rubric red flag 4: earlier buyers paid from later buyers' payments)
|
||||
step('payouts')
|
||||
try:
|
||||
import payouts
|
||||
tl = lambda l, i: (int(l['blockNumber'], 16), int(l['logIndex'], 16), l['transactionHash'].lower(), topic_addr(l['topics'][i]), int(l['data'], 16) if l['data'] not in ('0x', '') else 0)
|
||||
E['payout_relations'] = payouts.analyse(E, dec_rows, [tl(l, 1) for l in tin], [tl(l, 2) for l in out])
|
||||
except Exception as e:
|
||||
E['payout_relations'] = {'error': str(e)[:200]}
|
||||
|
||||
# ---- profiles of labelled wallets (roles + deployer + top recipients)
|
||||
step('wallets')
|
||||
recv = collections.Counter();
|
||||
|
||||
Reference in New Issue
Block a user