New answers tagged

0

If you want to call a method without the abi file you can do it by encoding the signature. https://github.com/ethereum/web3.js/blob/5829347e537473b6de2d9fda2c830f2be6f47968/docs/web3-eth-abi.rst#encodefunctionsignature Once you've encoded it you can sign the transaction and submit it manually.


2

No, they are not equivalent. The first will allow to return more than 32 bytes of data. The second one will revert in that case. There are also other side effects like the first one allocates memory for the returned data and the second doesn't allocate new memory it uses the 0 address.


0

Only from the smart contract based wallets that are designed for this. ERC-20 tokens on normal Ethereum accounts cannot do this.


1

transact() asks the node to sign your transaction using eth_sendTransaction. Infura can't do that, because they don't have your keys. Instead, you can use the contract object to create an unsigned transaction like: contract_call = contract.functions.transfer(destination_address, value) unsigned_txn = contract_call.buildTransaction({'chainId': 1, 'gasPrice': ...


0

The problem is that deployed() will not work until the migrations script has completed, but you have access to deployed address and create an instance pointing to it. module.exports = async function(deployer) { await deployer.deploy(Migrations); await deployer.deploy(DaiTokenMock); const tokenMock = await DaiTokenMock.at(DaiTokenMock.address); //...


1

One approach is identifying the ERC20 contract first, you can do this by different heuristics. Once you have the list of ERC20 contract addresses you use JSON RPC to do a eth_call for each ERC20 using the ERC20 ABI to obtain the balance of the address you want. To identify the ERC20 contracts in a blockchain you can: Download the code of each contract and ...


0

Regarding token recipients Any address can be the beneficiary, receiving ERC-20 and ERC-721 tokens (and also ERC-1155, ERC-777, and any other tokens). Regarding token contracts (the thing that emits the events) However, no, it is not possible for a token contract to both be an ERC-721 and an ERC-20 contract at the same time because those two specifications ...


0

Standard can be "retro compatible". However, I do not think it is the case for ERC-20 and ERC-721. Indeed, they are related to different types of token, fongible and non fongible. So you cannot manage both at once in this case as function names are the same, but behavior is different. However, if you are interested in both fongible and non fongible ...


0

That looks like the contract is the recipient of both types of tokens. The contract might have functionality to also transfer the tokens out of it but it might not. If it doesn't have such functionality the tokens simply stay there and can never be transferred out of it. You can't implement both of the standards in one contract as they have overlapping ...


0

You are misunderstanding how Ethereum ERC-20 tokens work. A single Ethereum account (address) can serve multiple tokens. There is no need to create a separate address for each token. To get an ERC-20 balance of an address for an token is well documented. For example. follow this ERC-20 tutorial.


0

As the question is "will it ever" the answer is most likely "yes". 15 GWei is not a bad fee in general, we just currently happen to be in a situation where that is not acceptable. Sometimes transactions with even 0 gas price are mined (although the reasons for that remain a bit unclear). So, as you were already told, just wait or replace ...


1

If the average gas price and the transaction flux stay as high as it is since a few months, it is very unlikely. If you want to replace your transaction you can send a new transaction with the same nonce and a gas price much higher.


1

In wallets and other Dapp interfaces different tokens and assets are displayed as having decimals. Since the EVM doesn't really support normal decimal datatypes such as floats for example what most ERC20 tokens do is they use integers and instead define a number of decimals (usually 18). So when you receive 1 BAT for example the smart contract will really ...


Top 50 recent answers are included