Questions tagged [bytecode]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
4
votes
3answers
1k views

Method ID for a Solidity generated getter function

In solidity, the bytecode for functions is taking the web3.sha3 value of a function name and taking the first 4 bytes of the resulting hash in the format of 0x00000000 So if you have a function ...
0
votes
1answer
324 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
9 views

How to get bytecode in Java (all programmatically)?

I am trying to generate a bytecode to deploy a contract to ethereum. I have included node.exe as resource and try to install solcjs programmatically in node, but unfortunately i am stuck. My current ...
0
votes
0answers
27 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 ...
0
votes
1answer
742 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
1answer
162 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 ...
4
votes
1answer
30 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://...
4
votes
2answers
1k 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 ...
1
vote
1answer
21 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
22 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 ...
1
vote
1answer
111 views

It is 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 ...
4
votes
2answers
104 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
1answer
112 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. ...
0
votes
0answers
29 views

Can I get a deployable bytecode from a contract?

In my truffle build files there are two types of bytecode for each contract: bytecode deployedBytecode web3.eth.getCode returns only the 2nd one. Can I access the original bytecode from web3? It ...
0
votes
1answer
25 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?
4
votes
2answers
1k views

Contract code size (and how to work around it?)

I'm writing some rather substantial Solidity smart-contracts, and believe I'm hitting the EIP170 24k bytecode size limit. I've already (a) factored my code into libraries (b) today split my ...
7
votes
4answers
119 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
1answer
90 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 ...
3
votes
1answer
334 views

Contract is sent and gets an address, but eth.getCode returns 0x

I'm trying to deploy a contract on a private blockchain network. My solidity code has a lot of variables used in it. The deployment does give me a contract address, however, when trying to retrieve ...
0
votes
1answer
37 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
47 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
10 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
91 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
45 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
2answers
210 views

Is it possible to recreate the deploy bytecode of a contract in solidity?

So I'd need something like the GetCode.at(address) function presented in the official doc: https://solidity.readthedocs.io/en/v0.5.0/assembly.html#example but which allows me to deploy that contract ...
0
votes
1answer
40 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?
0
votes
2answers
90 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 ...
2
votes
0answers
19 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 ...
3
votes
1answer
329 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
0answers
15 views

Pulling EVM Bytecode of Contract Address [duplicate]

Is there a way to pull the EVM bytecode of a given contract address? Using Web3 perhaps? I believe using the web3.eth.Contract command may get access to the contract, but I am specifically looking ...
0
votes
3answers
50 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
32 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
102 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 ...
1
vote
1answer
58 views

“Difficulty” opcode pushes always 0x0 to stack

Currently, I do some experiments with Geth-EVM and opcode execution. During the experiments, I observed that the DIFFICULTY opcode always pushs 0x0 to the EVM stack regardless of how I set the ...
0
votes
0answers
51 views

Why would I use interfaces in this case?

I see suggestions here and there to import an interface instead of the whole contract to reduce contract's bytecode and deployment costs. Consider the following structures: contract Storage { ...
1
vote
2answers
240 views

How does Etherscan.io figure out constructor arguments without contract verification

Recently, I've seen that Etherscan is able to automatically figure out passed constructor arguments. how were they able to figure it out?
0
votes
1answer
40 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.
1
vote
3answers
76 views

Understand a smart contract semantics

I am writing to understand a smart contract which seems quite "meaningless" to me. The contract is at (https://etherscan.io/address/0xd4fa166d5ffe8f78230fc05e6850881dc08b2da2#code) but indeed over ...
0
votes
1answer
524 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 ...
1
vote
0answers
170 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 ...
1
vote
1answer
63 views

EVM bytecode debugging jumps

How can i determine forehand the destination of JUMP for which there is no PUSH instruction thst preceeds it and the entries in the code where they where set, when analysing the bytecode? I looked ...
1
vote
1answer
559 views

Deploying contract byte code via assembly

I'm trying to write a smart contract which will deploy byte code using assembly op_code create. I'm following this post. But when I call deployCode function I got nothing. Ropsten etherscan tells me ...
0
votes
1answer
32 views

How to remove byte code of deployed smart contract which was deployed using Ropsten Test Network?

I 've deployed my smart contract on Etherscan using Ropsten Test network. I can see there is bytecode for my deployed contract on ropsten etherscan. I want to hide or don't want to show the bytecode ...
2
votes
2answers
84 views

Where is the contract bytecode stored when a contract creates a contract?

When a contract creates a contract, where's the new contract's bytecode stored? For example: This Maker contract was created by their deployment contract: https://etherscan.io/address/...
-1
votes
1answer
285 views

How can I compile my smart contract from an API using solc?

I want to compile my solidity code (smart contract) inside my node.js API using the solc library to get the ABI and bytecode of my solidity. What I want in details is an input that can read solidity ...
1
vote
2answers
126 views

verify and publish when using oraclize?

I'm using oraclize in my contract. import "github.com/oraclize/ethereum-api/oraclizeAPI.sol"; When I go to verify and publish on etherscan I get this error myc:4:1: ParserError: Source "github.com/...
1
vote
1answer
74 views

What does `JUMP [out]` stand for in Remix IDE?

After compiling this contract: pragma solidity ^0.4.25; contract Simplest { constructor() public { } function two_paths(bool _a) public pure returns (uint) { if (_a == true) { ...
2
votes
0answers
51 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);...
1
vote
1answer
92 views

get bytecode in smartcontract ? possible?

is it possbile to get bytecode of already deployed contract on another contract? example : get bytecode of contract A using contract B (using solidity )
1
vote
1answer
258 views

ERC20 Bytecode for Main net

I'm trying to Deploy my ERC20 contract in Ethereum main net, but I'm not sure about the bytecode. I have seen a lot of tutorials but nobody tell something about uploading on main net and bytecode ...