【发布时间】:2021-07-21 08:31:51
【问题描述】:
我正在remix 上学习稳固性 我还引用了这个open source api 来创建令牌。
是的 here 他们提供了一个 _totalSupply() 函数,我想将它连接到我的智能合约,以便它显示我为什么部署它的代币总量。
这里做错了什么?
pragma solidity ^0.8.0;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";
contract Foobar is ERC20 {
constructor(uint256 initialSupply) public ERC20("Foobar", "FOO") {
_mint(msg.sender, initialSupply);
// add totalSupply here
_totalSupply(uint256 5000000000000000000000000000000000000000);
}
}
【问题讨论】: