Skip to main content

Questions tagged [bytecode]

The tag has no usage guidance.

56 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4 votes
0 answers
391 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
4 votes
3 answers
1k views

How to deploy contract with bytecode from etherscan?

For example, I want to deploy a contract to my local testnet. But I only have its opcode from etherscan. How to deploy the contract with just those runtime bytecode?
user avatar
4 votes
0 answers
530 views

Is there an app to read QR code of smartcontract bytecode and trigger it?

I want to know if there is a workaround for a smartphone user to simply scan a QR code that would trigger a transaction using a custom smartcontract (not a native currency). The contract would behave ...
Etienne's user avatar
  • 173
3 votes
1 answer
798 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 ...
Kapol's user avatar
  • 149
3 votes
0 answers
144 views

Is there any reference on writing contracts directly with the bytecode language?

It would be great to have a complete reference of all the opcodes available, their exact effects and costs, and an example "Hello World" in ethereum assembly. Edit: this question isn't a duplicate of ...
MaiaVictor's user avatar
  • 3,177
2 votes
0 answers
36 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
2 votes
0 answers
458 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): ...
Patrick Collins's user avatar
2 votes
2 answers
1k 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?
zerb's user avatar
  • 31
2 votes
1 answer
2k 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/...
Ender's user avatar
  • 265
2 votes
0 answers
834 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 ...
Jordi Estapé Canal's user avatar
2 votes
0 answers
80 views

What is the methodID for SafeMath function when SafeMath library is referenced internally?

For the contract below contract Example { using SafeMath for uint256; uint256 internal _amount; function example(uint256 amount) external { _amount = _amount.add(amount);...
cyberstrome's user avatar
2 votes
0 answers
234 views

STOP after RETURN in bytecode generated by solidity

I am currently analyzing the code generated by the solidity compiler. Let's take this simple example: pragma solidity^0.4.24; contract test { constructor() public { } } The code generated with ...
Briomkez's user avatar
  • 1,894
2 votes
0 answers
61 views

What is the command PUSH29 010..00 in solidity compiled bytecode?

If you take a look to the bytecode of several contracts compiled from solidity you can notice that in the first ".data" basic block there is this command: PUSH29 ...
Briomkez's user avatar
  • 1,894
2 votes
0 answers
66 views

Compiling from remix onto geth console

I found how to deploy a contract onto MEW, but I do not understand, partially due to meta references and missing/assumed knowledge. I'm just looking from help on a walk through. I'm including the ...
blc's user avatar
  • 41
2 votes
0 answers
317 views

"queue limit" error

I try to deploy a smart contract and every time i receive "queue limit" error. Here is what i do: Web3 = require("web3") web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545")); ...
Questioner's user avatar
  • 2,680
2 votes
1 answer
591 views

verifying code deployed with web3.js

I am deploying my smart contracts using web3.js and compiling the code using solc. The contracts are deployed successfully with no issues however I am having a bit of a problem in verifying my ...
Zaid Amir's user avatar
  • 322
1 vote
1 answer
167 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
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
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 vote
0 answers
199 views

Find metadata URL from EVM bytecode

Currently, I am looking for a way to extract the metadata.json file URL from the ethereum bytecode. I have referred to this doc and figured out that metadata mapping is stored CBOR-encoded manner. ...
Sajitha Liyanage's user avatar
1 vote
0 answers
221 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": { | ^^^^^^^^^^ ...
zack's user avatar
  • 11
1 vote
0 answers
340 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 ...
Víctor Hernández's user avatar
1 vote
0 answers
209 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 ...
kishan's user avatar
  • 56
1 vote
0 answers
146 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?...
Barney Chambers's user avatar
1 vote
0 answers
44 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 ...
Kalev Maricq's user avatar
1 vote
0 answers
248 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 ...
jonasgeb's user avatar
1 vote
1 answer
144 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?
alandefreitas'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
25 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
0 votes
0 answers
36 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
0 votes
1 answer
152 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
0 votes
1 answer
182 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
0 votes
1 answer
331 views

Constructor arguments from EVM bytecode

I have a contract that results to the following bytecode: ...
oyinda david'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
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
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
0 votes
1 answer
116 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
0 votes
0 answers
101 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
100 views

The Get Functions of ERC1820 (added in genesis file) not working correctly on Quorum

Because I cannot deploy the magic ERC1820 directly to my private Quorum Network, I must add it to the genesis file like this: "0x1820a4b7618bde71dce8cdc73aab6c95905fad24": { "...
Majd TL's user avatar
  • 3,237
0 votes
1 answer
459 views

Does address.code return runtime or creation code

You have three options to retrieve bytecode: type(C).runtimeCode which returns the runtime code of a contract, type(C).creationCode which returns the creation code of a contract and address.code which ...
Luex's user avatar
  • 61
0 votes
0 answers
33 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 ...
maxime's user avatar
  • 106
0 votes
0 answers
62 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 ...
struggling170's user avatar
0 votes
1 answer
288 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 ...
user610620's user avatar
  • 1,528
0 votes
0 answers
320 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 { ...
ML_DL_RL's user avatar
0 votes
0 answers
63 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 ...
Mr. X's user avatar
  • 1
0 votes
1 answer
27 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 ...
Melshun Mclemore's user avatar
0 votes
0 answers
73 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 ...
jacksino's user avatar
0 votes
0 answers
289 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, ...
Karl A's user avatar
  • 1
0 votes
1 answer
138 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 ...
llp's user avatar
  • 33