Skip to main content
Share Your Experience: Take the 2024 Developer Survey
14 votes
Accepted

How do you send Ether as a function to a contract using Remix?

The code is correct but I lacked the understanding regarding the mechanics of how Ether is accessed and sent to contracts. I will explain to aid others in their advancement of knowledge... The ...
29A's user avatar
  • 347
6 votes

What does it mean by smart contract state.Where they get stored?

What does it mean exactly by state change. State change in a smart contract refers to a Transaction, which means two parties involved in the transaction will have some changes. For instance, if you ...
Sanchit's user avatar
  • 3,502
5 votes
Accepted

How is a post-transaction state calculated?

The state trie contains the balance of each account. Even transactions that throw an exception result in a reduction in the sender's balance through gas costs, which means that the resulting state is ...
Tjaden Hess's user avatar
  • 37.1k
5 votes
Accepted

How to send Ether to a contract successfully?

A contract can't forcefully extract ETH from a wallet address, if you want to pay Ether into a contract, you must set the "Value" of the transaction when calling a function (or just send ETH to the ...
AnAllergyToAnalogy's user avatar
4 votes

Carry out function for either x state or y state

Here's one way to do it: pragma solidity ^0.4.2; contract Test { enum GameState {noWager, wagerMade, wagerAccepted} GameState public currentState; modifier onlyState(GameState ...
BokkyPooBah's user avatar
  • 40.3k
3 votes

More questions about changing a smart contract state (variable)

When tx1 and tx2 are broadcast to the network they will be picked up by miners and included in blocks. If both tx1 and tx2 originate from the same "owned" account, then they will be included in the ...
benjaminion's user avatar
  • 9,297
3 votes
Accepted

Transaction propagation and acceptance on forks

Yes, the same contract can be mined on both sides of the fork. I don't think it's correct that each instance of the contract creation would yield a different contract address. Contract addresses are ...
Edmund Edgar's user avatar
  • 16.9k
2 votes

What does it mean by smart contract state.Where they get stored?

What does it mean exactly by state change. Where they get stored. State change of a contract means the values of the variables that are stored on the blockchain as part of the contract are changed. ...
joifsi's user avatar
  • 1,019
2 votes

Smart Contract States

Unlike other forms of software in which the data is (generally) external to the software that manages it, contract data is stored within a namespace (a key/value store) that is logically "inside" the ...
Rob Hitchens's user avatar
  • 55.3k
2 votes
Accepted

Reason for World State

From what I've understood through all the reading I've done on Casper CBC I'm assuming you're referring to Vlad's Casper CBC paper? Vlad has proposed a number of sharding schemes but I don't think ...
Kent Shikama's user avatar
2 votes

How Ethereum supports in dealing with double spending problems

If the transactions are created close to each other they are possibly valid transactions. If one transactions has already been processed (mined) and the wallet knows about this then the wallet refuses ...
Lauri Peltonen's user avatar
1 vote
Accepted

Is EVM deterministic?

Are these two different concepts? Even though we can't predict the result beforehand, being deterministic means that for the same starting conditions, and given the same inputs, the same result will ...
Richard Horrocks's user avatar
1 vote

How Ethereum supports in dealing with double spending problems

The wallet's idea of its balance is irrelevant. It's the network's accounting that matters. That is what is authoritative. A wallet merely reports it. There are really two scenarios here: Double-...
Rob Hitchens's user avatar
  • 55.3k
1 vote

Smart Contract States

The definition of “state” is the position the smart contract has in the space described by its permanent variables. In the case the smart contract has one bool variable and nothing more, it can ...
Rick Park's user avatar
  • 3,194
1 vote
Accepted

How can Ether be withdrawn from a contract successfully using transfer?

You need to add a payable function to accept Ether function () public payable { // this function enables the contract to receive funds } It doesn't need to do anything, but you can add logic in ...
Daniel Luca CleanUnicorn's user avatar
1 vote

Is it possible write a test for Truffle to validate that I am preventing unpredictable state variable changes in my contracts?

Having looked at the doc you linked, I don't think you need to simulate transactions happening at varying speeds. Since you also submit the nextTransitionCounter to the functions that you declare that ...
willjgriff's user avatar
  • 1,658
1 vote

Formal definition of the EVM as a Turing Machine

I can confirm the following: they run the exception handling before the state transition. If exception handling is triggered, the ongoing transaction is being reverted, so the state remains the ...
thorstenhirsch's user avatar
1 vote

Transactions and contract state

If both transactions for the token saved in your contract are mined, it will act by whoever is higher up in the transaction pool (whoever paid more). There is only one token and two people, so only ...
Fifth Dimension Dragon's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible