Edmund Edgar
  • Member for 5 years, 11 months
  • Last seen this week
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
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
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
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
Generating lots of private key means I can hack someone's ether?
Accepted answer
1 votes

Theoretically, yes: A private key is just a random number, and if you make one there is a non-zero probability that it will already be in use by someone else. However, the probability of finding a ...

View answer
Calling transfer returns true but doesn't perform the transfer
Accepted answer
2 votes

Web3's call is for making read-only calls to your local node. Try: tokenContract.transfer(_transferTo...

View answer
how come web3 send does not require a private key or signature
2 votes

The web3 library creates a transaction that needs to be signed by the account specified in from. It is signed either by talking to a local node which has the private key to that account and currently ...

View answer
How can I increase the nonce in Smart Contract?
3 votes

Yes, the contract nonce counts how many contract creation operations it's done (starting at 1, although it used to be 0) and a contract create operation is the only way to increase it. However, the ...

View answer
A doubt about forks and mining
Accepted answer
1 votes

If you see an invalid block you just ignore it and go back to doing whatever you'd be doing if you'd never seen it. Use the transactions you were previously using, and the next nonce you were ...

View answer
How to store dates before 1970-01-01 in a contract
2 votes

Yes, you can store whatever you like in your contract and give it whatever meaning you like. However, now returns a uint so you'll need to cast it. Try int date = int(now).

View answer
Why are timestamps stored in a uint (256 bit) when they would fit in a uint64?
2 votes

A storage slot is 256 bits, as are hashes, ETH amounts etc, so it's simpler to standardize on returning a 256-bit number. However, if you need a timestamp in your contract you are under no ...

View answer
I asked a stupid question, sorry guys! :(
Accepted answer
0 votes

Looking at the block explorer your transactions appear to be going through correctly. They fail when you send 0.1 ETH or less, because that's the minimum you set with require(msg.value > ...

View answer
"Augur" : Is it an "Oracle" or "data-source" ? which one?
2 votes

The premise of this question is Oraclize's definition which doesn't really match how people have historically used the term. On their definition Augur would be a data source, and you don't need an ...

View answer
1
2 3 4 5
14