tx · 3ixB56zBRnQAPkDZWfNKGWva8vxtgTayLLCtvc6BtPPb 3N1fcrWULKWACeWDuo3FpugKcoYC4xQ7uw8: -0.00600000 Waves 2022.07.12 11:05 [2136254] smart account 3N1fcrWULKWACeWDuo3FpugKcoYC4xQ7uw8 > SELF 0.00000000 Waves
{ "type": 13, "id": "3ixB56zBRnQAPkDZWfNKGWva8vxtgTayLLCtvc6BtPPb", "fee": 600000, "feeAssetId": null, "timestamp": 1657613181414, "version": 2, "chainId": 84, "sender": "3N1fcrWULKWACeWDuo3FpugKcoYC4xQ7uw8", "senderPublicKey": "48K83j8fKJeoBfJYe7BTpnr2VQg7uLGwyCrhmdghH3xZ", "proofs": [ "2uaVqXS1akoPJPrf1Y9Lz8DFcH11XQzUn526hZZwvyLanXxYReau5xenhwpTZdD3RUteQQtBWYprvqTarrruqBZz" ], "script": "base64:BgIRCAISCQoHAQEBCAgICBIAEgABAAlzZXBhcmF0b3ICAl9fAwFpAQllbWl0RXZlbnQHEHNvdXJjZV9jaGFpbl9pZHgQdGFyZ2V0X2NoYWluX2lkeAxibG9ja19oZWlnaHQKYmxvY2tfaGFzaAd0eF9oYXNoDHNvdXJjZV9hc3NldAZhbW91bnQECWFtb3VudEludAQHJG1hdGNoMAkAqAMBBQZhbW91bnQDCQABAgUHJG1hdGNoMAIGQmlnSW50BAFhBQckbWF0Y2gwBQFhAwkAAQIFByRtYXRjaDACBFVuaXQJAAIBAhBpbmNvcnJlY3QgYW1vdW50CQACAQILTWF0Y2ggZXJyb3IEDGV2ZW50TGFzdElkeAQHJG1hdGNoMAkAnwgBAg9FVkVOVFNfTEFTVF9JRFgDCQABAgUHJG1hdGNoMAIDSW50BAFhBQckbWF0Y2gwBQFhAwkAAQIFByRtYXRjaDACBFVuaXQAAAkAAgECC01hdGNoIGVycm9yBAVldmVudAkAuQkCCQDMCAIJAKQDAQUQc291cmNlX2NoYWluX2lkeAkAzAgCCQCkAwEFEHRhcmdldF9jaGFpbl9pZHgJAMwIAg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QgIBQFpBmNhbGxlcgVieXRlcwMJAAECBQckbWF0Y2gwAgNJbnQEAWEFByRtYXRjaDADCQBmAgUBYQAABQFhCQACAQIRbm8gZnJlZSBpbnN1cmFuY2UJAAIBAgxubyBpbnN1cmFuY2UJAJQKAgkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIFCWluc3VyYW5jZQUEdW5pdAkAzAgCCQEMSW50ZWdlckVudHJ5AgkArAICAhBJTlNVUkFOQ0VfRlJFRV9fCQDYBAEICAUBaQZjYWxsZXIFYnl0ZXMAAAUDbmlsBQR1bml0AQJ0eAEGdmVyaWZ5AAkA9AMDCAUCdHgJYm9keUJ5dGVzCQCRAwIIBQJ0eAZwcm9vZnMAAAgFAnR4D3NlbmRlclB1YmxpY0tleR0ZiQ4=", "height": 2136254, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AJdswEgA3BKNYL6GhwLPyKqPgoxc7nUEoEXKGhhaya85 Next: Cg9BrVmCLztgL4NF8hgdXT8695XLfenzjSQqhWXjWi3S Diff:
Old | New | Differences | |
---|---|---|---|
37 | 37 | then throw("zero payment") | |
38 | 38 | else unit | |
39 | 39 | if ((err == err)) | |
40 | - | then $Tuple2([IntegerEntry(("INSURANCE_FREE__" + toBase58String(i.caller.bytes)), i.payments[0].amount)], unit) | |
40 | + | then { | |
41 | + | let freeInsurance = match getInteger(("INSURANCE_FREE__" + toBase58String(i.caller.bytes))) { | |
42 | + | case a: Int => | |
43 | + | a | |
44 | + | case _ => | |
45 | + | 0 | |
46 | + | } | |
47 | + | $Tuple2([IntegerEntry(("INSURANCE_FREE__" + toBase58String(i.caller.bytes)), (freeInsurance + i.payments[0].amount))], unit) | |
48 | + | } | |
41 | 49 | else throw("Strict value is not equal to itself.") | |
42 | 50 | } | |
43 | 51 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 6 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let separator = "__" | |
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func emitEvent (source_chain_idx,target_chain_idx,block_height,block_hash,tx_hash,source_asset,amount) = { | |
8 | 8 | let amountInt = match parseBigInt(amount) { | |
9 | 9 | case a: BigInt => | |
10 | 10 | a | |
11 | 11 | case _: Unit => | |
12 | 12 | throw("incorrect amount") | |
13 | 13 | case _ => | |
14 | 14 | throw("Match error") | |
15 | 15 | } | |
16 | 16 | let eventLastIdx = match getInteger("EVENTS_LAST_IDX") { | |
17 | 17 | case a: Int => | |
18 | 18 | a | |
19 | 19 | case _: Unit => | |
20 | 20 | 0 | |
21 | 21 | case _ => | |
22 | 22 | throw("Match error") | |
23 | 23 | } | |
24 | 24 | let event = makeString([toString(source_chain_idx), toString(target_chain_idx), toString(block_height), block_hash, tx_hash, source_asset, toString(amountInt)], separator) | |
25 | 25 | $Tuple2([StringEntry(("EVENTS__" + toString(eventLastIdx)), event), IntegerEntry("EVENTS_LAST_IDX", (eventLastIdx + 1))], unit) | |
26 | 26 | } | |
27 | 27 | ||
28 | 28 | ||
29 | 29 | ||
30 | 30 | @Callable(i) | |
31 | 31 | func depositInsurance () = { | |
32 | 32 | let err = if ((size(i.payments) != 1)) | |
33 | 33 | then throw("no payment") | |
34 | 34 | else if ((i.payments[0].assetId != unit)) | |
35 | 35 | then throw("payment is not WAVES") | |
36 | 36 | else if ((0 >= i.payments[0].amount)) | |
37 | 37 | then throw("zero payment") | |
38 | 38 | else unit | |
39 | 39 | if ((err == err)) | |
40 | - | then $Tuple2([IntegerEntry(("INSURANCE_FREE__" + toBase58String(i.caller.bytes)), i.payments[0].amount)], unit) | |
40 | + | then { | |
41 | + | let freeInsurance = match getInteger(("INSURANCE_FREE__" + toBase58String(i.caller.bytes))) { | |
42 | + | case a: Int => | |
43 | + | a | |
44 | + | case _ => | |
45 | + | 0 | |
46 | + | } | |
47 | + | $Tuple2([IntegerEntry(("INSURANCE_FREE__" + toBase58String(i.caller.bytes)), (freeInsurance + i.payments[0].amount))], unit) | |
48 | + | } | |
41 | 49 | else throw("Strict value is not equal to itself.") | |
42 | 50 | } | |
43 | 51 | ||
44 | 52 | ||
45 | 53 | ||
46 | 54 | @Callable(i) | |
47 | 55 | func withdrawInsurance () = { | |
48 | 56 | let insurance = match getInteger(("INSURANCE_FREE__" + toBase58String(i.caller.bytes))) { | |
49 | 57 | case a: Int => | |
50 | 58 | if ((a > 0)) | |
51 | 59 | then a | |
52 | 60 | else throw("no free insurance") | |
53 | 61 | case _ => | |
54 | 62 | throw("no insurance") | |
55 | 63 | } | |
56 | 64 | $Tuple2([ScriptTransfer(i.caller, insurance, unit), IntegerEntry(("INSURANCE_FREE__" + toBase58String(i.caller.bytes)), 0)], unit) | |
57 | 65 | } | |
58 | 66 | ||
59 | 67 | ||
60 | 68 | @Verifier(tx) | |
61 | 69 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
62 | 70 |
github/deemru/w8io/169f3d6 27.80 ms ◑