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
9
votes
5 answers

Verify and Publish Contract on Etherscan with Imported OpenZeppelin file

I'm currently building a ERC721 compliant contract and have published the contract here: https://ropsten.etherscan.io/address/0xa513bc0a0d3af384fefcd8bbc1cc0c9763307c39 - I'm now attempting to verify and publish the contract source code The start of…
9
votes
3 answers

MetaMask does not inject window.ethereum: Uncaught (in promise) TypeError: Cannot read property 'request' of undefined

To start, let me mention this is an in-browser project, so i can only use So a few months back I made a dapp, which worked fine even tho I never set a provider,…
Bleiserman ADN
  • 141
  • 1
  • 1
  • 6
9
votes
1 answer

Does Solidity have HTTP request function?

I am making a project using Ethereum. In this project , I am making a contract called "A". When I send a message to "A", I want "A" to make a web request. Is it possible that Solidity requests using http (method GET/POST )?
문효범
  • 93
  • 1
  • 4
9
votes
2 answers

What is the difference between pure and view modifiers in solidity?

The code results in same output. pragma solidity ^0.5.0; contract mycontract { function add(uint c, uint d) public pure returns(uint) { uint e=c+d; return e; } function add(uint j, uint k) public view returns(uint) { uint…
9
votes
2 answers

How to call a Smart Contract function using Python and web3.py

I have a contract deployed on Ethereum test network which has some functions in it and they all happen to work while using the Remix interface. When trying to call those functions using web3.py in Python, I'm able to call only for public functions…
Moltenpowa
  • 221
  • 1
  • 2
  • 8
9
votes
8 answers

Uncaught Error: Returned values aren't valid, did it run Out of Gas?

I'm listening to events of my deployed contract. Whenever a transaction gets completed and event is fired receiving the response causes following error: Uncaught Error: Returned values aren't valid, did it run Out of Gas? at…
Ferit
  • 8,692
  • 8
  • 34
  • 59
9
votes
4 answers

How to get Smart Contract address when it is deployed with web3.js

I have tried to deploy a SmartContract from web3.js node library, I am getting a transaction hash from it but how would I get the contract address after It's been mined by a miner?
aac
  • 574
  • 2
  • 6
  • 18
9
votes
4 answers

How can we generate multiple random number in ethereum?

I want my smart contract to return 7 or 8 UNIQUE random numbers ranging from 1 to 100 upon calling the contract. What can be the best approach to obtain such result?
Joe Mutti
  • 137
  • 1
  • 8
9
votes
1 answer

Msg.sender does not work inside a "view" function, why? Is there a workaround?

I want to create a viewable function (needs to return a string to the user) that searches a mapping for msg.sender and if the senders value is x, I want the contract to proceed accordingly. It all does work inside remix but if I upload it to…
scoperationX
  • 127
  • 1
  • 9
9
votes
1 answer

Data on Private Ethereum blockchain lost/disappears after couple of days

I am deploying a private ethereum blockchain (geth) on a virtual machine on Azure. Upon deploying my Solidity contracts on the blockchain and launching my NodeJS application to it, I am able to add data normally through web apis of the nodejs…
Ghassan Zein
  • 4,089
  • 3
  • 19
  • 30
9
votes
1 answer

Why am I getting exceeds gas limit error when I specify the exact gas limit?

I am deploying a contract using truffle, and when I specify the gas limit as the gas I want to use for the transaction I always get the exceeds gas limit error. Why does this happen? edit What I am trying to do is deploy the crypto kitties…
yemista
  • 433
  • 5
  • 15
9
votes
4 answers

Solidity accessing private variable

currently, I'm practicing solidity. However, I'm a little confused about accessing a private variable in a contract. For example here; address private a; address private b; mapping (bytes32 => uint) public people; mapping (bytes32 => mapping(address…
riyoz
  • 431
  • 1
  • 6
  • 15
9
votes
2 answers

Can't send transaction even if I use an example from official Ethereum webpage

I write Crowdsale using this example. But I can't send a transaction, my test fails with an error: Contract: Crowdsale should accept payments after start: AssertionError: expected promise to be fulfilled but it was rejected with 'Error: VM…
rel1x
  • 2,351
  • 4
  • 34
  • 62
9
votes
2 answers

Best datatype to store hexidecimal and hex characters in the database

I'm using the Ethereum api. I want to store the information from the api into a mysql table. The address data looks…
Yada
  • 30,349
  • 24
  • 103
  • 144
9
votes
2 answers

Solidity return function why the constant?

I am just starting with solidity. I have a function like so: function get() constant returns (uint) { return storedData; } What is the use of the constant keyword here? I understand that after this keyboard we are defining the return type but…
Kex
  • 8,023
  • 9
  • 56
  • 129