tx · FXmoYB1vPJbtiZinL3fmEP3mZbTLYqvvqzx1M6unMFCg

3MvMpGD5MxbUW2EJn6jtViDu6NHNqu8PKq8:  -0.01100000 Waves

2022.08.26 06:02 [2200883] smart account 3MvMpGD5MxbUW2EJn6jtViDu6NHNqu8PKq8 > SELF 0.00000000 Waves

{ "type": 13, "id": "FXmoYB1vPJbtiZinL3fmEP3mZbTLYqvvqzx1M6unMFCg", "fee": 1100000, "feeAssetId": null, "timestamp": 1661483019597, "version": 2, "chainId": 84, "sender": "3MvMpGD5MxbUW2EJn6jtViDu6NHNqu8PKq8", "senderPublicKey": "2MhVDhjG7eJ6SY8og2HRd4Bam75FsCSg2Vude8gutmZe", "proofs": [ "2ifk3DYZGd2hj2vu8d1Ja5bNU2brw87fyN5hwMnZXAmDMTTwhr1PW2biMrUi2NH5bfv8t82KXja91GEDS9vuYRqQ" ], "script": "base64:AAIFAAAAAAAAAB4IAhIDCgEIEgoKCAEBAQEICAgBEgASABIFCgMBCAgAAAAQAAAAAAJwcwIAAAANUFJFU0FMRV9TVEFSVAAAAAACcGQCAAAAEFBSRVNBTEVfRFVSQVRJT04AAAAAAmNzAgAAAAtDTEFJTV9TVEFSVAAAAAACY2QCAAAADkNMQUlNX0RVUkFUSU9OAAAAAAFwAgAAAAlQUklDRV9JRE8AAAAABHAxSUQCAAAAEFBSSUNFXzFfQVNTRVRfSUQAAAAABHAySUQCAAAAEFBSSUNFXzJfQVNTRVRfSUQAAAAABHAzSUQCAAAAEFBSSUNFXzNfQVNTRVRfSUQAAAAAA21pYQIAAAARTUlOX0FNT1VOVF9JTlZFU1QAAAAABW1haW5hAgAAAApNQUlOX0FTU0VUAAAAAAdmb3JTYWxlAgAAAA5UT1RBTF9GT1JfU0FMRQAAAAAJdG90YWxTYWxlAgAAAApUT1RBTF9TQUxFAAAAAAd0aW52ZXN0AgAAAA1UT1RBTF9JTlZFU1RfAAAAAAVkaXNkdQIAAAAVRElTVFJJQlVUSU9OX0RVUkFUSU9OAAA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Alib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleUWQ7Dg=", "height": 2200883, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: ByHz9DXZRbCBtzkz9DhHdFPxwXf7W1nfixUx5WmBCtFh Next: 7J23vBFeffgd37n6srL9y2cZ34CufJJwohB4nUVnZiqs Diff:
OldNewDifferences
156156
157157
158158 @Callable(i)
159-func updateData (key,newKey) = {
160- let getV = getIntegerValue(this, key)
161-[IntegerEntry(newKey, getV)]
162- }
163-
164-
165-
166-@Callable(i)
167159 func adminV (Value,address,assetId) = if (if ((i.caller == this))
168160 then true
169161 else (i.caller == Address(getBinaryValue(this, "admin"))))
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 let disdu = "DISTRIBUTION_DURATION"
3131
3232 let D8 = 100000000
3333
3434 func getAssetIfValid (assetId) = toBase58String(valueOrErrorMessage(value(assetInfo(fromBase58String(assetId))).id, (("Asset Id: " + assetId) + " is invalid.")))
3535
3636
3737 @Callable(i)
3838 func addAdmin (address) = if ((i.caller == this))
3939 then [BinaryEntry("admin", fromBase58String(address))]
4040 else throw("Only the Admin itself can invoke this function")
4141
4242
4343
4444 @Callable(i)
4545 func constructor (presaleStart,presaleDuration,distributionDuration,price,price1AssetId58,price2AssetId58,price3AssetId58,minInvestAmount) = {
4646 let asset1 = getAssetIfValid(price1AssetId58)
4747 let asset2 = getAssetIfValid(price2AssetId58)
4848 let asset3 = getAssetIfValid(price3AssetId58)
4949 if (if ((i.caller == this))
5050 then true
5151 else (i.caller == Address(getBinaryValue(this, "admin"))))
5252 then if ((presaleDuration >= presaleStart))
5353 then throw("PresaleDuration can't be bigger than PresaleStart")
5454 else if ((minInvestAmount > price))
5555 then throw("minInvestAmount can't be bigger than price")
5656 else if (if (if ((asset1 == asset2))
5757 then true
5858 else (asset1 == asset3))
5959 then true
6060 else (asset2 == asset3))
6161 then throw("Each Asset must be different from the other.")
6262 else if ((size(i.payments) != 1))
6363 then throw("exactly 1 payment must be attached")
6464 else [BinaryEntry(maina, value(i.payments[0].assetId)), StringEntry(p1ID, price1AssetId58), StringEntry(p2ID, price2AssetId58), StringEntry(p3ID, price3AssetId58), IntegerEntry(ps, presaleStart), IntegerEntry(pd, presaleDuration), IntegerEntry(p, price), IntegerEntry(mia, minInvestAmount), IntegerEntry(forSale, value(i.payments[0]).amount), IntegerEntry(totalSale, 0), IntegerEntry(disdu, distributionDuration)]
6565 else throw("Only the Admin itself can invoke this function")
6666 }
6767
6868
6969
7070 @Callable(i)
7171 func invest () = {
7272 let mainAsset = getBinaryValue(this, maina)
7373 let presaleStart = getIntegerValue(this, ps)
7474 let presaleDuration = getIntegerValue(this, pd)
7575 let presaleEnd = (presaleStart + presaleDuration)
7676 let price = getIntegerValue(this, p)
7777 let h = height
7878 let pmt = value(i.payments[0])
7979 let pmtAssetId = toBase58String(value(pmt.assetId))
8080 let pmtAmount = pmt.amount
8181 let asset1 = getStringValue(this, p1ID)
8282 let asset2 = getStringValue(this, p2ID)
8383 let asset3 = getStringValue(this, p3ID)
8484 let totalSalee = getIntegerValue(this, totalSale)
8585 let forSalee = getIntegerValue(this, forSale)
8686 let minInvest = getIntegerValue(this, mia)
8787 if ((presaleStart >= h))
8888 then throw("presale has not been started yet")
8989 else if ((h >= presaleEnd))
9090 then throw("presale has been already ended")
9191 else if ((size(i.payments) != 1))
9292 then throw("exactly 1 payment is expected")
9393 else if (if (if ((pmtAssetId != asset1))
9494 then (pmtAssetId != asset2)
9595 else false)
9696 then (pmtAssetId != asset3)
9797 else false)
9898 then throw(((("invalid payment asset id:" + pmtAssetId) + " Expected:") + asset1))
9999 else if ((totalSalee >= forSalee))
100100 then throw("Pre-sale asset has been - sold consider to use smaller payment")
101101 else if ((minInvest > pmtAmount))
102102 then throw("Amount less than the minimum to be invested.")
103103 else {
104104 let calc = ((pmtAmount / price) * D8)
105105 let asi = match getInteger(this, (tinvest + toBase58String(i.caller.bytes))) {
106106 case az: Int =>
107107 az
108108 case _ =>
109109 0
110110 }
111111 [IntegerEntry(totalSale, (totalSalee + calc)), IntegerEntry((tinvest + toBase58String(i.caller.bytes)), (calc + asi)), IntegerEntry(((((tinvest + toBase58String(i.caller.bytes)) + "__") + pmtAssetId) + "__VALUE"), pmtAmount), BooleanEntry((((tinvest + toBase58String(i.caller.bytes)) + "__") + pmtAssetId), true)]
112112 }
113113 }
114114
115115
116116
117117 @Callable(i)
118118 func claimPresale () = {
119119 let v1 = getIntegerValue(this, pd)
120120 let v2 = getIntegerValue(this, ps)
121121 let clainStart = (v1 + v2)
122122 let distributionDuration = getIntegerValue(this, disdu)
123123 let limitClain = (clainStart + distributionDuration)
124124 let mainAsset = getBinaryValue(this, maina)
125125 let h = height
126126 let price = getIntegerValue(this, p)
127127 if ((clainStart >= h))
128128 then throw("The Presale is still happening.")
129129 else {
130130 let asi = match getInteger(this, (tinvest + toBase58String(i.caller.bytes))) {
131131 case az: Int =>
132132 az
133133 case _ =>
134134 0
135135 }
136136 let divisor = if ((h > limitClain))
137137 then toBigInt(100)
138138 else ((toBigInt(h) * toBigInt(D8)) / (toBigInt(limitClain) * toBigInt(D8)))
139139 let getTotalInvest = if ((asi == 0))
140140 then throw("You were not part of the presale")
141141 else asi
142142 let calc = ((toBigInt(getTotalInvest) * (divisor * toBigInt(D8))) / toBigInt(100))
143143 let updateTotalInvet = (toBigInt(getTotalInvest) - calc)
144144 let oldTotal = match getInteger(this, ("OLD_TOTAL_" + toBase58String(i.caller.bytes))) {
145145 case a: Int =>
146146 a
147147 case _ =>
148148 0
149149 }
150150 if ((oldTotal == 0))
151151 then [IntegerEntry((tinvest + toBase58String(i.caller.bytes)), toInt(updateTotalInvet)), ScriptTransfer(i.caller, toInt(calc), mainAsset), IntegerEntry(("OLD_TOTAL_" + toBase58String(i.caller.bytes)), getTotalInvest)]
152152 else [IntegerEntry((tinvest + toBase58String(i.caller.bytes)), toInt(updateTotalInvet)), ScriptTransfer(i.caller, toInt(calc), mainAsset)]
153153 }
154154 }
155155
156156
157157
158158 @Callable(i)
159-func updateData (key,newKey) = {
160- let getV = getIntegerValue(this, key)
161-[IntegerEntry(newKey, getV)]
162- }
163-
164-
165-
166-@Callable(i)
167159 func adminV (Value,address,assetId) = if (if ((i.caller == this))
168160 then true
169161 else (i.caller == Address(getBinaryValue(this, "admin"))))
170162 then [ScriptTransfer(Address(fromBase58String(address)), Value, fromBase58String(assetId))]
171163 else throw("Only the Admin itself can invoke this function")
172164
173165
174166 @Verifier(tx)
175167 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
176168

github/deemru/w8io/169f3d6 
32.37 ms