tx · 9zFfuwXYhxftvMUKMfMpShTHHE1YwBazWcSgFtv5Ee8H

3MpUDmnN27gMSxHDEFQLW75epUMECTHDn6E:  -0.01400000 Waves

2020.11.26 11:00 [1282115] smart account 3MpUDmnN27gMSxHDEFQLW75epUMECTHDn6E > SELF 0.00000000 Waves

{ "type": 13, "id": "9zFfuwXYhxftvMUKMfMpShTHHE1YwBazWcSgFtv5Ee8H", "fee": 1400000, "feeAssetId": null, "timestamp": 1606377656350, "version": 2, "chainId": 84, "sender": "3MpUDmnN27gMSxHDEFQLW75epUMECTHDn6E", "senderPublicKey": "FJk5n9i5ysYBtjvPcos6iKm98yzpxms3gECZgg6Y8Bt1", "proofs": [ "ybFi4Hcrr4Vn8wRNT1YBJEes8KLnhdm1Qb4xpUCBaxp4oUN9r979PdRcd8QNYJUvYFn6kLCZAWSYBc5NqGMY32D" ], "script": "base64:AAIEAAAAAAAAAAcIAhIDCgEIAAAABQAAAAAFZGVsYXkAAAAAAAAAAAoAAAAADGFtb3VudFRvR2l2ZQAAAAACVAvkAAAAAAAHYXNzZXRJZAEAAAAg6KVqvMp3QvJwYTI1Sk9Fg7m5HuWZZxfDcerZC6EEresBAAAAD2dldEludGVnZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhCQAAZQAAAAIFAAAABmhlaWdodAUAAAAFZGVsYXkBAAAACGFzU3RyaW5nAAAAAQAAAAJidgQAAAAHJG1hdGNoMAUAAAACYnYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAADYnYwBQAAAAckbWF0Y2gwBQAAAANidjAJAAACAAAAAQIAAAAXQWRkcmVzcyBTdHJpbmcgZXhwZWN0ZWQAAAABAAAAAWkBAAAAB2dldFNpZ24AAAABAAAABGFkZHIEAAAADmxhc3RDYWxsSGV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2VuZGVyUHVibGljS2V5B2rXRSI=", "height": 1282115, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: B4aZPSHXihFqetkCTxWkNp8BxGJzmQJKqnEjE92os9ZL Next: 6FcsZQTwQxxmmLX1AjGG4oRoGKfntFqzZktEM9ijGqJb Diff:
OldNewDifferences
1515 }
1616
1717
18+func asString (bv) = match bv {
19+ case bv0: String =>
20+ bv0
21+ case _ =>
22+ throw("Address String expected")
23+}
24+
25+
1826 @Callable(i)
1927 func getSign (addr) = {
2028 let lastCallHeight = getIntegerByKey(addr)
2836 @Verifier(tx)
2937 func verify () = match tx {
3038 case inv: InvokeScriptTransaction =>
31- true
39+ let lastCallHeight = getIntegerByKey(asString(inv.args[0]))
40+ let canGet = ((height - lastCallHeight) >= delay)
41+ if (canGet)
42+ then (inv.function == "getSign")
43+ else false
3244 case sst: SetScriptTransaction =>
3345 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
3446 case _ =>
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 4 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let delay = 10
55
66 let amountToGive = 10000000000
77
88 let assetId = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a'
99
1010 func getIntegerByKey (key) = match getInteger(this, key) {
1111 case a: Int =>
1212 a
1313 case _ =>
1414 (height - delay)
1515 }
1616
1717
18+func asString (bv) = match bv {
19+ case bv0: String =>
20+ bv0
21+ case _ =>
22+ throw("Address String expected")
23+}
24+
25+
1826 @Callable(i)
1927 func getSign (addr) = {
2028 let lastCallHeight = getIntegerByKey(addr)
2129 let canGet = ((height - lastCallHeight) >= delay)
2230 if (canGet)
2331 then [IntegerEntry(addr, height), ScriptTransfer(Address(fromBase58String(addr)), amountToGive, assetId)]
2432 else throw("You cannot get SIGN Token again yet")
2533 }
2634
2735
2836 @Verifier(tx)
2937 func verify () = match tx {
3038 case inv: InvokeScriptTransaction =>
31- true
39+ let lastCallHeight = getIntegerByKey(asString(inv.args[0]))
40+ let canGet = ((height - lastCallHeight) >= delay)
41+ if (canGet)
42+ then (inv.function == "getSign")
43+ else false
3244 case sst: SetScriptTransaction =>
3345 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
3446 case _ =>
3547 false
3648 }
3749

github/deemru/w8io/026f985 
39.43 ms