我正在研究如何制作 BEP-20 代币。为此,我在 remix 中复制了以下合约以进行研究:
如果我复制整个文件并在 Remix 中编译它,当我部署它时,它不会显示任何 getter。没有公共视图功能出现。如果我查看测试网上显示的合约,它也没有任何代币供应。
我将文件和库分开以便更好地阅读。然后,当我尝试显示它时,出现以下错误:
VM error: revert. revert The transaction has been reverted to the initial state. Note: The called function should be payable if you send value and the value you send should be less than your current balance. Debug the transaction to get more information.
这让我觉得这个合约没有生成代币......我错了什么?
答案 0 :(得分:0)
我设法解决了这个问题。正如我所怀疑的,为了部署合同,我必须删除与 uniswap 和 cakeswap 相关的所有内容。这将正确显示合同。
如果您想在注入的 web3 中使用 uniswap 接口部署合约,则需要 uniswap 测试网。
我在这里找到了蛋糕的测试地址: Binance Smart change tesnet