tx · EhT3Rgri2VSzFHP7qNK6JghJnrAdDGiWdugZLaDpQyY4

3Mzms5gHUDYufDRjSVN7g9DcCMG77pzFN4h:  -0.01400000 Waves

2021.10.05 10:05 [1732599] smart account 3Mzms5gHUDYufDRjSVN7g9DcCMG77pzFN4h > SELF 0.00000000 Waves

{ "type": 13, "id": "EhT3Rgri2VSzFHP7qNK6JghJnrAdDGiWdugZLaDpQyY4", "fee": 1400000, "feeAssetId": null, "timestamp": 1633417562761, "version": 2, "chainId": 84, "sender": "3Mzms5gHUDYufDRjSVN7g9DcCMG77pzFN4h", "senderPublicKey": "CU8dJ2mJQjVBWaDHwXjPztuVdy9XAyAnTuqSCKuNPARn", "proofs": [ "2oJt4Q1QqUdwc3xibuqtMpMqVQpQg2daH3RLFXnEpmx8mic2VwNXb8CMnPu9PG67hGtwMeWPtiJQELBFU3sfbdGg" ], "script": "base64:AAIFAAAAAAAAAB0IAhIDCgEBEgASBwoFCAgICAgSBAoCCAgSAwoBCAAAAAwAAAAAD3N0b3JhZ2VWZXJpZmllcgkBAAAABXZhbHVlAAAAAQkABCYAAAABAgAAACMzTjJzNVJ0YUhQQmVuQ3N4MkVDY29GUmJZSHgzbm9aaFhXMQAAAAAJc2lnbkFkbWluAgAAACMzTjF3UGdIRnRlem1SVkJhcW9valA4WEp3VGthcms0aGJpZgAAAAAIZmVlQWRtaW4CAAAAIzNNdnVqVVpUdG9BTlJ6cktZS3p4OTlWdGI5VFVoNlZQQ0RtAAAAAARiYW5rAgAAACMzTjFFNnRYZGRSb1ZhUmZROWRRM3ZnNUxhVzJmc2Q4SEt1YgAAAAAJc2lnblRva2VuAQAAACDopWq8yndC8nBhMjVKT0WDubke5ZlnF8Nx6tkLoQSt6wAAAAANYWNjZXB0ZWRUb2tlbgEAAAAgYfHkwqhFFD81I1SLw0GO/ozjwqWx6THXqSKcOOhu9fcAAAAAD2FjY2VwdGVkRGVjaW1hbAAAAAAABfXhAAAAAAAGdXNkbklEAgAAACwzS0ZYQkdH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ZWQgYXQgdGhlIG1vbWVudAMJAQAAAAIhPQAAAAIFAAAABmFtb3VudAUAAAAMY3VycmVudFByaWNlCQAAAgAAAAECAAAAElRoZSBwcmljZSBpcyB3cm9uZwkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAICAAAAClNUQVRVU19GQ18FAAAAD2NlcnRpZmljYXRpb25JZAkAASwAAAACAgAAAAhSRVZPS0VEXwkAAlgAAAABBQAAAAJpZAkABEwAAAACCQEAAAALU3RyaW5nRW50cnkAAAACCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAhkYXRhX2ZjXwUAAAAPY2VydGlmaWNhdGlvbklkAgAAAAFfBQAAAA1jYWxsZXJBZGRyZXNzBQAAAAduZXdKc29uCQAETAAAAAIJAQAAAAxJbnRlZ2VyRW50cnkAAAACCQABLAAAAAICAAAACGNyZWRpdHNfCQACWAAAAAEFAAAADWFjY2VwdGVkVG9rZW4JAABlAAAAAgUAAAAPZGFwcFNJR05DcmVkaXRzAAAAAAAAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABFAZXh0ck5hdGl2ZSgxMDYyKQAAAAEFAAAABGJhbmsFAAAABmFtb3VudAgFAAAAB3BheW1lbnQAAAAHYXNzZXRJZAUAAAADbmlsAAAAAWkBAAAAC2RlbGV0ZUVudHJ5AAAAAQAAAAVlbnRyeQQAAAAGY2FsbGVyCQAEJQAAAAEJAQAAABRhZGRyZXNzRnJvbVB1YmxpY0tleQAAAAEIBQAAAAFpAAAAD2NhbGxlclB1YmxpY0tleQMJAAAAAAAAAgUAAAAGY2FsbGVyBQAAAAlzaWduQWRtaW4JAARMAAAAAgkBAAAAC0RlbGV0ZUVudHJ5AAAAAQUAAAAFZW50cnkFAAAAA25pbAkAAAIAAAABAgAAAAJubwAAAAAiYz9O", "height": 1732599, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 43GMwisvVSbmyuE9N5M2VVGzJHBoGHH9Vz7JGN5Qf9xg Next: 9g7kfR8iM2ne6raetFDA8WFvQwfP1TUZTfo5CaZ25tAr Diff:
OldNewDifferences
142142 then value(payment.assetId)
143143 else throw("Waves is not accepted as payment")
144144 let currentPrice = getIntegerValue(this, ("certification_fee_" + toBase58String(value(paymentAssetId))))
145- let dappCredits = getIntegerValue(this, ("credits_" + toBase58String(acceptedToken)))
146- if ((0 >= dappCredits))
145+ let dappSIGNCredits = getIntegerValue(this, ("credits_" + toBase58String(acceptedToken)))
146+ if ((0 >= dappSIGNCredits))
147147 then throw("Not enough credit on the dapp, please refill")
148148 else if ((acceptedToken != paymentAssetId))
149149 then throw("This token is not accepted at the moment")
150150 else if ((amount != currentPrice))
151151 then throw("The price is wrong")
152- else [StringEntry(("STATUS_FC_" + certificationId), ("REVOKED_" + toBase58String(id))), StringEntry(((("data_fc_" + certificationId) + "_") + callerAddress), newJson), IntegerEntry(("credits_" + toBase58String(acceptedToken)), (dappCredits - 1)), ScriptTransfer(addressFromStringValue(bank), amount, payment.assetId)]
152+ 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)]
153153 }
154154 }
155155
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 5 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let storageVerifier = value(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1"))
55
66 let signAdmin = "3N1wPgHFtezmRVBaqoojP8XJwTkark4hbif"
77
88 let feeAdmin = "3MvujUZTtoANRzrKYKzx99Vtb9TUh6VPCDm"
99
1010 let bank = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub"
1111
1212 let signToken = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a'
1313
1414 let acceptedToken = base58'7bLUm2XNLWvVwgC9aPp9fNNAMVtbGwhwkqdgomJAgVbC'
1515
1616 let acceptedDecimal = 100000000
1717
1818 let usdnID = "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC"
1919
2020 let signDapp = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub"
2121
2222 func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0)
2323
2424
2525 func checkEntry (prefix,uuid) = match getString(this, (prefix + uuid)) {
2626 case a: String =>
2727 a
2828 case _ =>
2929 "NONE"
3030 }
3131
3232
3333 func checkUUID (uuid) = match getString(this, uuid) {
3434 case a: String =>
3535 a
3636 case _ =>
3737 "NONE"
3838 }
3939
4040
4141 @Callable(i)
4242 func setFee (fee) = {
4343 let callerAddress = toBase58String(i.caller.bytes)
4444 if ((callerAddress == feeAdmin))
4545 then [IntegerEntry(("certification_fee_" + toBase58String(acceptedToken)), fee)]
4646 else throw("You are not allowed to change fee")
4747 }
4848
4949
5050
5151 @Callable(i)
5252 func refillCredits () = {
5353 let callerAddress = toBase58String(i.caller.bytes)
5454 let payment = value(i.payments[0])
5555 let amount = value(payment.amount)
5656 let paymentAssetId = if (isDefined(payment.assetId))
5757 then value(payment.assetId)
5858 else throw("Accept SIGN token only")
5959 if ((signToken != paymentAssetId))
6060 then throw("Accept SIGN token only")
6161 else {
6262 let currentSIGNPrice = getIntegerValue(storageVerifier, ("certification_fee_" + toBase58String(value(paymentAssetId))))
6363 let numCredit = (amount / (currentSIGNPrice / acceptedDecimal))
6464 let currentCreditsAmount = getIntegerByKey(("credits_" + toBase58String(acceptedToken)))
6565 let newCreditsAmount = ((numCredit / acceptedDecimal) + currentCreditsAmount)
6666 if ((0 >= numCredit))
6767 then throw("Not enough for at least 1 credit")
6868 else [IntegerEntry(("credits_" + toBase58String(acceptedToken)), newCreditsAmount), ScriptTransfer(addressFromStringValue(signDapp), amount, payment.assetId)]
6969 }
7070 }
7171
7272
7373
7474 @Callable(invoke)
7575 func fileCertification (hash,title,uuid,ipfs,signerPubKey) = {
7676 let id = value(invoke.transactionId)
7777 let entryExist = checkEntry(hash, uuid)
7878 let uuidExist = checkUUID(uuid)
7979 let callerAddress = toBase58String(invoke.caller.bytes)
8080 if ((entryExist != "NONE"))
8181 then throw("This entry already exist")
8282 else if ((uuidExist != "NONE"))
8383 then throw("This uuid already exist")
8484 else if ((size(uuid) != 36))
8585 then throw("Uuid should be 36 characters.")
8686 else if ((size(hash) != 64))
8787 then throw("Hash should be 64 characters.")
8888 else if ((size(title) > 100))
8989 then throw("Title is too long, 100 characters max.")
9090 else if (if (if (contains(hash, "\""))
9191 then true
9292 else contains(title, "\""))
9393 then true
9494 else contains(ipfs, "\""))
9595 then throw("No \" allowed")
9696 else {
9797 let data = (((((((("{\"hash\":\"" + hash) + "\",\"timestamp\":") + toString(lastBlock.timestamp)) + ",\"title\":\"") + title) + "\",\"ipfs\":\"") + ipfs) + "\"}")
9898 let payment = value(invoke.payments[0])
9999 let amount = value(payment.amount)
100100 let paymentAssetId = if (isDefined(payment.assetId))
101101 then value(payment.assetId)
102102 else throw("Waves is not accepted as payment")
103103 let currentPrice = getIntegerValue(this, ("certification_fee_" + toBase58String(value(paymentAssetId))))
104104 let dappSIGNCredits = getIntegerByKey(("credits_" + toBase58String(acceptedToken)))
105105 if ((0 >= dappSIGNCredits))
106106 then throw("Not enough credit on the dapp, please refill")
107107 else if ((acceptedToken != paymentAssetId))
108108 then throw("This token is not accepted at the moment")
109109 else if ((amount != currentPrice))
110110 then throw("The price is wrong")
111111 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)]
112112 }
113113 }
114114
115115
116116
117117 @Callable(invoke)
118118 func revokeCertification (certificationId,signerPubKey) = {
119119 let id = value(invoke.transactionId)
120120 let callerAddress = toBase58String(invoke.caller.bytes)
121121 let entryExist = match getString(this, ((("data_fc_" + certificationId) + "_") + callerAddress)) {
122122 case a: String =>
123123 a
124124 case _ =>
125125 "NONE"
126126 }
127127 let isRevoked = match getString(this, ("STATUS_FC_" + certificationId)) {
128128 case a: String =>
129129 a
130130 case _ =>
131131 "NONE"
132132 }
133133 let newJson = (((dropRight(entryExist, 1) + ",\"status\":\"REVOKED_") + toBase58String(id)) + "\"}")
134134 if ((isRevoked != "NONE"))
135135 then throw("This certification have already been revoked.")
136136 else if ((entryExist == "NONE"))
137137 then throw("You cannot change the status of this certification.")
138138 else {
139139 let payment = value(invoke.payments[0])
140140 let amount = value(payment.amount)
141141 let paymentAssetId = if (isDefined(payment.assetId))
142142 then value(payment.assetId)
143143 else throw("Waves is not accepted as payment")
144144 let currentPrice = getIntegerValue(this, ("certification_fee_" + toBase58String(value(paymentAssetId))))
145- let dappCredits = getIntegerValue(this, ("credits_" + toBase58String(acceptedToken)))
146- if ((0 >= dappCredits))
145+ let dappSIGNCredits = getIntegerValue(this, ("credits_" + toBase58String(acceptedToken)))
146+ if ((0 >= dappSIGNCredits))
147147 then throw("Not enough credit on the dapp, please refill")
148148 else if ((acceptedToken != paymentAssetId))
149149 then throw("This token is not accepted at the moment")
150150 else if ((amount != currentPrice))
151151 then throw("The price is wrong")
152- else [StringEntry(("STATUS_FC_" + certificationId), ("REVOKED_" + toBase58String(id))), StringEntry(((("data_fc_" + certificationId) + "_") + callerAddress), newJson), IntegerEntry(("credits_" + toBase58String(acceptedToken)), (dappCredits - 1)), ScriptTransfer(addressFromStringValue(bank), amount, payment.assetId)]
152+ 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)]
153153 }
154154 }
155155
156156
157157
158158 @Callable(i)
159159 func deleteEntry (entry) = {
160160 let caller = toString(addressFromPublicKey(i.callerPublicKey))
161161 if ((caller == signAdmin))
162162 then [DeleteEntry(entry)]
163163 else throw("no")
164164 }
165165
166166

github/deemru/w8io/169f3d6 
40.73 ms