Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [bytecode]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
48 views

Runtime bytecode not contained in creation bytecode

I'm currently delving into EVM and contract bytecode. My understanding is that by sending a transaction to the NULL address with both the initcode and contract code, and ensuring that the init code ...
kaspyjrefluss8's user avatar
0 votes
0 answers
17 views

How find in bytecodes part of the code?

If with this code I can find the signature of a function in a solidity contract: const hash = Web3.utils.sha3(word).slice(0, 10).substring(2); How could I find another one? ex: assert(a == 0 || c / a ...
Cazs's user avatar
  • 1
0 votes
0 answers
24 views

General Exception, unable to get compiled [bytecode]

Hi I created a smart contract using Remix, I deployed the contract but now that I try to verify my contract on BscScan I keep getting the following error: Error! Unable to generate Contract Bytecode ...
Rockie Road's user avatar
2 votes
0 answers
33 views

How to deploy Tornado Cash Hasher contract to ZkSync network

I am going to deploy Tornado Cash contract to ZKSync network. In the Tornado Cash constructor, it takes an argument: Ihasher _hasher; where the Ihasher is: interface IHasher { function MiMCSponge(...
CHM's user avatar
  • 21
0 votes
0 answers
34 views

error="abi: improperly formatted output:

I have modified the bsc genesis contract and added only more function: function addValidator(address _consensusAddress) public { currentValidatorSet.push(Validator({ consensusAddress: ...
user132452's user avatar
0 votes
0 answers
16 views

How to have solidity output as minimal assembler-close bytecode as possible?

While as indicated in this answer it is probably impossible to have Solidity optimize away the free memory pointer and it's initialization causing the bytecode to start with 0x6080, I was wondering if ...
Zommuter's user avatar
  • 113
1 vote
1 answer
418 views

What solidity version is used when you give a range to the compiler e.g. pragma solidity >0.7.0 <0.9.0?

I am new to Solidity but have learned you can tell the compiler to use a range of Solidity versions e.g ^0.8.10 || > 0.7.0 < 0.9.0 when deploying smart contracts. My question is how does the ...
davidastro's user avatar
1 vote
1 answer
50 views

Retreiveing Bytecode of another smart contract through a smart contract

I am working on a project and I was wondering if its possible to retrieve the bytecode of another smart contract on Ethereum though my smart contract ? So basically, I will have a copy of that smart ...
Osama Elghazaly's user avatar
0 votes
1 answer
83 views

Determining if a smart contract is using delegatecall

Let's say that I have the bytecode of a smart contract deployed on ethereum (which I got with a call to eth_getCode). How can I programmatically determine if this smart contract uses delegatecall ...
galpo's user avatar
  • 145
2 votes
1 answer
36 views

Should all method hashes be found in a smart contract's opcodes?

I have a compiled/deployed solidity smart contract for which I have encoded all the functions signatures. (4-byte hashes) With the deployed bytecode, I have parsed the pushdata into an array for all '...
jjordan's user avatar
  • 31
0 votes
1 answer
149 views

Obtaining CFGs for individual functions with evm-cfg-builder

I am trying to obtain a Control Flow Graph (CFG) of each individual function in a Solidity contract for Machine Learning analysis purposes. I tried using evm-cfg-builder available at https://github....
PompousPompey's user avatar
1 vote
1 answer
109 views

how to verify a contract on etherscan?

thank you for your answers, but I think I'm still missing something, I don't know where to look for the elements that I don't like? does anyone have a solution please? I try with CONTRACT VERIFICATION ...
Bryce De Nyce's user avatar
4 votes
0 answers
379 views

Hardhat and foundry, contract bytecode different

I'm developing a contract in hardhat project. But now I want to write test by foundry. My problem is I'm using create2, but when running contract by hardhat and foundry they gave different addresses. ...
CT95's user avatar
  • 406
1 vote
1 answer
982 views

How to call a contract function only using function hash in ethers.js?

I would like to call a contract function, but I do not have the contract's abi. Since none of the decoders can decode the function name, the only solution I see is calling the function using its hash. ...
Nal Luksic's user avatar
  • 1,167
3 votes
1 answer
281 views

How to read private immutable field?

In solidity, immutable fields are stored on bytecode and not at the storage slot. So, if I want to query how can I do it? eg: pragma solidity >=0.7.0 <0.9.0; contract MyContract { uint ...
Abishek Bashyal's user avatar
1 vote
1 answer
34 views

can't find contract after compile successfully in remix: No Contract Compiled Yet

I compile this file in 0.4.8 successfully, pragma solidity 0.4.8; contract A { function f(uint[] arr) constant external returns (uint len) { assembly { pop arr := len }...
LEVI_104's user avatar
0 votes
2 answers
293 views

Decode ByteCode contract

How to decode a ByteCode contract on etherscan for exemple : https://etherscan.io/address/0x6b75d8af000000e20b7a7ddf000ba900b4009a80#code?
adam mr's user avatar
  • 121
2 votes
1 answer
349 views

Trying to use CREATE opcode to deploy a new contract instance using bytecode of a deployed contract

I am trying to get the bytecode from a deployed contract, then by using that bytecode, use the CREATE opcode to deploy a new instance of that contract. Here is the code I'm trying out (but to no avail)...
Allan's user avatar
  • 41
0 votes
0 answers
45 views

How to know if a smart contract is calling a function or if it is an EOA?

Some have suggested detecting the contract bytecode size but this can be spoofed in the constructor where the value will be 0 for an EOA and a contract. Then with create2 and self destruct the problem ...
Nat's user avatar
  • 279
0 votes
1 answer
176 views

Is there anyway to retrieve tokens sent to a smart contract?

I used my wallet to create a smart contract for a trading bot. Unknowingly , the code for this smart contract was for malicious intent. Once i try to withdraw from the smart contract, my tokens will ...
Jorge's user avatar
  • 1
2 votes
1 answer
143 views

Do immutable variables influence the contract bytecode?

Suppose you have a contract like this: pragma solidity >=0.8.19; contract Bar { uint256 public immutable value; constructor(uint256 value_) { value = value_; } } Will Bar ...
Paul Razvan Berg's user avatar
0 votes
1 answer
321 views

Constructor arguments from EVM bytecode

I have a contract that results to the following bytecode: ...
oyinda david's user avatar
1 vote
1 answer
165 views

Get bytecode offset(entrypoint) for the function in solidity contract

Suppose, I have the following source code: contract Test { function add(uint a, uint b) public returns(uint) { return a + b; } } And bytecode after compilation: ...
shermike's user avatar
0 votes
0 answers
40 views

where is the bytecode of an unverfied smart contract in etherscan?

Why is the bytecode of the previously unverified smart contract missing from Etherscan? We can view the bytecode of the unverified smart contract before. But now we can't even see the 'contract' tag ...
Fogg lee's user avatar
1 vote
2 answers
42 views

Can't find deployment bytecode for contract created from factory - How to retrieve it?

I have a factory contract that deploys child contracts, to complete a challenge on Ethernauts. I would like to retrieve the deployment bytecode for one of the child contracts, but I'm having trouble ...
Danny B's user avatar
  • 323
0 votes
0 answers
76 views

Unable to use a function from imported library

I'm trying to import and use a library to verify ring signatures. On doing so I'm getting an error while loading smart contract using w3.eth.contract(abi=abi, bytecode=bytecode). ValueError at /sc/...
P S's user avatar
  • 101
1 vote
1 answer
30 views

Can someone explain to me how returns work under the hood in solidity?

Can someone explain how I will be successfully able to return this function reddish(uint256 _red) public view returns (bytes memory) { bytes memory err = abi.encode(msg.sender, _red); assembly ...
Malik Aremu's user avatar
0 votes
1 answer
71 views

Getting execution bytecode from trace_addresses

Given the following call graph: A CALLs B CALLs G CALLs C CALLs G Is it possible to get the full bytecode that was executed by the evm as a single string, given the bytecode of the ...
Biela Diela's user avatar
3 votes
3 answers
3k views

How do i deploy a contract on chain using bytecode

I'd like to deploy a smart contract that can take in bytecode as the argument and deploy that contract. Currently, the only way I see examples of is that they take a specific contract that is already ...
bpop's user avatar
  • 33
1 vote
1 answer
266 views

How to compile with --bin option in solcjs?

I want to compile using --bin option because I want to get to see the bytecode of the compilation. Using solc I know it is something like this: solc --bin How can I achieve this using solcjs?
Falcon Stakepool's user avatar
1 vote
1 answer
250 views

Grab last 12 bytes of a bytes32

How do I grab the last 12 bytes of a bytes32 in assembly? For example, the last 12 bytes of bytes32 num = 0xdeb02111e4e5fa8c7c05e983a3446893a36d12ad6d79206163636f756e740000 Thanks!
dNyrM's user avatar
  • 918
2 votes
1 answer
29 views

Initializing Stuct

I would like to know if it is considered good practice initializing a struct when instantiating it or if it is just equally good to initialize its content right after instantiating it. In other words, ...
Alberto Molina's user avatar
1 vote
1 answer
432 views

How to get ABI from a public bytecode of a proxy contract (ERC1967Proxy)?

am trying to write a custom interface for a public smart contract not owned by me. The contract used in official docs of the project is this ERC1967Proxy contract. ABI of that is not really useful and ...
bihinchee's user avatar
3 votes
2 answers
1k views

Difference between `bytecode` and `deployedBytecode` (especially for contracts with constructor args)

Suppose I have a contract like pragma solidity ^0.8.17; contract MyContract { constructor(string arg1, uint arg2) { ... } ... } When I compile the solidity contract (actually ...
ywat's user avatar
  • 217
0 votes
1 answer
1k views

Contract verification Failed

I have two contracts Pool and PoolConfiguration, when deploying them to goerli test they both deploy successfully but when verifying on etherscan PoolConfiguration fail to verify and drops this error :...
noro meb's user avatar
  • 368
3 votes
2 answers
2k views

How to decode the output of an eth_call that returns a Tuple[]

I am developing a low-level library that interacts with RPC nodes directly. There is a requirement to call the AaveV2 getAllReserveTokens function, and I want to decode the output data. The particular ...
pestopasta's user avatar
5 votes
3 answers
2k views

Where are the smart contract constants stored?

I want to double-check something. I had been writing upgradable smart contact that uses a lot of constants. As far as I can see, smart contracts aren't storing constant variables in their storage. ...
Sky's user avatar
  • 2,322
4 votes
1 answer
392 views

Where are internal functions in bytecode?

I recently deployed a test contract on Ethereum that more or less just had a bunch of internal functions. On etherscan, decompling the bytecode I did not see these internal functions being listed. So.....
spongyball322's user avatar
0 votes
1 answer
115 views

JS Compiler into Solidity

Is there a transpiler that takes JS and spits out Solidity? If yes where, if not why not? I was thinking of creating a library that does this to help write smart contracts in JS if it doesn't already ...
Amu Varma's user avatar
1 vote
0 answers
39 views

Why two different source code generate same control flow graph in ethereum smart contract?

I analyzed control flow graph of two contracts written in solidity with different source code, one having vulnerability and other after resolving it. https://swcregistry.io/docs/SWC-107#modifier-...
Rue Lawliet's user avatar
0 votes
0 answers
99 views

Difference in Control Flow Graph (CFG) of bytecode having vulnerability and after fixing the vulnerability in Ethereum smart contract?

I was analyzing the Control Flow Graph (CFG) extraction from ByteCode by EtherSolve and then thought about an interesting question, how CFG of vulnerable smart contract gets changed after fixing this ...
Rue Lawliet's user avatar
0 votes
1 answer
35 views

What is a0(padded to 32bytes) and 2(padded to 32bytes) in the bytecode?

I was exploring about bytecode and came across a sample transaction mentioned in a Medium article. The issue is that I couldn't understand what do the 2 bytecodes mean in the Input Data bytecode below:...
Junior's user avatar
  • 3
0 votes
1 answer
52 views

Feasibility for Vulnerability Detection in Smart Contracts

I am excited to find out which is more feasible for vulnerability detection in ethereum smart contracts(solidity): Source Code or ByteCode and what's the reason?
Rue Lawliet's user avatar
5 votes
1 answer
3k views

Is it possible to get the "creation bytecode" of an already deployed contract in Solidity?

I am looking to get some already deployed code working for myself. With ethers.js I can get the bytecode in the following way ethers.getCode("CONTRACT ADDRESS") However, this is a ...
zen's user avatar
  • 51
3 votes
1 answer
278 views

Does importing other contracts affects my contract's size?

If I have Contract B{ ... } Contract A{ B b; ... } Does A's contract size equals to B's contract size plus A's other implementation? or does it only increased by the size that b object takes?...
matank001's user avatar
  • 820
1 vote
1 answer
122 views

how can i check hashcode and th amount

I'm new in Solidity, therefore if I have a wrong concept of anything kindly do explain. I'm working for a personal escrow smart contract that should include these functions: 1- function deposit from ...
Yazan Arafat's user avatar
0 votes
1 answer
4k views

Is there a way to get solidity code from bytecode [duplicate]

Recently I had used solidity optimizer. And after reading more about how it works I was interested in trying to go deeper. One of the things I wanted to do was to see how the "solidity" code ...
Sky's user avatar
  • 2,322
1 vote
2 answers
253 views

Could anyone help me with this Solidity Fibonacci challenge please?

What is the shortest runtime bytecode you can write for a contract that satisfies both the following: Accepts calldata of length 32 bytes representing one uint256 (no function selector) Returns, as ...
Vidhan Mangla's user avatar
2 votes
1 answer
32 views

How does Ethereum / the EVM know not to execute metadata/auxdata?

I have a contract as such: // SPDX-License-Identifier: MIT pragma solidity 0.8.15; contract SSimpleStorage { uint256 storedNumber; function storeNumber(uint256 newNumber) external { ...
Patrick Collins's user avatar
1 vote
0 answers
73 views

Why am I not able to access the storage of a contract deployed with bytecode?

I'm learning about EVM and I was trying to write a simple smart contract using bytecode only. What the contract is supposed to do is write the number 202 to storage slot 0 read from the storage and ...
Rodrigo Pina's user avatar

1
2 3 4 5