Questions tagged [transferfrom]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
6 votes
1 answer
407 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
2 votes
2 answers
992 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
2 votes
1 answer
1k views

Fail with error 'TransferHelper: TRANSFER_FROM_FAILED' Although approved

I'm trying to make a swap programmatically, I did the following approvals using ethers.js: token0.approve(wallet.address, amount); token1.approve(wallet.address, amount); token0.approve(...
0x_Anakin's user avatar
  • 121
1 vote
1 answer
3k views

deposite and withdraw erc20 token using smart contract

my goal is to create a smart contract which user can deposit erc20 and withdraw erc20 token using.i tried to implement this functionality using token transfer and transferfrom functions tried to send ...
Harish Manthurthi's user avatar
1 vote
1 answer
3k views

Contract with function payable to receive ERC20 token in one shot?

I am trying to write a smart contract with a function that receives an ERC20 token (i.e.: DAI), but the transaction to call this function is always failing. Let's assume I first record the ERC20 ...
Sergi Juanati's user avatar
0 votes
1 answer
2k views

Transfer ERC20 Token - Encountered during contract execution [Reverted]

When trying to sent some ERC20 Token from wallet getting following error: Warning! Error encountered during contract execution [Reverted] This error returned when i call transferFrom()( I made ...
pawelnbd1992's user avatar
0 votes
1 answer
504 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
2 answers
807 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