Questions tagged [bytecode]

The tag has no usage guidance.

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

Questions about bytecode and deployedBytecode

I am using solc-js independently as I am trying to deploy some contracts in Hedera. I have a question. Truffle and Hardhat generate a bytecode in the json that the ABI has. But it has a different ...
user avatar
2 votes
0 answers
355 views

Why is the Vyper Bytecode smaller? What is it giving up?

I have two contracts that are essentially the same, but one is in vyper: # SPDX-License-Identifier: MIT # @version ^0.3.3 my_var: public(uint256) @external def update_var(my_new_var: uint256): ...
user avatar
0 votes
1 answer
20 views

How to decode a bytes that represent a function call without having the function parameters types?

I have a Smart Contract that receives transactions proposal, these proposals go through a voting period and when this period ends, the transaction can be executed if it has the necessary approving ...
user avatar
0 votes
0 answers
3 views

Transaction init and 24kb contract size limit

The yellow paper says: init: An unlimited size byte array specifying the EVM-code for the account initialisation procedure, formally Ti. Isn't contract bytecode? If it is, there is a 24kb size limit ...
user avatar
1 vote
1 answer
32 views

Is it possible to call contract that has no function?

For example I have a contract that has the following bytecode 0x433d52593df3 (contract that returns the current block number if called). How could I call such a contract?
user avatar
  • 56
0 votes
0 answers
17 views

Figure out the address used at construction time for a regular smart contract

Is there anyway to figure out what was the address used at construction time and find it in the bytecode? For example I know that for libraries they are storing it in the contract in order to be able ...
user avatar
  • 56
0 votes
0 answers
6 views

Do all optimistic rollup virtual machines need to execute EVM bytecode?

Do all optimistic rollups need to be execute EVM bytecode, because the transactions also need to be able to be executed on mainnet in case of a fraud proof? Trying to understand rollups better, any ...
user avatar
  • 1
0 votes
0 answers
20 views

How is it the case that a contract's deployed code is longer than 24.576KB given EIP 170?

The deployed code associated with the contract address 0x05c848E3547Bc3Ccd977B84140FDC917Bfff96a1 is longer than EIP 170 permits (I think?). I know I'm misunderstanding something, but am struggling to ...
user avatar
0 votes
1 answer
34 views

is there a way to extract smart contract code from bytecode?

I have deployed the smart contract into polygon mainnet but I do not have the smart contract code now, I only had the smart contract address. I have not 'verify and published ' after deploying the ...
user avatar
0 votes
1 answer
86 views

Please tell me about the solid parameter byte []. After abigen compilation, the parameter in golang becomes [] [] byte. How should I construct this?

Please tell me about the solid parameter byte []. After abigen compilation, the parameter in golang becomes [] [] byte. How should I construct this? // Multicall0 is a paid mutator transaction binding ...
user avatar
  • 1
0 votes
1 answer
38 views

How does Etherscan show perfect solidity code for a contract?

Maybe I’m just missing something but all the samples I’ve seen of taking bytecode and trying to reverse engineer it into solidity code looks quite imperfect, yet looking at Etherscan for a particular ...
user avatar
0 votes
0 answers
27 views

how to explain runtime bytecode difference

I have a contract for which I only have the runtime bytecode and I am trying to find the code that can produce the same bytecode. I am nearly there but I have one difference left in the decompiled ...
user avatar
0 votes
1 answer
71 views

What does this decompiled NFT contract source code mean?

Decompiled the bytecode of a ERC-1155 contract using EtherScan, which gave the following result. It's fairly short, which is unexpected for an NFT, so line-by-line what does this code even mean, given ...
user avatar
0 votes
0 answers
22 views

How to identify modifiers in bytecode?

To identify a function from bytecode I do something like this: >>> Web3.keccak(text="transfer(address,uint256)")[0:4].hex() # function name 0xa9059cbb And I will find a9059cbb in ...
user avatar
  • 1
0 votes
0 answers
43 views

Problem in verifying & publishing contract on ropsten.etherscan

I'm trying to verify the following smart contract on ropsten.etherscan: pragma solidity ^0.4.17; //@title Ownable //@dev The Ownable contract has an owner address, and provides basic ...
user avatar
  • 1
0 votes
1 answer
58 views

What role does ABI-encoding play in digital signature?

I have two questions regarding the ABI. 1. When does it happen? A digital signature is made by creating a transaction data structure, RLP-encoded serializing the data, hashing it through keccak-256, ...
user avatar
  • 587
1 vote
1 answer
56 views

Why is compiled bytecode about 10x larger than Solidity code?

I'm busy optimising my Solidity contract and I noticed some behaviour I don't understand. When I add the following two getter functions: function getBaseReward() external view returns (uint256) { ...
user avatar
0 votes
0 answers
110 views

Revert transaction payable error with abi.encodeWithSignature

I have two contracts: Validate.sol // SPDX-License-Identifier: MIT pragma solidity 0.8.4; contract Validate { function validate(address _verifier, bytes memory _validityData) public view { ...
user avatar
1 vote
1 answer
125 views

Why do Etherscan's opcode view and opcode disassembler show different opcodes for the USDT contract?

We have USDT smart contract, which is located at 0xdac17f958d2ee523a2206206994597c13d831ec7. I am trying to decompile the smart contract (at least view it as at opcodes). What I see is that it begins ...
user avatar
  • 123
3 votes
2 answers
703 views

How to deploy a bytecode-only contract without an ABI

I see a contract's bytecode on chain that I want to re-deploy almost verbatim, but the issue is that there's no verification -- no ABI or source code. Can I still redeploy this contract to a hardhat ...
user avatar
1 vote
0 answers
8 views

What is the best tool to decompile bytecode? [duplicate]

Decompiling directly on etherscan takes forever (Days). Need a few way to decompile, paid or otherwise
user avatar
1 vote
1 answer
176 views

Bytecode not visible for deployed contract

Below is the contract that is used to deploy other contracts using only bytecode. I tried to deploy the contract using deployBytecode function, the contract gets deployed but only 0x is showing as ...
user avatar
  • 13
1 vote
0 answers
105 views

TRYING TO VERIFY MY SOURCE CODE ON ETHERSCAN ErrorUnable to generate Contract ByteCode and ABI (General Exception, unable to get compiled [bytecode])

Compiler Warning(s): ParserError: Expected pragma, import directive or contract/interface/library/struct/enum/constant/function definition. --> myc:1:1: | 1 | "accounts": { | ^^^^^^^^^^ ...
user avatar
  • 11
1 vote
1 answer
26 views

How to know contract functionality given only bytcode and address

Let's assume that we only have access to the address and bytecode of a smart contract (pure decentralization, no 3rd party tools such as etherscan etc). How can we understand or deduce what the ...
user avatar
  • 113
2 votes
1 answer
193 views

How to view contract source code from ABI, address and bytecode?

I have the address and ABI of a contract. I can also view the bytecode from that address on Etherscan but not the source code. Is it possible to get the contract source code using these information?
user avatar
  • 31
0 votes
0 answers
75 views

How to decode a raw transaction in Python? (superfluous bytes error)

I have a raw_tx in hex format. I'm using the following code to convert it from hexstr to a readable JSON text format. The issue is that I'm receiving the following error for certain transactions: ...
user avatar
0 votes
0 answers
23 views

Verifying contract with incomplete source code?

I launched an ERC20 token, but forgot to verify it. It was a classical openzeppelin smart contract for a token with fixed supply. Problem is i've lost the initial source code. Is it possible to ...
user avatar
0 votes
1 answer
78 views

Recover Source Code with ABI & Bytecode?

I stupidly lost my smart-contract source code due to a PC crash and was unable to recover it. I have an old version saved but much of the work I've done is lost. Luckily, I have the ABI, ByteCode, ...
user avatar
  • 1
0 votes
0 answers
81 views

Two metadata hashes at the end of the bytecoe

doing my own research i saw that the metadata hash is added to the end of the bytecode and i can extract and decode it with cbor. I know that we can identify them by different ways, in this case with ...
user avatar
1 vote
1 answer
307 views

Properly parse contract creation bytecode metadata hash using cbor module in npm

I 'd like to build a smart contract verification service like etherscan. While trying some verfication test on etherscan, I get to know that deployed contract blockchain bytecode differs from ...
user avatar
  • 55
0 votes
0 answers
63 views

please help me How do you pass a struct type defined value into a function call?

I am trying to call this function that takes in a Struct as an argument. My question is how does this look like on the bytecode level? And how does solidity know when a struct begins/ends? I'm looking ...
user avatar
  • 51
2 votes
1 answer
444 views

How to verify smart contracts on different solidity versions

I'd like to build my own smart contract verify system with all solidity versions both on single file and multiple files just like what etherscan or other block explorer does. I was able to verify for ...
user avatar
  • 55
0 votes
0 answers
49 views

What does the Ethereum registry entry confirming token ownership look like?

I have read that data about token owners such as NFT on Ethereum is stored in smart contracts. However, I have not found any example anywhere of how this looks in practice. What I mean is how does the ...
user avatar
  • 1
1 vote
2 answers
109 views

Interacting with closed source contract

I am an experienced developer but relatively new to blockchain development. There is a close source contract that I can interact with via the provider's web interface. The screenshot below is the ...
user avatar
0 votes
1 answer
99 views

Does "eth_getCode" return the init bytecode or the deployed bytecode?

The Ethereum JSON-PRC spec contains an eth_getCode method, but it is not specified what is being retrieved: Init bytecode (including constructor) Deployed bytecode (without constructor) Which one is ...
user avatar
1 vote
1 answer
303 views

Storing immutable state in contract data

This post highlights how to use CREATE2 to implement smart contract state using contract data. However, the author also says: "if storage doesn’t need to change, you can do away with metamorphic ...
user avatar
1 vote
1 answer
757 views

etherscan contract verification unable to match bytecodes due to $-signs

I have a contract called Test , which uses a library called LCG. They are respectively defined in the .sol files with the same name as the contract: // SPDX-License-Identifier: GPL-3.0 pragma solidity ...
user avatar
  • 177
0 votes
1 answer
43 views

Why does the JSON ABI include additional data?

The JSON formatted ABI's have data that is not part of standard solidity ABI encoding and not necessary for interaction with contracts (EVM bytecode). The standard ABI just requires the first (left, ...
user avatar
  • 313
0 votes
0 answers
60 views

Error! Unable to generate Contract ByteCode and ABI (The bytecode being searched for is in the list of compiled contract bytecode outputs)

What's strange is the Bytecode the be searched for is right under the main .sol file... I added in the correct code, recompiled on remix worked just fine. Inserted the correct compiler version, ...
user avatar
0 votes
1 answer
146 views

Run code in transaction without deploying smart contract?

A transaction can send eth, interact with a smart contract, or deploy a smart contract. From what I've heard, when you deploy a smart contract, you are actually running constructor code which then ...
user avatar
0 votes
0 answers
66 views

Can't call method of contract using Web3?

I can call the base methods (totalSupply, name, approve, etc.) but not the custom one's I defined. I get a "[name of method] is not a function error" If I console.log the contract.methods, ...
user avatar
0 votes
1 answer
23 views

smart contract information issue

Hi I was scammed by troncase, I want to know how to get my original staking out of the smart contract. it is asking me for a userAddress_address, last_uint256, first_uint256 What do i type in those ...
user avatar
1 vote
0 answers
34 views

Transaction data for contract creation: What's the data before the contract bytecode? [duplicate]

When a contract is deployed, the bytecode of the contract shows in the raw transaction data for the transaction that created the contract, along with constructor arguments after the contract bytecode ...
user avatar
  • 103
0 votes
0 answers
50 views

Calling a function of a deployed smartcontract by my smartcontract fails, while calling it using web3.py with the same bytedata succeeds

I want to call a function of an external smartcontract using my smartcontract. I wrote the following solidity code: contract main { address public toCall = theAddressToCall; function ...
user avatar
1 vote
1 answer
143 views

Different bytecodes using solcjs and remix

Using solcjs in any contract ends up producing significantly longer bytecode that using remix For instance this simple smart contract pragma solidity >=0.8.0; contract test { uint256 public c; ...
user avatar
  • 7,805
0 votes
0 answers
158 views

Smart Contract - How to Copy or Clone it?

All - Could someone tell me if it is possible to copy or obtain a smart contract code that has been proven to work on the blockchain in the past. I have a block number and the smart contract address, ...
user avatar
  • 1
1 vote
0 answers
85 views

Unknown decompiled bytecode function

I tried to de-compiled a code from Etherscan which is not yet verified. I understood most of the part from code but I got totally confused. Can anyone tell me what this function doing. function ...
user avatar
  • 46
1 vote
1 answer
202 views

Custom bytecode logs data but doesn't return it on eth_call, why not?

I'm creating custom bytecode for a project 0x4160005260206000a0 // OP-Codes // COINBASE // PUSH1 0x00 // MSTORE // PUSH1 0x20 // PUSH1 0x20 // LOG0 when the above is created, the transaction receipt ...
user avatar
  • 113
0 votes
1 answer
61 views

Different byteCode generated between block explorer and standard json input

I have deployed a contract and want to verify it, but when I used the same code with same configurations of compiler to verify it, it gave me negative result. Thus I tried to decompile these two ...
user avatar
  • 33
1 vote
0 answers
84 views

How to look up IPFS url in Ethereum Bytecode meta data

I have a solidity contract that is deployed on the Ethereum mainnet. The contract's bytecode ended with (what I assume to be) an IPFS url {ipfs}64736f6c634300060c0033 How do I look up this URL on ipfs?...
user avatar