tx · 42HrqDkBZAukkc5AJ1ZvxuYpyq2uqCGXyMDfyZ8YFAE9 3Mpm2vmub5QRknAQAa2qgTRKhtevrdMDdE4: -0.01000000 Waves 2020.10.12 16:27 [1217396] smart account 3Mpm2vmub5QRknAQAa2qgTRKhtevrdMDdE4 > SELF 0.00000000 Waves
{ "type": 13, "id": "42HrqDkBZAukkc5AJ1ZvxuYpyq2uqCGXyMDfyZ8YFAE9", "fee": 1000000, "feeAssetId": null, "timestamp": 1602509260522, "version": 1, "sender": "3Mpm2vmub5QRknAQAa2qgTRKhtevrdMDdE4", "senderPublicKey": "DEufZhwPGgMN1foHe9USrtxg2Tjjzp3yHSxWnXe1FaPJ", "proofs": [ "2CpW4vRaDmgfaQcUbfzGNedXfmi7gzkQxteqHDHFEYK4WPMdkbZJTJUErXi2bAwHUmM6B3bR7ktRHsYrzUfXUwQX" ], "script": "base64:AAIDAAAAAAAAAA0IARIECgIIARIDCgEBAAAABgAAAAAQb3JhY2xlQWNjb3VudEtleQIAAAANb3JhY2xlQWNjb3VudAAAAAARbGFzdFByaWNlSW5kZXhLZXkCAAAAC3ByaWNlX2luZGV4AAAAABBwcmljZUluZGV4UHJlZml4AgAAAAxwcmljZV9pbmRleF8AAAAAEXByaWNlSGVpZ2h0UHJlZml4AgAAAAZwcmljZV8AAAAADW9yYWNsZUFjY291bnQJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwUAAAAQb3JhY2xlQWNjb3VudEtleQAAAAAObGFzdFByaWNlSW5kZXgJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMFAAAAEWxhc3RQcmljZUluZGV4S2V5AAAAAgAAAAFpAQAAAARpbml0AAAAAgAAAAFvAAAACnN0YXJ0UHJpY2UJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAEG9yYWNsZUFjY291bnRLZXkFAAAAAW8JAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAEWxhc3RQcmljZUluZGV4S2V5AAAAAAAAAAAACQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAAEHByaWNlSW5kZXhQcmVmaXgCAAAAATAFAAAABmhlaWdodAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACBQAAABFwcmljZUhlaWdodFByZWZpeAkAAaQAAAABBQAAAAZoZWlnaHQFAAAACnN0YXJ0UHJpY2UFAAAAA25pbAAAAAFpAQAAAAlwb3N0UHJpY2UAAAABAAAABXByaWNlAwkBAAAAAiE9AAAAAggFAAAAAWkAAAAGY2FsbGVyBQAAAA1vcmFjbGVBY2NvdW50CQAAAgAAAAECAAAACmRpc2FsbG93ZWQEAAAADW5ld1ByaWNlSW5kZXgJAABkAAAAAgUAAAAObGFzdFByaWNlSW5kZXgAAAAAAAAAAAEJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAEWxhc3RQcmljZUluZGV4S2V5BQAAAA1uZXdQcmljZUluZGV4CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAAEHByaWNlSW5kZXhQcmVmaXgJAAGkAAAAAQUAAAANbmV3UHJpY2VJbmRleAUAAAAGaGVpZ2h0CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAAEXByaWNlSGVpZ2h0UHJlZml4CQABpAAAAAEFAAAABmhlaWdodAUAAAAFcHJpY2UFAAAAA25pbAAAAACEGDFe", "chainId": 84, "height": 1217396, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 3 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let oracleAccountKey = "oracleAccount" | |
5 | + | ||
6 | + | let lastPriceIndexKey = "price_index" | |
7 | + | ||
8 | + | let priceIndexPrefix = "price_index_" | |
9 | + | ||
10 | + | let priceHeightPrefix = "price_" | |
11 | + | ||
12 | + | let oracleAccount = addressFromStringValue(getStringValue(this, oracleAccountKey)) | |
13 | + | ||
14 | + | let lastPriceIndex = getIntegerValue(this, lastPriceIndexKey) | |
15 | + | ||
16 | + | @Callable(i) | |
17 | + | func init (o,startPrice) = WriteSet([DataEntry(oracleAccountKey, o), DataEntry(lastPriceIndexKey, 0), DataEntry((priceIndexPrefix + "0"), height), DataEntry((priceHeightPrefix + toString(height)), startPrice)]) | |
18 | + | ||
19 | + | ||
20 | + | ||
21 | + | @Callable(i) | |
22 | + | func postPrice (price) = if ((i.caller != oracleAccount)) | |
23 | + | then throw("disallowed") | |
24 | + | else { | |
25 | + | let newPriceIndex = (lastPriceIndex + 1) | |
26 | + | WriteSet([DataEntry(lastPriceIndexKey, newPriceIndex), DataEntry((priceIndexPrefix + toString(newPriceIndex)), height), DataEntry((priceHeightPrefix + toString(height)), price)]) | |
27 | + | } | |
28 | + | ||
29 | + |
github/deemru/w8io/026f985 13.07 ms ◑