tx · 4DKMwwTmYD2ruPkY9K1iDfVHpbhdNVi3XwRRe1E3M7H1 3N12oUKe89XdJsvWgx6ncAJTF6Bk8rP3sfP: -0.01000000 Waves 2022.12.28 10:16 [2379810] smart account 3N12oUKe89XdJsvWgx6ncAJTF6Bk8rP3sfP > SELF 0.00000000 Waves
{ "type": 13, "id": "4DKMwwTmYD2ruPkY9K1iDfVHpbhdNVi3XwRRe1E3M7H1", "fee": 1000000, "feeAssetId": null, "timestamp": 1672211798248, "version": 2, "chainId": 84, "sender": "3N12oUKe89XdJsvWgx6ncAJTF6Bk8rP3sfP", "senderPublicKey": "Aqi2u6UsFt6ePp65gz14SdCvKwP4t3CqiDejGBk7mWuj", "proofs": [ "5FCNeLXnLYzPMTATkHWev2Baj9Qt4XEXdicdREYQ4xHkdavTGDiYJ6Ukz2LN2FnKBMK4xN3tpv7ET7Xez7iMTz3c" ], "script": "base64:AAIFAAAAAAAAAAcIAhIDCgEIAAAABwAAAAAGYWRtUHViAQAAACCSM3T/ncM6OSW7t5MIo6BoPvkjQ8aifQCkP8tVwO8YJgAAAAAHZ2F0ZXdheQkBAAAAB0FkZHJlc3MAAAABAQAAABoBVHnur5oRfizEyRQme70fRz4o30Oc3NsESgAAAAAERU5OTwEAAAAg9X6hLSUj8vDDdWwKn9+MJZEpOFonVhnZN5VgGw+Pz70AAAAAB25leHRLZXkCAAAABl9uZXh0XwAAAAAKbmV4dFBlcmlvZAAAAAAAAAAFoAAAAAANc2VuZEFtb3VudEtleQIAAAAGX3NlbmRfAQAAAAtpc1BheW1lbnRPawAAAAEAAAABaQQAAAARYWNjZXB0YWJsZUFzc2V0SWQFAAAABEVOTk8DCQAAAAAAAAIJAAGQAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAJAAACAAAAAQIAAAAUUGF5bWVudCBub3QgYXR0YWNoZWQEAAAAAXAJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAADXdhbGxldEJhb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cm4AAAACBQAAAARFTk5PBQAAAA1wYXltZW50QW1vdW50CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIFAAAAB25leHRLZXkFAAAACmN1cnJlbnRLZXkFAAAABG5leHQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgUAAAANc2VuZEFtb3VudEtleQUAAAAKY3VycmVudEtleQUAAAANcGF5bWVudEFtb3VudAUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXl+5aIh", "height": 2379810, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let admPub = base58'Aqi2u6UsFt6ePp65gz14SdCvKwP4t3CqiDejGBk7mWuj' | |
5 | + | ||
6 | + | let gateway = Address(base58'3N12oUKe89XdJsvWgx6ncAJTF6Bk8rP3sfP') | |
7 | + | ||
8 | + | let ENNO = base58'HXJsuwkQmik6jwh7tC3cc6wq45A9Th2pDENH6HHR5vxt' | |
9 | + | ||
10 | + | let nextKey = "_next_" | |
11 | + | ||
12 | + | let nextPeriod = 1440 | |
13 | + | ||
14 | + | let sendAmountKey = "_send_" | |
15 | + | ||
16 | + | func isPaymentOk (i) = { | |
17 | + | let acceptableAssetId = ENNO | |
18 | + | if ((size(i.payments) == 0)) | |
19 | + | then throw("Payment not attached") | |
20 | + | else { | |
21 | + | let p = i.payments[0] | |
22 | + | let walletBalance = assetBalance(i.caller, acceptableAssetId) | |
23 | + | match p.assetId { | |
24 | + | case assetId: ByteVector => | |
25 | + | if ((assetId == acceptableAssetId)) | |
26 | + | then (p.amount > 0) | |
27 | + | else false | |
28 | + | case _ => | |
29 | + | throw("Wrong payment") | |
30 | + | } | |
31 | + | } | |
32 | + | } | |
33 | + | ||
34 | + | ||
35 | + | @Callable(i) | |
36 | + | func send (address) = { | |
37 | + | let currentKey = toBase58String(i.caller.bytes) | |
38 | + | let nextAvailable = valueOrElse(getInteger(this, (nextKey + currentKey)), 0) | |
39 | + | let next = (nextAvailable + nextPeriod) | |
40 | + | let diff = (next - height) | |
41 | + | if ((address == "")) | |
42 | + | then throw("add address") | |
43 | + | else if (if ((1440 >= diff)) | |
44 | + | then (nextAvailable > 0) | |
45 | + | else false) | |
46 | + | then throw("you can not") | |
47 | + | else if (!(isPaymentOk(i))) | |
48 | + | then throw("attach payment") | |
49 | + | else { | |
50 | + | let p = i.payments[0] | |
51 | + | let paymentAmount = p.amount | |
52 | + | [Burn(ENNO, paymentAmount), IntegerEntry((nextKey + currentKey), next), IntegerEntry((sendAmountKey + currentKey), paymentAmount)] | |
53 | + | } | |
54 | + | } | |
55 | + | ||
56 | + | ||
57 | + | @Verifier(tx) | |
58 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
59 | + |
github/deemru/w8io/169f3d6 28.01 ms ◑