Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [bytecode]

The tag has no usage guidance.

1
vote
1answer
13 views

How to improve web3 when importing and stop doing the same task over and over again?

When using web3js, you will automatically have to make file to create an instance of that contract which you will use in your main project to interact with. For example, smartContract.js import ...
1
vote
2answers
20 views

Encode constructor arguments used when deploying a contract

How can I encode the constructor arguments when deploying a contract? Here is my deployment function: async function deploy(abi, bin, args) { let contract = new this.web3.eth.Contract(JSON.parse(...
0
votes
2answers
22 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 ...
0
votes
1answer
24 views

Understand an online contract with no EVM bytecode avaliable

Could anyone shed some lights on the following contract? https://etherscan.io/address/0x27d6c4cb2551799a143e1a3291ae002b8c8aa078#code I am quite confused about what's going on here. Why doesn't the ...
1
vote
2answers
43 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 ...
1
vote
1answer
36 views

How to extract “runtime” bin from a EVM bin found on etherscan.io

I would like to extract the runtime bin from the EVM bin that can be found in the etherscan.io. For instance for this famous contract (https://etherscan.io/address/...
0
votes
1answer
37 views

Difference between Binary of the Contracts in Hex and contract bytecode?

I use the command "solcjs --bin mycontract.sol" to get the "Binary of the contracts in hex" and it looks like: It can be used as a parameter of evm in geth after the command "evm --code". When I use ...
6
votes
1answer
78 views

When did the Ethereum “free memory pointer” change? (6060… -> 6080…)

I have been digging a bit deeper into the Ethereum bytecode with the specific goal to do contract verification from the source code. I noticed, while doing some tests, that the initial bytes of the ...
1
vote
1answer
38 views

Smart Contract byte code using web3

How Could I pull out smart contract bytecode using web3 and contract address?
0
votes
1answer
42 views

Deploying custom bytecode on the blockchain

Say I have custom bytecode which I want to deploy to the blockchain, for example, 0x6009 (PUSH1 0x09) and I want to create a contract which executes exactly that bytecode when called. As far as I ...
0
votes
2answers
32 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 ...
1
vote
1answer
42 views

Convert contract creation code to contract source code

I already get the bytecode of a contract from web3 through this method: web3.eth.getCode(address), but I am having trouble decoding this code to a human readable form. How do I do it? Take the OMG ...
1
vote
1answer
57 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[...
1
vote
2answers
64 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 ...
2
votes
0answers
51 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 ...
3
votes
1answer
50 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
1answer
108 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
17 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
74 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
27 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
75 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 { ...
2
votes
1answer
413 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....
2
votes
1answer
123 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
54 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
82 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
23 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 ...
0
votes
1answer
126 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
40 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
21 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?
0
votes
0answers
30 views

How are arithmetic operations performed on strings within EVM bytecode?

for eample, I have this following bytecode: 60A060020a which translate into: PUSH1 0xA0 PUSH1 0x2 EXP How would an exponentiation operation be performed on the 2 items pushed into the stack, when ...
1
vote
1answer
63 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
74 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
41 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
29 views

Deploying dapp on ETH & ETC problem

I thought it would be cool to have my ETH dapp also on ETC blockchain. It runs on ETH blockchain with no problem so I took a bytecode a let it deploy on ETC through mycrypto.com. However when I ...
0
votes
1answer
159 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
32 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
172 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
31 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
174 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
62 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
0answers
12 views

Which subcontract is called on Scryddd token transfer?

Scry.info is an ERC20 token which chose security by obscurity (and also to not invest in something hidden since source code isn’t public at all). The transfer function of the main contract does not ...
0
votes
1answer
67 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
132 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
157 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
51 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
248 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
248 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
60 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/...
1
vote
0answers
124 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
88 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 ...