tx · DsZWMNEt42YSdLa6Ezz1ei6ZyqHmDcHybWR6pxE8j6cT

3Mza5Ao6wJgpw1JG3jxRY1xigD44zgfhdK6:  -0.04000000 Waves

2021.11.04 16:22 [1776309] smart account 3Mza5Ao6wJgpw1JG3jxRY1xigD44zgfhdK6 > SELF 0.00000000 Waves

{ "type": 13, "id": "DsZWMNEt42YSdLa6Ezz1ei6ZyqHmDcHybWR6pxE8j6cT", "fee": 4000000, "feeAssetId": null, "timestamp": 1636032122205, "version": 2, "chainId": 84, "sender": "3Mza5Ao6wJgpw1JG3jxRY1xigD44zgfhdK6", "senderPublicKey": "Gud7Z17wiZEMZiHRbn48k2D9H13jmLEDZZ8b7NCfjRJL", "proofs": [ "2BfUXuaeHDHPdnD7YLbRBGn45QcsB92zsbmuHRBBoyZg9NGBdD8TPmT5nP74Xq6t4QC13bAVfVFhmZ3dPDAciRwv" ], "script": "base64:AAIFAAAAAAAAAA8IAhIAEgMKAQESBAoCAQgAAAAAAAAAAwAAAAFpAQAAAAdkZXBvc2l0AAAAAAQAAAADcG10AwkAAAAAAAACCQABkAAAAAEIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAABCQABkQAAAAIIBQAAAAFpAAAACHBheW1lbnRzAAAAAAAAAAAACQAAAgAAAAECAAAAHEF0dGFjaGVkIHBheW1lbnQgaXMgcmVxdWlyZWQDCQEAAAAJaXNEZWZpbmVkAAAAAQgFAAAAA3BtdAAAAAdhc3NldElkCQAAAgAAAAECAAAAFXdvcmtzIHdpdGggd2F2ZXMgb25seQQAAAAKY3VycmVudEtleQkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzBAAAAA1jdXJyZW50QW1vdW50BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAACmN1cnJlbnRLZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAQAAAAJbmV3QW1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AAB3NtYXJ0UEsEAAAABnNlY29uZAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAFAAAACHNlY29uZFBLBAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAUU2V0U2NyaXB0VHJhbnNhY3Rpb24EAAAAAXQFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAA9EYXRhVHJhbnNhY3Rpb24EAAAAAXQFAAAAByRtYXRjaDAGAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABdJbnZva2VTY3JpcHRUcmFuc2FjdGlvbgQAAAABdAUAAAAHJG1hdGNoMAYDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAAAXQFAAAAByRtYXRjaDADBQAAAAVzbWFydAYFAAAABnNlY29uZAeBLsDb", "height": 1776309, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: JBqHQLCwbB3aZ4hAR18k1BjBKy3GSepNRfpXiTGV81p9 Next: GBhXADtPKoS4CpCVewbi4PsMLYemj3cpy2LzXXcDf5xH Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-
5-
6-@Callable(i)
7-func call () = {
8- let asset = Issue("Asset", "", 1, 0, true, unit, 0)
9- let assetId = calculateAssetId(asset)
10-[BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), asset, Reissue(assetId, 1, false), Burn(assetId, 1), ScriptTransfer(i.caller, 1, assetId)]
11- }
12-
134
145
156 @Callable(i)
6455 }
6556 let newAmount = (currentAmount - amount)
6657 if ((0 > amount))
67- then throw("Can't withdraw negative amount")
58+ then throw("Can't transfer negative amount")
6859 else if ((0 > newAmount))
6960 then throw("Not enough balance")
7061 else {
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
4-
5-
6-@Callable(i)
7-func call () = {
8- let asset = Issue("Asset", "", 1, 0, true, unit, 0)
9- let assetId = calculateAssetId(asset)
10-[BinaryEntry("bin", base58''), BooleanEntry("bool", true), IntegerEntry("int", 1), StringEntry("str", ""), DeleteEntry("str"), asset, Reissue(assetId, 1, false), Burn(assetId, 1), ScriptTransfer(i.caller, 1, assetId)]
11- }
12-
134
145
156 @Callable(i)
167 func deposit () = {
178 let pmt = if ((size(i.payments) == 1))
189 then i.payments[0]
1910 else throw("Attached payment is required")
2011 if (isDefined(pmt.assetId))
2112 then throw("works with waves only")
2213 else {
2314 let currentKey = toBase58String(i.caller.bytes)
2415 let currentAmount = match getInteger(this, currentKey) {
2516 case a: Int =>
2617 a
2718 case _ =>
2819 0
2920 }
3021 let newAmount = (currentAmount + pmt.amount)
3122 $Tuple2([IntegerEntry(currentKey, newAmount)], unit)
3223 }
3324 }
3425
3526
3627
3728 @Callable(i)
3829 func withdraw (amount) = {
3930 let currentKey = toBase58String(i.caller.bytes)
4031 let currentAmount = match getInteger(this, currentKey) {
4132 case a: Int =>
4233 a
4334 case _ =>
4435 0
4536 }
4637 let newAmount = (currentAmount - amount)
4738 if ((0 > amount))
4839 then throw("Can't withdraw negative amount")
4940 else if ((0 > newAmount))
5041 then throw("Not enough balance")
5142 else $Tuple2([IntegerEntry(currentKey, newAmount), ScriptTransfer(i.caller, amount, unit)], unit)
5243 }
5344
5445
5546
5647 @Callable(i)
5748 func transfer (amount,recipient) = {
5849 let currentKey = toBase58String(i.caller.bytes)
5950 let currentAmount = match getInteger(this, currentKey) {
6051 case a: Int =>
6152 a
6253 case _ =>
6354 0
6455 }
6556 let newAmount = (currentAmount - amount)
6657 if ((0 > amount))
67- then throw("Can't withdraw negative amount")
58+ then throw("Can't transfer negative amount")
6859 else if ((0 > newAmount))
6960 then throw("Not enough balance")
7061 else {
7162 let recKey = toBase58String(Address(fromBase58String(recipient)).bytes)
7263 let recAmount = match getInteger(this, recKey) {
7364 case a: Int =>
7465 a
7566 case _ =>
7667 0
7768 }
7869 $Tuple2([IntegerEntry(currentKey, newAmount), IntegerEntry(recKey, (recAmount + amount))], unit)
7970 }
8071 }
8172
8273
8374 @Verifier(tx)
8475 func verify () = {
8576 let smartPK = base58'Gud7Z17wiZEMZiHRbn48k2D9H13jmLEDZZ8b7NCfjRJL'
8677 let secondPK = base58'CwvKLDcXt3Wd2MEyEemVKawiD7gaCV68wh2GcnJRHFqB'
8778 let smart = sigVerify(tx.bodyBytes, tx.proofs[0], smartPK)
8879 let second = sigVerify(tx.bodyBytes, tx.proofs[0], secondPK)
8980 match tx {
9081 case t: SetScriptTransaction =>
9182 true
9283 case t: DataTransaction =>
9384 true
9485 case t: InvokeScriptTransaction =>
9586 true
9687 case t: TransferTransaction =>
9788 if (smart)
9889 then true
9990 else second
10091 case _ =>
10192 false
10293 }
10394 }
10495

github/deemru/w8io/169f3d6 
39.16 ms