tx · Cz2uiiaRUBv4hswsHp3994ohCCeZ2GDeVeuFV5G35tcC

3N1Ess2FjLbYhNN8EH2281Zig3iU7JFbgxS:  -0.01400000 Waves

2020.09.05 17:27 [1164203] smart account 3N1Ess2FjLbYhNN8EH2281Zig3iU7JFbgxS > SELF 0.00000000 Waves

{ "type": 13, "id": "Cz2uiiaRUBv4hswsHp3994ohCCeZ2GDeVeuFV5G35tcC", "fee": 1400000, "feeAssetId": null, "timestamp": 1599316027565, "version": 1, "sender": "3N1Ess2FjLbYhNN8EH2281Zig3iU7JFbgxS", "senderPublicKey": "GFDQU6mvL6dPRTRTFsGQd6UuPdXYekqv691fKLKaUMmJ", "proofs": [ "4og77kcRWCaZinEVEb3MrkvheYcTVxCyQUuaAy8bigQhFKjubrQ7MKohaUQUUEUM68Uw82pzhM7uWhVaBNWtxq1V" ], "script": "base64:AAIDAAAAAAAAAAkIARIFCgMICAEAAAALAAAAAApNYXhDb25zdWxzAAAAAAAAAAAFAQAAAA5nZXROdW1iZXJCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGgAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAADSW50BAAAAAF2BQAAAAckbWF0Y2gwBQAAAAF2AAAAAAAAAAAAAQAAAA5nZXRTdHJpbmdCeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEHQAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAGU3RyaW5nBAAAAAF2BQAAAAckbWF0Y2gwBQAAAAF2AgAAAAABAAAAD2dldEJvb2xlYW5CeUtleQAAAAEAAAADa2V5BAAAAAckbWF0Y2gwCQAEGwAAAAIFAAAABHRoaXMFAAAAA2tleQMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAHQm9vbGVhbgQAAAABdgUAAAAHJG1hdGNoMAUAAAABdgcAAAAAEUJmdENvZWZmaWNpZW50S2V5AgAAA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wAAAAAAAAAAAAkAAZEAAAACBQAAAAdjb25zdWxzAAAAAAAAAAAACQEAAAAMdmFsaWRhdGVTaWduAAAAAwUAAAADbXNnCQABkQAAAAIFAAAABXNpZ25zAAAAAAAAAAABCQABkQAAAAIFAAAAB2NvbnN1bHMAAAAAAAAAAAEJAQAAAAx2YWxpZGF0ZVNpZ24AAAADBQAAAANtc2cJAAGRAAAAAgUAAAAFc2lnbnMAAAAAAAAAAAIJAAGRAAAAAgUAAAAHY29uc3VscwAAAAAAAAAAAgkBAAAADHZhbGlkYXRlU2lnbgAAAAMFAAAAA21zZwkAAZEAAAACBQAAAAVzaWducwAAAAAAAAAAAwkAAZEAAAACBQAAAAdjb25zdWxzAAAAAAAAAAADCQEAAAAMdmFsaWRhdGVTaWduAAAAAwUAAAADbXNnCQABkQAAAAIFAAAABXNpZ25zAAAAAAAAAAAECQABkQAAAAIFAAAAB2NvbnN1bHMAAAAAAAAAAAQDCQAAZwAAAAIFAAAACWxhc3RSb3VuZAUAAAAFcm91bmQJAAACAAAAAQIAAAAVcm91bmQgbGVzcyBsYXN0IHJvdW5kAwkAAGYAAAACBQAAAAVjb3VudAUAAAAOYmZ0Q29lZmZpY2llbnQJAAACAAAAAQIAAAARaW52YWxpZCBiZnQgY291bnQJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIJAQAAAApDb25zdWxzS2V5AAAAAQUAAAAFcm91bmQFAAAACm5ld0NvbnN1bHMJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAADExhc3RSb3VuZEtleQUAAAAFcm91bmQFAAAAA25pbAAAAACr8/Y1", "chainId": 84, "height": 1164203, "applicationStatus": "succeeded", "spentComplexity": 0 } View: original | compacted Prev: D187JZBjjhq79QDKr1NsqC7XhFrLwYqrs5JCh4qCvqLa Next: none Diff:
OldNewDifferences
5050
5151 @Callable(i)
5252 func updateConsuls (newConsuls,stringSigns,round) = {
53- let consuls = consulsByRound(round)
53+ let consuls = consulsByRound(lastRound)
5454 let msg = toBytes(((newConsuls + ",") + toString(round)))
5555 let signs = split(stringSigns, ",")
5656 let count = ((((validateSign(msg, signs[0], consuls[0]) + validateSign(msg, signs[1], consuls[1])) + validateSign(msg, signs[2], consuls[2])) + validateSign(msg, signs[3], consuls[3])) + validateSign(msg, signs[4], consuls[4]))
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let MaxConsuls = 5
55
66 func getNumberByKey (key) = match getInteger(this, key) {
77 case v: Int =>
88 v
99 case _ =>
1010 0
1111 }
1212
1313
1414 func getStringByKey (key) = match getString(this, key) {
1515 case v: String =>
1616 v
1717 case _ =>
1818 ""
1919 }
2020
2121
2222 func getBooleanByKey (key) = match getBoolean(this, key) {
2323 case v: Boolean =>
2424 v
2525 case _ =>
2626 false
2727 }
2828
2929
3030 let BftCoefficientKey = "bft_coefficient"
3131
3232 let LastRoundKey = "last_round"
3333
3434 func ConsulsKey (round) = ("consuls_" + toString(round))
3535
3636
3737 let bftCoefficient = getNumberByKey(BftCoefficientKey)
3838
3939 let lastRound = getNumberByKey(LastRoundKey)
4040
4141 func consulsByRound (round) = split(getStringByKey(ConsulsKey(round)), ",")
4242
4343
4444 func validateSign (hash,sign,oracle) = if ((sign != "nil"))
4545 then if (sigVerify(hash, fromBase58String(sign), fromBase58String(oracle)))
4646 then 1
4747 else 0
4848 else 0
4949
5050
5151 @Callable(i)
5252 func updateConsuls (newConsuls,stringSigns,round) = {
53- let consuls = consulsByRound(round)
53+ let consuls = consulsByRound(lastRound)
5454 let msg = toBytes(((newConsuls + ",") + toString(round)))
5555 let signs = split(stringSigns, ",")
5656 let count = ((((validateSign(msg, signs[0], consuls[0]) + validateSign(msg, signs[1], consuls[1])) + validateSign(msg, signs[2], consuls[2])) + validateSign(msg, signs[3], consuls[3])) + validateSign(msg, signs[4], consuls[4]))
5757 if ((lastRound >= round))
5858 then throw("round less last round")
5959 else if ((count > bftCoefficient))
6060 then throw("invalid bft count")
6161 else WriteSet([DataEntry(ConsulsKey(round), newConsuls), DataEntry(LastRoundKey, round)])
6262 }
6363
6464

github/deemru/w8io/026f985 
26.06 ms