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

在54 跨链桥的章节中貌似存在一个注释错误 #759

Open
1 task done
BreakALegCml opened this issue Jul 3, 2024 · 0 comments
Open
1 task done

在54 跨链桥的章节中貌似存在一个注释错误 #759

BreakALegCml opened this issue Jul 3, 2024 · 0 comments

Comments

@BreakALegCml
Copy link

BreakALegCml commented Jul 3, 2024

Details(细节)

章节中用来监听burn和mint 事件Ethers.js的执行mint动作的代码中,作者写的注释是「执行burn操作」,但是我看代码的意图不是在另一条链进行mint么?
// 在执行burn操作

const main = async () => {
try{
console.log(`开始监听跨链事件`)
// 监听chain Sepolia的Bridge事件,然后在Goerli上执行mint操作,完成跨链
contractSepolia.on("Bridge", async (user, amount) => {
console.log(`Bridge event on Chain Sepolia: User ${user} burned ${amount} tokens`);
// 在执行burn操作
let tx = await contractGoerli.mint(user, amount);
await tx.wait();
console.log(`Minted ${amount} tokens to ${user} on Chain Goerli`);
});
// 监听chain Sepolia的Bridge事件,然后在Goerli上执行mint操作,完成跨链
contractGoerli.on("Bridge", async (user, amount) => {
console.log(`Bridge event on Chain Goerli: User ${user} burned ${amount} tokens`);
// 在执行burn操作
let tx = await contractSepolia.mint(user, amount);
await tx.wait();
console.log(`Minted ${amount} tokens to ${user} on Chain Sepolia`);
});
}catch(e){
console.log(e);
}

Are you willing to submit a PR?(你愿意提交PR吗?)

  • Yes I am willing to submit a PR!(是的我愿意)
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

No branches or pull requests

1 participant