Questions tagged [allowance]
The allowance tag has no usage guidance.
27
questions
0
votes
0
answers
7
views
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 ...
0
votes
1
answer
27
views
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 ...
0
votes
2
answers
20
views
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 ...
0
votes
1
answer
42
views
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 ...
0
votes
1
answer
49
views
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 &...
0
votes
1
answer
51
views
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 ...
1
vote
0
answers
123
views
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, ...
1
vote
4
answers
628
views
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,...
0
votes
1
answer
28
views
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 ...
1
vote
1
answer
40
views
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 ...
0
votes
1
answer
110
views
"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 ...
0
votes
1
answer
322
views
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 ...
4
votes
1
answer
2k
views
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 ...
2
votes
3
answers
11k
views
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.
...
1
vote
0
answers
193
views
How does Sushi deal with limit orders? (Conceptually)
On Sushi.com 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 ...
0
votes
1
answer
212
views
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 ...
1
vote
1
answer
700
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 ...
1
vote
0
answers
88
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 ...
1
vote
1
answer
828
views
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 ...
0
votes
1
answer
145
views
Token allowance and locking compromised address
So i heard about token allowance checker https://tac.dappstar.io/. It allows you set allowance for tokens.
Is there a possible way to set the allowance so that your account wouldnt receive ethereum, ...
0
votes
0
answers
170
views
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":[],"...
0
votes
1
answer
291
views
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 ...
0
votes
1
answer
136
views
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 ...
0
votes
1
answer
267
views
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 ...
1
vote
1
answer
1k
views
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 ...
0
votes
1
answer
209
views
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) ...
1
vote
1
answer
66
views
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?