tx · FCQ4WM7zuAZjBPp25CDs7CH71r8GQEgc1XrRuFt8wWXH

3MyBgxRjsj4dFVLNqZVMpJuqFcchA1rfdPd:  -0.05000000 Waves

2019.10.17 00:54 [723113] smart account 3MyBgxRjsj4dFVLNqZVMpJuqFcchA1rfdPd > SELF 0.00000000 Waves

{ "type": 13, "id": "FCQ4WM7zuAZjBPp25CDs7CH71r8GQEgc1XrRuFt8wWXH", "fee": 5000000, "feeAssetId": null, "timestamp": 1571262887779, "version": 1, "sender": "3MyBgxRjsj4dFVLNqZVMpJuqFcchA1rfdPd", "senderPublicKey": "FNveiFvnZxbJ2nmWHcE42V2V1LQV3qAtmdpvbFnTimVG", "proofs": [ "2c2fbBzRrK2WUPR12f939C5uyFoM4MfMzSPkJBbW8CXt2c9JuinG6dQSvz7VMQFJMeypjgYvxEaxTo82nHaBsjj7" ], "script": "base64:AAIDAAAAAAAAAAwIARIDCgEIEgMKAQEAAAATAAAAAAl3YXZlc0xldHMAAAAAAAX14QAAAAAADlRvdGFsQW1vdW50S2V5AgAAAAtUb3RhbEFtb3VudAAAAAASVG90YWxBbW91bnRMZWZ0S2V5AgAAAA9Ub3RhbEFtb3VudExlZnQAAAAAEVVuaXF1ZVNwb25zb3JzS2V5AgAAAA5VbmlxdWVTcG9uc29ycwAAAAAJRmVlUHVia2V5AQAAACAok4ZZcGaRC+s2MKC22dBEPDzVWEOIB9nM7V46PClPeQAAAAAJRmVlV2FsbGV0CQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABBQAAAAlGZWVQdWJrZXkAAAAADnJlY2VpdmVyUHViS2V5AQAAACAlbSP+mgMlNuu7HG4M1vuMOYBvzRL+YwXaxGu6HTwDKwAAAAAIcmVjZWl2ZXIJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEFAAAADnJlY2VpdmVyUHViS2V5AAAAAAdBc3NldGlkAQAAACAtXwbA0Q7uhfCrAR9ZeFYHgPlLE5YOZ+sod5jyZQISnwAAAAA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ADkxhc3RQYXltZW50S2V5BQAAAAZoZWlnaHQFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADBQAAAAhyZWNlaXZlcgUAAAAOV2l0aGRyYXdBbW91bnQFAAAABHVuaXQJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwUAAAAJRmVlV2FsbGV0BQAAAAlGZWVBbW91bnQFAAAABHVuaXQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAEAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABRTZXRTY3JpcHRUcmFuc2FjdGlvbgQAAAABcwUAAAAHJG1hdGNoMAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkHcDyyMA==", "chainId": 84, "height": 723113, "spentComplexity": 0 } View: original | compacted Prev: 9ZP1WGZksBpum9kd5tmh2JKzGaahPZZPQw5EnRi1rBzw Next: HBBhSEcWc8fwgc28PHv3wpsKgrjEnFCU5CBxWwDitJpm Diff:
OldNewDifferences
1717
1818 let receiver = addressFromPublicKey(receiverPubKey)
1919
20-let Assetid = "447PWweqTQPF9anUKtknDx7fNsGzHCVgsbVJiP8FSGdt"
20+let Assetid = base58'447PWweqTQPF9anUKtknDx7fNsGzHCVgsbVJiP8FSGdt'
2121
2222 let LastPaymentKey = "LastPayment"
2323
6363 @Callable(i)
6464 func deposit (sponsor) = {
6565 let pmt = extract(i.payment)
66- if ((pmt.assetId != toBytes(Assetid)))
66+ if ((pmt.assetId != Assetid))
6767 then throw("Only Assetid can be deposited")
6868 else {
6969 let currentKey = toBase58String(i.caller.bytes)
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let wavesLets = 100000000
55
66 let TotalAmountKey = "TotalAmount"
77
88 let TotalAmountLeftKey = "TotalAmountLeft"
99
1010 let UniqueSponsorsKey = "UniqueSponsors"
1111
1212 let FeePubkey = base58'3jPnDZ2dMwgNS3NJKwrRaov4EsEygKfrnHPyQDD2bfk4'
1313
1414 let FeeWallet = addressFromPublicKey(FeePubkey)
1515
1616 let receiverPubKey = base58'3X6cLkhy6PLoJ5uJdjke6a3ikfEW8Msf62CaoHRY8YWv'
1717
1818 let receiver = addressFromPublicKey(receiverPubKey)
1919
20-let Assetid = "447PWweqTQPF9anUKtknDx7fNsGzHCVgsbVJiP8FSGdt"
20+let Assetid = base58'447PWweqTQPF9anUKtknDx7fNsGzHCVgsbVJiP8FSGdt'
2121
2222 let LastPaymentKey = "LastPayment"
2323
2424 let PaymentTimeout = 10
2525
2626 let MaxSalary = 1
2727
2828 let Fee = 2
2929
3030 let test = 2
3131
3232 func getNumberByKey (key) = {
3333 let num = match getInteger(this, key) {
3434 case a: Int =>
3535 a
3636 case _ =>
3737 0
3838 }
3939 num
4040 }
4141
4242
4343 func GetKeySponsor (sponsor) = (sponsor + "_sponsor")
4444
4545
4646 func GetKeySponsorAmount (sponsor) = (sponsor + "_amount")
4747
4848
4949 func GetSponsorAmount (sponsor) = getNumberByKey(GetKeySponsorAmount(sponsor))
5050
5151
5252 func CheckUniqueSponsor (sponsor,count) = {
5353 let returnval = match getString(this, GetKeySponsor(sponsor)) {
5454 case a: String =>
5555 count
5656 case _ =>
5757 (count + 1)
5858 }
5959 returnval
6060 }
6161
6262
6363 @Callable(i)
6464 func deposit (sponsor) = {
6565 let pmt = extract(i.payment)
66- if ((pmt.assetId != toBytes(Assetid)))
66+ if ((pmt.assetId != Assetid))
6767 then throw("Only Assetid can be deposited")
6868 else {
6969 let currentKey = toBase58String(i.caller.bytes)
7070 let currentAmount = getNumberByKey(currentKey)
7171 let CurrSponsorAmount = GetSponsorAmount(currentKey)
7272 let currentTotalAmount = getNumberByKey(TotalAmountKey)
7373 let currentAmountLeft = getNumberByKey(TotalAmountLeftKey)
7474 let UniqueSponsorCount = getNumberByKey(UniqueSponsorsKey)
7575 let newUniqueSponsorCount = CheckUniqueSponsor(currentKey, UniqueSponsorCount)
7676 let newSponsorAmount = (CurrSponsorAmount + pmt.amount)
7777 let newAmount = (currentAmount + pmt.amount)
7878 let newtotalAmount = (currentTotalAmount + pmt.amount)
7979 let newtotalamountleft = (currentAmountLeft + pmt.amount)
8080 WriteSet([DataEntry(currentKey, newAmount), DataEntry(TotalAmountKey, newtotalAmount), DataEntry(TotalAmountLeftKey, newtotalamountleft), DataEntry(GetKeySponsorAmount(currentKey), newSponsorAmount), DataEntry(GetKeySponsor(currentKey), toBytes(sponsor)), DataEntry(UniqueSponsorsKey, newUniqueSponsorCount)])
8181 }
8282 }
8383
8484
8585
8686 @Callable(i)
8787 func withdraw (amount) = {
8888 let currentKey = toBase58String(i.caller.bytes)
8989 let AllowedSigner = (i.caller == receiver)
9090 let FeeAmount = ((amount * Fee) / 100)
9191 let WithdrawAmount = (amount - FeeAmount)
9292 let currentAmountLeft = match getInteger(this, TotalAmountLeftKey) {
9393 case a: Int =>
9494 a
9595 case _ =>
9696 0
9797 }
9898 let lastPayment = match getInteger(this, LastPaymentKey) {
9999 case a: Int =>
100100 a
101101 case _ =>
102102 0
103103 }
104104 if (!(AllowedSigner))
105105 then throw("Withdraw is only allowed by recipient")
106106 else if (((lastPayment + PaymentTimeout) > height))
107107 then throw("Next payment not yet allowed")
108108 else {
109109 let newAmountLeft = (currentAmountLeft - amount)
110110 if ((0 > amount))
111111 then throw("Can't withdraw negative amount")
112112 else if ((amount > (MaxSalary * wavesLets)))
113113 then throw((("Not allowed to withdraw more than " + toString(MaxSalary)) + " WAVES"))
114114 else if ((0 > newAmountLeft))
115115 then throw("Not enough balance")
116116 else ScriptResult(WriteSet([DataEntry(TotalAmountLeftKey, newAmountLeft), DataEntry(LastPaymentKey, height)]), TransferSet([ScriptTransfer(receiver, WithdrawAmount, unit), ScriptTransfer(FeeWallet, FeeAmount, unit)]))
117117 }
118118 }
119119
120120
121121 @Verifier(tx)
122122 func verify () = match tx {
123123 case s: SetScriptTransaction =>
124124 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
125125 case _ =>
126126 false
127127 }
128128

github/deemru/w8io/169f3d6 
104.50 ms