The Stack Overflow podcast is back! Listen to an interview with our new CEO.

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
1
vote
1answer
19 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); ...
2
votes
0answers
13 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
27 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
64 views
+50

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

Need a guide to access my ropsten test network contracts through my command line and not remix

I have written and published a contract on the ropsten test network using remix. Now I want to access the functions of the smart contract from my command line (My PC) and not the remix IDE. Is there a ...
0
votes
1answer
14 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 ...
0
votes
0answers
30 views

Smart contract function not returning value (decoded output) in Remix

I am completely new to Solidity and would appreciate any help. I have a supply chain smart contract and it contains a function that is supposed to be called by customers and after the call, the ...
0
votes
0answers
12 views

Pulling EVM Bytecode of Contract Address [duplicate]

Is there a way to pull the EVM bytecode of a given contract address? Using Web3 perhaps? I believe using the web3.eth.Contract command may get access to the contract, but I am specifically looking ...
0
votes
0answers
10 views

Feeding a contract address to echidna

Simple question: Can I use echidna on a contract address? Like in mythril the command I use is myth -v4 analyze -1 -a 0xec410f642db4a2bcc4d7a69bc13b1165ebad3cea. I don't see any supporting ...
2
votes
1answer
47 views

Why Ethereum sets user balance to MaxBig256 whenever a contract query is performed?

There is a strange behaviour on user wallet balances when performing a contract call (that is supposed to have no cost). Balance is right (expected value) until a free call is requested to a contract. ...
0
votes
1answer
42 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
2answers
132 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
0answers
31 views

Geth web3.eth.contract returns null

I understand that the way I'm doing this is a bit backwards, but I cannot install node.js onto our server, and we are using a PHP backend which doesn't have very good Ethereum support. I am trying to ...
0
votes
0answers
18 views

Is there any for a contract A to directly read the value of another contract B , while B doesn't necessarily have any getter functions

The following codes is a function of contract B, how can a contract A get these values such as balance[from], balance[to], balance[msg.sender] as efficiently and directly as possible in contract B ...
0
votes
1answer
23 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
38 views

How big is the Geth Fast Node Currently?

I am trying to embark on getting all the contract addresses pulled from the Ethereum blockchain. From what I read, a fast node is all that is required for this (getting blocks->txns->contractAddress ...
0
votes
1answer
78 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
24 views

Not getting getPastEvents or once function using contract instance

I have followed Web3 documentation to subscribe an evnet, I have created Instance of web3 using infura url as argument. Created contract object using, const contract = web3.eth.contract(abi, ...
1
vote
2answers
43 views

Get All Contracts from Blockchain

I am developing a large database of exploitable contract addresses and creating a website to host such a database for users to use to see if contracts are safe. Is there a way to get all contract ...
0
votes
1answer
42 views

Truffle: 'func.call()' retrieves the return-value of a non-constant function

I've just learned that one can easily obtain the return-value of a non-constant function, by using myContract.func.call() (instead of myContract.func(), which retrieves a response object). Up until ...
0
votes
1answer
34 views

Is it possible to send erc20 token when I have 0$ ether but $1000 in the token? [duplicate]

Long story short I have $1000 in one erc20 token contract but 0$ in ETH. Can I at least transfer these $1000 from the token to another address without ethereum asking for gas? That is: just change ...
0
votes
1answer
17 views

When calling a contract from an other contract, what happends if the value of callgas argument is above availaible gas?

In such case, the value is replaced with available gas right ? Or Does an out of gas exception is thrown ?
3
votes
0answers
36 views

Process address deposit from contract

Our service handles thousands (currently 10000+) of users and each user has his own Ethereum deposit address. To detect a new deposit we: Scan each block to get a list of transactions Get a list of ...
0
votes
1answer
50 views

How to get the return value of a contract from a contract call?

If a contract does returns something, (whether a string or return true/return false) how to get it’s return value ? I mean where does the return value is stored ? Is necessary to use RETURNDATACOPY or ...
0
votes
1answer
14 views

Get gas limit beforehand with Web3

I know that web3 exposes a function to estimate gas limit, but is it accurate when sending to a contract? AFAIK the amount of gas I'm gonna need if sending to a contract depends on the contract code, ...
0
votes
1answer
93 views

Is it possible to insert some custom data in the DATA field of an Ethereum Transaction?

i am working on trying to get some data encoded/inserted into an ethereum transaction. Let me describe my environment first, i am using Web3py, Ganache and Remix IDE. I am able to successfully ...
1
vote
0answers
24 views

Retrieving a State_object value on go-ethereum

I have a deployed contract address and I need to query a contract storage value, a token account balance that is stored on a mapping variable: mapping (address => uint256) balances; From go-...
3
votes
1answer
65 views

Issue in ERC721 token transfer to contract address

I am using ERC721 implementation for NFT tokens. I am testing the transfer functionalities in ERC721. `transferFrom(address _from, address _to, uint256 _tokenId)` `safeTransferFrom(address ...
1
vote
2answers
35 views

Who is msg.sender in a nested call chain?

I read about who is msg.sender when calling a contract from a contract, but who is msg.sender when calling a contract from a contract that calls another contract and so on and so forth?
1
vote
2answers
136 views

How to create a RawTransaction for contract interaction Web3j

I want to sign a transaction that calls a smart contract function and send it to the Rinkeby network. I found on Web3j documentation the RawTransaction class that supports the methods for the ...
0
votes
1answer
23 views

How to get the call graph of a mainchain transaction?

Simple question, but I couldn't find the answer. There are transactions like this one which involve many chained contracts. But as storage modify the functions being called and calldata doesn t ...
2
votes
1answer
77 views

Using 'call' from a constant function

I am trying to determine the behavior of call when executed from a constant function. Of course, the compiler issues a warning on that: Warning: Function declared as view, but this expression (...
0
votes
2answers
61 views

Instantiating a contract inside another contract on behalf of some address

I want to initialise an instance of a contract inside another contract on behalf of some address. e.g. I have contracts A and B contract A{ address owner; constructor() public{ ...
0
votes
2answers
20 views

ParserError: Expected identifier but got 'address'

I am trying to execute the following code: pragma solidity ^0.5.1; contract contractA { function blah(int x, int y) public payable {} } contract contractB { function invokeContractA() { ...
0
votes
1answer
22 views

Calling function of another contract in constructor not working anymore

I have a contract ElectionMaster that contains an array with all elections available in the network. When I create a new Election it calls a function addElection from ElectionMaster and registers ...
1
vote
2answers
180 views

Contract error: TypeError: abi.forEach is not a function

mac OS 10.14.15 node version v10.15.3 web3 version 1.0 version Parity-Ethereum/v2.5.1-beta-adabd8198-20190514/x86_64-macos/rustc1.34.1 I am trying to follow a YT tutorial to instantiate a contract ...
0
votes
1answer
226 views

Web3 Contract.balanceOf is not a function

I have read this helpful SO answer about sending ERC20 contracts, but it seems that the Web3 docs and API have changed dramatically since then. I am trying to get the balance of a smart contract using ...
0
votes
1answer
43 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 ...
1
vote
1answer
54 views

How to create a variable in storage via the solidity assembler

Similar to this question How to get access to the storage array through the solidity assembler? But instead of accessing a storage variable, I want to create a new storage variable via assembly. That ...
0
votes
2answers
43 views

How to dynamically generate a variable without declaring it in a contract (solidity)

Is it possible to generate a non-local variable with a function? Weird question but it's for an exercise my senior asked me to do, I've scoured the web for an answer to no avail. Instead of ...
0
votes
0answers
116 views

Can I subscribe to events emitted by another contract?

I am trying to subscribe to an event emitted by an existing library's smart contract. I've found examples of how to subscribe to events emitted by my contract using web sockets and my contract ABI as ...
1
vote
2answers
52 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?
1
vote
1answer
38 views

Encryption in Solidity - and yes of course the plaintext will be visible

I am using Solidity to write an Ethereum smart contract. I have a specific use case that requires a piece of data to be encrypted on the chain, despite the fact that both the plaintext and the ...
0
votes
1answer
74 views

How to integrate Dapper Wallet smart contracts with web app?

Dapper Labs who are the creators of Cryptokitties recently released their own wallet which is run by smartcontracts. They have open sourced the code: https://github.com/dapperlabs/dapper-contracts I ...
2
votes
1answer
40 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
20 views

Can function calls in other contracts change states?

In Solidity, is it possible to change states via function calls in other contracts? For example, let's consider the code below, where we have three assumptions: The function test2 is defined in the ...
0
votes
1answer
20 views

Are erc20's counted in market cap ethereum?

Are all erc20 ethereum tokens backed by some deposit of ether to a contract? If so, is there an overlap in the market cap of the current 24 billion in ether and the value of all the erc20 tokens?
0
votes
1answer
111 views

Quorum Can a non permissioned node change the states of private contract if the node knows contract addr and ABI?

I have ran the quorum-example, deploying a private contract. https://github.com/jpmorganchase/quorum-examples/tree/master/examples/7nodes I followed the commands written in README. However, I'm quite ...
0
votes
1answer
43 views

Multisig function calls

I am making a dapp in which ethereum user accounts that call certain functions are rewarded with an ERC20 token. All the dapp is based on functions using only one ethereum account as parameter. But if ...
0
votes
1answer
28 views

How to get Hash of function with many returns types?

I have a method : function getBalance(address _add) public view returns (uint256, string memory, bool, uint256, uint256, uint256) { return(accountBalance[_add].amount, ...