tx · CRgEhBx6X9Xj48xbX4FuiFcPMPfpgiz9RtGRYZNmRELY

3MscxufrKTYtkCUxbyHWWyRY8mbbgRm7SAt:  -0.01000000 Waves

2019.09.07 15:38 [665658] smart account 3MscxufrKTYtkCUxbyHWWyRY8mbbgRm7SAt > SELF 0.00000000 Waves

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

github/deemru/w8io/169f3d6 
40.87 ms