Questions tagged [bytecode]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
268 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?
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
1answer
250 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 ...
2
votes
0answers
43 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 ...
2
votes
1answer
263 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 { ...
3
votes
1answer
765 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....
4
votes
1answer
846 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.
1
vote
1answer
159 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 ...
0
votes
1answer
184 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 ...
1
vote
0answers
36 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 ...
1
vote
1answer
347 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?
2
votes
1answer
65 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 ...
0
votes
1answer
23 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?
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 ...
1
vote
1answer
114 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 ...
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
1answer
266 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.
1
vote
1answer
59 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: [...
0
votes
1answer
319 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 ...
0
votes
0answers
36 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 #[...
1
vote
1answer
380 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" "...
0
votes
2answers
75 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 ...
0
votes
1answer
142 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....
2
votes
1answer
261 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....
-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 ...
0
votes
0answers
79 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? ...
1
vote
1answer
415 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:...
0
votes
1answer
357 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:...
2
votes
1answer
79 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/...
2
votes
0answers
223 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")); ...
1
vote
1answer
182 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 ...
0
votes
0answers
268 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 ...
0
votes
1answer
122 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 ...
1
vote
1answer
134 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.
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 ...
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. ...
5
votes
1answer
146 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 ...
9
votes
1answer
918 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 ...
4
votes
3answers
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 ...
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 ...
10
votes
4answers
449 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....
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
321 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
1answer
740 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 ...
0
votes
1answer
531 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 ...
0
votes
1answer
27 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 ...
8
votes
1answer
1k views

Difference between bytecode and runtime bytecode

In Remix, clicking on "details" for a contract reveals the "bytecode" and "runtime bytecode". What is the difference?
4
votes
2answers
451 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
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 ...
5
votes
3answers
4k views

Deploying a smart contract with just bytecode

I have the bytecode of a contract, can I deploy it to a private network without the need of source code? Does bytecode contain the deployers signature or somehow the network id? Here is the bytecode. ...