tx · FjfemqxoWEp9sKkpQm7oQfpEe1JVPyrRjFhVYJ3c9Nie

3Mt6UXYiypnA6WwKMJsiXMckF7iNe9kWQci:  -0.01400000 Waves

2019.07.20 01:28 [593364] smart account 3Mt6UXYiypnA6WwKMJsiXMckF7iNe9kWQci > SELF 0.00000000 Waves

{ "type": 13, "id": "FjfemqxoWEp9sKkpQm7oQfpEe1JVPyrRjFhVYJ3c9Nie", "fee": 1400000, "feeAssetId": null, "timestamp": 1563575318939, "version": 1, "sender": "3Mt6UXYiypnA6WwKMJsiXMckF7iNe9kWQci", "senderPublicKey": "dTjHwyXGZRGo3Bk6xykECRRp6TeNkui1UV8qPq66UXA", "proofs": [ "3qNrn8yz5DESsanfxE83MXPxwqiXfFeqDCzJs59SHnGXBLyQZ6oBJQqww876piVDCxJn33wi6jqZfEqVcDgArQ6E" ], "script": null, "chainId": 84, "height": 593364, "spentComplexity": 0 } View: original | compacted Prev: APnetdAnvy1jYfaCQfBP8HEmtSjMGG2muNaKi29g8Ge Next: 3q3CN5HgRTEEbrNsm52Bxj61gB8Ci8EQoAKVVHZ8vZTf Full:
OldNewDifferences
1-{-# STDLIB_VERSION 3 #-}
2-{-# SCRIPT_TYPE ACCOUNT #-}
3-{-# CONTENT_TYPE DAPP #-}
4-let ownerPublicKey = base58'9UUaVVahBUyLHLQo4HNuQsRMKY9QBH43Grojkbdf4wG4'
5-
6-func getDestinationWalletAddress () = match getString(this, "destination_wallet_public_key") {
7- case v: String =>
8- if ((v == ""))
9- then throw("Destination wallet address cannot be empty")
10- else addressFromPublicKey(toBytes(v))
11- case _ =>
12- throw("Destination wallet undefined")
13-}
14-
15-
16-func getLootBoxPrice (id) = match getInteger(this, ("loot_box_" + toString(id))) {
17- case v: Int =>
18- v
19- case _ =>
20- throw("Loot box price undefined")
21-}
22-
23-
24-@Callable(i)
25-func setDestinationWallet (publicKey) = if ((i.callerPublicKey != ownerPublicKey))
26- then throw("Only owner can call this method")
27- else if ((publicKey == ""))
28- then throw("Public key cannot be empty")
29- else WriteSet([DataEntry("destination_wallet_public_key", publicKey)])
30-
31-
32-
33-@Callable(i)
34-func setLootBoxPrice (id,price) = if ((i.callerPublicKey != ownerPublicKey))
35- then throw("Only owner can call this method")
36- else if ((id == 0))
37- then throw("Loot id undefined")
38- else if ((price == 0))
39- then throw("Price undefined")
40- else WriteSet([DataEntry(("loot_box_" + toString(id)), price)])
41-
42-
43-
44-@Callable(i)
45-func buyLootBox (id) = {
46- let distinationWalletAddress = getDestinationWalletAddress()
47- let payment = extract(i.payment)
48- let lootBoxPrice = getLootBoxPrice(id)
49- let playerPaySum = payment.amount
50- if ((playerPaySum != lootBoxPrice))
51- then throw(((("Price must be equal " + toString(lootBoxPrice)) + " wavelets, given: ") + toString(playerPaySum)))
52- else TransferSet([ScriptTransfer(distinationWalletAddress, playerPaySum, unit)])
53- }
54-
55-
56-@Verifier(tx)
57-func verify () = match tx {
58- case i: InvokeScriptTransaction =>
59- true
60- case _ =>
61- sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
62-}
63-
1+# no script

github/deemru/w8io/026f985 
18.33 ms