# How do I integrated a cap into a templated contract from the wizard

**URL:** <https://forum.openzeppelin.com/t/how-do-i-integrated-a-cap-into-a-templated-contract-from-the-wizard/34919>\
**Category:** Contracts\
**Created:** [February 25, 2023, 4:10pm UTC](https://forum.openzeppelin.com/t/how-do-i-integrated-a-cap-into-a-templated-contract-from-the-wizard/34919 "2023-02-25T16:10:15Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ernestognw](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/ernestognw/32/18576_2.png) [@ernestognw](https://forum.openzeppelin.com/u/ernestognw)\
**Post date:** [February 26, 2023, 5:23pm UTC](https://forum.openzeppelin.com/t/how-do-i-integrated-a-cap-into-a-templated-contract-from-the-wizard/34919/3 "2023-02-26T17:23:50Z")

</div>

Hey @carboncoffee,

Seems like you've figured it out. However, you're re implementing the `_mint` function, and although it works, you can use `super.mint()` with the original `ERC20Capped`, you can see how this plays out by referring to the [Solidity Inheritance docs](https://docs.soliditylang.org/en/v0.8.17/contracts.html#inheritance)

The ERC20Capped receives the `cap` during construction, and should be used like:

```plaintext
contract Token is ERC20, ..., ERC20Capped {
  function _mint(address account, uint256 amount) internal override(ERC20Capped, ERC20) {
      super._mint(account, amount);
  }
}

```

Quick tested with the example I shared in the [other thread](https://forum.openzeppelin.com/t/how-to-add-max-supply-to-a-mintable-erc20-token-on-polygon-chain/11386/8) and the cap work as expected.

Best

---

_[View the full topic](https://forum.openzeppelin.com/t/how-do-i-integrated-a-cap-into-a-templated-contract-from-the-wizard/34919)._
