tx · ADEVQy7NTuyiKWCi6hjERR7zqqA7p8M3BNBBvhE9Yw2C

3MyLnBsVm9pw43K9eba5UExxb3efeai91KP:  -0.01000000 Waves

2022.12.22 14:00 [2371412] smart account 3MyLnBsVm9pw43K9eba5UExxb3efeai91KP > SELF 0.00000000 Waves

{ "type": 13, "id": "ADEVQy7NTuyiKWCi6hjERR7zqqA7p8M3BNBBvhE9Yw2C", "fee": 1000000, "feeAssetId": null, "timestamp": 1671706813282, "version": 2, "chainId": 84, "sender": "3MyLnBsVm9pw43K9eba5UExxb3efeai91KP", "senderPublicKey": "E5xdZLn3yHKAn29pTyubhr9R1mkRGg9WKAcpPrCYFYHx", "proofs": [ "3RSCzMUcSYRtpwM7zk1opg9BpsabkhqiExGiZDfJoKiq8RVZPvnFVCwxPKkrvs8z2BL9uWKZvKcsTu4vMnbi2mr6" ], "script": "base64:AAIFAAAAAAAAAB8IAhIAEgASCQoHCAgIAQEIARIDCgEBEgASABIDCgEIAAAAEAAAAAAGYWRtUHViAQAAACDCbSeYCFZIOpb4r9LWa8L402jDi6OfxQF86gIW2LZmcwAAAAAMcGF5bWVudEFzc2V0AQAAACAhOUTpKXxfz4r4M5I49SS+rwv2+rnVA49FLcaoUr/6uQAAAAAIZXZlbnRLZXkCAAAAB19ldmVudF8AAAAACnBheW1lbnRLZXkCAAAAA19wXwAAAAAQZ2xvYmFsRXZlbnRJZEtleQIAAAAJX2V2ZW50SWRfAAAAAA1zdGFydEJsb2NrS2V5AgAAAAxfc3RhcnRCbG9ja18AAAAAC2VuZEJsb2NrS2V5AgAAAApfZW5kQmxvY2tfAAAAAAhpbWFnZUtleQIAAAAHX2ltYWdlXwAAAAAIb3duZXJLZXkCAAAAB19vd25lcl8AAAAABnVybEtleQIAAAAFX3VybF8AAAAACmhhcmRDYXBLZXkCAAAACV9oYXJkQ2FwXwAAAAAIdGl0bGVLZXkCAAAAB190aXRsZV8AAAAAE3NoYXJlSG9sZGVyQ291bnRLZXkCAAAAEl9zaGFyZ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AAAAAIFAAAACnBheW1lbnRLZXkFAAAAD3RvdGFsUGF5bWVudEtleQkAAaQAAAABBQAAAAdldmVudElkCQAAZAAAAAIFAAAADHRvdGFsUGF5bWVudAUAAAANcGF5bWVudEFtb3VudAkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgUAAAAKcGF5bWVudEtleQUAAAAQd2FsbGV0UGF5bWVudEtleQUAAAAKY3VycmVudEtleQkAAaQAAAABBQAAAAdldmVudElkCQAAZAAAAAIFAAAADXdhbGxldFBheW1lbnQFAAAADXBheW1lbnRBbW91bnQFAAAAA25pbAAAAAFpAQAAAAVjbGFpbQAAAAAJAAACAAAAAQIAAAAgZXZlbnQgb3duZXIgd2lsbCBjbGFpbSB0aGUgbW9uZXkAAAABaQEAAAAGcmVmdW5kAAAAAAkAAAIAAAABAgAAACJpZiBub3Qgc3VjY2VzcyBwYXllcnMgZ29ubmEgcmVmdW5kAAAAAWkBAAAABmRlbGV0ZQAAAAEAAAADa2V5AwkAAAAAAAACCAUAAAABaQAAAA9jYWxsZXJQdWJsaWNLZXkFAAAABmFkbVB1YgkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAANrZXkFAAAAA25pbAkAAAIAAAABAgAAAB95b3UgYXJlIG5vdCBhbGxvd2VkIHRvIGRvIHRoaXMhAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmXrCQs", "height": 2371412, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: AApqRyrQSF48dUxEgMy55suavF82ipXJAGmNo3ngKDxp Next: HwPhrikPUtUfax3gB9BHYtFhfLhfHFmR5cNgVz6yhtnE Diff:
OldNewDifferences
7979 let totalPayment = valueOrElse(getInteger(this, ((paymentKey + totalPaymentKey) + toString(eventId))), 0)
8080 let walletPayment = valueOrElse(getInteger(this, (((paymentKey + walletPaymentKey) + currentKey) + toString(eventId))), 0)
8181 let shareHolderCount = valueOrElse(getInteger(this, ((paymentKey + shareHolderCountKey) + toString(eventId))), 0)
82- if ((height > startBlock))
82+ if ((startBlock > height))
8383 then throw("crowdfunding not started")
84- else if ((endBlock >= height))
84+ else if ((height >= endBlock))
8585 then throw("crowdfunding is over")
8686 else if ((totalPayment >= hardCap))
8787 then throw("crowdfunding is reached to hard cap. thank you for participating!")
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let admPub = base58'E5xdZLn3yHKAn29pTyubhr9R1mkRGg9WKAcpPrCYFYHx'
55
66 let paymentAsset = base58'3Eh6z6z6ouFpWxGKrPaPnZwmDnDjgYHV6tqCmZf2G7tk'
77
88 let eventKey = "_event_"
99
1010 let paymentKey = "_p_"
1111
1212 let globalEventIdKey = "_eventId_"
1313
1414 let startBlockKey = "_startBlock_"
1515
1616 let endBlockKey = "_endBlock_"
1717
1818 let imageKey = "_image_"
1919
2020 let ownerKey = "_owner_"
2121
2222 let urlKey = "_url_"
2323
2424 let hardCapKey = "_hardCap_"
2525
2626 let titleKey = "_title_"
2727
2828 let shareHolderCountKey = "_shareHolderCount_"
2929
3030 let totalPaymentKey = "_totalPayment_"
3131
3232 let walletPaymentKey = "_walletPayment_"
3333
3434 func isPaymentOk (i) = {
3535 let acceptableAssetId = paymentAsset
3636 if ((size(i.payments) == 0))
3737 then throw("Payment not attached")
3838 else {
3939 let p = i.payments[0]
4040 match p.assetId {
4141 case assetId: ByteVector =>
4242 if ((assetId == acceptableAssetId))
4343 then (p.amount > 0)
4444 else false
4545 case _ =>
4646 throw("Wrong payment asset")
4747 }
4848 }
4949 }
5050
5151
5252 @Callable(i)
5353 func shutdown () = throw("shutdown")
5454
5555
5656
5757 @Callable(i)
5858 func settings () = throw("settings")
5959
6060
6161
6262 @Callable(i)
6363 func create (title,image,owner,startBlock,endBlock,url,hardCap) = {
6464 let eventId = valueOrElse(getInteger(this, globalEventIdKey), 0)
6565 let increaseEventId = (eventId + 1)
6666 if ((i.callerPublicKey == admPub))
6767 then [StringEntry(((eventKey + imageKey) + toString(increaseEventId)), image), StringEntry(((eventKey + ownerKey) + toString(increaseEventId)), owner), StringEntry(((eventKey + titleKey) + toString(increaseEventId)), title), IntegerEntry(((eventKey + startBlockKey) + toString(increaseEventId)), startBlock), IntegerEntry(((eventKey + endBlockKey) + toString(increaseEventId)), endBlock), StringEntry(((eventKey + urlKey) + toString(increaseEventId)), url), IntegerEntry(((eventKey + hardCapKey) + toString(increaseEventId)), hardCap), IntegerEntry((eventKey + globalEventIdKey), increaseEventId)]
6868 else throw("you are not allowed")
6969 }
7070
7171
7272
7373 @Callable(i)
7474 func funding (eventId) = {
7575 let startBlock = valueOrErrorMessage(getInteger(this, ((eventKey + startBlockKey) + toString(eventId))), "err")
7676 let endBlock = valueOrErrorMessage(getInteger(this, ((eventKey + endBlockKey) + toString(eventId))), "err")
7777 let hardCap = valueOrErrorMessage(getInteger(this, ((eventKey + hardCapKey) + toString(eventId))), "err")
7878 let currentKey = toBase58String(i.caller.bytes)
7979 let totalPayment = valueOrElse(getInteger(this, ((paymentKey + totalPaymentKey) + toString(eventId))), 0)
8080 let walletPayment = valueOrElse(getInteger(this, (((paymentKey + walletPaymentKey) + currentKey) + toString(eventId))), 0)
8181 let shareHolderCount = valueOrElse(getInteger(this, ((paymentKey + shareHolderCountKey) + toString(eventId))), 0)
82- if ((height > startBlock))
82+ if ((startBlock > height))
8383 then throw("crowdfunding not started")
84- else if ((endBlock >= height))
84+ else if ((height >= endBlock))
8585 then throw("crowdfunding is over")
8686 else if ((totalPayment >= hardCap))
8787 then throw("crowdfunding is reached to hard cap. thank you for participating!")
8888 else if (!(isPaymentOk(i)))
8989 then throw("you have to attach payment greater than zero")
9090 else {
9191 let p = i.payments[0]
9292 let paymentAmount = p.amount
9393 [IntegerEntry(((paymentKey + shareHolderCountKey) + toString(eventId)), (shareHolderCount + 1)), IntegerEntry(((paymentKey + totalPaymentKey) + toString(eventId)), (totalPayment + paymentAmount)), IntegerEntry((((paymentKey + walletPaymentKey) + currentKey) + toString(eventId)), (walletPayment + paymentAmount))]
9494 }
9595 }
9696
9797
9898
9999 @Callable(i)
100100 func claim () = throw("event owner will claim the money")
101101
102102
103103
104104 @Callable(i)
105105 func refund () = throw("if not success payers gonna refund")
106106
107107
108108
109109 @Callable(i)
110110 func delete (key) = if ((i.callerPublicKey == admPub))
111111 then [DeleteEntry(key)]
112112 else throw("you are not allowed to do this!")
113113
114114
115115 @Verifier(tx)
116116 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
117117

github/deemru/w8io/026f985 
37.64 ms