使用openzepplin库合约

怎样在openzepplin的ERC20PresetMinterPauser.sol合约上加个token上限?

请先 登录 后评论

最佳答案 4天前

在自己的实现合约里,重载(重新实现)mint 方法,例如:

function mint(address to, uint256 amount) public override {
 require(totalSupply() <= 上限, "超上限了");   
super.mint(to, amount);
    }
请先 登录 后评论

其它 0 个回答

  • 1 关注
  • 0 收藏,82 浏览
  • 越泽 提出于 4天前

相似问题