Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [transferfrom]

The tag has no usage guidance.

46 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
2 votes
1 answer
43 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
2 votes
2 answers
4k views

How can I invoke an approve() function call from the user and not the contract?

I am working on a basic staking platform for practice. I understand that the user of the platform has to call the approve() function and pass the contract into it in order for the contract to use the ...
user68609's user avatar
2 votes
1 answer
43k views

TRANSFER_FROM_FAILED error when trying to swap BCLNC tokens for ETH on Uniswap

I'm attempting to swap BCLNC tokens for ETH on Uniswap, but I get the following error: The transaction cannot succeed due to error: TransferHelper: TRANSFER_FROM_FAILED. This is probably an issue ...
Neo's user avatar
  • 158
1 vote
1 answer
332 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
62 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
60 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
1 vote
1 answer
42 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
0 answers
47 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
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
1 vote
1 answer
71 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
1 vote
0 answers
147 views

MetaMask not showing ERC-20 amount in Transaction - Only showing ETH gas fee

Im experimenting with sending my custom ERC-20 token with MetaMask to my contract. Im using react.js for a simple front end. I press a button which creates a transaction from my metamask account for a ...
Kane Lawless's user avatar
1 vote
0 answers
262 views

Transferring ERC20 token to a contract using custom function

I have a couple of questions related to transferring ERC20 token to a contract. I am developing a protocol that has its own token to provide incentive mechanisms. For certain operations I need to lock ...
DN_Euler's user avatar
1 vote
1 answer
1k views

transferFrom error. Exception thrown in smart contract transaction

I compiled smart contract in solidity on remix.ethereum.org. I made account via MetaMask and want to let other addresses send tokens to themselves using ropsten network. I mean - I am contract owner = ...
WR10's user avatar
  • 11
1 vote
0 answers
233 views

transferFrom is not displaying DAI amount on MetaMask verification popup

I am using web3.min_1.36.js to send DAI to a contract. I already called "approve", so transferFrom is working correctly without error. However, the Metamask verification popup does not display the ...
Tester's user avatar
  • 313
1 vote
1 answer
62 views

When I tap buy button in market how does wallet check my allowance instantly?

On CrytpoKitties, when I tap the buy button in a market, MetaMask comes up and shows if I can buy or not based on allowance instantly. How is this possible? Is it making query? Is it included in kitty'...
lagoiz's user avatar
  • 147
0 votes
0 answers
11 views

Help with addLiquidtyEth keeps returning either transfer_from Failed or OVERFLOw

Im trying to add all tokens to liquidity. It doesnt allow the amount of tokens desired to be more then the total supply so im not sure why it keeps returning 'execution reverted: pancake: OVERFLOW' Im ...
blockchainhelpneeded's user avatar
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
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
36 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
0 answers
57 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
1 answer
73 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
0 votes
2 answers
415 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
0 votes
1 answer
208 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
137 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
304 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,695
0 votes
1 answer
202 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
2 answers
725 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
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
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
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
0 votes
0 answers
247 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
1 answer
232 views

Can I send ERC20 and ETH in the same transaction trough web3js?

Can I send ERC20 and ETH in the same transaction trough web3js ? I want enable the user to send my token with ETH in a same transaction to my wallet. I know that there are 2 transactions (ETH transfer ...
Alexander Herranz's user avatar
0 votes
1 answer
42 views

Send ERC20 Tokens directly to contract address to trigger to function in contract

We are trying to bypass allow method and make the contract more UX friendly. And instead of first allowing contract to spend and after calling transferFrom method, we are thinking about just sending ...
Adam Surrey Smitson's user avatar
0 votes
1 answer
150 views

Transferfrom and approve not working

I have erc20 tokens. Now I want to send these tokens to the current contract. How can I send it? function bid(uint256 tokens) public { require(block.timestamp < time,"time exceeded"); ...
Gajeel Redfox's user avatar
0 votes
1 answer
80 views

ERC20 Token Transfer Issue

I have a test token (ERC20) deployd on ETH test network (Kovan) The token was deployed using Unicrypt tool So far everything ok, but the issues is how can i transfer tokens from an outside smart ...
Armindo Pereira's user avatar
0 votes
1 answer
210 views

Procedure of transferring the ERC721 tokens in return for money between different accounts

I am using ERC721 in my script and have declared a method for transferring the tokens In return for a desired amount of money from the buyer. However, after sending the money by the buyer the ...
Sina Rahimi's user avatar
0 votes
0 answers
1k views

The transaction cannot succeed due to error: TransferHelper: TRANSFER_FROM_FAILED

I am having errors whenever I try to call add liquidity from my contract. Error: The transaction cannot succeed due to the error: TransferHelper: TRANSFER_FROM_FAILED. I have almost approved each and ...
cherry's user avatar
  • 101
0 votes
2 answers
989 views

How can I import an existing ERC20 token into my contract?

I'm trying to develop a staking contract. All of the guides I've seen utilize either payable (ETH) or a newly created token. How can I import an existing token (presumably via address) into my ...
Zed's user avatar
  • 1
0 votes
1 answer
277 views

Call function from deployed contract

I have a deployed contract (contract A) which should act as a storage (let's say 0xD7ACd2a9FD159E69Bb102A1ca21C9a3e3A5F771B). Now from my ERC20 Token contract (contract B), I am calling approve to the ...
4NDR34's user avatar
  • 61
0 votes
1 answer
166 views

Trying to write https://etherscan.io/writecontract/ transfer from

I transferred link tokens to xdai network using trust wallet. But trust wallet come to find out doesn’t allow users to switch to poa network xdai. So I need to write within the contract to transfer ...
LinktheLion's user avatar
0 votes
1 answer
916 views

調用transferFrom的函數時出現錯誤顯示Reason provided by the contract: "ERC20: transfer amount exceeds allowance

What's the problem? pragma solidity ^0.6.0; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/proxy/Initializable.sol"; import "https://github.com/...
好味道's user avatar
0 votes
0 answers
268 views

Problems with transferFrom within a contract

I am playing around with this repo, more exactly with the ERC20ContinuousToken.sol contract. I am able to successfully run the truffle tests after connecting the project to Ganache, so I know that ...
tiny-rick's user avatar
0 votes
1 answer
506 views

For loop for transferFrom

transferFrom method from ERC20 contract interface: function transferFrom(address _from, address _to, uint _value) public; transferFrom function from my contract : function transferFrom(address ...
pawelnbd1992's user avatar
0 votes
0 answers
100 views

Cann't send token with looping function

Sorry, I'm a newbie on ERC721 token. Please help. I have deployed ERC721 contract in the localhost testnet. I use looping function for mint token and it works. But when I use looping function for ...
Kadafi's user avatar
  • 1
0 votes
1 answer
201 views

Gets reverted when calling ERC20.transfer in a contract, not reverted when transferring 0

I have this code inside a contract interface ERC20 { //standard variables function allowance(address _owner, address _spender) constant returns (uint remaining); function approve(address ...
bbnn's user avatar
  • 236