Questions tagged [erc20]

ERC-20 is a smart contract standard defining an interface and a set of rules for development of fungible tokens on the Ethereum platform.

462 questions
3
votes
1 answer

How to transfer ERC20 tokens to another address using solidity?

I create ERC20 tokens, and i want to transfer my tokens to another address. I have two accounts in my metamask.(Account A/B) My ERC20 code's here (I deployed and save tokens in account A) pragma solidity ^0.8.0; // SPDX-License-Identifier:…
조규선
  • 73
  • 1
  • 3
3
votes
1 answer

ERC20: insufficient allowance

I created two token (YAY e sYAY) and a StakingRewards smart contract. Below the code: // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; contract YAYToken is ERC20 { …
Magnus
  • 41
  • 1
  • 1
  • 2
3
votes
0 answers

How do I find the number of buys and sells within the last 24 hours for a specific ERC-20 token?

I found this API that can give the the list of 'normal' transactions for a smart contract given the address for example Shiba Inu…
3
votes
1 answer

Displaying the transaction value of a custom ERC20 function in MetaMask

I have created a new contract on Polygon based on ERC20 with a couple of extra public functions. And am having trouble with communicating what the user is doing to MetaMask. When I perform a normal ERC20 transfer() transaction, the signature popup…
RedCabbage
  • 53
  • 5
3
votes
2 answers

Is there a way to trigger an event inside a contract when ERC20 tokens are sent to that contract?

I have a smart contract, which has an address when deployed. I want users to send ERC20 tokens to the smart contract address without using specific functions of the contract (USDC for instance) and I want to be able to trigger functions when this…
Jacobo Lansac
  • 167
  • 1
  • 11
3
votes
2 answers

ERC20: transfer amount exceeds allowance, even when it is approved

Returned error: VM Exception while processing transaction: revert ERC20: transfer amount exceeds allowance Code: ERC20Tokens[tokenTicker].token.approve(ERC20Tokens[tokenTicker].tokenHolder, 10); emit…
taranchik
  • 51
  • 1
  • 1
  • 4
3
votes
1 answer

Adding Liquidity to Uniswap fails

I'm trying to add liquidity to my smart contract on Uniswap, however whenever I try to add liquidity, I can approve the transaction, but hitting apply does nothing. The Javascript console shows an error saying: not able to predict gas gee. There's…
Daniel
  • 43
  • 4
3
votes
0 answers

Solidity - String Template Literal

How do I use string template literals on Solidity like JavaScript offers out of the box? I need to write a multiline string in my ERC20 and would like to leverage something that doesn’t require me writing a bunch of /n i.e. const…
Null isTrue
  • 1,882
  • 6
  • 26
  • 46
3
votes
2 answers

How to interact with OpenZeppelin proxy contracts from Truffle console?

I cannot figure out how to use @truffle/contract to interact with contracts deployed by package @openzeppelin/truffle-upgrades (ProxyAdmin and AdminUpgradeabilityProxy). I have deployed my contracts to Ganache: Deploying 'MetaToken' …
kivi_o
  • 103
  • 1
  • 9
3
votes
1 answer

How to transfer an ERC20 token between wallets with web3.py

I was wondering, what is the proper way to transfer an ERC20 token between two wallets using web3.py? I am testing everything on the Rinkeby test network. Here is what I've tried... from ethtoken.abi import EIP20_ABI from web3 import…
bond00719
  • 33
  • 1
  • 5
3
votes
0 answers

Ethereum ERC20 token transaction between private(Hyperledger Fabric) and public(Ethereum) blockchain

I've developed a case study based on Hyperledger Fabric using the fabric-chaincode-evm in order to develop Solidity smart contract. Using chaincode-evm there's the Fab3 proxy in the middle between Application and Fabric Network that map the Fabric…
3
votes
2 answers

Getting a list of ERC20 token holders in solidity

Is it possible to get a list of token holders for a given ERC20 token from within another solidity contract? Since "balances" are stored in a mapping in most ERC20 contracts, I do not think it is possible, since you can't get a list of keys for a…
user1558646
  • 145
  • 4
  • 9
3
votes
1 answer

How to create a ‘feeless’ ERC20 token?

Is it possible to create a feeless ERC20 token? Or paying fees through another address? I have a solution in mind, to refund the transaction fee amount to receiver’s adress from a central address. Any ideas?
Eugene Oz
  • 39
  • 1
2
votes
1 answer

Is there a way to get totalSupply of an ERC20 token using web3j java?

I'm developing an android app using android studio. I implemented web3j and successfully connected to ethereum using infura. I'm not sure how I can get the total supply of a specific coin. Tried using the load method to load a specific tokens…
Sparky
  • 21
  • 2
2
votes
1 answer

Issues setting a maximum amount of tokens in ERC20 contract

I've been trying to create a very simple ERC20 token with truffle in the rinkeby network. I placed the following code into my .sol file but the max supply doesnt seem to match. // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import…
ArtySaurio
  • 25
  • 3
1 2
3
30 31