tx · Ft9qRTsfpESnD3br7jqtrUpPrj8z7agwkrF4ypXsuXng 3MsRuV3XVXXGBp5X3UUZqg7ez7jDDJz7weW: -0.01000000 Waves 2020.07.28 14:38 [1107382] smart account 3MsRuV3XVXXGBp5X3UUZqg7ez7jDDJz7weW > SELF 0.00000000 Waves
{ "type": 13, "id": "Ft9qRTsfpESnD3br7jqtrUpPrj8z7agwkrF4ypXsuXng", "fee": 1000000, "feeAssetId": null, "timestamp": 1595936345141, "version": 1, "sender": "3MsRuV3XVXXGBp5X3UUZqg7ez7jDDJz7weW", "senderPublicKey": "CbCE2brrQyKsnf38mpm6ubhBULm9kxP8iMgrS5eYrCoa", "proofs": [ "EHB6s1njvZVS7dhTUAA95R9e9SSA1KbgES3URwor8ihdAy9AqybaxtusVWsY18LNki3mLYNaeWz5LHoXzrsVSzw" ], "script": "base64:AAIDAAAAAAAAAA0IARIECgIIARIDCgEBAAAABAAAAAAQb3JhY2xlQWNjb3VudEtleQIAAAANb3JhY2xlQWNjb3VudAAAAAAObGFzdFByaWNlSWRLZXkCAAAAC2xhc3RQcmljZUlkAAAAAA1vcmFjbGVBY2NvdW50CQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAEJAQAAABFAZXh0ck5hdGl2ZSgxMDUzKQAAAAIFAAAABHRoaXMFAAAAEG9yYWNsZUFjY291bnRLZXkAAAAAC2xhc3RQcmljZUlkCQEAAAARQGV4dHJOYXRpdmUoMTA1MCkAAAACBQAAAAR0aGlzBQAAAA5sYXN0UHJpY2VJZEtleQAAAAIAAAABaQEAAAAEaW5pdAAAAAIAAAABbwAAAApzdGFydFByaWNlCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAABBvcmFjbGVBY2NvdW50S2V5BQAAAAFvCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACBQAAAA5sYXN0UHJpY2VJZEtleQAAAAAAAAAAAAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgIAAAABMAUAAAAKc3RhcnRQcmljZQUAAAADbmlsAAAAAWkBAAAACXBvc3RQcmljZQAAAAEAAAAFcHJpY2UDCQEAAAACIT0AAAACCAUAAAABaQAAAAZjYWxsZXIFAAAADW9yYWNsZUFjY291bnQJAAACAAAAAQIAAAAKZGlzYWxsb3dlZAQAAAAKY3VyUHJpY2VJZAkAAGQAAAACBQAAAAtsYXN0UHJpY2VJZAAAAAAAAAAAAQkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgUAAAAObGFzdFByaWNlSWRLZXkFAAAACmN1clByaWNlSWQJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAAGkAAAAAQUAAAAKY3VyUHJpY2VJZAUAAAAFcHJpY2UFAAAAA25pbAAAAAAN1P0n", "chainId": 84, "height": 1107382, "spentComplexity": 0 } View: original | compacted Prev: none Next: CkVAujADqGz4BkYUgZygj3RkAJtZihhvjPPc4UZtZsLF 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/026f985 38.09 ms ◑