tx · AhCShtmr2zhZntHaY2xHSQXqikxVL5gc8Xf9MecTM2hV

3N5hQm6twVhFgf8mKBkJpNhxwcBnpZsPyni:  -0.01400000 Waves

2019.08.19 14:20 [637962] smart account 3N5hQm6twVhFgf8mKBkJpNhxwcBnpZsPyni > SELF 0.00000000 Waves

{ "type": 13, "id": "AhCShtmr2zhZntHaY2xHSQXqikxVL5gc8Xf9MecTM2hV", "fee": 1400000, "feeAssetId": null, "timestamp": 1566213652899, "version": 1, "sender": "3N5hQm6twVhFgf8mKBkJpNhxwcBnpZsPyni", "senderPublicKey": "5qEf6v7n4Cm55KWEaSs76eUft3uwLezLoJeBrf6u9BKE", "proofs": [ "3n9duRzYiprtAnTAjV5QUs3FPiR4PnbwfZEs7puuxSMzSPt7LuynTgZtQegBaKVgPFysNgNRt2pVs4vPqEuTYXjU" ], "script": "base64:AAIDAAAAAAAAAAAAAAAFAAAAAAp3YXZlc1Rva2VuBQAAAAR1bml0AQAAAAlwYXltZW50T2YAAAABAAAAA2tleQkAASwAAAACAgAAAAtwYXltZW50X29mXwUAAAADa2V5AQAAAAhzdGF0dXNPZgAAAAEAAAADa2V5CQABLAAAAAICAAAACnN0YXR1c19vZl8FAAAAA2tleQAAAAAFb3duZXIJAQAAAAV2YWx1ZQAAAAEJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQIAAAAjM041aFFtNnR3VmhGZ2Y4bUtCa0pwTmh4d2NCbnBac1B5bmkBAAAAEGlzUGF5bWVudFBlbmRpbmcAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzCQABLAAAAAICAAAACnN0YXR1c19vZl8FAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFzBQAAAAckbWF0Y2gwCQAAAAAAAAIFAAAAAXMCAAAAB3BlbmRpbmcHAAAAAwAAAAFpAQAAABBzZXRXYWl0VG9QYXltZW50AAAAAgAAAANrZX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mVlbiBwYXllZCBvciByZWplY3RlZAAAAAFpAQAAAAZyZWplY3QAAAABAAAAA2tleQMJAQAAABBpc1BheW1lbnRQZW5kaW5nAAAAAQUAAAADa2V5CQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQEAAAAIc3RhdHVzT2YAAAABBQAAAANrZXkCAAAACHJlamVjdGVkBQAAAANuaWwJAAACAAAAAQIAAAAoT3JkZXIgYWxyZWFkeSBoYXMgYmVlbiBwYXllZCBvciByZWplY3RlZAAAAAARzhSF", "chainId": 84, "height": 637962, "spentComplexity": 0 } View: original | compacted Prev: CSrrtvcWK5PNkVHx3SH6JA5dhUhrLqw3QC1kKeP7Rzay Next: qPgECP2aQ4ByJYJqfoF3ZCAPGyXxuzjq8jLp4XeVC8W Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let ownerKey = "owner"
5-
64 let wavesToken = unit
75
86 func paymentOf (key) = ("payment_of_" + key)
119 func statusOf (key) = ("status_of_" + key)
1210
1311
14-let owner = addressFromStringValue(value(getString(this, ownerKey)))
12+let owner = value(addressFromStringValue("3N5hQm6twVhFgf8mKBkJpNhxwcBnpZsPyni"))
1513
1614 func isPaymentPending (key) = match getString(this, ("status_of_" + key)) {
1715 case s: String =>
1917 case _ =>
2018 false
2119 }
22-
23-
24-@Callable(i)
25-func init (owner,token) = if ((i.caller == this))
26- then WriteSet([DataEntry(ownerKey, owner)])
27- else throw("only dapp itself can init")
28-
2920
3021
3122 @Callable(i)
3930 case a: AttachedPayment =>
4031 if ((a.assetId == unit))
4132 then {
42- let data = WriteSet([DataEntry("status_of_test", "paid")])
43- ScriptResult(data, TransferSet([ScriptTransfer(Address(base58'3N5hQm6twVhFgf8mKBkJpNhxwcBnpZsPyni'), 10, wavesToken)]))
33+ let data = WriteSet([DataEntry(statusOf(key), "paid")])
34+ let payment = extract(getInteger(this, paymentOf(key)))
35+ ScriptResult(data, TransferSet([ScriptTransfer(owner, payment, wavesToken)]))
4436 }
45- else throw("can only WAVES, but got ")
37+ else throw(("can only WAVES, but got " + toBase58String(value(a.assetId))))
4638 case _ =>
4739 throw("payment in assetTokens must be attached")
4840 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-let ownerKey = "owner"
5-
64 let wavesToken = unit
75
86 func paymentOf (key) = ("payment_of_" + key)
97
108
119 func statusOf (key) = ("status_of_" + key)
1210
1311
14-let owner = addressFromStringValue(value(getString(this, ownerKey)))
12+let owner = value(addressFromStringValue("3N5hQm6twVhFgf8mKBkJpNhxwcBnpZsPyni"))
1513
1614 func isPaymentPending (key) = match getString(this, ("status_of_" + key)) {
1715 case s: String =>
1816 (s == "pending")
1917 case _ =>
2018 false
2119 }
22-
23-
24-@Callable(i)
25-func init (owner,token) = if ((i.caller == this))
26- then WriteSet([DataEntry(ownerKey, owner)])
27- else throw("only dapp itself can init")
28-
2920
3021
3122 @Callable(i)
3223 func setWaitToPayment (key,payment) = WriteSet([DataEntry(statusOf(key), "pending"), DataEntry(paymentOf(key), payment)])
3324
3425
3526
3627 @Callable(i)
3728 func pay (key) = if (isPaymentPending(key))
3829 then match i.payment {
3930 case a: AttachedPayment =>
4031 if ((a.assetId == unit))
4132 then {
42- let data = WriteSet([DataEntry("status_of_test", "paid")])
43- ScriptResult(data, TransferSet([ScriptTransfer(Address(base58'3N5hQm6twVhFgf8mKBkJpNhxwcBnpZsPyni'), 10, wavesToken)]))
33+ let data = WriteSet([DataEntry(statusOf(key), "paid")])
34+ let payment = extract(getInteger(this, paymentOf(key)))
35+ ScriptResult(data, TransferSet([ScriptTransfer(owner, payment, wavesToken)]))
4436 }
45- else throw("can only WAVES, but got ")
37+ else throw(("can only WAVES, but got " + toBase58String(value(a.assetId))))
4638 case _ =>
4739 throw("payment in assetTokens must be attached")
4840 }
4941 else throw("Order already has been payed or rejected")
5042
5143
5244
5345 @Callable(i)
5446 func reject (key) = if (isPaymentPending(key))
5547 then WriteSet([DataEntry(statusOf(key), "rejected")])
5648 else throw("Order already has been payed or rejected")
5749
5850

github/deemru/w8io/026f985 
20.56 ms