tx · 3EDYFQ5Vaem2Fh6DcwcybfMjKtX9vT2ULTSwkfRgfGi7 3NB9QGKiAF3B8wiJZbRd2PfWJAX3rasvCAX: -0.00300000 Waves 2022.07.16 21:54 [2142692] smart account 3NB9QGKiAF3B8wiJZbRd2PfWJAX3rasvCAX > SELF 0.00000000 Waves
{ "type": 13, "id": "3EDYFQ5Vaem2Fh6DcwcybfMjKtX9vT2ULTSwkfRgfGi7", "fee": 300000, "feeAssetId": null, "timestamp": 1657997766751, "version": 2, "chainId": 84, "sender": "3NB9QGKiAF3B8wiJZbRd2PfWJAX3rasvCAX", "senderPublicKey": "25HKr2HEfEF45LGmh3fFPR4WDxgLz6p97kmgYdD4nGtX", "proofs": [ "2bopYU8Y46JBJumCkc7QWoxvG95bitVGQ1XATEr9LcgXUmQA7s682424c5RugRroT2XQLN8DKS1SAw8EKXbbjvr3" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAALAAAAAAtiYXNlQXNzZXRJZAkAAlkAAAABAgAAACxINVVVdVBKN1dCWHpqZzZaMWFoQlV4ajdWV29WRkZmRzNCTXp5QUFuUld0NgAAAAAKbWluVG9IYXRjaAAAAAAAAA9CQAAAAAAJbWluVG9CdXJuAAAAAAAAAABkAAAAAA5wb3dlckFzc2V0TmFtZQIAAAAFQm9tYmEAAAAAC2Rlc2NyaXB0aW9uAgAAAAxCbGFtYmEgVG9rZW4AAAAABmtQb3dlcgIAAAAMcG93ZXJBc3NldElkAAAAAAhiYXNlRGVjaQAAAAAAAA9CQAAAAAAFcmF0aW8AAAAAAAAAAGQBAAAACWdldEFtb3VudAAAAAEAAAAIYW1vdW50SW4JAABrAAAAAwUAAAAIYW1vdW50SW4FAAAABXJhdGlvBQAAAAhiYXNlRGVjaQEAAAAMZ2V0T3V0QW1vdW50AAAAAQAAAAhhbW91bnRJbgkAAGgAAAACCQAAaQAAAAIJAABrAAAAAwUAAAAIYW1vdW50SW4AAAAAAAAAAFAAAAAAAAAAAGQFAAAABXJhdGlv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"applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: none Next: 29zsCWRgRdbFsiGkan944vy1JHEz2bp89zXwiGYG4k5G Full:
Old | New | Differences | |
---|---|---|---|
1 | - | # no script | |
1 | + | {-# STDLIB_VERSION 5 #-} | |
2 | + | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | + | {-# CONTENT_TYPE DAPP #-} | |
4 | + | let baseAssetId = fromBase58String("H5UUuPJ7WBXzjg6Z1ahBUxj7VWoVFFfG3BMzyAAnRWt6") | |
5 | + | ||
6 | + | let minToHatch = 1000000 | |
7 | + | ||
8 | + | let minToBurn = 100 | |
9 | + | ||
10 | + | let powerAssetName = "Bomba" | |
11 | + | ||
12 | + | let description = "Blamba Token" | |
13 | + | ||
14 | + | let kPower = "powerAssetId" | |
15 | + | ||
16 | + | let baseDeci = 1000000 | |
17 | + | ||
18 | + | let ratio = 100 | |
19 | + | ||
20 | + | func getAmount (amountIn) = fraction(amountIn, ratio, baseDeci) | |
21 | + | ||
22 | + | ||
23 | + | func getOutAmount (amountIn) = ((fraction(amountIn, 80, 100) / ratio) * baseDeci) | |
24 | + | ||
25 | + | ||
26 | + | func checkPowerId () = match getString(kPower) { | |
27 | + | case p: String => | |
28 | + | p | |
29 | + | case _ => | |
30 | + | "Start" | |
31 | + | } | |
32 | + | ||
33 | + | ||
34 | + | @Callable(i) | |
35 | + | func hatchDucks () = if ((i.payments[0].assetId != baseAssetId)) | |
36 | + | then throw("Only Bull EGG accepted!") | |
37 | + | else if ((minToHatch > i.payments[0].amount)) | |
38 | + | then throw("Min amount to invest is 100 Bull EGG") | |
39 | + | else if ((checkPowerId() == "Start")) | |
40 | + | then { | |
41 | + | let powerAsset = Issue(powerAssetName, description, getAmount(i.payments[0].amount), 0, true) | |
42 | + | [powerAsset, StringEntry(kPower, toBase58String(calculateAssetId(powerAsset)))] | |
43 | + | } | |
44 | + | else { | |
45 | + | let powerAssetId = fromBase58String(checkPowerId()) | |
46 | + | [Reissue(powerAssetId, getAmount(i.payments[0].amount), true), ScriptTransfer(i.caller, getAmount(i.payments[0].amount), powerAssetId)] | |
47 | + | } | |
48 | + | ||
49 | + | ||
50 | + | ||
51 | + | @Callable(i) | |
52 | + | func burnDucks () = { | |
53 | + | let powerAssetId = fromBase58String(checkPowerId()) | |
54 | + | if ((i.payments[0].assetId != powerAssetId)) | |
55 | + | then throw("Only Bomba accepted!") | |
56 | + | else if ((minToBurn > i.payments[0].amount)) | |
57 | + | then throw("Min amount to burn is 100 Bomba") | |
58 | + | else [Burn(powerAssetId, i.payments[0].amount), ScriptTransfer(i.caller, getOutAmount(i.payments[0].amount), baseAssetId)] | |
59 | + | } | |
60 | + | ||
61 | + | ||
62 | + | @Verifier(tx) | |
63 | + | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
64 | + |
github/deemru/w8io/169f3d6 16.95 ms ◑