tx · DEUKcbLkN4CKKaMFfogjf6ZuMNfBnbGLsZqVDNQoxSwT 3Mzms5gHUDYufDRjSVN7g9DcCMG77pzFN4h: -0.01400000 Waves 2021.10.07 15:09 [1735794] smart account 3Mzms5gHUDYufDRjSVN7g9DcCMG77pzFN4h > SELF 0.00000000 Waves
{ "type": 13, "id": "DEUKcbLkN4CKKaMFfogjf6ZuMNfBnbGLsZqVDNQoxSwT", "fee": 1400000, "feeAssetId": null, "timestamp": 1633608616853, "version": 2, "chainId": 84, "sender": "3Mzms5gHUDYufDRjSVN7g9DcCMG77pzFN4h", "senderPublicKey": "CU8dJ2mJQjVBWaDHwXjPztuVdy9XAyAnTuqSCKuNPARn", "proofs": [ "2dchRCBTP2SoAZkrki8mJi4csagFVXiCJtLtWcEesD7GfjYCBmUKARMVaAE1Vuu2MAMfcTJTCEiyuc1LGYPKTAgw" ], "script": "base64:AAIFAAAAAAAAAB0IAhIDCgEBEgASBwoFCAgICAgSBAoCCAgSAwoBCAAAAA0AAAAAD3N0b3JhZ2VWZXJpZmllcgkBAAAABXZhbHVlAAAAAQkABCYAAAABAgAAACMzTjJzNVJ0YUhQQmVuQ3N4MkVDY29GUmJZSHgzbm9aaFhXMQAAAAAJc2lnbkFkbWluAgAAACMzTjF3UGdIRnRlem1SVkJhcW9valA4WEp3VGthcms0aGJpZgAAAAAIZmVlQWRtaW4CAAAAIzNNdnVqVVpUdG9BTlJ6cktZS3p4OTlWdGI5VFVoNlZQQ0RtAAAAAARiYW5rAgAAACMzTjFFNnRYZGRSb1ZhUmZROWRRM3ZnNUxhVzJmc2Q4SEt1YgAAAAANYWNjZXB0ZWRUb2tlbgEAAAAgYfHkwqhFFD81I1SLw0GO/ozjwqWx6THXqSKcOOhu9fcAAAAAD2FjY2VwdGVkRGVjaW1hbAAAAAAABfXhAAAAAAAIc3dvcERhcHAJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQIAAAAjM04yMlN2dEJ3ZkdjMUJ3RXJYNVlReDNXemFj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AAAAHbmV3SnNvbgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAAAhjcmVkaXRzXwkAAlgAAAABBQAAAA1hY2NlcHRlZFRva2VuCQAAZQAAAAIFAAAAD2RhcHBTSUdOQ3JlZGl0cwAAAAAAAAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAARiYW5rBQAAAAZhbW91bnQIBQAAAAdwYXltZW50AAAAB2Fzc2V0SWQFAAAAA25pbAAAAAFpAQAAAAtkZWxldGVFbnRyeQAAAAEAAAAFZW50cnkEAAAABmNhbGxlcgkABCUAAAABCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABCAUAAAABaQAAAA9jYWxsZXJQdWJsaWNLZXkDCQAAAAAAAAIFAAAABmNhbGxlcgUAAAAJc2lnbkFkbWluCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAABWVudHJ5BQAAAANuaWwJAAACAAAAAQIAAAACbm8AAAAAIoSDzA==", "height": 1735794, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9Wv9D5d2aEHBpF7yKVNatdGmKyaU4cx4vmWkxMb2tbuV Next: EJAMxvYSEPQu1rXcxmDiX1vjzZGPEKHYmLjB4TsCSMb1 Diff:
Old | New | Differences | |
---|---|---|---|
71 | 71 | let newCreditsAmount = (numCredit + currentCreditsAmount) | |
72 | 72 | if ((0 >= numCredit)) | |
73 | 73 | then throw("Not enough for at least 1 credit") | |
74 | - | else [IntegerEntry(("credits_" + toBase58String(acceptedToken)), newCreditsAmount), ScriptTransfer(addressFromStringValue(signDapp), (amount - extraSign), payment.assetId), ScriptTransfer(addressFromStringValue(callerAddress), extraSign, payment.assetId)] | |
74 | + | else [IntegerEntry(("credits_" + toBase58String(acceptedToken)), newCreditsAmount), ScriptTransfer(addressFromStringValue(signDapp), (amount - (extraSign * acceptedDecimal)), payment.assetId), ScriptTransfer(addressFromStringValue(callerAddress), extraSign, payment.assetId)] | |
75 | 75 | } | |
76 | 76 | } | |
77 | 77 |
Old | New | Differences | |
---|---|---|---|
1 | 1 | {-# STDLIB_VERSION 5 #-} | |
2 | 2 | {-# SCRIPT_TYPE ACCOUNT #-} | |
3 | 3 | {-# CONTENT_TYPE DAPP #-} | |
4 | 4 | let storageVerifier = value(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1")) | |
5 | 5 | ||
6 | 6 | let signAdmin = "3N1wPgHFtezmRVBaqoojP8XJwTkark4hbif" | |
7 | 7 | ||
8 | 8 | let feeAdmin = "3MvujUZTtoANRzrKYKzx99Vtb9TUh6VPCDm" | |
9 | 9 | ||
10 | 10 | let bank = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub" | |
11 | 11 | ||
12 | 12 | let acceptedToken = base58'7bLUm2XNLWvVwgC9aPp9fNNAMVtbGwhwkqdgomJAgVbC' | |
13 | 13 | ||
14 | 14 | let acceptedDecimal = 100000000 | |
15 | 15 | ||
16 | 16 | let swopDapp = value(addressFromString("3N22SvtBwfGc1BwErX5YQx3WzacDicfMpLr")) | |
17 | 17 | ||
18 | 18 | let signToken = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a' | |
19 | 19 | ||
20 | 20 | let usdnID = "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC" | |
21 | 21 | ||
22 | 22 | let signDapp = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub" | |
23 | 23 | ||
24 | 24 | func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0) | |
25 | 25 | ||
26 | 26 | ||
27 | 27 | func checkEntry (prefix,uuid) = match getString(this, (prefix + uuid)) { | |
28 | 28 | case a: String => | |
29 | 29 | a | |
30 | 30 | case _ => | |
31 | 31 | "NONE" | |
32 | 32 | } | |
33 | 33 | ||
34 | 34 | ||
35 | 35 | func checkUUID (uuid) = match getString(this, uuid) { | |
36 | 36 | case a: String => | |
37 | 37 | a | |
38 | 38 | case _ => | |
39 | 39 | "NONE" | |
40 | 40 | } | |
41 | 41 | ||
42 | 42 | ||
43 | 43 | @Callable(i) | |
44 | 44 | func setFee (fee) = { | |
45 | 45 | let callerAddress = toBase58String(i.caller.bytes) | |
46 | 46 | if ((callerAddress == feeAdmin)) | |
47 | 47 | then [IntegerEntry(("certification_fee_" + toBase58String(acceptedToken)), fee)] | |
48 | 48 | else throw("You are not allowed to change fee") | |
49 | 49 | } | |
50 | 50 | ||
51 | 51 | ||
52 | 52 | ||
53 | 53 | @Callable(i) | |
54 | 54 | func refillCredits () = { | |
55 | 55 | let callerAddress = toBase58String(i.caller.bytes) | |
56 | 56 | let payment = value(i.payments[0]) | |
57 | 57 | let amount = value(payment.amount) | |
58 | 58 | let paymentAssetId = if (isDefined(payment.assetId)) | |
59 | 59 | then value(payment.assetId) | |
60 | 60 | else throw("Accept SIGN token only") | |
61 | 61 | if ((signToken != paymentAssetId)) | |
62 | 62 | then throw("Accept SIGN token only") | |
63 | 63 | else { | |
64 | 64 | let AassetBalanceSwop = getIntegerValue(swopDapp, "A_asset_balance") | |
65 | 65 | let BassetBalanceSwop = getIntegerValue(swopDapp, "B_asset_balance") | |
66 | 66 | let oneDollarInSign = (AassetBalanceSwop / (BassetBalanceSwop * 100)) | |
67 | 67 | let halfDollarInSign = (oneDollarInSign / 2) | |
68 | 68 | let numCredit = ((amount / acceptedDecimal) / halfDollarInSign) | |
69 | 69 | let extraSign = ((amount / acceptedDecimal) - (numCredit * halfDollarInSign)) | |
70 | 70 | let currentCreditsAmount = getIntegerByKey(("credits_" + toBase58String(acceptedToken))) | |
71 | 71 | let newCreditsAmount = (numCredit + currentCreditsAmount) | |
72 | 72 | if ((0 >= numCredit)) | |
73 | 73 | then throw("Not enough for at least 1 credit") | |
74 | - | else [IntegerEntry(("credits_" + toBase58String(acceptedToken)), newCreditsAmount), ScriptTransfer(addressFromStringValue(signDapp), (amount - extraSign), payment.assetId), ScriptTransfer(addressFromStringValue(callerAddress), extraSign, payment.assetId)] | |
74 | + | else [IntegerEntry(("credits_" + toBase58String(acceptedToken)), newCreditsAmount), ScriptTransfer(addressFromStringValue(signDapp), (amount - (extraSign * acceptedDecimal)), payment.assetId), ScriptTransfer(addressFromStringValue(callerAddress), extraSign, payment.assetId)] | |
75 | 75 | } | |
76 | 76 | } | |
77 | 77 | ||
78 | 78 | ||
79 | 79 | ||
80 | 80 | @Callable(invoke) | |
81 | 81 | func fileCertification (hash,title,uuid,ipfs,signerPubKey) = { | |
82 | 82 | let id = value(invoke.transactionId) | |
83 | 83 | let entryExist = checkEntry(hash, uuid) | |
84 | 84 | let uuidExist = checkUUID(uuid) | |
85 | 85 | let callerAddress = toBase58String(invoke.caller.bytes) | |
86 | 86 | if ((entryExist != "NONE")) | |
87 | 87 | then throw("This entry already exist") | |
88 | 88 | else if ((uuidExist != "NONE")) | |
89 | 89 | then throw("This uuid already exist") | |
90 | 90 | else if ((size(uuid) != 36)) | |
91 | 91 | then throw("Uuid should be 36 characters.") | |
92 | 92 | else if ((size(hash) != 64)) | |
93 | 93 | then throw("Hash should be 64 characters.") | |
94 | 94 | else if ((size(title) > 100)) | |
95 | 95 | then throw("Title is too long, 100 characters max.") | |
96 | 96 | else if (if (if (contains(hash, "\"")) | |
97 | 97 | then true | |
98 | 98 | else contains(title, "\"")) | |
99 | 99 | then true | |
100 | 100 | else contains(ipfs, "\"")) | |
101 | 101 | then throw("No \" allowed") | |
102 | 102 | else { | |
103 | 103 | let data = (((((((("{\"hash\":\"" + hash) + "\",\"timestamp\":") + toString(lastBlock.timestamp)) + ",\"title\":\"") + title) + "\",\"ipfs\":\"") + ipfs) + "\"}") | |
104 | 104 | let payment = value(invoke.payments[0]) | |
105 | 105 | let amount = value(payment.amount) | |
106 | 106 | let paymentAssetId = if (isDefined(payment.assetId)) | |
107 | 107 | then value(payment.assetId) | |
108 | 108 | else throw("Waves is not accepted as payment") | |
109 | 109 | let currentPrice = getIntegerValue(this, ("certification_fee_" + toBase58String(value(paymentAssetId)))) | |
110 | 110 | let dappSIGNCredits = getIntegerByKey(("credits_" + toBase58String(acceptedToken))) | |
111 | 111 | if ((0 >= dappSIGNCredits)) | |
112 | 112 | then throw("Not enough credit on the dapp, please refill") | |
113 | 113 | else if ((acceptedToken != paymentAssetId)) | |
114 | 114 | then throw("This token is not accepted at the moment") | |
115 | 115 | else if ((amount != currentPrice)) | |
116 | 116 | then throw("The price is wrong") | |
117 | 117 | else [StringEntry(uuid, toBase58String(id)), StringEntry((hash + uuid), toBase58String(id)), StringEntry((title + uuid), toBase58String(id)), StringEntry(((("data_fc_" + toBase58String(id)) + "_") + callerAddress), data), IntegerEntry(("credits_" + toBase58String(acceptedToken)), (dappSIGNCredits - 1)), ScriptTransfer(addressFromStringValue(bank), amount, payment.assetId)] | |
118 | 118 | } | |
119 | 119 | } | |
120 | 120 | ||
121 | 121 | ||
122 | 122 | ||
123 | 123 | @Callable(invoke) | |
124 | 124 | func revokeCertification (certificationId,signerPubKey) = { | |
125 | 125 | let id = value(invoke.transactionId) | |
126 | 126 | let callerAddress = toBase58String(invoke.caller.bytes) | |
127 | 127 | let entryExist = match getString(this, ((("data_fc_" + certificationId) + "_") + callerAddress)) { | |
128 | 128 | case a: String => | |
129 | 129 | a | |
130 | 130 | case _ => | |
131 | 131 | "NONE" | |
132 | 132 | } | |
133 | 133 | let isRevoked = match getString(this, ("STATUS_FC_" + certificationId)) { | |
134 | 134 | case a: String => | |
135 | 135 | a | |
136 | 136 | case _ => | |
137 | 137 | "NONE" | |
138 | 138 | } | |
139 | 139 | let newJson = (((dropRight(entryExist, 1) + ",\"status\":\"REVOKED_") + toBase58String(id)) + "\"}") | |
140 | 140 | if ((isRevoked != "NONE")) | |
141 | 141 | then throw("This certification have already been revoked.") | |
142 | 142 | else if ((entryExist == "NONE")) | |
143 | 143 | then throw("You cannot change the status of this certification.") | |
144 | 144 | else { | |
145 | 145 | let payment = value(invoke.payments[0]) | |
146 | 146 | let amount = value(payment.amount) | |
147 | 147 | let paymentAssetId = if (isDefined(payment.assetId)) | |
148 | 148 | then value(payment.assetId) | |
149 | 149 | else throw("Waves is not accepted as payment") | |
150 | 150 | let currentPrice = getIntegerValue(this, ("certification_fee_" + toBase58String(value(paymentAssetId)))) | |
151 | 151 | let dappSIGNCredits = getIntegerValue(this, ("credits_" + toBase58String(acceptedToken))) | |
152 | 152 | if ((0 >= dappSIGNCredits)) | |
153 | 153 | then throw("Not enough credit on the dapp, please refill") | |
154 | 154 | else if ((acceptedToken != paymentAssetId)) | |
155 | 155 | then throw("This token is not accepted at the moment") | |
156 | 156 | else if ((amount != currentPrice)) | |
157 | 157 | then throw("The price is wrong") | |
158 | 158 | else [StringEntry(("STATUS_FC_" + certificationId), ("REVOKED_" + toBase58String(id))), StringEntry(((("data_fc_" + certificationId) + "_") + callerAddress), newJson), IntegerEntry(("credits_" + toBase58String(acceptedToken)), (dappSIGNCredits - 1)), ScriptTransfer(addressFromStringValue(bank), amount, payment.assetId)] | |
159 | 159 | } | |
160 | 160 | } | |
161 | 161 | ||
162 | 162 | ||
163 | 163 | ||
164 | 164 | @Callable(i) | |
165 | 165 | func deleteEntry (entry) = { | |
166 | 166 | let caller = toString(addressFromPublicKey(i.callerPublicKey)) | |
167 | 167 | if ((caller == signAdmin)) | |
168 | 168 | then [DeleteEntry(entry)] | |
169 | 169 | else throw("no") | |
170 | 170 | } | |
171 | 171 | ||
172 | 172 |
github/deemru/w8io/169f3d6 59.98 ms ◑