tx · yc97PsrZuyjsZSQYTXJcEsuuCqH8ExS8ynCjZKfNNDk 3N8bFgGAcpHq16dVYvjKD4cDEk4PbKwnx8j: -0.01000000 Waves 2019.11.03 10:36 [748411] smart account 3N8bFgGAcpHq16dVYvjKD4cDEk4PbKwnx8j > SELF 0.00000000 Waves
{ "type": 13, "id": "yc97PsrZuyjsZSQYTXJcEsuuCqH8ExS8ynCjZKfNNDk", "fee": 1000000, "feeAssetId": null, "timestamp": 1572766640030, "version": 1, "sender": "3N8bFgGAcpHq16dVYvjKD4cDEk4PbKwnx8j", "senderPublicKey": "DCmgu7g8zeogV1b7VfHzjun6P4fgi1eYbqyyMB41oigh", "proofs": [ "4cgRYnxPkMC31RBj62MiAZcjuNpnZCFyjntwBbRJVtFt48nXN1ANXnZAp32wEcN38UhCEoHneyPX4SHZDVxzEik8" ], "script": "base64:AAIDAAAAAAAAAA8IARIGCgQICAEIEgMKAQgAAAAAAAAAAgAAAAFpAQAAAAxlbnJvbGxFbXBQYXkAAAAEAAAACGVtcGxveWVlAAAABWVtcElkAAAABmFtb3VudAAAAAtkZXNjcmlwdGlvbgMDCQAAAAAAAAIFAAAABHRoaXMIBQAAAAFpAAAABmNhbGxlcgkBAAAAASEAAAABCQEAAAAJaXNEZWZpbmVkAAAAAQkABBsAAAACBQAAAAR0aGlzCQABLAAAAAIFAAAACGVtcGxveWVlAgAAAAZfc3RhdGUHCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAACGVtcGxveWVlAgAAAAZfc3RhdGUCAAAACGVucm9sbGVkCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAACGVtcGxveWVlAgAAAANfaWQFAAAABWVtcElkCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAACGVtcGxveWVlAgAAAAdfYW1vdW50BQAAAAZhbW91bnQJAARMAAAAAgkBAAAACURhdGFFbnRy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AAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAHQWRkcmVzcwAAAAEJAAGbAAAAAQUAAAAIZW1wbG95ZWUFAAAABmFtb3VudAUAAAAEdW5pdAUAAAADbmlsCQAAAgAAAAECAAAAFUVtcGxveWVlIG5vdCBlbnJvbGxlZAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAGOKYCbQ==", "chainId": 84, "height": 748411, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
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 payEmp (employee) = { | |
17 | + | let callerStr = toBase58String(i.caller.bytes) | |
18 | + | let status = match getString(this, (employee + "_state")) { | |
19 | + | case x: Unit => | |
20 | + | "unset" | |
21 | + | case x: String => | |
22 | + | x | |
23 | + | case _ => | |
24 | + | throw() | |
25 | + | } | |
26 | + | let amount = extract(getInteger(this, (employee + "_amount"))) | |
27 | + | if ((status == "enrolled")) | |
28 | + | then ScriptResult(WriteSet([DataEntry((employee + "_paidBy"), callerStr)]), TransferSet([ScriptTransfer(Address(toBytes(employee)), amount, unit)])) | |
29 | + | else throw("Employee not enrolled") | |
30 | + | } | |
31 | + | ||
32 | + | ||
33 | + | @Verifier(tx) | |
34 | + | func verify () = true | |
35 | + |
github/deemru/w8io/169f3d6 21.38 ms ◑