Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
daoauth committed Jul 24, 2024
0 parents commit 4bcee26
Show file tree
Hide file tree
Showing 8 changed files with 207 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/slsa-on-move.yml
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"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/build
27 changes: 27 additions & 0 deletions sui/serializer/Move.lock
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"
10 changes: 10 additions & 0 deletions sui/serializer/Move.toml
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" }
69 changes: 69 additions & 0 deletions sui/serializer/sources/serializer.move
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) {}
}
10 changes: 10 additions & 0 deletions sui/serializer_upgrade/Move.toml
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" }
3 changes: 3 additions & 0 deletions sui/serializer_upgrade/Upgrade.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[upgrade]
package_id = ""
upgrade_cap = ""
69 changes: 69 additions & 0 deletions sui/serializer_upgrade/sources/serializer.move
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) {}
}

0 comments on commit 4bcee26

Please sign in to comment.