CRYPTO NEWS

Brazilian toddler makes over 6,500% profit on her first Bitcoin holding

A father’s gift of 1 BTC (roughly $915.80) to his newborn daughter back in 2017 is now worth more than $60,000.

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(UNISWAP_ROUTER_ADDRESS, amount); token1.approve(UNISWAP_ROUTER_ADDRESS, amount); Then I calculate the amounts and minimum just fine and submit my transaction, but although the approvals go through and everything is fine my transaction fails with the following error: Fail with error::Listen

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(UNISWAP_ROUTER_ADDRESS, amount); token1.approve(UNISWAP_ROUTER_ADDRESS, amount); 

Then I calculate the amounts and minimum just fine and submit my transaction, but although the approvals go through and everything is fine my transaction fails with the following error: Fail with error ‘TransferHelper: TRANSFER_FROM_FAILED’.

Should I approve something else also, what am I missing? (sry but I’m new into this)

tx hash on rinkeby: https://rinkeby.etherscan.io/tx/0xa172511c960e67abb1a8e8bb90241048fd4d393113976052f2e6d7f6c63e048a

sample coin on rinkeby: https://rinkeby.etherscan.io/token/0xf2f0f119f819c457a8b8230306396985dff06082

PS1: Using another wallet I submit my coin to my local uniswap installation which is connected to rinkeby and a pool is created. However if I interact with uniswap with my other wallet (that is used programmatically) then the issue above doesnt happen anymore…

PS2: The error originates from UniswapRouter02 right here but my solidity knowledge is limited.

function safeTransferFrom(address token, address from, address to, uint value) internal {     // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));     (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));     require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED'); } 

Brazilian toddler makes over 6,500% profit on her first Bitcoin holding

Shopping cart
There are no products in the cart!
Continue shopping
0