Skip to main content

Questions tagged [bytecode]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
268 views

Geth Error: Cannot access contractAddress from the transaction receipt

I am trying to instantiate contracts via the geth console. Here are the instructions I am running: var bytecode = "0x6003600501600202600055" var createTx = eth.sendTransaction({ from: eth.accounts[...
0xsegfault's user avatar
  • 1,260
1 vote
2 answers
478 views

What is the size of byte code stored in the EVM?

Generally, what is the size of the bytecode stored in the EVM. I mean the approx average value of it or bytecode of a simple hello world program (setting and getting a string). On what factors this ...
Kartikey'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
9 votes
2 answers
1k 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 ...
Briomkez's user avatar
  • 1,894
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
1 answer
381 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) { ...
Peteris's user avatar
  • 1,005
2 votes
1 answer
1k views

Transfer function gas limit, why 2,300?

I read in the literature that the limit for a Solidity transfer function is 2,300 gas units, because it prevents possible threats like reentrancy, etc. However, I cannot understand why exactly 2,300 ...
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
3 votes
1 answer
1k views

How does a contract's constructor work and load input values?

I set up the following contract: pragma solidity ^0.4.25; contract Simplest { uint x; constructor(bool _lucky) public { if (_lucky == true) { x = 7; } else { ...
Peteris's user avatar
  • 1,005
4 votes
1 answer
2k views

Understanding how a simple contract breaks into bytecode

I'm trying to understand how contracts look in terms of bytecode and struggling to do that just based on the yellow paper. In particular, consider the following empty contract: pragma solidity ^0.4....
Peteris's user avatar
  • 1,005
5 votes
1 answer
5k views

How to get byte code from deployed contract in

I want to get the byte code of a deployed contract. How can I get it? Is there a special function in web3.js? I haven't found any.
Stepan Poperechnyi's user avatar
1 vote
1 answer
534 views

ERC20 verification for arbitrary address

I'm trying to verify if an arbitrary contract complies ERC20. While doing so I'm checking if the contract code has the following markers: totalSupply() - 18160ddd balanceOf(address) - 70a08231 ...
gagikk's user avatar
  • 13
2 votes
1 answer
1k views

Opcodes PUSH, DUP and SWAP?

I studied EVM implementations and the bytecode sequences used by them. I wondered that there are three opcodes which are recognized by the EVM but actually are invalid opcodes. B0 PUSH B1 DUP B2 ...
kedenk's user avatar
  • 155
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
2 answers
2k views

callvalue opcode, for what?

someone know what the opcode CALLVALUE is for? I would like to understand it well. Have you an example on which I can easily understand it?
EricEnticman's user avatar
3 votes
1 answer
255 views

how are negative numbers stored within the EVM stack?

for example, I have these opcodes: PUSH60 PUSH40 SUB for sub operations, I believe that the second stack item is subtracted from the first stack item (60 - 40) which would equal to -20 being the new ...
kieron's user avatar
  • 183
0 votes
1 answer
48 views

Does an Ethereum contract address hold two different kinds of files, one for the contract bytecode and another for the ABI?

Does an Ethereum contract address hold two different kinds of file, one for the contract bytecode and another for the ABI?
Erdös's user avatar
  • 111
1 vote
1 answer
666 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 ...
Jonathan Gimeno's user avatar
1 vote
1 answer
175 views

What is the "clone-bin" output in solc?

When it comes to bytecode solc has three types of outputs: --bin Binary of the contracts in hex. --bin-runtime Binary of the runtime part of the contracts in hex. --clone-bin ...
Ivan's user avatar
  • 277
1 vote
1 answer
201 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 ...
kedenk's user avatar
  • 155
0 votes
1 answer
427 views

Retrieve contract byte code

How may I find the byte code of an arbitrary contract? Preferably using a website and not writing my own client.
William Entriken's user avatar
1 vote
1 answer
297 views

Pushing bytes to EVM stack

I am sorry if this question seems to be somewhat bad, but I am trying to work out the stack representation of the following opcodes: PUSH1 60 PUSH2 40 would the stack representation of this be: [...
kieron's user avatar
  • 183
0 votes
1 answer
728 views

Get contract bytecode and creator from contract address on Geth console

I can get contract bytecode and it's creator via this URL. https://etherscan.io/address/CONTRACT_ADDRESS [example: https://etherscan.io/address/0x5a3e58c7cf09217d2a5385bf96c02673ed1187bb#code] I ...
artgb's user avatar
  • 155
0 votes
0 answers
47 views

What does #[$] or [$] mean in remix?

Can someone tell me what the #[$] or [$] in the remix assembly output means? I assume it's a placeholder for something yet to be determined but am unable to confirm if and what. For example: PUSH #[...
DAnsermino's user avatar
2 votes
1 answer
906 views

How to run local VM from golang?

I am going to run the virtual ethereum machine from the code, pass to it a compiled smart contract code. But I do not know how to do it. It's my code: package main import ( "context" "...
EricEnticman's user avatar
0 votes
2 answers
143 views

Remove source code

I am designing a smart contract challenge/enigma where I expect participants to run a given function of the contract to find the "secret treasure". I use truffle to compile the contract, then truffle ...
user369353's user avatar
0 votes
0 answers
333 views

How to get smart contract run time bytecode from network without compiling anything?

Simple question, but I couldn’t find the answer anywhere. How to get the exact bytecode of a smart contract (not creation bytecode) when the source code of contract is available on https://etherscan....
user2284570's user avatar
  • 1,018
4 votes
1 answer
635 views

solc producing different contract binary depending on OS

I have a Linux, and another person has a Mac. We have the same solc compiler version, except for the OS extension (I have 0.4.24+commit.e67f0147.Linux.g++, they have 0.4.24+commit.e67f0147.Darwin....
Alex Altair's user avatar
1 vote
1 answer
847 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 ...
Tarik EN-NAKDI's user avatar
0 votes
0 answers
448 views

Does it cost more gas to use =, >, <. operators with bytes32 than it does with uint256?

Does it cost any gas to cast a bytes32 memory value to uint256? What is the assembly op code for this? Does it cost more gas to use =, >, <. operators with bytes32 than it does with uint256? ...
mudgen's user avatar
  • 159
1 vote
1 answer
855 views

Publish and Verify the source code of a contract created by another contract on etherscan [duplicate]

This is the main contract which has been verified succesfully: https://ropsten.etherscan.io/address/0xc4c89dd46524c6f704e92a9cd012a3ebadadff36 This is the created contract I can't get verified: https:...
user avatar
1 vote
1 answer
1k views

Deploying a smart contract with several solidity files

I have a contract contains 4 .sol files and when I generate its bytecode and api as follows: > solc --bin GreenToken.sol > solc --abi GreenToken.sol I receive: ======= BasicToken.sol:...
Questioner's user avatar
  • 2,680
2 votes
1 answer
201 views

Bytecode execution during contract deployment

during the process of contract deployment the 'loading' code is executed (60606040523415600e57600080fd5b5b603680601c6000396000f300). This bytecode sequence loads the actual contract into the evm/...
kedenk's user avatar
  • 155
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
397 views

What is ethereum bytecode link references is?

I compiled contract from there and found some strange things in bytecode: <some_bytecode>...__CrowdsaleTokenExt:SafeMathLibExt______6366098d4f9091836000604051...<some-bytecode> As I ...
Дима Меркурьев's user avatar
0 votes
0 answers
602 views

Unable to verify deployed contract! Error! Unable to generate Contract ByteCode and ABI

I already searched and many of the people got this issue, I tried that but unable to fix this issue. I have deployed a contract and Contract Address is here. I am getting this error Error! Unable to ...
Kamran Jabbar's user avatar
0 votes
1 answer
376 views

how would you test if the smart contract from github is the deployed smart contract on the blockchain ERC20

The scenario is that scammers could give a .sol on an open github repo and deploy another contract on the ethereum blockchain. One reason to do that is to give a github smart contract with a vesting ...
francoisduvalcork's user avatar
2 votes
2 answers
255 views

Ethereum Bytecode

Why does Ethereum store bytecode on the blockchain and not the source code, what's the tradeoff? As far as I know, a source code does not need as much storage.
Ini's user avatar
  • 464
7 votes
3 answers
22k 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 ...
Dmitry Shalimov's user avatar
0 votes
1 answer
133 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. ...
shaharsol's user avatar
  • 561
5 votes
1 answer
245 views

First instructions in bytecode (606060405)

I'm trying to figure out how EVM bytecode works and I created an empty contract in Remix. The assembly version looks like this: PUSH1 0x60 PUSH1 0x40 MSTORE CALLVALUE ISZERO PUSH1 0xE JUMPI ...
AlexeyKarasev's user avatar
9 votes
1 answer
2k views

Why does changing comments in the smart contract change its bytecode?

Why are these 2 smart contracts, which differ only in the comments, result in different bytecode: 1st pragma solidity 0.4.20; contract Test { // test function test() pure public { } } 2nd ...
medvedev1088's user avatar
6 votes
2 answers
5k 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 ...
Chet's user avatar
  • 121
2 votes
1 answer
592 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
13 votes
5 answers
1k views

What is the shortest bytecode that will publish a contract with non-zero bytecode?

Yes, it's golf. So sue me. Rules The response to getCode() should have some characters that aren’t either 0 or x. To test it out, you can use the following with a local testrpc: web3.eth....
maurelian's user avatar
  • 3,221
1 vote
2 answers
535 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?
rstormsf's user avatar
  • 4,357
0 votes
1 answer
754 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 ...
Nagaganesh Jaladanki's user avatar
0 votes
1 answer
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 ...
YoungmindHS's user avatar
0 votes
1 answer
1k views

How does solc generate the bytecode for a contract?

I got sick of using remix and copying-pasting my web3 deploy text so I'm trying to write a python script that will generate this deploy test for me. However, one of the fields in the instantiation ...
steve's user avatar
  • 1
0 votes
1 answer
43 views

Short of running one's own node, how can I see the code of suicided contracts?

I'm interested in looking at the code in instances of the Parity Multisig wallet attacks, but the contracts have self-destructed. How can I get ahold of the exact bytecode that was executed in a given ...
Kimball Germane's user avatar