tx · 9ARKRCdVBTtFf7FnRHKMnRjsYhaQScvgxPN7H8tf95oX

3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB:  -0.01400000 Waves

2020.01.17 07:13 [857668] smart account 3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB > SELF 0.00000000 Waves

{ "type": 13, "id": "9ARKRCdVBTtFf7FnRHKMnRjsYhaQScvgxPN7H8tf95oX", "fee": 1400000, "feeAssetId": null, "timestamp": 1579234393206, "version": 1, "sender": "3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB", "senderPublicKey": "Gd5NihbWQoWuTnSvq25TuV2BYZG4U1e9KDqZn9zBPix7", "proofs": [ "4CLWbLSGiAErLgsDAG8Dz619uXSZHc2MypvBo4segKHTgTf1MxFz47E4xaJP7FKEE5qBCZMgpqkSBg8KEGSuughw" ], "script": "base64:AAIDAAAAAAAAABEIARIGCgQICAgIEgUKAwgICAAAAAIAAAAACHZlcmlmaWVyCQEAAAAHZXh0cmFjdAAAAAEJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAECAAAAIzNOMnM1UnRhSFBCZW5Dc3gyRUNjb0ZSYllIeDNub1poWFcxAAAAAARiYW5rAgAAACMzTjFFNnRYZGRSb1ZhUmZROWRRM3ZnNUxhVzJmc2Q4SEt1YgAAAAIAAAAGaW52b2tlAQAAABFmaWxlQ2VydGlmaWNhdGlvbgAAAAQAAAAEaGFzaAAAAAV0aXRsZQAAAAR1dWlkAAAABGRhdGEEAAAAAmlkCQEAAAAHZXh0cmFjdAAAAAEIBQAAAAZpbnZva2UAAAANdHJhbnNhY3Rpb25JZAQAAAAKZW50cnlFeGlzdAQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzCQABLAAAAAIFAAAABGhhc2gFAAAABHV1aWQDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQIAAAAETk9ORQQAAAAJdXVpZEV4aXN0BAAAAAck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WAAAAAEFAAAAAmlkCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAACW1lc3NhZ2VpZAUAAAAEdXVpZAkAAlgAAAABBQAAAAJpZAkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAIZGF0YV9lY18JAAJYAAAAAQUAAAACaWQCAAAAAV8FAAAADWNhbGxlckFkZHJlc3MFAAAABGRhdGEFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAEFAAAABGJhbmsFAAAABmFtb3VudAgFAAAAB3BheW1lbnQAAAAHYXNzZXRJZAUAAAADbmlsAAAAAN3Aock=", "chainId": 84, "height": 857668, "spentComplexity": 0 } View: original | compacted Prev: H1QXaFgLQac6cJ4b8xAFTfVRZ5qABmAdgsZCstyb6jAL Next: 6Un94hdcteHYjTYtM4MuNwwNWvJVevqBRfrDZ8jSZXCQ Diff:
OldNewDifferences
6363 }
6464
6565
66+
67+@Callable(invoke)
68+func emailCertification (messageid,uuid,data) = {
69+ let id = extract(invoke.transactionId)
70+ let entryExist = match getString(this, (messageid + uuid)) {
71+ case a: String =>
72+ a
73+ case _ =>
74+ "NONE"
75+ }
76+ let uuidExist = match getString(this, uuid) {
77+ case a: String =>
78+ a
79+ case _ =>
80+ "NONE"
81+ }
82+ let callerAddress = toBase58String(invoke.caller.bytes)
83+ let callerIsWhiteListedNum = match getInteger(this, ("addr_WHITELISTED_" + callerAddress)) {
84+ case a: Int =>
85+ a
86+ case _ =>
87+ 0
88+ }
89+ if ((entryExist != "NONE"))
90+ then throw("This entry already exist")
91+ else if ((uuidExist != "NONE"))
92+ then throw("This uuid already exist")
93+ else if ((size(uuid) > 36))
94+ then throw("Uuid is too long")
95+ else if ((callerIsWhiteListedNum > 0))
96+ then ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((messageid + uuid), toBase58String(id)), DataEntry(("addr_WHITELISTED_" + callerAddress), (callerIsWhiteListedNum - 1)), DataEntry(((("data_ec_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(invoke.caller, 500000, unit)]))
97+ else {
98+ let payment = extract(invoke.payment)
99+ let amount = extract(payment.amount)
100+ let paymentAssetId = if (isDefined(payment.assetId))
101+ then extract(payment.assetId)
102+ else throw("Waves is not accepted as payment")
103+ let acceptedToken = match getString(verifier, ("white_list_token_" + toBase58String(extract(paymentAssetId)))) {
104+ case a: String =>
105+ a
106+ case _ =>
107+ throw("This token is not accepted at the moment")
108+ }
109+ let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId))))
110+ if ((acceptedToken != "WHITELISTED"))
111+ then throw("This token is not accepted at the moment")
112+ else if (if ((amount != currentPrice))
113+ then (0 >= callerIsWhiteListedNum)
114+ else false)
115+ then throw("The price is wrong")
116+ else ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((messageid + uuid), toBase58String(id)), DataEntry(((("data_ec_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, payment.assetId)]))
117+ }
118+ }
119+
120+
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let verifier = extract(addressFromString("3N2s5RtaHPBenCsx2ECcoFRbYHx3noZhXW1"))
55
66 let bank = "3N1E6tXddRoVaRfQ9dQ3vg5LaW2fsd8HKub"
77
88 @Callable(invoke)
99 func fileCertification (hash,title,uuid,data) = {
1010 let id = extract(invoke.transactionId)
1111 let entryExist = match getString(this, (hash + uuid)) {
1212 case a: String =>
1313 a
1414 case _ =>
1515 "NONE"
1616 }
1717 let uuidExist = match getString(this, uuid) {
1818 case a: String =>
1919 a
2020 case _ =>
2121 "NONE"
2222 }
2323 let callerAddress = toBase58String(invoke.caller.bytes)
2424 let callerIsWhiteListedNum = match getInteger(this, ("addr_WHITELISTED_" + callerAddress)) {
2525 case a: Int =>
2626 a
2727 case _ =>
2828 0
2929 }
3030 if ((entryExist != "NONE"))
3131 then throw("This entry already exist")
3232 else if ((uuidExist != "NONE"))
3333 then throw("This uuid already exist")
3434 else if ((size(uuid) > 36))
3535 then throw("Uuid is too long")
3636 else if ((size(hash) > 64))
3737 then throw("Hash is too long")
3838 else if ((size(title) > 64))
3939 then throw("Title is too long")
4040 else if ((callerIsWhiteListedNum > 0))
4141 then ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((hash + uuid), toBase58String(id)), DataEntry((title + uuid), toBase58String(id)), DataEntry(("addr_WHITELISTED_" + callerAddress), (callerIsWhiteListedNum - 1)), DataEntry(((("data_fc_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(invoke.caller, 500000, unit)]))
4242 else {
4343 let payment = extract(invoke.payment)
4444 let amount = extract(payment.amount)
4545 let paymentAssetId = if (isDefined(payment.assetId))
4646 then extract(payment.assetId)
4747 else throw("Waves is not accepted as payment")
4848 let acceptedToken = match getString(verifier, ("white_list_token_" + toBase58String(extract(paymentAssetId)))) {
4949 case a: String =>
5050 a
5151 case _ =>
5252 throw("This token is not accepted at the moment")
5353 }
5454 let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId))))
5555 if ((acceptedToken != "WHITELISTED"))
5656 then throw("This token is not accepted at the moment")
5757 else if (if ((amount != currentPrice))
5858 then (0 >= callerIsWhiteListedNum)
5959 else false)
6060 then throw("The price is wrong")
6161 else ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((hash + uuid), toBase58String(id)), DataEntry((title + uuid), toBase58String(id)), DataEntry(((("data_fc_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, payment.assetId)]))
6262 }
6363 }
6464
6565
66+
67+@Callable(invoke)
68+func emailCertification (messageid,uuid,data) = {
69+ let id = extract(invoke.transactionId)
70+ let entryExist = match getString(this, (messageid + uuid)) {
71+ case a: String =>
72+ a
73+ case _ =>
74+ "NONE"
75+ }
76+ let uuidExist = match getString(this, uuid) {
77+ case a: String =>
78+ a
79+ case _ =>
80+ "NONE"
81+ }
82+ let callerAddress = toBase58String(invoke.caller.bytes)
83+ let callerIsWhiteListedNum = match getInteger(this, ("addr_WHITELISTED_" + callerAddress)) {
84+ case a: Int =>
85+ a
86+ case _ =>
87+ 0
88+ }
89+ if ((entryExist != "NONE"))
90+ then throw("This entry already exist")
91+ else if ((uuidExist != "NONE"))
92+ then throw("This uuid already exist")
93+ else if ((size(uuid) > 36))
94+ then throw("Uuid is too long")
95+ else if ((callerIsWhiteListedNum > 0))
96+ then ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((messageid + uuid), toBase58String(id)), DataEntry(("addr_WHITELISTED_" + callerAddress), (callerIsWhiteListedNum - 1)), DataEntry(((("data_ec_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(invoke.caller, 500000, unit)]))
97+ else {
98+ let payment = extract(invoke.payment)
99+ let amount = extract(payment.amount)
100+ let paymentAssetId = if (isDefined(payment.assetId))
101+ then extract(payment.assetId)
102+ else throw("Waves is not accepted as payment")
103+ let acceptedToken = match getString(verifier, ("white_list_token_" + toBase58String(extract(paymentAssetId)))) {
104+ case a: String =>
105+ a
106+ case _ =>
107+ throw("This token is not accepted at the moment")
108+ }
109+ let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId))))
110+ if ((acceptedToken != "WHITELISTED"))
111+ then throw("This token is not accepted at the moment")
112+ else if (if ((amount != currentPrice))
113+ then (0 >= callerIsWhiteListedNum)
114+ else false)
115+ then throw("The price is wrong")
116+ else ScriptResult(WriteSet([DataEntry(uuid, toBase58String(id)), DataEntry((messageid + uuid), toBase58String(id)), DataEntry(((("data_ec_" + toBase58String(id)) + "_") + callerAddress), data)]), TransferSet([ScriptTransfer(addressFromStringValue(bank), amount, payment.assetId)]))
117+ }
118+ }
119+
120+

github/deemru/w8io/026f985 
43.97 ms