tx · FgRKmwBWbK5duirG2QVx6o4Ceb8SJon7QfXeKuGfDLKG 3N5ZhGLzDmoMwHsWKAoTqkFvVYuditKPyvY: -0.01000000 Waves 2022.11.14 16:03 [2316836] smart account 3N5ZhGLzDmoMwHsWKAoTqkFvVYuditKPyvY > SELF 0.00000000 Waves
{ "type": 13, "id": "FgRKmwBWbK5duirG2QVx6o4Ceb8SJon7QfXeKuGfDLKG", "fee": 1000000, "feeAssetId": null, "timestamp": 1668431075293, "version": 2, "chainId": 84, "sender": "3N5ZhGLzDmoMwHsWKAoTqkFvVYuditKPyvY", "senderPublicKey": "7mgUaX6yf7mFk48Gus7kVGRUwCZXtr2CKWJW6KoukPiW", "proofs": [ "2gYaeCBeKbcNJTJCndnGhZSFMSSFokBQ6BZGK8Di7uE2TVtrRHpavyVbD33qXHuQ5u6aMzjgekhZ7R9zKqNpBdQT" ], "script": "base64:AAIFAAAAAAAAAA4IAhIAEgMKAQESAwoBAQAAAAEAAAAABnVzZG5JRAEAAAAgD/IcEqzkxDya7EYaqyWosOy6BytGzG2IcvC14pJJAbQAAAADAAAAAWkBAAAAB2RlcG9zaXQAAAAABAAAAANwbXQJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAABmNhbGxlcgkABCUAAAABCAUAAAABaQAAAAZjYWxsZXIDCQEAAAACIT0AAAACCAUAAAADcG10AAAAB2Fzc2V0SWQFAAAABnVzZG5JRAkAAAIAAAABAgAAAA1JbnZhbGlkIGFzc2V0BAAAAAlkZXBvc2l0ZWQJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQaAAAAAgUAAAAEdGhpcwUAAAAGY2FsbGVyAAAAAAAAAAAABAAAAAFzCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAGY2FsbGVyCQAAZAAAAAIIBQAAAANwbXQAAAAGYW1vdW50BQAAAAlkZXBvc2l0ZWQEAAAAB29uU3Rha2UJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAA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Zm9yV2l0aGRyYXcJAAACAAAAAQIAAAATTm90IGVub3VnaCB0byBjbGFpbQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACBQAAAAZjYWxsZXICAAAACV93aXRoZHJhdwkAAGUAAAACBQAAAAtmb3JXaXRoZHJhdwUAAAAGYW1vdW50CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAGYW1vdW50BQAAAAZ1c2RuSUQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5MC6gng==", "height": 2316836, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5K9e9dPw2NV47zr2VdqywautqEdcNbE78gJVyGQe8yCg Next: none Diff:
Old | New | Differences | |
---|---|---|---|
12 | 12 | else { | |
13 | 13 | let deposited = valueOrElse(getInteger(this, caller), 0) | |
14 | 14 | let s = IntegerEntry(caller, (pmt.amount + deposited)) | |
15 | - | let onStake = valueOrElse(getInteger(this, "_ | |
15 | + | let onStake = valueOrElse(getInteger(this, "_treasury"), 0) | |
16 | 16 | let updateTreasury = IntegerEntry("_treasury", (pmt.amount + onStake)) | |
17 | 17 | [s, updateTreasury] | |
18 | 18 | } |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let usdnID = base58'25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT' | |
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func deposit () = { | |
8 | 8 | let pmt = i.payments[0] | |
9 | 9 | let caller = toString(i.caller) | |
10 | 10 | if ((pmt.assetId != usdnID)) | |
11 | 11 | then throw("Invalid asset") | |
12 | 12 | else { | |
13 | 13 | let deposited = valueOrElse(getInteger(this, caller), 0) | |
14 | 14 | let s = IntegerEntry(caller, (pmt.amount + deposited)) | |
15 | - | let onStake = valueOrElse(getInteger(this, "_ | |
15 | + | let onStake = valueOrElse(getInteger(this, "_treasury"), 0) | |
16 | 16 | let updateTreasury = IntegerEntry("_treasury", (pmt.amount + onStake)) | |
17 | 17 | [s, updateTreasury] | |
18 | 18 | } | |
19 | 19 | } | |
20 | 20 | ||
21 | 21 | ||
22 | 22 | ||
23 | 23 | @Callable(i) | |
24 | 24 | func withdraw (amount) = { | |
25 | 25 | let caller = toString(i.caller) | |
26 | 26 | let pmt = i.payments[0] | |
27 | 27 | let callerBalance = valueOrElse(getInteger(this, caller), 0) | |
28 | 28 | if ((callerBalance == 0)) | |
29 | 29 | then throw("Nothing to withdraw") | |
30 | 30 | else if ((0 >= amount)) | |
31 | 31 | then throw("Invalid input") | |
32 | 32 | else [IntegerEntry(caller, (callerBalance - pmt.amount)), ScriptTransfer(i.caller, pmt.amount, usdnID)] | |
33 | 33 | } | |
34 | 34 | ||
35 | 35 | ||
36 | 36 | ||
37 | 37 | @Callable(i) | |
38 | 38 | func claim (amount) = { | |
39 | 39 | let caller = toString(i.caller) | |
40 | 40 | let forWithdraw = getIntegerValue(this, caller) | |
41 | 41 | if ((amount > forWithdraw)) | |
42 | 42 | then throw("Not enough to claim") | |
43 | 43 | else [IntegerEntry((caller + "_withdraw"), (forWithdraw - amount)), ScriptTransfer(i.caller, amount, usdnID)] | |
44 | 44 | } | |
45 | 45 | ||
46 | 46 | ||
47 | 47 | @Verifier(tx) | |
48 | 48 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
49 | 49 |
github/deemru/w8io/169f3d6 30.91 ms ◑