Questions tagged [ethereum]

Ethereum is a blockchain currency (like Bitcoin) with a public ledger. Questions should relate to programming. General questions about Ethereum should be asked on https://ethereum.stackexchange.com

is an open-source, public, blockchain-based distributed computing platform featuring smart contract (scripting) functionality. It provides a decentralized Turing-complete virtual machine, the Ethereum Virtual Machine (EVM), which can execute scripts using an international network of public nodes. Ethereum also provides a cryptocurrency token called , which can be transferred between accounts and used to compensate participant nodes for computations performed. Gas, an internal transaction pricing mechanism, is used to mitigate spam and allocate resources on the network.

was proposed in late 2013 by Vitalik Buterin, a cryptocurrency researcher and programmer.

The official website of is Ethereum.org

6757 questions
202
votes
3 answers

What is an appropriate type for smart contracts?

I'm wondering what is the best way to express smart contracts in typed languages such as Haskell or Idris (so you could, for example, compile it to run on the Ethereum network). My main concern is: what is the type that captures everything that a…
MaiaVictor
  • 51,090
  • 44
  • 144
  • 286
143
votes
4 answers

In Ethereum Solidity, what is the purpose of the "memory" keyword?

When looking at sample contracts, sometimes arrays are declared in methods with "memory" and sometimes they aren't. What's the difference?
fivedogit
  • 8,374
  • 7
  • 34
  • 43
67
votes
3 answers

What is address(0) in Solidity

Can anyone explain to me what address(0) is in Solidity? I found the following in the docs but it doesn't really make sense to me: If the target account is the zero-account (the account with the address 0), the transaction creates a new contract.…
pizzarob
  • 11,711
  • 6
  • 48
  • 69
64
votes
5 answers

How do I get the balance of an account in Ethereum?

How can I programmatically discover how much ETH is in a given account on the Ethereum blockchain?
fivedogit
  • 8,374
  • 7
  • 34
  • 43
52
votes
5 answers

Data location must be "memory" for return parameter in function, but none was given

I tried solidity example like as above in remix, solidity version > 0.5.0 But I am getting this error now. What is the way to solve this error? contract MyContract { string value; function get() public view returns (string) { return…
venus12
  • 523
  • 1
  • 4
  • 4
46
votes
9 answers

Difference between various blockchain protocols

As the developers are constantly using different network protocols of blockchain such as Hyperledger, multichain, Ethereum, Corda, and others. Community will appreciate if the developers & blockchain enthusiasts can pour in some key differences…
Saurabh
  • 1,249
  • 2
  • 13
  • 14
41
votes
5 answers

Are there null like thing in solidity

struct buyer { uint amount; Status status; } mapping(address=>buyer) public buyers; mapping(uint=>address) buyerIndex; uint public buyerNum; // Order a product. function() { uint doubleValue=value*2; uint…
Hao WU
  • 521
  • 1
  • 4
  • 5
37
votes
8 answers

How to find out if an Ethereum address is a contract?

An address in Solidity can be an account or a contract (or other things, such as a transaction). When I have a variable x, holding an address, how can I test if it is a contract or not? (Yes, I've read the chapter on types in the doc)
bortzmeyer
  • 34,164
  • 12
  • 67
  • 91
36
votes
3 answers

TestRPC/Ganache: the tx doesn't have the correct nonce

I have been experimenting with truffle recently and followed the following tutorial: http://truffleframework.com/tutorials/pet-shop Whenever I try to setup a transaction I keep getting the same error below Error: Error: the tx doesn't have the…
user1664
  • 481
  • 1
  • 7
  • 6
29
votes
2 answers

Member "push" not found or not visible after argument-dependent lookup in address payable[] storage ref

In the statement players.push(msg.sender); I am getting following error: Member "push" not found or not visible after argument-dependent lookup in address payable[] storage ref. Thus I cannot push to address payable array in solidity. What's the…
Ayan
  • 8,192
  • 4
  • 46
  • 51
29
votes
14 answers

Truffle command not found after installation

I installed truffle through npm with the following: sudo npm install -g truffle but when I run truffle list on the console it just gives me bash: truffle: command not found
user3480478
  • 429
  • 1
  • 4
  • 5
29
votes
2 answers

When will Ethereum switch to Proof of Stake?

Ethereum currently uses GPU-mining proof-of-work to perpetuate the blockchain, but I've read that the Ethereum foundation and developer team aims to move to proof-of-stake at some point in the future. What is the difference between the two and when…
fivedogit
  • 8,374
  • 7
  • 34
  • 43
28
votes
4 answers

How to connect ethers.js with metamask?

I am using the ethers.js documentation: https://docs.ethers.io/ethers.js/html/cookbook-providers.html . I am getting the error when setting up the provider -: Uncaught ReferenceError: web3 is not defined I want to connect my Decentralized…
Aashutosh Singh
  • 389
  • 1
  • 3
  • 4
28
votes
3 answers

Solidity basics: what "msg.sender" stands for

I just started to learn Solidity as a personal challenge. I'm not a developer so I've a loooooong way to go. I'm following the Ethereum.org tutorial, here is what I've got doubt about: What does [msg.sender] stand for? I guess it is the wallet…
Sumak
  • 319
  • 1
  • 3
  • 8
27
votes
3 answers

No safeTransferFrom function in ethers.js contract instance?

I created a contract instance in hardhat console like so: const contract_fac = await ethers.getContractFactory("ContractName"); const contract = await contract_fac.attach("CONTRACTADDR..."); Contract object has all public/external functions except…
Lightstorm
  • 379
  • 4
  • 5
1
2 3
99 100