tx · 2C6pgdwhXuPye7QoDAvuFCztFprwanYLA4NPkScNz7L7
3MpRDrT92zK6yWJh47UdA8mRDH7f2F3CSzH: -0.01000000 Waves
2021.10.31 04:53 [1769855] smart account 3MpRDrT92zK6yWJh47UdA8mRDH7f2F3CSzH > SELF 0.00000000 Waves
{
"type": 13,
"id": "2C6pgdwhXuPye7QoDAvuFCztFprwanYLA4NPkScNz7L7",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1635645250766,
"version": 2,
"chainId": 84,
"sender": "3MpRDrT92zK6yWJh47UdA8mRDH7f2F3CSzH",
"senderPublicKey": "6it1s6XyHkFTbzgCJPXSeHjyLYixDHy6hJgzzfbntDGB",
"proofs": [
"4WASmC4QAVnezRgsH3vp86pGZzAUoBs8t7Q7HBH7goZM9NAgMRJdmHCHr8p3gxGtTpLJgovwUdpmzqhPChRKhNUS"
],
"script": "base64:AAIFAAAAAAAAABEIAhIDCgEIEgMKAQgSAwoBAQAAAAUAAAAABm1kc3RpZAEAAAAgBi7WREUMKdJnPRpCCOky/DKzvRQlW1GeENSHUVBimooAAAAAC2dvb2RhY2NvdW50AgAAACMzTXpYcW8yckJ4YzNYRUtQVmNZSERyc2dQN2ptRTZjR2c2QwAAAAANT3JhY2xlQWRkcmVzcwkBAAAAB0FkZHJlc3MAAAABAQAAABoBVAWCzmDuwclYt/SIuagv1FUNvK4zvzIJVgAAAAADdXNkCQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAA1PcmFjbGVBZGRyZXNzAgAAAAd1c2RyYXRlAQAAAAtpc1BheW1lbnRPawAAAAEAAAABaQMJAAAAAAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAkAAAIAAAABAgAAABRQYXltZW50IG5vdCBhdHRhY2hlZAQAAAABcAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAHJG1hdGNoMAgFAAAAAXAAAAAHYXNzZXRJZAkAAGcAAAACCA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HJ5AAAAAgIAAAAHdXNkcmF0ZQUAAAAEcmF0ZQUAAAADbmlsCQAAAgAAAAECAAAAC0JBRCBBQ0NPVU5UAAAAACyDVwU=",
"height": 1769855,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: BPx6ZqErW9PSEpC8ZuWiudXZCu4ZfxXJ4gZqXPrNAwWY
Next: none
Diff:
Old | New | | Differences |
---|
25 | 25 | | then { |
---|
26 | 26 | | let pp = i.payments[0] |
---|
27 | 27 | | let amnt = pp.amount |
---|
| 28 | + | let mdstamount = (((amnt / 1000000) * usd) * 5000) |
---|
| 29 | + | [ScriptTransfer(i.caller, mdstamount, mdstid)] |
---|
| 30 | + | } |
---|
| 31 | + | else throw("Wrong payment amount or asset") |
---|
| 32 | + | |
---|
| 33 | + | |
---|
| 34 | + | |
---|
| 35 | + | @Callable(i) |
---|
| 36 | + | func privmdst (theString) = if (isPaymentOk(i)) |
---|
| 37 | + | then { |
---|
| 38 | + | let pp = i.payments[0] |
---|
| 39 | + | let amnt = pp.amount |
---|
28 | 40 | | let mdstamount = (((amnt / 1000000) * usd) * 10000) |
---|
29 | 41 | | [ScriptTransfer(i.caller, mdstamount, mdstid)] |
---|
30 | 42 | | } |
---|
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 | 18 | | (p.amount >= 10000000) |
---|
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 = (((amnt / 1000000) * usd) * 5000) |
---|
| 29 | + | [ScriptTransfer(i.caller, mdstamount, mdstid)] |
---|
| 30 | + | } |
---|
| 31 | + | else throw("Wrong payment amount or asset") |
---|
| 32 | + | |
---|
| 33 | + | |
---|
| 34 | + | |
---|
| 35 | + | @Callable(i) |
---|
| 36 | + | func privmdst (theString) = if (isPaymentOk(i)) |
---|
| 37 | + | then { |
---|
| 38 | + | let pp = i.payments[0] |
---|
| 39 | + | let amnt = pp.amount |
---|
28 | 40 | | let mdstamount = (((amnt / 1000000) * usd) * 10000) |
---|
29 | 41 | | [ScriptTransfer(i.caller, mdstamount, mdstid)] |
---|
30 | 42 | | } |
---|
31 | 43 | | else throw("Wrong payment amount or asset") |
---|
32 | 44 | | |
---|
33 | 45 | | |
---|
34 | 46 | | |
---|
35 | 47 | | @Callable(i) |
---|
36 | 48 | | func changerate (rate) = { |
---|
37 | 49 | | let compare = toString(i.caller) |
---|
38 | 50 | | if ((compare == goodaccount)) |
---|
39 | 51 | | then [IntegerEntry("usdrate", rate)] |
---|
40 | 52 | | else throw("BAD ACCOUNT") |
---|
41 | 53 | | } |
---|
42 | 54 | | |
---|
43 | 55 | | |
---|