tx · 8CpaQCAme6hnohpxa8WakW6bb8FtYJCx2GvJrBJ7AQpX

3N666c9jMPp2LgthP7QpdaHbfcyCXp6pfk2:  -0.01400000 Waves

2020.07.15 09:20 [1088059] smart account 3N666c9jMPp2LgthP7QpdaHbfcyCXp6pfk2 > SELF 0.00000000 Waves

{ "type": 13, "id": "8CpaQCAme6hnohpxa8WakW6bb8FtYJCx2GvJrBJ7AQpX", "fee": 1400000, "feeAssetId": null, "timestamp": 1594794081050, "version": 1, "sender": "3N666c9jMPp2LgthP7QpdaHbfcyCXp6pfk2", "senderPublicKey": "2K3zsM6XaqxaedbuC6dRB8cVX8TcnGRAXSkRyUmXiSAj", "proofs": [ "yih1u3Znu8hp7wJ13b3vGR5GMvz4yYYSTESow4QVGvdJPTRxEacJPTN7cQqgSRiVk4i6VnK28vQT8D6QpWPTsMZ" ], "script": "base64:AAIDAAAAAAAAAA8IARIECgICCBIFCgMICAEAAAARAAAAAAVXQVZFUwIAAAAFV0FWRVMBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAByRtYXRjaDAJAAQaAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAANJbnQEAAAAAXYFAAAAByRtYXRjaDAFAAAAAXYAAAAAAAAAAAABAAAADWdldEJ5dGVzQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABBwAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAACkJ5dGVWZWN0b3IEAAAAAXYFAAAAByRtYXRjaDAFAAAAAXYBAAAAA9AAAAEAAAAOZ2V0U3RyaW5nQnlLZXkAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAABlN0cmluZwQAAAABdgUAAAAHJG1hdGNoMAUAAAABdgIAAAAAAQAAABhnZXRTdHJpbmdCeUFkZ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AGkAAAAAQUAAAAHdkhlaWdodAIAAAAACQAAAgAAAAECAAAADmludmFsaWQgaGVpZ2h0AwkBAAAAAiE9AAAAAgkAAfUAAAABCQABmgAAAAEFAAAAAXYJAAJZAAAAAQkBAAAADmdldFN0cmluZ0J5S2V5AAAAAQkAAaQAAAABBQAAAAd2SGVpZ2h0CQAAAgAAAAEJAAEsAAAAAgIAAAAZaW52YWxpZCBrZWNjYWsyNTYodmFsdWUpIAkAAaQAAAABBQAAAAF2BgY1hhGn", "chainId": 84, "height": 1088059, "spentComplexity": 0 } View: original | compacted Prev: xFw7bKdZ1FREz1vDSaK9RqPBue9sf61ZphBRZEDsUsE Next: FCdpLwjPTJggzk2kV7cacvM5f3tfLBNewUD2gS8HvzGX Diff:
OldNewDifferences
88 v
99 case _ =>
1010 0
11+}
12+
13+
14+func getBytesByKey (key) = match getBinary(this, key) {
15+ case v: ByteVector =>
16+ v
17+ case _ =>
18+ base58'2CsAf'
1119 }
1220
1321
6270 let count = ((((validateSign(hash, signList[0], oracles[0]) + validateSign(hash, signList[1], oracles[1])) + validateSign(hash, signList[2], oracles[2])) + validateSign(hash, signList[3], oracles[3])) + validateSign(hash, signList[4], oracles[4]))
6371 if ((count > bftCoefficient))
6472 then throw("invalid bft count")
65- else if ((getStringByKey(toString(height)) != ""))
73+ else if ((getBytesByKey(toString(height)) != base58'2CsAf'))
6674 then throw("data is exist")
6775 else WriteSet([DataEntry(toString(height), hash)])
6876 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let WAVES = "WAVES"
55
66 func getNumberByKey (key) = match getInteger(this, key) {
77 case v: Int =>
88 v
99 case _ =>
1010 0
11+}
12+
13+
14+func getBytesByKey (key) = match getBinary(this, key) {
15+ case v: ByteVector =>
16+ v
17+ case _ =>
18+ base58'2CsAf'
1119 }
1220
1321
1422 func getStringByKey (key) = match getString(this, key) {
1523 case v: String =>
1624 v
1725 case _ =>
1826 ""
1927 }
2028
2129
2230 func getStringByAddressAndKey (address,key) = match getString(address, key) {
2331 case v: String =>
2432 v
2533 case _ =>
2634 ""
2735 }
2836
2937
3038 let OraclesKey = "oracles"
3139
3240 let ConsulsKey = "consuls"
3341
3442 let SubscriberAddressKey = "subscriber_address"
3543
3644 let GravityContractKey = "gravity_contract"
3745
3846 let BftCoefficientKey = "bft_coefficient"
3947
4048 let LasrRoundKey = "last_round"
4149
4250 let oracles = split(getStringByKey(OraclesKey), ",")
4351
4452 let bftCoefficient = getNumberByKey(BftCoefficientKey)
4553
4654 let gracityContract = addressFromStringValue(getStringByKey(GravityContractKey))
4755
4856 let consuls = split(getStringByAddressAndKey(gracityContract, ConsulsKey), ",")
4957
5058 let subscriberAddress = getStringByKey(SubscriberAddressKey)
5159
5260 func validateSign (hash,sign,oracle) = if ((sign != "nil"))
5361 then if (sigVerify(hash, fromBase58String(sign), fromBase58String(oracle)))
5462 then 1
5563 else 0
5664 else 0
5765
5866
5967 @Callable(i)
6068 func confirmData (hash,signs) = {
6169 let signList = split(signs, ",")
6270 let count = ((((validateSign(hash, signList[0], oracles[0]) + validateSign(hash, signList[1], oracles[1])) + validateSign(hash, signList[2], oracles[2])) + validateSign(hash, signList[3], oracles[3])) + validateSign(hash, signList[4], oracles[4]))
6371 if ((count > bftCoefficient))
6472 then throw("invalid bft count")
65- else if ((getStringByKey(toString(height)) != ""))
73+ else if ((getBytesByKey(toString(height)) != base58'2CsAf'))
6674 then throw("data is exist")
6775 else WriteSet([DataEntry(toString(height), hash)])
6876 }
6977
7078
7179
7280 @Callable(i)
7381 func setSortedOracles (newSortedOracles,stringSigns,round) = {
7482 let signs = split(stringSigns, ",")
7583 let count = ((((validateSign(toBytes(newSortedOracles), signs[0], consuls[0]) + validateSign(toBytes(newSortedOracles), signs[1], consuls[1])) + validateSign(toBytes(newSortedOracles), signs[2], consuls[2])) + validateSign(toBytes(newSortedOracles), signs[3], consuls[3])) + validateSign(toBytes(newSortedOracles), signs[4], consuls[4]))
7684 if ((count > bftCoefficient))
7785 then throw("invalid bft count")
7886 else WriteSet([DataEntry(OraclesKey, newSortedOracles), DataEntry(((LasrRoundKey + "_") + toString(round)), round)])
7987 }
8088
8189
8290 @Verifier(i)
8391 func sendData () = match i {
8492 case in: InvokeScriptTransaction =>
8593 let v = match in.args[0] {
8694 case v: Int =>
8795 v
8896 case _ =>
8997 throw("invalid args[0] type")
9098 }
9199 let vHeight = match in.args[1] {
92100 case vHeight: Int =>
93101 vHeight
94102 case _ =>
95103 throw("invalid args[1] type")
96104 }
97105 if ((in.dApp != addressFromStringValue(subscriberAddress)))
98106 then throw("invalid dapp address")
99107 else if ((getStringByKey(toString(vHeight)) == ""))
100108 then throw("invalid height")
101109 else if ((keccak256(toBytes(v)) != fromBase58String(getStringByKey(toString(vHeight)))))
102110 then throw(("invalid keccak256(value) " + toString(v)))
103111 else true
104112 case _ =>
105113 true
106114 }
107115

github/deemru/w8io/169f3d6 
24.68 ms