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.

165 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
2answers
438 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 ...
4
votes
2answers
905 views

Contract creation gas cost depends on code in library function?

I have a contract fooContract which is using a fooLib library, calling fooLib.foo(LibStruct storage param) The transaction cost to create fooContract seems to depend on the code in the fooLib.foo() ...
4
votes
0answers
313 views

Contract execution fails with Web3 but works with Remix

I am dealing with a very simple smart contract: contract MyRegistry { struct MyEvent { string date; // yyyy/mm/dd string desc; // potentially long string uint count; // &...
4
votes
0answers
422 views

Event and/or watch does not work

I have a contract for a simple bidding scenario as below: pragma solidity ^0.4.9; /* Contract accepting biddings during 30 minutes */ contract SimpleBidding { address contractOwnersAccount; ...
4
votes
0answers
104 views

Wrong value returned from function

I've a simple but problematic problem. I read a value of a struct from a smart contract with a function like this: function getOwner(address _id) constant returns (bytes32) { uint pos = ownerID[...
3
votes
0answers
47 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 ...
3
votes
0answers
824 views

Not able to claim EOS tokens through MyEtherWallet

I was following this guide to acquire EOS tokens: https://steemit.com/eos/@sandwich/contributing-to-eos-token-sale-with-myetherwallet-and-contract-inner-workings Did step one first. Seemed to work ...
3
votes
0answers
204 views

How to call smart contract functions with an address stored in hardware wallet?

Is there a way to call smart contract functions with an address stored in hardware wallet? If so, please let me know how. Thanks.
3
votes
0answers
200 views

Contract creation from another contract succeeds, then fails?

I have a first contract with some very basic functionality : contract ContractA { uint public supplyA; function ContractA (uint _supply) { supplyA = _supply; } function ...
3
votes
0answers
122 views

Assuming EIP140, is remaining gas refunded when a called contract throws?

Under EIP140 (REVERT) and assuming Solidity ≥0.4.10. If I call from my contract to a function on an external contract, and this external function does an invalid jump, does my contract still call ...
3
votes
1answer
327 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
0answers
42 views

How to know the reason of transaction's reversion in parity?

I am testing ERC20 USDT contract locally with parity. I imported contract to my private testnet and manually generated raw transaction that calls "transfer" method of contract. I send it to the node ...
2
votes
1answer
120 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 (...
2
votes
1answer
86 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 ...
2
votes
1answer
196 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)...
2
votes
1answer
113 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 ...
2
votes
0answers
30 views

Why not possible limiting gas but forwarding ether in creating this contract from Solidity documentation

In the Solidity docs Creating contracts via new there is an example: contract D { uint x; function D(uint a) public payable { x = a; } } and it states in the accompanying text: ...
2
votes
0answers
135 views

Getting complete storage of a contract using geth client

I found at here, that it is possible for a client to get the value from storage of a contract at a particular index using eth.getStorageAt(contract_address, index) interface. I wanted to ask Is it ...
2
votes
2answers
105 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(); } ...
2
votes
1answer
222 views

Contract creating other contract doesn't show resulting transaction details on etherescan

Looking for help with a successful transaction not showing the details on etherescan. Having a deployed factory contract like so (simplified): contract EntityFactory { event EntityCreated(...
2
votes
0answers
402 views

Submarine sends and CREATE2

I've been reading about the problem of front-running, especially in the Bancor case (https://hackernoon.com/front-running-bancor-in-150-lines-of-python-with-ethereum-api-d5e2bfd0d798). One proposed ...
2
votes
0answers
246 views

Usage regarding for loop in solidity contract

I am trying to integrate for loop in my smartcontract for adding details to a struct. I have implemented for loop using frontend by calling the function in smartcontract one by one. struct details {...
2
votes
0answers
116 views

Global variable problem, event is missing and not fired

I have a contract like below: contract SimpleBidding { address contractOwnersAccount; // request information address public client; uint barcode; // bidding information ...
2
votes
0answers
398 views

Parity with Nodejs - Sending bulk transactions

I'm running a private testnet with Parity, and interacting with it using a nodejs cli. I have a script with which I trigger multiple transactions in quick succession for a smart contract that I have ...
2
votes
0answers
169 views

Transaction hash as contract method parameter

How to send the generated transaction hash as the solidity contract parameter through JSON RPC API call to the blockchain.
2
votes
2answers
1k views

web3 js eth.contract equivalent in PHP

var Web3 = require('web3'); var web3 = new Web3(); web3.setProvider(new web3.providers.HttpProvider("http://blahblah.com:8545")); var token = web3.eth.contract(ABI).at("x0x_contract_address") How ...
1
vote
0answers
11 views

Is gas cost of external calls included in gas cost of the main call?

When I call external methods of other contracts from my contract, is the gas fee of these calls included in the gas fee displayed by MetaMask? My transaction reverts (execution reverted) for an ...
1
vote
1answer
24 views

How to deploy smart contract so that average user can interact with its public functions?

I sucesfully wrote and deployed smart contract using Remix and Metask to generate hashes used as keys. This contract has few payable public functions that set or get some numbers. After deploying ...
1
vote
1answer
35 views

getEthToTokenInputPrice miner hack?

Plan to use getEthToTokenInputPrice in a Dapp. I was going to just use a larger sample size spread out over a large time period to mitigate flash loan price manipulation. Someone said this was ...
1
vote
1answer
79 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
2answers
43 views

How do I make my smart contract available for interaction with Metamask?

I am using OpenZeppelin starter kit. I wrote a smart contract that simply contains two integers which can be called. I compiled and deployed the smart contract to my local Ganache blockchain. I have ...
1
vote
0answers
36 views

geth is returning call trace but does not count balance change

I send this command to my geth (I'm sure anyone's Geth would return the same): curl host:8545 -X POST --header 'Content-type: application/json' --data '{"jsonrpc":"2.0", "method":"...
1
vote
0answers
19 views

Ropsten network contract method call not executing

I have function I'd like to execute onto the ropsten blockchain. I expect my metamask account to update balances however I just get this following output back <Function Method(uint256,bytes32) ...
1
vote
1answer
26 views

How keccak hashing and for loop happening in pure function?

I put a keccak hashing inside pure function, it works and return me the result.It also works in a for loop. I studied that hashing the data and loop consumes consider amount of gas. Do we need to ...
1
vote
2answers
44 views

Very confused by the Contract API

TL;DR I'm very confused by the Contract API in web3: https://web3js.readthedocs.io/en/v1.2.6/web3-eth-contract.html myContract.methods not available in geth console either with Geth 1.9.11-stable and ...
1
vote
2answers
54 views

Token Sale Smart Contract

I am new to Ethereium Block Chain and have been trying some code written in solidity as follows. pragma solidity ^0.5.0; import "./MyERC20Token.sol"; import "./ERC20Burnable.sol"; contract ...
1
vote
2answers
221 views

How to withdraw DAI from DSR (Oasis Saving Dapp / MakerDao) using the contract only, not the Dapp frontend?

I am currently testing the Oasis Saving Dapp by MakerDao (https://oasis.app/save). After converting some DAI to DSR, users can earn savings and whenever they want, withdraw their funds (convert back ...
1
vote
3answers
61 views

How to call function from SmartContract?

I have a smart contract deployed having the following function. function getTime() public view returns (uint){ return now; } However, when I try to call the function like this. ("einstance"...
1
vote
1answer
44 views

How to print the value of encoded getter functions of contract

UPDATED: Sorry for Inconvenience, I have updated all my question and accept my apology , being naive user. I have encoded getter functions of my contract i.e. ...
1
vote
0answers
29 views

How to check current status of state variables

I have deployed my contract locally into Ganache (GUI) and then send/call lot of transactions. After these transactions, now I want to check the current status of all state variables. Is there any way/...
1
vote
1answer
25 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
67 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
0answers
31 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-...
1
vote
1answer
53 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
2answers
130 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
478 views

Smart contract method error: 'abi: unmarshalling empty output'

I had a working Solidity contract, made a change to its function signature (to take in an array of addresses, instead of a single address), I compiled it, ran abigen and generated Go bindings. Below ...
1
vote
0answers
119 views

Solidity: Creating contracts with contracts by “new” operator

I'm creating "Trade" contract inside "Token" contract. I used an array to store each "Trade" contracts. Used web3, truffle. Token.sol: mapping (address => Trade[]) private _Trade; event tradeMade(...
1
vote
0answers
14 views

How the following scenario be achieved using smart contracts?

Assuming we have two parties (A & B). How the following scenario be achieved using smart contracts? User A will deposit some funds (x coins). user A can receive penalty funds from user B, So user ...
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 ...
1
vote
0answers
39 views

Replaying the Bad Parity Hack

On a locally hosted instance of Ethererum I am trying to replay and understand the Bad Parity hack. I have a Wallet and a Wallet Library Contract. Wallet.sol constructor(address lib) public payable {...