Skip to content

Commit

Permalink
Merge pull request #13 from sota-zk-labs/mzk-41-layout7
Browse files Browse the repository at this point in the history
Mzk 41 layout7
  • Loading branch information
hduoc2003 authored Sep 10, 2024
2 parents 4564ca5 + 5554972 commit 07e345a
Show file tree
Hide file tree
Showing 45 changed files with 16,817 additions and 234 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,6 @@ aptos move create-object-and-publish-package --address-name <your_account_name>
```bash
aptos move upgrade-object-package --object-address <object_address> --named-addresses <your_account_name>=<object_address>
```

The reference source for the verifier part https://etherscan.io/address/0xd51A3D50d4D2f99a345a66971E650EEA064DD8dF#code
CPU layout 7 contracts: https://vscode.blockscan.com/ethereum/0x28e3ad4201ba416b23d9950503db28a9232be32a
19 changes: 19 additions & 0 deletions cpu/Move.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "cpu"
version = "1.0.0"
authors = []

[addresses]
cpu_addr = "_"

[dev-addresses]
cpu_addr = "1725fb72ba62d830193fe57a932b5071c9718a44e40891e4067a2fe0e78f4d0f"
lib_addr = "54ba5979fbdf5fa56c4f4b5147fa33068148d08f6f191c23bca865c21192dcaa"

[dependencies.AptosFramework]
git = "https://github.com/aptos-labs/aptos-core.git"
rev = "aptos-release-v1.17"
subdir = "aptos-move/framework/aptos-framework"

[dependencies]
libs = { local = "../libs" }
20 changes: 20 additions & 0 deletions cpu/sources/cairo_bootloader_program.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module cpu_addr::cairo_bootloader_program {
use std::signer::address_of;

struct CompiledProgram has key {
inner: vector<u256>
}

public fun init_compiled_program(signer: &signer, compiled_program: vector<u256>) {
if (!exists<CompiledProgram>(address_of(signer))) {
move_to(signer, CompiledProgram {
inner: compiled_program
});
};
}

#[view]
public fun get_compiled_program(signer: &signer): vector<u256> acquires CompiledProgram {
borrow_global<CompiledProgram>(address_of(signer)).inner
}
}
Loading

0 comments on commit 07e345a

Please sign in to comment.