Whatsabi Versions Save

Extract the ABI (and other metadata) from Ethereum bytecode, even without source code.

v0.11.0

4 months ago

Summary

Our ABI loaders learned about contract metadata with ABILoader.getContract(address): Promise<ContractResult>, thanks to @SonOfMosiah!

const loader = new whatsabi.loaders.SourcifyABILoader();
// Previously: const abi = await loader.loadABI(address);
const { abi, name, evmVersion, compilerVersion, runs, ok } = await loader.getContract(address);
if (!ok) throw new Error("contract not found");
...

What's Changed

Full Changelog: https://github.com/shazow/whatsabi/compare/v0.10.1...v0.11.0

v0.10.1

5 months ago

Summary

  • loaders.defaultsWithApiKeys is now loaders.defaultsWithEnv, supporting more overrides: SOURCIFY_CHAIN_ID, ETHERSCAN_BASE_URL, ETHERSCAN_API_KEY (thanks @SonOfMosiah).

Example:

const result = await whatsabi.autoload(address, {
  provider: provider,
  ... whatsabi.loaders.defaultsWithEnv({
    SOURCIFY_CHAIN_ID: 42161,
    ETHERSCAN_BASE_URL: "https://api.arbiscan.io/api",
    ETHERSCAN_API_KEY: "MYSECRETAPIKEY",
  }),
});

What's Changed

New Contributors

Full Changelog: https://github.com/shazow/whatsabi/compare/v0.10.0...v0.10.1

v0.10.0

5 months ago

Summary

  • loaders.defaultsWithAPIKeys(env) [Update: Use loaders.defaultsWithEnv in v0.10.1]: New helper for initializing default loaders with your own API keys (and more):
    const env = { ETHERSCAN_API_KEY: "<YOUR KEY>" }; // or process.env
    const r = await whatsabi.autoload(address, {
      provider,
      ...whatsabi.loaders.defaultsWithEnv(env),
    });
    
  • proxies.DiamondProxy now knows how to load all registered facets with proxy.facets(provider, address) or proxy.selectors(provider, address). Shoutout to @banteg for helping figure this out.
  • selectorsFromBytecode will now return as soon as the jump table is processed, for faster performance when just extracting selectors.
  • Shoutout to @cdump for making and sharing a benchmarking suite (#66), this prompted several improvements to whatsabi (false positives should be fixed, and performance improved). Also check out evmole, the bytecode-based parameter type guessing is very impressive!

What's Changed

New Contributors

Full Changelog: https://github.com/shazow/whatsabi/compare/v0.9.1...v0.10.0

v0.9.1

7 months ago

What's Changed

Full Changelog: https://github.com/shazow/whatsabi/compare/v0.9.0...v0.9.1

v0.9.0

8 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/shazow/whatsabi/compare/v0.8.6...v0.9.0

v0.8.6

8 months ago

What's Changed

Full Changelog: https://github.com/shazow/whatsabi/compare/v0.8.5...v0.8.6

v0.8.5

8 months ago

What's Changed

  • Mainly packaging changes. Trying to get the ESM and CJS builds to work in more environments. Sorry for the release spam.

Full Changelog: https://github.com/shazow/whatsabi/compare/v0.8.2...v0.8.5

v0.8.2

9 months ago

What's Changed

  • autoload: Include empty name keys when name is unknown (as per spec). 😑
  • Updated examples/*.ts code to latest WhatsABI and Ethers v6

Full Changelog: https://github.com/shazow/whatsabi/compare/v0.8.0...v0.8.2

v0.8.1

9 months ago

What's Changed

Full Changelog: https://github.com/shazow/whatsabi/compare/v0.8.0...v0.8.1

v0.8.0

9 months ago

What's Changed

  • 🤗 More provider-agnostic, tested with Ethers.js (v5 and v6) and Viem. (#48)
  • 🤏 Reduced bundle size to 12 KB ❗ (#48)
  • ⚒️ Changed build process to include esm+commonjs+types in the package, please open an issue if there are environments where WhatsABI is not importing properly.

Full Changelog: https://github.com/shazow/whatsabi/compare/v0.7.0...v0.8.0