@bgd-labs/toolbox 0.0.37 → 0.0.38

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/node.mjs CHANGED
@@ -33594,44 +33594,6 @@ async function renderTenderlyReport({
33594
33594
  config,
33595
33595
  getContractName = (sim2, address) => getMdContractName(sim2.contracts, address)
33596
33596
  }) {
33597
- const events = sim.transaction.transaction_info?.logs ? tenderly_logsToAbiLogs(sim.transaction.transaction_info?.logs) : [];
33598
- events.map((e) => {
33599
- if (!eventCache.find((eC) => JSON.stringify(eC) === JSON.stringify(e))) {
33600
- eventCache.push(e);
33601
- }
33602
- });
33603
- const logs = await enhanceLogs(
33604
- client,
33605
- parseLogs({
33606
- logs: (sim.transaction.transaction_info.logs || []).map(
33607
- (l) => l.raw
33608
- ),
33609
- eventDb: eventCache
33610
- })
33611
- );
33612
- const selfDestruct = await checkForSelfdestruct(
33613
- client,
33614
- sim.transaction.addresses,
33615
- []
33616
- // trusted addresses
33617
- );
33618
- const verified = await getVerificationStatus({
33619
- client,
33620
- addresses: sim.transaction.addresses,
33621
- // In the future we might want to maintain our own db, so we do not need to rely on tenderly so much for contract name lookup.
33622
- contractDb: sim.contracts.reduce(
33623
- (acc, val) => {
33624
- acc[val.address] = val.contract_name;
33625
- return acc;
33626
- },
33627
- {}
33628
- ),
33629
- apiKey: config.etherscanApiKey
33630
- });
33631
- const stateDiff = await enhanceStateDiff(
33632
- client,
33633
- transformTenderlyStateDiff(sim.transaction.transaction_info.state_diff)
33634
- );
33635
33597
  let report = `## Payload ${payloadId} on ${client.chain.name}
33636
33598
 
33637
33599
  - creator: ${payload.creator}
@@ -33672,6 +33634,49 @@ ${payload.actions.map(
33672
33634
  }
33673
33635
  }
33674
33636
  report += "\n";
33637
+ if (sim.simulation.status === false) {
33638
+ report += `### :sos: simulation failed: ${sim.transaction.error_message}
33639
+ `;
33640
+ return { report, eventCache };
33641
+ }
33642
+ const events = sim.transaction.transaction_info?.logs ? tenderly_logsToAbiLogs(sim.transaction.transaction_info?.logs) : [];
33643
+ events.map((e) => {
33644
+ if (!eventCache.find((eC) => JSON.stringify(eC) === JSON.stringify(e))) {
33645
+ eventCache.push(e);
33646
+ }
33647
+ });
33648
+ const logs = await enhanceLogs(
33649
+ client,
33650
+ parseLogs({
33651
+ logs: (sim.transaction.transaction_info.logs || []).map(
33652
+ (l) => l.raw
33653
+ ),
33654
+ eventDb: eventCache
33655
+ })
33656
+ );
33657
+ const selfDestruct = await checkForSelfdestruct(
33658
+ client,
33659
+ sim.transaction.addresses,
33660
+ []
33661
+ // trusted addresses
33662
+ );
33663
+ const verified = await getVerificationStatus({
33664
+ client,
33665
+ addresses: sim.transaction.addresses,
33666
+ // In the future we might want to maintain our own db, so we do not need to rely on tenderly so much for contract name lookup.
33667
+ contractDb: sim.contracts.reduce(
33668
+ (acc, val) => {
33669
+ acc[val.address] = val.contract_name;
33670
+ return acc;
33671
+ },
33672
+ {}
33673
+ ),
33674
+ apiKey: config.etherscanApiKey
33675
+ });
33676
+ const stateDiff = await enhanceStateDiff(
33677
+ client,
33678
+ transformTenderlyStateDiff(sim.transaction.transaction_info.state_diff)
33679
+ );
33675
33680
  if (verified.find((contract) => contract.status === 2 /* ERROR */)) {
33676
33681
  report += `:sos: Found unverified contracts!
33677
33682