tx · GcDaTGbMvei6JTDd8FiXTGVrZhqnYCWEFNVAst3d2dgB 3Muq67LZmpEmGX6kUpYpsnzH1niHS53eLRU: -0.05000000 Waves 2023.10.06 14:54 [2786726] smart account 3Muq67LZmpEmGX6kUpYpsnzH1niHS53eLRU > SELF 0.00000000 Waves
{ "type": 13, "id": "GcDaTGbMvei6JTDd8FiXTGVrZhqnYCWEFNVAst3d2dgB", "fee": 5000000, "feeAssetId": null, "timestamp": 1696593260104, "version": 1, "sender": "3Muq67LZmpEmGX6kUpYpsnzH1niHS53eLRU", "senderPublicKey": "9SUeqFoAG25U3HuKPEepdy9d1zcAtTiW5iGWak8N2BMF", "proofs": [ "dN5RRJoqVjmQFktBi4YMeRyztUTGrZA2Z8XF9RMGtcDfFvCYHY4tz5veRY1FfnTmBWuVr3iNnCRhQF1GLxHBWUZ" ], "script": "base64:BgINCAISAwoBARIECgIIARABEHdyaXRlQ29uc3RTdHJpbmcCA2tleQV2YWx1ZQMJAQEhAQkBCWlzRGVmaW5lZAEJAJ0IAgUEdGhpcwUDa2V5CQELU3RyaW5nRW50cnkCBQNrZXkFBXZhbHVlCQACAQkArAICAhVhbHJlYWR5IGluaXRpYWxpemVkOiAFA2tleQEId3JpdGVJbnQCA2tleQV2YWx1ZQMJAGYCAAAFBXZhbHVlCQACAQkArAICCQCsAgIJAKwCAgIXd3JpdGluZyBuZWdhdGl2ZSB2YWx1ZSAJAKQDAQUFdmFsdWUCCSBmb3Iga2V5IAUDa2V5CQEMSW50ZWdlckVudHJ5AgUDa2V5BQV2YWx1ZQENd3JpdGVDb25zdEludAIDa2V5BXZhbHVlAwkBASEBCQEJaXNEZWZpbmVkAQkAmggCBQR0aGlzBQNrZXkJAQh3cml0ZUludAIFA2tleQUFdmFsdWUJAAIBCQCsAgICEGFscmVhZHkgZXhpc3RzOiAFA2tleQEIY2hhbmdlQnkCA2tleQV2YWx1ZQkBCHdyaXRlSW50AgUDa2V5CQBkAgkBC3ZhbHVlT3JFbHNlAgkA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IK6kA4=", "chainId": 84, "height": 2786726, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 6 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | func a (b,c) = if (!(isDefined(getString(this, b)))) | |
5 | + | then StringEntry(b, c) | |
6 | + | else throw(("already initialized: " + b)) | |
7 | + | ||
8 | + | ||
9 | + | func d (b,c) = if ((0 > c)) | |
10 | + | then throw(((("writing negative value " + toString(c)) + " for key ") + b)) | |
11 | + | else IntegerEntry(b, c) | |
12 | + | ||
13 | + | ||
14 | + | func e (b,c) = if (!(isDefined(getInteger(this, b)))) | |
15 | + | then d(b, c) | |
16 | + | else throw(("already exists: " + b)) | |
17 | + | ||
18 | + | ||
19 | + | func f (b,c) = d(b, (valueOrElse(getInteger(this, b), 0) + c)) | |
20 | + | ||
21 | + | ||
22 | + | let g = "config" | |
23 | + | ||
24 | + | let h = valueOrErrorMessage(addressFromString(valueOrErrorMessage(getString(this, g), "minter: config address not found")), "invalid config address") | |
25 | + | ||
26 | + | func i (j) = invoke(h, "opAllowed", [j], nil) | |
27 | + | ||
28 | + | ||
29 | + | let k = "powerAssetId" | |
30 | + | ||
31 | + | let l = fromBase58String(getStringValue(this, k)) | |
32 | + | ||
33 | + | let m = split(valueOrErrorMessage(getString(h, "minters"), "minters addresses not found"), ",") | |
34 | + | ||
35 | + | let n = "maxSupply" | |
36 | + | ||
37 | + | let o = valueOrErrorMessage(getInteger(this, n), "maxSupply not set") | |
38 | + | ||
39 | + | let p = "currentSupply" | |
40 | + | ||
41 | + | let q = valueOrElse(getInteger(this, p), 0) | |
42 | + | ||
43 | + | let r = height | |
44 | + | ||
45 | + | func s (t) = ((((("height: " + toString(r)) + ", maxSupply: ") + toString(o)) + ", currentSupply: ") + toString(q)) | |
46 | + | ||
47 | + | ||
48 | + | @Callable(u) | |
49 | + | func mint (v) = { | |
50 | + | let w = i("mint") | |
51 | + | if ((w == w)) | |
52 | + | then { | |
53 | + | let x = valueOrErrorMessage(indexOf(m, toString(u.caller)), "mint denied") | |
54 | + | if ((x == x)) | |
55 | + | then { | |
56 | + | let y = (q + v) | |
57 | + | if ((y > o)) | |
58 | + | then throw("exceed max supply") | |
59 | + | else [Reissue(l, v, true), ScriptTransfer(u.caller, v, l), f(("minted_by_" + toString(u.caller)), v), d(p, y)] | |
60 | + | } | |
61 | + | else throw("Strict value is not equal to itself.") | |
62 | + | } | |
63 | + | else throw("Strict value is not equal to itself.") | |
64 | + | } | |
65 | + | ||
66 | + | ||
67 | + | ||
68 | + | @Callable(u) | |
69 | + | func init (z,o) = { | |
70 | + | let A = Issue("POWER", "Take the Power back! https://power.tech", 0, 8, true) | |
71 | + | let B = toBase58String(calculateAssetId(A)) | |
72 | + | [A, a(k, B), a(g, z), e(n, o)] | |
73 | + | } | |
74 | + | ||
75 | + |
github/deemru/w8io/169f3d6 24.89 ms ◑