Skip to content

Releases: shazow/whatsabi

v0.15.4

21 Oct 13:28
Compare
Choose a tag to compare

What's Changed

  • loaders: Avoid exception when Etherscan returns an empty response by @yohamta in #141
  • Handle multiple detected FixedProxyResolver better by @shazow in #143

Full Changelog: v0.15.3...v0.15.4

v0.15.3

10 Oct 22:44
Compare
Choose a tag to compare

What's Changed

  • disasm: Handle padded resolved address for FixedProxyResolver by @shazow in #140

Full Changelog: v0.15.2...v0.15.3

v0.15.2

03 Oct 13:10
Compare
Choose a tag to compare

What's Changed

  • src/auto.ts: check if contractResult.abi is not empty by @yohamta in #137
  • src/providers.ts: WithCachedCode, include prototype chain of Provider by @shazow in #138

Full Changelog: v0.15.1...v0.15.2

v0.15.1

02 Oct 15:17
Compare
Choose a tag to compare

What's Changed

  • providers: WithCachedCode should accept AnyProvider and make it compatible by @shazow in #134

Full Changelog: v0.15.0...v0.15.1

v0.15.0

01 Oct 18:36
Compare
Choose a tag to compare

Summary

whatsabi.providers.WithCachedCode

Added helper for caching getCode calls with autoload, useful for only resolving proxies when we already have the bytecode:

const address = "0x...";
const bytecode = "0x..."; // Already loaded from somewhere

const cachedCodeProvider = whatsabi.providers.WithCachedCode(provider, {
  [address]: bytecode,
});
const result = whatsabi.autoload(address, {
  provider: cachedCodeProvider,
  abiLoader: false, // Skip ABI loaders
  signatureLookup: false, // Skip looking up selector signatures
})

More docs here: https://shazow.github.io/whatsabi/modules/proxies.html

AutoloadResult.abiLoadedFrom

whatsabi.autoload will do everything necessary to load the ABI, which by default includes checking if it's already verified in public databases like Sourcify and Etherscan.

If the result is successfully loaded from an ABILoader, then it will be included in the AutoloadResult.abiLoadedFrom property. This is useful to distinguish if the result is from a verified database or whether WhatsABI had to resolve to doing its own internal static analysis to find selectors.

const result = whatsabi.autoload(address, config);
const loadedFrom = result.abiLoadedFrom?.name ?? "static analysis";
console.log("ABI loaded from:", loadedFrom);

More docs here: https://shazow.github.io/whatsabi/types/AutoloadResult.html

AutoloadResult.ContractResult

If we call whatsabi.autoload with setting { loadContractResult: true }, then we'll use the getContract loader APIs instead of loadABI which returns the full contract metadata (larger result and slower API call). The result will be included in the contractResult attribute, which also includes the full raw result in AutoloadResult.contractResult?.loaderResult.

const result = whatsabi.autoload(address, { provider, loadContractResult: true });
console.log(result.contractResult);

More docs here: https://shazow.github.io/whatsabi/types/loaders.ContractResult.html

What's Changed

  • src/loaders.ts: Add devdoc and userdoc support for SourcifyABILoader by @yohamta in #116
  • src/loader.ts: Add fallback for contract name in SourcifyABILoader by @yohamta in #121
  • loaders: Add AutoloadResult.abiLoadedFrom and plumb the result through MultiABILoader by @shazow in #122
  • Improve devex for only resolving proxies by @shazow in #120
  • loaders: Add loaderResult, remove {userdoc,devdoc} by @shazow in #127
  • loaders: Enhance ContractResult.loaderResult type by @yohamta in #128
  • autoload: AutoloadResult.ContractResult by @shazow in #131

New Contributors

Full Changelog: v0.14.1...v0.15.0

v0.14.1

12 Aug 15:01
Compare
Choose a tag to compare

Minor fix: Added exported whatsabi.errors types: https://shazow.github.io/whatsabi/modules/whatsabi.errors.html

Full Changelog: v0.14.0...v0.14.1

v0.14.0

09 Aug 20:27
7b28a95
Compare
Choose a tag to compare

Summary

What's Changed

New Contributors

Full Changelog: v0.13.2...v0.14.0

v0.13.2

15 Jul 15:52
6cadc63
Compare
Choose a tag to compare

What's Changed

  • src/types.ts: Add support for ethers.FallbackProvider by @shazow in #96

Full Changelog: v0.13.1...v0.13.2

v0.13.1

10 Jul 20:36
Compare
Choose a tag to compare

Summary

Improved provider support by relying on lower-level RPC methods whenever possible.

Fixed support for viem 2.x and web3.js

What's Changed

  • switch viem and ethersv5 provider order by @Plopmenz in #94
  • Improve provider abstraction: Use low level RPC whenever possible by @shazow in #95
  • Added web3js to the test matrix

New Contributors

Full Changelog: v0.12.0...v0.13.1

v0.12.0

15 Jun 14:44
Compare
Choose a tag to compare

Summary

Added optional addressResolver override for autoload:

const result = await whatsabi.autoload(address, {
  provider: provider,
  // ...
  // Example: Use viem to resolve ENS addresses
  addressResolver: async (name) => {
    return await publicClient.getEnsAddress({ name })
  },
}

Otherwise minor improvement to disassembling and the test suite.

What's Changed

  • disasm: Detect inverted selector jump condition (with fallback) by @shazow in #85
  • auto: Add addressResolver config by @shazow in #91
  • src/tests/env.ts: Use public RPC by @shazow in #92

Full Changelog: v0.11.0...v0.12.0