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
0answers
29 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
199 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
72 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?
2
votes
2answers
595 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
28 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
113 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
114 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
33 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
48 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
647 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 ...
1
vote
1answer
622 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 ...
1
vote
1answer
49 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
62 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
85 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
269 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
118 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
56 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
96 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
74 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
26 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
29 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
157 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
61 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
34 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
214 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
203 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
97 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
31 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
30 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 ...
1
vote
1answer
350 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 = '...
2
votes
1answer
43 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
60 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
47 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
23 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
326 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
27 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
1answer
124 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
46 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
426 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
458 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
67 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
103 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
194 views

state variable value not changing

I have very simple solidity code as below - pragma solidity ^0.5.6; contract SaveData { uint public salary; function setSalary(uint input) public { salary=input; } function ...
0
votes
1answer
122 views

Can't return string when function not pure? [duplicate]

See the below contract function of which return the string (Tested in Remix.org): pragma solidity >=0.4.22 <0.6.0; contract HelloWorld { function get() pure public returns (string memory){ ...
2
votes
1answer
575 views

Deploying and calling a contract works only with Ganache (not with Geth)

I deployed a HelloWorld contract using web3j and it worked awesome with Ganache. I was able to call my only function from the contract and it returns the desired result all the time. When I deploy ...
0
votes
1answer
77 views

Difference between ERC20 and ERC223

i still don't get the idea behind the "if you send 100 ERC20 to a contract, they're stuck there and these 100 ERC20 are lost forever".. i really don't get.. like, a contract has an address and a ...
3
votes
2answers
979 views

How much data can I store in a smart contract, what is the cost and how it is implemented?

If I suppose I use a smart contract as a database, how much data can I store? speaking only of strings and integers, save them in contract data structures does it cost in addition to the gas used for ...
1
vote
2answers
23 views

Verify transfered amount of two transactions from same ERC20 to same Contract

I making a contract to sell stuff in a decentralized way and want to use following method to transfer founds. function transferToken(address token, address from, uint256 amount) internal { IERC20 ...
0
votes
0answers
156 views

How do I send a transaction to a smart contract?

I need to build this transaction and send it to the blockchain how do I do it ? I always used ethsendrawTransaction just to send eth but never I never built this type of transaction: { "data": [ ...
1
vote
1answer
122 views

Is it possible for a smart contract to relay raw signed transaction

I am rethinking the flow for token transfer and confirmation on the network (ERC20,ERC721...). I am unaware of a way presently to: 1- transfer tokens and 2- trigger a call in different contract, ...

1 2
3
4 5
17