tx · 8aTGCBmPmzECJBBbTE2yWwLtWy1c37UyGKnsiS5vu9nd
3N356YfN19XTJNfZ1sE9kssQwTxvyMLq7MT: -0.01000000 Waves
2022.05.31 14:09 [2075760] smart account 3N356YfN19XTJNfZ1sE9kssQwTxvyMLq7MT > SELF 0.00000000 Waves
{
"type": 13,
"id": "8aTGCBmPmzECJBBbTE2yWwLtWy1c37UyGKnsiS5vu9nd",
"fee": 1000000,
"feeAssetId": null,
"timestamp": 1653995402444,
"version": 2,
"chainId": 84,
"sender": "3N356YfN19XTJNfZ1sE9kssQwTxvyMLq7MT",
"senderPublicKey": "5FCKdCQ3s4naiaoX3iSwKqTAHzcVkGi6M48BnWuHjJ5u",
"proofs": [
"SL6wGQ1pTLsB2Zuhf1qqQjDSC1SqHtgUFh9yKgFdq4pLMS8iv7XMtQSJAX1429XTuoL5o68NrDyM96J9pyn9HXm"
],
"script": "base64:AAIFAAAAAAAAAAcIAhIDCgEBAAAAAgAAAAANUEFZTUVOVF9BU1NFVAEAAAAgrZ1IFoWReWfvw0p6hpnR3VDpBUk85P5AREeM4YPEwvQBAAAAC2lzUGF5bWVudE9rAAAAAQAAAAFpBAAAABFhY2NlcHRhYmxlQXNzZXRJZAUAAAANUEFZTUVOVF9BU1NFVAMJAAAAAAAAAgkAAZAAAAABCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAkAAAIAAAABAgAAABRQYXltZW50IG5vdCBhdHRhY2hlZAQAAAABcAkAAZEAAAACCAUAAAABaQAAAAhwYXltZW50cwAAAAAAAAAAAAQAAAAIcHJpY2VLZXkCAAAACmxhc3RfcHJpY2UEAAAACmludGVnZXJWYWwJAQAAAAt2YWx1ZU9yRWxzZQAAAAIJAQAAABFAZXh0ck5hdGl2ZSgxMDUwKQAAAAIFAAAABHRoaXMFAAAACHByaWNlS2V5AAAAAAAC+vCABAAAAAckbWF0Y2gwCAUAAAABcAAAAAdhc3NldElkAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAApCeX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Z2VyVmFsAAAAAAAAmJaABAAAAANpZGEJAAQ4AAAAAQUAAAAGaXNzdWVyCQAETAAAAAIFAAAABmlzc3VlcgkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAAaQAAAABBQAAAAJpZAIAAAABXwUAAAAMd2FsbGV0U3RyaW5nCQACWAAAAAEFAAAAA2lkYQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCAUAAAABaQAAAAZjYWxsZXIAAAAAAAAAAAEFAAAAA2lkYQkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgUAAAAIcHJpY2VLZXkFAAAACG5ld1ByaWNlBQAAAANuaWwJAAACAAAAAQIAAAAeYWxyZWFkeSBtaW50ZWQgYnkgc29tZW9uZSBlbHNlCQAAAgAAAAECAAAAHldyb25nIHBheW1lbnQgYW1vdW50IG9yIGFzc2V0LgkAAAIAAAABAgAAAAxvdXQgb2YgcmFuZ2UAAAAAmMkacA==",
"height": 2075760,
"applicationStatus": "succeeded",
"spentComplexity": 0
}
View: original | compacted
Prev: 4sAGBHEq69F3Rh4hh2EoaHJ5tuN7pUDGLVF8noauAmLV
Next: 5KtjavABwZBTHtYHrYzWyezVasZgtHzkNY2hNB5S2Jft
Diff:
Old | New | | Differences |
---|
10 | 10 | | else { |
---|
11 | 11 | | let e = c.payments[0] |
---|
12 | 12 | | let f = "last_price" |
---|
13 | | - | let g = 50000000 |
---|
| 13 | + | let g = valueOrElse(getIntegerValue(this, f), 50000000) |
---|
14 | 14 | | let h = e.assetId |
---|
15 | 15 | | if ($isInstanceOf(h, "ByteVector")) |
---|
16 | 16 | | then { |
---|
|
43 | 43 | | let p = Issue(o, ("POKEMON_NFT_" + toString(j)), 1, 0, false) |
---|
44 | 44 | | let q = (g + 10000000) |
---|
45 | 45 | | let r = calculateAssetId(p) |
---|
46 | | - | valueOrErrorMessage([p, StringEntry(((toString(j) + "_") + k), toBase58String(r)), ScriptTransfer(c.caller, 1, r), IntegerEntry(f, q)], "an error occured") |
---|
| 46 | + | [p, StringEntry(((toString(j) + "_") + k), toBase58String(r)), ScriptTransfer(c.caller, 1, r), IntegerEntry(f, q)] |
---|
47 | 47 | | } |
---|
48 | 48 | | else throw("already minted by someone else") |
---|
49 | 49 | | } |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 5 #-} |
---|
2 | 2 | | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | 3 | | {-# CONTENT_TYPE DAPP #-} |
---|
4 | 4 | | let a = base58'CgidgEMbCKXXErgJXVyZCFRaK8SBNA73Jg8mNXALtVKh' |
---|
5 | 5 | | |
---|
6 | 6 | | func b (c) = { |
---|
7 | 7 | | let d = a |
---|
8 | 8 | | if ((size(c.payments) == 0)) |
---|
9 | 9 | | then throw("Payment not attached") |
---|
10 | 10 | | else { |
---|
11 | 11 | | let e = c.payments[0] |
---|
12 | 12 | | let f = "last_price" |
---|
13 | | - | let g = 50000000 |
---|
| 13 | + | let g = valueOrElse(getIntegerValue(this, f), 50000000) |
---|
14 | 14 | | let h = e.assetId |
---|
15 | 15 | | if ($isInstanceOf(h, "ByteVector")) |
---|
16 | 16 | | then { |
---|
17 | 17 | | let i = h |
---|
18 | 18 | | if ((i == a)) |
---|
19 | 19 | | then (e.amount == g) |
---|
20 | 20 | | else false |
---|
21 | 21 | | } |
---|
22 | 22 | | else throw("Wrong payment asset or min amount 50 USDN") |
---|
23 | 23 | | } |
---|
24 | 24 | | } |
---|
25 | 25 | | |
---|
26 | 26 | | |
---|
27 | 27 | | @Callable(c) |
---|
28 | 28 | | func mintPokemon (j) = { |
---|
29 | 29 | | let k = toBase58String(c.caller.bytes) |
---|
30 | 30 | | let f = "last_price" |
---|
31 | 31 | | let g = valueOrElse(getIntegerValue(this, f), 0) |
---|
32 | 32 | | if (if ((j > 0)) |
---|
33 | 33 | | then true |
---|
34 | 34 | | else (151 >= j)) |
---|
35 | 35 | | then if (b(c)) |
---|
36 | 36 | | then { |
---|
37 | 37 | | let l = toString(j) |
---|
38 | 38 | | let m = valueOrElse(getString(this, l), "none") |
---|
39 | 39 | | let n = ((toString(j) + "_w_") + k) |
---|
40 | 40 | | let o = ("POKEMON_NFT" + toString(j)) |
---|
41 | 41 | | if ((m == "none")) |
---|
42 | 42 | | then { |
---|
43 | 43 | | let p = Issue(o, ("POKEMON_NFT_" + toString(j)), 1, 0, false) |
---|
44 | 44 | | let q = (g + 10000000) |
---|
45 | 45 | | let r = calculateAssetId(p) |
---|
46 | | - | valueOrErrorMessage([p, StringEntry(((toString(j) + "_") + k), toBase58String(r)), ScriptTransfer(c.caller, 1, r), IntegerEntry(f, q)], "an error occured") |
---|
| 46 | + | [p, StringEntry(((toString(j) + "_") + k), toBase58String(r)), ScriptTransfer(c.caller, 1, r), IntegerEntry(f, q)] |
---|
47 | 47 | | } |
---|
48 | 48 | | else throw("already minted by someone else") |
---|
49 | 49 | | } |
---|
50 | 50 | | else throw("Wrong payment amount or asset.") |
---|
51 | 51 | | else throw("out of range") |
---|
52 | 52 | | } |
---|
53 | 53 | | |
---|
54 | 54 | | |
---|