tx · 6py2KX9oKWHjv8AHGXqfSjG1nEcZTzrUDV2LBfz2FCQf

3N7KPSUwpMgvDEVGw1DYBnKDiixSQUXhn2P:  -0.01000000 Waves

2023.05.31 08:18 [2601717] smart account 3N7KPSUwpMgvDEVGw1DYBnKDiixSQUXhn2P > SELF 0.00000000 Waves

{ "type": 13, "id": "6py2KX9oKWHjv8AHGXqfSjG1nEcZTzrUDV2LBfz2FCQf", "fee": 1000000, "feeAssetId": null, "timestamp": 1685510362311, "version": 2, "chainId": 84, "sender": "3N7KPSUwpMgvDEVGw1DYBnKDiixSQUXhn2P", "senderPublicKey": "BTvXQMmkgSf57dbcqWxpEvbi3ZYcEeWFkkXDZC6FrneM", "proofs": [ "3pGc8RLXk6NjqgRRKAogecme4HY4J3o3znARq1dKrG3MTCCccYbFTvQX6KdNRvTbLd7YJZupVJVKGJ2g4CHWP5us" ], "script": "base64:BgILCAISABIAEgMKAQEBAAxvd25lckFkZHJlc3MCIzNNdmpBYURZSHBTNEE1SzRDVjNrWk1NRUg5bTlKZEJTdmJxAwFpAQRjYWxsAAQFYXNzZXQJAMMIBwIFQXNzZXQCAAABAAAGBQR1bml0AAAEB2Fzc2V0SWQJALgIAQUFYXNzZXQJAMwIAgkBC0JpbmFyeUVudHJ5AgIDYmluAQAJAMwIAgkBDEJvb2xlYW5FbnRyeQICBGJvb2wGCQDMCAIJAQxJbnRlZ2VyRW50cnkCAgNpbnQAAQkAzAgCCQELU3RyaW5nRW50cnkCAgNzdHICAAkAzAgCCQELRGVsZXRlRW50cnkBAgNzdHIJAMwIAgUFYXNzZXQJAMwIAgkBB1JlaXNzdWUDBQdhc3NldElkAAEHCQDMCAIJAQRCdXJuAgUHYXNzZXRJZAABCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgABBQdhc3NldElkBQNuaWwBaQEHZGVwb3NpdAAECmN1cnJlbnRLZXkJANgEAQgIBQFpBmNhbGxlcgVieXRlcwQNZGVwb3NpdEFtb3V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CQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIFEGFtb3VudFRvV2l0aERyYXcFBHVuaXQFA25pbAC4L3t2", "height": 2601717, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 6iKwBM18VxhwvsPGHhtiahvXFSFeFqNmgfzvT75eTCyG Next: 67zAgh5xzku45yJZx2ry9vECoZ6QKEHfdwcWu4popPS Diff:
OldNewDifferences
1515 @Callable(i)
1616 func deposit () = {
1717 let currentKey = toBase58String(i.caller.bytes)
18- let depositAmount = (i.payments[0].amount - 5000000)
19- let platformfee = 5000000
20- let totalPlatformFee = getIntegerValue(this, ("platform_bal" + ownerAddress))
18+ let depositAmount = (i.payments[0].amount - 50000000)
19+ let platformfee = 50000000
20+ let totalPlatformFee = match getInteger(this, ("platform_bal_" + ownerAddress)) {
21+ case a: Int =>
22+ a
23+ case _ =>
24+ 0
25+ }
2126 let platformFeeInc = (totalPlatformFee + platformfee)
2227 [IntegerEntry(("balance_" + currentKey), depositAmount), IntegerEntry(("platform_bal_" + ownerAddress), platformFeeInc)]
2328 }
2833 func withDraw (amountToWithDraw) = {
2934 let Caller = toBase58String(i.caller.bytes)
3035 let currentKey = toBase58String(i.caller.bytes)
31- let currentAmount = match getInteger(this, ("platform_bal_" + Caller)) {
36+ let currentPlatformAmount = match getInteger(this, ("platform_bal_" + Caller)) {
3237 case a: Int =>
3338 a
3439 case _ =>
3540 0
3641 }
37- let newAmount = (currentAmount - amountToWithDraw)
42+ let newAmount = (currentPlatformAmount - amountToWithDraw)
3843 if ((Caller != ownerAddress))
3944 then throw("Not Authorized")
40- else if ((currentAmount == 0))
45+ else if ((currentPlatformAmount == 0))
4146 then throw("No sufficent amount available")
42- else [IntegerEntry(("platform_bal" + ownerAddress), newAmount), ScriptTransfer(i.caller, amountToWithDraw, unit)]
47+ else [IntegerEntry(("platform_bal_" + ownerAddress), newAmount), ScriptTransfer(i.caller, amountToWithDraw, unit)]
4348 }
4449
4550
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let ownerAddress = "3MvjAaDYHpS4A5K4CV3kZMMEH9m9JdBSvbq"
55
66 @Callable(i)
77 func call () = {
88 let asset = Issue("Asset", "", 1, 0, true, unit, 0)
99 let assetId = calculateAssetId(asset)
1010 [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)]
1111 }
1212
1313
1414
1515 @Callable(i)
1616 func deposit () = {
1717 let currentKey = toBase58String(i.caller.bytes)
18- let depositAmount = (i.payments[0].amount - 5000000)
19- let platformfee = 5000000
20- let totalPlatformFee = getIntegerValue(this, ("platform_bal" + ownerAddress))
18+ let depositAmount = (i.payments[0].amount - 50000000)
19+ let platformfee = 50000000
20+ let totalPlatformFee = match getInteger(this, ("platform_bal_" + ownerAddress)) {
21+ case a: Int =>
22+ a
23+ case _ =>
24+ 0
25+ }
2126 let platformFeeInc = (totalPlatformFee + platformfee)
2227 [IntegerEntry(("balance_" + currentKey), depositAmount), IntegerEntry(("platform_bal_" + ownerAddress), platformFeeInc)]
2328 }
2429
2530
2631
2732 @Callable(i)
2833 func withDraw (amountToWithDraw) = {
2934 let Caller = toBase58String(i.caller.bytes)
3035 let currentKey = toBase58String(i.caller.bytes)
31- let currentAmount = match getInteger(this, ("platform_bal_" + Caller)) {
36+ let currentPlatformAmount = match getInteger(this, ("platform_bal_" + Caller)) {
3237 case a: Int =>
3338 a
3439 case _ =>
3540 0
3641 }
37- let newAmount = (currentAmount - amountToWithDraw)
42+ let newAmount = (currentPlatformAmount - amountToWithDraw)
3843 if ((Caller != ownerAddress))
3944 then throw("Not Authorized")
40- else if ((currentAmount == 0))
45+ else if ((currentPlatformAmount == 0))
4146 then throw("No sufficent amount available")
42- else [IntegerEntry(("platform_bal" + ownerAddress), newAmount), ScriptTransfer(i.caller, amountToWithDraw, unit)]
47+ else [IntegerEntry(("platform_bal_" + ownerAddress), newAmount), ScriptTransfer(i.caller, amountToWithDraw, unit)]
4348 }
4449
4550

github/deemru/w8io/026f985 
42.39 ms