Releases: shazow/whatsabi
Releases · shazow/whatsabi
v0.13.2
v0.13.1
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
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
v0.11.0
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
- README, .env.example: Add env example by @shazow in #79
- feat: getContract by @SonOfMosiah in #77
- loaders: getContract returns non-nullable ContractResult by @shazow in #81
- Release v0.11.0 by @shazow in #82
Full Changelog: v0.10.1...v0.11.0
v0.10.1
Summary
loaders.defaultsWithApiKeys
is nowloaders.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
- Add a baseURL param to defaultsWithAPIKeys by @SonOfMosiah in #73
- loaders.defaultsWithEnv by @shazow in #74
- Switch to tsx, pnpm update by @shazow in #75
New Contributors
- @SonOfMosiah made their first contribution in #73
Full Changelog: v0.10.0...v0.10.1
v0.10.0
Summary
[Update: Useloaders.defaultsWithAPIKeys(env)
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 withproxy.facets(provider, address)
orproxy.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
- Fix syntax issues in the code in the 'usage' section of README by @Autosaida in #64
- DiamondProxy: Load internal facets and selectors by @shazow in #65
- disasm: Fix false positive selectors when looking for ISZERO selectors by @shazow in #68
examples/benchmark-selectors.ts
: Add benchmark example, improve selector loading performance when bypassing full parsing by @shazow in #71
New Contributors
- @Autosaida made their first contribution in #64
Full Changelog: v0.9.1...v0.10.0
v0.9.1
v0.9.0
What's Changed
- loaders: add
chainId
to sourcify loader by @jxom in #60 - autoload: Fix EOA handling for viem #61
- disasm: Include empty "name" fields in inputs/outputs of ABI results, to be more spec compliant #61
New Contributors
Full Changelog: v0.8.6...v0.9.0
v0.8.6
v0.8.5
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: v0.8.2...v0.8.5