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

How to find the source code of my contract which is not yet verified

I had created a token using eth based blockchain via remix.ethereum.org But I need to verify the source code ,but I am not having the backup copy of source code How can I see the source code of the ...
0
votes
0answers
27 views

Why error 'Fail with error 'Storage: Unpermissioned operator <0xc3d5d60630bc63eb1a07228cc5028cada1cc4c7b>' arises?

I wants to deposit & withdrawal DAI (https://kovan.etherscan.io/address/0xc4375b7de8af5a38a93548eb8453a498222c4ff2) to SOLO Margin(dydx) smart Contract at Kovan testnet (https://kovan.etherscan....
1
vote
2answers
21 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
23 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
16 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
25 views

Is it possible to transfer token from other address if I have private key from it?

I know that if someone owns tokens he can simply call transfer method of contract to send money. I also know that for ERC20 contract owner of tokens can call approve for my account, and then I can ...
1
vote
1answer
18 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
25 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 ...
0
votes
1answer
152 views

Getting “ReferenceError: unescape is not defined” when trying to call() a smart contract method from rasberry pi to a private geth network

> var contract1 = eth.contract(abi).at(address) undefined > contract1 { abi: [{.....] transactionHash: null, addRecord: function(), allEvents: function(), getPatientName: function(), ...
0
votes
0answers
18 views

Integration of (closed) cloud solution with Ethereum

I'm trying to invoke a smart contract function from a cloud solution Unfortunately I can only use REST web services and I cannot - install node.js - install any custom module Also, I can only use a ...
0
votes
0answers
22 views

Solidity - can I predict reverts?

I have a voting system and admin groups contracts. Each admin group (it contains array of addresses allowed to vote) can grab a voting contract and vote for changing code in my contracts environment. ...
0
votes
0answers
12 views

How can I retrieve the ETH stored in the contract for a now invalid ENS domain name?

A couple years ago, I bid on a domain name through the Ethereum Name Service (ENS) that is not valid, as it is considered a subdomain. For example, something like "apple.uk.eth" which should not be ...
0
votes
0answers
33 views

Gas required exceedes allowance when invoking a pure function

So, I got a problem when interacting with a smart contract in geth. I have this very simple contract: pragma solidity^0.6.1; contract Simple{ uint256 public number = 1; constructor() public { ...
1
vote
2answers
31 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 ...
0
votes
1answer
22 views

Trouble deploying one contract from another

Why creating a contract new RewardCourts() in another contract takes more than ten kilobytes of bytecode in the contract it is called from? (It makes bytecode too big and I can't deploy it!) What to ...
0
votes
0answers
21 views

Gas Estimation Failed error when scheduling Aion call

I am trying to understand the Aion scheduling system, so I tried their code example from here. Below is the code snippet: pragma solidity ^0.4.24; // interface Aion contract Aion { uint256 ...
1
vote
2answers
134 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
1answer
33 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"...
0
votes
3answers
39 views

If I use a factory contract to create a new contract, does it show that the factory contract created it in the blockchain? [closed]

I am not sure if it would show my address or the factory contract's address (or both).
1
vote
1answer
32 views

web3py - Sending a transaction to a payable contract function

I have deployed a smart contract dthat contains a payable function fundit(address _to). Now I am trying to use a Contract object to send ether to the function: tx_hash = instance.fundit....
2
votes
1answer
35 views

Execute transaction Approve directly against contract address (without ABI)

Solved For now, you will always need the ABI to execute a call against the ethereum network with web3. A simple way is to reconstruct the function you wish to execute is to, either create a separate ...
2
votes
1answer
27 views

Payable function that returns value: when is this example practical?

To quote an example from a book: contract StockPriceOracle { uint quoteFee = 500; mapping (string => uint) private stockPrices; //... function getStockPrice(string _stockTicker) payable ...
1
vote
2answers
31 views

How to read data returned by a function? [duplicate]

Counter.sol: pragma solidity >=0.5.0 <0.7.0; contract Counter { uint public _counter = 0; function GenNextID() public returns (uint) { return _counter++; } } I use ...
0
votes
2answers
49 views

Infura Json RPC: how to call a function passing parameters?

IMPORTANT My final goal is receive data via api on a php server and use Infura to call my contract to save the data Test Situation having this test contract on rinkeby contract test008 { ...
0
votes
1answer
24 views

What is the data field in eth_call commands for USDT?

I'm trying to use eth_call to send USDT (TetherToken) from one account to another (Although I know that eth_call just simiulate such transaction). Everything is clear in this regard, just the data ...
0
votes
1answer
121 views

the tx doesn't have the correct nonce. account has nonce of: 12 tx has nonce of: 3 - Ganache

I am trying to run my simple contract with different parameters (in the form of encoded signatures) and intends to put multiple transaction into ONE block. If I set Ganache GUI with automine option, ...
1
vote
1answer
198 views

MetaMask verification screen doesn't show amount or token when I use 'approveAndCall' to transfer tokens to a contract

When I use 'approveAndCall' to transfer tokens to a contract, the MetaMask verification screen doesn't show the amount, or the token name. let contract = new web3.eth.Contract(gsERC20abi, '...
1
vote
2answers
46 views

The method eth_sendTransaction does not exist/is not available, when using Ropsten Network

My following code previously works perfectly at Ganache, but when i switched it to Ropsten Network, it give captioned error. Here is Code: async function finalSettersFunctions(){ var myFunc; ...
6
votes
1answer
76 views

Is the ABI required to call a contract with ethers.js?

From the docs: // The Contract interface let abi = [ ... ]; // Connect to the network let provider = ethers.getDefaultProvider(); // The address from the above deployment example let ...
1
vote
2answers
87 views

How to insert multiple transactions into One Block in Ganache GUI

Is it possible to enable Ganache GUI to put multiple transactions into ONE block ?. The details about Why i need this thing, is given below; I am going to test Transaction Order Dependence (TOD) ...
2
votes
1answer
18 views

How to pass encoded parameters to call contract getter fuctions

I have an array (i.e. functionNames[]) of getter functions's names of my contract and another array (i.e. finalGettersParams) of encoded parameters (which has been populated from web3.eth.abi....
1
vote
1answer
35 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
3answers
111 views

Smart contract execution without making transaction on ethereum blockchain

If I as a user of a smart contract ,call a function which does a heavy computation but doesn't change anything except the function variables which live only during function execution and then thrown ...
0
votes
0answers
29 views

How can execute function that send ether in geth console?

I want to execute the send function that sends ether from the sender to the receiver, the code is as shown below. contract Sender { function send(address _receiver , uint amount) public ...
0
votes
1answer
44 views

What is the ethersjs equivalent of `web3.eth.call` in web3js?

web3.js has the ability to call a transaction and get return data without sending a transaction: web3.eth.call(callObject [, defaultBlock] [, callback]) ethersjs apparently does not have this ...
0
votes
0answers
18 views

How does specifying job parameters on Chainlink work?

I am trying to understand Chainlink, and I am running into a wall. I found this tutorial, which explains how I can create a job spec using JSON. The tutorial explains that you can specify the url, ...
1
vote
0answers
27 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/...
0
votes
0answers
28 views

Did I get this right that with delegatecall the msg.sender is the last entity that calls delegatecall (example below)?

In other words: If contract B is called by contract A: B: function externalcall() public { //msg.sender is contract A... msg.sender.call.value(0); } Then assuming msg.sender.call above calls back ...
0
votes
0answers
14 views

Cannot use delegatecalls in Remix since either the addresses aren't displayed correcly or I cannot access the memory address?

For instance delegatecall to the same address works: function callTheOtherContract() public { require(address(this).delegatecall(bytes4(keccak256("callMe()")))); } event CallMe(...
0
votes
0answers
22 views

Is there a way for a function to perform some code to a point and then revert without conditions (more details below…)?

I want to create a payable function that acts similarly to onlyowner modifier, or: function owner() public payable{ if(msg.sender != owner) { balances[owner] += msg.value; revert(); } } What ...
0
votes
1answer
23 views

How to call a write function of contract from Dapp?

I have created a smart contract in which a "stop()" function should be called once a deadline is reached. Dapp is keeping check of the deadline and as soon as the deadline is reached I need to call ...
0
votes
1answer
16 views

So can I simply send ether to a contract as if it's a regular wallet, even without payable function?

Are contracts really that different? I guess in theory every contract should have a private key somewhere + it should be possible to send ether to it? Unless geth/parity and other parts of the evm don'...
0
votes
1answer
26 views

REMIX debugger invalid opcode before JUMP

I am testing simple ERC20 token creation with the following in remix: pragma solidity ^0.5.0; import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v2.4.0/contracts/token/ERC20/ERC20....
2
votes
2answers
73 views

Calling function on ERC20 contract through staticcall gives wrong result

I've made two functions to interact with a local ERC20 token. Here they are: pragma solidity ^0.5.0; contract GardenTestContract { function getBalanceOf(address _address) public view returns (...
0
votes
0answers
20 views

Dataset of simple contracts with getter setters

Are there any repositories/datasets which provide smart contract with simple logic like having some getters and setter functions. So, that I could give some values to getter and setter functions, ...
0
votes
1answer
41 views

Calling contract functions using only ABI without source code

I have MyContract.json file of some contract(assume i haven't its source code). In .json file, there is abi and bytecode. If i want to deploy such contract (through web3js), I am facing following ...
0
votes
1answer
32 views

How to call external payable contract function from app.js (DApp)?

The contract has a function: function purchaseTokens() external payable { require(msg.value>0); ...etceteras... } What I need is an app.js part, something that would look like this (lets ...
0
votes
1answer
29 views

How to know the execution time of transaction when miner execute it

When i send three consecutive transactions to my contract (deployed on ethereum testnet), how can i know the exact time (at milli/micro/nano level) which transaction executed (on miner side) first and ...
0
votes
1answer
31 views

State Variable of solidity Contract could not be updated through JavaScript

I have following contract and just want to update its state variable values i.e. totalSupply. But when I try to attempt this task through JavaScript code (given below) by calling its function i.e. ...
0
votes
3answers
36 views

Could not assign contract state variable value to javascript variable

I want to retrieve and assign the value of my contract state variable to my javascript variable.I am doing as per guidlines provided on this community, but failed to assigned. my javascript code is ...

1
2 3 4 5
16