# Execution reverted: ERC20: transfer amount exceeds balance

**URL:** <https://forum.openzeppelin.com/t/execution-reverted-erc20-transfer-amount-exceeds-balance/28733>\
**Category:** Smart Contracts\
**Created:** [May 15, 2022, 8:01pm UTC](https://forum.openzeppelin.com/t/execution-reverted-erc20-transfer-amount-exceeds-balance/28733 "2022-05-15T20:01:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fataydo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/fataydo/32/14916_2.png) [@Fataydo](https://forum.openzeppelin.com/u/Fataydo)\
**Post date:** [May 15, 2022, 8:01pm UTC](https://forum.openzeppelin.com/t/execution-reverted-erc20-transfer-amount-exceeds-balance/28733/1 "2022-05-15T20:01:06Z")

</div>

Hello,  
i know that many people already opened a topic about this, but i cant find the problem.  
I want to initialize a dummy token, but i still get this error: execution reverted: ERC20: transfer amount exceeds balance.  
 ![image](https://us1.discourse-cdn.com/flex022/uploads/zeppelin/original/2X/0/010e02b841d60dd37f63e537cbac44dc9d588b17.png)  
This is the function that i want to use, i already approved everything and i minted 100 dummy tokens to my wallet(0x6301Ce2771c4E61AdD2C12eD8A2faDd3817CBB0f) cause the function requires that the balance of msg.sender is not 0.

Dummy token address: 0xDb273C604DE8cE5239a921927352868a12c1a8b7

failed transaction hash: 0x8a541624e11cc1e1d1b36b26d9b99c946e4707cbac56ebd0c7fa0ffc4c174d17

Everything was deployed on the avalanche fuji testnet, i would be realllllyy happy if someone could help me solve this problem, i know that this problem is easily solved but i just cant find it....

---

<div class="post-metadata">

**Author:** ![Skyge](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/skyge/32/343_2.png) [@Skyge](https://forum.openzeppelin.com/u/Skyge)\
**Post date:** [May 16, 2022, 2:10am UTC](https://forum.openzeppelin.com/t/execution-reverted-erc20-transfer-amount-exceeds-balance/28733/2 "2022-05-16T02:10:33Z")

</div>

Hi, welcome to the community! 👋

I think the error located in the function `MASTER_CHEF.deposit()`, and the `MASTER_CHEF` contract does not been verified, so I am not sure what is wrong.

---

<div class="post-metadata">

**Author:** ![Fataydo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/fataydo/32/14916_2.png) [@Fataydo](https://forum.openzeppelin.com/u/Fataydo)\
**Post date:** [May 16, 2022, 9:50am UTC](https://forum.openzeppelin.com/t/execution-reverted-erc20-transfer-amount-exceeds-balance/28733/3 "2022-05-16T09:50:53Z")

</div>

Hey, ive verified the masterchefv2 and masterchef contract(0x1f19a4968C0A0Fc87361dc6267493cF3B0cD9709, 0x8B64ba7f4D4ae8A5d8aC19130095f1aE47266178).  
I looked into the MASTER\_CHEF.deposit() and still couldnt find the problem.

---

<div class="post-metadata">

**Author:** ![Fataydo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/fataydo/32/14916_2.png) [@Fataydo](https://forum.openzeppelin.com/u/Fataydo)\
**Post date:** [May 19, 2022, 11:10am UTC](https://forum.openzeppelin.com/t/execution-reverted-erc20-transfer-amount-exceeds-balance/28733/4 "2022-05-19T11:10:58Z")

</div>

Do you have another idea, which could solve this problem i am still stuck at it...

---

<div class="post-metadata">

**Author:** ![Skyge](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/skyge/32/343_2.png) [@Skyge](https://forum.openzeppelin.com/u/Skyge)\
**Post date:** [May 20, 2022, 12:42am UTC](https://forum.openzeppelin.com/t/execution-reverted-erc20-transfer-amount-exceeds-balance/28733/5 "2022-05-20T00:42:09Z")

</div>

I think you deposited DUMMY token to your contracts, and when you try to call `init`, it will call `deposit(uint256 _pid, uint256 _amount)`, `pid` is 0, so the lp token seems like SMAY, and I do not think there is such a token in your contract, so when it tries to call `pool.lpToken.safeTransferFrom(address(msg.sender), address(this), _amount);`, the error comes.

---

<div class="post-metadata">

**Author:** ![Fataydo](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/fataydo/32/14916_2.png) [@Fataydo](https://forum.openzeppelin.com/u/Fataydo)\
**Post date:** [May 20, 2022, 8:10am UTC](https://forum.openzeppelin.com/t/execution-reverted-erc20-transfer-amount-exceeds-balance/28733/6 "2022-05-20T08:10:08Z")

</div>

omg, how could i oversee this, thank you sooo much for the help, i really appreciate it!  
have a great day!
