tx · 8BSGNXzjJDBvGWRN9oPqQHk2889J2bGKWC12WEb1VwoR

3MqeZHinERBkLSnzAwLb6X1m652hCZmxVqo:  -0.05000000 Waves

2019.11.12 12:24 [761631] smart account 3MqeZHinERBkLSnzAwLb6X1m652hCZmxVqo > SELF 0.00000000 Waves

{ "type": 13, "id": "8BSGNXzjJDBvGWRN9oPqQHk2889J2bGKWC12WEb1VwoR", "fee": 5000000, "feeAssetId": null, "timestamp": 1573550640308, "version": 1, "sender": "3MqeZHinERBkLSnzAwLb6X1m652hCZmxVqo", "senderPublicKey": "H914brzNMwL3CyT3aRGy8VXUNp59vm2nztQHEbUWDv6S", "proofs": [ "tL7SFG3KZAPVTx6o3oozJqLP9ntL7wU4kLg5Qoz3CMMKTETh3r3DonMtwRqFyuP8cGnNxRvgYEYWJCy5DcSZs3Q" ], "script": "base64:AAIDAAAAAAAAABQIARIAEgMKAQESAwoBARIECgIBCAAAAAAAAAAEAAAAAWkBAAAAB2RlcG9zaXQAAAAABAAAAANwbXQJAQAAAAdleHRyYWN0AAAAAQgFAAAAAWkAAAAHcGF5bWVudAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAADcG10AAAAB2Fzc2V0SWQJAAACAAAAAQIAAAAhY2FuIGhvZGwgd2F2ZXMgb25seSBhdCB0aGUgbW9tZW50BAAAAApjdXJyZW50S2V5CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMEAAAAEnh4eEludmVzdG9yQmFsYW5jZQkAASwAAAACCQABLAAAAAIFAAAACmN1cnJlbnRLZXkCAAAAAV8CAAAAAmliBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAEnh4eEludmVzdG9yQmFsYW5jZQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAAAAAAAAAAAABAAAAAluZXdBbW91bnQJAABkAAAAAgUAAAANY3Vycm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bgQAAAABdAUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAABAAAAIO/HtR5/9l2Z2N2soUbjSHC2AjD3nTb27uGLBqQhc/0/AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABdJbnZva2VTY3JpcHRUcmFuc2FjdGlvbgQAAAABYwUAAAAHJG1hdGNoMAYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAD0RhdGFUcmFuc2FjdGlvbgQAAAABZAUAAAAHJG1hdGNoMAYHVvFmng==", "chainId": 84, "height": 761631, "spentComplexity": 0 } View: original | compacted Prev: GQDC1bHY2EasZF79gzEYWJSn4RpoxLT5WxkNHcZ3qVY Next: FiRcHFRfwnty97mjJHSVWhDgfXHYhMquS2aR1y5FYtg2 Diff:
OldNewDifferences
117117
118118 @Verifier(tx)
119119 func verify () = match tx {
120- case d: SetScriptTransaction =>
120+ case t: SetScriptTransaction =>
121121 sigVerify(tx.bodyBytes, tx.proofs[0], base58'H914brzNMwL3CyT3aRGy8VXUNp59vm2nztQHEbUWDv6S')
122122 case c: InvokeScriptTransaction =>
123123 true
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44
55
66 @Callable(i)
77 func deposit () = {
88 let pmt = extract(i.payment)
99 if (isDefined(pmt.assetId))
1010 then throw("can hodl waves only at the moment")
1111 else {
1212 let currentKey = toBase58String(i.caller.bytes)
1313 let xxxInvestorBalance = ((currentKey + "_") + "ib")
1414 let currentAmount = match getInteger(this, xxxInvestorBalance) {
1515 case a: Int =>
1616 a
1717 case _ =>
1818 0
1919 }
2020 let newAmount = (currentAmount + pmt.amount)
2121 WriteSet([DataEntry(xxxInvestorBalance, newAmount)])
2222 }
2323 }
2424
2525
2626
2727 @Callable(i)
2828 func withdraw (amount) = {
2929 let currentKey = toBase58String(i.caller.bytes)
3030 let xxxInvestorBalance = ((currentKey + "_") + "ib")
3131 let currentAmount = match getInteger(this, xxxInvestorBalance) {
3232 case a: Int =>
3333 a
3434 case _ =>
3535 0
3636 }
3737 let newAmount = (currentAmount - amount)
3838 if ((0 > amount))
3939 then throw("Can't withdraw negative amount")
4040 else if ((0 > newAmount))
4141 then throw("Not enough balance")
4242 else ScriptResult(WriteSet([DataEntry(xxxInvestorBalance, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
4343 }
4444
4545
4646
4747 @Callable(i)
4848 func getFunds (amount) = {
4949 let quorum = 2
5050 let currentKey = toBase58String(i.caller.bytes)
5151 let xxxStartupFund = ((currentKey + "_") + "sf")
5252 let xxxStartupVotes = ((currentKey + "_") + "sv")
5353 let currentAmount = match getInteger(this, xxxStartupFund) {
5454 case a: Int =>
5555 a
5656 case _ =>
5757 0
5858 }
5959 let totalVotes = match getInteger(this, xxxStartupVotes) {
6060 case a: Int =>
6161 a
6262 case _ =>
6363 0
6464 }
6565 let newAmount = (currentAmount - amount)
6666 if ((0 > amount))
6767 then throw("Can't withdraw negative amount")
6868 else if ((0 > newAmount))
6969 then throw("Not enough balance")
7070 else if ((quorum > totalVotes))
7171 then throw("Not enough votes. At least 2 votes required!")
7272 else ScriptResult(WriteSet([DataEntry(xxxStartupFund, newAmount)]), TransferSet([ScriptTransfer(i.caller, amount, unit)]))
7373 }
7474
7575
7676
7777 @Callable(i)
7878 func vote (amount,address) = {
7979 let currentKey = toBase58String(i.caller.bytes)
8080 let xxxInvestorBalance = ((currentKey + "_") + "ib")
8181 let xxxStartupFund = ((address + "_") + "sf")
8282 let xxxStartupVotes = ((address + "_") + "sv")
8383 let flagKey = ((address + "_") + currentKey)
8484 let flag = match getInteger(this, flagKey) {
8585 case a: Int =>
8686 a
8787 case _ =>
8888 0
8989 }
9090 let currentAmount = match getInteger(this, xxxInvestorBalance) {
9191 case a: Int =>
9292 a
9393 case _ =>
9494 0
9595 }
9696 let currentVotes = match getInteger(this, xxxStartupVotes) {
9797 case a: Int =>
9898 a
9999 case _ =>
100100 0
101101 }
102102 let currentFund = match getInteger(this, xxxStartupFund) {
103103 case a: Int =>
104104 a
105105 case _ =>
106106 0
107107 }
108108 if ((0 >= amount))
109109 then throw("Can't withdraw negative amount")
110110 else if ((amount > currentAmount))
111111 then throw("Not enough balance!")
112112 else if ((flag > 0))
113113 then throw("Only one vote per project is possible!")
114114 else WriteSet([DataEntry(xxxInvestorBalance, (currentAmount - amount)), DataEntry(xxxStartupVotes, (currentVotes + 1)), DataEntry(flagKey, 1), DataEntry(xxxStartupFund, (currentFund + amount))])
115115 }
116116
117117
118118 @Verifier(tx)
119119 func verify () = match tx {
120- case d: SetScriptTransaction =>
120+ case t: SetScriptTransaction =>
121121 sigVerify(tx.bodyBytes, tx.proofs[0], base58'H914brzNMwL3CyT3aRGy8VXUNp59vm2nztQHEbUWDv6S')
122122 case c: InvokeScriptTransaction =>
123123 true
124124 case d: DataTransaction =>
125125 true
126126 case _ =>
127127 false
128128 }
129129

github/deemru/w8io/026f985 
39.55 ms