Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: auto.AutoloadConfig.fallbackLoad #119

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

WIP: auto.AutoloadConfig.fallbackLoad #119

wants to merge 1 commit into from

Conversation

shazow
Copy link
Owner

@shazow shazow commented Sep 18, 2024

This was originally merged via #113 but after sleeping on it, it still feels underbaked so I reverted it and now re-opening here for progress tracking.

Feels like this might be better done by adding additional fallback loaders instead. Would be nice if we could verify that the bytecode matches, but we can do that with the getContract API.

Example:

 // USDT, available on both PulseChain and Mainnet (but only verified on mainnet)
const address = "0xdAC17F958D2ee523a2206206994597C13D831ec7";
const result = await autoload(address, {
  provider: pulseChainProvider,
  fallbackLoad: {
    mainnnetProvider,
    ...whatsabi.loaders.defaultsWithEnv(env),
  }
});
console.log(result); // {isVerified: true, abi: [...], ...}

@shazow shazow changed the title auto: fallbackLoad WIP: auto: fallbackLoad Sep 18, 2024
@shazow shazow added someday Good idea but not planned yet maybe Not sure if this is a good idea yet labels Sep 18, 2024
@shazow shazow changed the title WIP: auto: fallbackLoad WIP: auto.AutoloadConfig.fallbackLoad Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maybe Not sure if this is a good idea yet someday Good idea but not planned yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants