Hey @carboncoffee,
The thread is a bit old, so I'm answering but feel free to open another support request if someone has a different question.
The ERC20Capped receives the cap
during construction, and should be used like:
contract Token is ERC20, ERC20Capped {
constructor(string memory name, string memory symbol, uint256 cap) ERC20(name, symbol) ERC20Capped(cap) {}
/// @dev For testing purposes. Note that access control is missing here and anyone can mint infinite tokens with this function setup !!!
function mint(address account, uint256 amount) public {
_mint(account, amount);
}
function _mint(address account, uint256 amount) internal override(ERC20Capped, ERC20) {
super._mint(account, amount);
}
}
Make sure to fully understand how inheritance works, and always write tests to validate the behavior you expect.