-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4bcee26
Showing
8 changed files
with
207 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Deploy on Github | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
actions: read | ||
contents: write | ||
id-token: write | ||
|
||
jobs: | ||
build: | ||
uses: zktx-io/slsa-on-move/.github/workflows/generator_generic_slsa3.yml@main | ||
with: | ||
move-compiler: "sui" | ||
move-directory: "sui/serializer" |
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 @@ | ||
**/build |
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,27 @@ | ||
# @generated by Move, please check-in and do not edit manually. | ||
|
||
[move] | ||
version = 0 | ||
manifest_digest = "8C8B9ADAFF8B7267E4476A3DF08A72810194D36146AC710F0545C8843B1F1075" | ||
deps_digest = "F8BBB0CCB2491CA29A3DF03D6F92277A4F3574266507ACD77214D37ECA3F3082" | ||
|
||
dependencies = [ | ||
{ name = "Sui" }, | ||
] | ||
|
||
[[move.package]] | ||
name = "MoveStdlib" | ||
source = { local = "../../../../../../crates/sui-framework/packages/move-stdlib" } | ||
|
||
[[move.package]] | ||
name = "Sui" | ||
source = { local = "../../../../../../crates/sui-framework/packages/sui-framework" } | ||
|
||
dependencies = [ | ||
{ name = "MoveStdlib" }, | ||
] | ||
|
||
[move.toolchain-version] | ||
compiler-version = "1.27.0" | ||
edition = "2024.beta" | ||
flavor = "sui" |
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,10 @@ | ||
[package] | ||
name = "serializer" | ||
version = "0.0.1" | ||
edition = "2024.beta" | ||
|
||
[addresses] | ||
serializer = "0x0" | ||
|
||
[dependencies] | ||
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/devnet" } |
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,69 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module serializer::serializer_tests { | ||
use sui::tx_context::{Self, TxContext}; | ||
use sui::transfer; | ||
use sui::object::{Self, UID}; | ||
use sui::clock::Clock; | ||
use std::option::Option; | ||
use sui::object::ID; | ||
use std::string::String; | ||
use std::ascii; | ||
|
||
public struct MutableShared has key { | ||
id: UID, | ||
value: u64, | ||
} | ||
|
||
fun init(ctx: &mut TxContext) { | ||
transfer::share_object(MutableShared { | ||
id: object::new(ctx), | ||
value: 1, | ||
}) | ||
} | ||
|
||
public entry fun use_clock(_clock: &Clock) {} | ||
|
||
public entry fun list<T: key + store>( | ||
item: T, | ||
ctx: &mut TxContext | ||
) { | ||
transfer::public_transfer(item, tx_context::sender(ctx)) | ||
} | ||
|
||
public fun return_struct<T: key + store>( | ||
item: T, | ||
): T { | ||
item | ||
} | ||
|
||
public entry fun value(clock: &MutableShared) { | ||
assert!(clock.value > 0, 1); | ||
} | ||
|
||
public entry fun set_value(clock: &mut MutableShared) { | ||
clock.value = 10; | ||
} | ||
|
||
public entry fun delete_value(clock: MutableShared) { | ||
let MutableShared { id, value: _ } = clock; | ||
object::delete(id); | ||
} | ||
|
||
public fun test_abort() { | ||
abort 0 | ||
} | ||
|
||
public fun addr(_: address) {} | ||
public fun id(_: ID) {} | ||
|
||
public fun ascii_(_: ascii::String) {} | ||
public fun string(_: String) {} | ||
|
||
public fun vec(_: vector<ascii::String>) {} | ||
public fun opt(_: Option<ascii::String>) {} | ||
|
||
public fun ints(_u8: u8, _u16: u16, _u32: u32, _u64: u64, _u128: u128, _u256: u256) {} | ||
public fun boolean(_bool: bool) {} | ||
} |
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,10 @@ | ||
[package] | ||
name = "serializer" | ||
version = "0.0.2" | ||
edition = "2024.beta" | ||
|
||
[addresses] | ||
serializer = "0x0" | ||
|
||
[dependencies] | ||
Sui = { git = "https://github.com/MystenLabs/sui.git", subdir = "crates/sui-framework/packages/sui-framework", rev = "framework/devnet" } |
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,3 @@ | ||
[upgrade] | ||
package_id = "" | ||
upgrade_cap = "" |
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,69 @@ | ||
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
module serializer::serializer_tests { | ||
use sui::tx_context::{Self, TxContext}; | ||
use sui::transfer; | ||
use sui::object::{Self, UID}; | ||
use sui::clock::Clock; | ||
use std::option::Option; | ||
use sui::object::ID; | ||
use std::string::String; | ||
use std::ascii; | ||
|
||
public struct MutableShared has key { | ||
id: UID, | ||
value: u64, | ||
} | ||
|
||
fun init(ctx: &mut TxContext) { | ||
transfer::share_object(MutableShared { | ||
id: object::new(ctx), | ||
value: 1, | ||
}) | ||
} | ||
|
||
public entry fun use_clock(_clock: &Clock) {} | ||
|
||
public entry fun list<T: key + store>( | ||
item: T, | ||
ctx: &mut TxContext | ||
) { | ||
transfer::public_transfer(item, tx_context::sender(ctx)) | ||
} | ||
|
||
public fun return_struct<T: key + store>( | ||
item: T, | ||
): T { | ||
item | ||
} | ||
|
||
public entry fun value(clock: &MutableShared) { | ||
assert!(clock.value > 10, 2); | ||
} | ||
|
||
public entry fun set_value(clock: &mut MutableShared) { | ||
clock.value = 20; | ||
} | ||
|
||
public entry fun delete_value(clock: MutableShared) { | ||
let MutableShared { id, value: _ } = clock; | ||
object::delete(id); | ||
} | ||
|
||
public fun test_abort() { | ||
abort 1 | ||
} | ||
|
||
public fun addr(_: address) {} | ||
public fun id(_: ID) {} | ||
|
||
public fun ascii_(_: ascii::String) {} | ||
public fun string(_: String) {} | ||
|
||
public fun vec(_: vector<ascii::String>) {} | ||
public fun opt(_: Option<ascii::String>) {} | ||
|
||
public fun ints(_u8: u8, _u16: u16, _u32: u32, _u64: u64, _u128: u128, _u256: u256) {} | ||
public fun boolean(_bool: bool) {} | ||
} |