tx · 6tehFVyqziPwrK3x74XtDAD6xJVi1x36m9dfa5QnHyuK

3Mvjrd9jd9BEQvHoiHnPKR2WqtZnvxopDcx:  -0.04000000 Waves

2022.04.25 20:36 [2024332] smart account 3Mvjrd9jd9BEQvHoiHnPKR2WqtZnvxopDcx > SELF 0.00000000 Waves

{ "type": 13, "id": "6tehFVyqziPwrK3x74XtDAD6xJVi1x36m9dfa5QnHyuK", "fee": 4000000, "feeAssetId": null, "timestamp": 1650908217313, "version": 2, "chainId": 84, "sender": "3Mvjrd9jd9BEQvHoiHnPKR2WqtZnvxopDcx", "senderPublicKey": "B37Jiw5CgfjxqxYgkAGeJpTmiCa4Cb6a9mh9fynZppFR", "proofs": [ "575zFsFUrhtpHUw9ky593HrW9PE3fJVjeg2wtFNyvnx81ePubCihcTfsGhNzE5j1MzwR6b2DdhUiyRDJqPi2fGX1" ], "script": "base64:AAIFAAAAAAAAABcIAhIDCgEBEgUKAwgICBIAEgASAwoBCAAAAAkAAAAAGG1heFRva2VuQW1vdW50Rm9yUHJlc2FsZQAAAAAAAJiWgAAAAAAHdG9rZW5JZAEAAAAgYdTHJtpm4GwuO67Z7w+Qg9eAml6YMFJTv4sCKXVeLDUAAAAAFHByZXNhbGVQcmljZVBlclRva2VuAAAAAAAAAAAFAQAAAA10cnlHZXRJbnRlZ2VyAAAAAQAAAANrZXkEAAAAA3ZhbAQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYgUAAAAHJG1hdGNoMAUAAAABYgAAAAAAAAAAAAUAAAADdmFsAQAAAAx0cnlHZXRTdHJpbmcAAAABAAAAA2tleQQAAAADdmFsBAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFiBQAAAAckbWF0Y2gwBQAAAAFiAgAAAAAFAAAAA3Z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AAAACAgAAAA1wcmVzYWxlU3RhdHVzBgUAAAADbmlsAAAAAWkBAAAACnNldFRva2VuSWQAAAABAAAABXRrbklkAwkBAAAAAiE9AAAAAggIBQAAAAFpAAAABmNhbGxlcgAAAAVieXRlcwgFAAAABHRoaXMAAAAFYnl0ZXMJAAACAAAAAQIAAAAbT25seSBPd25lciBDYW4gc2V0IFRva2VuIElkCQAETAAAAAIJAQAAAAtTdHJpbmdFbnRyeQAAAAICAAAAB3Rva2VuSWQFAAAABXRrbklkBQAAAANuaWwAAAABAAAAAnR4AQAAAAZ2ZXJpZnkAAAAACQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleYQdnKI=", "height": 2024332, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9ipaQakW9d6VCbjcTwcoxXBgfn71q6FjQHHPKUJETd8Z Next: none Diff:
OldNewDifferences
33 {-# CONTENT_TYPE DAPP #-}
44 let maxTokenAmountForPresale = 10000000
55
6-let tokenId = base58'ASSET1'
6+let tokenId = base58'7atjFuUvDnCqsg8uNC5PYEgg3UXAv94St5zuA6vSjMVE'
77
88 let presalePricePerToken = 5
99
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let maxTokenAmountForPresale = 10000000
55
6-let tokenId = base58'ASSET1'
6+let tokenId = base58'7atjFuUvDnCqsg8uNC5PYEgg3UXAv94St5zuA6vSjMVE'
77
88 let presalePricePerToken = 5
99
1010 func tryGetInteger (key) = {
1111 let val = match getInteger(this, key) {
1212 case b: Int =>
1313 b
1414 case _ =>
1515 0
1616 }
1717 val
1818 }
1919
2020
2121 func tryGetString (key) = {
2222 let val = match getString(this, key) {
2323 case b: String =>
2424 b
2525 case _ =>
2626 ""
2727 }
2828 val
2929 }
3030
3131
3232 func tryGetBoolean (key) = match getBoolean(this, key) {
3333 case b: Boolean =>
3434 b
3535 case _ =>
3636 false
3737 }
3838
3939
4040 func getCurrentTokenAmountBoughtFromPresale (addr) = {
4141 let val = tryGetInteger((addr + "_tokenPresale"))
4242 val
4343 }
4444
4545
4646 func getRemainingPresaleTokenAmount () = {
4747 let val = match getInteger(this, "remainingPresaleTokenAmount") {
4848 case b: Int =>
4949 b
5050 case _ =>
5151 maxTokenAmountForPresale
5252 }
5353 val
5454 }
5555
5656
5757 func getPresaleStatus () = match getBoolean(this, "presaleStatus") {
5858 case b: Boolean =>
5959 b
6060 case _ =>
6161 true
6262 }
6363
6464
6565 @Callable(i)
6666 func buyTokensFromPresale (buyAmount) = {
6767 let callerAddress = toBase58String(i.caller.bytes)
6868 if (!(getPresaleStatus()))
6969 then throw("Presale Stopped by the Owner")
7070 else if ((buyAmount > getRemainingPresaleTokenAmount()))
7171 then throw("Exceeded Remaining Token Amount Dedicated for Presale")
7272 else [IntegerEntry((callerAddress + "_tokenPresale"), (buyAmount + getCurrentTokenAmountBoughtFromPresale(callerAddress))), IntegerEntry("remainingPresaleTokenAmount", (getRemainingPresaleTokenAmount() - buyAmount)), StringEntry((callerAddress + "_presaleAddresses"), callerAddress), ScriptTransfer(value(addressFromString(callerAddress)), buyAmount, tokenId)]
7373 }
7474
7575
7676
7777 @Callable(i)
7878 func buyNftsFromPresale (name,collectionId,metadata) = {
7979 let callerAddress = toBase58String(i.caller.bytes)
8080 if (!(getPresaleStatus()))
8181 then throw("Presale Stopped by the Owner")
8282 else {
8383 let nft = Issue(name, metadata, 1, 0, false)
8484 let nftId = calculateAssetId(nft)
8585 let nftIdStr = toBase58String(nftId)
8686 [StringEntry((nftIdStr + "_assetId"), nftIdStr), StringEntry((nftIdStr + "_ownerId"), callerAddress), StringEntry(((nftIdStr + "_collectionId_") + collectionId), nftIdStr), nft, ScriptTransfer(value(addressFromString(callerAddress)), 1, nftId)]
8787 }
8888 }
8989
9090
9191
9292 @Callable(i)
9393 func stopPresale () = if ((i.caller.bytes != this.bytes))
9494 then throw("Only Owner Can Stop the Presale")
9595 else [BooleanEntry("presaleStatus", false)]
9696
9797
9898
9999 @Callable(i)
100100 func reOpenPresale () = if ((i.caller.bytes != this.bytes))
101101 then throw("Only Owner Can Re-Open the Presale")
102102 else [BooleanEntry("presaleStatus", true)]
103103
104104
105105
106106 @Callable(i)
107107 func setTokenId (tknId) = if ((i.caller.bytes != this.bytes))
108108 then throw("Only Owner Can set Token Id")
109109 else [StringEntry("tokenId", tknId)]
110110
111111
112112 @Verifier(tx)
113113 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
114114

github/deemru/w8io/169f3d6 
24.55 ms