Questions tagged [bytecode]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
22 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, ...
1
vote
1answer
25 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) { ...
0
votes
0answers
20 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 { ...
1
vote
1answer
23 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 ...
2
votes
2answers
139 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 ...
1
vote
0answers
7 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
1
vote
1answer
66 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 ...
1
vote
0answers
32 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": { | ^^^^^^^^^^ ...
1
vote
0answers
12 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 ...
1
vote
1answer
27 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?
0
votes
0answers
23 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: ...
0
votes
0answers
19 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 ...
0
votes
1answer
28 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, ...
0
votes
0answers
22 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 ...
1
vote
1answer
160 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 ...
0
votes
0answers
40 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 ...
1
vote
1answer
261 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 ...
0
votes
0answers
37 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 ...
1
vote
2answers
76 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 ...
0
votes
1answer
27 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 ...
1
vote
1answer
156 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 ...
1
vote
1answer
122 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 ...
0
votes
1answer
29 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, ...
0
votes
0answers
29 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, ...
0
votes
1answer
53 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 ...
0
votes
0answers
23 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, ...
0
votes
1answer
20 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 ...
1
vote
0answers
23 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 ...
0
votes
0answers
43 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 ...
1
vote
1answer
77 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; ...
0
votes
0answers
93 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, ...
1
vote
0answers
49 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 ...
1
vote
1answer
141 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 ...
0
votes
1answer
35 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 ...
0
votes
0answers
58 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?...
1
vote
1answer
1k views

Why I am not able to decompile this contract?

I wanted to decompile this, contract but for some reason the output saying only: No regular functions. That's it. Here is the full output: # # Panoramix v4 Oct 2019 # Decompiled source of bsc:...
1
vote
0answers
36 views

Smart contract copying code beyong code length

I've seen a couple smart contracts (eg the contract decompiled in this answer) use this pattern: Code[Code.Length:Code.Length+x] This surprised me because I would expect Code.Length to mark the end of ...
3
votes
1answer
167 views

Cannot verify Contract - bytecode has small difference

I forgot to verify the ERC20 token contract after deploying it. Now after 5 months, Im doing it again and completely forget which compiler and if I accidently change anything on the code. After ...
0
votes
1answer
62 views

EVM bytecode instrumentation

How can I instrument the EVM bytecode for runtime monitoring? Is there any technique or implementation for that?
0
votes
1answer
30 views

Do different clients use different amounts of gas?

I'm trying to understand clients/nodes a bit can someone help clarify the below for me. My understanding is that each client implements the EVM in their own way. Smart contracts are written in ...
2
votes
1answer
741 views

How to get "Contract creation code" when it's not verified yet?

Is there any possibility to get the "creation bytecode" of the contract when it's not yet verified? I have a token smart contract: https://ropsten.etherscan.io/address/...
0
votes
0answers
61 views

How does ecrecover get compiled?

How does ecrecover() in solidity work? Looking at ethervm.io there doesn't seem to be an opcode for ecrecover? To what bytes is a ecrecover() call compiled?
8
votes
2answers
1k views

Deploy pre compiled bytecode using truffle migrations deployer api

I want to deploy pre-compiled Smart Contract bytecode using Truffle migrations. Specifically, it is the Uniswap V2 Factory contract. In the Uniswap V2 documentation there is a cliffhanger, where they ...
0
votes
1answer
46 views

Interacting with Bytecode

Is it possible to interact with a smart contract with bytecode only (without ABI)? If yes, how can I do this?
1
vote
0answers
122 views

How to separately optimize bytecode?

This question is regarding the bytecode-optimizer of the solidity-compiler, not the yul-optimizer: Is there any way to separately optimize bytecode? Normally the solidity-compiler optimizes the ...
4
votes
1answer
84 views

What kind of bytecode is it in etherscan.io?

I have read some contracts from etherscan.io, and here are something that I don't understand: Why there are some contract addresses that do not have contract source code? Here is an example:https://...
2
votes
1answer
192 views

How to pass constructor parameters to solc?

I'm trying to compile a Smart Contract to bytecode using solc. I'm on a Ubuntu VM so I have to rely on a simple-to-install cmd line application. Compilation works fine but it seems like I can't pass ...
3
votes
1answer
166 views

What is the purpose of DUP1 at the beginning of contact creation bytecode?

I am trying to analyse the bytecode of creating a contract and I can't figure out why there is a need for the 006 DUP1 opcode in the snippet below. 000 PUSH1 80 002 PUSH1 40 004 MSTORE 005 CALLVALUE ...
4
votes
2answers
1k views

Function to execute raw bytecode in EVM

Suppose, I have the following bytecode (0x610101610102016000526001601ff3) that pushes two numbers to the stack, adds them and returns the value. Now I want to write a function in Solidity that will ...
0
votes
2answers
52 views

Bytecode: Does it Reveal What Language it Was Programmed In?

Does EVM bytecode have some indication to what high-level language it was programmed in?