Skip to content

Commit 886eb8b

Browse files
authored
More system specs (#567)
* feat: added more sys specs * more specs * feat: marked as system
1 parent cd344e6 commit 886eb8b

File tree

4 files changed

+38
-1
lines changed

4 files changed

+38
-1
lines changed

crates/move-model/src/model.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,6 +1539,8 @@ impl GlobalEnv {
15391539
"vdf_spec",
15401540
"zklogin_verified_id_spec",
15411541
"zklogin_verified_issuer_spec",
1542+
"derived_object_spec",
1543+
"funds_accumulator_spec",
15421544
];
15431545
const LOG_MODULE_NAME: &'static str = "log";
15441546
const VECTOR_MODULE_NAME: &'static str = "vector";

packages/sui-specs/sources/sui-framework/accumulator.move

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module specs::accumulator_spec;
22

3-
use sui::accumulator::{emit_deposit_event, emit_withdraw_event};
3+
use sui::accumulator::{emit_deposit_event, emit_withdraw_event, accumulator_address};
44

55
#[spec(target = sui::accumulator::emit_deposit_event)]
66
public fun emit_deposit_event_spec<T>(
@@ -19,3 +19,8 @@ public fun emit_withdraw_event_spec<T>(
1919
) {
2020
emit_withdraw_event<T>(accumulator, owner, amount)
2121
}
22+
23+
#[spec(target = sui::accumulator::accumulator_address)]
24+
public fun accumulator_address_spec<T>(address: address): address {
25+
accumulator_address<T>(address)
26+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module specs::derived_object_spec;
2+
3+
use sui::derived_object::derive_address;
4+
5+
#[spec(target = sui::derived_object::derive_address)]
6+
public fun derive_address_spec<K: copy + drop + store>(parent: ID, key: K): address {
7+
derive_address(parent, key)
8+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
module specs::funds_accumulator_spec;
2+
3+
use sui::funds_accumulator::{add_to_accumulator_address, withdraw_from_accumulator_address};
4+
5+
6+
#[spec(target = sui::funds_accumulator::add_to_accumulator_address)]
7+
public fun add_to_accumulator_address_spec<T: store>(
8+
accumulator: address,
9+
recipient: address,
10+
value: T,
11+
) {
12+
add_to_accumulator_address(accumulator, recipient, value)
13+
}
14+
15+
#[spec(target = sui::funds_accumulator::withdraw_from_accumulator_address)]
16+
public fun withdraw_from_accumulator_address_spec<T: store>(
17+
accumulator: address,
18+
owner: address,
19+
value: u256,
20+
): T {
21+
withdraw_from_accumulator_address(accumulator, owner, value)
22+
}

0 commit comments

Comments
 (0)