Questions tagged [bytecode]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
266 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 ...
0
votes
0answers
16 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 { ...
2
votes
2answers
106 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
1answer
21 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 ...
5
votes
2answers
348 views

What is the purpose of extcodecopy?

I am wondering, what is the purpose of the EXTCODECOPY bytecode instruction? I don't see any advantage in copying the code of another contract in memory. I am a little bit confused, because of the ...
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
56 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
25 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
11 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 ...
4
votes
2answers
958 views

Run EVM Code outside the Blockchain

is there any way to execute functions on a smart contract (as EVM-Bytecode) in a separate program like evm (provided by go-ethereum) without having to run a test-network? I need to find a way to run ...
1
vote
1answer
25 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
18 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
18 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 ...
2
votes
1answer
696 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/...
3
votes
1answer
161 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 ...
0
votes
1answer
25 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
1answer
125 views

How to tell the contract deployed size? (Error: The contract code couldn't be stored, please check your gas amount.)

I get Error: The contract code couldn't be stored, please check your gas amount. whenever I deploy to any test network (rinkeby, ropsten) or the live network. Deploy to a local Ganache works perfect. ...
3
votes
1answer
651 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?
0
votes
0answers
18 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
103 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 ...
1
vote
1answer
136 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
30 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 ...
2
votes
2answers
180 views

Ethereum Bytecode

Why does Ethereum store bytecode on the blockchain and not the sourcecode, what's the tradeoff? As far as I know sourcecode does not need as much storage.
6
votes
1answer
2k views

How is an ABI stored in bytecode?

I'm trying to understand how a simple hex string like 0x25d8dcf2 is enough information to execute a function in a contract. I've read up on the ABI and understand that the hex string is basically just ...
1
vote
1answer
230 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
34 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 ...
0
votes
1answer
2k views

Can not verify contract on etherscan.io “Error! Unable to generate Contract ByteCode and ABI”

I am getting the error "Error! Unable to generate Contract ByteCode and ABI" When I try to verify this code. I have split it into two pieces as I import it but not sure how to include it all in ...
1
vote
2answers
73 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
2answers
51 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?
2
votes
3answers
2k views

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

Is it possible to get the bytecode of an already deployed contract from another contract? Example: get bytecode of contract A using contract B in Solidity.
0
votes
1answer
24 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
142 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
289 views

Is it possible to get bytecode from the evm in golang?

Imagine this scenario, I have a contract that has a function where I call with runtime.Call(). But this function returns an address of a newly created contract, but not the bytecode as runtime.Create ...
0
votes
1answer
28 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
25 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, ...
1
vote
1answer
3k 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 ...
0
votes
1answer
47 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 ...
5
votes
3answers
14k views

Error! Unable to generate Contract ByteCode and ABI

Having issues verifying my token contract on etherscan.io. Receiving the following errors: Note: Contract was created during Txn# Result: Does not match the input creation bytecode found at this ...
0
votes
0answers
21 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, ...
1
vote
1answer
70 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
1answer
19 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 ...
0
votes
3answers
364 views

where is the abi stored for a contract?

once a contract is compiled and deployed to the blockchain, it stores the 'runtime bytecode' in the blockchain (as I understand). but to invoke the functions of a contract by an EOA, it requires ABI ...
7
votes
4answers
878 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 ...
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
41 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 ...
13
votes
1answer
4k 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
607 views

Can I find constructor arguments from truffle artifact?

I'm in the process of verifying my contract on Etherscan. Etherscan asks for ABI-encoded constructor arguments during the verification process, though I was a bit silly and don't quite know what they ...
0
votes
0answers
85 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
44 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
136 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 ...