tx · FsV3QqpdiavdfbEG7S7qe3yfUxGkL6w1nhZ2A63Jf7KU
3MpRDrT92zK6yWJh47UdA8mRDH7f2F3CSzH: -0.01000000 Waves
2021.10.31 03:44 [1769784] smart account 3MpRDrT92zK6yWJh47UdA8mRDH7f2F3CSzH > SELF 0.00000000 Waves
{
"type": 13,
"id": "FsV3QqpdiavdfbEG7S7qe3yfUxGkL6w1nhZ2A63Jf7KU",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1635641038878,
"version": 2,
"chainId": 84,
"sender": "3MpRDrT92zK6yWJh47UdA8mRDH7f2F3CSzH",
"senderPublicKey": "6it1s6XyHkFTbzgCJPXSeHjyLYixDHy6hJgzzfbntDGB",
"proofs": [
"2FCvUu2n11XzG7cgb8LceDubGuvJfktoXeoaMvT6HMSD3qwZmXZMkAyhS77DtTJ2H3emL685gLpVbEELvpxrnU7n"
],
"script": "base64:AAIFAAAAAAAAAAwIAhIDCgEIEgMKAQEAAAAFAAAAAAZtZHN0aWQBAAAAIAYu1kRFDCnSZz0aQgjpMvwys70UJVtRnhDUh1FQYpqKAAAAAAtnb29kYWNjb3VudAIAAAAjM016WHFvMnJCeGMzWEVLUFZjWUhEcnNnUDdqbUU2Y0dnNkMAAAAADU9yYWNsZUFkZHJlc3MJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVQFgs5g7sHJWLf0iLmoL9RVDbyuM78yCVYAAAAAA3VzZAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAANT3JhY2xlQWRkcmVzcwIAAAAHdXNkcmF0ZQEAAAALaXNQYXltZW50T2sAAAABAAAAAWkDCQAAAAAAAAIJAAGQAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAJAAACAAAAAQIAAAAUUGF5bWVudCBub3QgYXR0YWNoZWQEAAAAAXAJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAAByRtYXRjaDAIBQAAAAFwAAAAB2Fzc2V0SWQJAABnAAAAAggFAAAAAXAAAAAGYW1vdW50AAAAABdIdugAAAAAAgAAAAFpAQAAAAdidXltZHN0AAAAAQAAAAl0aGVTdHJpbmcDCQEAAAALaXNQYXltZW50T2sAAAABBQAAAAFpBAAAAAJwcAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAEYW1udAgFAAAAAnBwAAAABmFtb3VudAQAAAAKbWRzdGFtb3VudAkAAGgAAAACCQAAaAAAAAIFAAAABGFtbnQFAAAAA3VzZAAAAAAAAAAnEAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIFAAAACm1kc3RhbW91bnQFAAAABm1kc3RpZAUAAAADbmlsCQAAAgAAAAECAAAAHVdyb25nIHBheW1lbnQgYW1vdW50IG9yIGFzc2V0AAAAAWkBAAAACmNoYW5nZXJhdGUAAAABAAAABHJhdGUEAAAAB2NvbXBhcmUJAAQlAAAAAQgFAAAAAWkAAAAGY2FsbGVyAwkAAAAAAAACBQAAAAdjb21wYXJlBQAAAAtnb29kYWNjb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgIAAAAHdXNkcmF0ZQUAAAAEcmF0ZQUAAAADbmlsCQAAAgAAAAECAAAAC0JBRCBBQ0NPVU5UAAAAADvtons=",
"height": 1769784,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 9TA1SaZTWpWXuz6ew8wiq5RweA4aL3inasZTgJodMywA
Next: Eth3dHDLR2xk4nFpvzmS2q94bYUeKsJbCT7nGvXhZ1XH
Diff:
Old | New | | Differences |
---|
15 | 15 | | let p = i.payments[0] |
---|
16 | 16 | | match p.assetId { |
---|
17 | 17 | | case _ => |
---|
18 | | - | (p.amount >= 50000000) |
---|
| 18 | + | (p.amount >= 100000000000) |
---|
19 | 19 | | } |
---|
20 | 20 | | } |
---|
21 | 21 | | |
---|
|
25 | 25 | | then { |
---|
26 | 26 | | let pp = i.payments[0] |
---|
27 | 27 | | let amnt = pp.amount |
---|
28 | | - | let mdstamount = (((10000 / 1000000000000) * amnt) * usd) |
---|
| 28 | + | let mdstamount = ((amnt * usd) * 10000) |
---|
29 | 29 | | [ScriptTransfer(i.caller, mdstamount, mdstid)] |
---|
30 | 30 | | } |
---|
31 | 31 | | else throw("Wrong payment amount or asset") |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let mdstid = base58'R8sQUmwwAENBL6B5ejGztDh3RzJ3MbKRqK7GtspFxKT' |
---|
5 | 5 | | |
---|
6 | 6 | | let goodaccount = "3MzXqo2rBxc3XEKPVcYHDrsgP7jmE6cGg6C" |
---|
7 | 7 | | |
---|
8 | 8 | | let OracleAddress = Address(base58'3MpRDrT92zK6yWJh47UdA8mRDH7f2F3CSzH') |
---|
9 | 9 | | |
---|
10 | 10 | | let usd = getIntegerValue(OracleAddress, "usdrate") |
---|
11 | 11 | | |
---|
12 | 12 | | func isPaymentOk (i) = if ((size(i.payments) == 0)) |
---|
13 | 13 | | then throw("Payment not attached") |
---|
14 | 14 | | else { |
---|
15 | 15 | | let p = i.payments[0] |
---|
16 | 16 | | match p.assetId { |
---|
17 | 17 | | case _ => |
---|
18 | | - | (p.amount >= 50000000) |
---|
| 18 | + | (p.amount >= 100000000000) |
---|
19 | 19 | | } |
---|
20 | 20 | | } |
---|
21 | 21 | | |
---|
22 | 22 | | |
---|
23 | 23 | | @Callable(i) |
---|
24 | 24 | | func buymdst (theString) = if (isPaymentOk(i)) |
---|
25 | 25 | | then { |
---|
26 | 26 | | let pp = i.payments[0] |
---|
27 | 27 | | let amnt = pp.amount |
---|
28 | | - | let mdstamount = (((10000 / 1000000000000) * amnt) * usd) |
---|
| 28 | + | let mdstamount = ((amnt * usd) * 10000) |
---|
29 | 29 | | [ScriptTransfer(i.caller, mdstamount, mdstid)] |
---|
30 | 30 | | } |
---|
31 | 31 | | else throw("Wrong payment amount or asset") |
---|
32 | 32 | | |
---|
33 | 33 | | |
---|
34 | 34 | | |
---|
35 | 35 | | @Callable(i) |
---|
36 | 36 | | func changerate (rate) = { |
---|
37 | 37 | | let compare = toString(i.caller) |
---|
38 | 38 | | if ((compare == goodaccount)) |
---|
39 | 39 | | then [IntegerEntry("usdrate", rate)] |
---|
40 | 40 | | else throw("BAD ACCOUNT") |
---|
41 | 41 | | } |
---|
42 | 42 | | |
---|
43 | 43 | | |
---|