Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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".

0
votes
1answer
21 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
29 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 { ...
1
vote
1answer
79 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 ...
3
votes
1answer
97 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 ...
1
vote
2answers
46 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
75 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 { ...
0
votes
1answer
100 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 ...
2
votes
1answer
107 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
121 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
83 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 ...
2
votes
3answers
263 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 ...
0
votes
0answers
19 views

Collecting data sent to account/contract

What would be the best way to collect data that is sent to an account/contract. Each of the data will be a string of 128 bytes. Should I just leave it in the transactions and read and filter them out ...
3
votes
2answers
263 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 ...
2
votes
1answer
152 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
243 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....
2
votes
3answers
86 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?
1
vote
1answer
529 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 -> ...
0
votes
0answers
29 views

Is there a Limit for payload [duplicate]

Is there a limit to the size of calldata/transaction payload allowed in evm other than the block gas limit?
5
votes
1answer
265 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 ---> ...
0
votes
1answer
219 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 ...
2
votes
1answer
2k 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
457 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.
1
vote
2answers
2k 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, ...
3
votes
2answers
2k 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 ...
5
votes
4answers
2k 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 ...
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.
1
vote
1answer
334 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
80 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 "...
5
votes
1answer
1k 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,...
3
votes
2answers
4k 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
458 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 ...
3
votes
1answer
269 views

How can I call arbitrary function with arbitrary parameters from Solidity?

I am working on a voting library that allows members of a voting-DAO-like organization to vote on arbitrary actions. Security considerations (I know, arbitrary code execution is evil...) and ...
1
vote
0answers
394 views

abstract way of calling internal function instead of `this.call(callData)`

In Solidity I can call an internal function (inside the same contract that is calling it) the "usual" way: myFunc(); or I can call it via .call, as discussed here or here: callData = bytes4(sha3("...
12
votes
2answers
5k 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 ...
1
vote
1answer
115 views

What is preventing malicious miners stealing data to steal smart contract rewards?

The motivation for this question is roughly along the lines of a puzzle contract -- whoever submits the correct solution to the puzzle gets a reward from the contract. I'm guessing that the 'thing' ...
2
votes
0answers
183 views

“No data is deployed on the contract address” [duplicate]

Following token tutorial on ethereum.org, get error message No data is deployed on the contract address Forgive me, but I am new to mist. How do I find the "MyAdvancedToken" in Mist?
2
votes
0answers
319 views

eth_sendTransaction for function with address type parameters

I'm interacting with my local private blockchain created using geth. I'm able to use eth_call, but now I have some problems with eth_sendTransaction. The signature of the function is this: function ...
3
votes
2answers
1k views

Generate contract data hex for 'confirm' function on eth multisig wallet

I have an account on a hardware wallet that is an owner of a standard multsig wallet contract. I want to be able to approve a transaction that is originated from a different wallet. If I have access ...
4
votes
1answer
747 views

How can I decode getData from a contract method call

I'm using myContractInstance.myMethod.getData() to be able to serialize a transaction: // Get the call data, so you can call the contract through some other means var myCallData = myContractInstance....
7
votes
2answers
672 views

Why 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 ...
3
votes
0answers
35 views

How to make sense of the “data” sent to execute a contract? [duplicate]

I'm trying to understand the technical details of Ethereum and one thing I can't find any info about is the data to be sent to a contract. For example, I have a very simple coin flip betting ...
0
votes
0answers
75 views

Are there any libraries/tools for encoding input for data field of web3.eth.call method? [duplicate]

You can call contract functions using web3.eth.call method. Information on which function to call and what arguments to pass to this function is encoded according to the rules that can be found here. ...
3
votes
1answer
941 views

Can you help me parse this input data from a newProposal transaction from The DAO?

Every Ethereum transaction that represents a function call on a smart contract holds an input field with data that corresponds to the data sent through the interface of the function. For example, this ...
4
votes
1answer
1k views

Storing data in the blockchain inside a transaction

This question is related to this one and this one. I'm trying to store data in the blockchain inside the transaction data field: The second question offers a solution using a contract but is it ...
1
vote
1answer
84 views

How do I retrieve the event data related to the creation and transfer of The DAO tokens?

How do I retrieve the data related to the creation and transfer of The DAO tokens? This data will be useful to trace the movements in The DAO balances.
8
votes
1answer
2k views

Private chain: Extracting the “data” from an account?

I have initiated and mined a transaction between two accounts. I also included a data field in this transaction. This is just random hex data. Here is the command: eth.sendTransaction({from:...
8
votes
1answer
1k views

Private chain: Maximum size of “data” field in an Ethereum transaction?

The data field can be used to send arbitrary data in a transaction. I am aware that the amount of gas required increases with the increase in size of data, but, is there a limit to the size that's ...
5
votes
1answer
1k views

How do you get a string value from msg.data in the fallback function?

Im trying to do what The DAO did and do something when a sender sent money to my contract address. But im not sure how to. The something I want to do is to just create a new user in a mapping with the ...
6
votes
1answer
135 views

Can a contract know at what position in a callcode an argument begins?

using for example inline assembly with calldatacopy(t, f, s), which copies s bytes from calldata at position f to memory at position t in a call to for example function newContract(bytes data) { ... }...
5
votes
1answer
571 views

Accessing the last function parameter from msg.data

I have a fallback (unnamed) function in my contract and I know that the last parameter (or first, does not matter) passed is always an uint. Is it possible to somehow access it though the msg.data?