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
1answer
14 views

What is the cost of inter-contract calls?

I have a contract with methods to create items and add them to categories. I want to create a wrapper contract that would combine several calls into one: create an item and add it to several ...
0
votes
1answer
55 views

what information is provided to the miner with the transaction

I am wondering what information is provided to the miner with a transaction that needs to invoke a contract? I thought about Gas, GasPrice, name of function to invoke and input. But, whether the ...
2
votes
1answer
195 views

Contract working on Javascript VM and not Web3 Provider, why?

Here is the code: Calling contract: pragma solidity ^0.4.24; contract Caller { address public called_address; constructor() public payable { } function set_address(address _addy)...
0
votes
1answer
5 views

When a contract calls other contracts, is it an atomic operation?

If a contract calls several external methods of other contract(s), is it as a whole one atomic transaction (reverted as a whole if an exception happens)?
2
votes
1answer
110 views

Call a view function of an Ethereum Smart Contract using a program written in C

my attempt is to call a view function to reatrieve some data from a contract on the Blockchain using a C program. I do have the interface of the contract. I think i need to performe two things in ...
0
votes
1answer
70 views

Calling overloaded function from geth client

Attaching a geth client to a ganache-cli instance: $ geth attach http://localhost:8550 Welcome to the Geth JavaScript console! instance: EthereumJS TestRPC/v2.0.2/ethereum-js coinbase: ...
0
votes
1answer
69 views

How to showcase stats of live crowdfun in a website?

I am not completely sure where to find the answer to this. I went over the etherscan.io documentation and I was still confused. I am not sure if I simply create an API related to my account and then ...
0
votes
1answer
360 views

Load smart contracts in Java application without having the java wrapper class for Web3j (only the address of the contract)

I use web3j to interact with my local Ethereum node (created with geth), and I was wondering how should I handle smart contracts created at runtime. I know that in order to deploy a smart contract ...
0
votes
2answers
27 views

solidity, how to wait n second function or others solution

I am working on a project for p2p energy trading using blockchain. I am building an experiment on my own to demonstrate the concept for my master thesis. For this project I have two python scripts, ...
65
votes
3answers
22k 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 ...
1
vote
1answer
147 views

Byte32 error, even after converting string to hex

I looked everywhere for people with similar problems, but I couldn't find anything. I am confused why I keep getting this error (yes, I know others have had this error too, but not for the same ...
1
vote
1answer
74 views

Which one of methods should I choose for deployment of smart contract geth or a wallet if I have to build API for smart contracts in nodejs?

I'm having trouble to understand which method would be better for deployment geth or a wallet if I'm building API in nodejs using web3. Where exactly is the contract stored?? Is the contract ...
1
vote
1answer
172 views

Unable to read contract instance variable from deployed contract with truffle test

I am attempting to write some unit tests as I'm working on the development of some smart contracts, but I've run into an issue that's preventing me from continuing. I'm attempting to check the address ...
0
votes
0answers
22 views

How to know when a transaction is finished? (web3.js)

I make a contract method call using .send() method: contractInstance.methods.pay(itemId).send({from: defaultAccount, value: web3.utils.toWei(String(price*1.0000001)), gas: '1000000'}, ...
1
vote
2answers
93 views

Automatically test who can withdraw Ether from a smart contract

Is there any way I can automatically test who can withdraw ether from a smart contract? I need to perform this test automatically. So I cannot manually inspect the instructions. Can I design a smart ...
0
votes
1answer
19 views

In MetaMask (web3.js 0.20.x) how to get events happened during a transaction?

In MetaMask (web3.js 0.20.7) I send a contract method with .sendTransaction(). Now I need to check the values of arguments of UpdateItem event created by this contract during the call of this method. ...
1
vote
1answer
29 views

Is it possible to have a contract run whenever a wallet address receives a transaction?

I'd like to build some code that monitors a wallet address, and performs an action whenever that wallet receives a transaction. I could do this with say javascript or whatever, but that doesn't offer ...
0
votes
1answer
34 views

invalid tuple value (coderType=“tuple”, value=1) error while calling a contract function

My contract code is as follows: pragma solidity >= 0.5.0 < 0.7.0; contract StoreData { address public owner; constructor () public { owner = msg.sender; } ...
1
vote
2answers
127 views

Why do I need to have exact same code to load contract from address in Remix IDE?

I tried to interact with the deployed contract and i don't have its code. so i found out the contract address and tried to load contract from address in Remix IDE! isn't this possible? WHY?
0
votes
1answer
22 views

Display top referrer number

I am developing an ETH game with a referral structure. Each account that exists in the game has a "Referral Count" associated with it that updates as people sign up using their referral link....
0
votes
1answer
146 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
33 views

Running contract code in javascript without deploying on chain

I am building a state channel battleship game. I have a stateless contract which contains all my gameplay logic and another statechannels contract which contains all the dispute logic. Ideally, I ...
3
votes
1answer
31 views

Web3js shows Contract Address as null after deployment

I am using web3.js to deploy a contract. I am also using Ganache to mock the network and visualise the accounts. When the code below executes, the contract gets created, and Ganache shows a successful ...
6
votes
5answers
12k views

How to get value of a contract public property using web3.eth

using web3 javascript library how do you get the current value of a public property. e.g. contract MyContract { address public owner; ... } Here's a snippet of the abi: [{ "constant": ...
1
vote
1answer
150 views

How to simulate multiple consecutive transactions and get the resulting state?

I'm trying to simulate a transaction on the public blockchain that invokes a contract's method with certain parameters. Then I want to make a follow-up transaction with some other method call. I ...
6
votes
3answers
2k views
0
votes
1answer
21 views

My contract is deployed but instance is undefined

I have deployed a contract on the ganache blockchain successfully using truffle. In the truffle console, I can call the contract fine truffle(development)> MyCoin [Function: TruffleContract] { ...
1
vote
1answer
64 views

One contract accessing data from another fails

I am trying to get two contracts to interact: pragma solidity ^0.5.10; contract C2 { address public addr; constructor(address per) public { addr = per; } function ...
0
votes
1answer
167 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 ...
0
votes
1answer
285 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
2answers
436 views

Capturing an event fired from a contract that was called from another contract

I'm trying calculate tax on arbitrary items/values. To do this I have a single contract is used as an 'Oracle' to get the tax from an external system. This contract defines functions to be called from ...
0
votes
1answer
281 views

How to call get method of one contract from another?

I want to call a method of a contract from another contract. I've already read this post: calling one contract to another contract method, but it doesn't work for me. When I create the caller and try ...
1
vote
1answer
782 views

How to send data to smart contract?

I have the variable w1_temp, which i need to send to contract I have the following code: var W1Temp = require('w1temp') var Web3 = require('web3') var web3 = new Web3() web3.setProvider(new web3....
0
votes
1answer
29 views

How can I make an off-chain call to get the data stored at a specific storage slot on-chain? [duplicate]

I want to get data from on-chain that is not explicitly available through a getter. For example, if I know that there is data at position ...
1
vote
2answers
157 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
2answers
171 views

Contract function returns address?

Learning ethereum, I am hoping this is an easy one. I wrote a simple test contract contract Mini{ uint balance; // constructor // runs once upon creation function Mini(){ balance = 1000; } ...
0
votes
0answers
17 views

Why is Smart Contract call() method returning NULL in Ethereum Private Blockchain

This is where I am calling the contract function certify_find (hash, callback) { contract.methods.findDocHash(hash).call( function (error, result) { if (error) { console.log("Returned ERROR ...
0
votes
1answer
330 views

Filters object not working for web3.eth.contract getPastEvents() method

I have referred, Web3 Events, but filters object is not working for me, I've got the same result for events before and after applying filter object. Here's the code: instance.getPastEvents( "...
0
votes
1answer
75 views

Geth + Web3 | web3.eth.getAccounts() returns undefined

I have follow this SO answer for sending ERC20 tokens from 1 address to another. I am running into an issue where I am receiving an error that my from address is invalid Error: Error: ...
0
votes
1answer
204 views

web3 contract call does nothing

I'm trying to call a function contract from web3. The web3 provider is metamask and the metamask popup opens up when it should however when I click confirm I just see a loader and nothing happens. ...
0
votes
1answer
179 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; // --------------------------------------------------------...
0
votes
1answer
201 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
212 views

VM Exception while processing transaction: revert when I send ETH to my contract address

recently I met a very strange problem, when I deployed a ERC20 ICO contract to Repsten network through truffle and MetaMask.Then I send some ETHs to my ERC20 contract address, I expected is that when ...
1
vote
1answer
149 views

Multisig deployment created ETC standard wallet - how to access?

I made a multisig wallet on the ETH chain in December or so last year. It has an ETC parallel to it which I cannot access. As you know multisig wallets don't have private keys. And I can't use the ...
1
vote
2answers
213 views

state variable value not changing

I have very simple solidity code as below - pragma solidity ^0.5.6; contract SaveData { uint public salary; function setSalary(uint input) public { salary=input; } function ...
1
vote
1answer
73 views

ENS on Rinkeby - Network does not support ENS?

I was able to register the ENS domain on Rinkeby, as the network supports ENS. My TX: https://rinkeby.etherscan.io/tx/0xd42b64ab03387d7ca405e7ba7b85ce893444a141e7a7de174f0361e2c4231674 My subdomain: ...
1
vote
1answer
34 views

How do I find the ABI/JSON Interface for an ETH/ERC20 contract?

I sent TUSD to my Bittrex holdings to trade for other coins, but it never went into my account with Bittrex. They claim that I sent it to the wrong address. I am trying to recover these tokens so that ...
0
votes
1answer
362 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 : ...
4
votes
3answers
1k views

Method ID for a Solidity generated getter function

In solidity, the bytecode for functions is taking the web3.sha3 value of a function name and taking the first 4 bytes of the resulting hash in the format of 0x00000000 So if you have a function ...
2
votes
2answers
1k views

web3py: How to interact with deployed contract abi

I'm trying to interact with a smart contract I deployed with truffle using web3py I can't figure out how to load the abi string into the web3py eth.contract function contract = w3.eth.contract(...

1
2 3 4 5
17