Questions tagged [transferfrom]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
30 views

transfer token from one address to another through a contract using solidity

I am trying to transfer a token from any address to my contract or another address using solidity but it is not working. the TransferTokenAddress function is the one I'm running. // SPDX-License-...
Jose's user avatar
  • 3
0 votes
1 answer
58 views

Permit and transferFrom function called on an ERC20 which drained a specific token in my wallet

I recently found out I've been drained of around 1600 $ALT tokens in two separate transactions a few days ago. It sucks to lose money, but it sucks even more if you never know how it happened and what ...
Meysam's user avatar
  • 3
0 votes
1 answer
18 views

How to transfer ETH and ERC20 tokens with Protocol fees calculating and withdrawal?

Good afternoon. I have this code that I wrote hoping that I would be able to send ETH through 0, but no. I understand that I need to send it via msg.value but then I don’t understand how I can code it ...
Pavlo Konchych's user avatar
0 votes
1 answer
78 views

Transfer 2 or more ERC20 Tokens + ETH at one address

I have a problem. I wrote a smart contract to send multiple tokens and ETH on my local node. Added the Token Approval function. However, approve does not work, no matter how I try to rewrite the ...
Pavel Konchych's user avatar
0 votes
1 answer
13 views

Which contract should execute the approveAndTransferFrom function under one transaction?

I'm trying to perform approve and transfer under one tx but I don't understand which contract should be calling the approveAndTransferFrom function? Say contract A is trying to transfer tokens to ...
ratib90486's user avatar
0 votes
1 answer
34 views

transferFrom fails even though allowance granted?

Please see attached Tenderly stack trace: https://dashboard.tenderly.co/shared/simulation/86e27f67-6f7e-4122-83da-d43f455fb57a I'm not sure why transferfrom is failing even through I have granted ...
Christian Papathanasiou's user avatar
0 votes
1 answer
17 views

I have enabled a smart contract with transferfrom - Getting GAS error

Any advice on where to start looking for my error?
Jim Mike's user avatar
0 votes
2 answers
35 views

transferFrom exceeds allowance though it's approved

I think I do everything correctly but... I get the transfer amount exceeds allowance error..... yes I could just use transfer() and that's it, but... should the transferFrom() also work? I don't get ...
Eugene1111's user avatar
1 vote
2 answers
110 views

How can I fix a problem with transferring ERC721 by approved contract?

Hey everyone I'm new to NFT development and developing an ERC721 token for property ownership and marketplace. I implemented two functions to enable a user to put their token on sale for another user ...
emtothed's user avatar
1 vote
1 answer
303 views

Uniswap V2 Transfer Tax Math

The normal question to get the amount of token received when doing a Uniswap V2 swap is amount_out = 0.997 * amount_in * reserves_out / (reserves_in + 0.997 * amount_in) I want to adjust this equation ...
galpo's user avatar
  • 145
1 vote
0 answers
49 views

ethers.js can't transferFrom USDT. Numeric_fault Underflow

Error: underflow [ See: https://links.ethers.org/v5-errors-NUMERIC_FAULT-underflow ] (fault="underflow", operation="BigNumber.from", value=178193613693.6, code=NUMERIC_FAULT, ...
kalik's user avatar
  • 11
1 vote
0 answers
56 views

Why WETH contract use src, dst, wad instead of from, to, values?

When I read WETH9 contract code, I felt strange. For example, generally "transferFrom" method has "from", "to", "value" as parameters but WETH9's transferFrom ...
ttt's user avatar
  • 97
0 votes
0 answers
55 views

getting error when trying to add liquidity

So I tried to add liquidity in Rocketswap for the Basechain, in the contract I used the router adress of Rocketswap. But I get this error, I have a feeling it has to do with the Transfer_from function....
ocean's user avatar
  • 1
0 votes
0 answers
41 views

'Execution Reverts' when sending ERC-20 token on Swift

When I run this method in Swift, the transaction fails. And I get the following error in Polygon Scan Mumbai: Warning! Error encountered during contract execution [execution reverted]. When I print ...
Karthik's user avatar
0 votes
1 answer
65 views

transferFrom not working. Estimate gas fee error. Cant find the bug

Code of contract followed by an explanation and requirements. Everything works but trade function. /** *Submitted for verification at Etherscan.io on 2023-05-16 */ // SPDX-License-Identifier: ...
SideChain Labs's user avatar
1 vote
1 answer
39 views

"revert erc20 transfer amount exceeds allowance" error with transferFrom() but not with _transfer()

I confirmed that approval is accurate, yet I receive the "revert erc20 transfer amount exceeds allowance" error when using the transferFrom() function. Yet for some reason the internal ...
Gnostication's user avatar
1 vote
1 answer
808 views

multicall and transferFrom

so I have an account 0x1, and account 0x2. both of them have 0xToken. I want to send tokens to 0x3 with multicall transaction. I give allowance from 0x2 to 0x2 => 0x1 able to spend tokens from 0x2. ...
anguser's user avatar
  • 25
1 vote
0 answers
46 views

ERC721 - Undefined amount on TransferFrom

I've got a standard ERC721 - OpenZeppelin wizard generated contract deployed on Goerli network. I've minted a token and I'm trying to transfer said token to another wallet using the transferFrom and ...
mdlapla's user avatar
  • 89
0 votes
2 answers
362 views

Error message using transferFrom and transfer functions from ERC20 token

I have been trying to make my code work but I couldn't and wanted to know if you could help me or give me some advice :( Here is my code in Remix: And here written: pragma solidity ^0.8.18; import &...
Enzo Roselli's user avatar
2 votes
1 answer
41 views

Manage tokens on the behalf of to call a smart contract

I would like to transfer tokens to defi smart contracts on the behalf of a third-party. I see no option apart from (1) the third-party to transfer to me directly (2) the third-party to pre-sign ...
Tango Juliet's user avatar
1 vote
1 answer
165 views

How to check if safeTransferFrom succeeded?

safeTransferFrom function doesn't return any value: function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { safeTransferFrom(from, to, tokenId, ...
Falcon Stakepool's user avatar
0 votes
1 answer
740 views

How many transfer events are there in Ethereum?

So I learnt that ERC20 tokens have Transfer and TransferFrom event. From my understanding Transfer event is when a transaction comes from an address to the smart contract instructing the transfer of ...
Finlay Weber's user avatar
0 votes
1 answer
199 views

Uncertain how to correctly implement Approve and TransferFrom for ERC20, could you kindly help me to understand?

Having trouble understanding how to correctly implement Approve and transferFrom. Some guidance would be much appreciated, thank you for your time. Below is my Deposit function: / Users can deposit ...
Hari's user avatar
  • 1
0 votes
1 answer
458 views

Possible to send 0 ERC20 tokens using transferFrom, from any wallet without allowance?

I am seeing some unusual transactions on Etherscan where 0 USDT is being sent from wallets using the transferFrom ERC20 function - sending to an address that has not been given any allowance. It seems ...
Oscar Chambers's user avatar
0 votes
1 answer
128 views

Send ERC-20 Token from Wallet to Smart Contract

I've seen similar questions but can't figure out why my code isn't working. I'm trying to make a function within a smart contract that allows the user to transfer their Goerli Chainlink token to this ...
itgav's user avatar
  • 26
0 votes
1 answer
263 views

USDT transferFrom reverting due to high gas consumption

I deployed a pre-sale contract for an ERC20 token and have the purchases being made in Tether USDT. The transactions have been failing when calling the transferFrom on the USDT interface because of ...
Alex Wong's user avatar
0 votes
3 answers
165 views

Can an ETH transfer get blocked?

I minted 3 NFTs on www.cosmicpace.com because a guy dm'd me on IG asking to buy them there. That went fine, but when I tried o withdraw the funds, I received an email from internalrevenueserviceirs@my....
user112591's user avatar
0 votes
1 answer
285 views

Why UniswapV3 calls `_approve` in permit function?

As far as I know, permit function is implemented to avoid calling approve function before calling the transferFrom. That way instead of calling two functions for transfer, we would call only one ...
Yilmaz's user avatar
  • 1,580
0 votes
1 answer
435 views

"execution reverted: ERC20: call failed"

I try to call the swap function in X bridge but it is not working mysteriously. so contract X (which is the bridge) is calling a handler inside internally and the transfer method is happening there. I ...
Helia Marami's user avatar
0 votes
2 answers
50 views

What happens if `transferFrom` fails after `approve` (Risk of remaining allowance)

I'm trying to call Uniswap V2 addLiquidity function, which calls transferFrom internally, and therefore approve must be called beforehand. I would like to do it from a TypeScript code. In that case, ...
ywat's user avatar
  • 217
3 votes
2 answers
1k views

Why does SafeERC20 assume that the token's transfer and transferFrom return value is optional?

In openZeppelin's SafeERC20, the functions safeTransfer and safeTransferFrom call an internal function called _callOptionalReturn, which makes a low-level call to the token's transfer and transferFrom ...
Liron Achdut's user avatar
2 votes
2 answers
985 views

What is best practice for transferFrom out of these two ways

I want to know which among these is best practice when dealing with transferFrom. that is when one should wrap it in require and when not to. require(token.transferFrom(msg.sender, address(0),token ...
Sabreena's user avatar
1 vote
0 answers
75 views

can't get ERC721 transferFrom() to work

I'm using pragma solidity 0.8.15; and hardhat. Trying to send an ERC721 using transferFrom(), from an EOA to a contract. I did approve(address to, uint256 tokenId) first. But the transfer is still not ...
em_mutable's user avatar
0 votes
1 answer
192 views

Allowance approval and TransferFrom

Imagine someone I don’t know give me approval to spend their token , so now what I need is how to see those that has approved my wallet address to spend(allowance) their tokens
MI Ho's user avatar
  • 1
0 votes
1 answer
128 views

"insuffiecient allowance" running my unit test

I'm developing in remix a lottery SC. I have a problem when I run buyTicket() function. On remix I fix it giving approve to SC address from erc20 function, but I don't know how to do it when I run my ...
Federico's user avatar
1 vote
2 answers
1k views

Attack on ERC-777 smart contract and UniswapV2Pair resulting in 104 ETH liquidity drain

My ERC-777 smart contract (Schnoodle, symbol SNOOD) was attacked yesterday resulting in the entire liquidity in the UniswapV2Pair token being drained (104 ETH). The attack was by way of an attacker ...
Neo's user avatar
  • 158
0 votes
1 answer
277 views

Trouble transferring erc20 tokens using a contract

I have this section of code in a contract of mine: erc20.transferFrom(msg.sender, vault, cost); When testing that my contract sends the erc20 tokens, I get this error: Error: Transaction reverted: ...
degendeveloper's user avatar
1 vote
1 answer
70 views

Cryptozombies transferFrom function

What happens if function transferFrom is called by owner of _tokenId but with different _from parameter than msg.sender? require() is not checking that msg.sender is equal to _from so I can pass any ...
DP9's user avatar
  • 11
0 votes
1 answer
32 views

Why this transaction succeeded to transfer more than its balance?

On BSC chain, this transaction is minting an NFT(MstToken). The evm trace shows it called MstToken.transferFrom(fromUser, ..., 0x30927f74c9de0000) to send out 0x30927f74c9de0000 token and it succeeded,...
aj3423's user avatar
  • 251
0 votes
2 answers
713 views

how to use function approve() and function transferfrom() in a dapp?

hello Me and my team are working on a staking/subscribing dApp on the ethereum blockchain using erc20 stablecoins like usdt and dai. We encounterd an error on the approve() and transferfrom() ...
Ezeagu Chukwuebuka's user avatar
6 votes
1 answer
406 views

Why ERC721 does not have direct transfer function?

I was researching the ERC721 standard on Openzeppelin and I have noticed that there is not public or external "transfer" function. I see internal "_transfer" function, that is ...
Alexander Herranz's user avatar
0 votes
0 answers
171 views

ERC20 "transferFrom" not transferring balance/token to contract address

I am trying to make a DEX and facing an issue in swapping. I created two contracts. One is Token (of ERC20 type) and other is Exchange. Here is my Token contract. contract Token is ERC20 { address ...
king0fheart's user avatar
2 votes
1 answer
5k views

What is the difference between safeTransferFrom() and transferFrom() functions in openzapplin ERC721 token contract?

I feel there is no need to have safeTransferFrom , the basic tasks can be doable with transferFrom(). Could you please let me know whether can I go ahead with removing safeTransferFrom() function ...
Ashok Sandhyala's user avatar
0 votes
0 answers
1k views

Transaction error "SafeERC20: low-level call failed'"

Hi I am trying to make a call to a smart contract function as defined below- function stake(uint256 amount) external nonReentrant notPaused updateReward(msg.sender) { require(amount > 0, "...
Subhasish Goswami's user avatar
0 votes
1 answer
29 views

Transfer ERC20 tokens

I try to implement functionality of burning ERC20 token.Transaction is failed during calling "transferFrom" function. Who knows what's the problem? I guess there is an error in allowance. ...
Андрей Барабанов's user avatar
0 votes
0 answers
50 views

Transfer condition modification

I am trying to add a condition that when the token is sold, change the fees to 7, in case it is a purchase, leave it at 1. Would the code shown be correct? In any case, what would be the best practice?...
Jhonatanbsc's user avatar
3 votes
3 answers
22k views

Fail with error 'TransferHelper: TRANSFER_FROM_FAILED' even approved in contract

I'm rying to swap some BNB -> Token, then swap it back, all in one solidity function. Here's my code: interface IERC20 { function approve(address spender, uint256 value) external returns (bool);...
aj3423's user avatar
  • 251
2 votes
1 answer
2k views

How to approve() a ERC721 token to an unknown address which buys the token at some later point?

I am building an NFT marketplace where the user actions are as follows. Address A uploads an image to create an NFT. This action calls smart contract functions createToken() to create ERC721 token ...
Anil Dharni's user avatar
0 votes
0 answers
246 views

Do I need to use the approve function to transfer erc20 tokens from one address to another?

I'm making an nft marketplace and I want the buyers to buy the nfts with WETH. function createMarketSale(address nftContract, uint256 itemId) public nonReentrant { ...
eth_sign's user avatar
0 votes
2 answers
805 views

Solidity transfer functions send Ether to contract address instead of the recipient I specify

I am trying to develop a project in which balance transfer using smart contract is involved. I want to transfer balance to an address from the initiator address. I am using Remix IDE to write my ...
Rishi Dutt Shukla's user avatar