Skip to content

Commit

Permalink
feat: add layout7 contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
hduoc2003 committed Sep 12, 2024
1 parent 4564ca5 commit 5f9c254
Show file tree
Hide file tree
Showing 46 changed files with 16,818 additions and 235 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/aptos_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ jobs:
with:
version: 4.0.0
- name: test_contract
run: (cd libs && aptos move test --coverage --dev --skip-fetch-latest-git-deps --skip-attribute-checks) & (cd verifier && aptos move test --coverage --dev --skip-fetch-latest-git-deps --skip-attribute-checks)
run: (cd libs && aptos move test --coverage --dev --skip-fetch-latest-git-deps --skip-attribute-checks) & (cd verifier && aptos move test --coverage --dev --skip-fetch-latest-git-deps --skip-attribute-checks) & (cd cpu && aptos move test --coverage --dev --skip-fetch-latest-git-deps --skip-attribute-checks)
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_addr: address): vector<u256> acquires CompiledProgram {
borrow_global<CompiledProgram>(signer_addr).inner
}
}
Loading

0 comments on commit 5f9c254

Please sign in to comment.