tx · HURkJMycQXQsJw5SXMLfYv4H9eUEENkjFRE3iUxPCQWp
3NCEnW5hTnRQ7J9TFQsHS4W92f54PCCWQvN: -0.01400000 Waves
2020.02.03 14:43 [882935] smart account 3NCEnW5hTnRQ7J9TFQsHS4W92f54PCCWQvN > SELF 0.00000000 Waves
{
"type": 13,
"id": "HURkJMycQXQsJw5SXMLfYv4H9eUEENkjFRE3iUxPCQWp",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1580730266399,
"version": 1,
"sender": "3NCEnW5hTnRQ7J9TFQsHS4W92f54PCCWQvN",
"senderPublicKey": "8PUyJHGVRUxhY118c4H5isGCGLYgRBmcSzNYooDAqwh",
"proofs": [
"5LerMgCvMryFxEMyK42Duj7MvvsvAXUqL6JhnmZEjixDDtdzZzjQCMvwPbhK8WwBhkxsnek6azs5HPMjyrwsP4xH"
],
"script": "base64:AAIDAAAAAAAAAAcIARIDCgEIAAAAAAAAAAEAAAABaQEAAAAUdHJ5R2V0NjAwU2Vjb25kc0xvY2sAAAABAAAACGxvY2tOYW1lBAAAAA1sb2NrVW50aWxOYW1lCQABLAAAAAIFAAAACGxvY2tOYW1lAgAAAAYvdW50aWwEAAAAA25vdwQAAAAHJG1hdGNoMAkAA+0AAAABBQAAAAZoZWlnaHQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACUJsb2NrSW5mbwQAAAABYgUAAAAHJG1hdGNoMAgFAAAAAWIAAAAJdGltZXN0YW1wAAAAAAAAAAAABAAAAAhsb2NrZWRCeQQAAAAHJG1hdGNoMAkABBwAAAACBQAAAAR0aGlzBQAAAAhsb2NrTmFtZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAKQnl0ZVZlY3RvcgQAAAABYgUAAAAHJG1hdGNoMAUAAAABYggIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAALbG9ja2VkVW50aWwEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAANbG9ja1VudGlsTmFtZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAV1bnRpbAUAAAAHJG1hdGNoMAUAAAAFdW50aWwAAAAAAAAAAAAEAAAAB2NhbkxvY2sDCQAAZgAAAAIFAAAAA25vdwUAAAALbG9ja2VkVW50aWwGCQAAAAAAAAIFAAAACGxvY2tlZEJ5CAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAwUAAAAHY2FuTG9jawkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAIbG9ja05hbWUICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAADWxvY2tVbnRpbE5hbWUJAABkAAAAAgUAAAADbm93AAAAAAAAAAJYBQAAAANuaWwJAAACAAAAAQIAAAAZQWxyZWFkeSBsb2NrZWQgYnkgYW5vdGhlcgAAAABplNu0",
"chainId": 84,
"height": 882935,
"spentComplexity": 0
}
View: original | compacted
Prev: 8DRYuJaQCiMYgsWw4YpNMtQN7QfKKrmMVkxaTqYB8L2w
Next: W8MCsbjMoyEDj4vhLsWUZRoSHm6CNzo6doWc9v5WCZ2
Diff:
Old | New | | Differences |
---|
29 | 29 | | else (lockedBy == i.caller.bytes) |
---|
30 | 30 | | if (canLock) |
---|
31 | 31 | | then WriteSet([DataEntry(lockName, i.caller.bytes), DataEntry(lockUntilName, (now + 600))]) |
---|
32 | | - | else WriteSet([DataEntry(lockName, lockedBy), DataEntry(lockUntilName, lockedUntil)]) |
---|
| 32 | + | else throw("Already locked by another") |
---|
33 | 33 | | } |
---|
34 | 34 | | |
---|
35 | 35 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 3 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | |
---|
5 | 5 | | |
---|
6 | 6 | | @Callable(i) |
---|
7 | 7 | | func tryGet600SecondsLock (lockName) = { |
---|
8 | 8 | | let lockUntilName = (lockName + "/until") |
---|
9 | 9 | | let now = match blockInfoByHeight(height) { |
---|
10 | 10 | | case b: BlockInfo => |
---|
11 | 11 | | b.timestamp |
---|
12 | 12 | | case _ => |
---|
13 | 13 | | 0 |
---|
14 | 14 | | } |
---|
15 | 15 | | let lockedBy = match getBinary(this, lockName) { |
---|
16 | 16 | | case b: ByteVector => |
---|
17 | 17 | | b |
---|
18 | 18 | | case _ => |
---|
19 | 19 | | i.caller.bytes |
---|
20 | 20 | | } |
---|
21 | 21 | | let lockedUntil = match getInteger(this, lockUntilName) { |
---|
22 | 22 | | case until: Int => |
---|
23 | 23 | | until |
---|
24 | 24 | | case _ => |
---|
25 | 25 | | 0 |
---|
26 | 26 | | } |
---|
27 | 27 | | let canLock = if ((now > lockedUntil)) |
---|
28 | 28 | | then true |
---|
29 | 29 | | else (lockedBy == i.caller.bytes) |
---|
30 | 30 | | if (canLock) |
---|
31 | 31 | | then WriteSet([DataEntry(lockName, i.caller.bytes), DataEntry(lockUntilName, (now + 600))]) |
---|
32 | | - | else WriteSet([DataEntry(lockName, lockedBy), DataEntry(lockUntilName, lockedUntil)]) |
---|
| 32 | + | else throw("Already locked by another") |
---|
33 | 33 | | } |
---|
34 | 34 | | |
---|
35 | 35 | | |
---|