forked from tact-lang/tact
-
Notifications
You must be signed in to change notification settings - Fork 0
/
stdlib.tact
61 lines (45 loc) · 1.34 KB
/
stdlib.tact
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
contract StdlibTest {
v: Int = 0;
init() {
// Nothing to do
}
receive() {
// Deploy
}
get fun sliceEmpty(sc: Slice): Bool {
return sc.empty();
}
get fun sliceBits(sc: Slice): Int {
return sc.bits();
}
get fun sliceRefs(sc: Slice): Int {
return sc.refs();
}
get fun storeBool(bl: Builder, b: Bool): Builder {
return bl.storeBool(b);
}
get fun loadBool(sc: Slice): Bool {
return sc.loadBool();
}
get fun storeBit(bl: Builder, b: Bool): Builder {
return bl.storeBit(b);
}
get fun loadBit(sc: Slice): Bool {
return sc.loadBit();
}
get fun tvm_2023_07_upgrade(): Int {
return gasConsumed();
}
get fun tvm_2024_04_upgrade(): Int {
return getComputeFee(1000, false) + getStorageFee(1000, 1000, 1000, false) + getForwardFee(1000, 1000, false) + getSimpleComputeFee(1000, false) + getSimpleForwardFee(1000, 1000, false) + getOriginalFwdFee(1000, false) + myStorageDue();
}
get fun storeMaybeRef(bl: Builder, c: Cell?): Builder {
return bl.storeMaybeRef(c);
}
get fun parseStdAddress(slice: Slice): StdAddress {
return parseStdAddress(slice);
}
get fun parseVarAddress(slice: Slice): VarAddress {
return parseVarAddress(slice);
}
}