tx · 7eNNx2X8dEm3zfURuHEEyv3vgK6pnp68iVMjt9t4BiPT

3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB:  -0.01400000 Waves

2019.11.16 11:40 [767436] smart account 3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB > SELF 0.00000000 Waves

{ "type": 13, "id": "7eNNx2X8dEm3zfURuHEEyv3vgK6pnp68iVMjt9t4BiPT", "fee": 1400000, "feeAssetId": null, "timestamp": 1573893703130, "version": 1, "sender": "3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB", "senderPublicKey": "Gd5NihbWQoWuTnSvq25TuV2BYZG4U1e9KDqZn9zBPix7", "proofs": [ "3zVgBbNw8izjdFMRtFBpN5LYZk88ggnyNfGDgcYhYEwPa6qsPJYY1hX6SAQbhUH3K5P4kFtYZFL6AR1ywuyAVoai" ], "script": "base64:AAIDAAAAAAAAAAoIARIGCgQICAgIAAAAAgAAAAAIdmVyaWZpZXIJAQAAAAdleHRyYWN0AAAAAQkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQIAAAAjM04yczVSdGFIUEJlbkNzeDJFQ2NvRlJiWUh4M25vWmhYVzEAAAAABGJhbmsCAAAAIzNOMUU2dFhkZFJvVmFSZlE5ZFEzdmc1TGFXMmZzZDhIS3ViAAAAAQAAAAZpbnZva2UBAAAAEWZpbGVDZXJ0aWZpY2F0aW9uAAAABAAAAARoYXNoAAAABXRpdGxlAAAABHV1aWQAAAAEZGF0YQQAAAACaWQJAQAAAAdleHRyYWN0AAAAAQgFAAAABmludm9rZQAAAA10cmFuc2FjdGlvbklkBAAAAAplbnRyeUV4aXN0BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMJAAEsAAAAAgUAAAAEaGFzaAUAAAAEdXVpZAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAROT05FBAAAAAl1dWlkRXhpc3QEAAAA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bnRyeQAAAAIJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAACGRhdGFfZmNfCQACWAAAAAEFAAAAAmlkAgAAAAFfBQAAAA1jYWxsZXJBZGRyZXNzBQAAAARkYXRhBQAAAANuaWwAAAAAMJLsYg==", "chainId": 84, "height": 767436, "spentComplexity": 0 } View: original | compacted Prev: 3NNnoBLG7adtUQ2PBx4fXe27goJotiVVpVsLbD1zEkEy Next: 6yTobJJtqnuVGT2q6MC127Whc1mApLeVEagu9W2e67CM Diff:
OldNewDifferences
77
88 @Callable(invoke)
99 func fileCertification (hash,title,uuid,data) = {
10- let payment = extract(invoke.payment)
11- let amount = extract(payment.amount)
1210 let id = extract(invoke.transactionId)
1311 let entryExist = match getString(this, (hash + uuid)) {
1412 case a: String =>
3937 then throw("Hash is too long")
4038 else if ((size(title) > 64))
4139 then throw("Title is too long")
42- else {
43- let paymentAssetId = if (isDefined(payment.assetId))
44- then extract(payment.assetId)
45- else throw("Waves is not accepted as payment")
46- let acceptedToken = match getString(verifier, ("white_list_token_" + toBase58String(extract(paymentAssetId)))) {
47- case a: String =>
48- a
49- case _ =>
50- throw("This token is not accepted at the moment")
51- }
52- let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId))))
53- if ((acceptedToken != "WHITELISTED"))
54- then throw("This token is not accepted at the moment")
55- else if (if ((amount != currentPrice))
56- then (0 >= callerIsWhiteListedNum)
57- else false)
58- then throw("The price is wrong")
59- else if ((callerIsWhiteListedNum > 0))
60- 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(addressFromStringValue(bank), amount, payment.assetId)]))
40+ else if (isDefined(invoke.payment))
41+ then {
42+ let payment = extract(invoke.payment)
43+ let amount = extract(payment.amount)
44+ let paymentAssetId = if (isDefined(payment.assetId))
45+ then extract(payment.assetId)
46+ else throw("Waves is not accepted as payment")
47+ let acceptedToken = match getString(verifier, ("white_list_token_" + toBase58String(extract(paymentAssetId)))) {
48+ case a: String =>
49+ a
50+ case _ =>
51+ throw("This token is not accepted at the moment")
52+ }
53+ let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId))))
54+ if ((acceptedToken != "WHITELISTED"))
55+ then throw("This token is not accepted at the moment")
56+ else if ((amount != currentPrice))
57+ then throw("The price is wrong")
6158 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)]))
62- }
59+ }
60+ else if ((0 >= callerIsWhiteListedNum))
61+ then throw("You are not White Listed, please attach a payment.")
62+ else 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)])
6363 }
6464
6565
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) = {
10- let payment = extract(invoke.payment)
11- let amount = extract(payment.amount)
1210 let id = extract(invoke.transactionId)
1311 let entryExist = match getString(this, (hash + uuid)) {
1412 case a: String =>
1513 a
1614 case _ =>
1715 "NONE"
1816 }
1917 let uuidExist = match getString(this, uuid) {
2018 case a: String =>
2119 a
2220 case _ =>
2321 "NONE"
2422 }
2523 let callerAddress = toBase58String(invoke.caller.bytes)
2624 let callerIsWhiteListedNum = match getInteger(this, ("addr_WHITELISTED_" + callerAddress)) {
2725 case a: Int =>
2826 a
2927 case _ =>
3028 0
3129 }
3230 if ((entryExist != "NONE"))
3331 then throw("This entry already exist")
3432 else if ((uuidExist != "NONE"))
3533 then throw("This uuid already exist")
3634 else if ((size(uuid) > 36))
3735 then throw("Uuid is too long")
3836 else if ((size(hash) > 64))
3937 then throw("Hash is too long")
4038 else if ((size(title) > 64))
4139 then throw("Title is too long")
42- else {
43- let paymentAssetId = if (isDefined(payment.assetId))
44- then extract(payment.assetId)
45- else throw("Waves is not accepted as payment")
46- let acceptedToken = match getString(verifier, ("white_list_token_" + toBase58String(extract(paymentAssetId)))) {
47- case a: String =>
48- a
49- case _ =>
50- throw("This token is not accepted at the moment")
51- }
52- let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId))))
53- if ((acceptedToken != "WHITELISTED"))
54- then throw("This token is not accepted at the moment")
55- else if (if ((amount != currentPrice))
56- then (0 >= callerIsWhiteListedNum)
57- else false)
58- then throw("The price is wrong")
59- else if ((callerIsWhiteListedNum > 0))
60- 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(addressFromStringValue(bank), amount, payment.assetId)]))
40+ else if (isDefined(invoke.payment))
41+ then {
42+ let payment = extract(invoke.payment)
43+ let amount = extract(payment.amount)
44+ let paymentAssetId = if (isDefined(payment.assetId))
45+ then extract(payment.assetId)
46+ else throw("Waves is not accepted as payment")
47+ let acceptedToken = match getString(verifier, ("white_list_token_" + toBase58String(extract(paymentAssetId)))) {
48+ case a: String =>
49+ a
50+ case _ =>
51+ throw("This token is not accepted at the moment")
52+ }
53+ let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId))))
54+ if ((acceptedToken != "WHITELISTED"))
55+ then throw("This token is not accepted at the moment")
56+ else if ((amount != currentPrice))
57+ then throw("The price is wrong")
6158 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)]))
62- }
59+ }
60+ else if ((0 >= callerIsWhiteListedNum))
61+ then throw("You are not White Listed, please attach a payment.")
62+ else 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)])
6363 }
6464
6565

github/deemru/w8io/026f985 
39.73 ms