tx · BuyRzDRkim4Q7ACxiZUcAEqsuy5mVdjx9kCNznM8fxS4

3MpRDrT92zK6yWJh47UdA8mRDH7f2F3CSzH:  -0.01000000 Waves

2021.10.31 02:14 [1769692] smart account 3MpRDrT92zK6yWJh47UdA8mRDH7f2F3CSzH > SELF 0.00000000 Waves

{ "type": 13, "id": "BuyRzDRkim4Q7ACxiZUcAEqsuy5mVdjx9kCNznM8fxS4", "fee": 1000000, "feeAssetId": null, "timestamp": 1635635694770, "version": 2, "chainId": 84, "sender": "3MpRDrT92zK6yWJh47UdA8mRDH7f2F3CSzH", "senderPublicKey": "6it1s6XyHkFTbzgCJPXSeHjyLYixDHy6hJgzzfbntDGB", "proofs": [ "4jXDwftK9V6vrYxhuB6r5tDpgqHiPhHtUmr2XGZbMrZ8tx3k5PXyksX8NNThCrHNiY6p3occrpbrZXjsEJtA2aY1" ], "script": "base64:AAIFAAAAAAAAAAwIAhIDCgEIEgMKAQEAAAAFAAAAAAZtZHN0aWQBAAAAIAYu1kRFDCnSZz0aQgjpMvwys70UJVtRnhDUh1FQYpqKAAAAAAtnb29kYWNjb3VudAIAAAAjM016WHFvMnJCeGMzWEVLUFZjWUhEcnNnUDdqbUU2Y0dnNkMAAAAADU9yYWNsZUFkZHJlc3MJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVQFgs5g7sHJWLf0iLmoL9RVDbyuM78yCVYAAAAAA3VzZAkBAAAAEUBleHRyTmF0aXZlKDEwNTApAAAAAgUAAAANT3JhY2xlQWRkcmVzcwIAAAAHdXNkcmF0ZQEAAAALaXNQYXltZW50T2sAAAABAAAAAWkDCQAAAAAAAAIJAAGQAAAAAQgFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAJAAACAAAAAQIAAAAUUGF5bWVudCBub3QgYXR0YWNoZWQEAAAAAXAJAAGRAAAAAggFAAAAAWkAAAAIcGF5bWVudHMAAAAAAAAAAAAEAAAAByRtYXRjaDAIBQAAAAFwAAAAB2Fzc2V0SWQJAABnAAAAAggFAAAAAXAAAAAGYW1vdW50AAAAAAAF9eEAAAAAAgAAAAFpAQAAAAdidXltZHN0AAAAAQAAAAl0aGVTdHJpbmcDCQEAAAALaXNQYXltZW50T2sAAAABBQAAAAFpBAAAAAJwcAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAEYW1udAgFAAAAAnBwAAAABmFtb3VudAQAAAAKbWRzdGFtb3VudAkAAGkAAAACCQAAaAAAAAIJAABoAAAAAgUAAAAEYW1udAUAAAADdXNkAAAAAAAAACcQAAAAAAAF9eEACQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAKbWRzdGFtb3VudAUAAAAGbWRzdGlkBQAAAANuaWwJAAACAAAAAQIAAAAdV3JvbmcgcGF5bWVudCBhbW91bnQgb3IgYXNzZXQAAAABaQEAAAAKY2hhbmdlcmF0ZQAAAAEAAAAEcmF0ZQQAAAAHY29tcGFyZQkABCUAAAABCAUAAAABaQAAAAZjYWxsZXIDCQAAAAAAAAIFAAAAB2NvbXBhcmUFAAAAC2dvb2RhY2NvdW50CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAAd1c2RyYXRlBQAAAARyYXRlBQAAAANuaWwJAAACAAAAAQIAAAALQkFEIEFDQ09VTlQAAAAAyg991Q==", "height": 1769692, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: EQQLPeXjHcMoDJZHwRqKjDHCZRaDm9VNyeKHf8DYy9KD Next: AvcTkEKL1gLjM1WFK7hhqM2mS8RpTWDCQVsrRJsMNpZG Diff:
OldNewDifferences
44 let mdstid = base58'R8sQUmwwAENBL6B5ejGztDh3RzJ3MbKRqK7GtspFxKT'
55
66 let goodaccount = "3MzXqo2rBxc3XEKPVcYHDrsgP7jmE6cGg6C"
7+
8+let OracleAddress = Address(base58'3MpRDrT92zK6yWJh47UdA8mRDH7f2F3CSzH')
9+
10+let usd = getIntegerValue(OracleAddress, "usdrate")
711
812 func isPaymentOk (i) = if ((size(i.payments) == 0))
913 then throw("Payment not attached")
2125 then {
2226 let pp = i.payments[0]
2327 let amnt = pp.amount
24- let mdstamount = ((amnt * 5000) / 100000000)
28+ let mdstamount = (((amnt * usd) * 10000) / 100000000)
2529 [ScriptTransfer(i.caller, mdstamount, mdstid)]
2630 }
2731 else throw("Wrong payment amount or asset")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let mdstid = base58'R8sQUmwwAENBL6B5ejGztDh3RzJ3MbKRqK7GtspFxKT'
55
66 let goodaccount = "3MzXqo2rBxc3XEKPVcYHDrsgP7jmE6cGg6C"
7+
8+let OracleAddress = Address(base58'3MpRDrT92zK6yWJh47UdA8mRDH7f2F3CSzH')
9+
10+let usd = getIntegerValue(OracleAddress, "usdrate")
711
812 func isPaymentOk (i) = if ((size(i.payments) == 0))
913 then throw("Payment not attached")
1014 else {
1115 let p = i.payments[0]
1216 match p.assetId {
1317 case _ =>
1418 (p.amount >= 100000000)
1519 }
1620 }
1721
1822
1923 @Callable(i)
2024 func buymdst (theString) = if (isPaymentOk(i))
2125 then {
2226 let pp = i.payments[0]
2327 let amnt = pp.amount
24- let mdstamount = ((amnt * 5000) / 100000000)
28+ let mdstamount = (((amnt * usd) * 10000) / 100000000)
2529 [ScriptTransfer(i.caller, mdstamount, mdstid)]
2630 }
2731 else throw("Wrong payment amount or asset")
2832
2933
3034
3135 @Callable(i)
3236 func changerate (rate) = {
3337 let compare = toString(i.caller)
3438 if ((compare == goodaccount))
3539 then [IntegerEntry("usdrate", rate)]
3640 else throw("BAD ACCOUNT")
3741 }
3842
3943

github/deemru/w8io/026f985 
31.57 ms