tx · UF3eaEgYPUUtwtUxJFMMBP5ZqHADjpHrNqM2WN6VwcC 3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua: -0.01400000 Waves 2021.03.15 17:05 [1438936] smart account 3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua > SELF 0.00000000 Waves
{ "type": 13, "id": "UF3eaEgYPUUtwtUxJFMMBP5ZqHADjpHrNqM2WN6VwcC", "fee": 1400000, "feeAssetId": null, "timestamp": 1615817119265, "version": 2, "chainId": 84, "sender": "3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua", "senderPublicKey": "CTyHhnVTxf16Z4CmGGneAK8WB5g2QyT4MB8kUn8vPPcu", "proofs": [ "5wLj92vLn6eXREz3Au2uRKMLQb9btiCJGkMLUqmFJZL3LhXKp8bTC9A3ooh5daMb4YtSPbBL4T9fa8e1WCwg8gef" ], "script": "base64:AAIEAAAAAAAAAAYIAhIAEgAAAAACAQAAAAxpc1dhdmVzQXNzZXQAAAABAAAAB2Fzc2V0SWQEAAAAByRtYXRjaDAFAAAAB2Fzc2V0SWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAABWFzc2V0BQAAAAckbWF0Y2gwBwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAQAAAAFd2F2ZXMFAAAAByRtYXRjaDAGCQAAAgAAAAECAAAAC01hdGNoIGVycm9yAQAAABBnZXRUcmVhc3VyeVZhbHVlAAAAAQAAAAdhc3NldElkBAAAAAx0cmVhc3VyeU5hbWUEAAAAByRtYXRjaDAFAAAAB2Fzc2V0SWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAABWFzc2V0BQAAAAckbWF0Y2gwCQABLAAAAAICAAAACVRyZWFzdXJ5LQkAAlgAAAABBQAAAAVhc3NldAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAANzdHIFAAAAByRtYXRjaD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VudHMAAAAAAAAAAAAAAAAGYW1vdW50CQAETAAAAAIFAAAAC2dvdkNvbnRyYWN0CQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcggFAAAAC2dvdkNvbnRyYWN0AAAACHF1YW50aXR5BQAAAA1nb3ZDb250cmFjdElkBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleVojiYY=", "height": 1438936, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 5dfTQBUf4mjFaVjbqJe1kzyjKGdqG6DYFe69sUanuYvm Next: 69eFQ6Z4J67ZiLYfBx5wWyWbh8aS4HiDBCnQ9phvyzwt Diff:
Old | New | Differences | |
---|---|---|---|
18 | 18 | case str: String => | |
19 | 19 | ("Treasury-" + str) | |
20 | 20 | case _: Unit => | |
21 | - | throw("Unknown treasury") | |
21 | + | throw("Unknown treasury #1") | |
22 | 22 | case _ => | |
23 | 23 | throw("Match error") | |
24 | 24 | } | |
25 | 25 | match getInteger(this, treasuryName) { | |
26 | 26 | case val: Int => | |
27 | 27 | val | |
28 | - | case | |
29 | - | | |
28 | + | case _ => | |
29 | + | throw("Unknown treasury #2") | |
30 | 30 | } | |
31 | 31 | } | |
32 | 32 | ||
34 | 34 | @Callable(i) | |
35 | 35 | func init () = if ((this != i.caller)) | |
36 | 36 | then throw("Access denied") | |
37 | - | else [IntegerEntry("governorCreationPrice", 1)] | |
37 | + | else [DeleteEntry("caca"), DeleteEntry("feePoolStack"), DeleteEntry("lendingPoolAssets"), DeleteEntry("lendingPoolStack"), DeleteEntry("lendingPoolTokens"), DeleteEntry("listedLendingTokens"), IntegerEntry("governorCreationPrice", 1), IntegerEntry("Treasury-WAVES", 0)] | |
38 | 38 | ||
39 | 39 | ||
40 | 40 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 4 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | func isWavesAsset (assetId) = match assetId { | |
5 | 5 | case asset: ByteVector => | |
6 | 6 | false | |
7 | 7 | case waves: Unit => | |
8 | 8 | true | |
9 | 9 | case _ => | |
10 | 10 | throw("Match error") | |
11 | 11 | } | |
12 | 12 | ||
13 | 13 | ||
14 | 14 | func getTreasuryValue (assetId) = { | |
15 | 15 | let treasuryName = match assetId { | |
16 | 16 | case asset: ByteVector => | |
17 | 17 | ("Treasury-" + toBase58String(asset)) | |
18 | 18 | case str: String => | |
19 | 19 | ("Treasury-" + str) | |
20 | 20 | case _: Unit => | |
21 | - | throw("Unknown treasury") | |
21 | + | throw("Unknown treasury #1") | |
22 | 22 | case _ => | |
23 | 23 | throw("Match error") | |
24 | 24 | } | |
25 | 25 | match getInteger(this, treasuryName) { | |
26 | 26 | case val: Int => | |
27 | 27 | val | |
28 | - | case | |
29 | - | | |
28 | + | case _ => | |
29 | + | throw("Unknown treasury #2") | |
30 | 30 | } | |
31 | 31 | } | |
32 | 32 | ||
33 | 33 | ||
34 | 34 | @Callable(i) | |
35 | 35 | func init () = if ((this != i.caller)) | |
36 | 36 | then throw("Access denied") | |
37 | - | else [IntegerEntry("governorCreationPrice", 1)] | |
37 | + | else [DeleteEntry("caca"), DeleteEntry("feePoolStack"), DeleteEntry("lendingPoolAssets"), DeleteEntry("lendingPoolStack"), DeleteEntry("lendingPoolTokens"), DeleteEntry("listedLendingTokens"), IntegerEntry("governorCreationPrice", 1), IntegerEntry("Treasury-WAVES", 0)] | |
38 | 38 | ||
39 | 39 | ||
40 | 40 | ||
41 | 41 | @Callable(i) | |
42 | 42 | func createGovernor () = if ((size(i.payments) != 1)) | |
43 | 43 | then throw("No payment attached") | |
44 | 44 | else if ((this == i.caller)) | |
45 | 45 | then throw("dApp self sending is denied") | |
46 | 46 | else if ((isWavesAsset(i.payments[0].assetId) == false)) | |
47 | 47 | then throw("Payment should be in WAVES") | |
48 | 48 | else { | |
49 | 49 | let governorCreationPrice = match getInteger(this, "governorCreationPrice") { | |
50 | 50 | case val: Int => | |
51 | 51 | val | |
52 | 52 | case null => | |
53 | 53 | throw("Data missing: 'governorCreationPrice'") | |
54 | 54 | } | |
55 | 55 | if ((i.payments[0].amount != governorCreationPrice)) | |
56 | 56 | then throw("Not a valid amount sent") | |
57 | 57 | else { | |
58 | 58 | let govContract = Issue("GovernorContract", toString(height), 1, 0, false) | |
59 | 59 | let govContractId = calculateAssetId(govContract) | |
60 | 60 | [IntegerEntry("Treasury-WAVES", (getTreasuryValue("WAVES") + i.payments[0].amount)), govContract, ScriptTransfer(i.caller, govContract.quantity, govContractId)] | |
61 | 61 | } | |
62 | 62 | } | |
63 | 63 | ||
64 | 64 | ||
65 | 65 | @Verifier(tx) | |
66 | 66 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
67 | 67 |
github/deemru/w8io/169f3d6 39.27 ms ◑