tx · D1Zxi7LVxf9iCyNDmz6ur6unYyY37eyBjF8cjNGaPrYE

3N3irEKCdj77h97aEbfj3fa3uMXCNCXVhKt:  -0.05000000 Waves

2023.03.22 11:46 [2501008] smart account 3N3irEKCdj77h97aEbfj3fa3uMXCNCXVhKt > SELF 0.00000000 Waves

{ "type": 13, "id": "D1Zxi7LVxf9iCyNDmz6ur6unYyY37eyBjF8cjNGaPrYE", "fee": 5000000, "feeAssetId": null, "timestamp": 1679474815680, "version": 2, "chainId": 84, "sender": "3N3irEKCdj77h97aEbfj3fa3uMXCNCXVhKt", "senderPublicKey": "FACNGaFYnR8yFbQFg9sRBpzGVCyzMyLeVw3JMhGQT1wn", "proofs": [ "3saAq9eBNGAPPMDjhLaQBonH9tHhuTKNjZCZQM8LH1VXiHkkzc2yamyTQfrrBSs2CnuRWpJuFsUWDbGgzsRa9Ydz" ], "script": "base64:BgIICAISABIAEgAEABNwZXBlQ29udHJhY3RBZGRyZXNzAiMzTjRrWFpIR2tlNnlScTNaNTdxN0JUZ0NyVDJTQ3ZRQ1lFUgAOc1dhdmVzSWRTdHJpbmcCLEZYaUZ4ZWRQNzZDbWcxdjRYR05EWUpwTkU5Z1RHUFJHMXpqZmttVXNHaEZtAAxwZXBlQ29udHJhY3QJARFAZXh0ck5hdGl2ZSgxMDYyKQEFE3BlcGVDb250cmFjdEFkZHJlc3MABnNXYXZlcwkA2QQBBQ5zV2F2ZXNJZFN0cmluZwMBaQEHZ2V0UmF0ZQAEB3Jlc3VsdHMJAPwHBAUMcGVwZUNvbnRyYWN0AgdnZXRSYXRlBQNuaWwFA25pbAQHJG1hdGNoMAUHcmVzdWx0cwMJAAECBQckbWF0Y2gwAgZTdHJpbmcEAXQFByRtYXRjaDAJAJQKAgUDbmlsBQF0CQACAQIFRXJyb3IBaQEHZGVwb3NpdAAEDHN0YXJ0QmFsYW5jZQkA8AcCBQR0aGlzBQZzV2F2ZXMDCQAAAgUMc3RhcnRCYWxhbmNlBQxzdGFydEJhbGFuY2UEB3Jlc3VsdHMJAPwHBAUMcGVwZUNvbnRyYWN0AgdkZXBvc2l0BQNuaWwIBQFpCHBheW1lbnRzBAckbWF0Y2gwBQdyZXN1bHRzAwkAAQIFByRtYXRjaDACBFVuaXQEAWEFByRtYXRjaDAECm5ld0JhbGFuY2UJAPAHAgUEdGhpcwUGc1dhdmVzBApzZW5kQW1vdW50CQBlAgUKbmV3QmFsYW5jZQUMc3RhcnRCYWxhbmNlCQCUCgIJAMwIAgkBDlNjcmlwdFRyYW5zZmVyAwgFAWkGY2FsbGVyBQpzZW5kQW1vdW50BQZzV2F2ZXMFA25pbAUKc2VuZEFtb3VudAkAAgECDUVycm9yIGRlcG9zaXQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4BaQEId2l0aGRyYXcABAxzdGFydEJhbGFuY2UICQDvBwEFBHRoaXMJYXZhaWxhYmxlAwkAAAIFDHN0YXJ0QmFsYW5jZQUMc3RhcnRCYWxhbmNlBAdyZXN1bHRzCQD8BwQFDHBlcGVDb250cmFjdAIId2l0aGRyYXcFA25pbAgFAWkIcGF5bWVudHMEByRtYXRjaDAFB3Jlc3VsdHMDCQABAgUHJG1hdGNoMAIEVW5pdAQBYQUHJG1hdGNoMAQKbmV3QmFsYW5jZQgJAO8HAQUEdGhpcwlhdmFpbGFibGUECnNlbmRBbW91bnQJAGUCBQpuZXdCYWxhbmNlBQxzdGFydEJhbGFuY2UJAJQKAgkAzAgCCQEOU2NyaXB0VHJhbnNmZXIDCAUBaQZjYWxsZXIFCnNlbmRBbW91bnQFBHVuaXQFA25pbAUKc2VuZEFtb3VudAkAAgECDUVycm9yIGRlcG9zaXQJAAIBAiRTdHJpY3QgdmFsdWUgaXMgbm90IGVxdWFsIHRvIGl0c2VsZi4Ar+pbEg==", "height": 2501008, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: DmEvoNtfouYRyRk238qN5fQS7bFnas6Bprh9gb4DoamK Next: A72JFBJbCxLVJH6RJ3a43y4f3RPF4R2N2BKGBzr1fYF1 Diff:
OldNewDifferences
3131 match results {
3232 case a: Unit =>
3333 let newBalance = assetBalance(this, sWaves)
34-[ScriptTransfer(i.caller, (newBalance - startBalance), sWaves)]
34+ let sendAmount = (newBalance - startBalance)
35+ $Tuple2([ScriptTransfer(i.caller, sendAmount, sWaves)], sendAmount)
36+ case _ =>
37+ throw("Error deposit")
38+ }
39+ }
40+ else throw("Strict value is not equal to itself.")
41+ }
42+
43+
44+
45+@Callable(i)
46+func withdraw () = {
47+ let startBalance = wavesBalance(this).available
48+ if ((startBalance == startBalance))
49+ then {
50+ let results = invoke(pepeContract, "withdraw", nil, i.payments)
51+ match results {
52+ case a: Unit =>
53+ let newBalance = wavesBalance(this).available
54+ let sendAmount = (newBalance - startBalance)
55+ $Tuple2([ScriptTransfer(i.caller, sendAmount, unit)], sendAmount)
3556 case _ =>
3657 throw("Error deposit")
3758 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let pepeContractAddress = "3N4kXZHGke6yRq3Z57q7BTgCrT2SCvQCYER"
55
66 let sWavesIdString = "FXiFxedP76Cmg1v4XGNDYJpNE9gTGPRG1zjfkmUsGhFm"
77
88 let pepeContract = addressFromStringValue(pepeContractAddress)
99
1010 let sWaves = fromBase58String(sWavesIdString)
1111
1212 @Callable(i)
1313 func getRate () = {
1414 let results = invoke(pepeContract, "getRate", nil, nil)
1515 match results {
1616 case t: String =>
1717 $Tuple2(nil, t)
1818 case _ =>
1919 throw("Error")
2020 }
2121 }
2222
2323
2424
2525 @Callable(i)
2626 func deposit () = {
2727 let startBalance = assetBalance(this, sWaves)
2828 if ((startBalance == startBalance))
2929 then {
3030 let results = invoke(pepeContract, "deposit", nil, i.payments)
3131 match results {
3232 case a: Unit =>
3333 let newBalance = assetBalance(this, sWaves)
34-[ScriptTransfer(i.caller, (newBalance - startBalance), sWaves)]
34+ let sendAmount = (newBalance - startBalance)
35+ $Tuple2([ScriptTransfer(i.caller, sendAmount, sWaves)], sendAmount)
36+ case _ =>
37+ throw("Error deposit")
38+ }
39+ }
40+ else throw("Strict value is not equal to itself.")
41+ }
42+
43+
44+
45+@Callable(i)
46+func withdraw () = {
47+ let startBalance = wavesBalance(this).available
48+ if ((startBalance == startBalance))
49+ then {
50+ let results = invoke(pepeContract, "withdraw", nil, i.payments)
51+ match results {
52+ case a: Unit =>
53+ let newBalance = wavesBalance(this).available
54+ let sendAmount = (newBalance - startBalance)
55+ $Tuple2([ScriptTransfer(i.caller, sendAmount, unit)], sendAmount)
3556 case _ =>
3657 throw("Error deposit")
3758 }
3859 }
3960 else throw("Strict value is not equal to itself.")
4061 }
4162
4263

github/deemru/w8io/169f3d6 
28.73 ms