tx · 8MRrrW4RqJ4uhcBGyWxt7npwEb7hBFiFoTkmMyovJxaR

3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB:  -0.01400000 Waves

2019.12.28 09:15 [828521] smart account 3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB > SELF 0.00000000 Waves

{ "type": 13, "id": "8MRrrW4RqJ4uhcBGyWxt7npwEb7hBFiFoTkmMyovJxaR", "fee": 1400000, "feeAssetId": null, "timestamp": 1577513749173, "version": 1, "sender": "3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB", "senderPublicKey": "Gd5NihbWQoWuTnSvq25TuV2BYZG4U1e9KDqZn9zBPix7", "proofs": [ "2YoGRbofimawPXGCa7apiK6hQf6PDsqaPWfGu3Znjick1xsb8HoJGcawM21SozBmYYk6PGLGi8tjB6SRrKaXfoKD" ], "script": "base64:AAIDAAAAAAAAAAoIARIGCgQICAgIAAAAAgAAAAAIdmVyaWZpZXIJAQAAAAdleHRyYWN0AAAAAQkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQIAAAAjM04yczVSdGFIUEJlbkNzeDJFQ2NvRlJiWUh4M25vWmhYVzEAAAAABGJhbmsCAAAAIzNOMUU2dFhkZFJvVmFSZlE5ZFEzdmc1TGFXMmZzZDhIS3ViAAAAAQAAAAZpbnZva2UBAAAAEWZpbGVDZXJ0aWZpY2F0aW9uAAAABAAAAARoYXNoAAAABXRpdGxlAAAABHV1aWQAAAAEZGF0YQQAAAACaWQJAQAAAAdleHRyYWN0AAAAAQgFAAAABmludm9rZQAAAA10cmFuc2FjdGlvbklkBAAAAAplbnRyeUV4aXN0BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMJAAEsAAAAAgUAAAAEaGFzaAUAAAAEdXVpZAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAFhBQAAAAckbWF0Y2gwBQAAAAFhAgAAAAROT05FBAAAAAl1dWlkRXhpc3QEAAAAByRtY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AAANY2FsbGVyQWRkcmVzcwUAAAAEZGF0YQUAAAADbmlsCQEAAAALVHJhbnNmZXJTZXQAAAABCQAETAAAAAIJAQAAAA5TY3JpcHRUcmFuc2ZlcgAAAAMJAQAAABxAZXh0clVzZXIoYWRkcmVzc0Zyb21TdHJpbmcpAAAAAQUAAAAEYmFuawUAAAAGYW1vdW50CAUAAAAHcGF5bWVudAAAAAdhc3NldElkBQAAAANuaWwAAAAAx9gPzg==", "chainId": 84, "height": 828521, "spentComplexity": 0 } View: original | compacted Prev: A9G1AoUFjupmsnmKV93SZH2XPhLZ7jD8PrYCHXRQNbAz Next: 5jXYB2vHzyaeFuprimucAKzFwVhEEyXvdQY1HZXc3iTr Diff:
OldNewDifferences
5757 else false)
5858 then throw("The price is wrong")
5959 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, 1, payment.assetId)]))
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, 500100, payment.assetId)]))
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 }
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 {
4141 let payment = extract(invoke.payment)
4242 let amount = extract(payment.amount)
4343 let paymentAssetId = if (isDefined(payment.assetId))
4444 then extract(payment.assetId)
4545 else throw("Waves is not accepted as payment")
4646 let acceptedToken = match getString(verifier, ("white_list_token_" + toBase58String(extract(paymentAssetId)))) {
4747 case a: String =>
4848 a
4949 case _ =>
5050 throw("This token is not accepted at the moment")
5151 }
5252 let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId))))
5353 if ((acceptedToken != "WHITELISTED"))
5454 then throw("This token is not accepted at the moment")
5555 else if (if ((amount != currentPrice))
5656 then (0 >= callerIsWhiteListedNum)
5757 else false)
5858 then throw("The price is wrong")
5959 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, 1, payment.assetId)]))
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, 500100, payment.assetId)]))
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

github/deemru/w8io/026f985 
71.62 ms