Questions tagged [bytecode]
The bytecode tag has no usage guidance.
227
questions
0
votes
0
answers
19
views
etherscan api not returning contract bytecode for some contracts
For some contracts, the Etherscan api returns empty bytecode (0x). For example for:
8AB399CBB9FDB9A36518A7E7EDDF89158E56C595 (even though the contract exists: https://etherscan.io/address/...
0
votes
1
answer
32
views
smart contract code tracking
Good afternoon. I want to make the smart contract code publicly available, how to track patterns of parts of the bytecode, and so that when they appear somewhere I know about it. what tools do I need ...
1
vote
1
answer
26
views
Looking for comprehensive documentation for Solidity-generated bytecode
I'm currently working on analyzing the bytecode of smart contracts generated by Solidity. While examining the bytecode, I've encountered various opcodes and structures that I need to understand in ...
1
vote
1
answer
49
views
Try to verify a deployed Contract without the setting of optimizer
I deployed a contract one year ago, it works well and now I want to verify it to public code to the client, but the problem is: I can't remember what I set in the optimizer setting before. I tried ...
1
vote
1
answer
39
views
Question about SLOAD and JUMP/JUMPI in EVM Bytecode
I have a question about the behavior of EVM bytecode. When an SLOAD instruction is executed and the next opcode is a JUMP or JUMPI, can the value pushed onto the stack by the SLOAD be considered a ...
0
votes
1
answer
121
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 ...
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 ...
0
votes
0
answers
28
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 ...
2
votes
0
answers
50
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(...
0
votes
0
answers
50
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: ...
0
votes
0
answers
17
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 ...
1
vote
1
answer
516
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 ...
1
vote
1
answer
51
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 ...
0
votes
1
answer
104
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 ...
2
votes
1
answer
47
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 '...
0
votes
1
answer
163
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....
1
vote
1
answer
122
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 ...
4
votes
0
answers
500
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. ...
1
vote
1
answer
1k
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. ...
3
votes
1
answer
338
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 ...
1
vote
1
answer
35
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
}...
0
votes
2
answers
470
views
Decode ByteCode contract
How to decode a ByteCode contract on etherscan for exemple : https://etherscan.io/address/0x6b75d8af000000e20b7a7ddf000ba900b4009a80#code?
2
votes
1
answer
466
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)...
0
votes
1
answer
203
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 ...
2
votes
1
answer
199
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 ...
0
votes
1
answer
399
views
Constructor arguments from EVM bytecode
I have a contract that results to the following bytecode: ...
1
vote
1
answer
188
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:
...
0
votes
0
answers
41
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 ...
1
vote
2
answers
52
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 ...
0
votes
0
answers
82
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/...
1
vote
1
answer
31
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 ...
0
votes
1
answer
76
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 ...
3
votes
4
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 ...
1
vote
1
answer
312
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?
1
vote
1
answer
267
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!
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, ...
1
vote
1
answer
505
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 ...
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 ...
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 :...
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 ...
6
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.
...
4
votes
1
answer
446
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.....
0
votes
1
answer
131
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 ...
1
vote
0
answers
43
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-...
0
votes
0
answers
109
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 ...
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:...
0
votes
1
answer
54
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?
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 ...
3
votes
1
answer
336
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?...
1
vote
1
answer
142
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 ...