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

Difference between ERC20, ERC223, ERC721 and ERC948?

I am new to Solidity. I got lots of type of solidity but I am not able to get what actually difference in all type of ERCs. Can anyone please explain the differences and similarities to me.
2
votes
1 answer

Can the same public address used for Ether be used to receive other coins as well?

I am planning for a cryptocurrency app, and am trying to figure out something I haven't been able to find an answer to. On the Etherum blockchain, a user has a public address used for receiving coins, and a private key used to send. There are also…
Lars Andren
  • 8,601
  • 7
  • 41
  • 56
2
votes
0 answers

truffle migrate: calling method at the time of deployment

I am trying to initialize some contracts at the time of deployment using 'truffle migrate'. Basically I want to create some user roles when my contracts gets deployed as one time task. I am not sure how to do it, as during 'truffle migrate' when…
dagra
  • 589
  • 4
  • 20
2
votes
0 answers

web3.js - how to check if a Token Contract implements ERC223 standard?

I would like to receive payments in any given ERC20 Token. For that, the user must fisrt approve the transaction calling... function approve(address, uint) ... on the Token's contract and then call to a specific function on MyContract that will…
Viter Rod
  • 450
  • 6
  • 11
2
votes
2 answers

Transfer custom ERC20 token using web3 (invalid address err)

I'm using web3 library version 0.20.2. What I want to do with my smart contract is just transfer the custom erc20 token. smart contract code below (sloidity) function transfer(address _to, uint256 _value) returns (bool success) {} I want to use…
rachel_hong
  • 471
  • 2
  • 6
  • 15
1
vote
1 answer

Abstract Contracts In Solidity TypeError: No arguments passed to the base constructor. Specify the arguments or mark "AssetAcquisition" as abstract

I had an issue with a solidity contract in which the error demanded I write my code as an abstract. Abstract means my code will be non-deployable. This is a contract that aims to transfer assets and acquisition. Just random stuff! import…
Bonsu
  • 67
  • 1
  • 5
1
vote
1 answer

Error adding liquidity to UniswapV2Pair during construction

I'm concerning about why I'm getting an error trying to add liquidity using the addLiquidityETH to a UniswapV2Pair during construction. It seems that it reverts when the router calls the IUniswapV2Pair(pair).mint(to); method. If I, instead, call the…
1
vote
2 answers

How to appoint the address in the approval process for future transferFrom in ERC20 smart contract

When I use approve and transferFrom, I notice the owner can give authority to spender. However, the owner CAN'T appoint an address for this approval that the token will be transfer to. That means if the spender got the approval, it can transfer…
Huowuge
  • 41
  • 5
1
vote
0 answers

Issues while selling to a liquidity pool created for my own smart contract

i've been lately trying to create an ERC20 Token with Some Fees implemented on the transfer functions and an AntiSnipe system which is supposed to block the addresses trying to make a transfer in a certain range of time. As per Uniswap…
user18541404
1
vote
1 answer

how to call an external function in YUL?

How can I accomplish the next behavior(more specific to implement callMint) in Yul? I couldn't find anything related to this contract Token is ERC20{ .... function mint(address addr, uint256 amount) external { _mint(addr, amount); …
bogdy9912
  • 172
  • 1
  • 1
  • 10
1
vote
1 answer

i am trying to install a package in my terminal and they give an error message that said

up to date, audited 704 packages in 2s 121 packages are looking for funding run npm fund for details 8 vulnerabilities (5 high, 3 critical) To address all issues (including breaking changes), run: npm audit fix --force Run npm audit for details. I…
1
vote
1 answer

How i send ERC20 tokens using wagmi.sh hooks (useSendTransaction)?

How can I send ERC20 tokens (not native tokens) using wagmi.sh hooks (useSendTransaction)? This the standard react hook : import { useSendTransaction, usePrepareSendTransaction } from 'wagmi' function App() { const { config } =…
AMHF
  • 19
  • 2
1
vote
0 answers

Error HH404: File @openzeppelin/contracts/token/ERC20/exstentions/ERC20Capped.sol

I'm using visual studio code and I'm trying to make my first crypto token so I'm new to all this coding and everything but I'm following a tutorial for a ERC20 token and im stuck on npx hardhat compile because every time i do it i get the error…
1
vote
1 answer

Native coin MATIC has a Contract Address on the Polygon Network?

I am currently developing a donation smart contract for the Polygon blockchain. The donation contract should receive many types of coins like (MATIC, USDT, USDC, etc.). I first made the donate function like the below: function donate(address donor,…
azvast
  • 337
  • 4
  • 10
1
vote
1 answer

Allowance is returned zero even after approval

I was unit testing my contract and within the tests i approved that the smart contract should be able to spend the tokens of the msg.sender (the owner) and then tried to transferFrom function to transfer the tokens from the msg.sender to the…