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:
Old | New | | Differences |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let pepeContractAddress = "3N4kXZHGke6yRq3Z57q7BTgCrT2SCvQCYER" |
---|
5 | 5 | | |
---|
| 6 | + | let sWavesIdString = "FXiFxedP76Cmg1v4XGNDYJpNE9gTGPRG1zjfkmUsGhFm" |
---|
| 7 | + | |
---|
6 | 8 | | let pepeContract = addressFromStringValue(pepeContractAddress) |
---|
| 9 | + | |
---|
| 10 | + | let sWaves = fromBase58String(sWavesIdString) |
---|
7 | 11 | | |
---|
8 | 12 | | @Callable(i) |
---|
9 | 13 | | func getRate () = { |
---|
|
20 | 24 | | |
---|
21 | 25 | | @Callable(i) |
---|
22 | 26 | | func deposit () = { |
---|
| 27 | + | let startBalance = assetBalance(this, sWaves) |
---|
23 | 28 | | 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.") |
---|
30 | 38 | | } |
---|
31 | 39 | | |
---|
32 | 40 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 6 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let pepeContractAddress = "3N4kXZHGke6yRq3Z57q7BTgCrT2SCvQCYER" |
---|
5 | 5 | | |
---|
| 6 | + | let sWavesIdString = "FXiFxedP76Cmg1v4XGNDYJpNE9gTGPRG1zjfkmUsGhFm" |
---|
| 7 | + | |
---|
6 | 8 | | let pepeContract = addressFromStringValue(pepeContractAddress) |
---|
| 9 | + | |
---|
| 10 | + | let sWaves = fromBase58String(sWavesIdString) |
---|
7 | 11 | | |
---|
8 | 12 | | @Callable(i) |
---|
9 | 13 | | func getRate () = { |
---|
10 | 14 | | let results = invoke(pepeContract, "getRate", nil, nil) |
---|
11 | 15 | | match results { |
---|
12 | 16 | | case t: String => |
---|
13 | 17 | | $Tuple2(nil, t) |
---|
14 | 18 | | case _ => |
---|
15 | 19 | | throw("Error") |
---|
16 | 20 | | } |
---|
17 | 21 | | } |
---|
18 | 22 | | |
---|
19 | 23 | | |
---|
20 | 24 | | |
---|
21 | 25 | | @Callable(i) |
---|
22 | 26 | | func deposit () = { |
---|
| 27 | + | let startBalance = assetBalance(this, sWaves) |
---|
23 | 28 | | 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.") |
---|
30 | 38 | | } |
---|
31 | 39 | | |
---|
32 | 40 | | |
---|