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
40 views

Can you input a variable into a contract call?

In ETH could you call a contract by inputting a variable parameter? As in the value of that parameter is unknown at call and must be evaluated at run-time? Something like "someFunction( ...
2
votes
2answers
301 views

How do I call a function into a contract with solidity and want to continue execution even if this call reverts?

I have looked into the Solidity docs but cannot seem to find this feature. I want to call into a contract and want to push two values onto the stack: the actual return value AND if the execution ...
3
votes
2answers
673 views

Ethereum Smart Contract execution principle

I have a question that might sound really dumb, but its understanding is crucial for me. Say, I have a Smart Contract, which has a public variable, and a setter to change that variable. If a Smart ...
0
votes
1answer
684 views

Calling a “view” function using web3js

--- HEAVILY EDITED --- Solidity contract: pragma solidity ^0.4.24; contract PatientRecords { struct Patient { string ID; string weight; string height; string diseasehistory; ...
0
votes
2answers
30 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 ...
1
vote
1answer
29 views

Doubt in javascript function execution

hi guys I have this contract function: function teste(uint _oX) public returns (uint value) { return 34; } And I try to call in JS this way : MyContract.teste(1).then(value => console.log(...
0
votes
1answer
91 views

getting result of a method of smart contract that don't change any state variables

I know in ethereum if a method of smart contract don't change state variables we can see it's result without making any transaction. now I want to know how can see result of this method ...
1
vote
1answer
106 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
195 views

Adding quotation marks to string before calling a function [closed]

Alright, so I'm not sure if I should be asking this here or HTML/JavaScript forums, so please do let me know if I am in the wrong place. I believe it belongs here as you all understand dApps and ...
1
vote
1answer
214 views

Ether transfer from Account to Account with smart contract doesn't work

I've been struggling for a whole day trying to figure out what's wrong with my smart contract but I couldn't sort it out. Any help is appreciated, I'm sure I'm missing something :( Here is my ...
0
votes
2answers
349 views

Calling Truffle Commands through a script

I made following contract using visual studio code pragma solidity ^0.4.17; contract IDSCheck { mapping( string => string ) PersonHash; function AddHash(string name, string hash) { ...
1
vote
2answers
146 views

ethereum smart contract security check [closed]

How to prevent smart contract from the vulnerabilities? what are all the security measurements we need to consider before publishing our smart contract? Regards Mani
1
vote
0answers
69 views

encodeABI() throws Uncaught (in promise) Error

I am trying to use encodeABI() on one of my contract methods like this: signTx = async () => { ... const response = await contract.methods.recoverAddr(fixed_msg_sha, v_decimal, r, s)....
2
votes
1answer
183 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
0answers
115 views

How to access data from web3.eth.Contracts.send() function?

If I run this chunk of code from my async function I will get a transaction receipt as an output: const response = await contract.methods.recoverAddr(hex_msg, v_decimal,r, s).send({from: accounts[0]}...
1
vote
0answers
60 views

Possibly hacked but not sure Help!

I recently had most ERC20 tokens moved from a MEW wallet through the individual ERC20 contracts. Does anyone know how this may have happened? I am sending pertinent info from one on etherscan.io 1)...
2
votes
1answer
688 views

Using Python to invoke smart contract [duplicate]

I'm currently writing a thesis on a simulation of a peer to peer electricity market. The payments between the agents of the simulation would be settled through an Eth smart contract. I would like to ...
2
votes
1answer
370 views

Get return data from delegatecall

I'm using a low level delegatecall to forward my calls to a library. I need to (in this order) : load bytes4 sig into _message from memory load bounty (STRUCT) into _message from storage load bytes ...
2
votes
1answer
99 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 ...
1
vote
1answer
143 views

Pure function execution flow

We're working with the project in which we're storing some confidential details (different for each user)in smart contract, we don't want to show this information to anyone else even miner, thus we ...
1
vote
1answer
188 views

do smart contracts execute sequentially in each node or in parallel/simulteneously? across all nodes?

do smart contracts execute sequentially in each node or in parallel/simulteneously? across all nodes? 2nd question is - Does it execute on "ALL" nodes including Light nodes as well?
0
votes
1answer
726 views

How to estimate gas cost for contract method using geth

I want to estimate a contract method gas cost using geth. I understand there is no direct way using geth as in the web3 libs. But I don't understand what is the second argument needed and how I can ...
1
vote
1answer
339 views

Solidity: using low level call function on an EOA

Say I have a contract with a method that does a low level call on an address _addr assuming the target address is a contract with a certain method isValid(): contract Dummy { function doCall(...
0
votes
2answers
68 views

Can code send ETH to user accounts?

I was watching a talk by Vitalik in DEVCON1 in which he says code can do three things one of them being code can send ETH to other contracts. But can it send ETH to users account as well? Attached is ...
0
votes
1answer
114 views

smart contract in private Ethereum network

Let's say we have a private Ethereum network. One node has created a smart contract and pushed it to the network, while some validating node validates it and then every node puts it in the blockchain. ...
0
votes
1answer
73 views

How do Token transfers, the associated token contract transactions and ERC20 token txns fit together?

Looking at Quantstamp token as an example it contains a list of transfers: Similarly the associated contract also has "Transactions" and "Erc20 Token Txns", however they all seem to be different. ...
0
votes
2answers
61 views

ETC Stuck in ETH standard wallet contract

I used to use the standard wallet contract in Mist to store ETH and as a result have some ETC still stored in the wallet contract address according to the ETC block explorer. I am trying to figure out ...
1
vote
2answers
154 views

Difference between creating contract with and without using new

Hi can anyone tell me the differnece between creating contract using a new operator and creating contract by passing the address. Example: contract A{ uint256 public num = 10; function get() ...
2
votes
1answer
926 views

How to read data from smart contract using web3.js?

I want to build something similar to the Read Contract tab feature of etherscan which reads a contract and return all the public props like: - name, totalSupply, decimals, etc. However I have not ...
0
votes
0answers
275 views

Transaction pending on Ropsten

I deployed a contract on JavaScript VM using remix online IDE. Here is the contract: pragma solidity ^0.4.17; contract FileDetail { struct File{ string fileName; string fileHash; } File[...
2
votes
1answer
319 views

Optional Multi-Parameter Call to External Contract

I would like to half implement ERC223 for business reasons. This means being able to notify other contracts when they receive tokens, but not revert if the recipient is a contract that doesn't ...
1
vote
1answer
169 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
418 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 ...
1
vote
2answers
60 views

Contract A has a function that depends on Contract B's state. How does concurrency work for these two contracts?

I was thinking about a scenario where one contract depends on another contract's state. For example, contract a may want to decide on its next state update based on the current state of contract b by ...
2
votes
1answer
299 views

How to call contract state-changing method on Ropsten via Infura using web3@1.0.0?

I have the following contract: pragma solidity ^0.4.24; contract Escrow { address public owner; event LogReceivedFunds(address sender, uint amount); event LogReturnedFunds(address ...
2
votes
1answer
184 views

How can I withdraw funds from an escrow contract in web3@1.0.0?

I deposited ETH into a simple contract, and I want to get it back. I have this function: function refundBalance() public onlyOwner { uint256 balance = address(this).balance; msg.sender....
0
votes
1answer
99 views

from token transaction detail, how can I know if token is actually transferred?

I am implementing support of multiple tokens in my application. I want to listen new token received transactions. I got that I need to decode the input data in any transaction to get the toAddress ...
0
votes
1answer
37 views

How do I access the properties of a contract xyz from an enclosing contract abc?

With respect to the following code: pragma solidity ^0.4.23; contract xyz { uint x = 0; function setX(uint pX) public { x = pX; } function getX() public view returns(uint){ ...
0
votes
1answer
115 views

Identify whether the recepient of transaction is an external account or a smart contract [duplicate]

I know that an Ethereum transaction addressed to '0x000..000' is creating a new contract. Now, given a transaction address to non-zero address, I want to identify whether it is a transaction to an ...
1
vote
1answer
90 views

Where the contract code located physically and how it can be accessed?

After deployed where the contract code physically is located at? Storage or ROM of each node? And how it can be accessed for execution? By contract address? Then, Does contract address act like a ...
0
votes
1answer
836 views

How to call a deployed contract function

I deployed the smart contract into a test network. so if a new user is added to the test network and he wants to use my smart contract functions. How to call those functions by the new user in the ...
1
vote
0answers
318 views

Error: VM Exception while processing transaction: revert when contract function calling contract function

I am getting the Error: VM Exception while processing transaction: revert when one of my contracts is calling another contract to make a transaction but not if I directly make a call to a contract for ...
0
votes
0answers
88 views

My smart smart contract won't send to multiple addresses

I have experienced some difficulties in getting deployed multisend/airdrop smart contract to distribute tokens to multiple addresses by interacting with the main contract. Each time it failed. Kindly ...
0
votes
0answers
40 views

Can the result of a call trigger the execution of a transaction?

Supposing I have a transaction (A) = a call (B) + other storage operations (C). Executing A, beeing a transaction, I have to pay the gasUsed by B and C. Beeing B an expensive call and since I need the ...
0
votes
1answer
57 views

Ropsten contract doesn't send anything when calling with this.balance after initialized with eth

This was my code: contract Oust { address kingdom = 0x344d65e66a9c4f8d7911bf7433b509d6daac9bc0; function Oust() public payable { } function take() public { kingdom.call.value(...
1
vote
2answers
397 views

Sending ether via Contract instance

My contract instance is created like: var instance = web3.eth.contract(abi).at(addressA); instance.sendTransaction is showing error in this case, what's the correct way to send ether to this ...
5
votes
2answers
1k 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 ...
2
votes
1answer
3k views

How to get contract instance address for Web3 1.0 contract API?

With truffle-contract, all you needed to do to get the contract instance was something like this: const getContract = require('truffle-contract') const contractJSON = require('./MyContract.json') ...
0
votes
1answer
258 views

How can I access a contract deployed by another (deployed) contract?

I am currently working on voting contracts modeled after a particular electoral system. My intention is to first deploy the MasterConstituency contract manually and to have that contract deploy ...
1
vote
0answers
21 views

Contract's functions: Calls vs Transactions [duplicate]

I have a doubt about the behavior when you call a contract's function. I know if you call a function by sending a transaction that code will be executed in every single node of the chain. But what ...

1
3 4
5
6 7
17