tx · 7sDT8wewW3KN6UhG9F1MCbDeTdYgHs8W35tS1mtqKBjK
3MpwA3zztn9AiVLgzxtYyj21AAbvtWeBodX: -0.01000000 Waves
2022.05.11 22:51 [2047447] smart account 3MpwA3zztn9AiVLgzxtYyj21AAbvtWeBodX > SELF 0.00000000 Waves
{
"type": 13,
"id": "7sDT8wewW3KN6UhG9F1MCbDeTdYgHs8W35tS1mtqKBjK",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1652298684534,
"version": 2,
"chainId": 84,
"sender": "3MpwA3zztn9AiVLgzxtYyj21AAbvtWeBodX",
"senderPublicKey": "DiHcx3LJuz15WXcQqQE1gEhBzw6k7HqgBE7m1qn3APFw",
"proofs": [
"2M7KwTFhELcJszGWipsXZGEGvk3Kcb95C5aPkgSLMEZYnPvS8pWFEaLnH39ZzGnDvfoPzKqAk3zmERTECvYRAhJ7"
],
"script": "base64:AAIFAAAAAAAAAAQIAhIAAAAAAQAAAAALUkVXQVJEQVNTRVQBAAAAIK2dSBaFkXln78NKeoaZ0d1Q6QVJPOT+QERHjOGDxML0AAAAAQAAAAFpAQAAAARjYWxsAAAAAAkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIAAAAAAAX14QAFAAAAC1JFV0FSREFTU0VUBQAAAANuaWwAAAAA/9FSzQ==",
"height": 2047447,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 8o3juiN1Dev2zdt11ushde6rfK96F6bXZiyfxcsaBpnq
Next: none
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let PAYMENT_ASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh' |
---|
5 | | - | |
---|
6 | | - | func isPaymentOk (i) = { |
---|
7 | | - | let acceptableAssetId = PAYMENT_ASSET |
---|
8 | | - | if ((size(i.payments) == 0)) |
---|
9 | | - | then throw("Payment not attached") |
---|
10 | | - | else { |
---|
11 | | - | let p = i.payments[0] |
---|
12 | | - | match p.assetId { |
---|
13 | | - | case assetId: ByteVector => |
---|
14 | | - | if ((assetId == acceptableAssetId)) |
---|
15 | | - | then (p.amount == 1000000) |
---|
16 | | - | else false |
---|
17 | | - | case _ => |
---|
18 | | - | throw("Wrong payment asset") |
---|
19 | | - | } |
---|
20 | | - | } |
---|
21 | | - | } |
---|
22 | | - | |
---|
| 4 | + | let REWARDASSET = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh' |
---|
23 | 5 | | |
---|
24 | 6 | | @Callable(i) |
---|
25 | | - | func flip (choice) = if (isPaymentOk(i)) |
---|
26 | | - | then { |
---|
27 | | - | let x = valueOrElse(choice, 0) |
---|
28 | | - | if (if ((x == 1)) |
---|
29 | | - | then true |
---|
30 | | - | else (x == 0)) |
---|
31 | | - | then { |
---|
32 | | - | let wallet = (((toBase58String(i.caller.bytes) + "_") + toString(choice)) + "_c") |
---|
33 | | - | throw(wallet) |
---|
34 | | - | } |
---|
35 | | - | else throw("wrong choice ser!!") |
---|
36 | | - | } |
---|
37 | | - | else throw("wrong payment asset ser!!") |
---|
| 7 | + | func call () = [ScriptTransfer(i.caller, 100000000, REWARDASSET)] |
---|
38 | 8 | | |
---|
39 | 9 | | |
---|