Nethereum / Nethereum/Nethereum

Contract utils bytecode for address creation seems to be incorrect when flushing eth

Open
#783 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
2.3k
Forks
744
PR merge metrics
No merged PRs in 30d

Description

https://github.com/Nethereum/Nethereum/blob/da8be76dbcad23b9f0835819855efbe999ed1060/src/Nethereum.Util/ContractUtils.cs#L32

Here is the bytecode from NethereumForwarder which works for me (flushes eth correctly):

https://github.com/Nethereum/Nethereum.WalletForwarder/blob/59c0b5868de1e2dfec27f42a1565bd3b5fcb7396/Nethereum.WalletForwarder.Testing/ForwarderTests.cs#L448

...but the bytecode from ContractUtils does not generate an address from which we can flush the ethereum.

Tested this locally with Geth and on Infura ropsten

Wanted to clarify this before maybe opening a PR?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with src/Nethereum.Util/ContractUtils.cs at line 32 and compare its address-creation bytecode with the working bytecode referenced in Nethereum.WalletForwarder.Testing/ForwarderTests.cs at line 448. Reproduce the behavior with Geth or Infura Ropsten, then verify that the generated address can flush ETH correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
blockchain
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.