tx · 27yXFvCua9d8zDbiWrUW5juBNjxs3FEJRWkLFBA6KR5q 3MsqcsQSU3FeyxcMjrRQHcM8pTGrHu8yyWX: -0.01400000 Waves 2019.09.07 21:36 [666028] smart account 3MsqcsQSU3FeyxcMjrRQHcM8pTGrHu8yyWX > SELF 0.00000000 Waves
{ "type": 13, "id": "27yXFvCua9d8zDbiWrUW5juBNjxs3FEJRWkLFBA6KR5q", "fee": 1400000, "feeAssetId": null, "timestamp": 1567881247461, "version": 1, "sender": "3MsqcsQSU3FeyxcMjrRQHcM8pTGrHu8yyWX", "senderPublicKey": "D1oc84fv4treBFDLvPS9vQdrs7A9HwTHxaeK9C7nHRTH", "proofs": [ "2q4QPBXXcfUzWvMuBD83a2yJa7HzvFE6jjbN8QKuN4fgjZ8GsTP81PGxRHMAoPbDxgKkrG7SGNKC3wEaHNATsJfs" ], "script": "base64:AAIDAAAAAAAAAAAAAAAAAAAAAQAAAAFpAQAAAAtjcmVhdGVPcmRlcgAAAAEAAAAFcHJpY2UEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAAASEAAAABCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAIllvdSBuZWVkIHRvIHVzZSB0b2tlbklkLCBub3Qgd2F2ZXMEAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwkBAAAACFdyaXRlU2V0AAAAAQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIFAAAACmN1cnJlbnRLZXkCAAAAAV8JAAJYAAAAAQkBAAAAB2V4dHJhY3QAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQIBQAAAANwbXQAAAAGYW1vdW50BQAAAANuaWwAAAAAP6rOyQ==", "chainId": 84, "height": 666028, "spentComplexity": 0 } View: original | compacted Prev: 9v3CsfASxbavvyL861Kuo217EDEBdrUGLpcvBzq1pdXN Next: 5YduKMkLzpcmLdPy3xGVZXshisWU8wFZPcagTCAi7uwS Full:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | let answersCount = 20 | |
5 | - | ||
6 | - | let answers = ["It is certain.", "It is decidedly so.", "Without a doubt.", "Yes - definitely.", "You may rely on it.", "As I see it, yes.", "Most likely.", "Outlook good.", "Yes.", "Signs point to yes.", "Reply hazy, try again.", "Ask again later.", "Better not tell you now.", "Cannot predict now.", "Concentrate and ask again.", "Don't count on it.", "My reply is no.", "My sources say no.", "Outlook not so good.", "Very doubtful."] | |
7 | - | ||
8 | - | func getAnswer (question,previousAnswer) = { | |
9 | - | let hash = sha256(toBytes((question + previousAnswer))) | |
10 | - | let index = toInt(hash) | |
11 | - | answers[(index % answersCount)] | |
12 | - | } | |
13 | - | ||
14 | - | ||
15 | - | func getPreviousAnswer (address) = match getString(this, (address + "_a")) { | |
16 | - | case a: String => | |
17 | - | a | |
18 | - | case _ => | |
19 | - | address | |
20 | - | } | |
21 | 4 | ||
22 | 5 | ||
23 | 6 | @Callable(i) | |
24 | - | func tellme (question) = { | |
25 | - | let callerAddress = toBase58String(i.caller.bytes) | |
26 | - | let answer = getAnswer(question, getPreviousAnswer(callerAddress)) | |
27 | - | WriteSet([DataEntry((callerAddress + "_q"), question), DataEntry((callerAddress + "_a"), answer)]) | |
7 | + | func createOrder (price) = { | |
8 | + | let pmt = extract(i.payment) | |
9 | + | if (!(isDefined(pmt.assetId))) | |
10 | + | then throw("You need to use tokenId, not waves") | |
11 | + | else { | |
12 | + | let currentKey = toBase58String(i.caller.bytes) | |
13 | + | WriteSet([DataEntry(((currentKey + "_") + toBase58String(extract(pmt.assetId))), pmt.amount)]) | |
14 | + | } | |
28 | 15 | } | |
29 | 16 | ||
30 | 17 |
github/deemru/w8io/026f985 33.64 ms ◑