As of May 31, 2023, we have updated our Code of Conduct.

New answers tagged

0 votes

Implementing an ERC20 Smart-Contract within another Smart-Contract

OK I finally got the thing working so here are some major takeaways that I think & hope future coders will find very helpful if they're trying to achieve the same functionality: While Metamask (...
Mark55's user avatar
  • 929
0 votes

Implementing an ERC20 Smart-Contract within another Smart-Contract

First of all ethereum require to pay transactions in ETH and not in any ERC tokens. So in your case you want to collect Fee for invoking your contract by ETH or ERC token so what you have to do is use ...
kishan sudani's user avatar
1 vote

Metamask - get value entered from calling ERC20 "approve()" method

when you send the transaction you cannot override the argument again if you do that that will be another transaction. in your case you hardcoded the 1000 to be approved and in metamask user can enter ...
mahyar's user avatar
  • 53
0 votes

insufficient allowance Error .. ERC20

From your code what I understood is that you want to access tek token from your contract when user is calling the buyItem function. You can achieve this using two methods. approve Your contract code ...
kishan sudani's user avatar
0 votes

Token allowance of router address

There is no need to cast routerAdd to an address, as it is an address already. You can therefore just use allowance[address(this)][routerAdd] =... The reason developers do it this way is, that is it ...
Nal Luksic's user avatar
0 votes

transferFrom not working. Estimate gas fee error. Cant find the bug

trying openzepplin libraries like safeMath to perform calculations will limit the error rate in calculations, safeErc20 library will allow you to use functions like safeTransferFrom to transfer ...
kaay's user avatar
  • 5
0 votes

How can I remove custom spending cap on Metamask?

Simple answer, you cannot for good reason. Find your answer here. We designed this interface to give you more control and visibility over your token allowances, since you'll be prompted to always ...
norym's user avatar
  • 141

Top 50 recent answers are included