简体   繁体   English

如何在多条链上使用 erc20 自定义代币?

[英]How to use erc20 custom token on multiple chains?

If erc20 tokens are deplopyed on ethereum and dapp is on polygon, we cannot use the following code如果 erc20 代币部署在以太坊上并且 dapp 在多边形上,我们不能使用以下代码

IERC20 token = IERC20(add);

So to use my tokens on polygon dapp as a payment, I can use bridging.因此,要将我在多边形 dapp 上的代币用作付款,我可以使用桥接。 If I send my tokens to polygon through bridging, bridging service will create a new contract on my behalf and I can use the new contract's address in my polygon dapp's contract file.如果我通过桥接将我的代币发送到多边形,桥接服务将代表我创建一个新合同,我可以在我的多边形 dapp 合同文件中使用新合同的地址。 (Is my concept on bridging right?) (我的桥接概念对吗?)

But I feel like this is a little problematic approach and gas fees is also big issue here.但我觉得这是一个有点问题的方法,而且汽油费在这里也是一个大问题。 So I was thinking if it is possible to deploy two contracts for my same tokens - one on ethereum and the other on polygon.所以我在想是否可以为我的同一个代币部署两个合约——一个在以太坊上,另一个在多边形上。 Is it a bad practice?这是一个不好的做法吗? Will it create a coin inconsistency?它会造成硬币不一致吗?

Please help.请帮忙。 I am looking for an appropriate answer for a long time.我一直在寻找合适的答案。 Couldn't have found any yet.还没有找到。

Is it a bad practice?这是一个不好的做法吗?

Yes.是的。

Will it create a coin inconsistency?它会造成硬币不一致吗?

Yes.是的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM