Linked Questions

41
votes
3answers
34k views

How to call a contract method using the eth_call JSON-RPC API

Ok, so I'm trying to call a contract method using the methods provided by the Ethereum JSON RPC interface. The JSON RPC is running on an Ubuntu machine. Unfortunately, I can't really get a result back ...
26
votes
3answers
19k views

Returning a struct and reading via Web3

I am storing data in my contract using a mapping of structs. For examples sake, say I'm storing employee info (name/address/salary), mapped by their employee ID. Via a web front-end, I'd like to be ...
8
votes
2answers
3k views

Syntax for calling contract state changing methods

I've been struggling a bit with calling methods that change the state of the contract. Take, for example, the following contract: contract C { uint[] numbers; function initNumbers() { ...
5
votes
1answer
10k views

Getting 'invalid opcode' error

First of all, sorry for the code in Portuguese, this was a choice of the team and I had no saying on that. I'm writing a Billet Manager, the code is as follows: contract GerenciadorBoletos { ...
7
votes
1answer
5k views

How to compile .sol file from the command-line?

How do I compile a solidity file (e.g. 05_greeter.sol) from the command-line into bytecode? Without using IDE such as Mix.
6
votes
1answer
2k views

How can I deploy a contract with reference to a library contract without using a graphical user interface like Browser Solidity?

I am using Solidity Browser to deploy a contract due to from Library contract method failing #2831 issue. On this following answer https://ethereum.stackexchange.com/a/9181/4575 I have guided to use ...
6
votes
1answer
929 views

2 mapped structs with an address array - push not working

Can someone help me understand why the function add in the contract one is not working and in the contract two is? Both are mined and are inserted into the blockchain. Thanks. Not working contract ...
1
vote
2answers
2k views

How to deploy compiled contract file using the geth cli?

So I've followed the greeter contract tutorial from here to deploy a contract to my private cloud. It works fine and all, but it is rather difficult that I need to create a string from my contract and ...
3
votes
2answers
729 views

BigNumber error while trying to call structs

Consider the following contract: contract Test{ uint public id; address public addr; bytes32 public name; struct t { bytes32 name; uint id; address addr; ...
4
votes
1answer
548 views

Understanding TokenCreator/OwnedToken example from Solidity documentation

Here's the page containing the example https://solidity.readthedocs.io Here are two contracts that are supposed to work together(my questions are below): Here's how I think it works. Please correct ...
2
votes
1answer
163 views

Compiling and deploying Registrar.sol in private network

I created a contract using go-ethereum console, I want to deploy registrar in private network. I found out a way to compile and deploy in https://github.com/ethereum/dapp-bin/tree/master/registrar ...
3
votes
1answer
184 views

Smart Contract different behaviour on testnet vs Solidity Browser

The following smart contract behaves differently on Solidity Browser and testnet: pragma solidity 0.4.2; contract mortal { address owner; function mortal() { owner = msg.sender; } ...