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.

148 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
2answers
329 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
3answers
160 views

Can a contract control another address?

Say I have control of addresses A and B, and I am writing contract C. When I deploy C on the blockchain, it will have it's own address, that can send and receive ether. But I want to have a method on ...
4
votes
2answers
782 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
294 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
417 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
103 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
38 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
814 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
201 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
198 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
117 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 ...
2
votes
1answer
81 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
50 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
296 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 ...
2
votes
1answer
198 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
169 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
79 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
3answers
1k views

How to query Ethereum contract to get data from it?

How to query Ethereum contract to get data from it?
2
votes
0answers
26 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
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(); } ...
2
votes
1answer
211 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
385 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
243 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
114 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
385 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
163 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
22 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
2answers
549 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 ...
1
vote
0answers
25 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
2answers
66 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

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:...
1
vote
1answer
87 views

How is it possiblle - Although one or More Error Occured [Reverted] Contract Execution Completed?

How is it possible that the txn is reverted due to some error but completed? https://etherscan.io/tx/0xc35fde759557f7742224373ea0777cc7ec36bac98dd678aa621ab96063c29e1c
1
vote
1answer
301 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
74 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
1answer
29 views

What is the advantage and disadvantage of deploying Erays on Ethereum?

I have read this paper, Erays: Reverse Engineering Ethereum's Opaque Smart Contracts. They proposed this reverse engineering tool for Ethereum smart contracts. it will take as input a compiled EVM ...
1
vote
0answers
13 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
0answers
27 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 {...
1
vote
0answers
53 views

state channel between smart contracts

In my scenario, there are data sellers and data buyers which might be persons or organizations. I would like to create a smart contract for data seller and another smart contract for data buyer where ...
1
vote
1answer
25 views

Metamask Web3js Synchronous Method Error

Okay guys, I'm a complete newbie to Ethereum and Web3.js and going through the Crypto Zombies tutorial and have done okay so far. But, when I use this function in my index.html file as they show it I ...
1
vote
1answer
120 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
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)....
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
57 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)...
1
vote
1answer
160 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 ...
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 ...
1
vote
2answers
130 views

How to use a date time from an API to prevent contract interactions if the date is a string?

I want an to use an oracle to prevent contract interaction after certain time cutoffs This is the APIs format: "event":"event2","timezone":"UTC+1","datetime":"2018-06-07 01:00:00" I think doing all ...
1
vote
0answers
23 views

Invoking functions of smart contract on Android phone?

Regarding to my contract code bellow, do you think that it's possible to do following scenario using a web browser on Android mobile ? Uploading GUI web application of RFID/NFC smart contract (i.e. ...
1
vote
0answers
171 views

(browserify) Error : Cannot find module 'web3/lib/solidity/coder.js'

When I use command browserify viz.js -o main.js to build this project, I receive following error message : C:\Users\KX5710\Downloads\GUI_solarchain\solarchain-dashboard-master>browserify viz.js -o ...
1
vote
0answers
266 views

How to get transaction hash at time of invoking function?

I have a function as follows: function setEnergy(address dev, uint256 energy) public returns (bool) { require(dev != address(0)); amount[dev].energyValue = amount[dev].energyValue + energy; ...