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/ozjwqWx6THXqSKcOOhu9fcAAAAAD2FjY2VwdGVkRGVjaW1hbAAAAAAABfXhAAAAAAAIc3dvcERhcHAJAQAAAAV2YWx1ZQAAAAEJAAQmAAAAAQIAAAAjM04yMlN2dEJ3ZkdjMUJ3RXJYNVlReDNXemF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UAAAAHbmV3SnNvbgkABEwAAAACCQEAAAAMSW50ZWdlckVudHJ5AAAAAgkAASwAAAACAgAAAAhjcmVkaXRzXwkAAlgAAAABBQAAAA1hY2NlcHRlZFRva2VuCQAAZQAAAAIFAAAAD2RhcHBTSUdOQ3JlZGl0cwAAAAAAAAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAARQGV4dHJOYXRpdmUoMTA2MikAAAABBQAAAARiYW5rBQAAAAZhbW91bnQIBQAAAAdwYXltZW50AAAAB2Fzc2V0SWQFAAAAA25pbAAAAAFpAQAAAAtkZWxldGVFbnRyeQAAAAEAAAAFZW50cnkEAAAABmNhbGxlcgkABCUAAAABCQEAAAAUYWRkcmVzc0Zyb21QdWJsaWNLZXkAAAABCAUAAAABaQAAAA9jYWxsZXJQdWJsaWNLZXkDCQAAAAAAAAIFAAAABmNhbGxlcgUAAAAJc2lnbkFkbWluCQAETAAAAAIJAQAAAAtEZWxldGVFbnRyeQAAAAEFAAAABWVudHJ5BQAAAANuaWwJAAACAAAAAQIAAAACbm8AAAAAIoSDzA==", "height": 1735794, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: 9Wv9D5d2aEHBpF7yKVNatdGmKyaU4cx4vmWkxMb2tbuV Next: EJAMxvYSEPQu1rXcxmDiX1vjzZGPEKHYmLjB4TsCSMb1 Diff:
OldNewDifferences
7171 let newCreditsAmount = (numCredit + currentCreditsAmount)
7272 if ((0 >= numCredit))
7373 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)]
7575 }
7676 }
7777
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 acceptedToken = base58'7bLUm2XNLWvVwgC9aPp9fNNAMVtbGwhwkqdgomJAgVbC'
1313
1414 let acceptedDecimal = 100000000
1515
1616 let swopDapp = value(addressFromString("3N22SvtBwfGc1BwErX5YQx3WzacDicfMpLr"))
1717
1818 let signToken = base58'Gf9t8FA4H3ssoZPCwrg3KwUFCci8zuUFP9ssRsUY3s6a'
1919
2020 let usdnID = "3KFXBGGLCjA5Z2DuW4Dq9fDDrHjJJP1ZEkaoajSzuKsC"
2121
2222 let signDapp = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub"
2323
2424 func getIntegerByKey (key) = valueOrElse(getInteger(this, key), 0)
2525
2626
2727 func checkEntry (prefix,uuid) = match getString(this, (prefix + uuid)) {
2828 case a: String =>
2929 a
3030 case _ =>
3131 "NONE"
3232 }
3333
3434
3535 func checkUUID (uuid) = match getString(this, uuid) {
3636 case a: String =>
3737 a
3838 case _ =>
3939 "NONE"
4040 }
4141
4242
4343 @Callable(i)
4444 func setFee (fee) = {
4545 let callerAddress = toBase58String(i.caller.bytes)
4646 if ((callerAddress == feeAdmin))
4747 then [IntegerEntry(("certification_fee_" + toBase58String(acceptedToken)), fee)]
4848 else throw("You are not allowed to change fee")
4949 }
5050
5151
5252
5353 @Callable(i)
5454 func refillCredits () = {
5555 let callerAddress = toBase58String(i.caller.bytes)
5656 let payment = value(i.payments[0])
5757 let amount = value(payment.amount)
5858 let paymentAssetId = if (isDefined(payment.assetId))
5959 then value(payment.assetId)
6060 else throw("Accept SIGN token only")
6161 if ((signToken != paymentAssetId))
6262 then throw("Accept SIGN token only")
6363 else {
6464 let AassetBalanceSwop = getIntegerValue(swopDapp, "A_asset_balance")
6565 let BassetBalanceSwop = getIntegerValue(swopDapp, "B_asset_balance")
6666 let oneDollarInSign = (AassetBalanceSwop / (BassetBalanceSwop * 100))
6767 let halfDollarInSign = (oneDollarInSign / 2)
6868 let numCredit = ((amount / acceptedDecimal) / halfDollarInSign)
6969 let extraSign = ((amount / acceptedDecimal) - (numCredit * halfDollarInSign))
7070 let currentCreditsAmount = getIntegerByKey(("credits_" + toBase58String(acceptedToken)))
7171 let newCreditsAmount = (numCredit + currentCreditsAmount)
7272 if ((0 >= numCredit))
7373 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)]
7575 }
7676 }
7777
7878
7979
8080 @Callable(invoke)
8181 func fileCertification (hash,title,uuid,ipfs,signerPubKey) = {
8282 let id = value(invoke.transactionId)
8383 let entryExist = checkEntry(hash, uuid)
8484 let uuidExist = checkUUID(uuid)
8585 let callerAddress = toBase58String(invoke.caller.bytes)
8686 if ((entryExist != "NONE"))
8787 then throw("This entry already exist")
8888 else if ((uuidExist != "NONE"))
8989 then throw("This uuid already exist")
9090 else if ((size(uuid) != 36))
9191 then throw("Uuid should be 36 characters.")
9292 else if ((size(hash) != 64))
9393 then throw("Hash should be 64 characters.")
9494 else if ((size(title) > 100))
9595 then throw("Title is too long, 100 characters max.")
9696 else if (if (if (contains(hash, "\""))
9797 then true
9898 else contains(title, "\""))
9999 then true
100100 else contains(ipfs, "\""))
101101 then throw("No \" allowed")
102102 else {
103103 let data = (((((((("{\"hash\":\"" + hash) + "\",\"timestamp\":") + toString(lastBlock.timestamp)) + ",\"title\":\"") + title) + "\",\"ipfs\":\"") + ipfs) + "\"}")
104104 let payment = value(invoke.payments[0])
105105 let amount = value(payment.amount)
106106 let paymentAssetId = if (isDefined(payment.assetId))
107107 then value(payment.assetId)
108108 else throw("Waves is not accepted as payment")
109109 let currentPrice = getIntegerValue(this, ("certification_fee_" + toBase58String(value(paymentAssetId))))
110110 let dappSIGNCredits = getIntegerByKey(("credits_" + toBase58String(acceptedToken)))
111111 if ((0 >= dappSIGNCredits))
112112 then throw("Not enough credit on the dapp, please refill")
113113 else if ((acceptedToken != paymentAssetId))
114114 then throw("This token is not accepted at the moment")
115115 else if ((amount != currentPrice))
116116 then throw("The price is wrong")
117117 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)]
118118 }
119119 }
120120
121121
122122
123123 @Callable(invoke)
124124 func revokeCertification (certificationId,signerPubKey) = {
125125 let id = value(invoke.transactionId)
126126 let callerAddress = toBase58String(invoke.caller.bytes)
127127 let entryExist = match getString(this, ((("data_fc_" + certificationId) + "_") + callerAddress)) {
128128 case a: String =>
129129 a
130130 case _ =>
131131 "NONE"
132132 }
133133 let isRevoked = match getString(this, ("STATUS_FC_" + certificationId)) {
134134 case a: String =>
135135 a
136136 case _ =>
137137 "NONE"
138138 }
139139 let newJson = (((dropRight(entryExist, 1) + ",\"status\":\"REVOKED_") + toBase58String(id)) + "\"}")
140140 if ((isRevoked != "NONE"))
141141 then throw("This certification have already been revoked.")
142142 else if ((entryExist == "NONE"))
143143 then throw("You cannot change the status of this certification.")
144144 else {
145145 let payment = value(invoke.payments[0])
146146 let amount = value(payment.amount)
147147 let paymentAssetId = if (isDefined(payment.assetId))
148148 then value(payment.assetId)
149149 else throw("Waves is not accepted as payment")
150150 let currentPrice = getIntegerValue(this, ("certification_fee_" + toBase58String(value(paymentAssetId))))
151151 let dappSIGNCredits = getIntegerValue(this, ("credits_" + toBase58String(acceptedToken)))
152152 if ((0 >= dappSIGNCredits))
153153 then throw("Not enough credit on the dapp, please refill")
154154 else if ((acceptedToken != paymentAssetId))
155155 then throw("This token is not accepted at the moment")
156156 else if ((amount != currentPrice))
157157 then throw("The price is wrong")
158158 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)]
159159 }
160160 }
161161
162162
163163
164164 @Callable(i)
165165 func deleteEntry (entry) = {
166166 let caller = toString(addressFromPublicKey(i.callerPublicKey))
167167 if ((caller == signAdmin))
168168 then [DeleteEntry(entry)]
169169 else throw("no")
170170 }
171171
172172

github/deemru/w8io/169f3d6 
59.98 ms