tx · AKbfDgGo4yC2Wi4D1b3w14ig8fHHyApWqQjPQwfKvSkT
3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua: -0.01400000 Waves
2021.03.17 13:28 [1441603] smart account 3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua > SELF 0.00000000 Waves
{
"type": 13,
"id": "AKbfDgGo4yC2Wi4D1b3w14ig8fHHyApWqQjPQwfKvSkT",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1615976935014,
"version": 2,
"chainId": 84,
"sender": "3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua",
"senderPublicKey": "CTyHhnVTxf16Z4CmGGneAK8WB5g2QyT4MB8kUn8vPPcu",
"proofs": [
"2HtrrapU1S9KhicNCLcypUW6YG5Sef2oq3U9JUAZZpLn65KfTcLWtKJHTLj86oFy3sngyKQN9vTL4yuhvQ2mAAFG"
],
"script": "base64:AAIEAAAAAAAAAAkIAhIAEgMKAQgAAAAEAAAAAAlzZXBhcmF0b3ICAAAAA19fXwAAAAARa2V5TG9ja2FibGVBc3NldHMCAAAAE2RBcHBfTG9ja2FibGVBc3NldHMBAAAACmNoZWNrQXNzZXQAAAABAAAAB2Fzc2V0SWQEAAAAByRtYXRjaDAJAAPsAAAAAQUAAAAHYXNzZXRJZAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAFQXNzZXQEAAAAB2lzQXNzZXQFAAAAByRtYXRjaDAGBwEAAAARZ2V0TG9ja2FibGVBc3NldHMAAAAABAAAAAdzdHJMaXN0CQEAAAARQGV4dHJOYXRpdmUoMTA1MykAAAACBQAAAAR0aGlzBQAAABFrZXlMb2NrYWJsZUFzc2V0cwQAAAAHc3BsaXRlZAkABLUAAAACBQAAAAdzdHJMaXN0BQAAAAlzZXBhcmF0b3IDCQAAZgAAAAIAAAAAAAAAAGQJAAGQAAAAAQUAAAAHc3BsaXRlZAkAAAIAAAABCQABkQAAAAIFAAAAB3NwbGl0ZWQAAAAAAAAAAAAFAAAAB3NwbGl0ZWQAAAACAAAAAWkBAAAABGluaXQAAAAACQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAIFAAAAEWtleUxvY2thYmxlQXNzZXRzAgAAAAAFAAAAA25pbAAAAAFpAQAAABJvcEFkZExvY2thYmxlQXNzZXQAAAABAAAACmFzc2V0SWRTdHIEAAAAB2Fzc2V0SWQJAAJZAAAAAQUAAAAKYXNzZXRJZFN0cgMJAQAAAAIhPQAAAAIFAAAABHRoaXMIBQAAAAFpAAAABmNhbGxlcgkAAAIAAAABAgAAAA1BY2Nlc3MgZGVuaWVkAwkAAAAAAAACCQEAAAAKY2hlY2tBc3NldAAAAAEFAAAAB2Fzc2V0SWQHCQAAAgAAAAECAAAAFU5vdCBhbiBleGlzdGluZyBhc3NldAQAAAAObG9ja2FibGVBc3NldHMJAQAAABFnZXRMb2NrYWJsZUFzc2V0cwAAAAADCQAAAAAAAAIJAQAAAA9jb250YWluc0VsZW1lbnQAAAACBQAAAA5sb2NrYWJsZUFzc2V0cwUAAAAKYXNzZXRJZFN0cgYJAAACAAAAAQIAAAAWQXNzZXQgYWxyZWFkeSBsb2NrYWJsZQkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACBQAAABFrZXlMb2NrYWJsZUFzc2V0cwkABLkAAAACCQAETAAAAAIFAAAACmFzc2V0SWRTdHIFAAAADmxvY2thYmxlQXNzZXRzBQAAAAlzZXBhcmF0b3IFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5FPDWDg==",
"height": 1441603,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: Bd55XmExNtfgy4yuRLkCxmayqy42evz4cPjPwo8hPyAK
Next: 4MegBEKkGfbwwaAjGTsMe8Wwcb2m33xtbU9WTt9BbkhH
Diff:
Old | New | | Differences |
---|
17 | 17 | | let strList = getStringValue(this, keyLockableAssets) |
---|
18 | 18 | | let splited = split(strList, separator) |
---|
19 | 19 | | if ((100 > size(splited))) |
---|
20 | | - | then throw(toString(size(splited))) |
---|
| 20 | + | then throw(splited[0]) |
---|
21 | 21 | | else splited |
---|
22 | 22 | | } |
---|
23 | 23 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 4 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let separator = "___" |
---|
5 | 5 | | |
---|
6 | 6 | | let keyLockableAssets = "dApp_LockableAssets" |
---|
7 | 7 | | |
---|
8 | 8 | | func checkAsset (assetId) = match assetInfo(assetId) { |
---|
9 | 9 | | case isAsset: Asset => |
---|
10 | 10 | | true |
---|
11 | 11 | | case _ => |
---|
12 | 12 | | false |
---|
13 | 13 | | } |
---|
14 | 14 | | |
---|
15 | 15 | | |
---|
16 | 16 | | func getLockableAssets () = { |
---|
17 | 17 | | let strList = getStringValue(this, keyLockableAssets) |
---|
18 | 18 | | let splited = split(strList, separator) |
---|
19 | 19 | | if ((100 > size(splited))) |
---|
20 | | - | then throw(toString(size(splited))) |
---|
| 20 | + | then throw(splited[0]) |
---|
21 | 21 | | else splited |
---|
22 | 22 | | } |
---|
23 | 23 | | |
---|
24 | 24 | | |
---|
25 | 25 | | @Callable(i) |
---|
26 | 26 | | func init () = [StringEntry(keyLockableAssets, "")] |
---|
27 | 27 | | |
---|
28 | 28 | | |
---|
29 | 29 | | |
---|
30 | 30 | | @Callable(i) |
---|
31 | 31 | | func opAddLockableAsset (assetIdStr) = { |
---|
32 | 32 | | let assetId = fromBase58String(assetIdStr) |
---|
33 | 33 | | if ((this != i.caller)) |
---|
34 | 34 | | then throw("Access denied") |
---|
35 | 35 | | else if ((checkAsset(assetId) == false)) |
---|
36 | 36 | | then throw("Not an existing asset") |
---|
37 | 37 | | else { |
---|
38 | 38 | | let lockableAssets = getLockableAssets() |
---|
39 | 39 | | if ((containsElement(lockableAssets, assetIdStr) == true)) |
---|
40 | 40 | | then throw("Asset already lockable") |
---|
41 | 41 | | else [StringEntry(keyLockableAssets, makeString(assetIdStr :: lockableAssets, separator))] |
---|
42 | 42 | | } |
---|
43 | 43 | | } |
---|
44 | 44 | | |
---|
45 | 45 | | |
---|
46 | 46 | | @Verifier(tx) |
---|
47 | 47 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
48 | 48 | | |
---|