tx · 4YhWMpQkvFJah1ashk5xUomxdobUkuppcxpxc6469yFK

3MyDGEoKp1gF4LSRknk9vSuDEyrwuYXcQEQ:  -0.01000000 Waves

2022.05.09 13:37 [2044029] smart account 3MyDGEoKp1gF4LSRknk9vSuDEyrwuYXcQEQ > SELF 0.00000000 Waves

{ "type": 13, "id": "4YhWMpQkvFJah1ashk5xUomxdobUkuppcxpxc6469yFK", "fee": 1000000, "feeAssetId": null, "timestamp": 1652092766553, "version": 2, "chainId": 84, "sender": "3MyDGEoKp1gF4LSRknk9vSuDEyrwuYXcQEQ", "senderPublicKey": "BhRnrwd6wVHSkSaWXCjQRjaoXcpCdUW2hkJD6V7uVDxN", "proofs": [ "4kmL8wWd414LoQu68Fvi4kL6qi6HuG9by8AdciapxQgB4Cg7LFA2qf5iJQG81eVGXxh4H1gDTGzxKQPqSosqtfsZ" ], "script": "base64:AAIFAAAAAAAAABgIAhIAEgQKAggBEgMKAQESBQoDCAgBEgAAAAAJAAAAAApzaGlueXdnZ2lkAQAAACCJac8C/7a6udRxltd5uJl2JrB00Hd59HNuhvD0c58GJgAAAAAMYWRtaW5BZGRyZXNzCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABAgAAACMzTXBOdGlQU1JTcTZObmFRWWszOEJmV1N6WmNnQVlUeXJROQAAAAANYXNzZXRzQWRkcmVzcwEAAAAaAVTL5rTBd9cdJy1rFhBLypFI6ymLChqVp5oBAAAADXRyeUdldEludGVnZXIAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAEAAAANdHJ5R2V0Qm9vbGVhbgAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGwAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAHQm9vbGVhbgQAAAABY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yZSBub3QgYXV0aG9yaXplZCB0byBwZXJmb3JtIHRoaXMgb3BlcmF0aW9uCQEAAAAQaW50ZXJuYWxUcmFuc2ZlcgAAAAMFAAAAC2Zyb21BZGRyZXNzBQAAAAl0b0FkZHJlc3MFAAAABmFtb3VudAAAAAFpAQAAAAZSZWRlZW0AAAAABAAAAAphZGRyZXNzU3RyCQAEJQAAAAEIBQAAAAFpAAAABmNhbGxlcgQAAAAOcmVzZXJ2ZWRBbW91bnQJAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQkAASwAAAACBQAAAAphZGRyZXNzU3RyAgAAAAlfUmVzZXJ2ZWQDCQAAAAAAAAIFAAAADnJlc2VydmVkQW1vdW50AAAAAAAAAAAACQAAAgAAAAECAAAAEU5vdGhpbmcgdG8gcmVkZWVtCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEJAAEsAAAAAgUAAAAKYWRkcmVzc1N0cgIAAAAJX1Jlc2VydmVkCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAOcmVzZXJ2ZWRBbW91bnQFAAAACnNoaW55d2dnaWQFAAAAA25pbAAAAAArftjs", "height": 2044029, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4FQepgcGSUiM7szPq1pqp5wDqwP9Hxvm9FFWMXP3zhLk Next: 6x5DG9NM6tRwDwEvGw6pZzN1mSpZpL5whQdtLvJCKRFq Diff:
OldNewDifferences
3232 func internalPay (addressStr,amount) = {
3333 let deposited = tryGetInteger((addressStr + "_Deposit"))
3434 if ((0 > (deposited - amount)))
35- then throw("Not enough deposit to build.")
35+ then throw("Not enough deposit.")
3636 else if (((deposited - amount) == 0))
3737 then [DeleteEntry((addressStr + "_Deposit"))]
3838 else [IntegerEntry((addressStr + "_Deposit"), (deposited - amount))]
4646
4747
4848 func internalTransfer (fromAddress,toAddress,amount) = (internalPay(fromAddress, amount) ++ internalDeposit(toAddress, amount))
49-
50-
51-@Callable(i)
52-func setAssetAddress (assetAddr) = if (if ((i.caller != this))
53- then (i.caller != adminAddress)
54- else false)
55- then throw("you are not authorized to perform this operation")
56- else [StringEntry("AssetAddress", assetAddr)]
57-
5849
5950
6051 @Callable(i)
7263 then throw("Only $HEG payments allowed")
7364 else {
7465 let amount = tryGetInteger((addressStr + "_Deposit"))
75- internalDeposit(addressStr, (amount + amountIn))
66+ $Tuple2(internalDeposit(addressStr, (amount + amountIn)), (amount + amountIn))
7667 }
7768 else throw("Strict value is not equal to itself.")
7869 }
9081 then (i.caller.bytes != assetsAddress)
9182 else false)
9283 then throw("you are not authorized to perform this operation")
93- else internalPay(addressStr, amount)
84+ else $Tuple2(internalPay(addressStr, amount), amount)
9485
9586
9687
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let shinywggid = base58'AFQS5E4ELtxex3iANtWtUU2V2oWJZSo8VVnK8z3VFmqf'
55
66 let adminAddress = addressFromStringValue("3MpNtiPSRSq6NnaQYk38BfWSzZcgAYTyrQ9")
77
88 let assetsAddress = base58'3N8WDKbqGox5Eky326PHHT7rUyrby5MXdmb'
99
1010 func tryGetInteger (key) = match getInteger(this, key) {
1111 case b: Int =>
1212 b
1313 case _ =>
1414 0
1515 }
1616
1717
1818 func tryGetBoolean (key) = match getBoolean(this, key) {
1919 case b: Boolean =>
2020 b
2121 case _ =>
2222 false
2323 }
2424
2525
2626 func internalDeposit (addressStr,amountIn) = {
2727 let amount = tryGetInteger((addressStr + "_Deposit"))
2828 [IntegerEntry((addressStr + "_Deposit"), (amount + amountIn))]
2929 }
3030
3131
3232 func internalPay (addressStr,amount) = {
3333 let deposited = tryGetInteger((addressStr + "_Deposit"))
3434 if ((0 > (deposited - amount)))
35- then throw("Not enough deposit to build.")
35+ then throw("Not enough deposit.")
3636 else if (((deposited - amount) == 0))
3737 then [DeleteEntry((addressStr + "_Deposit"))]
3838 else [IntegerEntry((addressStr + "_Deposit"), (deposited - amount))]
3939 }
4040
4141
4242 func internalReserve (addressStr,amount) = {
4343 let reservedAmount = tryGetInteger((addressStr + "_Reserved"))
4444 [IntegerEntry((addressStr + "_Reserved"), (reservedAmount + amount))]
4545 }
4646
4747
4848 func internalTransfer (fromAddress,toAddress,amount) = (internalPay(fromAddress, amount) ++ internalDeposit(toAddress, amount))
49-
50-
51-@Callable(i)
52-func setAssetAddress (assetAddr) = if (if ((i.caller != this))
53- then (i.caller != adminAddress)
54- else false)
55- then throw("you are not authorized to perform this operation")
56- else [StringEntry("AssetAddress", assetAddr)]
57-
5849
5950
6051 @Callable(i)
6152 func Deposit () = {
6253 let addressStr = toString(i.originCaller)
6354 let pmt = i.payments[0]
6455 if ((pmt == pmt))
6556 then {
6657 let amountIn = value(i.payments[0].amount)
6758 if ((amountIn == amountIn))
6859 then {
6960 let assetIn = pmt.assetId
7061 if ((assetIn == assetIn))
7162 then if ((assetIn != shinywggid))
7263 then throw("Only $HEG payments allowed")
7364 else {
7465 let amount = tryGetInteger((addressStr + "_Deposit"))
75- internalDeposit(addressStr, (amount + amountIn))
66+ $Tuple2(internalDeposit(addressStr, (amount + amountIn)), (amount + amountIn))
7667 }
7768 else throw("Strict value is not equal to itself.")
7869 }
7970 else throw("Strict value is not equal to itself.")
8071 }
8172 else throw("Strict value is not equal to itself.")
8273 }
8374
8475
8576
8677 @Callable(i)
8778 func Pay (addressStr,amount) = if (if (if ((i.caller != this))
8879 then (i.caller != adminAddress)
8980 else false)
9081 then (i.caller.bytes != assetsAddress)
9182 else false)
9283 then throw("you are not authorized to perform this operation")
93- else internalPay(addressStr, amount)
84+ else $Tuple2(internalPay(addressStr, amount), amount)
9485
9586
9687
9788 @Callable(i)
9889 func CallerPay (amount) = {
9990 let callerAddr = toString(i.caller)
10091 internalPay(callerAddr, amount)
10192 }
10293
10394
10495
10596 @Callable(i)
10697 func transferCoins (fromAddress,toAddress,amount) = if (if ((i.caller != adminAddress))
10798 then (i.caller.bytes != assetsAddress)
10899 else false)
109100 then throw("you are not authorized to perform this operation")
110101 else internalTransfer(fromAddress, toAddress, amount)
111102
112103
113104
114105 @Callable(i)
115106 func Redeem () = {
116107 let addressStr = toString(i.caller)
117108 let reservedAmount = tryGetInteger((addressStr + "_Reserved"))
118109 if ((reservedAmount == 0))
119110 then throw("Nothing to redeem")
120111 else [DeleteEntry((addressStr + "_Reserved")), ScriptTransfer(i.caller, reservedAmount, shinywggid)]
121112 }
122113
123114

github/deemru/w8io/169f3d6 
83.84 ms