tx · DDq4tiUU1CZLkcPDSBJ5XN4FyH56cbEF8wSUxJTKeLCy
3MwPF8FWd4fYohy6CXXB6wtjbRRvqFpxmdD: -0.01000000 Waves
2023.08.19 19:36 [2717733] smart account 3MwPF8FWd4fYohy6CXXB6wtjbRRvqFpxmdD > SELF 0.00000000 Waves
{
"type": 13,
"id": "DDq4tiUU1CZLkcPDSBJ5XN4FyH56cbEF8wSUxJTKeLCy",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1692463038722,
"version": 2,
"chainId": 84,
"sender": "3MwPF8FWd4fYohy6CXXB6wtjbRRvqFpxmdD",
"senderPublicKey": "G6PnkMn8MpXBkNwsQKMn1o1V7EKMgZyHCJRdFMQuouBC",
"proofs": [
"5p1GTjoeKyx5CfmBGrkqWhNcaV3iXzG7PCcqW4KEZvZZGJRizaj67f6MmidKW86TQcv19p8xs3DQ6qLYe4GA9EyP"
],
"script": "base64:BgIJCAISABIDCgEBCAAQY29udHJhY3RGaWxlTmFtZQICcDEAA1NFUAIBXwAIa2Fzc2V0SWQCB0Fzc2V0SUQACWtuZXdUb2tlbgIFVG9rZW4BCmtleUFzc2V0SUQACQC5CQIJAMwIAgICJXMJAMwIAgIHYXNzZXRJRAUDbmlsBQNTRVABBWtleVR4AAkAuQkCCQDMCAICAiVzCQDMCAICCnB1cmNoYXNlOiAFA25pbAUDU0VQAQd3cmFwRXJyAQNtc2cJALkJAgkAzAgCBRBjb250cmFjdEZpbGVOYW1lCQDMCAICAToJAMwIAgUDbXNnBQNuaWwCAAEIdGhyb3dFcnIBA21zZwkAAgEJAQd3cmFwRXJyAQUDbXNnAgFpAQ10b2tlbklzc3VhbmNlAAQEbmFtZQIIUFJBQ1RJQ0UEC2Rlc2NyaXB0aW9uAgoxOjEwIHdhdmVzBAhxdWFudGl0eQCAreIEBAhkZWNpbWFscwAABAtpc3N1ZV90b2tlbgkAwggFBQRuYW1lBQtkZXNjcmlwdGlvbgUIcXVhbnRpdHkFCGRlY2ltYWxzBgQHY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"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: GkQThJFaL3X8ZPZuAczM7q7yL2UGiTD4JSRsEXb9VMae
Next: 4qW4EZjVvZmwS2fuaprXHbBViP5zFwTP95baF4q3FAa2
Diff:
Old | New | | Differences |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = "p1" |
---|
5 | 5 | | |
---|
6 | | - | let b = Address(base58'3MwPF8FWd4fYohy6CXXB6wtjbRRvqFpxmdD') |
---|
| 6 | + | let b = "_" |
---|
7 | 7 | | |
---|
8 | | - | let c = base58'BQE3kUrRJ2nEzsXVeuB1KGBdyRhCHa3fRtSkyTsCJwa1' |
---|
| 8 | + | let c = "AssetID" |
---|
9 | 9 | | |
---|
10 | | - | let d = " " |
---|
| 10 | + | let d = "Token" |
---|
11 | 11 | | |
---|
12 | | - | let e = "AssetID" |
---|
13 | | - | |
---|
14 | | - | func f () = makeString(["%s", "Переданное сообщение: "], d) |
---|
| 12 | + | func e () = makeString(["%s", "assetID"], b) |
---|
15 | 13 | | |
---|
16 | 14 | | |
---|
17 | | - | func g () = makeString(["%s", "assetID"], d) |
---|
| 15 | + | func f () = makeString(["%s", "purchase: "], b) |
---|
18 | 16 | | |
---|
19 | 17 | | |
---|
20 | | - | func h (i) = makeString([a, ":", i], "") |
---|
| 18 | + | func g (h) = makeString([a, ":", h], "") |
---|
21 | 19 | | |
---|
22 | 20 | | |
---|
23 | | - | func j (i) = throw(h(i)) |
---|
| 21 | + | func i (h) = throw(g(h)) |
---|
24 | 22 | | |
---|
25 | 23 | | |
---|
26 | | - | @Callable(k) |
---|
27 | | - | func message (i) = { |
---|
28 | | - | let l = split(i, d) |
---|
29 | | - | let m = size(l) |
---|
30 | | - | let n = k.payments[0] |
---|
31 | | - | let o = k.payments[0].amount |
---|
32 | | - | if ((o != m)) |
---|
33 | | - | then j("Кол-во слов != кол-ву токенов") |
---|
34 | | - | else if ((c == k.payments[0].assetId)) |
---|
35 | | - | then j("Платеж должен быть в PRACTICE") |
---|
36 | | - | else [StringEntry(f(), i)] |
---|
| 24 | + | @Callable(j) |
---|
| 25 | + | func tokenIssuance () = { |
---|
| 26 | + | let k = "PRACTICE" |
---|
| 27 | + | let l = "1:10 waves" |
---|
| 28 | + | let m = 10000000 |
---|
| 29 | + | let n = 0 |
---|
| 30 | + | let o = Issue(k, l, m, n, true) |
---|
| 31 | + | let p = calculateAssetId(o) |
---|
| 32 | + | [o, BinaryEntry(c, p), StringEntry(d, o.name)] |
---|
37 | 33 | | } |
---|
38 | 34 | | |
---|
39 | 35 | | |
---|
40 | | - | @Verifier(p) |
---|
41 | | - | func q () = sigVerify(p.bodyBytes, p.proofs[0], p.senderPublicKey) |
---|
| 36 | + | |
---|
| 37 | + | @Callable(j) |
---|
| 38 | + | func buyToken (m) = { |
---|
| 39 | + | let q = (j.payments[0].assetId == unit) |
---|
| 40 | + | let p = valueOrErrorMessage(getBinaryValue(this, c), "id токена не найден") |
---|
| 41 | + | let r = j.payments[0].amount |
---|
| 42 | + | let s = 10000000 |
---|
| 43 | + | let t = (s * m) |
---|
| 44 | + | let u = { |
---|
| 45 | + | let v = j.payments[0] |
---|
| 46 | + | if ($isInstanceOf(v, "AttachedPayment")) |
---|
| 47 | + | then { |
---|
| 48 | + | let w = v |
---|
| 49 | + | w |
---|
| 50 | + | } |
---|
| 51 | + | else throw("Send exactly 0.1 WAVES") |
---|
| 52 | + | } |
---|
| 53 | + | if ((q != true)) |
---|
| 54 | + | then i("Платеж должен быть в WAVES") |
---|
| 55 | + | else if ((r != t)) |
---|
| 56 | + | then i("Неправильная сумма платежа") |
---|
| 57 | + | else [ScriptTransfer(j.caller, m, p), IntegerEntry(f(), m)] |
---|
| 58 | + | } |
---|
| 59 | + | |
---|
42 | 60 | | |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 6 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = "p1" |
---|
5 | 5 | | |
---|
6 | | - | let b = Address(base58'3MwPF8FWd4fYohy6CXXB6wtjbRRvqFpxmdD') |
---|
| 6 | + | let b = "_" |
---|
7 | 7 | | |
---|
8 | | - | let c = base58'BQE3kUrRJ2nEzsXVeuB1KGBdyRhCHa3fRtSkyTsCJwa1' |
---|
| 8 | + | let c = "AssetID" |
---|
9 | 9 | | |
---|
10 | | - | let d = " " |
---|
| 10 | + | let d = "Token" |
---|
11 | 11 | | |
---|
12 | | - | let e = "AssetID" |
---|
13 | | - | |
---|
14 | | - | func f () = makeString(["%s", "Переданное сообщение: "], d) |
---|
| 12 | + | func e () = makeString(["%s", "assetID"], b) |
---|
15 | 13 | | |
---|
16 | 14 | | |
---|
17 | | - | func g () = makeString(["%s", "assetID"], d) |
---|
| 15 | + | func f () = makeString(["%s", "purchase: "], b) |
---|
18 | 16 | | |
---|
19 | 17 | | |
---|
20 | | - | func h (i) = makeString([a, ":", i], "") |
---|
| 18 | + | func g (h) = makeString([a, ":", h], "") |
---|
21 | 19 | | |
---|
22 | 20 | | |
---|
23 | | - | func j (i) = throw(h(i)) |
---|
| 21 | + | func i (h) = throw(g(h)) |
---|
24 | 22 | | |
---|
25 | 23 | | |
---|
26 | | - | @Callable(k) |
---|
27 | | - | func message (i) = { |
---|
28 | | - | let l = split(i, d) |
---|
29 | | - | let m = size(l) |
---|
30 | | - | let n = k.payments[0] |
---|
31 | | - | let o = k.payments[0].amount |
---|
32 | | - | if ((o != m)) |
---|
33 | | - | then j("Кол-во слов != кол-ву токенов") |
---|
34 | | - | else if ((c == k.payments[0].assetId)) |
---|
35 | | - | then j("Платеж должен быть в PRACTICE") |
---|
36 | | - | else [StringEntry(f(), i)] |
---|
| 24 | + | @Callable(j) |
---|
| 25 | + | func tokenIssuance () = { |
---|
| 26 | + | let k = "PRACTICE" |
---|
| 27 | + | let l = "1:10 waves" |
---|
| 28 | + | let m = 10000000 |
---|
| 29 | + | let n = 0 |
---|
| 30 | + | let o = Issue(k, l, m, n, true) |
---|
| 31 | + | let p = calculateAssetId(o) |
---|
| 32 | + | [o, BinaryEntry(c, p), StringEntry(d, o.name)] |
---|
37 | 33 | | } |
---|
38 | 34 | | |
---|
39 | 35 | | |
---|
40 | | - | @Verifier(p) |
---|
41 | | - | func q () = sigVerify(p.bodyBytes, p.proofs[0], p.senderPublicKey) |
---|
| 36 | + | |
---|
| 37 | + | @Callable(j) |
---|
| 38 | + | func buyToken (m) = { |
---|
| 39 | + | let q = (j.payments[0].assetId == unit) |
---|
| 40 | + | let p = valueOrErrorMessage(getBinaryValue(this, c), "id токена не найден") |
---|
| 41 | + | let r = j.payments[0].amount |
---|
| 42 | + | let s = 10000000 |
---|
| 43 | + | let t = (s * m) |
---|
| 44 | + | let u = { |
---|
| 45 | + | let v = j.payments[0] |
---|
| 46 | + | if ($isInstanceOf(v, "AttachedPayment")) |
---|
| 47 | + | then { |
---|
| 48 | + | let w = v |
---|
| 49 | + | w |
---|
| 50 | + | } |
---|
| 51 | + | else throw("Send exactly 0.1 WAVES") |
---|
| 52 | + | } |
---|
| 53 | + | if ((q != true)) |
---|
| 54 | + | then i("Платеж должен быть в WAVES") |
---|
| 55 | + | else if ((r != t)) |
---|
| 56 | + | then i("Неправильная сумма платежа") |
---|
| 57 | + | else [ScriptTransfer(j.caller, m, p), IntegerEntry(f(), m)] |
---|
| 58 | + | } |
---|
| 59 | + | |
---|
42 | 60 | | |
---|