#!/usr/bin/env python3 """READ-ONLY reproduction: Maker ETH-B GemJoin Reconstructed for portability; NOT rerun when this map was built. The map displays older archived evidence, not output generated by this script. Default RPC: https://rpc.pulsechain.com (public). Override with --rpc. Python standard library only; no keys/signatures/broadcasts. Archive-state access is required at the saved block. trace_callMany is client-dependent. """ import argparse, copy, datetime, json, urllib.request CALLS = [{'label': 'end.ETH-B.fix(bytes32)', 'request': {'jsonrpc': '2.0', 'id': 1, 'method': 'eth_call', 'params': [{'to': '0x0e2e8f1d1326a4b9633d96222ce399c708b19c28', 'data': '0x63fad85e4554482d42000000000000000000000000000000000000000000000000000000'}, '0x1a896ff']}}, {'label': 'ETH-B.endGem', 'request': {'jsonrpc': '2.0', 'id': 1, 'method': 'eth_call', 'params': [{'to': '0x35d1b3f3d7966a1dfe207aa4514c12a259a0492b', 'data': '0x214414d54554482d420000000000000000000000000000000000000000000000000000000000000000000000000000000e2e8f1d1326a4b9633d96222ce399c708b19c28'}, '0x1a896ff']}}, {'label': 'ETH-B.wethBalance', 'request': {'jsonrpc': '2.0', 'id': 1, 'method': 'eth_call', 'params': [{'to': '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', 'data': '0x70a0823100000000000000000000000008638ef1a205be6762a8b935f5da9b700cf7322c'}, '0x1a896ff']}}, {'label': 'eleven_state_continuing_calls', 'request': {'jsonrpc': '2.0', 'id': 1, 'method': 'trace_callMany', 'params': [[[{'to': '0x6b175474e89094c44da98b954eedeac495271d0f', 'data': '0x095ea7b30000000000000000000000009759a6ac90977b93b58547b4a71c78317f391a280000000000000000000000000000000000000000000000000de0b6b3a7640000', 'from': '0xd4ac95936b55d10e4bc5acdc5511df29f399f777'}, ['trace', 'stateDiff']], [{'to': '0x9759a6ac90977b93b58547b4a71c78317f391a28', 'data': '0x3b4da69f000000000000000000000000d4ac95936b55d10e4bc5acdc5511df29f399f7770000000000000000000000000000000000000000000000000de0b6b3a7640000', 'from': '0xd4ac95936b55d10e4bc5acdc5511df29f399f777'}, ['trace', 'stateDiff']], [{'to': '0x35d1b3f3d7966a1dfe207aa4514c12a259a0492b', 'data': '0xa3b22fc40000000000000000000000000e2e8f1d1326a4b9633d96222ce399c708b19c28', 'from': '0xd4ac95936b55d10e4bc5acdc5511df29f399f777'}, ['trace', 'stateDiff']], [{'to': '0x0e2e8f1d1326a4b9633d96222ce399c708b19c28', 'data': '0x6ea425550000000000000000000000000000000000000000000000000de0b6b3a7640000', 'from': '0xd4ac95936b55d10e4bc5acdc5511df29f399f777'}, ['trace', 'stateDiff']], [{'to': '0x0e2e8f1d1326a4b9633d96222ce399c708b19c28', 'data': '0xfe8507c64554482d410000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de0b6b3a7640000', 'from': '0xd4ac95936b55d10e4bc5acdc5511df29f399f777'}, ['trace', 'stateDiff']], [{'to': '0x2f0b23f53734252bda2277357e97e1517d6b042a', 'data': '0xef693bed000000000000000000000000d4ac95936b55d10e4bc5acdc5511df29f399f777000000000000000000000000000000000000000000000000000094a556edd023', 'from': '0xd4ac95936b55d10e4bc5acdc5511df29f399f777'}, ['trace', 'stateDiff']], [{'to': '0x0e2e8f1d1326a4b9633d96222ce399c708b19c28', 'data': '0xfe8507c64554482d420000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de0b6b3a7640000', 'from': '0xd4ac95936b55d10e4bc5acdc5511df29f399f777'}, ['trace', 'stateDiff']], [{'to': '0x08638ef1a205be6762a8b935f5da9b700cf7322c', 'data': '0xef693bed000000000000000000000000d4ac95936b55d10e4bc5acdc5511df29f399f77700000000000000000000000000000000000000000000000000005bde50338f60', 'from': '0xd4ac95936b55d10e4bc5acdc5511df29f399f777'}, ['trace', 'stateDiff']], [{'to': '0x0e2e8f1d1326a4b9633d96222ce399c708b19c28', 'data': '0xfe8507c64554482d430000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000de0b6b3a7640000', 'from': '0xd4ac95936b55d10e4bc5acdc5511df29f399f777'}, ['trace', 'stateDiff']], [{'to': '0xf04a5cc80b1e94c69b48f5ee68a08cd2f09a7c3e', 'data': '0xef693bed000000000000000000000000d4ac95936b55d10e4bc5acdc5511df29f399f77700000000000000000000000000000000000000000000000000005f2094ce56f2', 'from': '0xd4ac95936b55d10e4bc5acdc5511df29f399f777'}, ['trace', 'stateDiff']], [{'from': '0xd4ac95936b55d10e4bc5acdc5511df29f399f777', 'to': '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2', 'data': '0x2e1a7d4d00000000000000000000000000000000000000000000000000014fa43befb675'}, ['trace', 'stateDiff']]], '0x1a896ff']}}] ALLOWED = {"eth_call", "eth_getCode", "eth_getStorageAt", "eth_getBalance", "eth_getTransactionByHash", "eth_getTransactionReceipt", "eth_getBlockByNumber", "eth_getLogs", "trace_callMany", "debug_traceTransaction", "trace_transaction", "eth_chainId", "ots_traceTransaction"} def rpc(url, method, params, timeout): if method not in ALLOWED: raise ValueError("Method not allowed by this read-only script: " + method) body = {"jsonrpc": "2.0", "id": 1, "method": method, "params": params} request = urllib.request.Request(url, json.dumps(body).encode(), {"Content-Type": "application/json", "User-Agent": "pSTABLES-readonly-check/1.0"}) with urllib.request.urlopen(request, timeout=timeout) as response: return json.load(response) def main(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("--rpc", default="https://rpc.pulsechain.com") parser.add_argument("--pin", type=lambda value: int(value, 0), help="Optional state-block override; historical transaction hashes and calldata remain unchanged") parser.add_argument("--timeout", type=int, default=90) parser.add_argument("--output", help="Optional JSON output filename; otherwise stdout") parser.add_argument("--print-requests", action="store_true", help="Inspect requests without connecting to any RPC") args = parser.parse_args() calls = copy.deepcopy(CALLS) for row in calls: q = row["request"] if args.pin is not None and q["method"] in {"eth_call", "eth_getCode", "eth_getStorageAt", "eth_getBalance", "eth_getTransactionCount", "trace_callMany"}: q["params"][-1] = hex(args.pin) if args.print_requests: print(json.dumps(calls, indent=2)); return chain = rpc(args.rpc, "eth_chainId", [], args.timeout) if chain.get("result") != "0x171": raise RuntimeError("Expected PulseChain chain ID 369; got " + str(chain)) output = {"generated_utc": datetime.datetime.now(datetime.timezone.utc).isoformat(), "read_only": True, "signed_or_broadcast": False, "pin_override": args.pin, "reads": []} for row in calls: q = row["request"] try: response = rpc(args.rpc, q["method"], q["params"], args.timeout) except Exception as error: response = {"transport_error": str(error)} output["reads"].append({"label": row["label"], "request": q, "response": response}) text = json.dumps(output, indent=2) if args.output: with open(args.output, "w", encoding="utf-8") as target: target.write(text + "\n") else: print(text) if __name__ == "__main__": main()