tx · 6h8YZ7SMBChxb1XVyKK2Mk1HJgvieXhBhcwU3Xhjyup5

3Mt4xfFCxdFFhMyVEZ5XjaTkijskBXLZsC6:  -0.01000000 Waves

2020.09.17 12:57 [1181127] smart account 3Mt4xfFCxdFFhMyVEZ5XjaTkijskBXLZsC6 > SELF 0.00000000 Waves

{ "type": 13, "id": "6h8YZ7SMBChxb1XVyKK2Mk1HJgvieXhBhcwU3Xhjyup5", "fee": 1000000, "feeAssetId": null, "timestamp": 1600336690732, "version": 1, "sender": "3Mt4xfFCxdFFhMyVEZ5XjaTkijskBXLZsC6", "senderPublicKey": "9cQL23KvMUx1GkfMgHxqKoDxXE61fMKq3tfQRKkJVj7v", "proofs": [ "5AfhgfRU1ABhU74eQUY4rumDgvgfhPeNeNwAVqg4RYSkoyB6gz89zk2HnPesJ9uk9kfBKrNx9A3x7gVs4dmtmSTL" ], "script": "base64:AAIDAAAAAAAAAA0IARIECgIIARIDCgEBAAAABgAAAAAQb3JhY2xlQWNjb3VudEtleQIAAAANb3JhY2xlQWNjb3VudAAAAAARbGFzdFByaWNlSW5kZXhLZXkCAAAAC3ByaWNlX2luZGV4AAAAABBwcmljZUluZGV4UHJlZml4AgAAAAxwcmljZV9pbmRleF8AAAAAEXByaWNlSGVpZ2h0UHJlZml4AgAAAAZwcmljZV8AAAAADW9yYWNsZUFjY291bnQJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwUAAAAQb3JhY2xlQWNjb3VudEtleQAAAAAObGFzdFByaWNlSW5kZXgJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMFAAAAEWxhc3RQcmljZUluZGV4S2V5AAAAAgAAAAFpAQAAAARpbml0AAAAAgAAAAFvAAAACnN0YXJ0UHJpY2UJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAEG9yYWNsZUFjY291bnRLZXkFAAAAAW8JAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAEWxhc3RQcmljZUluZGV4S2V5AAAAAAAAAAAACQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAAEHByaWNlSW5kZXhQcmVmaXgCAAAAATAFAAAABmhlaWdodAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACBQAAABFwcmljZUhlaWdodFByZWZpeAkAAaQAAAABBQAAAAZoZWlnaHQFAAAACnN0YXJ0UHJpY2UFAAAAA25pbAAAAAFpAQAAAAlwb3N0UHJpY2UAAAABAAAABXByaWNlAwkBAAAAAiE9AAAAAggFAAAAAWkAAAAGY2FsbGVyBQAAAA1vcmFjbGVBY2NvdW50CQAAAgAAAAECAAAACmRpc2FsbG93ZWQEAAAADW5ld1ByaWNlSW5kZXgJAABkAAAAAgUAAAAObGFzdFByaWNlSW5kZXgAAAAAAAAAAAEJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAEWxhc3RQcmljZUluZGV4S2V5BQAAAA1uZXdQcmljZUluZGV4CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAAEHByaWNlSW5kZXhQcmVmaXgJAAGkAAAAAQUAAAANbmV3UHJpY2VJbmRleAUAAAAGaGVpZ2h0CQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAAEXByaWNlSGVpZ2h0UHJlZml4CQABpAAAAAEFAAAABmhlaWdodAUAAAAFcHJpY2UFAAAAA25pbAAAAACEGDFe", "chainId": 84, "height": 1181127, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
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 
15.82 ms