Questions tagged [erc-20-approve]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
7 views

How to save users that already approved a token

I'm making a dApp, i see that a lot of dApp asks to approve a transaction only one time How they know if someone already approved it? they save the address in a db? if yes, how they know if the user ...
0
votes
0answers
6 views

How to get the token approval list for my mutlisig wallet?

Etherscan recently launched a tool to exactly do this, but it doesn’t works on smart contracts and thus my multisig wallets. I have an OpenEthereum full archival node, but getStorageAt() isn’t that ...
0
votes
1answer
35 views

How can I send my NFT (ERC721) Token (minted on ContractA) to another Smartcontract (ContractB) so that it is allowed to transfer it?

I try to send my NFT token#300, which is an ERC721 token, minted on ContractA, to antoher ContractB, so that ContractB is now the owner of this Token#300 - so that the ContractB is now allowed to ...
0
votes
1answer
16 views

Accept tokens in Smart Contract without allowance [duplicate]

I'm trying to develop an Smart Contract function that accepts and ERC20 token, and send it to another address. I know that I make the user to call approve and later execute the function: //check SC's ...
0
votes
0answers
17 views

ERC20: Transfer amount exceeds allowance [duplicate]

I have created a contract which is a ERC20 contract. Once the contract is created, I have specified some amount of ERC20 tokens to be minted and sent to the contract. Moreover, I have defined that ...
0
votes
0answers
12 views

ERC20 approve attack: may its success be dependent on mainer decision about transaction order?

My question is related to the possible attack vector on ERC20 contracts described here. This attack effectively boils down to these steps: First transaction (mined): Alice calls approve(addressOfBob, ...
0
votes
2answers
86 views

Cant pass large uint in react.js (2**256-1) into solidity approve function

I am trying to call a simple approve() to allow my contract to spend my tokens. Trying to make the amount argument = (2**256 - 1) however I am getting the below error message every time. Unhandled ...
1
vote
1answer
24 views

How to call .increaseAllowance() from another token

I'm deploying a contract that is the owner of a token. In that contract i want to say that the token increaseAllowance to msg.sender and the amount that msg.send have putted in arguments of the ...
0
votes
1answer
36 views

Metamask: Is aprove equivalent to 100% automatic transactions?

When we do an approve in metamask we see this text: Is this site trustworthy? By granting this permission, you authorize [Site] to retire your [Token] and automate transactions for you. What does ...
0
votes
1answer
49 views

Can't sign approve transaction in Uniswap

I created a simple Erc20 token contract, i'd like to make the token approval on exchange(uniswap) only avaliable for just the owner of the contract. Everything seem to work fine but when a user goes ...
2
votes
1answer
109 views

Current ERC20 approval best practices?

I've been reading some (old) discussions about the potential attack vector of using ERC20 approve (for example: https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729) but I've been ...
0
votes
1answer
252 views

Fail with error 'TransferHelper: TRANSFER_FROM_FAILED', all gas used up

I'm trying to buy some CHY with USDT on Uniswap main net, fails with error 'TransferHelper: TRANSFER_FROM_FAILED', This is my failed tx link. This is a successful tx link from someone else. I notice ...
0
votes
0answers
17 views

Error in construtor when deploying: ERC20 approve method

I have this code in my constructor, which is raising an error on deployment: constructor(){ owner = msg.sender; wETH.approve(msg.sender, type(uint256).max); //Approve the owner to transfer ...
0
votes
1answer
90 views

How can I check on the frontend if an ERC20 address has approved a contract? (Approval)

I see Uniswap and a lot of other frontend UIs can check if an ERC20 token has approved the contract to use the address's funds, and dynamically change their buttons to "Swap" from "...
0
votes
0answers
16 views

Gas estimation failed:“transfer amount exceeds spender allowance” [duplicate]

0 I want to execute function Tip and transfer IERC20 Token. However, this message is shown. Uni::transferFrom: transfer amount exceeds spender allowance { "originalError": { "code"...
1
vote
1answer
170 views

Uniswap Liquidity Not Showing (please advise)

We created a meme token. Added it into the ERC20 blockchain and then went to add it to Uniswap. Can someone please advise as to why the coin was succesfull being added to Uniswap, but will not allow ...
0
votes
1answer
132 views

Solidity: ERC-20 TransferFrom reverts after approval

i am trying to code a smart contract which takes the tokens of the player who enters. function enterToken(address token, uint amount) public { uint _amount = amount * 10 ** 18; IERC20 ...
0
votes
0answers
65 views

can mint function be included in the erc20 reflection contract?

mint function to increase the supply of tokens be included in an erc20 contract with reflection keeping the existing reflection total , when mint function occurs can it should sync with existing ...
0
votes
0answers
100 views

Cannot use transferFrom

no matter what I try, I am unable to call token.transferFrom without getting ERC20: transfer amount exceeds allowance - even though I have approved the allowance. Code speaks better than words: ...
2
votes
1answer
224 views

How to interact with a smart contract without ABI

So I bought a scamcoin (I know). I have the contract and I've managed to decompile the bytecode. How can I interact with the contract to approve the token? https://bscscan.com/address/...
0
votes
1answer
777 views

Uniswap Approve Succeeded But No ETH Returned in "Swap"

I attempted to swap some eMax (using the Uniswap Swap feature) for ETH and the Approve went through, in the end I received another token (old version of token before hard fork). It seems to be the ...
0
votes
0answers
72 views

when call solidity token approve method via web3js, my metamask is locking

i have got code like following; when i call that code, my metamask is locking and didn't respond. what can you suggest? thank you var MyContractToken = new web3.eth.Contract(abiToken,'...
4
votes
1answer
668 views

What is the best way to use uniswap without router?

I just bought a scam token. The liquidity pool is still there but I couldn't sell because I couldn't approve the token in Uniswap. When I try to approve, the error "execution reverted: ERC20: ...
0
votes
0answers
23 views

Approve() and transferFrom() functions seems to be giving errors

I am trying to develop a smart contract very similar to: https://github.com/tapmydata/tap-protocol/blob/main/contracts/VestingVault.sol So , I deployed ERC20 token and passed the contract address to ...
0
votes
1answer
69 views

Logic in approveAndCall function for erc20 token deprecated & not working

I am following along with a older tutorial on making an ERC20 token in order to learn Solidity a little better. Since the tutorial is old, I've had to change a lot of things so far to get it up to ...
1
vote
1answer
60 views

Approve and Swap/Deposit at the same time [duplicate]

So one of the most annoying things for me is having to Approve before calling Swap or Deposit. I would love there to be a proxy contract which just calls Approve and Swap/Deposit in the same function. ...
1
vote
0answers
50 views

How do I approve a smart contract to spend my ERC20 tokens? [duplicate]

My first time here, please forgive me for any mistakes. I made a custom ERC20 token using Openzeppelin ERC20PresetFixedSupply. I want to use that in my contract. I was using this code to test how ...
0
votes
0answers
10 views

How to list to Uniswap on User behalf

Currently, DAPP is under development. Is it possible for us to handle the GAS payment and approval process on behalf of the user who created the token using DAPP when trying to list the token in ...
0
votes
1answer
138 views

Sending ERC20 token to the constructor of a contract

I want to send an erc20 token to the constructor of a contract. I can't manually use the approve(spender, amount) function before deploying the contract as the spender address needs to be the address ...
1
vote
0answers
128 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 ...
0
votes
1answer
419 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(...
0
votes
1answer
55 views

Previous call to approve is mandatory?

I was trying this tutorial that implements a simple DEX. I am specially interested in the non payable function sell, that exchange custom tokens for ETH. function sell(uint256 amount) public { ...
1
vote
0answers
36 views

Does ERC20's transferFrom function fail if it doesn't meet the require statement?

I'm learning about the ERC20 contract by OpenZeppelin and curious about the approve function: function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (...
0
votes
0answers
275 views

Web3 + Truffle, is this the correct way to approve a spend?

I have created an ERC20 token using Web3, Openzeppelin and Truffle, and minted some tokens. const LToken1 = await ERC20.new('Test L Token 1', "TEST1", web3.utils.toWei('1000000')); I would ...
0
votes
1answer
204 views

Why is my approve() function using incorrect token_id

I have created an ERC20 token using openzeppelin and web3. I am then trying add some of this new token to a contract (An instance of UniswapV2Router02.sol) in order to add liquidity to a liquidity ...
0
votes
2answers
118 views

Is there a way to approve all future erc20 tokens for a contract?

I wanted to write a Smart Will contract that basically sends everything in my address to a beneficiary's address if I die. However I don't want to send everything to the smart contract in advance ...
1
vote
1answer
2k views

What is the use case of transferFrom function in ERC20 token contract?

In @openZeppelin's ERC20 implementation here is the code for function transferFrom: function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) { ...
0
votes
1answer
142 views

Is it possible to use both approve and trasferfrom functions in a single function in other contracts? [duplicate]

I realized that you need to approve the amount of tokens you are gonna send to contract. for this you should first use approve function in token contract and then call the trasferfrom function in ...
0
votes
3answers
1k views

IERC20.approve(spender, amount) thinks the owner is also the contract

I have these functions and deployed my contract to Ropsten testnet. function setSmartContractAllownace(uint daiAmountIn) public { IERC20 daiToken = IERC20(ropstenDAI); daiToken.approve(...
0
votes
0answers
72 views

Approval notification

Is there a simple way that I can be notified (or check easily) when my address (an EOA) is approved by some other address (EOA, not contract) for an allowance of x amount of any ERC-20 token? It seems ...
1
vote
1answer
1k 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 ...
0
votes
0answers
259 views

Approve Allowance ERC(20)

Can you please tell why do we have to approve ERC20 tokens before sending them? contract Transfer { function version1() { ERC20(someToken).transferFrom(msg.sender, address(this), 122); ...
2
votes
1answer
1k views

How to approve user to spend all my ERC20 tokens?

In ERC20 we approve a user to spend our token and then they can spend as much allowed using transferFrom, but if the allowance limit exceed then I have to approve again, is there any way to allow them ...
0
votes
1answer
22 views

Unable to approve [closed]

/// pragma solidity ^0.6.0; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol"; import "https://github.com/OpenZeppelin/...
0
votes
1answer
55 views

An attack to my contract similar to ERC-20 approval() exploit

I have function setNonRecurringFlow(uint256 _child, int256 _remainingSwapCredit) external; function setRecurringFlow( uint256 _child, int256 _maxSwapCredit, int256 ...
0
votes
0answers
43 views

What is the cause of an "APPROVED" transaction but doesnt do a "TRANSFER" for an ERC-20 Token?

I have a transaction that was approved and I paid $3 in fees. But the token was never "transfered" where and how can I debug what happen to my transaction of why it didn't transfer?
2
votes
1answer
790 views

i am new to this, can someone steal my erc20 token with the Function approve()

I have been using yield Farming (YFValue) and I noticed when I accept the contract via MetaMask. I set faming 500 USDT but in the contract the input was: Function: approve(address _spender, uint256 ...
2
votes
1answer
3k views

How to transfer ERC20 token to another contract and calling contracts function

I need to send an ERC20 Token from a contract to another contract and calling a function of the other contract at the same time. I know how to transfer an ERC20 Token from solidity to another contract,...
1
vote
1answer
304 views

How to make a delegatecall to external ERC20 token's approve function?

What I would like to do is something like this: function testCall(uint amount) public virtual returns (bool) { address tta = address(0xE7B6....); (bool success, bytes memory result) = tta....
5
votes
0answers
81 views

Not able to use DAI's permit() function

I'm having trouble testing the permit() functionality from the DAI contract. I've read the documentation and a couple of other resources, although, I got the contract code and deployed myself a copy ...