tx · FaGPrZiDHp9Uzs556SuNwAz9ajTkmMsUBvhiUmVNK24c

3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB:  -0.01400000 Waves

2019.11.16 11:16 [767413] smart account 3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB > SELF 0.00000000 Waves

{ "type": 13, "id": "FaGPrZiDHp9Uzs556SuNwAz9ajTkmMsUBvhiUmVNK24c", "fee": 1400000, "feeAssetId": null, "timestamp": 1573892230891, "version": 1, "sender": "3NC28hSivrmsTUXaYD1x6L362J4ZpUnoTdB", "senderPublicKey": "Gd5NihbWQoWuTnSvq25TuV2BYZG4U1e9KDqZn9zBPix7", "proofs": [ "5veukLigTcdGswbKJHcrm6GJUT6AzxmQN1zXydfR68E342biR5mfwFwqD7CfBUYXWhhLYymxvutY11HRYg4DPo25" ], "script": "base64:AAIDAAAAAAAAAAoIARIGCgQICAgIAAAAAgAAAAAIdmVyaWZpZXIJAQAAAAdleHRyYWN0AAAAAQkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQIAAAAjM04yczVSdGFIUEJlbkNzeDJFQ2NvRlJiWUh4M25vWmhYVzEAAAAABGJhbmsCAAAAIzNOMUU2dFhkZFJvVmFSZlE5ZFEzdmc1TGFXMmZzZDhIS3ViAAAAAQAAAAZpbnZva2UBAAAAEWZpbGVDZXJ0aWZpY2F0aW9uAAAABAAAAARoYXNoAAAABXRpdGxlAAAABHV1aWQAAAAEZGF0YQQAAAAHcGF5bWVudAkBAAAAB2V4dHJhY3QAAAABCAUAAAAGaW52b2tlAAAAB3BheW1lbnQEAAAABmFtb3VudAMJAQAAAAlpc0RlZmluZWQAAAABCAUAAAAHcGF5bWVudAAAAAZhbW91bnQJAQAAAAdleHRyYWN0AAAAAQgFAAAAB3BheW1lbnQAAAAGYW1vdW50AAAAAAAAAAAABAAAAAJpZAkBAAAAB2V4dHJhY3QAAAABCAUAAAAGaW52b2tlAAAADXRyYW5zYWN0aW9uSWQEAAAACmVudHJ5R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AAAJRGF0YUVudHJ5AAAAAgkAASwAAAACCQABLAAAAAIJAAEsAAAAAgIAAAAIZGF0YV9mY18JAAJYAAAAAQUAAAACaWQCAAAAAV8FAAAADWNhbGxlckFkZHJlc3MFAAAABGRhdGEFAAAAA25pbAkBAAAAC1RyYW5zZmVyU2V0AAAAAQkABEwAAAACCQEAAAAOU2NyaXB0VHJhbnNmZXIAAAADCQEAAAAcQGV4dHJVc2VyKGFkZHJlc3NGcm9tU3RyaW5nKQAAAAEFAAAABGJhbmsFAAAABmFtb3VudAgFAAAAB3BheW1lbnQAAAAHYXNzZXRJZAUAAAADbmlsAAAAAEGQwn0=", "chainId": 84, "height": 767413, "spentComplexity": 0 } View: original | compacted Prev: CP6SxxxEfg3rDaHarwAMuJU9fE4uf7SPev1soTS3Yqjb Next: 3NNnoBLG7adtUQ2PBx4fXe27goJotiVVpVsLbD1zEkEy Diff:
OldNewDifferences
88 @Callable(invoke)
99 func fileCertification (hash,title,uuid,data) = {
1010 let payment = extract(invoke.payment)
11- let amount = extract(payment.amount)
11+ let amount = if (isDefined(payment.amount))
12+ then extract(payment.amount)
13+ else 0
1214 let id = extract(invoke.transactionId)
1315 let entryExist = match getString(this, (hash + uuid)) {
1416 case a: String =>
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 payment = extract(invoke.payment)
11- let amount = extract(payment.amount)
11+ let amount = if (isDefined(payment.amount))
12+ then extract(payment.amount)
13+ else 0
1214 let id = extract(invoke.transactionId)
1315 let entryExist = match getString(this, (hash + uuid)) {
1416 case a: String =>
1517 a
1618 case _ =>
1719 "NONE"
1820 }
1921 let uuidExist = match getString(this, uuid) {
2022 case a: String =>
2123 a
2224 case _ =>
2325 "NONE"
2426 }
2527 let callerAddress = toBase58String(invoke.caller.bytes)
2628 let callerIsWhiteListedNum = match getInteger(this, ("addr_WHITELISTED_" + callerAddress)) {
2729 case a: Int =>
2830 a
2931 case _ =>
3032 0
3133 }
3234 if ((entryExist != "NONE"))
3335 then throw("This entry already exist")
3436 else if ((uuidExist != "NONE"))
3537 then throw("This uuid already exist")
3638 else if ((size(uuid) > 36))
3739 then throw("Uuid is too long")
3840 else if ((size(hash) > 64))
3941 then throw("Hash is too long")
4042 else if ((size(title) > 64))
4143 then throw("Title is too long")
4244 else {
4345 let paymentAssetId = if (isDefined(payment.assetId))
4446 then extract(payment.assetId)
4547 else throw("Waves is not accepted as payment")
4648 let acceptedToken = match getString(verifier, ("white_list_token_" + toBase58String(extract(paymentAssetId)))) {
4749 case a: String =>
4850 a
4951 case _ =>
5052 throw("This token is not accepted at the moment")
5153 }
5254 let currentPrice = getIntegerValue(verifier, ("certification_fee_" + toBase58String(extract(paymentAssetId))))
5355 if ((acceptedToken != "WHITELISTED"))
5456 then throw("This token is not accepted at the moment")
5557 else if (if ((amount != currentPrice))
5658 then (0 >= callerIsWhiteListedNum)
5759 else false)
5860 then throw("The price is wrong")
5961 else if ((callerIsWhiteListedNum > 0))
6062 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)]))
6163 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)]))
6264 }
6365 }
6466
6567

github/deemru/w8io/026f985 
38.12 ms