tx · mU4csBEqu3JYmLi29v7oUQYtmxYu76Ydvp2meVL2mBU 3N4SWvz9XFb2r2kbtmuXmTX8GecawXbanW4: -0.01000000 Waves 2020.05.05 19:19 [985041] smart account 3N4SWvz9XFb2r2kbtmuXmTX8GecawXbanW4 > SELF 0.00000000 Waves
{ "type": 13, "id": "mU4csBEqu3JYmLi29v7oUQYtmxYu76Ydvp2meVL2mBU", "fee": 1000000, "feeAssetId": null, "timestamp": 1588695549055, "version": 1, "sender": "3N4SWvz9XFb2r2kbtmuXmTX8GecawXbanW4", "senderPublicKey": "98mEcMjicjCtcFBUbKEDYxysAipxKnu2jPDdAqv6aFQA", "proofs": [ "4Ta18Ur8UdLPpb68CnHbK8ckWfFWrtaJzfFPTRS6PGiPfdLUsSgjRmSzPJUmoyqW2Yq3G4pCpgiuwKnRDLfZyzFK" ], "script": "base64:AAIDAAAAAAAAAAAAAAAEAAAAABBvcmFjbGVBY2NvdW50S2V5AgAAAA1vcmFjbGVBY2NvdW50AAAAAA5sYXN0UHJpY2VJZEtleQIAAAALbGFzdFByaWNlSWQAAAAADW9yYWNsZUFjY291bnQJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQkBAAAAEUBleHRyTmF0aXZlKDEwNTMpAAAAAgUAAAAEdGhpcwUAAAAQb3JhY2xlQWNjb3VudEtleQAAAAALbGFzdFByaWNlSWQJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMFAAAADmxhc3RQcmljZUlkS2V5AAAAAgAAAAFpAQAAAARpbml0AAAAAgAAAAFvAAAACnN0YXJ0UHJpY2UJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAAEG9yYWNsZUFjY291bnRLZXkFAAAAAW8JAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAADmxhc3RQcmljZUlkS2V5AAAAAAAAAAAACQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACAgAAAAEwBQAAAApzdGFydFByaWNlBQAAAANuaWwAAAABaQEAAAAJcG9zdFByaWNlAAAAAQAAAAVwcmljZQMJAQAAAAIhPQAAAAIIBQAAAAFpAAAABmNhbGxlcgUAAAANb3JhY2xlQWNjb3VudAkAAAIAAAABAgAAAApkaXNhbGxvd2VkBAAAAApjdXJQcmljZUlkCQAAZAAAAAIFAAAAC2xhc3RQcmljZUlkAAAAAAAAAAABCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAA5sYXN0UHJpY2VJZEtleQUAAAAKY3VyUHJpY2VJZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAAaQAAAABBQAAAApjdXJQcmljZUlkBQAAAAVwcmljZQUAAAADbmlsAAAAAK6lPnw=", "chainId": 84, "height": 985041, "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 lastPriceIdKey = "lastPriceId" | |
7 | + | ||
8 | + | let oracleAccount = addressFromStringValue(getStringValue(this, oracleAccountKey)) | |
9 | + | ||
10 | + | let lastPriceId = getIntegerValue(this, lastPriceIdKey) | |
11 | + | ||
12 | + | @Callable(i) | |
13 | + | func init (o,startPrice) = WriteSet([DataEntry(oracleAccountKey, o), DataEntry(lastPriceIdKey, 0), DataEntry("0", startPrice)]) | |
14 | + | ||
15 | + | ||
16 | + | ||
17 | + | @Callable(i) | |
18 | + | func postPrice (price) = if ((i.caller != oracleAccount)) | |
19 | + | then throw("disallowed") | |
20 | + | else { | |
21 | + | let curPriceId = (lastPriceId + 1) | |
22 | + | WriteSet([DataEntry(lastPriceIdKey, curPriceId), DataEntry(toString(curPriceId), price)]) | |
23 | + | } | |
24 | + | ||
25 | + |
github/deemru/w8io/169f3d6 34.65 ms ◑