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
0
votes
1answer
17 views

What are the ways to call a smart contract function during development?

What are the ways to call a smart contract function during development using Truffle simulated VM with a GUI interface (like Remix or EtherScan offer)? I know I could use CLI options like Truffle ...
1
vote
1answer
38 views

During gas-free transaction get an error “No relay responded! 4 attempted, 4 pinged”

I did all modification related to this instruction https://github.com/tabookey/tabookey-gasless However, when I'm trying to write some tests it fails and provides me the following error Error:...
0
votes
0answers
12 views

Dataset of simple contracts with getter setters

Are there any repositories/datasets which provide smart contract with simple logic like having some getters and setter functions. So, that I could give some values to getter and setter functions, ...
2
votes
2answers
97 views

Is Solidity creating an implicit getter for a nested contract that is created?

Is Solidity creating an implicit getter or not for a nested contract that is created? Example: contract Foo { .... } contract Bar { Foo public foo; Bar() { foo = new Foo(); } ...
1
vote
2answers
439 views

Issue with Ganche and Truffle with Metamask. Can't load token balance

I'm testing to create a token in Truffle; it compiles fine, but it won't load the balance of the token in to Metamask. I've set the connection correct: it does load the ETH balances of the Ganache ...
0
votes
1answer
38 views

Smart contract access from external source

I would like to build a simple smart contract, which can be accessed from "the outside World", meaning I can call methods of the contract from another small application or web site, instead of having ...
0
votes
2answers
120 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({'...
2
votes
1answer
45 views

bn256 and Boneh-Boyen digital signature in solidity

I am looking to have a full-fledged implementation of bn256 in solidity. And Boneh-Boyen digital signature. Is there is any available built-in libraries or implementation in solidity to bn256 and ...
0
votes
1answer
38 views

Calling contract functions using only ABI without source code

I have MyContract.json file of some contract(assume i haven't its source code). In .json file, there is abi and bytecode. If i want to deploy such contract (through web3js), I am facing following ...
4
votes
2answers
860 views

What is calldata?

What is calldata? I learned that there are three types of memories: Storage Memory Stack In the Ethereum docs, it says that the function parameters are of type memory by default. However, I've also ...
0
votes
1answer
44 views

mishandled exception: can't understand research paper content

What is the meaning of following paragraph in the context of ISZERO & mishandled exception. I found an article at: enter link description here It says that: Detecting a mishandled exception is ...
0
votes
1answer
60 views

In Quorum, Does contract resides on all the nodes or a majority subset of the nodes?

"A contract in the sense of Solidity is a collection of code (its functions) and data (its state) that resides at a specific address on the Ethereum blockchain." - Solidity Documentation In Quorum, ...
0
votes
1answer
184 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
1answer
88 views

Contracts are “instantiated” by the account creating transaction?

I read the following in a research paper: Short Paper: Formal Verification of Smart Contracts that: contracts are “instantiated” by the account creating transaction; this will allocate the ...
0
votes
1answer
45 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 ...
0
votes
1answer
147 views

Private Ethereum Smart Contract API call to notify (without needing the external api response to update the state) without using Oraclize

In a Private Ethereum Smart Contract, can we do an external API call just to notify (without needing the external api response to update the state) without using Oraclize? Understand Oraclize is ...
0
votes
1answer
24 views

How to call external payable contract function from app.js (DApp)?

The contract has a function: function purchaseTokens() external payable { require(msg.value>0); ...etceteras... } What I need is an app.js part, something that would look like this (lets ...
1
vote
1answer
67 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 ...
0
votes
1answer
65 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
16 views

How to know the execution time of transaction when miner execute it

When i send three consecutive transactions to my contract (deployed on ethereum testnet), how can i know the exact time (at milli/micro/nano level) which transaction executed (on miner side) first and ...
0
votes
1answer
61 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
26 views

State Variable of solidity Contract could not be updated through JavaScript

I have following contract and just want to update its state variable values i.e. totalSupply. But when I try to attempt this task through JavaScript code (given below) by calling its function i.e. ...
0
votes
0answers
219 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){ ...
2
votes
1answer
77 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
3answers
30 views

Could not assign contract state variable value to javascript variable

I want to retrieve and assign the value of my contract state variable to my javascript variable.I am doing as per guidlines provided on this community, but failed to assigned. my javascript code is ...
0
votes
1answer
23 views

Get Contract Address by It's ByteCode

I have some bytecode and would like to find the contract address that it belongs to. Is there an easy way to do this?
2
votes
1answer
168 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)...
1
vote
1answer
118 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
17 views

Two calls to a contract: input of the first can only be revealed after the second call

I see that there are no parallel execution in EVM. The problem I am trying to solve is the following: I have a contract which takes the input of two parties -- say users A and B. The result of 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 ...
0
votes
1answer
14 views

AttributeError while trying to call a contract using web3py and Infura

I am trying to call a function from an already-deployed contract on the Ropsten network: from web3 import Web3 infura_url = "https://ropsten.infura.io/v3/XXXXXXXXXXXXXX" w3 = Web3(Web3.HTTPProvider(...
1
vote
1answer
18 views

Call Smart Contract Function in Python Script

My situation is reverse to most. I am relatively experienced in coding in Solidity, but have absolutely no experience in using Python. What I would ideally like to do is have a script that will, in ...
0
votes
1answer
66 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 ...
1
vote
2answers
63 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
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 ...
2
votes
1answer
194 views

How to convert string to type defined by an abi.Type for payload construction?

I am writing a CLI in Go that should faciliate users to be able to make contract function calls from it. This entails generating contract ABIs and providing input parameters to the function arguments ...
2
votes
1answer
289 views

SOLVED How to retrieve Ether from old multisig wallet contract?

I have a 1.5 years old multisig wallet contract. I am able to import it to Ethereum Wallet (version 0.11.1) through Contracts -> Watch Contract menu and that way I can run some functions on it ("Add ...
71
votes
9answers
12k views

Can contracts pay the gas instead of the message sender?

Is it possible for a contract to pay the gas costs (or part of it) that result from the contract being called? Or does the sender of a message always pay the resulting gas costs no matter what?
1
vote
1answer
113 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 ...
0
votes
1answer
76 views

Linked contracts not running on go-ethereum

A very simple linked contracts example where A contract has a variable and B contract queries the A contract's variable is running ok on Ropsten+myetherwallet and Remix sandbox, but it fails when ...
0
votes
1answer
44 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 ...
1
vote
1answer
21 views

Creating a contract instance

Is it generally better to define a contract instance once, then pass it through your components like... class Parent extends React.Component{ constructor(props){ super(props); ...
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); ...
0
votes
1answer
208 views

Web3js :interact with smart contract

I'm currently struggling to interact with my smart contract, I don't if it comes from the way I call the function or the way I connect to my smart contract. Here is the code const contractAddress = '...
2
votes
0answers
15 views

Why is it required to know the function selector in a smart contract to call the function? [duplicate]

I understand what a function selector is and how it is computed: The first four bytes of the call data for a function call specifies the function to be called. It is the first (left, high-order ...
1
vote
2answers
30 views

How do i use .send() to fire methods of my smartcontract?

I have looked alot for information about this and lastly i turn myself to here. I've written a smartcontract and deployed it to Ropsten . I am then using web3.js to interact with my smartcontract, i ...
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
1answer
159 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 ...
4
votes
2answers
325 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
126 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( "...