tx · 3Qq6FEDPFGa1f1Nqtb6jZmCAPsoABCUgtCchHgPvFaVb

3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB:  -0.01400000 Waves

2019.12.28 09:38 [828550] smart account 3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB > SELF 0.00000000 Waves

{ "type": 13, "id": "3Qq6FEDPFGa1f1Nqtb6jZmCAPsoABCUgtCchHgPvFaVb", "fee": 1400000, "feeAssetId": null, "timestamp": 1577515125371, "version": 1, "sender": "3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB", "senderPublicKey": "Gd5NihbWQoWuTnSvq25TuV2BYZG4U1e9KDqZn9zBPix7", "proofs": [ "u4WJwbAmMoBEz45j7BFY832hy6SaCpzgqsR4gC61ojpM6isEdzjoAr1Vmqnsw1bZa1zzo1JMxz5PY2LNbMguXHg" ], "script": "base64:AAIDAAAAAAAAAAoIARIGCgQICAgIAAAAAgAAAAAIdmVyaWZpZXIJAQAAAAdleHRyYWN0AAAAAQkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQIAAAAjM04yczVSdGFIUEJlbkNzeDJFQ2NvRlJiWUh4M25vWmhYVzEAAAAABGJhbmsCAAAAIzNOMUU2dFhkZFJvVmFSZlE5ZFEzdmc1TGFXMmZzZDhIS3ViAAAAAQAAAAZpbnZva2UBAAAAEWZpbGVDZXJ0aWZpY2F0aW9uAAAABAAAAARoYXNoAAAABXRpdGxlAAAABHV1aWQAAAAEZGF0YQQAAAACaWQJAQAAAAdleHRyYWN0AAAAAQgFAAAABmludm9rZQAAAA10cmFuc2FjdGlvbklkBAAAAAplbnRyeUV4aXN0BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMJAAEsAAAAAgUAAAAEaGFzaAUAAAAEdXVpZAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAROT05FBAAAAAl1dWlkRXhpc3QEAAA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QWRkcmVzcwUAAAAEZGF0YQUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAEYmFuawUAAAAGYW1vdW50CAUAAAAHcGF5bWVudAAAAAdhc3NldElkBQAAAANuaWwAAAAAl/9hTg==", "chainId": 84, "height": 828550, "spentComplexity": 0 } View: original | compacted Prev: 3LFXBoaP1KHKYgaSVi8mhexjRrybd7bUh7WBUmDCTrGe Next: FmNpAaSPn7chevZbgubn4oubhBNEs2EhuuAiaFmFQHg Diff:
OldNewDifferences
3737 then throw("Hash is too long")
3838 else if ((size(title) > 64))
3939 then throw("Title is too long")
40- else {
41- let payment = extract(invoke.payment)
42- let amount = extract(payment.amount)
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(invoke.caller, 500000, payment.assetId)]))
40+ else if ((callerIsWhiteListedNum > 0))
41+ 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)]))
42+ else {
43+ let payment = extract(invoke.payment)
44+ let amount = extract(payment.amount)
45+ let paymentAssetId = if (isDefined(payment.assetId))
46+ then extract(payment.assetId)
47+ else throw("Waves is not accepted as payment")
48+ let acceptedToken = match getString(verifier, ("white_list_token_" + toBase58String(extract(paymentAssetId)))) {
49+ case a: String =>
50+ a
51+ case _ =>
52+ throw("This token is not accepted at the moment")
53+ }
54+ let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId))))
55+ if ((acceptedToken != "WHITELISTED"))
56+ then throw("This token is not accepted at the moment")
57+ else if (if ((amount != currentPrice))
58+ then (0 >= callerIsWhiteListedNum)
59+ else false)
60+ 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)]))
62- }
62+ }
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) = {
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")
40- else {
41- let payment = extract(invoke.payment)
42- let amount = extract(payment.amount)
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(invoke.caller, 500000, payment.assetId)]))
40+ else if ((callerIsWhiteListedNum > 0))
41+ 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)]))
42+ else {
43+ let payment = extract(invoke.payment)
44+ let amount = extract(payment.amount)
45+ let paymentAssetId = if (isDefined(payment.assetId))
46+ then extract(payment.assetId)
47+ else throw("Waves is not accepted as payment")
48+ let acceptedToken = match getString(verifier, ("white_list_token_" + toBase58String(extract(paymentAssetId)))) {
49+ case a: String =>
50+ a
51+ case _ =>
52+ throw("This token is not accepted at the moment")
53+ }
54+ let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId))))
55+ if ((acceptedToken != "WHITELISTED"))
56+ then throw("This token is not accepted at the moment")
57+ else if (if ((amount != currentPrice))
58+ then (0 >= callerIsWhiteListedNum)
59+ else false)
60+ 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)]))
62- }
62+ }
6363 }
6464
6565

github/deemru/w8io/6500d08 
62.96 ms