# Create deflationary ERC20 token

**URL:** <https://forum.openzeppelin.com/t/create-deflationary-erc20-token/3647>\
**Category:** Contracts\
**Created:** [August 27, 2020, 8:23am UTC](https://forum.openzeppelin.com/t/create-deflationary-erc20-token/3647 "2020-08-27T08:23:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rahaman](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/rahaman/32/2299_2.png) [@Rahaman](https://forum.openzeppelin.com/u/Rahaman)\
**Post date:** [August 27, 2020, 8:23am UTC](https://forum.openzeppelin.com/t/create-deflationary-erc20-token/3647/1 "2020-08-27T08:23:41Z")

</div>

Hi  
I want an ERC20 token with burning function like this ([How to create an ERC20 Token with burn and stop burn feature?](https://forum.openzeppelin.com/t/how-to-create-an-erc20-token-with-burn-and-stop-burn-feature/1048)) if an wallet have \<=1,00 to XYZ token then when transfer from this wallet to any wallet any amount then 5% will burn, and if the wallet holding \<=5,00 XYZ token then burn 4% and if the wallet holding \<=1,000 XYZ then burn 3% like same way if \<=5,000 XYZ burn 3%, if \<=10,000 XYZ burn 2% and if holding \>=20,000 then burn only 0%

Thanks for help and give your time ! 💞

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [August 27, 2020, 8:51am UTC](https://forum.openzeppelin.com/t/create-deflationary-erc20-token/3647/2 "2020-08-27T08:51:35Z")

</div>

Hi @Rahaman,

First of all, I suggest looking at [Points to consider when creating a fungible token (ERC20, ERC777)](https://forum.openzeppelin.com/t/points-to-consider-when-creating-a-fungible-token-erc20-erc777/2915)

Tokens should be appropriately tested and audited, along with ensuring regulatory compliance.

⚠ A deflationary token can cause issues such as this recent issue: [https://medium.com/balancer-protocol/incident-with-non-standard-erc20-deflationary-tokens-95a0f6d46dea](https://medium.com/balancer-protocol/incident-with-non-standard-erc20-deflationary-tokens-95a0f6d46dea)

* * *

If you wanted to proceed, I suggest looking at extending from [ERC20PresetMinterPauser](https://docs.openzeppelin.com/contracts/3.x/api/presets#ERC20PresetMinterPauser).

You could then override [`_beforeTokenTransfer`](https://docs.openzeppelin.com/contracts/3.x/api/token/erc20#ERC20-_beforeTokenTransfer-address-address-uint256-) to make any modifications to the amount such as burning. See [Using Hooks](https://docs.openzeppelin.com/contracts/3.x/extending-contracts#using-hooks) for more details.

You would need to check that both `from` and `to` are non-zero so that you only do this for transfers and not for mint or burn.

---

<div class="post-metadata">

**Author:** ![martriay](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/martriay/32/20_2.png) [@martriay](https://forum.openzeppelin.com/u/martriay)\
**Post date:** [April 9, 2021, 1:27am UTC](https://forum.openzeppelin.com/t/create-deflationary-erc20-token/3647/3 "2021-04-09T01:27:13Z")

</div>

2 posts were split to a new topic: [Help with SafeMath subtraction](https://forum.openzeppelin.com/t/help-with-safemath-subtraction/6858)

---

<div class="post-metadata">

**Author:** ![abcoathup](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/abcoathup/32/415_2.png) [@abcoathup](https://forum.openzeppelin.com/u/abcoathup)\
**Post date:** [April 23, 2021, 3:27am UTC](https://forum.openzeppelin.com/t/create-deflationary-erc20-token/3647/4 "2021-04-23T03:27:10Z")

</div>

A post was split to a new topic: [How would you distribute a fee to all token holders?](https://forum.openzeppelin.com/t/how-would-you-distribute-a-fee-to-all-token-holders/7270)
