New answers tagged

0

When using Uniswap you have to grant it permission to transfer tokens on your behalf. (This is part of the standard ERC20 functionality and a common feature of dapps.) The Uniswap UI gives you two options: Grant an "infinitely" large allowance so you never have to re-approve again in the future, or; Grant a specific allowance amount, and re-...


1

The instructions below are for senior software developers, who know Docker and UNIX command line. You will also need an Ethereum API node. Create alias that runs the command sto from the command-line using Docker container. If Docker image is not on your local computer yet, it will be automatically downloaded on the first sto run. alias sto='docker run -p ...


1

ethapi.contract.getabi() returns a promise, not the ABI. You can take advantage of async await in order to wait for the promise response. async function getContractFromAddress(contractAddress) { let contractABI = (await ethapi.contract.getabi(contractAddress)).result let tokenContract = new web3.eth.Contract(contractABI,contractAddress) return ...


1

Replace: tokenContract.symbol().call() With: await tokenContract.methods.symbol().call(). Your first mistake is that symbol() method is in object tokenContract.methods and second one is that you're making external request to the blockchain without having the keyword await.


0

What is "swap" presicely between ERC20 tokens? Is it exchanging one ERC20 token for the other without fees, A "swap" is a trade, which may or may not include an explicit fee. By "trade" I mean you are buying one currency or token for another. As we're talking about ERC20 tokens, and not derivatives*, the term "swap" ...


1

It looks like you're looking for an on-chain mapping of Symbol -> USD price. I'm not sure it makes sense to aggregate aggregators if you're looking for an interface as described. You have two options to get a mapping of Symbol -> USD Price. Create the mapping yourself This is what Aave currently does It would be nice if there was a library for all ...


1

There are several reasons why this might be leading to an error: According to the web3js docs The transactionHash event is fired automatically as soon as the transaction hash is available. On local ganache blockchains transactions are usually confirmed and mined instantly after being sent (unless configured otherwise). On testnets and on mainnet this event ...


1

The only way is to iterate over all the blocks in the chain using the eth_getBlockByNumber method, extracting transaction data from them


0

If we have a _totalSupply variable, we have to update it each time one balance change. So it will cost some gas to write this variable. That's not correct. For example, if Bob transfers x tokens to Alice, their balances will be updated but not the total supply. The same principle applies to fiat money, a bank or cash transfer has no impact on the total ...


1

To get the address of the created contract, I use the RPC API function eth_getTransactionReceipt - it has an analogue on the web3.


0

A single Ethereum address can manage both ethers and tokens, providing the wallet supports the token standard. Ledger and Metamask support ERC20 : To manage ERC20 with ledger see this : https://support.ledger.com/hc/en-us/articles/115005197845-Manage-ERC20-tokens. To add UNI to Metamask you just need the contract address, more info here : https://metamask....


1

If you go to https://etherscan.io/address/0x1b2cb9a600f80d8cdb529f8d448b9010b0c978c6 you can see it has the tokens which were transferred to it. The address has no Ethers, as nobody has transferred Ethers there - that's why "Ether value" is 0.


1

ERC-20 is specific to Ethereum. Other blockchains have similar token standards that are copy-paste or inspired by ERC-20.


0

Yes you can. You can add any extra functionality you want, as long as the required functions with the correct signature are present.


0

Let's talk about what's going on, and then talk about a potential solution for the OP's specific case. When generating many accounts from one seed, there is a master keypair (public and private keys, just like a regular keypair), and then the other accounts have their private and public keys generated from that keypair. The generated accounts do not have the ...


0

I think my VS Code is messed up, because I tried using it in remix and it works fine. If anyone knows how to fix this VS Code problem LMK please!


0

Root cause of the issue identified: When I deployed FVP_Tokel.sol on Ropsten via Truffle/Infura it migrated and worked just fine; but when I started experiencing issues while deploying on Mainnet (the prompt would just sit there for hours after compiling) I decided to try Remix (granted, the new fancy version) which in fact I do not recall there was an area ...


1

You don't need to "find" a smart contract which does that, since there isn't probably a token which does exactly what you need. So you need to create it. Most of your requirements sound like pretty standard ERC20 functionality. You can start by using OpenZeppelin templates - inherit the required contracts and extend their functionality as needed.


0

You can try to import the wallet into myetherwallet.com or mycrypto.com app. What you need is add the contract address for the token if its not included as standard in your wallet of choice.


0

I have created a dApp that does an ERC1155<->ERC20<->ETH bridge (ERC-721 to be added - please make a pull request). Convert between ERC-1155, ERC-20, and ETH in both directions in several ways (locking or wrapping). So 2x2+1=5 ways to convert. No fees. Several blockchains deployed. Live: https://erc1155.portonvictor.org/#/ GitHub: https://github....


0

My wallet 0xbC57B9bb80DD02c882fcE8cf5700f8A2a003838E is the creator wallet ; See the Contract ; Therefore I should be the ONLY one able to see and execute the MINT function. I am still waiting for an answer from the Ethereum Team...


0

Whether it's possible or not depends on your contract, but most likely it's not possible. Once a contract is deployed it's immutable - you can't change it. There exist various architectural patterns which allow you to upgrade contracts, but these are typically not used for basic ERC20 tokens. Also, if you don't know about this, then you probably don't have ...


0

I got the answer, you have to pass the full length address to remix. even if it is an address or 0x0 in this case it will be : 0x0000000000000000000000000000000000000000


0

As mentioned in the comments, this is not possible directly - you would have to know in advance all the tokens you will buy and their addresses (maybe they don't even exist yet). Also I can't see how any EIP would help you with that since you can't approve a token which doesn't exist. Unfortunately I can't also think of any way you could do this with a ...


1

If you call it from an externally-owned account: It is better to check the allowance in advance, because doing so can save you a bit of gas if it is insufficient and the transaction would subsequently revert. If you call it from a smart-contract account: Depending on how you want your contract function to behave - for example - you may want it to do ...


1

Found the answer, go to https://old.instadapp.io/exit they Key to the whole thing being the /exit page.


0

One solution would be to have an initial zero supply and when someone deposits ETH into your contract then the contract will mint an appropriate number of tokens and transfer them to the caller. Later when they return the tokens to get their ETH back you can destroy the tokens so that they no longer exist. The other alternative would be to create an initial ...


0

The error message Bad instruction and the gas consumption equal to gas limit 1,000,000 indicates the problem was caused by an assert or low level error like array out of bound access. Looking at the receive function none of the transfers should cause Bad Instruction. Failed transfers revert but do not consume all available gas. After discarding mapping ...


0

Here is how it worked out. In the crowdsale migration.js, I've deployed token contract first, fetched the address through async. Assigned it to a const. This const thereafter acted as a pointer to the token contract. Migration code below const Crowdsale = artifacts.require("contracts/Crowdsale.sol"); const Token = artifacts.require("contracts/...


0

I had the same problem, I found the solution on Github. Basically, you need to delete indexOf() function after error.message so it should look like this assert(error.message, 'error message must contain revert'); Here is your answer: https://github.com/dappuniversity/token_sale/issues/27


0

_unstable__ERC20Owned is a contract. You can find it in your file at the line 118. A same file can include several contracts. For exemple here you have two contracts in the same file : GSNRecipientERC20Fee and _unstable__ERC20Owned. The first one instantiates the second one in its constructor.


0

As everyone knows smart contracts only accept ETH. They can manage ETH and tokens. How can I transfer ERC20 Tokens to Bitcoin donor in ICO? You could use Wrapped BTC (wBTC) which is an ERC20 token backed by Bitcoin, such that its price follows that of BTC (https://etherscan.io/token/0x2260fac5e5542a773aa44fbcfedf7c193bc2c599). Therefore, instead of ...


0

You can get this info by checking the metric non-zero-balance-address https://studio.glassnode.com/metrics?a=USDT&category=&m=addresses.NonZeroCount They have API support.


2

The use-case is that you give permission for someone else to transfer from your account. That someone else can be either an externally-owned account or a smart-contract account. For example, suppose you want to convert some TKN to ETH on Uniswap. You could theoretically transfer your TKN to the Uniswap contract and then call some function on it to send you ...


2

What stops devs from changing supply of contracts? Only one thing - others will see it in their code and simply avoid using that contract. Would making the state variable private or internal prevent this from happening? No, the access level of a state variable (private/internal/public) determines who can read it, not who can change it. The only one who ...


Top 50 recent answers are included