Questions tagged [bytecode]

The tag has no usage guidance.

39 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
497 views

Is there an app to read QR code of smartcontract bytecode and trigger it?

I want to know if there is a workaround for a smartphone user to simply scan a QR code that would trigger a transaction using a custom smartcontract (not a native currency). The contract would behave ...
3
votes
1answer
157 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 ...
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?
3
votes
0answers
138 views

Is there any reference on writing contracts directly with the bytecode language?

It would be great to have a complete reference of all the opcodes available, their exact effects and costs, and an example "Hello World" in ethereum assembly. Edit: this question isn't a duplicate of ...
2
votes
1answer
691 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/...
2
votes
0answers
475 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 ...
2
votes
0answers
63 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);...
2
votes
0answers
140 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 ...
2
votes
0answers
50 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
0answers
60 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 ...
2
votes
0answers
272 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
0answers
24 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 ...
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?
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
0answers
35 views

Smart contract copying code beyong code length

I've seen a couple smart contracts (eg the contract decompiled in this answer) use this pattern: Code[Code.Length:Code.Length+x] This surprised me because I would expect Code.Length to mark the end of ...
1
vote
0answers
117 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 ...
1
vote
1answer
23 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?
1
vote
1answer
262 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 { ...
0
votes
0answers
17 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
17 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 ...
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 ...
0
votes
0answers
29 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 ...
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
0answers
24 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, ...
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, ...
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
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 ...
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, ...
0
votes
1answer
33 views

Different byteCode generated between block explorer and standard json input

I have deployed a contract and want to verify it, but when I used the same code with same configurations of compiler to verify it, it gave me negative result. Thus I tried to decompile these two ...
0
votes
0answers
55 views

How to look up IPFS url in Ethereum Bytecode meta data

I have a solidity contract that is deployed on the Ethereum mainnet. The contract's bytecode ended with (what I assume to be) an IPFS url {ipfs}64736f6c634300060c0033 How do I look up this URL on ipfs?...
0
votes
0answers
59 views

How does ecrecover get compiled?

How does ecrecover() in solidity work? Looking at ethervm.io there doesn't seem to be an opcode for ecrecover? To what bytes is a ecrecover() call compiled?
0
votes
0answers
43 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 #[...
0
votes
0answers
236 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....
0
votes
0answers
161 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? ...
0
votes
0answers
504 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
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. ...
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 ...