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

refactor: update swap to use templating #30

Merged
merged 2 commits into from
Jul 26, 2023
Merged

refactor: update swap to use templating #30

merged 2 commits into from
Jul 26, 2023

Conversation

fadeev
Copy link
Member

@fadeev fadeev commented Jul 25, 2023

Use templating for the swap tutorial.

Context: zeta-chain/docs#74

const [signer] = await hre.ethers.getSigners();
console.log(`🔑 Using account: ${signer.address}\n`);

const targetZRC20 = getAddress("zrc20" as any, args.destination as any);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to use any here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, we don't need any for zrc20, but we need to cast to any for the network name, because getAddress expects the second argument to be of type ZetaProtocolNetwork and. I think importing types just for arguments is a bit of an overkill.

Copy link

@lucas-janon lucas-janon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@fadeev fadeev merged commit 218f674 into main Jul 26, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants