tx · 3kCgctn8UTQtPQPzqTq415tFqZjJFrHGjwRY4TcwnaDj 3N7KPSUwpMgvDEVGw1DYBnKDiixSQUXhn2P: -0.01000000 Waves 2023.05.30 20:35 [2601018] smart account 3N7KPSUwpMgvDEVGw1DYBnKDiixSQUXhn2P > SELF 0.00000000 Waves
{ "type": 13, "id": "3kCgctn8UTQtPQPzqTq415tFqZjJFrHGjwRY4TcwnaDj", "fee": 1000000, "feeAssetId": null, "timestamp": 1685468192989, "version": 2, "chainId": 84, "sender": "3N7KPSUwpMgvDEVGw1DYBnKDiixSQUXhn2P", "senderPublicKey": "BTvXQMmkgSf57dbcqWxpEvbi3ZYcEeWFkkXDZC6FrneM", "proofs": [ "Mz9qLR4TGdXf2ts4YJyvUGUsCHB6x6HrruUyMLcAbaqpTXrhMcQS8UQ1NFDSMY84eTSUQaj9539pqi9DAqdKyuH" ], "script": "base64:AAIFAAAAAAAAAAsIAhIAEgASAwoBAQAAAAEAAAAADG93bmVyQWRkcmVzcwIAAAAjM012akFhRFlIcFM0QTVLNENWM2taTU1FSDltOUpkQlN2YnEAAAADAAAAAWkBAAAABGNhbGwAAAAABAAAAAVhc3NldAkABEMAAAAHAgAAAAVBc3NldAIAAAAAAAAAAAAAAAABAAAAAAAAAAAABgUAAAAEdW5pdAAAAAAAAAAAAAQAAAAHYXNzZXRJZAkABDgAAAABBQAAAAVhc3NldAkABEwAAAACCQEAAAALQmluYXJ5RW50cnkAAAACAgAAAANiaW4BAAAAAAkABEwAAAACCQEAAAAMQm9vbGVhbkVudHJ5AAAAAgIAAAAEYm9vbAYJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAICAAAAA2ludAAAAAAAAAAAAQkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACAgAAAANzdHICAAAAAAkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABAgAAAANzdHIJAARMAAAAAgUAAAAFYXNzZXQJAARMAAAAAgkBAAAAB1JlaXNzdWUAAAADBQAAAAdh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QEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwkAASwAAAACAgAAAA1wbGF0Zm9ybV9iYWxfBQAAAAZDYWxsZXIDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAQAAAAJbmV3QW1vdW50CQAAZQAAAAIFAAAADWN1cnJlbnRBbW91bnQFAAAAEGFtb3VudFRvV2l0aERyYXcDCQEAAAACIT0AAAACBQAAAAZDYWxsZXIFAAAADG93bmVyQWRkcmVzcwkAAAIAAAABAgAAAA5Ob3QgQXV0aG9yaXplZAMJAAAAAAAAAgUAAAANY3VycmVudEFtb3VudAAAAAAAAAAAAAkAAAIAAAABAgAAAB1ObyBzdWZmaWNlbnQgYW1vdW50IGF2YWlsYWJsZQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAAAxwbGF0Zm9ybV9iYWwFAAAADG93bmVyQWRkcmVzcwUAAAAJbmV3QW1vdW50CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAQYW1vdW50VG9XaXRoRHJhdwUAAAAEdW5pdAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXm6CGPm", "height": 2601018, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: F1T9jL21SiYgoqz2yFnLacJhjVFZcvRxnoe9DC6D4ExS Next: 6iKwBM18VxhwvsPGHhtiahvXFSFeFqNmgfzvT75eTCyG Diff:
Old | New | Differences | |
---|---|---|---|
15 | 15 | @Callable(i) | |
16 | 16 | func deposit () = { | |
17 | 17 | let currentKey = toBase58String(i.caller.bytes) | |
18 | - | let amount = i.payments[0].amount | |
18 | + | let depositAmount = (i.payments[0].amount - 5000000) | |
19 | + | let platformfee = 5000000 | |
19 | 20 | let totalPlatformFee = getIntegerValue(this, ("platform_bal" + ownerAddress)) | |
20 | - | let platformFeeInc = (totalPlatformFee + | |
21 | - | [IntegerEntry(("balance_" + currentKey), | |
21 | + | let platformFeeInc = (totalPlatformFee + platformfee) | |
22 | + | [IntegerEntry(("balance_" + currentKey), depositAmount), IntegerEntry(("platform_bal_" + ownerAddress), platformFeeInc)] | |
22 | 23 | } | |
23 | 24 | ||
24 | 25 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let ownerAddress = "3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq" | |
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func call () = { | |
8 | 8 | let asset = Issue("Asset", "", 1, 0, true, unit, 0) | |
9 | 9 | let assetId = calculateAssetId(asset) | |
10 | 10 | [BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), asset, Reissue(assetId, 1, false), Burn(assetId, 1), ScriptTransfer(i.caller, 1, assetId)] | |
11 | 11 | } | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | ||
15 | 15 | @Callable(i) | |
16 | 16 | func deposit () = { | |
17 | 17 | let currentKey = toBase58String(i.caller.bytes) | |
18 | - | let amount = i.payments[0].amount | |
18 | + | let depositAmount = (i.payments[0].amount - 5000000) | |
19 | + | let platformfee = 5000000 | |
19 | 20 | let totalPlatformFee = getIntegerValue(this, ("platform_bal" + ownerAddress)) | |
20 | - | let platformFeeInc = (totalPlatformFee + | |
21 | - | [IntegerEntry(("balance_" + currentKey), | |
21 | + | let platformFeeInc = (totalPlatformFee + platformfee) | |
22 | + | [IntegerEntry(("balance_" + currentKey), depositAmount), IntegerEntry(("platform_bal_" + ownerAddress), platformFeeInc)] | |
22 | 23 | } | |
23 | 24 | ||
24 | 25 | ||
25 | 26 | ||
26 | 27 | @Callable(i) | |
27 | 28 | func withDraw (amountToWithDraw) = { | |
28 | 29 | let Caller = toBase58String(i.caller.bytes) | |
29 | 30 | let currentKey = toBase58String(i.caller.bytes) | |
30 | 31 | let currentAmount = match getInteger(this, ("platform_bal_" + Caller)) { | |
31 | 32 | case a: Int => | |
32 | 33 | a | |
33 | 34 | case _ => | |
34 | 35 | 0 | |
35 | 36 | } | |
36 | 37 | let newAmount = (currentAmount - amountToWithDraw) | |
37 | 38 | if ((Caller != ownerAddress)) | |
38 | 39 | then throw("Not Authorized") | |
39 | 40 | else if ((currentAmount == 0)) | |
40 | 41 | then throw("No sufficent amount available") | |
41 | 42 | else [IntegerEntry(("platform_bal" + ownerAddress), newAmount), ScriptTransfer(i.caller, amountToWithDraw, unit)] | |
42 | 43 | } | |
43 | 44 | ||
44 | 45 | ||
45 | 46 | @Verifier(tx) | |
46 | 47 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
47 | 48 |
github/deemru/w8io/169f3d6 33.63 ms ◑