Some checks failed
CI/CD Pipeline / Solidity Contracts (push) Failing after 1m12s
CI/CD Pipeline / Security Scanning (push) Successful in 2m38s
CI/CD Pipeline / Lint and Format (push) Failing after 40s
CI/CD Pipeline / Terraform Validation (push) Failing after 21s
CI/CD Pipeline / Kubernetes Validation (push) Successful in 24s
HYBX OMNL TypeScript & anchor / token-aggregation build + reconcile artifact (push) Failing after 24s
Validation / validate-genesis (push) Successful in 26s
Validation / validate-terraform (push) Failing after 21s
Validation / validate-kubernetes (push) Failing after 9s
Validation / validate-smart-contracts (push) Failing after 9s
Validation / validate-security (push) Failing after 1m7s
Validation / validate-documentation (push) Failing after 15s
Resolve etherscanLinks from batch metadata and optional mainnet log scans; serve a fast local-batch attestation path for the explorer CT. Co-authored-by: Cursor <cursoragent@cursor.com>
49 lines
2.1 KiB
JavaScript
49 lines
2.1 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.PAYMENT_ATTESTED_TOPIC0 = void 0;
|
|
exports.decodePaymentAttestedLogs = decodePaymentAttestedLogs;
|
|
const ethers_1 = require("ethers");
|
|
const chain138Explorer_1 = require("./chain138Explorer");
|
|
/** topic0 = PaymentAttested(bytes32,bytes32,address,address,bytes32,...) — matches cast sig-event */
|
|
exports.PAYMENT_ATTESTED_TOPIC0 = '0x827a09f9798dc544d2acc52ecdad1fe0f5fa859be89a74a39dd7cb986b4cb340';
|
|
function decodePaymentAttestedLogs(envelope, explorerBase) {
|
|
if (envelope.status !== '1' || !Array.isArray(envelope.result))
|
|
return [];
|
|
const out = [];
|
|
for (const log of envelope.result) {
|
|
const t = log.topics ?? [];
|
|
if (t.length < 4 || !log.transactionHash)
|
|
continue;
|
|
const chain138TxHash = (0, chain138Explorer_1.chain138TxHashFromLogTopic)(t[1]);
|
|
if (!chain138TxHash)
|
|
continue;
|
|
const instructionId = t[2] ?? '';
|
|
const creditor = t[3] ? ethers_1.ethers.getAddress('0x' + t[3].slice(-40)) : '';
|
|
let debtor = '';
|
|
let uetr = '';
|
|
if (log.data && log.data.length >= 130) {
|
|
try {
|
|
const decoded = ethers_1.ethers.AbiCoder.defaultAbiCoder().decode(['address', 'bytes32', 'uint64', 'uint8', 'uint256', 'uint64', 'bytes32', 'bytes32', 'bytes32', 'bytes32', 'bytes32', 'bytes32', 'uint256'], log.data);
|
|
debtor = String(decoded[0]);
|
|
uetr = ethers_1.ethers.hexlify(decoded[1]);
|
|
}
|
|
catch {
|
|
/* non-fatal */
|
|
}
|
|
}
|
|
out.push({
|
|
chain138TxHash,
|
|
chain138ExplorerUrl: (0, chain138Explorer_1.chain138ExplorerTxUrl)(chain138TxHash, explorerBase),
|
|
instructionId,
|
|
uetr,
|
|
creditor,
|
|
debtor,
|
|
mainnetTxHash: log.transactionHash,
|
|
mainnetExplorerUrl: `https://etherscan.io/tx/${log.transactionHash}`,
|
|
blockNumber: String(log.blockNumber ?? ''),
|
|
logIndex: String(log.logIndex ?? ''),
|
|
});
|
|
}
|
|
return out;
|
|
}
|