tx · 9p3A64kThR1jptuYhX8eTKvY4t1sgsLkHoD676d7dNRy 3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh: -0.01000000 Waves 2021.07.15 07:50 [1614265] smart account 3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh > SELF 0.00000000 Waves
{ "type": 13, "id": "9p3A64kThR1jptuYhX8eTKvY4t1sgsLkHoD676d7dNRy", "fee": 1000000, "feeAssetId": null, "timestamp": 1626324627865, "version": 2, "chainId": 84, "sender": "3N51W4fn1aAAdypU26EGUwNZPr3zikN3vwh", "senderPublicKey": "D7edN6TZzQ6PbyWHGFdGMPJkkRNjR1Y32g7MmU7AXR73", "proofs": [ "3mPoGNP51WQdaSjoj3EdGbyi1MA4qYzhz7Ca5oE5bZ6uozAgqCmwC9xQ5MftWJnj56uJ4cUDbWLtyPwHJeJNQb36" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAADAAAAAAlCTE9DS1NURVAAAAAAAAAAAAoAAAAAA1JFUwEAAAAg9zCOS72Q1vYXbBOZsGiYip0A3D8vW8S490kPXDWEHLMBAAAACnJhbmRvbWl6ZXIAAAABAAAAA2ludgQAAAAIbGFzdFBsYXkEAAAAByRtYXRjaDAJAAQcAAAAAgUAAAAEdGhpcwIAAAAIbGFzdFBsYXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAXMFAAAAByRtYXRjaDAFAAAAAXMDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABFVuaXQBAAAADkdvbGRNaW5lcnMyMDIxCQAAAgAAAAECAAAAC01hdGNoIGVycm9yBAAAAARyYW5kCQAAywAAAAIJAADLAAAAAgkAAMsAAAACCQAAywAAAAIJAADLAAAAAgUAAAAIbGFzdFBsYXkIBQAAAANpbnYAAAANdHJhbnNhY3Rpb25JZAgFAAAAA2ludgAAAA9jYWxsZXJQdWJsaWNLZXkIBQAAAAlsYXN0QmxvY2sAAAATZ2VuZXJhdGlvblNpZ25hd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eded", "spentComplexity": 0 } View: original | compacted Prev: 9FrmauXha9yDCP9veavtQRMpZWwr4Ug8roZ7b1ofe5Xh Next: 4HnJUdhRFsoCD9ymTfmfSDQbJXFayBp3Gh6Cu9aCggR4 Diff:
Old | New | Differences | |
---|---|---|---|
65 | 65 | } | |
66 | 66 | else 0 | |
67 | 67 | } | |
68 | - | let r = assetBalance(i.caller, b) | |
69 | - | if ((10 > r)) | |
68 | + | let r = (q + 1) | |
69 | + | let s = assetBalance(i.caller, b) | |
70 | + | if ((10 > s)) | |
70 | 71 | then throw("Not enough, need 1000 pieces") | |
71 | 72 | else { | |
72 | - | let | |
73 | - | let | |
74 | - | [Issue("DEMO", "DEMO", 1, 0, false), Burn(b, 10), ScriptTransfer(i.caller, 1, | |
73 | + | let t = Issue("DEMO", "DEMO", 1, 0, false) | |
74 | + | let u = calculateAssetId(t) | |
75 | + | [Issue("DEMO", "DEMO", 1, 0, false), Burn(b, 10), ScriptTransfer(i.caller, 1, u), IntegerEntry("ingots_count", r), StringEntry(("ingot_" + toString(r)), toBase58String(u))] | |
75 | 76 | } | |
76 | 77 | } | |
77 | 78 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let a = 10 | |
5 | 5 | ||
6 | 6 | let b = base58'HdveNhSzDRiEib9RfQ5EAxmpFVica4EqvBFd2S4pdbD4' | |
7 | 7 | ||
8 | 8 | func c (d) = { | |
9 | 9 | let e = { | |
10 | 10 | let f = getBinary(this, "lastPlay") | |
11 | 11 | if ($isInstanceOf(f, "ByteVector")) | |
12 | 12 | then { | |
13 | 13 | let g = f | |
14 | 14 | g | |
15 | 15 | } | |
16 | 16 | else if ($isInstanceOf(f, "Unit")) | |
17 | 17 | then base58'TGCTLFoHxJ8U7rcUofN' | |
18 | 18 | else throw("Match error") | |
19 | 19 | } | |
20 | 20 | let h = (((((e + d.transactionId) + d.callerPublicKey) + lastBlock.generationSignature) + toBytes(lastBlock.timestamp)) + toBytes(lastBlock.height)) | |
21 | 21 | sha256(h) | |
22 | 22 | } | |
23 | 23 | ||
24 | 24 | ||
25 | 25 | @Callable(i) | |
26 | 26 | func goToMine () = { | |
27 | 27 | let j = toBase58String(i.caller.bytes) | |
28 | 28 | let k = { | |
29 | 29 | let f = getInteger(this, ("wait_" + j)) | |
30 | 30 | if ($isInstanceOf(f, "Int")) | |
31 | 31 | then { | |
32 | 32 | let l = f | |
33 | 33 | l | |
34 | 34 | } | |
35 | 35 | else 0 | |
36 | 36 | } | |
37 | 37 | let m = (lastBlock.height + a) | |
38 | 38 | let n = c(i) | |
39 | 39 | let o = (toInt(n) % 1000) | |
40 | 40 | if ((k > lastBlock.height)) | |
41 | 41 | then throw((("Still wait block " + toString(lastBlock.height)) + " for mining")) | |
42 | 42 | else [IntegerEntry(("wait_" + j), m), ScriptTransfer(i.caller, o, b)] | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | ||
47 | 47 | @Callable(i) | |
48 | 48 | func craftIngot () = { | |
49 | 49 | let j = toBase58String(i.caller.bytes) | |
50 | 50 | let p = { | |
51 | 51 | let f = getInteger(this, ("craft_" + j)) | |
52 | 52 | if ($isInstanceOf(f, "Int")) | |
53 | 53 | then { | |
54 | 54 | let l = f | |
55 | 55 | l | |
56 | 56 | } | |
57 | 57 | else 0 | |
58 | 58 | } | |
59 | 59 | let q = { | |
60 | 60 | let f = getInteger(this, "ingots_count") | |
61 | 61 | if ($isInstanceOf(f, "Int")) | |
62 | 62 | then { | |
63 | 63 | let l = f | |
64 | 64 | l | |
65 | 65 | } | |
66 | 66 | else 0 | |
67 | 67 | } | |
68 | - | let r = assetBalance(i.caller, b) | |
69 | - | if ((10 > r)) | |
68 | + | let r = (q + 1) | |
69 | + | let s = assetBalance(i.caller, b) | |
70 | + | if ((10 > s)) | |
70 | 71 | then throw("Not enough, need 1000 pieces") | |
71 | 72 | else { | |
72 | - | let | |
73 | - | let | |
74 | - | [Issue("DEMO", "DEMO", 1, 0, false), Burn(b, 10), ScriptTransfer(i.caller, 1, | |
73 | + | let t = Issue("DEMO", "DEMO", 1, 0, false) | |
74 | + | let u = calculateAssetId(t) | |
75 | + | [Issue("DEMO", "DEMO", 1, 0, false), Burn(b, 10), ScriptTransfer(i.caller, 1, u), IntegerEntry("ingots_count", r), StringEntry(("ingot_" + toString(r)), toBase58String(u))] | |
75 | 76 | } | |
76 | 77 | } | |
77 | 78 | ||
78 | 79 |
github/deemru/w8io/169f3d6 32.31 ms ◑