-
Notifications
You must be signed in to change notification settings - Fork 2
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
1 parent
d4f008f
commit 3014724
Showing
11 changed files
with
147 additions
and
3 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
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
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,12 @@ | ||
```k | ||
module MX-STORAGE-HOOKS | ||
imports MX-COMMON-SYNTAX | ||
imports MX-STORAGE-TOOLS-SYNTAX | ||
rule MX#storageLoad(mxStringValue(Key:String), Destination:MxValue ) | ||
=> storageLoad(getCallee(), Key, Destination) | ||
endmodule | ||
``` |
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,28 @@ | ||
```k | ||
module MX-STORAGE-TOOLS-SYNTAX | ||
imports MX-COMMON-SYNTAX | ||
imports STRING-SYNTAX | ||
syntax MxInstructions ::= storageLoad(address: String, key: String, destination: MxValue) | ||
endmodule | ||
module MX-STORAGE-TOOLS | ||
imports private COMMON-K-CELL | ||
imports private MX-ACCOUNTS-CONFIGURATION | ||
imports private MX-COMMON-SYNTAX | ||
imports private MX-STORAGE-TOOLS-SYNTAX | ||
imports private STRING-SYNTAX | ||
rule | ||
<k> | ||
storageLoad(... address: Address:String, key: _Key:String, destination: Destination:MxValue) | ||
=> storeHostValue(Destination, mxWrappedEmpty) | ||
... | ||
</k> | ||
<mx-account-address> Address </mx-account-address> | ||
[priority(100)] | ||
endmodule | ||
``` |
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
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,11 @@ | ||
```k | ||
module MX-CALLS-TOOLS | ||
imports MX-COMMON-SYNTAX | ||
imports MX-CALL-CONFIGURATION | ||
rule [[getCallee() => Callee]] | ||
<mx-callee> Callee:String </mx-callee> | ||
endmodule | ||
``` |
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 |
---|---|---|
@@ -1,15 +1,21 @@ | ||
```k | ||
requires "accounts/hooks.md" | ||
requires "accounts/esdt-hooks.md" | ||
requires "accounts/storage-hooks.md" | ||
requires "accounts/storage-tools.md" | ||
requires "biguint/hooks.md" | ||
requires "blocks/hooks.md" | ||
requires "calls/hooks.md" | ||
requires "calls/tools.md" | ||
module MX-COMMON | ||
imports private MX-ACCOUNTS-HOOKS | ||
imports private MX-BIGUINT-HOOKS | ||
imports private MX-BLOCKS-HOOKS | ||
imports private MX-CALLS-HOOKS | ||
imports private MX-CALLS-TOOLS | ||
imports private MX-STORAGE-HOOKS | ||
imports private MX-STORAGE-TOOLS | ||
endmodule | ||
``` |
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
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
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 @@ | ||
addAccount("Owner"); | ||
setCallee("Owner"); | ||
setStorage("Owner", "MyKey", mxStringValue("Hello")); | ||
|
||
push mxIntValue(12); | ||
push mxStringValue("MyKey"); | ||
call 2 MX#storageLoad; | ||
push_store_data; | ||
check_eq mxIntValue(12); | ||
check_eq mxWrappedEmpty |
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,9 @@ | ||
addAccount("Owner"); | ||
setCallee("Owner"); | ||
|
||
push mxIntValue(12); | ||
push mxStringValue("MyKey"); | ||
call 2 MX#storageLoad; | ||
push_store_data; | ||
check_eq mxIntValue(12); | ||
check_eq mxWrappedEmpty |