tx · CQBMATMLzsT36KeDfLrW5CV5pCL7r2dJtFKQbQqSCsnE

3MwuRJoXoSjMeXnEUrLPgRz99wNiAuU9CBR:  -0.01000000 Waves

2019.11.03 11:46 [748480] smart account 3MwuRJoXoSjMeXnEUrLPgRz99wNiAuU9CBR > SELF 0.00000000 Waves

{ "type": 13, "id": "CQBMATMLzsT36KeDfLrW5CV5pCL7r2dJtFKQbQqSCsnE", "fee": 1000000, "feeAssetId": null, "timestamp": 1572770753141, "version": 1, "sender": "3MwuRJoXoSjMeXnEUrLPgRz99wNiAuU9CBR", "senderPublicKey": "yUsSKsNhgnpSG5NTFt4oRnHShxqriS8ATaHyG9qon5e", "proofs": [ "9jGSk5fjm8XqLhEvccSss971eTna57wRqu4Buk2h8XmYnhaTjbW1E98PALY5WyDeezv8eubwDXsKiufv2puJpDf" ], "script": "base64:AAIDAAAAAAAAABYIARIGCgQICAEIEgUKAwgBCBIDCgEIAAAAAAAAAAMAAAABaQEAAAAMZW5yb2xsRW1wUGF5AAAABAAAAAhlbXBsb3llZQAAAAVlbXBJZAAAAAZhbW91bnQAAAALZGVzY3JpcHRpb24DAwkAAAAAAAACBQAAAAR0aGlzCAUAAAABaQAAAAZjYWxsZXIJAQAAAAEhAAAAAQkBAAAACWlzRGVmaW5lZAAAAAEJAAQbAAAAAgUAAAAEdGhpcwkAASwAAAACBQAAAAhlbXBsb3llZQIAAAAGX3N0YXRlBwkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACBQAAAAhlbXBsb3llZQIAAAAGX3N0YXRlAgAAAAhlbnJvbGxlZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACBQAAAAhlbXBsb3llZQIAAAADX2lkBQAAAAVlbXBJZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACBQAAAAhlbXBsb3llZQIAAAAHX2Ftb3VudAUAAAAGYW1vdW50CQAETAAAAAIJ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AAAAFUVtcGxveWVlIG5vdCBlbnJvbGxlZAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAGucsQkg==", "chainId": 84, "height": 748480, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 3 #-}
2+{-# SCRIPT_TYPE ACCOUNT #-}
3+{-# CONTENT_TYPE DAPP #-}
4+
5+
6+@Callable(i)
7+func enrollEmpPay (employee,empId,amount,description) = if (if ((this == i.caller))
8+ then !(isDefined(getBoolean(this, (employee + "_state"))))
9+ else false)
10+ then WriteSet([DataEntry((employee + "_state"), "enrolled"), DataEntry((employee + "_id"), empId), DataEntry((employee + "_amount"), amount), DataEntry((employee + "_description"), description), DataEntry((employee + "_enrolledBy"), toBase58String(i.caller.bytes))])
11+ else throw((("Pay for " + employee) + " has already been enrolled or caller is not dApp owner"))
12+
13+
14+
15+@Callable(i)
16+func reviseEmpPay (employee,amount,description) = if ((this == i.caller))
17+ then {
18+ let desc = match getString(this, (employee + "_description")) {
19+ case x: Unit =>
20+ "unset"
21+ case x: String =>
22+ ((x + "; Revised: ") + description)
23+ case _ =>
24+ throw()
25+ }
26+ WriteSet([DataEntry((employee + "_amount"), amount), DataEntry((employee + "_description"), desc), DataEntry((employee + "_revisedBy"), toBase58String(i.caller.bytes))])
27+ }
28+ else throw("Caller is not dApp owner")
29+
30+
31+
32+@Callable(i)
33+func payEmp (employee) = {
34+ let callerStr = toBase58String(i.caller.bytes)
35+ let status = match getString(this, (employee + "_state")) {
36+ case x: Unit =>
37+ "unset"
38+ case x: String =>
39+ x
40+ case _ =>
41+ throw()
42+ }
43+ let amount = extract(getInteger(this, (employee + "_amount")))
44+ if ((status == "enrolled"))
45+ then ScriptResult(WriteSet([DataEntry((employee + "_paidBy"), callerStr)]), TransferSet([ScriptTransfer(addressFromStringValue(value(employee)), amount, unit)]))
46+ else throw("Employee not enrolled")
47+ }
48+
49+
50+@Verifier(tx)
51+func verify () = true
52+

github/deemru/w8io/026f985 
13.59 ms