-
Notifications
You must be signed in to change notification settings - Fork 452
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into bold-review
- Loading branch information
Showing
6 changed files
with
52 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
;; Copyright 2024, Offchain Labs, Inc. | ||
;; For license information, see https://github.com/nitro/blob/master/LICENSE | ||
|
||
(module | ||
(import "vm_hooks" "read_args" (func $read_args (param i32))) | ||
(import "vm_hooks" "write_result" (func $write_result (param i32 i32))) | ||
(memory (export "memory") 2 2) | ||
(func $main (export "user_entrypoint") (param $args_len i32) (result i32) | ||
(local $len i32) | ||
|
||
;; write args to 0x0 | ||
(call $read_args (i32.const 0)) | ||
|
||
;; treat first 4 bytes as size to write | ||
(i32.load (i32.const 0)) | ||
local.set $len | ||
|
||
;; call write | ||
(call $write_result (i32.const 0) (local.get $len)) | ||
|
||
;; return success | ||
i32.const 0 | ||
) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters