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
1answer
23 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
16 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
28 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
32 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 ...
-1
votes
0answers
30 views

How to emulate smart contract execution on mainet?

There’s something which was never tested I’d like to test on Mainnet… In that kind of situation, the simple answer would be to create a transaction for the thing I want to test… But the problem is I ...
0
votes
1answer
7 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
0answers
31 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
23 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
49 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
31 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?
0
votes
2answers
67 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
0answers
18 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
75 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
46 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
17 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
20 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
121 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
113 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
42 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
33 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
55 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
48 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
34 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
55 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
34 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
15 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
85 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
38 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
27 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, ...
1
vote
1answer
80 views

How can I call the permanent ENS registrar contract directly from sbt-ethereum?

I would like to register a name (e.g. 'somename' >= 7 characters) with the new ENS contract using sbt-ethereum and the .eth registrar controller, for one year. I have confirmed that the code in the ....
3
votes
1answer
69 views

How would I exchange ETH for DAI in uniswap directly from sbt-ethereum?

Firstly, i love sbt-ethereum. It is zippy and an absolute pleasure. Having completed the contract-interaction portion of the tutorial, I wanted to test out a live contract. I would like to interact ...
0
votes
2answers
42 views

msg.sender.balance inside contract

what does/should msg.sender.balance return when used inside contract? Assume we have contract A, calling B, which is calling C. msg.sender is propagated with the calls down to B and C The user is ...
1
vote
1answer
30 views

How does contract of dapp figure out who buyer is?

How does contract of dapp(eg. market place) figure out who buyer is? If buyer wants to purchase servive(or product) at certain dapp, he should transfer tokens to contract address of the dapp. At ...
0
votes
1answer
23 views

Regarding interaction between smart contracts [closed]

If we have a case where we have Two smart contracts. Contract A passes value to Contract B. the address of contract A is also passed to contract B in the smart contract. while compiling the contract B ...
0
votes
1answer
91 views

Web3js :interact with smart contract

I'm currently struggling to interact with my smart contract, I don't if it comes from the way I call the function or the way I connect to my smart contract. Here is the code const contractAddress = '...
1
vote
1answer
30 views

How to access a smart contract function protected by access rights using Web3?

I have a smart contract address for security tokens, and certain functions of it are protected by access rights, for which I have an address to access those functions, however I am not able to figure ...
0
votes
1answer
34 views

Create a large number of contracts with different addresses

I'm developing a performance test where I check the time a gateway spends to find a contract in a blockchain. I'm using ganache-cli to simulate the blockchain, my doubts are: 1) Is it possible to ...
1
vote
1answer
32 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:...
0
votes
1answer
22 views

Retrieve the status of a contract by its creator

In a situation where there are multiple contracts stored in different blocks, is there any method to retrieve the status of a contract through its owner's address? (e.g. in my situation, each person ...
0
votes
1answer
91 views

Load smart contracts in Java application without having the java wrapper class for Web3j (only the address of the contract)

I use web3j to interact with my local Ethereum node (created with geth), and I was wondering how should I handle smart contracts created at runtime. I know that in order to deploy a smart contract ...
0
votes
0answers
28 views

call() returning BadFunctionCallOutput in web3.py

Have a very basic ERC721 contract based on OpenZeppelin-Solidity, as follows: pragma solidity ^0.5.7; import 'openzeppelin-solidity/contracts/token/ERC721/ERC721Mintable.sol'; import 'openzeppelin-...
0
votes
0answers
24 views

Understand the `call` opcode in this contract

Hello, I am posting a quick question regarding the functionality this contract: https://etherscan.io/address/6b63ea3612dde97082aab468157950f927618d31#code From the source code, I am not even able to ...
1
vote
0answers
38 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
0
votes
1answer
36 views

Automatically Run Contract

I have a private ethereum network made up of multiple nodes and I would like one of them to interact with the a deployed smart contract without my input. Is it possible for create a script that will ...
1
vote
1answer
217 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
1answer
139 views

How to call a contract function using Nethereum?

I would like to call a contract function using Nethereum C#. Here is the contract in Etherscan (https://etherscan.io/token/0x8c9b261faef3b3c2e64ab5e58e04615f8c788099#readContract) I want to call ...
0
votes
3answers
51 views

Limit the number of times a static function is called

As far as I am concerned, when a function in a smart contract is defined as pure or view it is possible to invoke it without being charged for the gas consumption that its execution requires. This ...
1
vote
0answers
48 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(...