tx · 5dfTQBUf4mjFaVjbqJe1kzyjKGdqG6DYFe69sUanuYvm 3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua: -0.01400000 Waves 2021.03.15 17:00 [1438928] smart account 3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua > SELF 0.00000000 Waves
{ "type": 13, "id": "5dfTQBUf4mjFaVjbqJe1kzyjKGdqG6DYFe69sUanuYvm", "fee": 1400000, "feeAssetId": null, "timestamp": 1615816808990, "version": 2, "chainId": 84, "sender": "3Mz29fiz3zgY9JDbiHKANvHsFgQutdfu4Ua", "senderPublicKey": "CTyHhnVTxf16Z4CmGGneAK8WB5g2QyT4MB8kUn8vPPcu", "proofs": [ "3pmapJVdy1RNo3m8BHEzfFp1SFZf1TGvZMimPsUMuFEGdym8ktbnjaW9Z5eW9xwnkvmpsheH8QH7qC1u9kNHETcA" ], "script": "base64:AAIEAAAAAAAAAAYIAhIAEgAAAAACAQAAAAxpc1dhdmVzQXNzZXQAAAABAAAAB2Fzc2V0SWQEAAAAByRtYXRjaDAFAAAAB2Fzc2V0SWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAABWFzc2V0BQAAAAckbWF0Y2gwBwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAEVW5pdAQAAAAFd2F2ZXMFAAAAByRtYXRjaDAGCQAAAgAAAAECAAAAC01hdGNoIGVycm9yAQAAABBnZXRUcmVhc3VyeVZhbHVlAAAAAQAAAAdhc3NldElkBAAAAAx0cmVhc3VyeU5hbWUEAAAAByRtYXRjaDAFAAAAB2Fzc2V0SWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAABWFzc2V0BQAAAAckbWF0Y2gwCQABLAAAAAICAAAACVRyZWFzdXJ5LQkAAlgAAAABBQAAAAVhc3NldAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAANzdHIFAAAAByRtYXRjaD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F0Y2gwAgAAAANJbnQEAAAAA3ZhbAUAAAAHJG1hdGNoMAUAAAADdmFsBAAAAARudWxsBQAAAAckbWF0Y2gwCQAAAgAAAAECAAAAJURhdGEgbWlzc2luZzogJ2dvdmVybm9yQ3JlYXRpb25QcmljZScDCQEAAAACIT0AAAACCAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAAAAAZhbW91bnQFAAAAFWdvdmVybm9yQ3JlYXRpb25QcmljZQkAAAIAAAABAgAAABdOb3QgYSB2YWxpZCBhbW91bnQgc2VudAQAAAALZ292Q29udHJhY3QJAARCAAAABQIAAAAQR292ZXJub3JDb250cmFjdAkAAaQAAAABBQAAAAZoZWlnaHQAAAAAAAAAAAEAAAAAAAAAAAAHBAAAAA1nb3ZDb250cmFjdElkCQAEOAAAAAEFAAAAC2dvdkNvbnRyYWN0CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACAgAAAA5UcmVhc3VyeS1XQVZFUwkAAGQAAAACCQEAAAAQZ2V0VHJlYXN1cnlWYWx1ZQAAAAECAAAABVdBVkVTCAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAAAAAZhbW91bnQJAARMAAAAAgUAAAALZ292Q29udHJhY3QJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyCAUAAAALZ292Q29udHJhY3QAAAAIcXVhbnRpdHkFAAAADWdvdkNvbnRyYWN0SWQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5s6P4DA==", "height": 1438928, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: GUwUBq2f1UWYheHhcuFGKZMR3LU1sNSwJYCae9kNm4tQ Next: UF3eaEgYPUUtwtUxJFMMBP5ZqHADjpHrNqM2WN6VwcC Diff:
Old | New | Differences | |
---|---|---|---|
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 |
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 | 21 | throw("Unknown treasury") | |
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 | 28 | case null => | |
29 | 29 | 0 | |
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 | 37 | else [IntegerEntry("governorCreationPrice", 1)] | |
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 37.22 ms ◑