Questions tagged [calldata]

Questions about the "data" part in a transaction, which can be accessed by "msg.data". web3.eth.getTransaction calls this field "input".

Filter by
Sorted by
Tagged with
0
votes
1answer
34 views

pass storage through interface to library

Here is what am i doing: There is a library, accept storage argument as parameter, then do some math and return the result. And there is a contract to call the function in the library, and an extra ...
1
vote
1answer
47 views

What data is in 'calldataload'?

I want to parse event logs that are generated by the contract shown below, which assigns different sections of calldataload to the 4 Topics, and the Data section, of the event logs. Topic 0 receives ...
4
votes
2answers
947 views

What is calldata?

What is calldata? I learned that there are three types of memories: Storage Memory Stack In the Ethereum docs, it says that the function parameters are of type memory by default. However, I've also ...
1
vote
2answers
414 views

How calldata is stored in memory?

When I execute this: bytes8 h = 0x000008dfe2f440000733c; t.call.gas(0x7e0b0)(bytes4(keccak256("enter(bytes8)")),0x8dfe2f440000733c0000000,h); the calldata is : 0: ...
1
vote
1answer
540 views

How to send data to smart contract?

I have the variable w1_temp, which i need to send to contract I have the following code: var W1Temp = require('w1temp') var Web3 = require('web3') var web3 = new Web3() web3.setProvider(new web3....
0
votes
1answer
26 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 ...
0
votes
1answer
256 views

Update dapp after contract transaction is mined

I made a web app that interacts with a smart contract, using truffle unbox webpack. My contract has a variable called sum and 2 functions: one called answer that increments the sum variable after it ...
5
votes
1answer
97 views

When should I use calldata and when should I use memory?

I have seen people use both memory and calldata keywords when writing Solidity. Specifically, they are used when declaring function parameters. When should I use memory and when should I use calldata?...
21
votes
3answers
26k views

What does “intrinsic gas too low” mean?

I'm running the Mist wallet, and I've deployed this contract to testnet (from https://ethereum.stackexchange.com/a/179/520) : contract Notary{ struct Document { uint timestamp; ...
4
votes
1answer
174 views

What is a function selector?

I am reading an article, it says: To enable deployment on the Ethereum platform, the contract functions are compiled into EVM bytecode and a piece of code called function selector is added, ...
0
votes
1answer
102 views

member not found or not visible after argument-dependent lookup in mapping

pragma solidity >=0.4.0 <0.7.0; contract New{ mapping(address => string) public users; string name; address[] public userAddress ; //string[] public userNames; ...
1
vote
0answers
20 views

Calling private function from external - where are referenced type parameters stored in the end?

Let's assume we have something like: contract C { function externalFunction(uint256[] calldata data) external { privateFunction(data); } function privateFunction(uint256[] memory data)...
0
votes
0answers
24 views

Call Arguments? and Explicit call?

I am trying to understand the arguments of the built-in Solidity's (or EVM's: I am not sure) call function. I know it has 4 arguments. I am trying to understand the call function at: Syntax Error in ...
16
votes
6answers
12k views

Encoding/Decoding contract ABI data

How to encode and decode ABI data? Can someone show me an example with web3js library?
0
votes
2answers
141 views

Unable to make a transaction with Data using Java api ethSendRawTransaction

I am trying to make a transaction between two different accounts using Java. It works perfectly fine as long as I am not using "Data" parameter. My intent is not to call a smart contract but to make ...
1
vote
3answers
3k views

Decoding contract output of web3 eth call

I have written data to a contract using sendRawTransaction, and am trying to fetch it using web3.eth.call for the function : function checkRecord(uint id, bytes email) constant returns (uint id2, ...
2
votes
1answer
37 views

Understanding first evm word of reference types in assembly

Given the following function: function getArrayItems(bytes calldata) external returns ( bytes4 _signature, bytes32 _wutIsThis, bytes32 _length, bytes32 _firstItem ) { assembly { ...
4
votes
1answer
145 views

can anyone help to explain calldataload

In the Solidity documentation, the definition of calldataload is: calldataload(p) call data starting from position p (32 bytes) But I am really confused by what is call data. Is the call data of ...
8
votes
2answers
799 views

Can msg.data be used as an identifier?

I'm looking at the multisig wallet implementation here and I see the usage of sha3(msg.data,block.number) being used as an identifier. What exactly is inside the msg.data and why is it unique enough ...
0
votes
1answer
263 views

Solidity: msg.data vs bytes

This is a simple contract that has a function input_data(bytes data) and a simple fallback function that passes msg.data to function input_data. contract test_input_data{ address owner; event ...
1
vote
0answers
73 views

Proxy contract DELEGATECALL to pass a DYNAMIC array to a function in the target contract

I'm trying to get a Proxy contract to correctly do a delegatecall to a function in another 'target' contract. The problem is, that I need to pass a dynamic array as the parameter to this function. Q: ...
1
vote
3answers
154 views

Calldata with too many parameters

While reading https://solidity.readthedocs.io/en/v0.4.21/abi-spec.html#abi I was just thinking what happens when calldata contains more parameters/data than the function expects (I know first ...
1
vote
0answers
151 views

How to decode Tx data? Online tool?

Is there a fast way to decode the data returning from a Smart Contract call? I know there are github projects with JS libraries to decode this kind of data (such as https://github.com/ConsenSys/abi-...
0
votes
1answer
482 views

What is Calldata tag needed when a function has a string parameter?

I'm using: pragma solidity ^0.5.0; I have a function as below in my contract: function test(string a) external{ a="apple"; } An error shows up saying I need to add "calldata" to the parameter. ...
1
vote
1answer
423 views

Get the input data of a transaction with web3j

How can I retrieve transaction details (including the input data) from a txHash using Web3j? I tried the following method: public void buscarHhash(Web3j web3, String txHash) throws IOException { ...
2
votes
3answers
451 views

How does MetaMask's TRANSACTION DATA work? How to interact with smart contracts by only using MetaMask?

I have this source code pragma solidity ^0.4.21; // Relevant part of the CaptureTheEther contract. contract CaptureTheEther { mapping (address => bytes32) public nicknameOf; function ...
1
vote
1answer
805 views

How to access string arguments from calldata in external functions? (0.5.X)

With the introduction of Solc 0.5.X , parameter memory locations for arrays (and strings/bytes) must be made explicit. For external functions, this memory location is required to be specified as ...
5
votes
1answer
2k views

calldata keyword as parameter in solidity v0.5.0 function?

What purpose does the "calldata" serve in this parameter _owners? Is it a new keyword? function setup(address[] calldata _owners, uint256 _threshold, address to, bytes calldata data) Taken from ...
3
votes
2answers
342 views

Solidity CALL and DELEGATECALL: messages and data format

I have some questions about Solidity CALL and DELEGATECALL. I have already read some related threads (link), but found no answers to my doubts. 1) Is there any difference in performing a CALL to a ...
1
vote
2answers
62 views

Thinking through from traditional DB to ETH

I am looking for a data structure kind of like this: [ "data": { "id": 0, "hash" : "5feceb66ffc86f38d952786c6d696c79c2dbc239dd4e91b46729d73a27fb57e9", "owner" : 0, "status" : "...
2
votes
1answer
181 views

How does a contract's constructor work and load input values?

I set up the following contract: pragma solidity ^0.4.25; contract Simplest { uint x; constructor(bool _lucky) public { if (_lucky == true) { x = 7; } else { ...
5
votes
4answers
3k views

How to decode input data from tx using python3?

I am trying to decode input data from token sale transactions. This is one of the transactions I am trying to parse 0xf7b7196ca9eab6e4fb6e7bce81aeb25a4edf04330e57b3c15bece9d260577e2b Which has the ...
2
votes
1answer
280 views

Call function by using bytesData. (call.value()())

Assume I have two contracts: contract A { function test1() public view returns(bool) { return false; } } contract B { function testCall(address addr, data) public view returns(...
0
votes
1answer
511 views

Web3j directly gets string from contract by eth_call

I just have a simple solidity contract: pragma solidity ^0.4.19; contract SampleContract { string value; function SampleContract() public { value = "hello world"; } ...
1
vote
0answers
100 views

delegatecall for Smart Contract versioning

I've a state variable address public current; which stores the address of the latest updated contract. This value can be modified with a function. Then, I've a function of this kind function ...
13
votes
2answers
6k views

What is msg.data?

Is msg.data equal to {from: addr1, data:something}? How to handle the data 'something'? when execution this code: web3.eth.sendTransaction({from: ..., to: addressOfE, data: something}); how to ...
2
votes
3answers
115 views

Can I send data to non-contract address?

Metamask allows to attach data to any transaction. What happens if I send some data with some ETH to existing non-contract address? Is that data recorded on the blockchain? Can I read it later?
2
votes
1answer
273 views

Assign metadata to a transaction

How can I append some (extra) data to a transaction that calls a contract method (with given parameters)? The transaction has only one 'data' field which is used to serialize the method call. If I ...
1
vote
1answer
636 views

Contract call from a contract from a contract?

As I understand it, it is possible for a contract to call another contract by using othercontractaddress.call(gas_amount).value(eth amount)(tx data). Or in this case sender -> contract A -> ...
6
votes
1answer
379 views

Making call with contract instance vs making call with hashed method ID

As I understand there are two main ways to call a function in another contract. 1.) Using the 4 byte methodID ----> address.call(bytes4(sha3('foo()')) 2.) Using the contract ABI ---> ...
4
votes
1answer
3k views

Decode Etherscan.io Contract Input Data

Reading my input data on etherscan, I see each value as hex values. Which is fine to read the addresses. But I would like to read the amounts [1] && [3] as numbers. Contract Method Function: ...
6
votes
2answers
548 views

Is sending some datas in the data field safe?

An airdrop ask to send it 0ETH with 150000 GAS and some datas in DATA field. Is it safe? What could be the aim of this transaction? Thanks.
5
votes
1answer
2k views

How to send a smart token transaction from one account to another account using JSON RPC interface

I would like to send amounts of a created token from one address to another. I would like to use eth_sendTransaction: eth_sendTransaction Creates new message call transaction or a contract creation,...
42
votes
3answers
35k views

How to call a contract method using the eth_call JSON-RPC API

Ok, so I'm trying to call a contract method using the methods provided by the Ethereum JSON RPC interface. The JSON RPC is running on an Ubuntu machine. Unfortunately, I can't really get a result back ...
1
vote
1answer
393 views

how to retrieve function call address from deployed contract for usage with MetaMask send + transaction data?

I've deployed a contract into my testrpc network. $ truffle deploy Using network 'development'. Running migration: 1_initial_migration.js Deploying Migrations... Migrations: ...
0
votes
1answer
1k views

Using Ethereum to buy Tezos

I would like to use my Ethereum to buy Tezos. Does anyone know if Coinbase pass transaction data along with the transaction? Thanks.
4
votes
2answers
3k views

What is “data” param of rawTx? How to send ETH by using web3

I want to send eth by using web3 on testnet. Source address is 0xbddf0bf3ac858d7fb8a2bdda55884d61779ba5a9. The destination is 0x8005ceb675d2ff8c989cc95354438b9fab568681. I found the example on web3 ...
0
votes
1answer
86 views

Use accounts as datastore

I am rather new to Ethereum and I wonder if the following scenario is possible. I want/need to store some data encoded as a JWT in the blockchain and have it (publicly) accessible via an ID. Only the "...
3
votes
2answers
5k views

How do I “Add Data” to a send transaction in Solidity

In myetherwallet, there is an +Advanced: Add Data Section where I can add data to the transaction. How can I add this same data in a transaction I make in Solidity?
2
votes
0answers
495 views

Call vs Delegate Call call data format

I'm using both call and delegatecall within an assembly block and i've noticed that when issuing a call I need to provide 4 bytes (sig) + any arguments, whereas for delegatecall I need to provide 4 ...