Edmund Edgar
  • Member for 5 years, 10 months
  • Last seen this week
Paying a transaction fee with an ERC20 token
Accepted answer
22 votes

It is not really true at the moment that you can pay fees in anything except ETH, although there is some discussion about changing this. The way things normally work, you have to pay the fee in ETH. ...

View answer
Transaction timestamp
1 votes

Solidity doesn't have access to a transaction timestamp, so the timestamp used is usually the timestamp of the block in which it was mined. This means a transaction sent earlier that is mined at the ...

View answer
Deriving Ethereum address from Bitcoin address
Accepted answer
4 votes

A Bitcoin address is made by: private key -> public key -> hash An Ethereum address is made by: private key -> public key -> hash -> throw some of it away and keep the rest This means that the ...

View answer
What is best what to store a string's compressed version on a smart-contract?
Accepted answer
1 votes

An IPFS address consists, in reverse order, of a hash of the data, the length of the said hash, and an identifier to tell you what algorithm is being used for the hashing. The algorithms in wide use ...

View answer
how to maintain msg.sender when internal function call
1 votes

In standard ERC20 contracts the transfer() function can only be called by the account that owns the tokens. If you want to put a contract in the middle, the caller (msg.sender) of the transfer() ...

View answer
Is it possible to make approve and transferfrom in single transaction?
1 votes

The purpose of the approve() -> transferFrom() flow is that you want a different account to do the transfer than the one that is allowed to approve it. If it's a single account, you'd normally just do ...

View answer
View contract details in a Django application
0 votes

You have two options: Run an Ethereum node, or find someone who will let you use theirs. (For example, Infura provide the use of Ethereum nodes as a service.) You can make queries against the ...

View answer
What is the philosophy behind the difficulty setting and block generating time?
1 votes

Faster block times are convenient for users because they both reduce both the time typically taken for an initial confirmation and the time necessary to be reasonably confident that the transaction ...

View answer
Does Ethereum have a payment URI like Bitcoin?
Accepted answer
6 votes

There are a couple of proposals, but I don't think either of them are widely supported yet: EIP 681: URL Format for Transaction Requests This provides for a standard URI scheme including a function ...

View answer
Can events always be called directly by user accounts? Is there a way to make them internal?
0 votes

When you talk about "calling" events, are you talking about emitting (creating) them or about querying them? An event is written to the blockchain which is visible to all participating nodes, so you ...

View answer
How could i fetch transaction hash for a particular transaction in frontend?
Accepted answer
1 votes

In the function in the contract, call a log event. Let's imagine you have a function like this (examples untested, may not work or even compile, it's just to give you the general idea...): uint256 ...

View answer
Tracking back data from blockchain and Immutable concepts
Accepted answer
5 votes

A full copy of the blockchain contains a complete history of all the transactions that ever occurred in its history, so data is never erased from a node that downloads all the data in every block and ...

View answer
tokens within tokens in ERC20
1 votes

Yes, it's possible. Any contract can own and control an ERC20 token, so you can either: Mint an allowance of your earned token and transfer it to your staked token contract which can then ...

View answer
web3 is not defined problem
0 votes

Look at the network section in your browser console and check for errors where it's supposed to be loading your external JavaScript. At a minimum it'll be failing because you have a typo in ...

View answer
truffle migration fails, but initial migration was mined
0 votes

You're setting an exceedingly high block gas limit. Try reducing it to below 2147483647. PS You might also like to look at Etherlime, which provides a nice alternative to truffle migrations that's ...

View answer
How do you set an icon for Metamask "DApp Connect" popup prompt?
Accepted answer
1 votes

Metamask uses the favicon for your site. See here for how to set one up: https://www.w3.org/2005/10/howto-favicon

View answer
Deliberate Slashing: Don't slashing and leaking incentivize DDOS attacks on smaller nodes? Won't this centralize POS more than POW, even?
3 votes

This isn't a great question for Stack Exchange because you've buried a bunch of separate questions in the premises. Reddit would probably be better. But here goes. The penalty for being offline for a ...

View answer
Do contract calls atomically modify contract contents?
Accepted answer
2 votes

Yes, contract calls are atomic and transactions run strictly in series, so you don't need to worry about different transactions treading on each other. However, you don't know what order transactions ...

View answer
Contract methods calls return empty array
0 votes

You have some stray brackets after the method name. Instead of registryContract.methods.owner().call(); try registryContract.methods.owner.call();

View answer
Output order changes after the event triggered
1 votes

Since your calls to getCandidate() are asynchronous - you're calling each item without waiting for the previous result - you can't be sure that the order you request the data will match the order you ...

View answer
Error InternalCompilerError: Stack too deep, try removing local variables
2 votes

You have too many variables in the function (including the parameters). You need to find a way to reduce the number of variables used by a single function. If your contract is just storing those ...

View answer
Official Update on Ethereum 2.0?
4 votes

Ethereum is a decentralized network so nobody has the last word on what is "official". Vitalik may propose something and everyone may ignore it. The closest thing Ethereum has to an "official" ...

View answer
How Exactly is Smart Contract Validation Performed?
2 votes

A transaction is validated as part of a block. A block consists of an ordered list of transactions, and a reference to the previous block it builds on top of. During validation, every step in ...

View answer
bytes32/uint256 conversion
Accepted answer
2 votes

Assuming genes.test.call(0x000063169218f348dc640d171b000208934b5a90189038cb3084624a50f7316c) is JavaScript, your problem is probably that the parameter is getting interpreted as a JavaScript number,...

View answer
Increment a uint variable results in unexpected value
Accepted answer
0 votes

It should only be adding 1. The problem is almost definitely in the method you're using to read the variable, which we can't see. Write some tests, and if your tests fail, post the failing test.

View answer
How to delete or remove a key from mapping?
1 votes

delete categoryMap[_oldCategoryLabel];

View answer
avoid replay attacks on signing on smart contracts
3 votes

The signature only signs a specific message, so attackers can't use the same signature for a different message. There is a class of attacks called replay attacks which apply to resending the same ...

View answer
Can you input a variable into a contract call?
Accepted answer
1 votes

You can't make the EVM interpolate things in the parameters you supply in your transactions. The code creating your transaction, typically JavaScript, can of course do whatever computations it likes ...

View answer
account nonce - what if it did not exist?
2 votes

The nonce is not intended to stop you spending the same money twice. If you had two transactions sending the same 50 ETH, the first transaction would go into the blockchain as a successful transfer, ...

View answer
Truffle Webpack starts with error: MetaCoin has not been deployed to detected network
Accepted answer
24 votes

One thing to check would be the network ID. It doesn't matter what network ID you use for your local test node, but Truffle needs to agree about what you're using with testrpc. With testrpc running, ...

View answer
1
2 3 4 5
14