tx · 37ueSBJtFKWQSaNpAYgSJUU4heZaNYL34xdL32ouqfms

3Mw7mAf2p8drjeSSDEbq6yyFhjqTgDcwGFB:  -0.04000000 Waves

2022.05.05 10:34 [2038114] smart account 3Mw7mAf2p8drjeSSDEbq6yyFhjqTgDcwGFB > SELF 0.00000000 Waves

{ "type": 13, "id": "37ueSBJtFKWQSaNpAYgSJUU4heZaNYL34xdL32ouqfms", "fee": 4000000, "feeAssetId": null, "timestamp": 1651736178384, "version": 2, "chainId": 84, "sender": "3Mw7mAf2p8drjeSSDEbq6yyFhjqTgDcwGFB", "senderPublicKey": "Ti5K4A5REvfgdfj3SWhhb2wJXRKenVb3WPQ6tE1TaKe", "proofs": [ "394AVQ7psaM5xThAspCqp8JZdPfqNLs9w81CnRsHToNZ6quB7vho46L1wMZ4jgVCYKw289BCCagmRos6Cywn4nMX" ], "script": "base64:AAIFAAAAAAAAABMIAhILCgkBAQEBAQgICAESABIAAAAADgAAAAACcHMCAAAADVBSRVNBTEVfU1RBUlQAAAAAAnBkAgAAABBQUkVTQUxFX0RVUkFUSU9OAAAAAAJjcwIAAAALQ0xBSU1fU1RBUlQAAAAAAmNkAgAAAA5DTEFJTV9EVVJBVElPTgAAAAABcAIAAAAJUFJJQ0VfSURPAAAAAARwMUlEAgAAABBQUklDRV8xX0FTU0VUX0lEAAAAAARwMklEAgAAABBQUklDRV8yX0FTU0VUX0lEAAAAAARwM0lEAgAAABBQUklDRV8zX0FTU0VUX0lEAAAAAANtaWECAAAAEU1JTl9BTU9VTlRfSU5WRVNUAAAAAAVtYWluYQIAAAAKTUFJTl9BU1NFVAAAAAAHZm9yU2FsZQIAAAAOVE9UQUxfRk9SX1NBTEUAAAAACXRvdGFsU2FsZQIAAAAKVE9UQUxfU0FMRQAAAAAHdGludmVzdAIAAAANVE9UQUxfSU5WRVNUXwEAAAAPZ2V0QXNzZXRJZlZhbGlkAAAAAQAAAAdhc3NldElkCQACWAAAAAEJAQAAABN2YWx1ZU9yRXJyb3JN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AVieXRlcwIAAAAIX0hJU1RPUlkAAAAAAAAAAAAEAAAACWRpZmVyZW5jSAkAAGUAAAACCQAAZQAAAAIFAAAADWNsYWluRHVyYXRpb24FAAAADGhTb2xpY2l0YXRpbgkAAGUAAAACBQAAAAFoBQAAAApjbGFpblN0YXJ0BAAAAApmaW5hbFZhbHVlCQAAaAAAAAIFAAAABmRpc3RyaQUAAAAJZGlmZXJlbmNICQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgUAAAAHdGludmVzdAkAAlgAAAABCAgFAAAAAWkAAAAGY2FsbGVyAAAABWJ5dGVzAgAAAAhfSElTVE9SWQkAAGUAAAACBQAAAAFoBQAAAApjbGFpblN0YXJ0CQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAIFAAAAB3RpbnZlc3QJAAJYAAAAAQgIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwkAAGUAAAACBQAAAApnZXRUSW52ZXN0CQAAaAAAAAIFAAAACmZpbmFsVmFsdWUFAAAABXByaWNlCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMIBQAAAAFpAAAABmNhbGxlcgUAAAAKZmluYWxWYWx1ZQUAAAAJbWFpbkFzc2V0BQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleWkpALA=", "height": 2038114, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: FpHsYLbEBC4LcgdSCuVWgvF31uEr4P3niTNrqVT5yF5g Next: HBPfn3XKJCRNCXJiBnPWVppmx8TE6SUGH3BrYnwho3bw Diff:
OldNewDifferences
4040 then throw("PresaleDuration can't be bigger than PresaleStart")
4141 else if ((presaleDuration >= claimStart))
4242 then throw("presaleDuration can't be bigger than claimStart")
43- else if ((claimStart >= claimDuration))
44- then throw("claimStart can't be bigger than claimDuration")
43+ else if ((claimDuration >= claimStart))
44+ then throw("claimDuration can't be bigger than claimStart")
4545 else if ((minInvestAmount >= price))
4646 then throw("minInvestAmount can't be bigger than price")
4747 else if (if (if ((asset1 == asset2))
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))
3939 then if ((presaleDuration >= presaleStart))
4040 then throw("PresaleDuration can't be bigger than PresaleStart")
4141 else if ((presaleDuration >= claimStart))
4242 then throw("presaleDuration can't be bigger than claimStart")
43- else if ((claimStart >= claimDuration))
44- then throw("claimStart can't be bigger than claimDuration")
43+ else if ((claimDuration >= claimStart))
44+ then throw("claimDuration can't be bigger than claimStart")
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 
27.62 ms