Questions tagged [bytecode]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
2answers
45 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
14 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
56 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 ...
0
votes
0answers
30 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
20 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
16 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
17 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
16 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
16 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
17 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
32 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
32 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
40 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
22 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
79 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
21 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
27 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
630 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
34 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 ...
2
votes
1answer
81 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
41 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
22 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
377 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
37 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?
0
votes
0answers
15 views

How to deploy a compiled stateless contract and which doesn t have creation code/transaction?

I got a deployed contract bytecode from an internal project which I d like to publish on the mainnet. The problem is it s just the bytecode without the creation code. Is there a simpler way to deploy ...
8
votes
2answers
966 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
35 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
95 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
74 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
129 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
0answers
79 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
694 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
45 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?
7
votes
4answers
657 views

ABI and Bytecode stored inside Contract

I was scrolling around Ethereum StackExchange and I came across with an interesting thought that I have never read or seen anyone talk about. I'm perfectly aware of how contracts work and are ...
0
votes
1answer
44 views

Why won't a Byte code generate for the below code? The Byte code is not generating in the contract details

pragma solidity ^0.4.24; // ---------------------------------------------------------------------------- // 'NicePoints' token contract // // Deployed to : 0xb9447Ca592c68d56EE481D5D12aDf11DB1008A72 /...
2
votes
1answer
103 views

Map Bytecode of Function to Function Within Entire Bytecode

Is it possible to distinguish a functions bytecode out of an entire contracts bytecode? For example, when I pull the bytecode from a contract address, I get something like: ...
1
vote
1answer
20 views

How do I send funds from a contract to an account using bytecode?

The instruction CREATE will send funds to a new account. Is there another instruction for sending funds to an account that already exists? Or I just have to use CREATE as if the account doesn't exist?
2
votes
1answer
491 views

web3.eth.getCode doesn't return the data shown on etherscan

For example, let's take contract address 0xdac17f958d2ee523a2206206994597c13d831ec7. Does anybody have an idea why the following two are totally different: The string returned from await web3.eth....
0
votes
1answer
390 views

Calling contract functions using only ABI without source code

I have MyContract.json file of some contract(assume i haven't its source code). In .json file, there is abi and bytecode. If i want to deploy such contract (through web3js), I am facing following ...
0
votes
1answer
120 views

Get Contract Address by It's ByteCode

I have some bytecode and would like to find the contract address that it belongs to. Is there an easy way to do this?
2
votes
0answers
51 views

Why is it required to know the function selector in a smart contract to call the function? [duplicate]

I understand what a function selector is and how it is computed: The first four bytes of the call data for a function call specifies the function to be called. It is the first (left, high-order ...
10
votes
1answer
3k views

What is the difference between bytecode, init code, deployed bytedcode, creation bytecode, and runtime bytecode?

I constantly see different types of bytecode and do not know what each of them are. What are the differences between bytecode, init code, deployed bytedcode, creation bytecode, and runtime bytecode?
0
votes
1answer
86 views

EVM Stack - number of elements

The words in the stack are 256-bit, therefore 32 bytes in hexadecimal representation. The Ethereum Yellow Paper states “the stack as a size of 1024”, although it does not say what (bits/words). A ...
1
vote
1answer
339 views

Can I deploy smart contract written in an older version of solidity ? If yes how to recognize it in EVM?

If I can compile a smart-contract written in an older version say 0.1.3, can I still deploy it? If I can, is there a way to look at EVM bytecode and tell that this smart contract is written with an ...
2
votes
1answer
455 views

How to construct deployable bytecode from runtime bytecode?

For example I want to redeploy/clone a contract to another address but don't have the original source code, so I only have the runtime bytecode stored on the blockchain. If I try to deploy the runtime ...
0
votes
3answers
121 views

Is it possible to find out dynamic array size looking at a smart contract?

This question already answers that in order to get the size of an array programmaticaly, a getter should be defined. However, assuming that there isn't a getter, is there a way to find out size of a ...
0
votes
1answer
60 views

What is the purpose of ISZERO?

I found that ISZERO is an opcode but I can't find what is the purpose of ISZERO. Can somebody please guide me what is the purpose of ISZERO? Zulfi.
0
votes
2answers
180 views

Remix: This contract does not implement all functions and thus cannot be created

I'm new here and code with openzeppelin framework 2.2.0. There is no error occurred when compiling with solidity 0.5.8. But when I'm going to deploy the contract, I have no bytecode and cannot ...
1
vote
1answer
2k views

Deploying contract using byteCode

In that example you can see, how to deploy a new contract having just ABI and ByteCode (uses for copy and deploy contracts from mainnet to your testnet for example). /****** Deploying new contract ...
2
votes
0answers
358 views

Etherscan verification bytecodes don't match

Hi I'm trying to verify a token deployed at 0x87ab739464881af0011052d4ca0b0d657e8c3b48 in tx 0xbaa8f3fe86a35d2e0b7ed16b24782743e7dfb1eb21cfbb12253d0a50ef2ff365. (Mainnet) I compiled and deployed it ...