tx · D1cnBVk7CdnsmhyNrbEjWpwDUCZv5dkzSMefLHCd4M7Z
3NCEnW5hTnRQ7J9TFQsHS4W92f54PCCWQvN: -0.01400000 Waves
2020.02.06 13:10 [887206] smart account 3NCEnW5hTnRQ7J9TFQsHS4W92f54PCCWQvN > SELF 0.00000000 Waves
{
"type": 13,
"id": "D1cnBVk7CdnsmhyNrbEjWpwDUCZv5dkzSMefLHCd4M7Z",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1580983786857,
"version": 1,
"sender": "3NCEnW5hTnRQ7J9TFQsHS4W92f54PCCWQvN",
"senderPublicKey": "8PUyJHGVRUxhY118c4H5isGCGLYgRBmcSzNYooDAqwh",
"proofs": [
"5sq9dKpQs3ofEu4fhD3bz4KRZD5vWjHdAPuzLwTEF9evBG6ASHjjedoHh2xGdniP1wdfHS3MMY36LMt8J59z1PLP"
],
"script": "base64:AAIDAAAAAAAAAAcIARIDCgEIAAAAAQAAAAAQYWxsb3dlZEFkZHJlc3NlcwkABEwAAAACAgAAACMzTkNFblc1aFRuUlE3SjlURlFzSFM0VzkyZjU0UENDV1F2TgkABEwAAAACAgAAACMzTjdqaDJIenJBR2hYTkN0Nml2V0NlSjMyNW95N3hmVVZtRwUAAAADbmlsAAAAAQAAAAFpAQAAABR0cnlHZXQ2MDBTZWNvbmRzTG9jawAAAAEAAAAIbG9ja05hbWUEAAAADWxvY2tVbnRpbE5hbWUJAAEsAAAAAgUAAAAIbG9ja05hbWUCAAAABi91bnRpbAoBAAAAHmNoZWNrT25lQWxsb3dlZEFkZGVyZXNzZXNFbnRyeQAAAAIAAAAFZm91bmQAAAAHYWRkcmVzcwMFAAAABWZvdW5kBgkAAAAAAAACCAkBAAAAHEBleHRyVXNlcihhZGRyZXNzRnJvbVN0cmluZykAAAABBQAAAAdhZGRyZXNzAAAABWJ5dGVzCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1pbkFsbG93ZWRMaXN0BAAAAAskbGlzdDQ2NzU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UAAAAHJG1hdGNoMAUAAAABYggIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAALbG9ja2VkVW50aWwEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAANbG9ja1VudGlsTmFtZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAV1bnRpbAUAAAAHJG1hdGNoMAUAAAAFdW50aWwAAAAAAAAAAAAEAAAAB2NhbkxvY2sDCQAAZgAAAAIFAAAAA25vdwUAAAALbG9ja2VkVW50aWwGCQAAAAAAAAIFAAAACGxvY2tlZEJ5CAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAwUAAAAHY2FuTG9jawkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAIbG9ja05hbWUICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAADWxvY2tVbnRpbE5hbWUJAABkAAAAAgUAAAADbm93AAAAAAAACSfABQAAAANuaWwJAAACAAAAAQIAAAAZQWxyZWFkeSBsb2NrZWQgYnkgYW5vdGhlcgAAAAAJ3ZAC",
"chainId": 84,
"height": 887206,
"spentComplexity": 0
}
View: original | compacted
Prev: W8MCsbjMoyEDj4vhLsWUZRoSHm6CNzo6doWc9v5WCZ2
Next: none
Diff:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | |
---|
| 4 | + | let allowedAddresses = ["3NCEnW5hTnRQ7J9TFQsHS4W92f54PCCWQvN", "3N7jh2HzrAGhXNCt6ivWCeJ325oy7xfUVmG"] |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func tryGet600SecondsLock (lockName) = { |
---|
8 | 8 | | let lockUntilName = (lockName + "/until") |
---|
| 9 | + | func checkOneAllowedAdderessesEntry (found,address) = if (found) |
---|
| 10 | + | then true |
---|
| 11 | + | else (addressFromStringValue(address).bytes == i.caller.bytes) |
---|
| 12 | + | |
---|
| 13 | + | let inAllowedList = { |
---|
| 14 | + | let $list467531 = allowedAddresses |
---|
| 15 | + | let $size467531 = size($list467531) |
---|
| 16 | + | let $acc0467531 = false |
---|
| 17 | + | if (($size467531 == 0)) |
---|
| 18 | + | then $acc0467531 |
---|
| 19 | + | else { |
---|
| 20 | + | let $acc1467531 = checkOneAllowedAdderessesEntry($acc0467531, $list467531[0]) |
---|
| 21 | + | if (($size467531 == 1)) |
---|
| 22 | + | then $acc1467531 |
---|
| 23 | + | else { |
---|
| 24 | + | let $acc2467531 = checkOneAllowedAdderessesEntry($acc1467531, $list467531[1]) |
---|
| 25 | + | if (($size467531 == 2)) |
---|
| 26 | + | then $acc2467531 |
---|
| 27 | + | else { |
---|
| 28 | + | let $acc3467531 = checkOneAllowedAdderessesEntry($acc2467531, $list467531[2]) |
---|
| 29 | + | throw("List size exceed 2") |
---|
| 30 | + | } |
---|
| 31 | + | } |
---|
| 32 | + | } |
---|
| 33 | + | } |
---|
9 | 34 | | let now = match blockInfoByHeight(height) { |
---|
10 | 35 | | case b: BlockInfo => |
---|
11 | 36 | | b.timestamp |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | |
---|
| 4 | + | let allowedAddresses = ["3NCEnW5hTnRQ7J9TFQsHS4W92f54PCCWQvN", "3N7jh2HzrAGhXNCt6ivWCeJ325oy7xfUVmG"] |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func tryGet600SecondsLock (lockName) = { |
---|
8 | 8 | | let lockUntilName = (lockName + "/until") |
---|
| 9 | + | func checkOneAllowedAdderessesEntry (found,address) = if (found) |
---|
| 10 | + | then true |
---|
| 11 | + | else (addressFromStringValue(address).bytes == i.caller.bytes) |
---|
| 12 | + | |
---|
| 13 | + | let inAllowedList = { |
---|
| 14 | + | let $list467531 = allowedAddresses |
---|
| 15 | + | let $size467531 = size($list467531) |
---|
| 16 | + | let $acc0467531 = false |
---|
| 17 | + | if (($size467531 == 0)) |
---|
| 18 | + | then $acc0467531 |
---|
| 19 | + | else { |
---|
| 20 | + | let $acc1467531 = checkOneAllowedAdderessesEntry($acc0467531, $list467531[0]) |
---|
| 21 | + | if (($size467531 == 1)) |
---|
| 22 | + | then $acc1467531 |
---|
| 23 | + | else { |
---|
| 24 | + | let $acc2467531 = checkOneAllowedAdderessesEntry($acc1467531, $list467531[1]) |
---|
| 25 | + | if (($size467531 == 2)) |
---|
| 26 | + | then $acc2467531 |
---|
| 27 | + | else { |
---|
| 28 | + | let $acc3467531 = checkOneAllowedAdderessesEntry($acc2467531, $list467531[2]) |
---|
| 29 | + | throw("List size exceed 2") |
---|
| 30 | + | } |
---|
| 31 | + | } |
---|
| 32 | + | } |
---|
| 33 | + | } |
---|
9 | 34 | | let now = match blockInfoByHeight(height) { |
---|
10 | 35 | | case b: BlockInfo => |
---|
11 | 36 | | b.timestamp |
---|
12 | 37 | | case _ => |
---|
13 | 38 | | 0 |
---|
14 | 39 | | } |
---|
15 | 40 | | let lockedBy = match getBinary(this, lockName) { |
---|
16 | 41 | | case b: ByteVector => |
---|
17 | 42 | | b |
---|
18 | 43 | | case _ => |
---|
19 | 44 | | i.caller.bytes |
---|
20 | 45 | | } |
---|
21 | 46 | | let lockedUntil = match getInteger(this, lockUntilName) { |
---|
22 | 47 | | case until: Int => |
---|
23 | 48 | | until |
---|
24 | 49 | | case _ => |
---|
25 | 50 | | 0 |
---|
26 | 51 | | } |
---|
27 | 52 | | let canLock = if ((now > lockedUntil)) |
---|
28 | 53 | | then true |
---|
29 | 54 | | else (lockedBy == i.caller.bytes) |
---|
30 | 55 | | if (canLock) |
---|
31 | 56 | | then WriteSet([DataEntry(lockName, i.caller.bytes), DataEntry(lockUntilName, (now + 600000))]) |
---|
32 | 57 | | else throw("Already locked by another") |
---|
33 | 58 | | } |
---|
34 | 59 | | |
---|
35 | 60 | | |
---|