tx · CZ8itX1YtgkepHrXNdaTiwCLztwv3ZPYbUueQ84sVijD

3MyLnBsVm9pw43K9eba5UExxb3efeai91KP:  -0.01000000 Waves

2022.12.22 15:47 [2371521] smart account 3MyLnBsVm9pw43K9eba5UExxb3efeai91KP > SELF 0.00000000 Waves

{ "type": 13, "id": "CZ8itX1YtgkepHrXNdaTiwCLztwv3ZPYbUueQ84sVijD", "fee": 1000000, "feeAssetId": null, "timestamp": 1671713266383, "version": 2, "chainId": 84, "sender": "3MyLnBsVm9pw43K9eba5UExxb3efeai91KP", "senderPublicKey": "E5xdZLn3yHKAn29pTyubhr9R1mkRGg9WKAcpPrCYFYHx", "proofs": [ "31morfdVKZFFFTGQ3Lp7fz1tXXogvmmyEBebLGmD7vLD7LqWhXCHsuyChrgHG3uGoAv4AZ8Z3MDYVUTcwbtrQZXv" ], "script": "base64:AAIFAAAAAAAAACIIAhIDCgEEEgASCQoHCAgIAQEIARIDCgEBEgASABIDCgEIAAAAEQAAAAAGYWRtUHViAQAAACDCbSeYCFZIOpb4r9LWa8L402jDi6OfxQF86gIW2LZmcwAAAAAMcGF5bWVudEFzc2V0AQAAACAhOUTpKXxfz4r4M5I49SS+rwv2+rnVA49FLcaoUr/6uQAAAAALc2h1dERvd25LZXkCAAAACl9zaHV0RG93bl8AAAAACGV2ZW50S2V5AgAAAAdfZXZlbnRfAAAAAApwYXltZW50S2V5AgAAAAlfcGF5bWVudF8AAAAAEGdsb2JhbEV2ZW50SWRLZXkCAAAACV9ldmVudElkXwAAAAANc3RhcnRCbG9ja0tleQIAAAAMX3N0YXJ0QmxvY2tfAAAAAAtlbmRCbG9ja0tleQIAAAAKX2VuZEJsb2NrXwAAAAAIaW1hZ2VLZXkCAAAAB19pbWFnZV8AAAAACG93bmVyS2V5AgAAAAdfb3duZXJfAAAAAAZ1cmxLZXkCAAAABV91cmxfAAAAAApoYXJkQ2FwS2V5AgAAAAlfaGFyZENhcF8AAAAACHRpdGxlS2V5AgAAAAdfdGl0bGVf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AAAAAAAAggFAAAAAWkAAAAPY2FsbGVyUHVibGljS2V5BQAAAAZhZG1QdWIJAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAADa2V5BQAAAANuaWwJAAACAAAAAQIAAAAfeW91IGFyZSBub3QgYWxsb3dlZCB0byBkbyB0aGlzIQAAAAEAAAACdHgBAAAABnZlcmlmeQAAAAAJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5o1CYDg==", "height": 2371521, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 8Wcznytk6JB1VENMz98LymQHRiWrcVxJqA3ACvKTC81F Next: Edf3zztHwQbf29tdqpPKTnhCgKeWrVcWfMNUN9PuV62c Diff:
OldNewDifferences
44 let admPub = base58'E5xdZLn3yHKAn29pTyubhr9R1mkRGg9WKAcpPrCYFYHx'
55
66 let paymentAsset = base58'3Eh6z6z6ouFpWxGKrPaPnZwmDnDjgYHV6tqCmZf2G7tk'
7+
8+let shutDownKey = "_shutDown_"
79
810 let eventKey = "_event_"
911
5052
5153
5254 @Callable(i)
53-func shutdown () = throw("shutdown")
55+func shutdown (isOpen) = {
56+ let shutDown = valueOrElse(getBoolean(this, shutDownKey), true)
57+ if ((i.callerPublicKey == admPub))
58+ then [BooleanEntry(shutDownKey, shutDown)]
59+ else throw("you are not allow to do this!")
60+ }
5461
5562
5663
8895 else if (!(isPaymentOk(i)))
8996 then throw("you have to attach payment greater than zero")
9097 else {
91- let p = i.payments[0]
92- let paymentAmount = p.amount
98+ let shutDown = valueOrElse(getBoolean(this, shutDownKey), true)
99+ if (shutDown)
100+ then throw("emergency shutdown")
101+ else {
102+ let p = i.payments[0]
103+ let paymentAmount = p.amount
93104 [IntegerEntry(((paymentKey + shareHolderCountKey) + toString(eventId)), (shareHolderCount + 1)), IntegerEntry(((paymentKey + totalPaymentKey) + toString(eventId)), (totalPayment + paymentAmount)), IntegerEntry(((((paymentKey + walletPaymentKey) + currentKey) + "_") + toString(eventId)), (walletPayment + paymentAmount))]
105+ }
94106 }
95107 }
96108
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'
7+
8+let shutDownKey = "_shutDown_"
79
810 let eventKey = "_event_"
911
1012 let paymentKey = "_payment_"
1113
1214 let globalEventIdKey = "_eventId_"
1315
1416 let startBlockKey = "_startBlock_"
1517
1618 let endBlockKey = "_endBlock_"
1719
1820 let imageKey = "_image_"
1921
2022 let ownerKey = "_owner_"
2123
2224 let urlKey = "_url_"
2325
2426 let hardCapKey = "_hardCap_"
2527
2628 let titleKey = "_title_"
2729
2830 let shareHolderCountKey = "_shareHolderCount_"
2931
3032 let totalPaymentKey = "_totalPayment_"
3133
3234 let walletPaymentKey = "_walletPayment_"
3335
3436 func isPaymentOk (i) = {
3537 let acceptableAssetId = paymentAsset
3638 if ((size(i.payments) == 0))
3739 then throw("Payment not attached")
3840 else {
3941 let p = i.payments[0]
4042 match p.assetId {
4143 case assetId: ByteVector =>
4244 if ((assetId == acceptableAssetId))
4345 then (p.amount > 0)
4446 else false
4547 case _ =>
4648 throw("Wrong payment asset")
4749 }
4850 }
4951 }
5052
5153
5254 @Callable(i)
53-func shutdown () = throw("shutdown")
55+func shutdown (isOpen) = {
56+ let shutDown = valueOrElse(getBoolean(this, shutDownKey), true)
57+ if ((i.callerPublicKey == admPub))
58+ then [BooleanEntry(shutDownKey, shutDown)]
59+ else throw("you are not allow to do this!")
60+ }
5461
5562
5663
5764 @Callable(i)
5865 func settings () = throw("settings")
5966
6067
6168
6269 @Callable(i)
6370 func create (title,image,owner,startBlock,endBlock,url,hardCap) = {
6471 let eventId = valueOrElse(getInteger(this, globalEventIdKey), 0)
6572 let increaseEventId = (eventId + 1)
6673 if ((i.callerPublicKey == admPub))
6774 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)]
6875 else throw("you are not allowed")
6976 }
7077
7178
7279
7380 @Callable(i)
7481 func funding (eventId) = {
7582 let startBlock = valueOrErrorMessage(getInteger(this, ((eventKey + startBlockKey) + toString(eventId))), "err")
7683 let endBlock = valueOrErrorMessage(getInteger(this, ((eventKey + endBlockKey) + toString(eventId))), "err")
7784 let hardCap = valueOrErrorMessage(getInteger(this, ((eventKey + hardCapKey) + toString(eventId))), "err")
7885 let currentKey = toBase58String(i.caller.bytes)
7986 let totalPayment = valueOrElse(getInteger(this, ((paymentKey + totalPaymentKey) + toString(eventId))), 0)
8087 let walletPayment = valueOrElse(getInteger(this, (((paymentKey + walletPaymentKey) + currentKey) + toString(eventId))), 0)
8188 let shareHolderCount = valueOrElse(getInteger(this, ((paymentKey + shareHolderCountKey) + toString(eventId))), 0)
8289 if ((startBlock > height))
8390 then throw("crowdfunding not started")
8491 else if ((height >= endBlock))
8592 then throw("crowdfunding is over")
8693 else if ((totalPayment >= hardCap))
8794 then throw("crowdfunding is reached to hard cap. thank you for participating!")
8895 else if (!(isPaymentOk(i)))
8996 then throw("you have to attach payment greater than zero")
9097 else {
91- let p = i.payments[0]
92- let paymentAmount = p.amount
98+ let shutDown = valueOrElse(getBoolean(this, shutDownKey), true)
99+ if (shutDown)
100+ then throw("emergency shutdown")
101+ else {
102+ let p = i.payments[0]
103+ let paymentAmount = p.amount
93104 [IntegerEntry(((paymentKey + shareHolderCountKey) + toString(eventId)), (shareHolderCount + 1)), IntegerEntry(((paymentKey + totalPaymentKey) + toString(eventId)), (totalPayment + paymentAmount)), IntegerEntry(((((paymentKey + walletPaymentKey) + currentKey) + "_") + toString(eventId)), (walletPayment + paymentAmount))]
105+ }
94106 }
95107 }
96108
97109
98110
99111 @Callable(i)
100112 func claim () = throw("event owner will claim the money")
101113
102114
103115
104116 @Callable(i)
105117 func refund () = throw("if not success payers gonna refund")
106118
107119
108120
109121 @Callable(i)
110122 func delete (key) = if ((i.callerPublicKey == admPub))
111123 then [DeleteEntry(key)]
112124 else throw("you are not allowed to do this!")
113125
114126
115127 @Verifier(tx)
116128 func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
117129

github/deemru/w8io/026f985 
28.81 ms