tx · 4Sjx5AjS1w4oTGPZdBtH1QM6DcDSrTjseCXywWPfD7vD

3Muq5wV3BDmwMhJVZYV29DzxmK1omjyuibx:  -0.01400000 Waves

2019.12.30 15:41 [831830] smart account 3Muq5wV3BDmwMhJVZYV29DzxmK1omjyuibx > SELF 0.00000000 Waves

{ "type": 13, "id": "4Sjx5AjS1w4oTGPZdBtH1QM6DcDSrTjseCXywWPfD7vD", "fee": 1400000, "feeAssetId": null, "timestamp": 1577709666220, "version": 1, "sender": "3Muq5wV3BDmwMhJVZYV29DzxmK1omjyuibx", "senderPublicKey": "2VedaSDtTc2zJEQPTDwrUiyjjbQAbFbjtyuFWe5HSt4S", "proofs": [ "fqBuJ7VTRMRCUFHtLYqYTTgSEqHSezS44DtznTx3SLMkb3gAjrBVpiQvspxyiRvzRKNUv6H8t4MS2DqxUQ29WcG" ], "script": "base64:AAIDAAAAAAAAABMIARIICgYIAQEBAQESABIDCgEIAAAAEgAAAAASRHJhZ29uRnJ1aXRBZGRyZXNzAgAAACMzTXpERzlydDEzRXU1dXc0bVpxa0c1YXhEaWlqdlZTRGJqYwAAAAANZGl2UHJvZ3JhbVB1YgkAAlkAAAABAgAAACwyVmVkYVNEdFRjMnpKRVFQVER3clVpeWpqYlFBYkZianR5dUZXZTVIU3Q0UwAAAAAIYWRtaW5QdWIJAAJZAAAAAQIAAAAsNXlqY2Z2SDZpdXdya0ZnaFh1V2FKZU1wcGFRODkzRlNzOEhDQWdWUXp1TlkAAAAADHdhdmVzQXNzZXRJZAUAAAAEdW5pdAAAAAAKYnRjQXNzZXRJZAEAAAAgbDay9tQcEtzHdt0STB4S0ADuIUgbcohuxXO8rQ852yoAAAAACmV0aEFzc2V0SWQBAAAAIDhuzkVW3sDH2wOtmv6JQ6ro5x6FVpACOmgC2/a56f4VAAAAAApsdGNBc3NldElkAQAAACDoIi/sdJtWLPdBhG4QLfxocGGv0n1LPYuk5MXk5PmgNAAAAAALd2VzdEFzc2V0SWQBAAAAIKPMH7K9UkJ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ZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABCQACWQAAAAEFAAAADGRlcG9zaXRPd25lcgUAAAASZGl2aWRlbmRzQXZhbGlhYmxlBQAAAAdhc3NldElkBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAABm8qkLA=", "chainId": 84, "height": 831830, "spentComplexity": 0 } View: original | compacted Prev: 5WRfPAjMKVa1muX9pEvCqLCgL64af87Se3kAgxbSuqdp Next: 6WZjsTb3UjQnBUi7rMF7p7Hb7XXYnc8KUeWiQHHeUhu Diff:
OldNewDifferences
33 {-# CONTENT_TYPE DAPP #-}
44 let DragonFruitAddress = "3MzDG9rt13Eu5uw4mZqkG5axDiijvVSDbjc"
55
6-let divProgramPub = fromBase58String("A4bJfnBhBTVh7GRNr1hHz6iqJta6eBbaExPDG7UapoaD")
6+let divProgramPub = fromBase58String("2VedaSDtTc2zJEQPTDwrUiyjjbQAbFbjtyuFWe5HSt4S")
77
88 let adminPub = fromBase58String("5yjcfvH6iuwrkFghXuWaJeMppaQ893FSs8HCAgVQzuNY")
99
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let DragonFruitAddress = "3MzDG9rt13Eu5uw4mZqkG5axDiijvVSDbjc"
55
6-let divProgramPub = fromBase58String("A4bJfnBhBTVh7GRNr1hHz6iqJta6eBbaExPDG7UapoaD")
6+let divProgramPub = fromBase58String("2VedaSDtTc2zJEQPTDwrUiyjjbQAbFbjtyuFWe5HSt4S")
77
88 let adminPub = fromBase58String("5yjcfvH6iuwrkFghXuWaJeMppaQ893FSs8HCAgVQzuNY")
99
1010 let wavesAssetId = unit
1111
1212 let btcAssetId = base58'8HRQdqJBBeqZvgMtg6we6sw11i5GzpFNs7onNeVRBmaq'
1313
1414 let ethAssetId = base58'4oHq3C7ar7kmcRHEZBrgPyGtU6fkqJ1pHoRYboKeYSWQ'
1515
1616 let ltcAssetId = base58'Gd9pdZw9muDBZwwsQLqyigRJCDABbiJaksmemzFCorsV'
1717
1818 let westAssetId = base58'C2Pz1Q9QYaF9MkK9J9mX9vAMVc25R3w6Lr5g5B5Yje87'
1919
2020 let wctAssetId = base58'AMQkRmWSWHEd1nMDvDZFkadoCFCxRkDzBsEbscJ9ZZ2P'
2121
2222 func callerIsAdmin (callerPublicKey) = if ((callerPublicKey == adminPub))
2323 then callerPublicKey
2424 else throw("You cannot create deposits")
2525
2626
2727 func callerIsDepositOwner (assetName,callerPublicKey) = {
2828 let depositOwner = getString(this, (assetName + "_DepositOwner"))
2929 if ((callerPublicKey == depositOwner))
3030 then callerPublicKey
3131 else throw("Only deposit owner can withdrawal dividends")
3232 }
3333
3434
3535 func depositCreatedCheck (assetName) = {
3636 let key = (assetName + "_DepositOwner")
3737 let val = getString(this, key)
3838 match val {
3939 case a: String =>
4040 true
4141 case _ =>
4242 false
4343 }
4444 }
4545
4646
4747 func amountCheck (assetName,pmtAmount) = {
4848 let key = (assetName + "_DepositAmount")
4949 let val = getInteger(this, key)
5050 let depositAmount = match val {
5151 case a: Int =>
5252 a
5353 case _ =>
5454 throw("Couldn't find deposit amount")
5555 }
5656 if ((pmtAmount == depositAmount))
5757 then pmtAmount
5858 else throw("Amount is incorrect")
5959 }
6060
6161
6262 func assetBase58ToName (assetId) = if (!(isDefined(assetId)))
6363 then "WAVES"
6464 else if ((assetId == btcAssetId))
6565 then "BTC"
6666 else if ((assetId == ethAssetId))
6767 then "ETH"
6868 else if ((assetId == ltcAssetId))
6969 then "LTC"
7070 else if ((assetId == westAssetId))
7171 then "WEST"
7272 else if ((assetId == wctAssetId))
7373 then "WCT"
7474 else throw("AssetId is incorrect")
7575
7676
7777 func assetNameToBase58 (assetName) = if ((assetName == "WAVES"))
7878 then wavesAssetId
7979 else if ((assetName == "BTC"))
8080 then btcAssetId
8181 else if ((assetName == "ETH"))
8282 then ethAssetId
8383 else if ((assetName == "LTC"))
8484 then ltcAssetId
8585 else if ((assetName == "WEST"))
8686 then westAssetId
8787 else if ((assetName == "WCT"))
8888 then wctAssetId
8989 else throw("Asset name is incorrect")
9090
9191
9292 func getDividendsPercent (assetName) = {
9393 let key = (assetName + "_DividendPercent")
9494 let val = getInteger(this, key)
9595 match val {
9696 case a: Int =>
9797 a
9898 case _ =>
9999 throw("Couldn't Find dividend percent")
100100 }
101101 }
102102
103103
104104 func getDividendsWithdrawnAmount (assetName) = {
105105 let val = getInteger(this, (assetName + "_DividendWithdrawn"))
106106 match val {
107107 case a: Int =>
108108 a
109109 case _ =>
110110 0
111111 }
112112 }
113113
114114
115115 func getDividendBalance (assetId,dividendsWithdrawn,dividendsPercent) = {
116116 let dividendsTotalBalance = (assetBalance(this, assetId) + dividendsWithdrawn)
117117 let userStake = ((dividendsTotalBalance * dividendsPercent) / 100)
118118 (userStake - dividendsWithdrawn)
119119 }
120120
121121
122122 @Callable(i)
123123 func createDeposit (assetName,amount,deividendPercent,startHeight,durationBlocks,startTimestamp) = {
124124 let callerPub = callerIsAdmin(i.callerPublicKey)
125125 let depositAlreadyCreated = depositCreatedCheck(assetName)
126126 if (depositAlreadyCreated)
127127 then throw("Deposit is already created")
128128 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)])
129129 }
130130
131131
132132
133133 @Callable(i)
134134 func deposit () = {
135135 let callerPub = toBase58String(i.callerPublicKey)
136136 let pmt = extract(i.payment)
137137 let assetName = assetBase58ToName(pmt.assetId)
138138 let amount = amountCheck(assetName, pmt.amount)
139139 let depositState = getString(this, (assetName + "_DepositState"))
140140 if ((depositState == "Created"))
141141 then ScriptResult(WriteSet([DataEntry("_Operation", height), DataEntry((assetName + "_DepositOwner"), callerPub), DataEntry((assetName + "_DepositState"), "Active"), DataEntry((assetName + "_DividendWithdrawn"), 0)]), TransferSet([ScriptTransfer(addressFromStringValue(DragonFruitAddress), amount, pmt.assetId)]))
142142 else throw("Deposit is unavailable")
143143 }
144144
145145
146146
147147 @Callable(i)
148148 func withdrawDividends (assetName) = {
149149 let assetId = assetNameToBase58(assetName)
150150 let depositOwner = callerIsDepositOwner(assetName, toBase58String(i.callerPublicKey))
151151 let dividendsPercent = getDividendsPercent(assetName)
152152 let dividendsWithdrawn = getDividendsWithdrawnAmount(assetName)
153153 let dividendsAvaliable = getDividendBalance(assetId, dividendsWithdrawn, dividendsPercent)
154154 ScriptResult(WriteSet([DataEntry((assetName + "_DividendWithdrawn"), (dividendsWithdrawn + dividendsAvaliable))]), TransferSet([ScriptTransfer(addressFromPublicKey(fromBase58String(depositOwner)), dividendsAvaliable, assetId)]))
155155 }
156156
157157
158158 @Verifier(tx)
159159 func verify () = true
160160

github/deemru/w8io/026f985 
40.17 ms