Skip to content

feat(example): deploy bytecode from scratch#1767

Merged
rakita merged 4 commits intobluealloy:mainfrom
clearloop:main
Sep 18, 2024
Merged

feat(example): deploy bytecode from scratch#1767
rakita merged 4 commits intobluealloy:mainfrom
clearloop:main

Conversation

@clearloop
Copy link
Copy Markdown
Contributor

@clearloop clearloop commented Sep 13, 2024

Introduces an example about deploying raw bytecode with revm with storage operations as example, it includes:

  • set up a basic REVM from scratch
  • concat [init_code, runtime_bytecode, constructor_params ] as bytecode
  • deploy the bytecode with REVM
  • verify the storage operation from init_code in the deployed contract
  • passing params to constructor with codecopy

@clearloop clearloop changed the title feat(example): deploy bytecode from stratch feat(example): deploy bytecode from scratch Sep 13, 2024
@clearloop clearloop marked this pull request as ready for review September 13, 2024 17:50

/// [ PUSH1, 0x01, PUSH1, 0x17, PUSH1, 0x1f, CODECOPY, PUSH0, MLOAD, PUSH0, SSTORE ]
const INIT_CODE: &[u8] = &[
0x60, 0x01, 0x60, 0x17, 0x60, 0x1f, 0x39, 0x5f, 0x51, 0x5f, 0x55,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, you could use exact notion from the comment if you include, revm::interpreter::opcode::*

Copy link
Copy Markdown
Member

@rakita rakita left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool example, Left one nit but lgtm otherwise.

@rakita rakita merged commit 54d2415 into bluealloy:main Sep 18, 2024
@github-actions github-actions bot mentioned this pull request Sep 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants