tx · FiRcHFRfwnty97mjJHSVWhDgfXHYhMquS2aR1y5FYtg2 3MqeZHinERBkLSnzAwLb6X1m652hCZmxVqo: -0.05000000 Waves 2019.11.12 12:32 [761639] smart account 3MqeZHinERBkLSnzAwLb6X1m652hCZmxVqo > SELF 0.00000000 Waves
{ "type": 13, "id": "FiRcHFRfwnty97mjJHSVWhDgfXHYhMquS2aR1y5FYtg2", "fee": 5000000, "feeAssetId": null, "timestamp": 1573551000016, "version": 1, "sender": "3MqeZHinERBkLSnzAwLb6X1m652hCZmxVqo", "senderPublicKey": "H914brzNMwL3CyT3aRGy8VXUNp59vm2nztQHEbUWDv6S", "proofs": [ "5kXDcD2nomFRsaXJRnLcrWMSdGopnLXmqgaKW37faNXSzmaQSfaLhcXThnLmPaBGQqEsBcvLvdhWjB7W2DBKMuy5" ], "script": "base64:AAIDAAAAAAAAABQIARIAEgMKAQESAwoBARIECgIBCAAAAAEAAAAABW93bmVyAQAAACDvx7Uef/ZdmdjdrKFG40hwtgIw95029u7hiwakIXP9PwAAAAQAAAABaQEAAAAHZGVwb3NpdAAAAAAEAAAAA3BtdAkBAAAAB2V4dHJhY3QAAAABCAUAAAABaQAAAAdwYXltZW50AwkBAAAACWlzRGVmaW5lZAAAAAEIBQAAAANwbXQAAAAHYXNzZXRJZAkAAAIAAAABAgAAACFjYW4gaG9kbCB3YXZlcyBvbmx5IGF0IHRoZSBtb21lbnQEAAAACmN1cnJlbnRLZXkJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwQAAAASeHh4SW52ZXN0b3JCYWxhbmNlCQABLAAAAAIJAAEsAAAAAgUAAAAKY3VycmVudEtleQIAAAABXwIAAAACaWIEAAAADWN1cnJlbnRBbW91bnQEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAASeHh4SW52ZXN0b3JCYWxhbmNlAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAWEFAAAAByRtYXRjaDAFAA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AAAByRtYXRjaDACAAAAFFNldFNjcmlwdFRyYW5zYWN0aW9uBAAAAAF0BQAAAAckbWF0Y2gwCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAUAAAAFb3duZXIDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAF0ludm9rZVNjcmlwdFRyYW5zYWN0aW9uBAAAAAFjBQAAAAckbWF0Y2gwBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPRGF0YVRyYW5zYWN0aW9uBAAAAAFkBQAAAAckbWF0Y2gwBge2hCQJ", "chainId": 84, "height": 761639, "spentComplexity": 0 } View: original | compacted Prev: 8BSGNXzjJDBvGWRN9oPqQHk2889J2bGKWC12WEb1VwoR Next: 4Xih9krecfAWoguDsgtG5HZp5Xfg3H2STzev9M7pYoXP Diff:
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | ||
4 | + | let owner = base58'H914brzNMwL3CyT3aRGy8VXUNp59vm2nztQHEbUWDv6S' | |
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func deposit () = { | |
118 | 118 | @Verifier(tx) | |
119 | 119 | func verify () = match tx { | |
120 | 120 | case t: SetScriptTransaction => | |
121 | - | sigVerify(tx.bodyBytes, tx.proofs[0], | |
121 | + | sigVerify(tx.bodyBytes, tx.proofs[0], owner) | |
122 | 122 | case c: InvokeScriptTransaction => | |
123 | 123 | true | |
124 | 124 | case d: DataTransaction => |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 3 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | - | ||
4 | + | let owner = base58'H914brzNMwL3CyT3aRGy8VXUNp59vm2nztQHEbUWDv6S' | |
5 | 5 | ||
6 | 6 | @Callable(i) | |
7 | 7 | func deposit () = { | |
8 | 8 | let pmt = extract(i.payment) | |
9 | 9 | if (isDefined(pmt.assetId)) | |
10 | 10 | then throw("can hodl waves only at the moment") | |
11 | 11 | else { | |
12 | 12 | let currentKey = toBase58String(i.caller.bytes) | |
13 | 13 | let xxxInvestorBalance = ((currentKey + "_") + "ib") | |
14 | 14 | let currentAmount = match getInteger(this, xxxInvestorBalance) { | |
15 | 15 | case a: Int => | |
16 | 16 | a | |
17 | 17 | case _ => | |
18 | 18 | 0 | |
19 | 19 | } | |
20 | 20 | let newAmount = (currentAmount + pmt.amount) | |
21 | 21 | WriteSet([DataEntry(xxxInvestorBalance, newAmount)]) | |
22 | 22 | } | |
23 | 23 | } | |
24 | 24 | ||
25 | 25 | ||
26 | 26 | ||
27 | 27 | @Callable(i) | |
28 | 28 | func withdraw (amount) = { | |
29 | 29 | let currentKey = toBase58String(i.caller.bytes) | |
30 | 30 | let xxxInvestorBalance = ((currentKey + "_") + "ib") | |
31 | 31 | let currentAmount = match getInteger(this, xxxInvestorBalance) { | |
32 | 32 | case a: Int => | |
33 | 33 | a | |
34 | 34 | case _ => | |
35 | 35 | 0 | |
36 | 36 | } | |
37 | 37 | let newAmount = (currentAmount - amount) | |
38 | 38 | if ((0 > amount)) | |
39 | 39 | then throw("Can't withdraw negative amount") | |
40 | 40 | else if ((0 > newAmount)) | |
41 | 41 | then throw("Not enough balance") | |
42 | 42 | else ScriptResult(WriteSet([DataEntry(xxxInvestorBalance, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
43 | 43 | } | |
44 | 44 | ||
45 | 45 | ||
46 | 46 | ||
47 | 47 | @Callable(i) | |
48 | 48 | func getFunds (amount) = { | |
49 | 49 | let quorum = 2 | |
50 | 50 | let currentKey = toBase58String(i.caller.bytes) | |
51 | 51 | let xxxStartupFund = ((currentKey + "_") + "sf") | |
52 | 52 | let xxxStartupVotes = ((currentKey + "_") + "sv") | |
53 | 53 | let currentAmount = match getInteger(this, xxxStartupFund) { | |
54 | 54 | case a: Int => | |
55 | 55 | a | |
56 | 56 | case _ => | |
57 | 57 | 0 | |
58 | 58 | } | |
59 | 59 | let totalVotes = match getInteger(this, xxxStartupVotes) { | |
60 | 60 | case a: Int => | |
61 | 61 | a | |
62 | 62 | case _ => | |
63 | 63 | 0 | |
64 | 64 | } | |
65 | 65 | let newAmount = (currentAmount - amount) | |
66 | 66 | if ((0 > amount)) | |
67 | 67 | then throw("Can't withdraw negative amount") | |
68 | 68 | else if ((0 > newAmount)) | |
69 | 69 | then throw("Not enough balance") | |
70 | 70 | else if ((quorum > totalVotes)) | |
71 | 71 | then throw("Not enough votes. At least 2 votes required!") | |
72 | 72 | else ScriptResult(WriteSet([DataEntry(xxxStartupFund, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)])) | |
73 | 73 | } | |
74 | 74 | ||
75 | 75 | ||
76 | 76 | ||
77 | 77 | @Callable(i) | |
78 | 78 | func vote (amount,address) = { | |
79 | 79 | let currentKey = toBase58String(i.caller.bytes) | |
80 | 80 | let xxxInvestorBalance = ((currentKey + "_") + "ib") | |
81 | 81 | let xxxStartupFund = ((address + "_") + "sf") | |
82 | 82 | let xxxStartupVotes = ((address + "_") + "sv") | |
83 | 83 | let flagKey = ((address + "_") + currentKey) | |
84 | 84 | let flag = match getInteger(this, flagKey) { | |
85 | 85 | case a: Int => | |
86 | 86 | a | |
87 | 87 | case _ => | |
88 | 88 | 0 | |
89 | 89 | } | |
90 | 90 | let currentAmount = match getInteger(this, xxxInvestorBalance) { | |
91 | 91 | case a: Int => | |
92 | 92 | a | |
93 | 93 | case _ => | |
94 | 94 | 0 | |
95 | 95 | } | |
96 | 96 | let currentVotes = match getInteger(this, xxxStartupVotes) { | |
97 | 97 | case a: Int => | |
98 | 98 | a | |
99 | 99 | case _ => | |
100 | 100 | 0 | |
101 | 101 | } | |
102 | 102 | let currentFund = match getInteger(this, xxxStartupFund) { | |
103 | 103 | case a: Int => | |
104 | 104 | a | |
105 | 105 | case _ => | |
106 | 106 | 0 | |
107 | 107 | } | |
108 | 108 | if ((0 >= amount)) | |
109 | 109 | then throw("Can't withdraw negative amount") | |
110 | 110 | else if ((amount > currentAmount)) | |
111 | 111 | then throw("Not enough balance!") | |
112 | 112 | else if ((flag > 0)) | |
113 | 113 | then throw("Only one vote per project is possible!") | |
114 | 114 | else WriteSet([DataEntry(xxxInvestorBalance, (currentAmount - amount)), DataEntry(xxxStartupVotes, (currentVotes + 1)), DataEntry(flagKey, 1), DataEntry(xxxStartupFund, (currentFund + amount))]) | |
115 | 115 | } | |
116 | 116 | ||
117 | 117 | ||
118 | 118 | @Verifier(tx) | |
119 | 119 | func verify () = match tx { | |
120 | 120 | case t: SetScriptTransaction => | |
121 | - | sigVerify(tx.bodyBytes, tx.proofs[0], | |
121 | + | sigVerify(tx.bodyBytes, tx.proofs[0], owner) | |
122 | 122 | case c: InvokeScriptTransaction => | |
123 | 123 | true | |
124 | 124 | case d: DataTransaction => | |
125 | 125 | true | |
126 | 126 | case _ => | |
127 | 127 | false | |
128 | 128 | } | |
129 | 129 |
github/deemru/w8io/026f985 29.81 ms ◑