tx · Gr1w5ArjpHRXNHFtk73GHP8Aoks2PZx7tRr4u2nzNb9w 3N87CDQXvwT2seFcukEutRZZa5NWhZuvzq2: -0.01000000 Waves 2020.04.13 17:08 [952719] smart account 3N87CDQXvwT2seFcukEutRZZa5NWhZuvzq2 > SELF 0.00000000 Waves
{ "type": 13, "id": "Gr1w5ArjpHRXNHFtk73GHP8Aoks2PZx7tRr4u2nzNb9w", "fee": 1000000, "feeAssetId": null, "timestamp": 1586786921084, "version": 1, "sender": "3N87CDQXvwT2seFcukEutRZZa5NWhZuvzq2", "senderPublicKey": "FrxHfdzYvm9piv8N2YiCadKgfdxxcYP8KdbuRetnnR9Z", "proofs": [ "52jcQuSn7ATiCbBtmCHMeFCaMaiMT94njF8J1B8aeYyASzTdqSkoNkwpWdFSQc7FCw5HSXzPZihufHQP7Cokgfe9" ], "script": "base64:AAIDAAAAAAAAAA0IARIECgIIARIDCgEBAAAABAAAAAAQb3JhY2xlQWNjb3VudEtleQIAAAANb3JhY2xlQWNjb3VudAAAAAAObGFzdFByaWNlSWRLZXkCAAAAC2xhc3RQcmljZUlkAAAAAA1vcmFjbGVBY2NvdW50CQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAEJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMFAAAAEG9yYWNsZUFjY291bnRLZXkAAAAAC2xhc3RQcmljZUlkCQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAAR0aGlzBQAAAA5sYXN0UHJpY2VJZEtleQAAAAIAAAABaQEAAAAEaW5pdAAAAAIAAAABbwAAAApzdGFydFByaWNlCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAABBvcmFjbGVBY2NvdW50S2V5BQAAAAFvCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAA5sYXN0UHJpY2VJZEtleQAAAAAAAAAAAAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAABMAUAAAAKc3RhcnRQcmljZQUAAAADbmlsAAAAAWkBAAAACXBvc3RQcmljZQAAAAEAAAAFcHJpY2UDCQEAAAACIT0AAAACCAUAAAABaQAAAAZjYWxsZXIFAAAADW9yYWNsZUFjY291bnQJAAACAAAAAQIAAAAKZGlzYWxsb3dlZAQAAAAKY3VyUHJpY2VJZAkAAGQAAAACBQAAAAtsYXN0UHJpY2VJZAAAAAAAAAAAAQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAObGFzdFByaWNlSWRLZXkFAAAACmN1clByaWNlSWQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAGkAAAAAQUAAAAKY3VyUHJpY2VJZAUAAAAFcHJpY2UFAAAAA25pbAAAAAAN1P0n", "chainId": 84, "height": 952719, "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 30.87 ms ◑