tx · FpHsYLbEBC4LcgdSCuVWgvF31uEr4P3niTNrqVT5yF5g

3Mw7mAf2p8drjeSSDEbq6yyFhjqTgDcwGFB:  -0.04000000 Waves

2022.05.05 10:33 [2038113] smart account 3Mw7mAf2p8drjeSSDEbq6yyFhjqTgDcwGFB > SELF 0.00000000 Waves

{ "type": 13, "id": "FpHsYLbEBC4LcgdSCuVWgvF31uEr4P3niTNrqVT5yF5g", "fee": 4000000, "feeAssetId": null, "timestamp": 1651736088923, "version": 2, "chainId": 84, "sender": "3Mw7mAf2p8drjeSSDEbq6yyFhjqTgDcwGFB", "senderPublicKey": "Ti5K4A5REvfgdfj3SWhhb2wJXRKenVb3WPQ6tE1TaKe", "proofs": [ "e59CLpCN7sGGDVREuSYDTER7ZPAYZRbNXRNpkwRNR9baBuP1YraMoaBQQqBA5XAcvUcafn44NCvgUN9TrJFUhkv" ], "script": "base64:AAIFAAAAAAAAABMIAhILCgkBAQEBAQgICAESABIAAAAADgAAAAACcHMCAAAADVBSRVNBTEVfU1RBUlQAAAAAAnBkAgAAABBQUkVTQUxFX0RVUkFUSU9OAAAAAAJjcwIAAAALQ0xBSU1fU1RBUlQAAAAAAmNkAgAAAA5DTEFJTV9EVVJBVElPTgAAAAABcAIAAAAJUFJJQ0VfSURPAAAAAARwMUlEAgAAABBQUklDRV8xX0FTU0VUX0lEAAAAAARwMklEAgAAABBQUklDRV8yX0FTU0VUX0lEAAAAAARwM0lEAgAAABBQUklDRV8zX0FTU0VUX0lEAAAAAANtaWECAAAAEU1JTl9BTU9VTlRfSU5WRVNUAAAAAAVtYWluYQIAAAAKTUFJTl9BU1NFVAAAAAAHZm9yU2FsZQIAAAAOVE9UQUxfRk9SX1NBTEUAAAAACXRvdGFsU2FsZQIAAAAKVE9UQUxfU0FMRQAAAAAHdGludmVzdAIAAAANVE9UQUxfSU5WRVNUXwEAAAAPZ2V0QXNzZXRJZlZhbGlkAAAAAQAAAAdhc3NldElkCQACWAAAAAEJAQAAABN2YWx1ZU9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ABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAgAAAAhfSElTVE9SWQAAAAAAAAAAAAQAAAAJZGlmZXJlbmNICQAAZQAAAAIJAABlAAAAAgUAAAANY2xhaW5EdXJhdGlvbgUAAAAMaFNvbGljaXRhdGluCQAAZQAAAAIFAAAAAWgFAAAACmNsYWluU3RhcnQEAAAACmZpbmFsVmFsdWUJAABoAAAAAgUAAAAGZGlzdHJpBQAAAAlkaWZlcmVuY0gJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgkAASwAAAACBQAAAAd0aW52ZXN0CQACWAAAAAEICAUAAAABaQAAAAZjYWxsZXIAAAAFYnl0ZXMCAAAACF9ISVNUT1JZCQAAZQAAAAIFAAAAAWgFAAAACmNsYWluU3RhcnQJAARMAAAAAgkBAAAADEludGVnZXJFbnRyeQAAAAIJAAEsAAAAAgUAAAAHdGludmVzdAkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzCQAAZQAAAAIFAAAACmdldFRJbnZlc3QJAABoAAAAAgUAAAAKZmluYWxWYWx1ZQUAAAAFcHJpY2UJAARMAAAAAgkBAAAADlNjcmlwdFRyYW5zZmVyAAAAAwgFAAAAAWkAAAAGY2FsbGVyBQAAAApmaW5hbFZhbHVlBQAAAAltYWluQXNzZXQFAAAAA25pbAAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V51c3nmA==", "height": 2038113, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: BedVh8C4MqaQXT65XYxTMr5YTT7ipis5Sp32JFuJMLQL Next: 37ueSBJtFKWQSaNpAYgSJUU4heZaNYL34xdL32ouqfms Diff:
OldNewDifferences
3636 let asset2 = getAssetIfValid(price2AssetId58)
3737 let asset3 = getAssetIfValid(price3AssetId58)
3838 if ((i.caller == this))
39- then if ((presaleStart >= presaleDuration))
40- then throw("PresaleStart can't be bigger than PresaleDuration")
39+ then if ((presaleDuration >= presaleStart))
40+ then throw("PresaleDuration can't be bigger than PresaleStart")
4141 else if ((presaleDuration >= claimStart))
4242 then throw("presaleDuration can't be bigger than claimStart")
4343 else if ((claimStart >= claimDuration))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let ps = "PRESALE_START"
55
66 let pd = "PRESALE_DURATION"
77
88 let cs = "CLAIM_START"
99
1010 let cd = "CLAIM_DURATION"
1111
1212 let p = "PRICE_IDO"
1313
1414 let p1ID = "PRICE_1_ASSET_ID"
1515
1616 let p2ID = "PRICE_2_ASSET_ID"
1717
1818 let p3ID = "PRICE_3_ASSET_ID"
1919
2020 let mia = "MIN_AMOUNT_INVEST"
2121
2222 let maina = "MAIN_ASSET"
2323
2424 let forSale = "TOTAL_FOR_SALE"
2525
2626 let totalSale = "TOTAL_SALE"
2727
2828 let tinvest = "TOTAL_INVEST_"
2929
3030 func getAssetIfValid (assetId) = toBase58String(valueOrErrorMessage(value(assetInfo(fromBase58String(assetId))).id, (("Asset Id: " + assetId) + " is invalid.")))
3131
3232
3333 @Callable(i)
3434 func constructor (presaleStart,presaleDuration,claimStart,claimDuration,price,price1AssetId58,price2AssetId58,price3AssetId58,minInvestAmount) = {
3535 let asset1 = getAssetIfValid(price1AssetId58)
3636 let asset2 = getAssetIfValid(price2AssetId58)
3737 let asset3 = getAssetIfValid(price3AssetId58)
3838 if ((i.caller == this))
39- then if ((presaleStart >= presaleDuration))
40- then throw("PresaleStart can't be bigger than PresaleDuration")
39+ then if ((presaleDuration >= presaleStart))
40+ then throw("PresaleDuration can't be bigger than PresaleStart")
4141 else if ((presaleDuration >= claimStart))
4242 then throw("presaleDuration can't be bigger than claimStart")
4343 else if ((claimStart >= claimDuration))
4444 then throw("claimStart can't be bigger than claimDuration")
4545 else if ((minInvestAmount >= price))
4646 then throw("minInvestAmount can't be bigger than price")
4747 else if (if (if ((asset1 == asset2))
4848 then true
4949 else (asset1 == asset3))
5050 then true
5151 else (asset2 == asset3))
5252 then throw("Each Asset must be different from the other.")
5353 else if ((size(i.payments) != 1))
5454 then throw("exactly 1 payment must be attached")
5555 else [BinaryEntry(maina, value(i.payments[0].assetId)), StringEntry(p1ID, price1AssetId58), StringEntry(p2ID, price2AssetId58), StringEntry(p3ID, price3AssetId58), IntegerEntry(ps, presaleStart), IntegerEntry(pd, presaleDuration), IntegerEntry(cs, claimStart), IntegerEntry(cd, claimDuration), IntegerEntry(p, price), IntegerEntry(mia, minInvestAmount), IntegerEntry(forSale, value(i.payments[0]).amount), IntegerEntry(totalSale, 0)]
5656 else throw("Only the Admin itself can invoke this function")
5757 }
5858
5959
6060
6161 @Callable(i)
6262 func invest () = {
6363 let mainAsset = getBinary(this, maina)
6464 let presaleStart = getIntegerValue(this, ps)
6565 let presaleDuration = getIntegerValue(this, pd)
6666 let presaleEnd = (presaleStart + presaleDuration)
6767 let price = getIntegerValue(this, p)
6868 let h = height
6969 let pmt = value(i.payments[0])
7070 let pmtAssetId = value(pmt.assetId)
7171 let pmtAmount = pmt.amount
7272 let asset1 = fromBase58String(getStringValue(this, p1ID))
7373 let asset2 = fromBase58String(getStringValue(this, p2ID))
7474 let asset3 = fromBase58String(getStringValue(this, p3ID))
7575 let totalSalee = getIntegerValue(this, totalSale)
7676 let forSalee = getIntegerValue(this, forSale)
7777 let minInvest = getIntegerValue(this, mia)
7878 if ((presaleStart >= h))
7979 then throw("presale has not been started yet")
8080 else if ((h >= presaleEnd))
8181 then throw("presale has been already ended")
8282 else if ((size(i.payments) != 1))
8383 then throw("exactly 1 payment is expected")
8484 else if (if (if ((pmtAssetId != asset1))
8585 then true
8686 else (pmtAssetId != asset2))
8787 then true
8888 else (pmtAssetId != asset3))
8989 then throw("invalid payment asset id")
9090 else if ((totalSalee >= forSalee))
9191 then throw("Pre-sale asset has been - sold consider to use smaller payment")
9292 else if ((minInvest > pmtAmount))
9393 then throw("Amount less than the minimum to be invested.")
9494 else {
9595 let getTInvest = valueOrElse(getIntegerValue(this, (tinvest + toBase58String(i.caller.bytes))), 0)
9696 let calc = (pmtAmount / price)
9797 let totalAmount = (pmtAmount + getTInvest)
9898 [IntegerEntry((tinvest + toBase58String(i.caller.bytes)), totalAmount), IntegerEntry(totalSale, (totalSalee + calc)), BooleanEntry((((tinvest + toBase58String(i.caller.bytes)) + "__") + toBase58String(pmtAssetId)), true)]
9999 }
100100 }
101101
102102
103103
104104 @Callable(i)
105105 func claimPresale () = {
106106 let mainAsset = getBinary(this, maina)
107107 let h = height
108108 let clainStart = getIntegerValue(this, cs)
109109 let clainDuration = getIntegerValue(this, cd)
110110 let clainEnd = (clainStart + clainDuration)
111111 let price = getIntegerValue(this, p)
112112 if ((clainStart >= h))
113113 then throw("The Presale is still happening.")
114114 else if ((h > clainEnd))
115115 then {
116116 let getTInvest = valueOrErrorMessage(getIntegerValue(this, (tinvest + toBase58String(i.caller.bytes))), "You were not part of the presale")
117117 let calc = (getTInvest / price)
118118 let distri = (calc / clainDuration)
119119 let hSolicitatin = valueOrElse(getIntegerValue(this, ((tinvest + toBase58String(i.caller.bytes)) + "_HISTORY")), 0)
120120 let diferencH = (clainDuration - hSolicitatin)
121121 let finalValue = (distri * diferencH)
122122 [IntegerEntry(((tinvest + toBase58String(i.caller.bytes)) + "_HISTORY"), (h - clainStart)), IntegerEntry((tinvest + toBase58String(i.caller.bytes)), (getTInvest - (finalValue * price))), ScriptTransfer(i.caller, finalValue, mainAsset)]
123123 }
124124 else {
125125 let getTInvest = valueOrErrorMessage(getIntegerValue(this, (tinvest + toBase58String(i.caller.bytes))), "You were not part of the presale")
126126 let calc = (getTInvest / price)
127127 let distri = (calc / clainDuration)
128128 let hSolicitatin = valueOrElse(getIntegerValue(this, ((tinvest + toBase58String(i.caller.bytes)) + "_HISTORY")), 0)
129129 let diferencH = ((clainDuration - hSolicitatin) - (h - clainStart))
130130 let finalValue = (distri * diferencH)
131131 [IntegerEntry(((tinvest + toBase58String(i.caller.bytes)) + "_HISTORY"), (h - clainStart)), IntegerEntry((tinvest + toBase58String(i.caller.bytes)), (getTInvest - (finalValue * price))), ScriptTransfer(i.caller, finalValue, mainAsset)]
132132 }
133133 }
134134
135135
136136 @Verifier(tx)
137137 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
138138

github/deemru/w8io/169f3d6 
31.70 ms