tx · FzQ34yq96nygio6MHySAFucwUapDhTN8T77cgSGvxFV8

3MuADE2ryaHKiVHXg5uFLyB4NYnvQJLZBUv:  -0.01400000 Waves

2019.12.25 11:53 [824308] smart account 3MuADE2ryaHKiVHXg5uFLyB4NYnvQJLZBUv > SELF 0.00000000 Waves

{ "type": 13, "id": "FzQ34yq96nygio6MHySAFucwUapDhTN8T77cgSGvxFV8", "fee": 1400000, "feeAssetId": null, "timestamp": 1577263993363, "version": 1, "sender": "3MuADE2ryaHKiVHXg5uFLyB4NYnvQJLZBUv", "senderPublicKey": "A4bJfnBhBTVh7GRNr1hHz6iqJta6eBbaExPDG7UapoaD", "proofs": [ "bz7Qzw8Qeu1WnuM6QSNbQY9SbEuFc2gaYXQvbvfXHdoxf4Psx2ofjrTJs8c9fv9mJjMHEUCQRA57v5sJh4B5zQr" ], "script": "base64:AAIDAAAAAAAAABMIARIICgYIAQEBAQESABIDCgEIAAAAGQAAAAAHd2F2ZWxldAAAAAAABfXhAAAAAAAPd2F2ZXNEZXBvc2l0QW10CQAAaAAAAAIAAAAAAAAACigFAAAAB3dhdmVsZXQAAAAADWJ0Y0RlcG9zaXRBbXQJAABpAAAAAgkAAGgAAAACAAAAAAAAAAooBQAAAAd3YXZlbGV0AAAAAAAAACcQAAAAAA1ldGhEZXBvc2l0QW10CQAAaAAAAAIAAAAAAAAAAA0FAAAAB3dhdmVsZXQAAAAADWx0Y0RlcG9zaXRBbXQJAABoAAAAAgAAAAAAAAAAJwUAAAAHd2F2ZWxldAAAAAAOd2VzdERlcG9zaXRBbXQJAABoAAAAAgAAAAAAAABlkAUAAAAHd2F2ZWxldAAAAAANd2N0RGVwb3NpdEFtdAkAAGgAAAACAAAAAAAAAGWQBQAAAAd3YXZlbGV0AAAAABJEcmFnb25GcnVpdEFkZHJlc3MCAAAAIzNNekRHOXJ0MTNFdTV1dzRtWnFrRzVheERpaWp2VlNEYmpjAAAAAA1kaXZQcm9ncmFtUHViCQACWQAAAAECAAAALEE0Ykpm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VuZEJhbGFuY2UAAAADCAUAAAADdHR4AAAAB2Fzc2V0SWQFAAAAEmRpdmlkZW5kc1dpdGhkcmF3bgUAAAAQZGl2aWRlbmRzUGVyY2VudAQAAAAOYWNjb3VudEJhbGFuY2UJAAPrAAAAAgUAAAAEdGhpcwgFAAAAA3R0eAAAAAdhc3NldElkCQAAZwAAAAIJAABlAAAAAgUAAAAOYWNjb3VudEJhbGFuY2UIBQAAAAN0dHgAAAAGYW1vdW50BQAAAAlkaXZpZGVuZHMDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAF0ludm9rZVNjcmlwdFRyYW5zYWN0aW9uBAAAAANpdHgFAAAAByRtYXRjaDAGBwcYbQX+", "chainId": 84, "height": 824308, "spentComplexity": 0 } View: original | compacted Prev: 5Z7b73dHSect8WW3QovZtWv6sAWrzRuNFKodQuHFq5wn Next: BuJqY8mhyJ9CmEnJAVCpLcCgJeNkwhPSQSu4cnmHcfFk Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let wavelet = 100000000
5+
6+let wavesDepositAmt = (2600 * wavelet)
7+
8+let btcDepositAmt = ((2600 * wavelet) / 10000)
9+
10+let ethDepositAmt = (13 * wavelet)
11+
12+let ltcDepositAmt = (39 * wavelet)
13+
14+let westDepositAmt = (26000 * wavelet)
15+
16+let wctDepositAmt = (26000 * wavelet)
17+
418 let DragonFruitAddress = "3MzDG9rt13Eu5uw4mZqkG5axDiijvVSDbjc"
519
620 let divProgramPub = fromBase58String("A4bJfnBhBTVh7GRNr1hHz6iqJta6eBbaExPDG7UapoaD")
923
1024 let wavesAssetId = unit
1125
12-let btcAssetId = base58'1'
26+let btcAssetId = base58'8HRQdqJBBeqZvgMtg6we6sw11i5GzpFNs7onNeVRBmaq'
1327
14-let ethAssetId = base58'1'
28+let ethAssetId = base58'4oHq3C7ar7kmcRHEZBrgPyGtU6fkqJ1pHoRYboKeYSWQ'
1529
1630 let ltcAssetId = base58'1'
1731
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4+let wavelet = 100000000
5+
6+let wavesDepositAmt = (2600 * wavelet)
7+
8+let btcDepositAmt = ((2600 * wavelet) / 10000)
9+
10+let ethDepositAmt = (13 * wavelet)
11+
12+let ltcDepositAmt = (39 * wavelet)
13+
14+let westDepositAmt = (26000 * wavelet)
15+
16+let wctDepositAmt = (26000 * wavelet)
17+
418 let DragonFruitAddress = "3MzDG9rt13Eu5uw4mZqkG5axDiijvVSDbjc"
519
620 let divProgramPub = fromBase58String("A4bJfnBhBTVh7GRNr1hHz6iqJta6eBbaExPDG7UapoaD")
721
822 let adminPub = fromBase58String("5yjcfvH6iuwrkFghXuWaJeMppaQ893FSs8HCAgVQzuNY")
923
1024 let wavesAssetId = unit
1125
12-let btcAssetId = base58'1'
26+let btcAssetId = base58'8HRQdqJBBeqZvgMtg6we6sw11i5GzpFNs7onNeVRBmaq'
1327
14-let ethAssetId = base58'1'
28+let ethAssetId = base58'4oHq3C7ar7kmcRHEZBrgPyGtU6fkqJ1pHoRYboKeYSWQ'
1529
1630 let ltcAssetId = base58'1'
1731
1832 let westAssetId = base58'1'
1933
2034 let wctAssetId = base58'1'
2135
2236 func callerIsAdmin (callerPublicKey) = if ((callerPublicKey == adminPub))
2337 then callerPublicKey
2438 else throw("You cannot create deposits")
2539
2640
2741 func callerIsDepositOwner (assetName,callerPublicKey) = {
2842 let depositOwner = getString(this, (assetName + "_DepositOwner"))
2943 if ((callerPublicKey == depositOwner))
3044 then callerPublicKey
3145 else throw("Only deposit owner can withdrawal dividends")
3246 }
3347
3448
3549 func depositCreatedCheck (assetName) = {
3650 let key = (assetName + "_DepositOwner")
3751 let val = getString(this, key)
3852 match val {
3953 case a: String =>
4054 true
4155 case _ =>
4256 false
4357 }
4458 }
4559
4660
4761 func amountCheck (assetName,pmtAmount) = {
4862 let key = (assetName + "_DepositAmount")
4963 let val = getInteger(this, key)
5064 let depositAmount = match val {
5165 case a: Int =>
5266 a
5367 case _ =>
5468 throw("Couldn't find deposit amount")
5569 }
5670 if ((pmtAmount == depositAmount))
5771 then pmtAmount
5872 else throw("Amount is incorrect")
5973 }
6074
6175
6276 func assetBase58ToName (assetId) = if (!(isDefined(assetId)))
6377 then "WAVES"
6478 else if ((assetId == btcAssetId))
6579 then "BTC"
6680 else if ((assetId == ethAssetId))
6781 then "ETH"
6882 else if ((assetId == ltcAssetId))
6983 then "LTC"
7084 else if ((assetId == westAssetId))
7185 then "VST"
7286 else if ((assetId == wctAssetId))
7387 then "WCT"
7488 else throw("AssetId is incorrect")
7589
7690
7791 func assetNameToBase58 (assetName) = if ((assetName == "WAVES"))
7892 then wavesAssetId
7993 else if ((assetName == "BTC"))
8094 then btcAssetId
8195 else if ((assetName == "ETH"))
8296 then ethAssetId
8397 else if ((assetName == "LTC"))
8498 then ltcAssetId
8599 else if ((assetName == "VST"))
86100 then westAssetId
87101 else if ((assetName == "WCT"))
88102 then wctAssetId
89103 else throw("Asset name is incorrect")
90104
91105
92106 func getDividendsPercent (assetName) = {
93107 let key = (assetName + "_DividendPercent")
94108 let val = getInteger(this, key)
95109 match val {
96110 case a: Int =>
97111 a
98112 case _ =>
99113 throw("Couldn't Find dividend percent")
100114 }
101115 }
102116
103117
104118 func getDividendsWithdrawnAmount (assetName) = {
105119 let val = getInteger(this, (assetName + "_DividendsWithdrawn"))
106120 match val {
107121 case a: Int =>
108122 a
109123 case _ =>
110124 0
111125 }
112126 }
113127
114128
115129 func getDividendBalance (assetId,dividendsWithdrawn,dividendsPercent) = {
116130 let dividendsTotalBalance = (assetBalance(this, assetId) + dividendsWithdrawn)
117131 let userStake = ((dividendsTotalBalance * dividendsPercent) / 100)
118132 (userStake - dividendsWithdrawn)
119133 }
120134
121135
122136 @Callable(i)
123137 func createDeposit (assetName,amount,deividendPercent,startHeight,durationBlocks,startTimestamp) = {
124138 let callerPub = callerIsAdmin(i.callerPublicKey)
125139 let depositAlreadyCreated = depositCreatedCheck(assetName)
126140 if (depositAlreadyCreated)
127141 then throw("Deposit is already created")
128142 else WriteSet([DataEntry((assetName + "_DepositState"), "Created"), DataEntry((assetName + "_DepositAmount"), amount), DataEntry((assetName + "_DividendPercent"), deividendPercent), DataEntry((assetName + "_DepositStartBlock"), startHeight), DataEntry((assetName + "_DepositStartTimestamp"), startTimestamp), DataEntry((assetName + "_DepositDurationBlock"), durationBlocks)])
129143 }
130144
131145
132146
133147 @Callable(i)
134148 func deposit () = {
135149 let callerPub = toBase58String(i.callerPublicKey)
136150 let pmt = extract(i.payment)
137151 let assetName = assetBase58ToName(pmt.assetId)
138152 let amount = amountCheck(assetName, pmt.amount)
139153 let depositState = getString(this, (assetName + "_DepositState"))
140154 if ((depositState == "Created"))
141155 then ScriptResult(WriteSet([DataEntry((assetName + "_DepositOwner"), callerPub), DataEntry((assetName + "_DepositState"), "Active"), DataEntry((callerPub + "_DividendsWithdrawn"), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(DragonFruitAddress), amount, pmt.assetId)]))
142156 else throw("Deposit is unavailable")
143157 }
144158
145159
146160
147161 @Callable(i)
148162 func withdrawDividends (assetName) = {
149163 let assetId = assetNameToBase58(assetName)
150164 let depositOwner = callerIsDepositOwner(assetName, toBase58String(i.callerPublicKey))
151165 let dividendsPercent = getDividendsPercent(assetName)
152166 let dividendsWithdrawn = getDividendsWithdrawnAmount(assetName)
153167 let dividendsAvaliable = getDividendBalance(assetId, dividendsWithdrawn, dividendsPercent)
154168 ScriptResult(WriteSet([DataEntry((depositOwner + "_DividendsWithdrawn"), (dividendsWithdrawn + dividendsAvaliable))]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(depositOwner)), dividendsAvaliable, assetId)]))
155169 }
156170
157171
158172 @Verifier(tx)
159173 func verify () = if (sigVerify(tx.bodyBytes, tx.proofs[0], divProgramPub))
160174 then match tx {
161175 case sstx: SetScriptTransaction =>
162176 true
163177 case ttx: TransferTransaction =>
164178 let assetName = assetBase58ToName(ttx.assetId)
165179 let dividendsPercent = getDividendsPercent(assetName)
166180 let dividendsWithdrawn = getDividendsWithdrawnAmount(assetName)
167181 let dividends = getDividendBalance(ttx.assetId, dividendsWithdrawn, dividendsPercent)
168182 let accountBalance = assetBalance(this, ttx.assetId)
169183 ((accountBalance - ttx.amount) >= dividends)
170184 case itx: InvokeScriptTransaction =>
171185 true
172186 case _ =>
173187 false
174188 }
175189 else false
176190

github/deemru/w8io/026f985 
46.81 ms