tx · FhmK2Qd89mHueKHU7giLxTqkvprjNqdmcR2FydDv1Q5z 3N47VNUyRs9LtYQjfh1wXoonwtxrk351iQ4: -0.01400000 Waves 2021.05.15 23:18 [1527273] smart account 3N47VNUyRs9LtYQjfh1wXoonwtxrk351iQ4 > SELF 0.00000000 Waves
{ "type": 13, "id": "FhmK2Qd89mHueKHU7giLxTqkvprjNqdmcR2FydDv1Q5z", "fee": 1400000, "feeAssetId": null, "timestamp": 1621109923124, "version": 2, "chainId": 84, "sender": "3N47VNUyRs9LtYQjfh1wXoonwtxrk351iQ4", "senderPublicKey": "6L6mk8eadmViy8hb3fDkBs1maSLoVepN2mVL4wom2pus", "proofs": [ "3EzZtXMmTiqsTLqZgdVz52S78h3kLBc2iYUD4eMZKtL65X4ZWJP2m2tVbjd4NVnFUsvG7HkZoEpKEJSim6YzSVqc" ], "script": "base64:AAIEAAAAAAAAAAQIAhIAAAAACAAAAAAMSXNCbG9ja2VkS2V5AgAAAAppc19ibG9ja2VkAAAAABVNaW5XYXZlc1N3YXBBbW91bnRLZXkCAAAAFW1pbl93YXZlc19zd2FwX2Ftb3VudAAAAAAMc3BvbnNvclRva2VuAQAAACCKKZuoP6lfFmxrqYQcUrketdDBz2UMb3LD63UVrxSxsAAAAAACZGIJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNONUVDMnFkVWZ4SmtneWJhNlZqNlAyZzZ4U0J3eWNlN2pjAAAAAAVwcmljZQAAAAAAAAAAAgAAAAAHZGl2aWRlcgAAAAAAAJiWgAAAAAASbWluV2F2ZXNTd2FwQW1vdW50CQEAAAALdmFsdWVPckVsc2UAAAACCQAEGgAAAAIFAAAAAmRiBQAAABVNaW5XYXZlc1N3YXBBbW91bnRLZXkAAAAAAAAAAAAAAAAACWlzQmxvY2tlZAkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABBsAAAACBQAAAAJkYgUAAAAMSXNCbG9ja2VkS2V5BwAAAAEAAAABaQEAAAAIYnV5QXNzZXQAAAAABAAAAANwbXQJAQAAAAV2YWx1ZQAAAAEJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAAB2FjY291bnQJAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyAwkAAGYAAAACBQAAABJtaW5XYXZlc1N3YXBBbW91bnQIBQAAAANwbXQAAAAGYW1vdW50CQAAAgAAAAEJAAEsAAAAAgkAASwAAAACAgAAAEBUaGUgc3BlY2lmaWVkIFdhdmVzIGFtb3VudCBpcyBsZXNzIHRoYW4gdGhlIHJlcXVpcmVkIG1pbmltdW0gb2YgCQABpAAAAAEFAAAAEm1pbldhdmVzU3dhcEFtb3VudAIAAAAKIHdhdmVsZXRzLgMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAApT25seSBXYXZlcyB0b2tlbiBpcyBhbGxvd2VkIGZvciBzd2FwcGluZy4DBQAAAAlpc0Jsb2NrZWQJAAACAAAAAQIAAABaY29udHJhY3QgaXMgYmxvY2tlZCBieSBFTUVSR0VOQ1kgU0hVVERPV04gYWN0aW9ucyB1bnRpbGwgcmVhY3RpdmF0aW9uIGJ5IGVtZXJnZW5jeSBvcmFjbGVzCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgkAAGsAAAADCAUAAAADcG10AAAABmFtb3VudAUAAAAFcHJpY2UFAAAAB2RpdmlkZXIFAAAADHNwb25zb3JUb2tlbgUAAAADbmlsAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmmZmk9", "height": 1527273, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 7pLm2T5WqGLkrhpTq33JmkzLzrTPchq2CRZGGAycF7Cz Next: CC8wrSu8HofTzfg8LTveyzRRhLAH7RNv3Fpyr5QSfU8T Diff:
Old | New | Differences | |
---|---|---|---|
11 | 11 | ||
12 | 12 | let price = 2 | |
13 | 13 | ||
14 | - | let divider = | |
14 | + | let divider = 10000000 | |
15 | 15 | ||
16 | 16 | let minWavesSwapAmount = valueOrElse(getInteger(db, MinWavesSwapAmountKey), 0) | |
17 | 17 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let IsBlockedKey = "is_blocked" | |
5 | 5 | ||
6 | 6 | let MinWavesSwapAmountKey = "min_waves_swap_amount" | |
7 | 7 | ||
8 | 8 | let sponsorToken = base58'AJL4X2MaR3QZski33QRMeFZLonS6BnkcR1X72MJW8e31' | |
9 | 9 | ||
10 | 10 | let db = addressFromStringValue("3N5EC2qdUfxJkgyba6Vj6P2g6xSBwyce7jc") | |
11 | 11 | ||
12 | 12 | let price = 2 | |
13 | 13 | ||
14 | - | let divider = | |
14 | + | let divider = 10000000 | |
15 | 15 | ||
16 | 16 | let minWavesSwapAmount = valueOrElse(getInteger(db, MinWavesSwapAmountKey), 0) | |
17 | 17 | ||
18 | 18 | let isBlocked = valueOrElse(getBoolean(db, IsBlockedKey), false) | |
19 | 19 | ||
20 | 20 | @Callable(i) | |
21 | 21 | func buyAsset () = { | |
22 | 22 | let pmt = value(i.payments[0]) | |
23 | 23 | let account = toString(i.caller) | |
24 | 24 | if ((minWavesSwapAmount > pmt.amount)) | |
25 | 25 | then throw((("The specified Waves amount is less than the required minimum of " + toString(minWavesSwapAmount)) + " wavelets.")) | |
26 | 26 | else if (isDefined(pmt.assetId)) | |
27 | 27 | then throw("Only Waves token is allowed for swapping.") | |
28 | 28 | else if (isBlocked) | |
29 | 29 | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") | |
30 | 30 | else [ScriptTransfer(i.caller, fraction(pmt.amount, price, divider), sponsorToken)] | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | @Verifier(tx) | |
35 | 35 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
36 | 36 |
github/deemru/w8io/026f985 25.73 ms ◑