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

Solidity BlockChain invalid amount check

// Attempt transfer tokens, when you have none invalidAmount = tokens(10) // recipient has no tokens ?? await token.transfer(deployer, invalidAmount, { from: receiver }).should.be.rejectedWith(EVM_REVERT) Fellow Developers , I am…
Shubham
  • 21
  • 2
2
votes
1 answer

How to Use Web3 to Purchase ERC20 Token

I'm trying to implement a solidity "purchase" function into web3. Ultimately, I want to have a button where a user would then have metamask open to send a fixed amount(1 ether for a simple example) to the smart contract in exchange for an ERC20…
2
votes
1 answer

Contract Address cannot receive ETH

I have tried many times but cannot transfer ETH to Contract Address. https://rinkeby.etherscan.io/address/0xe9d0430dea9b84a9e32801d6e6072175fd48fb85 Errors such as: Warning! Error encountered during contract execution [out of gas] Warning! Error…
2
votes
1 answer

What is the use of Uniswap Router Initialization in a Token Contract

I just started on building Tokens using ETH & BSC, this is one statement which I see in many Contracts. Inside the Constructor method, the Uniswap router is iniliazed probably with the V2 version. What is the use of this? constructor () public { …
BlockChain Learner
  • 125
  • 1
  • 10
  • 18
2
votes
2 answers

Solidity - Add Total Supply

I'm learning solidity on remix I'm also referencing this open source api for token creation. Right here they provide a _totalSupply() function that I'd like to wire to my smart contract so it shows the total amount of tokens why I deploy it. What am…
Null isTrue
  • 1,882
  • 6
  • 26
  • 46
2
votes
1 answer

What happens if the total balance of tokens exceeds the totalSupply of a token?

As I understand it the totalSupply is just a number for informational purpose. It doesn't impose a hard limit on the total of all balances, or does it ? Example: function transfer(address receiver, uint numTokens) public returns (bool) { …
Howie1337
  • 31
  • 3
2
votes
2 answers

How to create a Privacy Preservinng Algorithmic Stablecoin in Ethereum

How to create privacy focus algorithmic stable coin on ethereum I want to create a algorithmic stablecoin on the top of ethereum platform please suggest any reference, website, code
2
votes
1 answer

get array of ownership of an ERC20

I'm trying to build a node.js server that using the web3.js to get a map of all accounts that have a token and the number of that token they all have. The output I'm trying to get is the map key being the address and the map value is the amount of…
Patrick W. McMahon
  • 3,488
  • 1
  • 20
  • 31
2
votes
1 answer

Subscribe for ERC20 transfer events

I have been trying to observe the transactions taking place on mainnet for a specific contract, specifically Tether (USDT). I am able to download the contract and compile the solidity code with Web3 (Java). However I am unable to subscribe for…
2
votes
2 answers

Why do I get the error: Could not find import, when compiling on truffle

So, I'm trying to compile in truffle some open zeppelin ERC20 contracts, but I get the following error: Error: Error: Could not find import from any sources; imported from C:/Users/Angel/Documents/blockchain course/ethereum…
2
votes
0 answers

How do I create a custom token in the Libra TestNet?

I want to create my custom token in Libra TestNet. I don't have much knowledge about the move programming language and need a lot of help. Is it possible to create our own implementation and execute in Libra Testnet? What is sample implementation…
karthi keyan
  • 213
  • 2
  • 19
2
votes
1 answer

Solidity error message when executing smart contract: “The called function should be payable if you send value...”

I'm trying to deploy an ERC777 test contract ON REMIX IDE; but the VM is giving me the below error when I try to transact the contract VM error: revert. revert The transaction has been reverted to the initial state. Note: The called function…
gussy_88
  • 23
  • 1
  • 3
2
votes
0 answers

How to set different signer and gas payer for a single transaction

I am trying to make a transaction of DAI tokens from user wallet 0xDAIUserWallet to some random token contract say 0xRandomContractAddress. In this scenario I am using the private key of DAI User to sign the transaction as well as to pay gas fee, as…
DIGVJSS
  • 463
  • 1
  • 10
  • 21
2
votes
0 answers

How to fix "Gas estimation failed error" when transferring Minter and Owner roles to a new account in one function?

I have a simple ERC20 contract which is ERC20Detailed, ERC20Mintable and Ownable. On deployment I want: Add Minter to a new account, passed in the argument Remove deployer from Minter role Transfer Ownership to a new account, passed in the…
Gio
  • 73
  • 2
  • 13
2
votes
0 answers

Arbitrary File Overwrite, Dependency of truffle-hdwallet-provider

I am trying to deploy a contract to mainnet, and after running "npm install --save dotenv truffle-hdwallet-provider" I get 1 high severity vulnerability - Arbitrary File Overwrite. (details below) I have tried to open package-lock and edit versions…
Josephhh
  • 21
  • 1