tx · 5NtNUCbK3A5P3HF6PdotyQJm6a3cHT6x1fBLCaMDZivs

3NB9QGKiAF3B8wiJZbRd2PfWJAX3rasvCAX:  -0.00700000 Waves

2022.07.16 22:22 [2142718] smart account 3NB9QGKiAF3B8wiJZbRd2PfWJAX3rasvCAX > SELF 0.00000000 Waves

{ "type": 13, "id": "5NtNUCbK3A5P3HF6PdotyQJm6a3cHT6x1fBLCaMDZivs", "fee": 700000, "feeAssetId": null, "timestamp": 1657999426318, "version": 2, "chainId": 84, "sender": "3NB9QGKiAF3B8wiJZbRd2PfWJAX3rasvCAX", "senderPublicKey": "25HKr2HEfEF45LGmh3fFPR4WDxgLz6p97kmgYdD4nGtX", "proofs": [ "4iTPo84DEZhaCbh8xC2bhswTCnAkVibdkZKT5pFcvVgzYk64DYVUHMf12dwNTgV9QVi6Kq6otKSsciu9AZcBRysT" ], "script": "base64:AAIFAAAAAAAAAAYIAhIAEgAAAAALAAAAAAtiYXNlQXNzZXRJZAkAAlkAAAABAgAAACxINVVVdVBKN1dCWHpqZzZaMWFoQlV4ajdWV29WRkZmRzNCTXp5QUFuUld0NgAAAAAKbWluVG9IYXRjaAAAAAAAAA9CQAAAAAAJbWluVG9CdXJuAAAAAAAAAABkAAAAAA5wb3dlckFzc2V0TmFtZQIAAAAFQm9tYmEAAAAAC2Rlc2NyaXB0aW9uAgAAAAxCbGFtYmEgVG9rZW4AAAAABmtQb3dlcgIAAAAMcG93ZXJBc3NldElkAAAAAAhiYXNlRGVjaQAAAAAAAA9CQAAAAAAFcmF0aW8AAAAAAAAAAGQBAAAACWdldEFtb3VudAAAAAEAAAAIYW1vdW50SW4JAABrAAAAAwUAAAAIYW1vdW50SW4FAAAABXJhdGlvBQAAAAhiYXNlRGVjaQEAAAAMZ2V0T3V0QW1vdW50AAAAAQAAAAhhbW91bnRJbgkAAGkAAAACCQAAaAAAAAIJAABrAAAAAwUAAAAIYW1vdW50SW4AAAAAAAAAAFAAAAAAAAAAAGQFAAAACGJhc2VEZW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AAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXllbmuL", "height": 2142718, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 29zsCWRgRdbFsiGkan944vy1JHEz2bp89zXwiGYG4k5G Next: none Diff:
OldNewDifferences
2020 func getAmount (amountIn) = fraction(amountIn, ratio, baseDeci)
2121
2222
23-func getOutAmount (amountIn) = ((fraction(amountIn, 80, 100) / ratio) * baseDeci)
23+func getOutAmount (amountIn) = ((fraction(amountIn, 80, 100) * baseDeci) / ratio)
2424
2525
2626 func checkPowerId () = match getString(kPower) {
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let baseAssetId = fromBase58String("H5UUuPJ7WBXzjg6Z1ahBUxj7VWoVFFfG3BMzyAAnRWt6")
55
66 let minToHatch = 1000000
77
88 let minToBurn = 100
99
1010 let powerAssetName = "Bomba"
1111
1212 let description = "Blamba Token"
1313
1414 let kPower = "powerAssetId"
1515
1616 let baseDeci = 1000000
1717
1818 let ratio = 100
1919
2020 func getAmount (amountIn) = fraction(amountIn, ratio, baseDeci)
2121
2222
23-func getOutAmount (amountIn) = ((fraction(amountIn, 80, 100) / ratio) * baseDeci)
23+func getOutAmount (amountIn) = ((fraction(amountIn, 80, 100) * baseDeci) / ratio)
2424
2525
2626 func checkPowerId () = match getString(kPower) {
2727 case p: String =>
2828 p
2929 case _ =>
3030 "Start"
3131 }
3232
3333
3434 @Callable(i)
3535 func hatchDucks () = if ((i.payments[0].assetId != baseAssetId))
3636 then throw("Only BUGGS accepted!")
3737 else if ((minToHatch > i.payments[0].amount))
3838 then throw("Min amount to invest is 100 BUGGS")
3939 else if ((checkPowerId() == "Start"))
4040 then {
4141 let powerAsset = Issue(powerAssetName, description, getAmount(i.payments[0].amount), 0, true)
4242 [powerAsset, StringEntry(kPower, toBase58String(calculateAssetId(powerAsset))), ScriptTransfer(i.caller, getAmount(i.payments[0].amount), calculateAssetId(powerAsset))]
4343 }
4444 else {
4545 let powerAssetId = fromBase58String(checkPowerId())
4646 [Reissue(powerAssetId, getAmount(i.payments[0].amount), true), ScriptTransfer(i.caller, getAmount(i.payments[0].amount), powerAssetId)]
4747 }
4848
4949
5050
5151 @Callable(i)
5252 func burnDucks () = {
5353 let powerAssetId = fromBase58String(checkPowerId())
5454 if ((i.payments[0].assetId != powerAssetId))
5555 then throw("Only Bomba accepted!")
5656 else if ((minToBurn > i.payments[0].amount))
5757 then throw("Min amount to burn is 100 Bomba")
5858 else [Burn(powerAssetId, i.payments[0].amount), ScriptTransfer(i.caller, getOutAmount(i.payments[0].amount), baseAssetId)]
5959 }
6060
6161
6262 @Verifier(tx)
6363 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
6464

github/deemru/w8io/169f3d6 
24.61 ms