Questions tagged [allowance]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers

Cannot import correctly uniswap's permit2

Hello i am trying to import the permit2 following the official uniswap's guide but i cannot manage to import it correctly since it lacks of the structs and more things even if i don't get any error ...
user19288852's user avatar
0 votes
1 answer

Alert after spending approval

This is a simple dAPP i am running via metamask. I have tried many things. window.alert(`Connected Successfully`); I have tried to add this window.alert to my code but it wont do much. async function ...
Jim Mike's user avatar
0 votes
2 answers

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
0 votes
1 answer

How to give allowance to a contract and send erc20 between accounts

I wrote the following contract: // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract enviaToken { address public ...
CaioBonani's user avatar
0 votes
1 answer

insufficient allowance Error .. ERC20

// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import &...
kaay's user avatar
  • 7
0 votes
1 answer

Token allowance of router address

Pretty much every coin with taxes has an allowance function to give the router allowance over max uint to be able to sell the tokens. However, I always see the allowance given to 'router', which ...
Andy's user avatar
  • 185
1 vote
0 answers

0x API buy USDC with ETH works, buy ETH with USDC fails

have been building a little front end app to execute trades back and forth between ETH and USDC, partly to learn and partly to build a tool I want to exist. I have all the quotes and stuff working OK, ...
user2863033's user avatar
1 vote
4 answers

Allowing contract to take ERC20 tokens from msg.sender

I'm kind of new to Solidity and struggling with allowances and approvals. I want my smart contract to be allowed to take ERC20 tokens (LINK in this case) from the msg.sender. I'm using Remix on Goerli,...
TRS's user avatar
  • 131
0 votes
1 answer

Allowance failed when attempting to transfer LINK tokens

I'm creating a smart contract where users can create NFT raffles. I will be using Chainlink VRF for getting provably fair results. For this, the user who creates the raffle needs to supply the ...
TRS's user avatar
  • 131
1 vote
1 answer

Disabling allowance for Coins and NFTs?

Allowance phishing attacks are on the rise, and the number of use cases for allowance for erc20 and NFTs seems to be limited. Is there any problem with disabling allowance, perhaps with a new ...
rook's user avatar
  • 141
0 votes
1 answer

"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
0 votes
1 answer

build an abstract contract for user to claim erc20 tokens, encountered " insufficient allowance" error

My goal is to build an abstract contract and send a specific erc20 token into it so that others can claim the erc20token with merkletree validations. However I am having problem approving the contract ...
Poutine's user avatar
  • 17
4 votes
1 answer

Difference between Approve() and IncreaseAllowance() in ERC20 contract

Over the last few days, I have been looking up the best and clear explanation of the differences between Approve() and increaseAllowance() of the ERC20 contract. Still, I couldn't come up with a ...
Sina Rahimi's user avatar
2 votes
3 answers

Error ERC20: insufficient allowance

i intend to use my erc20 token for doing some payment for minting nft. but when i call testPay function always got ERC20: insufficient allowance error. already looking for answer but can't find one. ...
satrio galih's user avatar
1 vote
0 answers

How does Sushi deal with limit orders? (Conceptually)

On it is possible to set limit orders. From their documentation: When the user creates a limit order for a purchase or a sale on SushiSwap, the order is sent to an AWS server[...] And in ...
Alvin Sartor's user avatar
0 votes
1 answer

Infinite Allowance for token inside smart contract?

I want contract2 to be able to transfer the tokens from contract1. So i set allowance to -1 If i understand correctly it's not "infinite", but it's the highest possible number in EVM. My ...
smenir443's user avatar
  • 125
1 vote
1 answer

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 ...
The Chimpy Dev's user avatar
1 vote
0 answers

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 ...
Kushagra Jain's user avatar
1 vote
1 answer

Allowance = Unlimited. What could happen?

Allowance = Unlimited. What can happen? Hi, let‘s say I approve via MetaMask that another address can spend an unlimited amount of ETH on my address. What can happen? Can this address spend all my ETH ...
ptrckolous's user avatar
0 votes
1 answer

Token allowance and locking compromised address

So i heard about token allowance checker It allows you set allowance for tokens. Is there a possible way to set the allowance so that your account wouldnt receive ethereum, ...
Stephen Robb's user avatar
0 votes
0 answers

Why is the allowance 10**8 inside the test but equal to zero in the smart contract?

I'm running this test: def test_mint(prf, exValue, web3): wBtcAddress = "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599" ABI = [{"constant":True,"inputs":[],"...
Donnoh's user avatar
  • 33
0 votes
1 answer

How can I get a list of token spending allowance for a wallet address?

Let's say I am an end-user who has been testing dapps here and there and I've approved multiple tokens spending for my wallet for different dapps. Is there an easy way for me to get the list of which ...
Kev's user avatar
  • 101
0 votes
1 answer

Why Transfer function doesn't check for allowance comparing to TransferFrom?

Why Transfer function doesn't check for allowance comparing to TransferFrom? Do I need to call increaseAllowance each time before calling TransferFrom? Ex implementation of Transfer without allowance ...
Dmitry Dyachkov's user avatar
0 votes
1 answer

Why is my Crowdsale Contract not letting me buy?

Good day, I have designed a mintable token that has a max supply, I now want to sell that token in a Crowdsale. I created the crowdsale contract, set the token address, transffered the funds... but ...
AvocadoChocolate's user avatar
1 vote
1 answer

Usecase for approve and allowance functions of ERC20 token

Could you please enlighten me on how approve and allowance functions work using a usecase? I dont understand the underlying operations of these functions. Especially, when a token owner delegates the ...
Muni V K's user avatar
0 votes
1 answer

Is there an indexed database for ERC20 allowances?

For instance, I'd like to make the following query: Return all the addresses that have approved spender x on a particular token It seems that I can only query for a specific (address, spender) ...
Parker Applebye's user avatar
1 vote
1 answer

Do dapps(contract) check allowance of buyer when he calls buy function?

When a buyer calls a buy function on dapp contract, some dapps check the buyer's allowance before transfer tokens(erc20). Is it usual?
lagoiz's user avatar
  • 147