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
2answers
294 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
138 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
67 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
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
0answers
108 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
54 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
613 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
314 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
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 ...
1
vote
1answer
116 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
159 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
531 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
236 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
109 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
62 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
55 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
762 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
229 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
277 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
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 ...
1
vote
2answers
55 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
239 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
153 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
54 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
75 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
74 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
614 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
306 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
78 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
38 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
56 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
273 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 ...
4
votes
2answers
856 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
175 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 ...
0
votes
0answers
49 views

Events firing but bool variable not changing in value

Given a contract with an event as follows contract test { event LogEvent( address a, bool result ); function testInputs(some parameters) public (){ .... ...
0
votes
1answer
33 views

Unpredictable states error when refactoring smart contracts

Ethereum smart contract functions are limited to around 16 local variables. When they exceed that number, stack is too deep error is generated. The solution is to refactor the large functions into ...
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, ...
2
votes
1answer
176 views

Transaction fails when calling contract function with return value

I'm hitting some unintuitive behavior in solidity when one of my contracts calls another. I'm testing the contracts with web3py. Here's is the most minimal example I could come up with. Note that it ...
0
votes
1answer
575 views

Command line tool to interact with smart contract

I want to be able to interact with functions on a smart contract. I do not want to setup my own node using geth, and would like to use something like Infura as a remote node. Based on what I have ...
0
votes
1answer
63 views

Which one is a better option - web3js or golang apis? [closed]

I want to build an application where I can call methods from smart contracts. I can do so by using either web3js or golang apis. Query: Which one is a better option when interacting with smart ...
0
votes
2answers
572 views

Quorum PrivateFor Not Working in Web3 - From Account Address to Smart Contract Address

I am using Web3 to send a transaction to a smart contract address. The public transactions are working OK. However, when I use the PrivateFor parameter in the web3 call, the transaction is still sent ...
1
vote
2answers
1k views

How execute a contract method with private key / sign send method?

I'd like to execute an erc20 contract method without unlocking a wallet, signing the transaction inside my code. Here is how the code should look like: public async send(sender: string, receiver: ...
0
votes
1answer
117 views

Airdrop function executing but balances not updating

I created the following code for token generation and airdrop. The token generation is working. I am able to execute the Drop() function (and got confirmations of contract execution) but the token ...
0
votes
2answers
50 views

Where the Smart Contract deployment charges goes?

I'm newbie to Ethereum, and finding answers of some questions that I have. I have learned about SC deployment that deploying the contract cost 0.01072934 ether, or about $3.21 USD So, where that cost ...