tx · 6dqSR13AkJcTe5n48uyEH118aPSDkV82espR2dK82kZs

3N3irEKCdj77h97aEbfj3fa3uMXCNCXVhKt:  -0.05000000 Waves

2023.03.22 11:38 [2501001] smart account 3N3irEKCdj77h97aEbfj3fa3uMXCNCXVhKt > SELF 0.00000000 Waves

{ "type": 13, "id": "6dqSR13AkJcTe5n48uyEH118aPSDkV82espR2dK82kZs", "fee": 5000000, "feeAssetId": null, "timestamp": 1679474365321, "version": 2, "chainId": 84, "sender": "3N3irEKCdj77h97aEbfj3fa3uMXCNCXVhKt", "senderPublicKey": "FACNGaFYnR8yFbQFg9sRBpzGVCyzMyLeVw3JMhGQT1wn", "proofs": [ "2dYhyDD9cQS1yRQAQWMHiewmUG4MSgvpYXAy8SkV8N4nDewrR1vkCFckMxv7yuojrU6fmyfUkmEshve46hvWTyMT" ], "script": "base64:BgIGCAISABIABAATcGVwZUNvbnRyYWN0QWRkcmVzcwIjM040a1haSEdrZTZ5UnEzWjU3cTdCVGdDclQyU0N2UUNZRVIADnNXYXZlc0lkU3RyaW5nAixGWGlGeGVkUDc2Q21nMXY0WEdORFlKcE5FOWdUR1BSRzF6amZrbVVzR2hGbQAMcGVwZUNvbnRyYWN0CQERQGV4dHJOYXRpdmUoMTA2MikBBRNwZXBlQ29udHJhY3RBZGRyZXNzAAZzV2F2ZXMJANkEAQUOc1dhdmVzSWRTdHJpbmcCAWkBB2dldFJhdGUABAdyZXN1bHRzCQD8BwQFDHBlcGVDb250cmFjdAIHZ2V0UmF0ZQUDbmlsBQNuaWwEByRtYXRjaDAFB3Jlc3VsdHMDCQABAgUHJG1hdGNoMAIGU3RyaW5nBAF0BQckbWF0Y2gwCQCUCgIFA25pbAUBdAkAAgECBUVycm9yAWkBB2RlcG9zaXQABAxzdGFydEJhbGFuY2UJAPAHAgUEdGhpcwUGc1dhdmVzBAdyZXN1bHRzCQD8BwQFDHBlcGVDb250cmFjdAIHZGVwb3NpdAUDbmlsCAUBaQhwYXltZW50cwMJAAACBQdyZXN1bHRzBQdyZXN1bHRzBAckbWF0Y2gwBQdyZXN1bHRzAwkAAQIFByRtYXRjaDACBFVuaXQEAWEFByRtYXRjaDAECm5ld0JhbGFuY2UJAPAHAgUEdGhpcwUGc1dhdmVzCQDMCAIJAQ5TY3JpcHRUcmFuc2ZlcgMIBQFpBmNhbGxlcgkAZQIFCm5ld0JhbGFuY2UFDHN0YXJ0QmFsYW5jZQUGc1dhdmVzBQNuaWwJAAIBAg1FcnJvciBkZXBvc2l0CQACAQIkU3RyaWN0IHZhbHVlIGlzIG5vdCBlcXVhbCB0byBpdHNlbGYuAEj3iE4=", "height": 2501001, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 2QeTbFHbUwzFeqeV46HMsMsjat1uTaFx8TYsukFR7Nbf Next: DmEvoNtfouYRyRk238qN5fQS7bFnas6Bprh9gb4DoamK Diff:
OldNewDifferences
33 {-# CONTENT_TYPE DAPP #-}
44 let pepeContractAddress = "3N4kXZHGke6yRq3Z57q7BTgCrT2SCvQCYER"
55
6+let sWavesIdString = "FXiFxedP76Cmg1v4XGNDYJpNE9gTGPRG1zjfkmUsGhFm"
7+
68 let pepeContract = addressFromStringValue(pepeContractAddress)
9+
10+let sWaves = fromBase58String(sWavesIdString)
711
812 @Callable(i)
913 func getRate () = {
2024
2125 @Callable(i)
2226 func deposit () = {
27+ let startBalance = assetBalance(this, sWaves)
2328 let results = invoke(pepeContract, "deposit", nil, i.payments)
24- match results {
25- case a: Unit =>
26- nil
27- case _ =>
28- throw("Error deposit")
29- }
29+ if ((results == results))
30+ then match results {
31+ case a: Unit =>
32+ let newBalance = assetBalance(this, sWaves)
33+[ScriptTransfer(i.caller, (newBalance - startBalance), sWaves)]
34+ case _ =>
35+ throw("Error deposit")
36+ }
37+ else throw("Strict value is not equal to itself.")
3038 }
3139
3240
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 6 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let pepeContractAddress = "3N4kXZHGke6yRq3Z57q7BTgCrT2SCvQCYER"
55
6+let sWavesIdString = "FXiFxedP76Cmg1v4XGNDYJpNE9gTGPRG1zjfkmUsGhFm"
7+
68 let pepeContract = addressFromStringValue(pepeContractAddress)
9+
10+let sWaves = fromBase58String(sWavesIdString)
711
812 @Callable(i)
913 func getRate () = {
1014 let results = invoke(pepeContract, "getRate", nil, nil)
1115 match results {
1216 case t: String =>
1317 $Tuple2(nil, t)
1418 case _ =>
1519 throw("Error")
1620 }
1721 }
1822
1923
2024
2125 @Callable(i)
2226 func deposit () = {
27+ let startBalance = assetBalance(this, sWaves)
2328 let results = invoke(pepeContract, "deposit", nil, i.payments)
24- match results {
25- case a: Unit =>
26- nil
27- case _ =>
28- throw("Error deposit")
29- }
29+ if ((results == results))
30+ then match results {
31+ case a: Unit =>
32+ let newBalance = assetBalance(this, sWaves)
33+[ScriptTransfer(i.caller, (newBalance - startBalance), sWaves)]
34+ case _ =>
35+ throw("Error deposit")
36+ }
37+ else throw("Strict value is not equal to itself.")
3038 }
3139
3240

github/deemru/w8io/026f985 
19.31 ms