tx · DpgeXiBTNXkExnv9LTbDgKz4hNw12d4boZ7Ah7EnLor8
3MpRDrT92zK6yWJh47UdA8mRDH7f2F3CSzH: -0.01000000 Waves
2021.10.31 04:29 [1769830] smart account 3MpRDrT92zK6yWJh47UdA8mRDH7f2F3CSzH > SELF 0.00000000 Waves
{
"type": 13,
"id": "DpgeXiBTNXkExnv9LTbDgKz4hNw12d4boZ7Ah7EnLor8",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1635643782401,
"version": 2,
"chainId": 84,
"sender": "3MpRDrT92zK6yWJh47UdA8mRDH7f2F3CSzH",
"senderPublicKey": "6it1s6XyHkFTbzgCJPXSeHjyLYixDHy6hJgzzfbntDGB",
"proofs": [
"4Q1ep16otnosGWaMzXGepP69piaT9tad4CZgJXa4gFFoj9wFqi651XfXUZD61ioYdLd6cgqofcPjqR92Ti5BACHF"
],
"script": "base64:AAIFAAAAAAAAAAwIAhIDCgEIEgMKAQEAAAAHAAAAAAZtZHN0aWQBAAAAIAYu1kRFDCnSZz0aQgjpMvwys70UJVtRnhDUh1FQYpqKAAAAAAtnb29kYWNjb3VudAIAAAAjM016WHFvMnJCeGMzWEVLUFZjWUhEcnNnUDdqbUU2Y0dnNkMAAAAADU9yYWNsZUFkZHJlc3MJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVQFgs5g7sHJWLf0iLmoL9RVDbyuM78yCVYAAAAABGJhbmQJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVQFgs5g7sHJWLf0iLmoL9RVDbyuM78yCVYAAAAAA3VzZAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAANT3JhY2xlQWRkcmVzcwIAAAAHdXNkcmF0ZQAAAAAHdXNkYmFuZAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAANT3JhY2xlQWRkcmVzcwIAAAAFV0FWRVMBAAAAC2lzUGF5bWVudE9rAAAAAQAAAAFpAwkAAAAAAAACCQABkAAAAAEIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAACQAAAgAAAAECAAAAFFBheW1lbnQgbm90IGF0dGFjaGVkBAAAAAFwCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAABAAAAAckbWF0Y2gwCAUAAAABcAAAAAdhc3NldElkCQAAZwAAAAIIBQAAAAFwAAAABmFtb3VudAAAAAAAAJiWgAAAAAIAAAABaQEAAAAHYnV5bWRzdAAAAAEAAAAJdGhlU3RyaW5nAwkBAAAAC2lzUGF5bWVudE9rAAAAAQUAAAABaQQAAAACcHAJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAABGFtbnQIBQAAAAJwcAAAAAZhbW91bnQEAAAACm1kc3RhbW91bnQJAABoAAAAAgkAAGgAAAACCQAAaAAAAAIJAABpAAAAAgUAAAAEYW1udAAAAAAABfXhAAUAAAADdXNkAAAAAAAAACcQAAAAAAAAAABkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAKbWRzdGFtb3VudAUAAAAGbWRzdGlkBQAAAANuaWwJAAACAAAAAQIAAAAdV3JvbmcgcGF5bWVudCBhbW91bnQgb3IgYXNzZXQAAAABaQEAAAAKY2hhbmdlcmF0ZQAAAAEAAAAEcmF0ZQQAAAAHY29tcGFyZQkABCUAAAABCAUAAAABaQAAAAZjYWxsZXIDCQAAAAAAAAIFAAAAB2NvbXBhcmUFAAAAC2dvb2RhY2NvdW50CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAd1c2RyYXRlBQAAAARyYXRlBQAAAANuaWwJAAACAAAAAQIAAAALQkFEIEFDQ09VTlQAAAAA66Ax9Q==",
"height": 1769830,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: BaofEAFmfAE7bpT6g5QzkRMZq4D6mDZdNJ4FSCQPm2kY
Next: F7Rhbqe7114mtoL5Ycs2wEngBhjHfZrvhhAB1vt2MVdH
Diff:
Old | New | | Differences |
---|
7 | 7 | | |
---|
8 | 8 | | let OracleAddress = Address(base58'3MpRDrT92zK6yWJh47UdA8mRDH7f2F3CSzH') |
---|
9 | 9 | | |
---|
| 10 | + | let band = Address(base58'3MpRDrT92zK6yWJh47UdA8mRDH7f2F3CSzH') |
---|
| 11 | + | |
---|
10 | 12 | | let usd = getIntegerValue(OracleAddress, "usdrate") |
---|
| 13 | + | |
---|
| 14 | + | let usdband = getIntegerValue(OracleAddress, "WAVES") |
---|
11 | 15 | | |
---|
12 | 16 | | func isPaymentOk (i) = if ((size(i.payments) == 0)) |
---|
13 | 17 | | then throw("Payment not attached") |
---|
|
25 | 29 | | then { |
---|
26 | 30 | | let pp = i.payments[0] |
---|
27 | 31 | | let amnt = pp.amount |
---|
28 | | - | let mdstamount = (((amnt * usd) * 100000) / 100000000) |
---|
| 32 | + | let mdstamount = ((((amnt / 100000000) * usd) * 10000) * 100) |
---|
29 | 33 | | [ScriptTransfer(i.caller, mdstamount, mdstid)] |
---|
30 | 34 | | } |
---|
31 | 35 | | 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 | + | let band = Address(base58'3MpRDrT92zK6yWJh47UdA8mRDH7f2F3CSzH') |
---|
| 11 | + | |
---|
10 | 12 | | let usd = getIntegerValue(OracleAddress, "usdrate") |
---|
| 13 | + | |
---|
| 14 | + | let usdband = getIntegerValue(OracleAddress, "WAVES") |
---|
11 | 15 | | |
---|
12 | 16 | | func isPaymentOk (i) = if ((size(i.payments) == 0)) |
---|
13 | 17 | | then throw("Payment not attached") |
---|
14 | 18 | | else { |
---|
15 | 19 | | let p = i.payments[0] |
---|
16 | 20 | | match p.assetId { |
---|
17 | 21 | | case _ => |
---|
18 | 22 | | (p.amount >= 10000000) |
---|
19 | 23 | | } |
---|
20 | 24 | | } |
---|
21 | 25 | | |
---|
22 | 26 | | |
---|
23 | 27 | | @Callable(i) |
---|
24 | 28 | | func buymdst (theString) = if (isPaymentOk(i)) |
---|
25 | 29 | | then { |
---|
26 | 30 | | let pp = i.payments[0] |
---|
27 | 31 | | let amnt = pp.amount |
---|
28 | | - | let mdstamount = (((amnt * usd) * 100000) / 100000000) |
---|
| 32 | + | let mdstamount = ((((amnt / 100000000) * usd) * 10000) * 100) |
---|
29 | 33 | | [ScriptTransfer(i.caller, mdstamount, mdstid)] |
---|
30 | 34 | | } |
---|
31 | 35 | | else throw("Wrong payment amount or asset") |
---|
32 | 36 | | |
---|
33 | 37 | | |
---|
34 | 38 | | |
---|
35 | 39 | | @Callable(i) |
---|
36 | 40 | | func changerate (rate) = { |
---|
37 | 41 | | let compare = toString(i.caller) |
---|
38 | 42 | | if ((compare == goodaccount)) |
---|
39 | 43 | | then [IntegerEntry("usdrate", rate)] |
---|
40 | 44 | | else throw("BAD ACCOUNT") |
---|
41 | 45 | | } |
---|
42 | 46 | | |
---|
43 | 47 | | |
---|