tx · 7pLm2T5WqGLkrhpTq33JmkzLzrTPchq2CRZGGAycF7Cz
3N47VNUyRs9LtYQjfh1wXoonwtxrk351iQ4: -0.01400000 Waves
2021.05.15 23:17 [1527272] smart account 3N47VNUyRs9LtYQjfh1wXoonwtxrk351iQ4 > SELF 0.00000000 Waves
{
"type": 13,
"id": "7pLm2T5WqGLkrhpTq33JmkzLzrTPchq2CRZGGAycF7Cz",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1621109863838,
"version": 2,
"chainId": 84,
"sender": "3N47VNUyRs9LtYQjfh1wXoonwtxrk351iQ4",
"senderPublicKey": "6L6mk8eadmViy8hb3fDkBs1maSLoVepN2mVL4wom2pus",
"proofs": [
"5x63H1tA8hkvD45dsKPCm6Tk7dP4fXFLJT8GSuCVM8xZwCYCqkUeBNSUD15MnfmwRBrUtV3sTYvSS2yFuSHwBJsV"
],
"script": "base64:AAIEAAAAAAAAAAQIAhIAAAAACAAAAAAMSXNCbG9ja2VkS2V5AgAAAAppc19ibG9ja2VkAAAAABVNaW5XYXZlc1N3YXBBbW91bnRLZXkCAAAAFW1pbl93YXZlc19zd2FwX2Ftb3VudAAAAAAMc3BvbnNvclRva2VuAQAAACCKKZuoP6lfFmxrqYQcUrketdDBz2UMb3LD63UVrxSxsAAAAAACZGIJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAECAAAAIzNONUVDMnFkVWZ4SmtneWJhNlZqNlAyZzZ4U0J3eWNlN2pjAAAAAAVwcmljZQAAAAAAAAAAAgAAAAAHZGl2aWRlcgAAAAAABfXhAAAAAAASbWluV2F2ZXNTd2FwQW1vdW50CQEAAAALdmFsdWVPckVsc2UAAAACCQAEGgAAAAIFAAAAAmRiBQAAABVNaW5XYXZlc1N3YXBBbW91bnRLZXkAAAAAAAAAAAAAAAAACWlzQmxvY2tlZAkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABBsAAAACBQAAAAJkYgUAAAAMSXNCbG9ja2VkS2V5BwAAAAEAAAABaQ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CHa8jwr4sNN7H5UFhVM9tbej6ShLkEz7V7q9w3SzUN2M
Next: FhmK2Qd89mHueKHU7giLxTqkvprjNqdmcR2FydDv1Q5z
Diff:
Old | New | | Differences |
---|
9 | 9 | | |
---|
10 | 10 | | let db = addressFromStringValue("3N5EC2qdUfxJkgyba6Vj6P2g6xSBwyce7jc") |
---|
11 | 11 | | |
---|
12 | | - | let price = 1 |
---|
| 12 | + | let price = 2 |
---|
| 13 | + | |
---|
| 14 | + | let divider = 100000000 |
---|
13 | 15 | | |
---|
14 | 16 | | let minWavesSwapAmount = valueOrElse(getInteger(db, MinWavesSwapAmountKey), 0) |
---|
15 | 17 | | |
---|
|
25 | 27 | | then throw("Only Waves token is allowed for swapping.") |
---|
26 | 28 | | else if (isBlocked) |
---|
27 | 29 | | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") |
---|
28 | | - | else [ScriptTransfer(i.caller, fraction(pmt.amount, 1, 1), sponsorToken)] |
---|
| 30 | + | else [ScriptTransfer(i.caller, fraction(pmt.amount, price, divider), sponsorToken)] |
---|
29 | 31 | | } |
---|
30 | 32 | | |
---|
31 | 33 | | |
---|
Full:
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 | | - | let price = 1 |
---|
| 12 | + | let price = 2 |
---|
| 13 | + | |
---|
| 14 | + | let divider = 100000000 |
---|
13 | 15 | | |
---|
14 | 16 | | let minWavesSwapAmount = valueOrElse(getInteger(db, MinWavesSwapAmountKey), 0) |
---|
15 | 17 | | |
---|
16 | 18 | | let isBlocked = valueOrElse(getBoolean(db, IsBlockedKey), false) |
---|
17 | 19 | | |
---|
18 | 20 | | @Callable(i) |
---|
19 | 21 | | func buyAsset () = { |
---|
20 | 22 | | let pmt = value(i.payments[0]) |
---|
21 | 23 | | let account = toString(i.caller) |
---|
22 | 24 | | if ((minWavesSwapAmount > pmt.amount)) |
---|
23 | 25 | | then throw((("The specified Waves amount is less than the required minimum of " + toString(minWavesSwapAmount)) + " wavelets.")) |
---|
24 | 26 | | else if (isDefined(pmt.assetId)) |
---|
25 | 27 | | then throw("Only Waves token is allowed for swapping.") |
---|
26 | 28 | | else if (isBlocked) |
---|
27 | 29 | | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") |
---|
28 | | - | else [ScriptTransfer(i.caller, fraction(pmt.amount, 1, 1), sponsorToken)] |
---|
| 30 | + | else [ScriptTransfer(i.caller, fraction(pmt.amount, price, divider), sponsorToken)] |
---|
29 | 31 | | } |
---|
30 | 32 | | |
---|
31 | 33 | | |
---|
32 | 34 | | @Verifier(tx) |
---|
33 | 35 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
34 | 36 | | |
---|