Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions crates/move-model/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1539,6 +1539,8 @@ impl GlobalEnv {
"vdf_spec",
"zklogin_verified_id_spec",
"zklogin_verified_issuer_spec",
"derived_object_spec",
"funds_accumulator_spec",
];
const LOG_MODULE_NAME: &'static str = "log";
const VECTOR_MODULE_NAME: &'static str = "vector";
Expand Down
7 changes: 6 additions & 1 deletion packages/sui-specs/sources/sui-framework/accumulator.move
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module specs::accumulator_spec;

use sui::accumulator::{emit_deposit_event, emit_withdraw_event};
use sui::accumulator::{emit_deposit_event, emit_withdraw_event, accumulator_address};

#[spec(target = sui::accumulator::emit_deposit_event)]
public fun emit_deposit_event_spec<T>(
Expand All @@ -19,3 +19,8 @@ public fun emit_withdraw_event_spec<T>(
) {
emit_withdraw_event<T>(accumulator, owner, amount)
}

#[spec(target = sui::accumulator::accumulator_address)]
public fun accumulator_address_spec<T>(address: address): address {
accumulator_address<T>(address)
}
8 changes: 8 additions & 0 deletions packages/sui-specs/sources/sui-framework/derived_object.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module specs::derived_object_spec;

use sui::derived_object::derive_address;

#[spec(target = sui::derived_object::derive_address)]
public fun derive_address_spec<K: copy + drop + store>(parent: ID, key: K): address {
derive_address(parent, key)
}
22 changes: 22 additions & 0 deletions packages/sui-specs/sources/sui-framework/funds_accumulator.move
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module specs::funds_accumulator_spec;

use sui::funds_accumulator::{add_to_accumulator_address, withdraw_from_accumulator_address};


#[spec(target = sui::funds_accumulator::add_to_accumulator_address)]
public fun add_to_accumulator_address_spec<T: store>(
accumulator: address,
recipient: address,
value: T,
) {
add_to_accumulator_address(accumulator, recipient, value)
}

#[spec(target = sui::funds_accumulator::withdraw_from_accumulator_address)]
public fun withdraw_from_accumulator_address_spec<T: store>(
accumulator: address,
owner: address,
value: u256,
): T {
withdraw_from_accumulator_address(accumulator, owner, value)
}
Loading