tx · 3qMQWCiY5DtG93VetDdy6GEc3dedkN6qQhh76CHoU9Wn
3N47VNUyRs9LtYQjfh1wXoonwtxrk351iQ4: -0.01400000 Waves
2021.05.15 23:32 [1527288] smart account 3N47VNUyRs9LtYQjfh1wXoonwtxrk351iQ4 > SELF 0.00000000 Waves
{
"type": 13,
"id": "3qMQWCiY5DtG93VetDdy6GEc3dedkN6qQhh76CHoU9Wn",
"fee": 1400000,
"feeAssetId": null,
"timestamp": 1621110827649,
"version": 2,
"chainId": 84,
"sender": "3N47VNUyRs9LtYQjfh1wXoonwtxrk351iQ4",
"senderPublicKey": "6L6mk8eadmViy8hb3fDkBs1maSLoVepN2mVL4wom2pus",
"proofs": [
"yrVfz8nccxrgmfQJTxrhdvcDHqfhEJbEXtxPHYhG5BVzMka6AjoyHcybWJ8FZQZtpVivP61gEQU2a1kCJkgGnQJ"
],
"script": "base64:AAIEAAAAAAAAAAQIAhIAAAAACQAAAAAMSXNCbG9ja2VkS2V5AgAAAAppc19ibG9ja2VkAAAAABVNaW5XYXZlc1N3YXBBbW91bnRLZXkCAAAAFW1pbl93YXZlc19zd2FwX2Ftb3VudAAAAAAFUHJpY2UCAAAAEHdhdmVzX3N3YXBfcHJpY2UAAAAADHNwb25zb3JUb2tlbgEAAAAgiimbqD+pXxZsa6mEHFK5HrXQwc9lDG9yw+t1Fa8UsbAAAAAAAmRiCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABAgAAACMzTjVFQzJxZFVmeEprZ3liYTZWajZQMmc2eFNCd3ljZTdqYwAAAAAHZGl2aWRlcgAAAAAAAJiWgAAAAAASbWluV2F2ZXNTd2FwQW1vdW50CQEAAAALdmFsdWVPckVsc2UAAAACCQAEGgAAAAIFAAAAAmRiBQAAABVNaW5XYXZlc1N3YXBBbW91bnRLZXkAAAAAAAAAAAAAAAAACWlzQmxvY2tlZAkBAAAAC3ZhbHVlT3JFbHNlAAAAAgkABBsAAAACBQAAAAJkYgUAAAAMSXNCbG9ja2VkS2V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AAAAnR4AAAAD3NlbmRlclB1YmxpY0tlebWjWDg=",
"height": 1527288,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: CC8wrSu8HofTzfg8LTveyzRRhLAH7RNv3Fpyr5QSfU8T
Next: none
Diff:
Old | New | | Differences |
---|
5 | 5 | | |
---|
6 | 6 | | let MinWavesSwapAmountKey = "min_waves_swap_amount" |
---|
7 | 7 | | |
---|
| 8 | + | let Price = "waves_swap_price" |
---|
| 9 | + | |
---|
8 | 10 | | let sponsorToken = base58'AJL4X2MaR3QZski33QRMeFZLonS6BnkcR1X72MJW8e31' |
---|
9 | 11 | | |
---|
10 | 12 | | let db = addressFromStringValue("3N5EC2qdUfxJkgyba6Vj6P2g6xSBwyce7jc") |
---|
11 | | - | |
---|
12 | | - | let price = 90 |
---|
13 | 13 | | |
---|
14 | 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 | + | |
---|
| 20 | + | let price = valueOrElse(getInteger(db, Price), 0) |
---|
19 | 21 | | |
---|
20 | 22 | | @Callable(i) |
---|
21 | 23 | | func buyAsset () = { |
---|
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 | + | let Price = "waves_swap_price" |
---|
| 9 | + | |
---|
8 | 10 | | let sponsorToken = base58'AJL4X2MaR3QZski33QRMeFZLonS6BnkcR1X72MJW8e31' |
---|
9 | 11 | | |
---|
10 | 12 | | let db = addressFromStringValue("3N5EC2qdUfxJkgyba6Vj6P2g6xSBwyce7jc") |
---|
11 | | - | |
---|
12 | | - | let price = 90 |
---|
13 | 13 | | |
---|
14 | 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 | + | |
---|
| 20 | + | let price = valueOrElse(getInteger(db, Price), 0) |
---|
19 | 21 | | |
---|
20 | 22 | | @Callable(i) |
---|
21 | 23 | | func buyAsset () = { |
---|
22 | 24 | | let pmt = value(i.payments[0]) |
---|
23 | 25 | | let account = toString(i.caller) |
---|
24 | 26 | | if ((minWavesSwapAmount > pmt.amount)) |
---|
25 | 27 | | then throw((("The specified Waves amount is less than the required minimum of " + toString(minWavesSwapAmount)) + " wavelets.")) |
---|
26 | 28 | | else if (isDefined(pmt.assetId)) |
---|
27 | 29 | | then throw("Only Waves token is allowed for swapping.") |
---|
28 | 30 | | else if (isBlocked) |
---|
29 | 31 | | then throw("contract is blocked by EMERGENCY SHUTDOWN actions untill reactivation by emergency oracles") |
---|
30 | 32 | | else [ScriptTransfer(i.caller, fraction(pmt.amount, price, divider), sponsorToken)] |
---|
31 | 33 | | } |
---|
32 | 34 | | |
---|
33 | 35 | | |
---|
34 | 36 | | @Verifier(tx) |
---|
35 | 37 | | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
36 | 38 | | |
---|