tx · CgmenB83TPBcuHG33UwNGRT17wrD7Sfa48c3PHao9B1p 3N4KbMnJH8FaM94jqxNFe2oyZ8GB7Z8yVBP: -0.01000000 Waves 2023.06.22 16:00 [2633871] smart account 3N4KbMnJH8FaM94jqxNFe2oyZ8GB7Z8yVBP > SELF 0.00000000 Waves
{ "type": 13, "id": "CgmenB83TPBcuHG33UwNGRT17wrD7Sfa48c3PHao9B1p", "fee": 1000000, "feeAssetId": null, "timestamp": 1687438840218, "version": 2, "chainId": 84, "sender": "3N4KbMnJH8FaM94jqxNFe2oyZ8GB7Z8yVBP", "senderPublicKey": "5sTpaMQe2KW8dskXeG41rUyomuUePPeo57FbhuoSsq2R", "proofs": [ "5JXatHtvLKzy6dErtreeUoa67F3Atc7F5X41uDHasirjuxrE1dZENNya35YUbBr9QEugG4CuGWtu8f24H4gAwAh" ], "script": "base64:AAIFAAAAAAAAAA4IAhIECgIIBBIECgIIAQAAAAAAAAACAAAAAWkBAAAACWdldFRXQVA2MAAAAAIAAAAIYXNzZXRTdHIAAAAFZGVidWcEAAAAA3ZhbAMJAAAAAAAAAgUAAAAIYXNzZXRTdHICAAAABVdBVkVTCQAFFAAAAAIFAAAAA25pbAkABRQAAAACCQEAAAALdmFsdWVPckVsc2UAAAACCQAEGgAAAAIFAAAABHRoaXMCAAAAC3ByaWNlX1dBVkVTAAAAAAAAF2RICQEAAAALdmFsdWVPckVsc2UAAAACCQAEGgAAAAIFAAAABHRoaXMCAAAAC3ByaWNlX1dBVkVTAAAAAAAAF2RIAwkAAAAAAAACBQAAAAhhc3NldFN0cgIAAAAsMjVGRXFFalJrcUs2eUNraVQ3THo2U0FZejdnVUZDdHhmQ0NobnJWRkQ1QVQJAAUUAAAAAgUAAAADbmlsCQAFFAAAAAIJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAAQaAAAAAgUAAAAEdGhpcwIAAAAycHJpY2VfMjVGRXFFalJrcUs2eUNraVQ3THo2U0FZejdnVUZDdHhmQ0NobnJWRkQ1Q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RJZAAAAAVwcmljZQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAAAZwcmljZV8FAAAAB2Fzc2V0SWQFAAAABXByaWNlBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleeScySI=", "height": 2633871, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4eEafu7y2PuhiVkMJXjxP86Dhxp6z2kUdFJXfppKvPMP Next: EXRrxED1883mcDgjjnA5B4M2hM2N8R2Kh7wPnumV46b Diff:
Old | New | Differences | |
---|---|---|---|
6 | 6 | @Callable(i) | |
7 | 7 | func getTWAP60 (assetStr,debug) = { | |
8 | 8 | let val = if ((assetStr == "WAVES")) | |
9 | - | then $Tuple2(nil, $Tuple2(1533000, 1533000)) | |
9 | + | then $Tuple2(nil, $Tuple2(valueOrElse(getInteger(this, "price_WAVES"), 1533000), valueOrElse(getInteger(this, "price_WAVES"), 1533000))) | |
10 | 10 | else if ((assetStr == "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT")) | |
11 | - | then $Tuple2(nil, $Tuple2(85633, 85633)) | |
12 | - | else { | |
13 | - | let p = { | |
14 | - | let @ = reentrantInvoke(Address(base58'3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS'), "getShareAssetPriceREADONLY", [assetStr], nil) | |
15 | - | if ($isInstanceOf(@, "Int")) | |
16 | - | then @ | |
17 | - | else throw("Couldn't cast Any to Int") | |
11 | + | then $Tuple2(nil, $Tuple2(valueOrElse(getInteger(this, "price_25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), 85633), valueOrElse(getInteger(this, "price_25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), 85633))) | |
12 | + | else if ((assetStr == "EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc")) | |
13 | + | then $Tuple2(nil, $Tuple2(valueOrElse(getInteger(this, "price_EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc"), 85633), valueOrElse(getInteger(this, "price_EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc"), 85633))) | |
14 | + | else { | |
15 | + | let p = { | |
16 | + | let @ = reentrantInvoke(Address(base58'3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS'), "getShareAssetPriceREADONLY", [assetStr], nil) | |
17 | + | if ($isInstanceOf(@, "Int")) | |
18 | + | then @ | |
19 | + | else throw("Couldn't cast Any to Int") | |
20 | + | } | |
21 | + | if ((p == p)) | |
22 | + | then $Tuple2(nil, $Tuple2(p, p)) | |
23 | + | else throw("Strict value is not equal to itself.") | |
18 | 24 | } | |
19 | - | if ((p == p)) | |
20 | - | then $Tuple2(nil, $Tuple2(p, p)) | |
21 | - | else throw("Strict value is not equal to itself.") | |
22 | - | } | |
23 | 25 | if (debug) | |
24 | 26 | then throw(toString(val._2._1)) | |
25 | 27 | else val | |
26 | 28 | } | |
29 | + | ||
30 | + | ||
31 | + | ||
32 | + | @Callable(i) | |
33 | + | func setPrice (assetId,price) = [IntegerEntry(("price_" + assetId), price)] | |
27 | 34 | ||
28 | 35 | ||
29 | 36 | @Verifier(tx) |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | ||
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func getTWAP60 (assetStr,debug) = { | |
8 | 8 | let val = if ((assetStr == "WAVES")) | |
9 | - | then $Tuple2(nil, $Tuple2(1533000, 1533000)) | |
9 | + | then $Tuple2(nil, $Tuple2(valueOrElse(getInteger(this, "price_WAVES"), 1533000), valueOrElse(getInteger(this, "price_WAVES"), 1533000))) | |
10 | 10 | else if ((assetStr == "25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT")) | |
11 | - | then $Tuple2(nil, $Tuple2(85633, 85633)) | |
12 | - | else { | |
13 | - | let p = { | |
14 | - | let @ = reentrantInvoke(Address(base58'3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS'), "getShareAssetPriceREADONLY", [assetStr], nil) | |
15 | - | if ($isInstanceOf(@, "Int")) | |
16 | - | then @ | |
17 | - | else throw("Couldn't cast Any to Int") | |
11 | + | then $Tuple2(nil, $Tuple2(valueOrElse(getInteger(this, "price_25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), 85633), valueOrElse(getInteger(this, "price_25FEqEjRkqK6yCkiT7Lz6SAYz7gUFCtxfCChnrVFD5AT"), 85633))) | |
12 | + | else if ((assetStr == "EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc")) | |
13 | + | then $Tuple2(nil, $Tuple2(valueOrElse(getInteger(this, "price_EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc"), 85633), valueOrElse(getInteger(this, "price_EMAMLxDnv3xiz8RXg8Btj33jcEw3wLczL3JKYYmuubpc"), 85633))) | |
14 | + | else { | |
15 | + | let p = { | |
16 | + | let @ = reentrantInvoke(Address(base58'3MvRWw2FPEimFCTGtK7qY9uAJbM7XJ4ZfJS'), "getShareAssetPriceREADONLY", [assetStr], nil) | |
17 | + | if ($isInstanceOf(@, "Int")) | |
18 | + | then @ | |
19 | + | else throw("Couldn't cast Any to Int") | |
20 | + | } | |
21 | + | if ((p == p)) | |
22 | + | then $Tuple2(nil, $Tuple2(p, p)) | |
23 | + | else throw("Strict value is not equal to itself.") | |
18 | 24 | } | |
19 | - | if ((p == p)) | |
20 | - | then $Tuple2(nil, $Tuple2(p, p)) | |
21 | - | else throw("Strict value is not equal to itself.") | |
22 | - | } | |
23 | 25 | if (debug) | |
24 | 26 | then throw(toString(val._2._1)) | |
25 | 27 | else val | |
26 | 28 | } | |
29 | + | ||
30 | + | ||
31 | + | ||
32 | + | @Callable(i) | |
33 | + | func setPrice (assetId,price) = [IntegerEntry(("price_" + assetId), price)] | |
27 | 34 | ||
28 | 35 | ||
29 | 36 | @Verifier(tx) | |
30 | 37 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
31 | 38 |
github/deemru/w8io/169f3d6 25.48 ms ◑