Skip to content

Example implementation of changing a Solidity contract bytecode during the constructor execution

Notifications You must be signed in to change notification settings

petr-hejda/fake-number

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

Example implementation of changing a Solidity contract bytecode during the constructor execution.

This code contains a function foo() with hardcoded return value 1 - but in fact it returns 2. It's because the bytecode returned by the constructor is different than the bytecode compiled from the source code.

Install

npm i

Test

npm test

Test result:

  MyContract
    ✔ Deploys with hardcoded 1 (871ms)
    ✔ Returns 2 instead


  2 passing (883ms)

About

Example implementation of changing a Solidity contract bytecode during the constructor execution

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published