tx · Masa2LZG6gbvvEtfuM7UhBkbgBxiwrFvZ4FPrHDEtWX
3NCEnW5hTnRQ7J9TFQsHS4W92f54PCCWQvN: -0.01400000 Waves
2020.02.02 17:40 [881667] smart account 3NCEnW5hTnRQ7J9TFQsHS4W92f54PCCWQvN > SELF 0.00000000 Waves
{
"type": 13,
"id": "Masa2LZG6gbvvEtfuM7UhBkbgBxiwrFvZ4FPrHDEtWX",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1580654481290,
"version": 1,
"sender": "3NCEnW5hTnRQ7J9TFQsHS4W92f54PCCWQvN",
"senderPublicKey": "8PUyJHGVRUxhY118c4H5isGCGLYgRBmcSzNYooDAqwh",
"proofs": [
"4Yyk2MeMver1PY7Yo49Pbd4Bu4j11LiJFhMzmG6ZrpXN6Lm1k87gGtcQ6nrMA3tJSJtDD5ZPHn55SG4RK3WmBWoX"
],
"script": "base64:AAIDAAAAAAAAAAgIARIECgIIAQAAAAEAAAAAD25hbWVVbnRpbFN1ZmZ1eAIAAAAGOnVudGlsAAAAAQAAAAFpAQAAAAdnZXRMb2NrAAAAAgAAAAhsb2NrTmFtZQAAAAV1bnRpbAQAAAANbG9ja05hbWVVbnRpbAkAASwAAAACBQAAAAhsb2NrTmFtZQUAAAAPbmFtZVVudGlsU3VmZnV4BAAAAAFxAwkAAGcAAAACBQAAAAZoZWlnaHQFAAAABXVudGlsCQAAAgAAAAECAAAAGVN1cHBsaWVkIHVudGlsIGlzIHRvbyBsb3cGBAAAAAJxcQMJAABmAAAAAgUAAAAFdW50aWwJAABkAAAAAgUAAAAGaGVpZ2h0AAAAAAAAAAAKCQAAAgAAAAECAAAAGlN1cHBsaWVkIHVudGlsIGlzIHRvbyBoaWdoBgQAAAALY2FuQmVMb2NrZWQEAAAAByRtYXRjaDAJAAQcAAAAAgUAAAAEdGhpcwUAAAAIbG9ja05hbWUDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAWIFAAAAByRtYXRjaDAJAAAAAAAAAgUAAAABYggIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAAEVW5pdAUAAAAHJG1hdGNoMAYEAAAADGxhc3RMb2NrVGltZQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAA1sb2NrTmFtZVVudGlsAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAXQFAAAAByRtYXRjaDAFAAAAAXQEAAAABFVuaXQFAAAAByRtYXRjaDAAAAAAAAAAAAADAwUAAAALY2FuQmVMb2NrZWQGCQAAZwAAAAIFAAAABmhlaWdodAUAAAAMbGFzdExvY2tUaW1lCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAAhsb2NrTmFtZQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAANbG9ja05hbWVVbnRpbAUAAAAFdW50aWwFAAAAA25pbAkAAAIAAAABAgAAABNMb2NrIGNhbnQgYmUgbG9ja2VkAAAAABFM6lI=",
"chainId": 84,
"height": 881667,
"spentComplexity": 0
}
View: original | compacted
Prev: B4E4HJiNJNr8FV3HJs9AChh1j7Ry2vTGr7aaw7FqGNrs
Next: BKPqmGGSaD6Wi3XvpKMLX3mGEyXHtvsDQUYCtioJuMFc
Diff:
Old | New | | Differences |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func getLock (lockName,until) = { |
---|
8 | 8 | | let lockNameUntil = (lockName + nameUntilSuffux) |
---|
9 | | - | let nowUnion = blockInfoByHeight(height) |
---|
10 | | - | let now = match nowUnion { |
---|
11 | | - | case t: BlockInfo => |
---|
12 | | - | t |
---|
13 | | - | case _ => |
---|
14 | | - | throw("Cannot get last block") |
---|
15 | | - | } |
---|
16 | | - | let q = if ((now.timestamp >= until)) |
---|
| 9 | + | let q = if ((height >= until)) |
---|
17 | 10 | | then throw("Supplied until is too low") |
---|
18 | 11 | | else true |
---|
19 | | - | let qq = if ((until > (now.timestamp + 600000))) |
---|
| 12 | + | let qq = if ((until > (height + 10))) |
---|
20 | 13 | | then throw("Supplied until is too high") |
---|
21 | 14 | | else true |
---|
22 | 15 | | let canBeLocked = match getBinary(this, lockName) { |
---|
|
33 | 26 | | } |
---|
34 | 27 | | if (if (canBeLocked) |
---|
35 | 28 | | then true |
---|
36 | | - | else (now.timestamp >= lastLockTime)) |
---|
| 29 | + | else (height >= lastLockTime)) |
---|
37 | 30 | | then WriteSet([DataEntry(lockName, i.caller.bytes), DataEntry(lockNameUntil, until)]) |
---|
38 | 31 | | else throw("Lock cant be locked") |
---|
39 | 32 | | } |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let nameUntilSuffux = ":until" |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func getLock (lockName,until) = { |
---|
8 | 8 | | let lockNameUntil = (lockName + nameUntilSuffux) |
---|
9 | | - | let nowUnion = blockInfoByHeight(height) |
---|
10 | | - | let now = match nowUnion { |
---|
11 | | - | case t: BlockInfo => |
---|
12 | | - | t |
---|
13 | | - | case _ => |
---|
14 | | - | throw("Cannot get last block") |
---|
15 | | - | } |
---|
16 | | - | let q = if ((now.timestamp >= until)) |
---|
| 9 | + | let q = if ((height >= until)) |
---|
17 | 10 | | then throw("Supplied until is too low") |
---|
18 | 11 | | else true |
---|
19 | | - | let qq = if ((until > (now.timestamp + 600000))) |
---|
| 12 | + | let qq = if ((until > (height + 10))) |
---|
20 | 13 | | then throw("Supplied until is too high") |
---|
21 | 14 | | else true |
---|
22 | 15 | | let canBeLocked = match getBinary(this, lockName) { |
---|
23 | 16 | | case b: ByteVector => |
---|
24 | 17 | | (b == i.caller.bytes) |
---|
25 | 18 | | case Unit => |
---|
26 | 19 | | true |
---|
27 | 20 | | } |
---|
28 | 21 | | let lastLockTime = match getInteger(this, lockNameUntil) { |
---|
29 | 22 | | case t: Int => |
---|
30 | 23 | | t |
---|
31 | 24 | | case Unit => |
---|
32 | 25 | | 0 |
---|
33 | 26 | | } |
---|
34 | 27 | | if (if (canBeLocked) |
---|
35 | 28 | | then true |
---|
36 | | - | else (now.timestamp >= lastLockTime)) |
---|
| 29 | + | else (height >= lastLockTime)) |
---|
37 | 30 | | then WriteSet([DataEntry(lockName, i.caller.bytes), DataEntry(lockNameUntil, until)]) |
---|
38 | 31 | | else throw("Lock cant be locked") |
---|
39 | 32 | | } |
---|
40 | 33 | | |
---|
41 | 34 | | |
---|