We’re rewarding the question askers & reputations are being recalculated! Read more.

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
0
votes
2answers
615 views

How to preserve msg.sender==B when user A calls contract B which calls contract C which calls contract library D?

I have user A which calls contract B which calls contract C which calls contract D. How to call external library D from contract C while preserving msg.sender==B ? Of course, I cannot use tx.origin ...
0
votes
1answer
295 views

Basics and Workflow on Smart Contracts creation and execution

I'm confused about how the Smart Contracts work internally. I've read this: https://blog.zeppelin.solutions/the-hitchhikers-guide-to-smart-contracts-in-ethereum-848f08001f05 TLTR: there is an ...
3
votes
2answers
337 views

Solidity CALL and DELEGATECALL: messages and data format

I have some questions about Solidity CALL and DELEGATECALL. I have already read some related threads (link), but found no answers to my doubts. 1) Is there any difference in performing a CALL to a ...
0
votes
1answer
64 views

Referencing another another contract returns an empty value

I've created a consortium based network where I have two contracts deployed. pragma solidity ^0.4.4; contract ScoreStore{ mapping(string => int) PersonScores; function AddPersonScore(...
1
vote
2answers
126 views

How to use a date time from an API to prevent contract interactions if the date is a string?

I want an to use an oracle to prevent contract interaction after certain time cutoffs This is the APIs format: "event":"event2","timezone":"UTC+1","datetime":"2018-06-07 01:00:00" I think doing all ...
0
votes
1answer
111 views

Incorporating AI/Machine Learning (e.g., Recurrent Neural Networks) into EVM/Solidity via Oracles

I am exploring the viability and avenues to incorporate AI/ML with EVM and/or Smart Contracts via solidity or oracles. For example, I wish to leverage Recurrent Neural Networks, which demonstrates ...
0
votes
2answers
57 views

Comparing values of fetched data with input data of different contracts

Given two contracts as follows, contract TestData calls contract Reg to fetch data that had already been stored in its map using get_attributes function. pragma solidity ^0.4.21; contract Reg { ...
0
votes
2answers
28 views

Fetching data from another contract

I have the two following contracts: tryContract and testData. The testData contract aims at fetching data from the tryContract contract utilizing its get_attributes function. Before doing any fetching,...
0
votes
0answers
33 views

How do i get to return value form one smart contract function into another smart contract on private ethereum network?

Here it is my called function. pragma solidity ^0.4.19; contract Called{ string public name; function set(string _var) { name = _var; } function get() view returns (...
1
vote
1answer
119 views

Will the introduction of sharding have an effect on the functionality of currently deployed smart contracts or the EVM?

Is there any risk the the hard fork required for sharding or Plasma to take effect on the Ethereum network will cause compatibility issues for contracts already deployed? Will the protocol in place ...
1
vote
1answer
70 views

What happens when transaction is sent from smart contract?

If during smart contract execution it decides to send a transaction, then transaction would be created, validated and broadcasted to the network from all the nodes executing this smart contract. ...
0
votes
3answers
490 views

how to withdraw ether from smart contract?

I am writing a smart contract which receives Ether. How can I transfer Ether from the contract to my personal purse Can I send Ether from the contract like as I can do with regular wallet? I would ...
1
vote
1answer
292 views

Parsing msg.data to extract JSON

I get msg.data as JSON. How can I parse it in my contract to create variables in my contract with given values?
0
votes
1answer
34 views

How can I call a function in a smart contract that is inherited from another

Hi I am trying to call the function transfer , however in remix it says that I can only call the transferOwnership method, here is my solidity contract pragma solidity ^0.4.18; contract Ownable { ...
0
votes
0answers
218 views

Trying to call a method in a contract, invalid address error/Type Error

Hi I have a deployed contract pragma solidity ^0.4.0; contract adderr { int total; function adder() public { total = 0; } function getTotal() constant returns (int){ ...
0
votes
1answer
38 views

How do smart contracts launching new tokens get executed permanently?

As far as I know, in order to create a contract, a contract account is created which contains the code. When this account is triggered by a transaction or message call, the EVM executes this code. ...
1
vote
0answers
333 views

How to call a transfer function from an already deployed contract ERC20? [closed]

I use remix and I want only to send 10 tokens to someone if a condition is fulfilled. For that I use transfer function from an already deployed contract ERC20 (deployed on the Ropsten Testnet and the ...
0
votes
1answer
236 views

Not getting any results from Web3j querying of ERC20 token's balanceOf() function

I am trying to use Web3j to query the balanceOf() function of a standard ERC20 token as shown in the code below: try { String encodedFunction = FunctionEncoder.encode(function); ...
4
votes
1answer
2k views

How to load contract from address- remix?

Hi I just found that remix added "Load contract from address" option. So I tried to load contract from address "0x67601d7a7cbbD77368785122c508503f168B1dAa" . You can see this contract is in function ...
1
vote
2answers
732 views

Does view functions cost gas? And how to send transaction in a proper way?

I have a method defined as: getNames() view public , if i call on it contractInstance.getNames.estimatedGas() it returns me a non-zero value, why? I mean, view methods should not consume any gas! On ...
0
votes
1answer
32 views

Is it safe to assume that a smart contract can hold Ether for years if the withdrawal is not triggered?

Given that ethereum continues to run for few years, is it safe to assume that the smart contract will hold the ether that was deposited into it for years until its triggered to transfer/withdraw the ...
0
votes
1answer
157 views

How to track incoming to smart contract transactions using web3js?

I've got one Ethereum smart contract which calls functions of the other one. How could I track these calls using web3js or some other tool if it is possible at all? I need it because I want to execute ...
0
votes
2answers
24 views

Verifying a smart contract or not

If I choose not to verify a smart contract, the source code will be not visible, but would other people be able to see the content anyway? I am asking this because I want to call an API and that would ...
1
vote
1answer
222 views

Calling external contract leads to infinite gas need

I'm trying to implement this pattern: contract Producer { uint8 public SOME_VALUE=12; } contract Consumer { Producter currentProducer; function setProducer(address addr) { currentProducer = ...
1
vote
2answers
97 views

Smart Contracts - Where is contract in it?

I am new to Smart Contracts. When I saw some example of Smart Contracts, I realize that they are just some piece of code, not exactly contracts. For example function sendCoin(address receiver, uint ...
1
vote
0answers
23 views

Invoking functions of smart contract on Android phone?

Regarding to my contract code bellow, do you think that it's possible to do following scenario using a web browser on Android mobile ? Uploading GUI web application of RFID/NFC smart contract (i.e. ...
0
votes
1answer
378 views

How to use geth.aar on Android mobile?

I downloaded go-ethereum .aar file from here : https://geth.ethereum.org/downloads/ For my Android phone for invoking functions of my smart contract. But I don't know how to use this file?
2
votes
3answers
1k views

How to query Ethereum contract to get data from it?

How to query Ethereum contract to get data from it?
2
votes
1answer
266 views

Assign metadata to a transaction

How can I append some (extra) data to a transaction that calls a contract method (with given parameters)? The transaction has only one 'data' field which is used to serialize the method call. If I ...
0
votes
1answer
163 views

Why I do not get returned value of function of my smart contract using testRPC and a Graphical User Interface?

I have a smart contract that is tested with remix and it works well. Its code is as follows : contract Weechain: pragma solidity ^0.4.15; // --------------------------------------------------------...
1
vote
0answers
168 views

(browserify) Error : Cannot find module 'web3/lib/solidity/coder.js'

When I use command browserify viz.js -o main.js to build this project, I receive following error message : C:\Users\KX5710\Downloads\GUI_solarchain\solarchain-dashboard-master>browserify viz.js -o ...
4
votes
2answers
331 views

Calling a contract method on a specific block number using Go

Using the go-ethereum library, I'm able to call contract methods using the generated Go bindings: balance, err := wallet.Balance(&bind.CallOpts{ Pending: false, From: sender, ...
0
votes
0answers
89 views

Problem of interacting with Smart Contract via HTML and JavaScript application

I followed and tested "Creating a Web UI for our Smart Contract" tutorial and it works well. However, when I do exactly what I did in the above tutorial for THIS SMART CONTRACT, I do not see the ...
1
vote
1answer
65 views

Is it legal to include arbitrary bytes at the end of the DATA section executing a contract method?

Feel free to refer directly to the yellow paper or other similar baseline documents - I've been reading those documents looking for an answer to my question. I wish there were a "language-lawyer" tag ...
5
votes
2answers
6k views

TypeError: web3.eth.Contract is not a constructor (What is the reason ?)

I always use following command to create a contract instance without any problem : var contractInstance = new web3.eth.Contract(abi, '0xe1623AAf57fCbe260F022404C730ae32aebe39F6'); However, when ...
0
votes
1answer
296 views

Why myContract.events.MyEvent([options][, callback]) does not return “data” and “logs”?

We have an event as follows : event LogNewObject(address sender, bytes32 indexed id, bytes32 sub_states_types, bytes32 sub_states_values, address owner); This event is called in following function : ...
0
votes
1answer
48 views

A common error at time of using web3 options

When i use some web3 options as follows, I receive a common error i.e. TypeError: web3.[option] is not a function For example : TypeError: web3.toAscii is not a function web3.toAscii(...
1
vote
3answers
228 views

How to get “event logs” similar to “remix”?

I have an event as follows : event LogNewObject(address sender, bytes32 indexed id, bytes32 sub_states_types, bytes32 sub_states_values, address owner); And this event is used in following function :...
1
vote
1answer
486 views

When do we receive : “Error encountered during contract execution [Bad instruction] ”?

I have received same message as this question : Warning! Error encountered during contract execution [Bad instruction] However, my contract concept is different. Here is my contract code : pragma ...
0
votes
1answer
343 views

Problem with invoking a function with byte32 parameter : “Given parameter is not bytes”?

We have a function as follows: function newObject(bytes32 _id, uint256 number_of_sub_states, bytes32[10] sub_states_types, bytes32[10] sub_states_values, address _owner) public returns(bool success) {...
0
votes
1answer
1k views

call contract function signed on client side web3.js 1.0 [duplicate]

I don't think the web3.js 1.0 docs cover this. I found this post. but the answer seems outdated. How to properly create a raw transaction and sign it using web3 in browser I'd like to use web3.js 1....
0
votes
1answer
155 views

Freeze account for a limited time after transaction

Is it possible ina contract to freeze an account for a specific period of time, 1 month in example, after a transaction, let say the user sends 1 ETH to my contract and he can't do another transaction ...
1
vote
0answers
251 views

How to get transaction hash at time of invoking function?

I have a function as follows: function setEnergy(address dev, uint256 energy) public returns (bool) { require(dev != address(0)); amount[dev].energyValue = amount[dev].energyValue + energy; ...
0
votes
2answers
508 views

How to read values of Struct in Solidity contract?

I have developed the following smart contract and try to test it via the truffle js console: pragma solidity ^0.4.2; contract AddressRatings { struct Rating { mapping ( address => uint8 ) ...
0
votes
0answers
121 views

Problem with invoking a function

I have a function as follows i.e. transfer. function transfer(address _to, uint256 ENvalue, uint256 PWvalue) public returns (bool) { require(_to != address(0)); balances[_to].bEN = balances[_to]....
0
votes
2answers
119 views

When should we call( ), watch( ) or get ( ) an event?

I find this concept to be very confusing, when should I be using watch, call or get to listen to an event? how are they different and when should they be used? var event1 = newInst.getSupplier({'...
0
votes
1answer
35 views

Getting a list of Variables in a smart contract via just the contract address

Is it possible to get a list of all variables that a smart contract needs to be sent just by knowing the contract's address? What i want to do: make a call to the chain and get the required ...
3
votes
1answer
222 views

Calling multiple smart contracts — how deep can it go?

How many nested calls can an Ethereum transaction do? Can Smart Contract A call Smart Contract B, then Smart Contract C and so on with only one call through Smart Contract A, and is there a limit to ...
0
votes
1answer
320 views

How to interact with a smart contract which is deployed in a quorum network (Alastria)?

I have already deployed the contract using tuffle in my private network. Now, I would like to know what i have to do to interact with the contract. I don't need ethers in my wallet and actually i don'...
0
votes
1answer
1k views

Web3.py - how to use abi in python when solc doesn't work

I have a smart contract that I deployed to the Ropsten test network with truffle (using Javascript). I want to be able to send transactions to it from my server, which is written in Python. I've ...