tx · 7srB7U6HqSQxfWUntRRfSByRCBj2YzuH5o989GiTq4ib 3MyLnBsVm9pw43K9eba5UExxb3efeai91KP: -0.01000000 Waves 2022.12.23 09:50 [2372595] smart account 3MyLnBsVm9pw43K9eba5UExxb3efeai91KP > SELF 0.00000000 Waves
{ "type": 13, "id": "7srB7U6HqSQxfWUntRRfSByRCBj2YzuH5o989GiTq4ib", "fee": 1000000, "feeAssetId": null, "timestamp": 1671778224780, "version": 2, "chainId": 84, "sender": "3MyLnBsVm9pw43K9eba5UExxb3efeai91KP", "senderPublicKey": "E5xdZLn3yHKAn29pTyubhr9R1mkRGg9WKAcpPrCYFYHx", "proofs": [ "3xemRrACz2FpnA9dS4kdt9NcPa7Nr9zT7q6gJGjgVcSR5q4DJNeFPsJhAngSBLePin63S2peARDDjc9TtFfZtxzo" ], "script": "base64:AAIFAAAAAAAAACQIAhIDCgEEEgASCQoHCAgIAQEIARIDCgEBEgASABIAEgMKAQgAAAASAAAAAAZhZG1QdWIBAAAAIMJtJ5gIVkg6lviv0tZrwvjTaMOLo5/FAXzqAhbYtmZzAAAAAAxwYXltZW50QXNzZXQBAAAAICE5ROkpfF/Pivgzkjj1JL6vC/b6udUDj0UtxqhSv/q5AAAAAAZuZnRLZXkCAAAABV9uZnRfAAAAAAtzaHV0RG93bktleQIAAAAKX3NodXREb3duXwAAAAAIZXZlbnRLZXkCAAAAB19ldmVudF8AAAAACnBheW1lbnRLZXkCAAAACV9wYXltZW50XwAAAAAQZ2xvYmFsRXZlbnRJZEtleQIAAAAJX2V2ZW50SWRfAAAAAA1zdGFydEJsb2NrS2V5AgAAAAxfc3RhcnRCbG9ja18AAAAAC2VuZEJsb2NrS2V5AgAAAApfZW5kQmxvY2tfAAAAAAhpbWFnZUtleQIAAAAHX2ltYWdlXwAAAAAIb3duZXJLZXkCAAAAB19vd25lcl8AAAAABnVybEtleQIAAAAFX3VybF8AAAAACmhhcmRDYXBLZXkCAAAACV9oYXJkQ2FwXwAAAAAIdGl0bG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ZSBuZnQAAAABaQEAAAAGcmVmdW5kAAAAAAkAAAIAAAABAgAAACJpZiBub3Qgc3VjY2VzcyBwYXllcnMgZ29ubmEgcmVmdW5kAAAAAWkBAAAABmRlbGV0ZQAAAAEAAAADa2V5AwkAAAAAAAACCAUAAAABaQAAAA9jYWxsZXJQdWJsaWNLZXkFAAAABmFkbVB1YgkABEwAAAACCQEAAAALRGVsZXRlRW50cnkAAAABBQAAAANrZXkFAAAAA25pbAkAAAIAAAABAgAAAB95b3UgYXJlIG5vdCBhbGxvd2VkIHRvIGRvIHRoaXMhAAAAAQAAAAJ0eAEAAAAGdmVyaWZ5AAAAAAkAAfQAAAADCAUAAAACdHgAAAAJYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXkWVCY9", "height": 2372595, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 4cKoVWcMsDZDPCmD7MwkfxAhihTAMXLdNCoow1p7JCvP Next: HFf3tcx8Ast8hnqN3DyBcCygiqQwqrR2pMkZdMktkcXv Diff:
Old | New | Differences | |
---|---|---|---|
113 | 113 | ||
114 | 114 | ||
115 | 115 | @Callable(i) | |
116 | - | func claimShare () = throw(" | |
116 | + | func claimShare () = throw("userwill claim the nft") | |
117 | 117 | ||
118 | 118 | ||
119 | 119 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let admPub = base58'E5xdZLn3yHKAn29pTyubhr9R1mkRGg9WKAcpPrCYFYHx' | |
5 | 5 | ||
6 | 6 | let paymentAsset = base58'3Eh6z6z6ouFpWxGKrPaPnZwmDnDjgYHV6tqCmZf2G7tk' | |
7 | 7 | ||
8 | 8 | let nftKey = "_nft_" | |
9 | 9 | ||
10 | 10 | let shutDownKey = "_shutDown_" | |
11 | 11 | ||
12 | 12 | let eventKey = "_event_" | |
13 | 13 | ||
14 | 14 | let paymentKey = "_payment_" | |
15 | 15 | ||
16 | 16 | let globalEventIdKey = "_eventId_" | |
17 | 17 | ||
18 | 18 | let startBlockKey = "_startBlock_" | |
19 | 19 | ||
20 | 20 | let endBlockKey = "_endBlock_" | |
21 | 21 | ||
22 | 22 | let imageKey = "_image_" | |
23 | 23 | ||
24 | 24 | let ownerKey = "_owner_" | |
25 | 25 | ||
26 | 26 | let urlKey = "_url_" | |
27 | 27 | ||
28 | 28 | let hardCapKey = "_hardCap_" | |
29 | 29 | ||
30 | 30 | let titleKey = "_title_" | |
31 | 31 | ||
32 | 32 | let shareHolderCountKey = "_shareHolderCount_" | |
33 | 33 | ||
34 | 34 | let totalPaymentKey = "_totalPayment_" | |
35 | 35 | ||
36 | 36 | let walletPaymentKey = "_walletPayment_" | |
37 | 37 | ||
38 | 38 | func isPaymentOk (i) = { | |
39 | 39 | let acceptableAssetId = paymentAsset | |
40 | 40 | if ((size(i.payments) == 0)) | |
41 | 41 | then throw("Payment not attached") | |
42 | 42 | else { | |
43 | 43 | let p = i.payments[0] | |
44 | 44 | match p.assetId { | |
45 | 45 | case assetId: ByteVector => | |
46 | 46 | if ((assetId == acceptableAssetId)) | |
47 | 47 | then (p.amount > 0) | |
48 | 48 | else false | |
49 | 49 | case _ => | |
50 | 50 | throw("Wrong payment asset") | |
51 | 51 | } | |
52 | 52 | } | |
53 | 53 | } | |
54 | 54 | ||
55 | 55 | ||
56 | 56 | @Callable(i) | |
57 | 57 | func shutdown (isOpen) = if ((i.callerPublicKey == admPub)) | |
58 | 58 | then [BooleanEntry(shutDownKey, isOpen)] | |
59 | 59 | else throw("you are not allow to do this!") | |
60 | 60 | ||
61 | 61 | ||
62 | 62 | ||
63 | 63 | @Callable(i) | |
64 | 64 | func settings () = throw("settings") | |
65 | 65 | ||
66 | 66 | ||
67 | 67 | ||
68 | 68 | @Callable(i) | |
69 | 69 | func create (title,image,owner,startBlock,endBlock,url,hardCap) = { | |
70 | 70 | let eventId = valueOrElse(getInteger(this, (eventKey + globalEventIdKey)), 0) | |
71 | 71 | let increaseEventId = (eventId + 1) | |
72 | 72 | if ((i.callerPublicKey == admPub)) | |
73 | 73 | 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)] | |
74 | 74 | else throw("you are not allowed") | |
75 | 75 | } | |
76 | 76 | ||
77 | 77 | ||
78 | 78 | ||
79 | 79 | @Callable(i) | |
80 | 80 | func funding (eventId) = { | |
81 | 81 | let startBlock = valueOrErrorMessage(getInteger(this, ((eventKey + startBlockKey) + toString(eventId))), "can not find event 1") | |
82 | 82 | let endBlock = valueOrErrorMessage(getInteger(this, ((eventKey + endBlockKey) + toString(eventId))), "can not find event 2") | |
83 | 83 | let hardCap = valueOrErrorMessage(getInteger(this, ((eventKey + hardCapKey) + toString(eventId))), "can not find event 3") | |
84 | 84 | let currentKey = toBase58String(i.caller.bytes) | |
85 | 85 | let totalPayment = valueOrElse(getInteger(this, ((paymentKey + totalPaymentKey) + toString(eventId))), 0) | |
86 | 86 | let walletPayment = valueOrElse(getInteger(this, (((paymentKey + walletPaymentKey) + currentKey) + toString(eventId))), 0) | |
87 | 87 | let shareHolderCount = valueOrElse(getInteger(this, ((paymentKey + shareHolderCountKey) + toString(eventId))), 0) | |
88 | 88 | if ((height > startBlock)) | |
89 | 89 | then throw("crowdfunding not started") | |
90 | 90 | else if ((endBlock >= height)) | |
91 | 91 | then throw("crowdfunding is over") | |
92 | 92 | else if ((totalPayment >= hardCap)) | |
93 | 93 | then throw("crowdfunding is reached to hard cap. thank you for participating!") | |
94 | 94 | else if (!(isPaymentOk(i))) | |
95 | 95 | then throw("you have to attach payment greater than zero") | |
96 | 96 | else { | |
97 | 97 | let shutDown = valueOrElse(getBoolean(this, shutDownKey), true) | |
98 | 98 | if (!(shutDown)) | |
99 | 99 | then throw("emergency shutdown") | |
100 | 100 | else { | |
101 | 101 | let p = i.payments[0] | |
102 | 102 | let paymentAmount = p.amount | |
103 | 103 | [IntegerEntry(((paymentKey + shareHolderCountKey) + toString(eventId)), (shareHolderCount + 1)), IntegerEntry(((paymentKey + totalPaymentKey) + toString(eventId)), (totalPayment + paymentAmount)), IntegerEntry(((((paymentKey + walletPaymentKey) + currentKey) + "_") + toString(eventId)), (walletPayment + paymentAmount))] | |
104 | 104 | } | |
105 | 105 | } | |
106 | 106 | } | |
107 | 107 | ||
108 | 108 | ||
109 | 109 | ||
110 | 110 | @Callable(i) | |
111 | 111 | func claim () = throw("event owner will claim the money") | |
112 | 112 | ||
113 | 113 | ||
114 | 114 | ||
115 | 115 | @Callable(i) | |
116 | - | func claimShare () = throw(" | |
116 | + | func claimShare () = throw("userwill claim the nft") | |
117 | 117 | ||
118 | 118 | ||
119 | 119 | ||
120 | 120 | @Callable(i) | |
121 | 121 | func refund () = throw("if not success payers gonna refund") | |
122 | 122 | ||
123 | 123 | ||
124 | 124 | ||
125 | 125 | @Callable(i) | |
126 | 126 | func delete (key) = if ((i.callerPublicKey == admPub)) | |
127 | 127 | then [DeleteEntry(key)] | |
128 | 128 | else throw("you are not allowed to do this!") | |
129 | 129 | ||
130 | 130 | ||
131 | 131 | @Verifier(tx) | |
132 | 132 | func verify () = sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) | |
133 | 133 |
github/deemru/w8io/169f3d6 112.29 ms ◑