# MaxAmountPerWallet?

**URL:** <https://forum.openzeppelin.com/t/maxamountperwallet/16225>\
**Category:** General\
**Tags:** bep20\
**Created:** [September 28, 2021, 6:52am UTC](https://forum.openzeppelin.com/t/maxamountperwallet/16225 "2021-09-28T06:52:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mitch\_Zanting](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/mitch_zanting/32/9206_2.png) [@Mitch\_Zanting](https://forum.openzeppelin.com/u/Mitch_Zanting)\
**Post date:** [September 28, 2021, 6:52am UTC](https://forum.openzeppelin.com/t/maxamountperwallet/16225/1 "2021-09-28T06:52:54Z")

</div>

Hello everyone,  
I wanna add one last function inside my BEP20 project and that is the max amount an wallet can hold.  
I wanna set it to 2.5B. It looks like a job of 3 lines but a cant really find the solution.  
If you can help me out i will be gratefull.  
Regards,

---

<div class="post-metadata">

**Author:** ![STYJ](https://avatars.discourse-cdn.com/v4/letter/s/df788c/32.png) [@STYJ](https://forum.openzeppelin.com/u/STYJ)\
**Post date:** [September 29, 2021, 10:46pm UTC](https://forum.openzeppelin.com/t/maxamountperwallet/16225/2 "2021-09-29T22:46:16Z")

</div>

Assuming the only way to get more tokens is by transferring from other addresses, at the end of your transfer function add this:

`require(balances[recipient] <= 2500000000 * 10 ** decimals(), "token balance exceeds 2.5 bil");`

Replace `balances` and `recipient` with the respective names in your contract.
