Questions tagged [decoding]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
0 answers
23 views

abi.decode fails to decode Structure

Function reverts when trying to decode this struct: struct NftProperties { uint32 dateOfFirstOperation; uint32 timestampStart; uint32 timestampEnd; int64 equivalentCO2; uint64 ...
user avatar
  • 775
0 votes
0 answers
25 views

Detecting internal transactions given a debug_traceTransaction response

Intro Hello everyone, I am attempting to filter and recreate internal transactions given a debug_traceTransaction response and the {tracer: "callTracer"} tracer. An example transaction can ...
user avatar
0 votes
2 answers
182 views

Fastest way to find the function in a contract from it's selector?

Let's say I have a function selector: 0xa9059cbb And I have a contract as such: // SPDX-License-Identifier: MIT pragma solidity ^0.8.7; contract CallAnything { function balanceOf(address ...
user avatar
0 votes
1 answer
133 views

How do I decode call data in solidity?

I have data in memory that is used for a function call, so I guess that makes it call data rather than a calldata (data location). This call data, say bytes memory data, consists of a selector and the ...
user avatar
  • 209
0 votes
0 answers
21 views

Decode number of tokens and token contract address from msg.data (ERC-20)

I have a smart contract with just a fallback function and some logic. I want users to send their tokens directly to the smart contract to do some smart contract logic on receive. I've implemented ...
user avatar
0 votes
1 answer
388 views

decodeParameters function python web3?

Is there a function like "decodeParameters" for web3 python? Regards
user avatar
0 votes
1 answer
212 views

How to compress transaction's input?

Any idea to compress the input data to erase the much zeros From: ...
user avatar
1 vote
1 answer
293 views

Why use abi encoding/decoding for method parameters? Why not simply separate the parameters in the method signature?

I have seen source codes where they would encode a bunch of parameters into a single bytes parameter and pass it into a function, what's the real purpose of doing it? For example: function hello(bytes ...
user avatar
  • 277
0 votes
1 answer
48 views

Why can't "input data" get decoded in a normal, readable format in an explorer, in some cases?

Let's say, this transaction https://testnet.snowtrace.io/tx/0x86895afcc3768254e5a1257790e95cdcd7402df6c88ed098c012a809a9be3e1d The function router.swapExactAVAXForTokens was called here. However, in ...
user avatar
0 votes
0 answers
221 views

Is it possible to decrypt a signed message given public or private key and message's signature?

a smart contract's function requires a certificate input that should be created using a signed message by the relevant wallet which will call that function. Is it possible to decrypt that signed ...
user avatar
2 votes
1 answer
340 views

Unable to decode input using Etherscan ABI

I'm looking at the input for a transaction that calls a Smart Contract and I cannot make sense of it. This specific sample is on FTM, but I'm assuming there is no difference in behaviour to ETH? ...
user avatar
0 votes
0 answers
189 views

How to parse Ethereum transaction input and get token transfers (ERC20)?

I am parsing Ethereum transactions to get transfers of different (erc20) tokens in Java. I know how to parse transfer, transfer_from, approve function calls, but I have problems with mint and execute ...
user avatar
  • 1
0 votes
0 answers
134 views

How to parse constructor arguments on contract creation transaction using ethers.js?

Ethers.js has a parseTransaction function that can be used in the following way to extract arguments from any transaction on a deployed contract. const txDescription = contractInfo.interface....
user avatar
  • 885
0 votes
1 answer
861 views

How to send bytes data to contract with web3.py to decode

I'm doing a test and trying to send bytes data to a contract so it can parse, store in variables, and return a value. Solidity code pragma solidity 0.6.12; contract testbyte { function sendBytes(...
user avatar
0 votes
1 answer
82 views

How do I parse a bytes32 in solidty?

I have a bytes32 object in memory or storage and I want to parse it into little chunks, for example into one uint8, followed by a bool, followed by uint10, followed by address. How can one do that? I ...
user avatar
  • 209
1 vote
0 answers
372 views

Decoding input data from transaction

I'm struggling with decoding the input data from transaction, have tried already everything that I found in similar topics here but all I can retrieve is: { "method": null, "types&...
user avatar
0 votes
0 answers
450 views

How to decode string from bytes 32 in event log that is returned as hex on event log subscribe

I am using the web3.eth.subscribe method to listen for events on a contract. When an event occurs, I am using the web3.eth.abi.decodeLog to decode the data from the event. One of the parameters I am ...
user avatar
2 votes
2 answers
91 views

How can I decode calls to the songbird network?

for example: I am a multisig signer. And I want to decode the call data that is used to call a specific smart contract. example on smart contract : 0x02f0826ef6aD107Cfc861152B32B52fD11BaB9ED (WNat) I ...
user avatar
  • 29
1 vote
1 answer
124 views

bscscan contract argument data decoding

Let's take a look at this tx: https://bscscan.com/tx/0x9b7cde866e9fe9b9a1c636d0f9686ea5b1920c875d7fcd973baf847bc359c8a9 as you can see it's buying token through pancake swap: ...
user avatar
  • 31
2 votes
2 answers
2k views

Decode input parameter without ABI

I have a transaction with input data that looks like this: 0x2293db5700000000000000000000000030823e060e8be429b34bd9192df9cad4b166a056 I know that the last 40 characters is the token address which ...
user avatar
  • 31
0 votes
1 answer
2k views

Best way to decode transaction input on the client side

I need to decode transaction input on the client side. Libraries like ethereum-input-data-decoder needs NodeJS dependencies like fs. Now I decode the one type of contract methods as follows: const ...
user avatar
0 votes
1 answer
171 views

How to decode input for tx sent to zero address (contract creation tx)

Decoding transaction input data requires providing ABI. How can I decode transaction input from a transaction issued to "zero" address? This special address is used for creating new ...
user avatar
0 votes
1 answer
487 views

How does Solidity decode a struct returned from a delegate call?

I have a proxy contract that delegate calls to a target contract. The proxy is similar to DSProxy. In it, there is an execute function: function execute(address target, bytes memory data) external ...
user avatar
0 votes
1 answer
2k views

Decode raw data within Solidity

If I only have the raw input data of a contract call, what would be the best way to decode it into readable form within Solidity? "[INPUT]":"...
user avatar
  • 327
0 votes
1 answer
333 views

How to decode when the input of tracsaction consists of multiple contracts?

I'm testing how to decode the input data of a transaction. I am currently using Infura and web3py. In the case of USDT token transfer, USDT ABI and contract address are obtained and decoded through ...
user avatar
  • 61
0 votes
1 answer
263 views

Is it possible to encode and decode two consequent byte arrays (with unknown sizes) using `abi.encode` and `abi.decode`?

Is it possible to encode and decode two consequent bytes using abi.encode and abi.decode (as following)? bytes memory data = abi.encode(data1, data2); // later on (bytes memory data1_recovered, bytes ...
user avatar
1 vote
3 answers
72 views

Would it be possible to integrate crypto with trading bot? [closed]

You can create a trading bot in trading view and see how well your crypto would perform in a given time frame. (I can see how much money would I make if I didn't sell or how much money I would make if ...
user avatar
  • 11
1 vote
2 answers
970 views

Decoding Transaction input data in Nethereum

I'm using Nethereum and see this example of how to decode the Input data of a Transaction object. Nethereum Playground C# This looks like it assumes that you have to know which function data you're ...
user avatar
1 vote
0 answers
593 views

Decoding transaction data using abi-decoder

I'm trying to write a very simple script in typescript that finds uniswap transactions and decodes the transaction data so I can read the function being called and the parameters it is being called ...
user avatar
  • 31
0 votes
1 answer
161 views

Method's parameters: a way to know a uint256 is a token amount and its number of decimals?

When decoding transaction actions or logs, I never know how to human-read uint256 values when they are token amounts and, if so, how to know how many decimals they are. For the decimals, do I always ...
user avatar
  • 101
1 vote
1 answer
929 views

decode ethereum input data in R [closed]

I am using the etherscan API to get the input data of transactions. However I have no real clue how I can decode the input data into something readable. For example: ...
user avatar
3 votes
1 answer
8k views

how to decode log event of my transaction log?

I receive a transaction event in my log of my Ethereum transaction. .on('receipt', function(receipt){ console.log("address: " + receipt.logs[0].address); console.log(&...
user avatar
0 votes
1 answer
2k views

abi.decode with pragma experimental ABIEncoderV2 reverts with nested array

I have a function with a parameter of bytes calldata that needs to be decoded to a struct, but the call reverts in assembly. I believe the issue has something to do with the nested array. I have ...
user avatar
6 votes
2 answers
3k views

How to decode a raw transaction in Python?

I have a raw_tx in hex format which I'm going to broadcast via eth_sendrawtransaction JSON-RPC method. I want to check this raw_tx by decoding it on fields: gas, gas_price, nonce, value, etc. Some ...
user avatar
  • 287
1 vote
1 answer
156 views

Where does the length parameter end and the actual string start in an abi encoded string?

Assuming I decided to ABI encode a very long string (for the purpose of this question I just picked an arbitrary 5-paragraph lorem ipsum text generate by https://www.lipsum.com/feed/html) and get out ...
user avatar
2 votes
2 answers
706 views

How to decode a transaction to verify its signature in Javascript?

I noticed that it's possible to sign a transaction with a wrong private key. I took the following example found at https://github.com/ethereumjs/ethereumjs-tx const EthereumTx = require('ethereumjs-...
user avatar
  • 33
1 vote
0 answers
76 views

Given just an Etheruem address, is there any way to tell if it's an ERC20 and/or an ERC721

If I have only an Ethereum address and only a locally running node (using a third party such as EtherScan or Alethio is cheating), is there any way to tell if that address is an ERC20 or an ERC721 ...
user avatar
0 votes
1 answer
123 views

Is Ethereum block header a list?

Decoding a RLP encoded block using Eth specifications do we get header as list? But as per format i.e., [[blockHeader,transactionList,uncleList],totalDifficulty], blockHeader should have been string. ...
user avatar
  • 1
1 vote
1 answer
737 views

RLP decoding for a list

in many standard documentation and many blogs, I have found the example for list with two strings like below [“cat”, “dog” ] -> C8 83 636174 83 646F67 and thats how it is decoded 1) Retrieve the ...
user avatar
1 vote
1 answer
166 views

Quorum how to decode result returned by eth_getQuorumPayload api?

I've read the post How to get decrypted transaction data in quorum? I followed the api document and got the result by calling eth_getQuorumPayload curl -H "Content-Type: application/json" -X POST ...
user avatar
  • 57
3 votes
1 answer
1k views

Encoded input params

I created a simple test contract with a single method: pragma solidity ^0.4.24; contract SimpleTest { function testFunc(string name, bool isFirst) public { //do stuff } } I'm ...
user avatar
  • 523
1 vote
0 answers
347 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-...
user avatar
1 vote
1 answer
574 views

Anyone with knowledge in org.web3j.abi.Type Decoder?

I am trying to decode a String with this code that I found but I have not been able to do it. String to = inputdata.substring(10, 74); String value = inputdata.substring(74, 138); Method refMethod = ...
user avatar
1 vote
1 answer
960 views

How to decode the input data in java?

I receive the input data as the image shows. And when I try to decode it with the method: String inputdata = null; Optional<Transaction> tx = web3.ethGetTransactionByHash(txHash).send()....
user avatar
2 votes
1 answer
2k views

How to unpack/decode parameters encoded with web3.eth.abi.encodeParameters in Solidity?

My client app (nodejs) packs some arguments to pass to a smart contracts as bytes _data (similar to ERC223 calls with fallback). I pack the arguments in my JS client like this: const packedArgs = ...
user avatar
  • 1,067
15 votes
3 answers
6k views

How can I easily parse a raw transaction?

In the Bitcoin ecosystem, there are tools like https://blockchain.info/decode-tx to decode a raw transaction. Is there a site that offers the equivalent for Ethereum? I'm looking for an easy way to ...