Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [contract-invocation]

Questions regarding the act of calling or interacting with (a.k.a. invoking) a contract on the Ethereum blockchain by a user or another contract on the blockchain. Includes both local invocation by call and global invocation by transaction.

Filter by
Sorted by
Tagged with
6
votes
1answer
2k views

with Web3.js, display sendTransaction data field from function call

From js, I typically call a function with something like this: theFunction=someAbi.at(0x1234...); theFunction.someMethod(param1, param2, param3, {"from": 0x111222..., "to": 0x1234..., "value":...
3
votes
1answer
38 views

Calling a function doesn't take effect if I update two mappings

I'm testing a very simple example contract MyNewTest { Student[] students; mapping (string => uint) nametonumber; mapping (uint => string) numbertoname; uint counter; struct Student { ...
4
votes
1answer
72 views

How to have a private function in Serpent?

I've been reading this tutorial on contracts and implementing them in Serpent and on the bottom of page 13: Any time we reference a function within the contract, we must call it from self (a ...
2
votes
3answers
202 views

How are end-users meant to build trust towards smart contracts (and their originators)?

One of the benefits commonly associated with Ethereum is that it allows end-users to interact directly with smart contracts and thereby removing the need for trusted-third-parties. In cases where: ...
6
votes
2answers
2k views

How can I use “eth_sendTransaction” to invoke a contract and get logs?

I have deployed: contract test { function multiply(uint a) returns(uint d) { return a * 7; } } I can call the contract with "eth_call" : mpsp@ubuntu-slave2:~$ curl http:...
6
votes
1answer
669 views

Can you execute a contract twice in one block? [duplicate]

If you call a contract with two different tx from different account, can they be executed and mined in the same block? If yes how do you guarantee order and concurrency integrity like deadlocks?
2
votes
0answers
26 views

Recovering Contract Address varies every time [duplicate]

I have a contract datafactorycontract that calls another contract dataproducercontract. For that, in datafactorycontract I have a mapping that stores the address of the dataproducercontract being its ...
1
vote
1answer
94 views

I found a useful Ethereum script. How do I run it ELI5?

What's the least painful option to use the Stackexchange Bounty script described here? I'm dreaming of a chrome extension :)
1
vote
2answers
61 views

Getting TheDAO proposals by code

I'm using TheDAO Interface to get the proposals like in Etherscan (https://etherscan.io/token/TheDAO#proposals) but I don't get any. My code is like this: var theDAOInterfaceABI = [{ "constant": true,...
3
votes
3answers
1k views

Creating a contract with constructor in ethereumj

contract Calculator{ int result; function Calculator(int initialResult){ result=initialResult; } } If above is the contract source code I have created then how to call Calculator ...
1
vote
0answers
41 views

Can two state-changing transactions be in a single block? [duplicate]

I don't know how Ethereum verifies the atomicity of the state of a contract in the mining process. Say I have a greet-counting contract. If two people call the greet function in (almost) the same ...
1
vote
2answers
645 views

Smart Contracts and Insurances, how is an event determined?

I recently came across this article: https://dailyfintech.com/2016/01/14/what-does-the-future-hold-for-blockchain-and-insurance/ There they claim to have built an Flight Insurance Smart Contract ...
3
votes
1answer
2k views

NodeJS+web3 - Reading from a contract works, how about writing to a contract? [duplicate]

In Mist you can call functions of contracts in two ways: On the left panel, to call functions that read from a contract (the result is immediate). On the right panel, to call functions that write ...
7
votes
2answers
1k views

Is it possible to call another contract from a contract maintaining the msg.sender of the original caller?

Imagine that Alice calls a contract method C1 and that method calls another method in contract C2. Regularly msg.sender equals the Alice Account in the C1 method. And msg.sender equals the C1 ...
4
votes
1answer
180 views

Fallback function gets called when setting contract variables from external node

I’m a beginner in the Ethereum world and I’ve got some problems dealing with a SimpleStorage contract on my private testnet (http://solidity.readthedocs.io/en/latest/introduction-to-smart-contracts....
8
votes
1answer
356 views

Check if a contract implements specific ABI using JSON-RPC

In my Python web service, I'd like to confirm if a contract supports specific ABI (certain call methods). I am running get and communicating over JSON RPC. What are steps to for this? I am guessing ...
18
votes
2answers
4k views

Contract reading a string returned by another contract

I have 2 contracts, Parents and Child which has a public string variable - name. contract Child { string public name; function child (string _name){ name = _name; } } Parents ...
60
votes
2answers
20k views

Difference between CALL, CALLCODE and DELEGATECALL

CALL and CALLCODE take the same number of operands (in the execution stack). For the exception flag being pushed on top of the stack: 0 means exception, 1 means successful execution. CALL is easy to ...
5
votes
1answer
658 views

How can I execute code locally at given address?

What's the simplest way of executing piece of code at specific address of the main blockchain locally using the command-line interface? In here it's demonstrated how to play mp3 file based on the ...
7
votes
1answer
1k views

I created a wallet contract, sent ether to it and now cannot send to another account

While experimenting. I creating a wallet contract. Here is the address: https://etherscan.io/address/0xC23501aB1E8E5C5EDB0fFA83C5A4DcFb9c31a355 I sent some ether to it. Now I want to send the ether ...
41
votes
3answers
35k 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 ...
16
votes
6answers
12k views

Encoding/Decoding contract ABI data

How to encode and decode ABI data? Can someone show me an example with web3js library?
20
votes
3answers
4k views

Pass a function as a parameter in Solidity

Can you pass a function as a parameter in Solidity? My guess: There is the concept of address in Solidity, but they represent contracts. Contracts can have fallback functions, but I don't think you ...
4
votes
1answer
1k views

Can't deploy a contract that calls another contract

When I run the below code when connected to geth --dev --mine, the output is: A transmitted, waiting for mining... aAddress: 0xbaxxxxx4ae42d B transmitted, waiting for mining... bAddress: ...
23
votes
3answers
23k views

How to get return values when function with argument is called?

I am writing below a simple contract which stores all results of questionnaires for each ID. contract answer{ mapping(address => mapping(string => bool)) voters; struct qList { uint ...
4
votes
1answer
787 views

Is there any Ethereum online light-client/wallet that can accept smart contracts?

There are plenty of online wallets (e.g. Ethereumwallet, MyEtherWallet, Jaxx Bitcoin and Ethereum Wallet - Chrome extensions, etc.) but I did not find any wallet that has the ability to add a contract ...
3
votes
1answer
87 views

Same functionality, new contract for new usage?

When different people use the same contract functionality, do they send to the same contract address? Or do they create their own new copies of the contract at a different address? If they use the ...
4
votes
1answer
1k views

Specifying gas amount for contract call from JavaScript

I'm making this call from JavaScript to the contract function. contracts['CrowdFunder'].contract.contribute({value: web3.toWei(0.000000000000000005, 'ether')}); The function is called, but the error ...
6
votes
1answer
2k views

Passing ether with call to Solidity function

I have deployed a contract to testnet which appears to function. I have a function named contribute which gets the ether from the msg.value. The function is below and doesn't take any arguments. I ...
3
votes
2answers
168 views

What various components are needed to trigger an Ethereum contract?

From what I understand, you must provide Ether so there's an incentive for miners to run the contract, but what else is provided? Must you sign cryptographically (to make sure an unrelated party ...
2
votes
1answer
976 views

Understanding data payload on contract call [duplicate]

I'm running truffle's default example Metacoin: import "ConvertLib.sol"; contract MetaCoin { mapping (address => uint) balances; function MetaCoin() { balances[tx.origin] = 10000; } ...
18
votes
4answers
9k views

How does one contract send ether to another contract with more than 2300 gas?

I want one contract to collect a certain amount of finney before sending it to another contract, but I can't simply send in with C2.send(thisMuch). function() { Dividend m = Dividend(dividendAddr)...
16
votes
2answers
2k views

What happens when a smart contract gets several similar calls in the same block?

What happens when a smart contract gets several similar calls in the same block? Consider for instance this greeter: contract greeter { string name; function setName(string name_) { ...
15
votes
3answers
18k views

Call function on another contract

I've created a contract called "Name" which I've deployed to the testnet. this function just register some text for the user and display it back. My contract is: contract Name is mortal{ ...
6
votes
1answer
2k views

Call contract from another account using web3.js

I have a contract with which 2 accounts should interact. The accounts are in the same node in web3.eth.accounts. The contract was created by accounts[0]. How can I call that contract from accounts[...
5
votes
1answer
246 views

What happens if you chained delegatecalls?

Solidity docs say "only the code of the given address is used, all other aspects (storage, balance, ...) are taken from the current contract." This is useful when creating a library. But what happens ...
5
votes
1answer
415 views

Proper ethereum exchange workflow

I've recently found out, that there's no convenient way to monitor transactions to 'externally owned account' generated by some contract. I went to various forums and ethereum bugtrackers for an ...
3
votes
1answer
759 views

How to read responses from calls to contract methods made using web3.js?

I have built a contract which provides a simple method for storing some data in a property of my contract on the blockchain. I can interface with my contract using web3.js and I have no issue doing ...
10
votes
2answers
3k views

Is it possible to call Ethereum API from a Software Application without running an ETH node?

I was wondering if it's possible to make a call to Ethereum blockchain from a software application on my computer without having to run an ethereum node ? for example, I want to make calls from a ...
1
vote
1answer
100 views

Contract functions not triggered

My contract deployed on address 0x63788a3eace0d77c5573787e3f9c9515c246d0e6 Is not getting executed via Mist browser. I have tried execute NewPoll function that requires 4 fields text 32 bytes I ...
6
votes
3answers
3k views

Why does mist throw 'Uncaught invalid address'?

I'm trying to make a web page that gets a message from a simple "hello world" smart contract. Unfortunately, it isn't working. I'm seeing this in the Mist console. Uncaught invalid address v ...
3
votes
1answer
514 views

Does a contract message call require a signature from the sender?

Say for example you have this simple contract: contract Example { function sayHello() constant returns (string msg) { return "hello"; } And I make a message call: exampleContract.sayHello....
8
votes
1answer
4k views

Basic example of interaction between 2 contracts?

What is a basic example of one contract invoking a method in another (non-calling) contract? Would the address of the contract having that method always need to be hardcoded?
3
votes
1answer
231 views

How problematic is transitioning Augur's full-Serpent smart contract suite?

I read here that Augur's smart contract suite is actually written in Serpent. I'm aware that it is a relatively well supported language at the moment (at least compared to Mutan and LLL), but given ...
5
votes
1answer
1k views

Can smart contracts execute themselves? [duplicate]

Is it possible for a smart contract to autonomously execute (with no external interaction) when a certain condition is met? Say, when a certain time arrives. My thought is that smart contracts are ...
21
votes
2answers
6k views

Do I need a compiled contract just to get the ABI definition?

Why do I need a compiled version of the contract just to get the ABI definition? Seems like the contract address should be enough. Im very confused because I am simply trying to run a contract ...
17
votes
1answer
1k views

What is the order and concurrency behavior of multiple calls to a contract in a single transaction?

Suppose a contract has three call APIs that have side effects. What's the behavior if I try to: Call all three APIs from one address (i.e. issue three transactions if from nodejs). Are all three ...
4
votes
1answer
261 views

How does a client interact with a contract already in the blockchain?

I am looking for someone to help clarify the 'stacktrace' of interactions that occur when a client interacts with a smart contract. Clearly, one has to submit a transaction to a miner, who then has ...
2
votes
2answers
3k views

How can i sent ETH from a contract wallet to another account?

Use the mist wallet 0.3.9. The ETH from a pool is sent to a wallet address. How can I send the ETH from wallet to account? When I try to send from the wallet address to an exchange address, I saw ...
4
votes
1answer
2k views

Where exactly do DApps run? Who gets rewarded for running them? [duplicate]

So I am currently running a full node, as well as a GPU miner. I am curious first of all where do DApps get run? They wouldn't make sense to run on a GPU as they aren't very parallizable, so I am ...