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

External contract #271

Closed
carletex opened this issue Mar 30, 2023 · 2 comments · Fixed by #592
Closed

External contract #271

carletex opened this issue Mar 30, 2023 · 2 comments · Fixed by #592
Labels
discussion Further information is discussed

Comments

@carletex
Copy link
Member

We have really nice hooks (on top of wagmi's) for interacting with contracts deployed from SE-2 (leveraging on the hardhat_contracts.ts file).

Let's find the best way to do something similar with external contracts. E.g. You want your dApp to interact with the DAI contract. SE1 use a external_contracts.js file.

Ideally, as a builder, I'd like to use it the same way we use our custom hooks (same autocomplete / types magic).

  const { writeAsync } = useScaffoldContractWrite({
    contractName: "DaiContract",
    functionName: "transfer",
    args: [address, amount],
  });

I guess we could do that right now if we make the builder paste (in the right format) the contract info in hardhats_contracts.ts. But that's not very friendly.

So maybe a external_contracts.ts with a more clear format? Using wagmi's cli?

Check out this comment from @technophile-04 #200 (comment).

@carletex carletex added the discussion Further information is discussed label Mar 30, 2023
@KcPele
Copy link
Contributor

KcPele commented Jul 7, 2023

the hook should accepts the ABI and address of the contract right?

@sverps
Copy link
Collaborator

sverps commented Aug 2, 2023

I have made some progress on this (https://github.com/sverps/se-2/tree/feature/271-external-contracts) before my holidays. I'll see if I can find some time to pick this up again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Further information is discussed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants