tx · 2vuwqsWGUYjvMy2gKvPMXqFpyB7o9CCRV9ppkMsqs9Yy

3MtSS7RTsDoG91pR5gx5EWzGjJKuciDPeFN:  -0.01400000 Waves

2020.05.22 22:01 [1009869] smart account 3MtSS7RTsDoG91pR5gx5EWzGjJKuciDPeFN > SELF 0.00000000 Waves

{ "type": 13, "id": "2vuwqsWGUYjvMy2gKvPMXqFpyB7o9CCRV9ppkMsqs9Yy", "fee": 1400000, "feeAssetId": null, "timestamp": 1590174086495, "version": 1, "sender": "3MtSS7RTsDoG91pR5gx5EWzGjJKuciDPeFN", "senderPublicKey": "8ffZxZakt7dEoMzAQT8TtX1zEBkt7fy8Z4amcAGGP4n6", "proofs": [ "5rwpTtbE75qwVUaPiF5wWJmHkwRnLnQQQ7GUrh23EPV1mAvJRcaSf9XpaGmYggBrV2tb9jjhLvfSVZw3yiLee98T" ], "script": "base64:AAIDAAAAAAAAABEIARIHCgUICAgICBIECgIICAAAAAUAAAAABE5PTkUCAAAABG5vbmUAAAAACWFkbVB1YktleQEAAAAgSbRXZpKipUGQZgwtsByHuazYu1/9b9MYoKHOzSIEyXQBAAAADmdldE51bWJlckJ5S2V5AAAAAQAAAANrZXkEAAAAA251bQQAAAAHJG1hdGNoMAkABBoAAAACBQAAAAR0aGlzBQAAAANrZXkDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAA0ludAQAAAABYQUAAAAHJG1hdGNoMAUAAAABYQAAAAAAAAAAAAUAAAADbnVtAQAAAAtnZXRTdHJCeUtleQAAAAEAAAADa2V5BAAAAANzdHIEAAAAByRtYXRjaDAJAAQdAAAAAgUAAAAEdGhpcwUAAAADa2V5AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAAAZTdHJpbmcEAAAAAWEFAAAAByRtYXRjaDAFAAAAAWEFAAAABE5PTkUFAAAAA3N0cgEAAAANZ2V0U2VjdXJlSGFzaAAAAAEAAAADa2V5CQACWAAAAAEJAAH1AAAAAQkAAfYAAAABCQABmwAAAAEFAAAAA2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AAAAAAAgAAAAhSZWNvdmVyeQcJAAACAAAAAQIAAAATUmVxdWVzdCBub3QgYWxsb3dlZAMJAAAAAAAAAgkAAZEAAAACBQAAAARhdXRoAAAAAAAAAAAAAgAAAAhSZWNvdmVyeQQAAAAFbXVsdGkJAQAAAA1wYXJzZUludFZhbHVlAAAAAQkAAZEAAAACBQAAAARhdXRoAAAAAAAAAAABCQEAAAAIV3JpdGVTZXQAAAABCQAETAAAAAIJAQAAAAlEYXRhRW50cnkAAAACCQABLAAAAAIFAAAACHNlY0VtYWlsAgAAAAdfb3BBdXRoCQABLAAAAAIJAAEsAAAAAgkAASwAAAACAgAAAAlSZWNvdmVyeSwJAAGkAAAAAQkAAGQAAAACBQAAAAVtdWx0aQAAAAAAAAAAAQIAAAABLAkAAaQAAAABCQAAZAAAAAIIBQAAAAlsYXN0QmxvY2sAAAAGaGVpZ2h0CQAAaAAAAAIFAAAABW11bHRpAAAAAAAAAAA8BQAAAANuaWwJAQAAAAhXcml0ZVNldAAAAAEJAARMAAAAAgkBAAAACURhdGFFbnRyeQAAAAIFAAAACHNlY0VtYWlsBQAAAAhyZXNldEtleQkABEwAAAACCQEAAAAJRGF0YUVudHJ5AAAAAgkAASwAAAACBQAAAAhzZWNFbWFpbAIAAAAHX29wQXV0aAkAASwAAAACAgAAAAtSZWNvdmVyeSwxLAkAAaQAAAABCQAAZAAAAAIIBQAAAAlsYXN0QmxvY2sAAAAGaGVpZ2h0AAAAAAAAAAA8BQAAAANuaWwAAAAApbgt8g==", "chainId": 84, "height": 1009869, "spentComplexity": 0 } View: original | compacted Prev: Ecvfz2pKtCXZEXydLPmM1Mr5uySUHeuTsz1epd2rQUjK Next: GM6EMyytHiyB2iodwzJu52mHkviUUS2iXLPgXXjAjF2J Diff:
OldNewDifferences
3535 let pubKey = toBase58String(i.callerPublicKey)
3636 let secEmail = getSecureHash(opEmail)
3737 let secPass = getSecureHash(opPass)
38- if ((pubKey != toBase58String(admPubKey)))
39- then throw("Not auth to add operator")
40- else if ((getStrByKey(secEmail) != NONE))
41- then throw("This operator already added")
42- else if ((sigVerify(toBytes((opEmail + opPass)), fromBase58String(opSign), fromBase58String(opPubKey)) == false))
43- then throw("Sign not verified")
44- else WriteSet([DataEntry(secEmail, secPass), DataEntry((secEmail + "_opKey"), opPubKey), DataEntry((secEmail + "_opSign"), opSign), DataEntry((secEmail + "_opLevel"), opLevel), DataEntry((secEmail + "_opAuth"), ("Allow,0," + toString(lastBlock.height)))])
38+ if ((toBase58String(i.caller.bytes) != "oo"))
39+ then throw(("this is " + toString(getNumberByKey(toBase58String(i.caller.bytes)))))
40+ else if ((pubKey != toBase58String(admPubKey)))
41+ then throw("Not auth to add operator")
42+ else if ((getStrByKey(secEmail) != NONE))
43+ then throw("This operator already added")
44+ else if (isDefined(transactionHeightById(i.transactionId)))
45+ then throw("BAD GUY")
46+ else if ((sigVerify(toBytes(((opEmail + opPass) + toBase58String(i.transactionId))), fromBase58String(opSign), fromBase58String(opPubKey)) == false))
47+ then throw("Sign not verified")
48+ else WriteSet([DataEntry(secEmail, secPass), DataEntry((secEmail + "_opKey"), opPubKey), DataEntry((secEmail + "_opSign"), opSign), DataEntry((secEmail + "_opLevel"), opLevel), DataEntry((secEmail + "_opAuth"), ("Allow,0," + toString(lastBlock.height)))])
4549 }
4650
4751
4852
4953 @Callable(i)
50-func resetOp (opEmail) = {
54+func resetOp (opEmail,resetKey) = {
5155 let pubKey = toBase58String(i.callerPublicKey)
5256 let pay = extract(i.payment)
5357 let secEmail = getSecureHash(opEmail)
5458 if ((getStrByKey(secEmail) == NONE))
5559 then throw("This operator does not exist")
56- else if (((getStrByKey(secEmail) + "_opKey") != pubKey))
57- then if (if ((isDefined(pay.assetId) == true))
58- then true
59- else (20000000 >= pay.amount))
60- then throw("Need at least 2 Waves for auth change password")
61- else TransferSet([ScriptTransfer(addressFromStringValue("3MpBUJbYZVA8iwoesCYaSytA82dVPyzVpmW"), 15000000, pay.assetId)])
62- else {
63- let auth = split(getStrByKey((secEmail + "_opAuth")), ",")
64- if ((parseIntValue(auth[2]) >= height))
60+ else {
61+ let auth = split(getStrByKey((secEmail + "_opAuth")), ",")
62+ if (((getStrByKey(secEmail) + "_opKey") != pubKey))
63+ then if (if ((isDefined(pay.assetId) == true))
64+ then true
65+ else ((20000000 * (parseIntValue(auth[1]) + 1)) >= pay.amount))
66+ then throw("Need at least 2 Waves for auth change password")
67+ else TransferSet([ScriptTransfer(addressFromStringValue("3MpBUJbYZVA8iwoesCYaSytA82dVPyzVpmW"), 15000000, pay.assetId)])
68+ else if ((parseIntValue(auth[2]) >= height))
6569 then throw((("There is already a request delivered to your email, wait " + toString((parseIntValue(auth[2]) - height))) + " minutes"))
6670 else if (if (if ((auth[0] == "Allow"))
6771 then true
7680 let multi = parseIntValue(auth[1])
7781 WriteSet([DataEntry((secEmail + "_opAuth"), ((("Recovery," + toString((multi + 1))) + ",") + toString((lastBlock.height + (multi * 60)))))])
7882 }
79- else WriteSet([DataEntry(secEmail, opEmail), DataEntry((secEmail + "_opAuth"), ("Recovery,1," + toString((lastBlock.height + 60))))])
80- }
83+ else WriteSet([DataEntry(secEmail, resetKey), DataEntry((secEmail + "_opAuth"), ("Recovery,1," + toString((lastBlock.height + 60))))])
84+ }
8185 }
8286
8387
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# SCRIPT_TYPE ACCOUNT #-}
33 {-# CONTENT_TYPE DAPP #-}
44 let NONE = "none"
55
66 let admPubKey = base58'5xiFtrMoXunfGTJwkeA26uAcy2ByUajvA7WQ7xNNSa8b'
77
88 func getNumberByKey (key) = {
99 let num = match getInteger(this, key) {
1010 case a: Int =>
1111 a
1212 case _ =>
1313 0
1414 }
1515 num
1616 }
1717
1818
1919 func getStrByKey (key) = {
2020 let str = match getString(this, key) {
2121 case a: String =>
2222 a
2323 case _ =>
2424 NONE
2525 }
2626 str
2727 }
2828
2929
3030 func getSecureHash (key) = toBase58String(keccak256(blake2b256(toBytes(key))))
3131
3232
3333 @Callable(i)
3434 func addOp (opEmail,opPass,opPubKey,opSign,opLevel) = {
3535 let pubKey = toBase58String(i.callerPublicKey)
3636 let secEmail = getSecureHash(opEmail)
3737 let secPass = getSecureHash(opPass)
38- if ((pubKey != toBase58String(admPubKey)))
39- then throw("Not auth to add operator")
40- else if ((getStrByKey(secEmail) != NONE))
41- then throw("This operator already added")
42- else if ((sigVerify(toBytes((opEmail + opPass)), fromBase58String(opSign), fromBase58String(opPubKey)) == false))
43- then throw("Sign not verified")
44- else WriteSet([DataEntry(secEmail, secPass), DataEntry((secEmail + "_opKey"), opPubKey), DataEntry((secEmail + "_opSign"), opSign), DataEntry((secEmail + "_opLevel"), opLevel), DataEntry((secEmail + "_opAuth"), ("Allow,0," + toString(lastBlock.height)))])
38+ if ((toBase58String(i.caller.bytes) != "oo"))
39+ then throw(("this is " + toString(getNumberByKey(toBase58String(i.caller.bytes)))))
40+ else if ((pubKey != toBase58String(admPubKey)))
41+ then throw("Not auth to add operator")
42+ else if ((getStrByKey(secEmail) != NONE))
43+ then throw("This operator already added")
44+ else if (isDefined(transactionHeightById(i.transactionId)))
45+ then throw("BAD GUY")
46+ else if ((sigVerify(toBytes(((opEmail + opPass) + toBase58String(i.transactionId))), fromBase58String(opSign), fromBase58String(opPubKey)) == false))
47+ then throw("Sign not verified")
48+ else WriteSet([DataEntry(secEmail, secPass), DataEntry((secEmail + "_opKey"), opPubKey), DataEntry((secEmail + "_opSign"), opSign), DataEntry((secEmail + "_opLevel"), opLevel), DataEntry((secEmail + "_opAuth"), ("Allow,0," + toString(lastBlock.height)))])
4549 }
4650
4751
4852
4953 @Callable(i)
50-func resetOp (opEmail) = {
54+func resetOp (opEmail,resetKey) = {
5155 let pubKey = toBase58String(i.callerPublicKey)
5256 let pay = extract(i.payment)
5357 let secEmail = getSecureHash(opEmail)
5458 if ((getStrByKey(secEmail) == NONE))
5559 then throw("This operator does not exist")
56- else if (((getStrByKey(secEmail) + "_opKey") != pubKey))
57- then if (if ((isDefined(pay.assetId) == true))
58- then true
59- else (20000000 >= pay.amount))
60- then throw("Need at least 2 Waves for auth change password")
61- else TransferSet([ScriptTransfer(addressFromStringValue("3MpBUJbYZVA8iwoesCYaSytA82dVPyzVpmW"), 15000000, pay.assetId)])
62- else {
63- let auth = split(getStrByKey((secEmail + "_opAuth")), ",")
64- if ((parseIntValue(auth[2]) >= height))
60+ else {
61+ let auth = split(getStrByKey((secEmail + "_opAuth")), ",")
62+ if (((getStrByKey(secEmail) + "_opKey") != pubKey))
63+ then if (if ((isDefined(pay.assetId) == true))
64+ then true
65+ else ((20000000 * (parseIntValue(auth[1]) + 1)) >= pay.amount))
66+ then throw("Need at least 2 Waves for auth change password")
67+ else TransferSet([ScriptTransfer(addressFromStringValue("3MpBUJbYZVA8iwoesCYaSytA82dVPyzVpmW"), 15000000, pay.assetId)])
68+ else if ((parseIntValue(auth[2]) >= height))
6569 then throw((("There is already a request delivered to your email, wait " + toString((parseIntValue(auth[2]) - height))) + " minutes"))
6670 else if (if (if ((auth[0] == "Allow"))
6771 then true
6872 else (auth[0] != "Recovery"))
6973 then if ((auth[0] != "Allow"))
7074 then true
7175 else (auth[0] == "Recovery")
7276 else false)
7377 then throw("Request not allowed")
7478 else if ((auth[0] == "Recovery"))
7579 then {
7680 let multi = parseIntValue(auth[1])
7781 WriteSet([DataEntry((secEmail + "_opAuth"), ((("Recovery," + toString((multi + 1))) + ",") + toString((lastBlock.height + (multi * 60)))))])
7882 }
79- else WriteSet([DataEntry(secEmail, opEmail), DataEntry((secEmail + "_opAuth"), ("Recovery,1," + toString((lastBlock.height + 60))))])
80- }
83+ else WriteSet([DataEntry(secEmail, resetKey), DataEntry((secEmail + "_opAuth"), ("Recovery,1," + toString((lastBlock.height + 60))))])
84+ }
8185 }
8286
8387

github/deemru/w8io/026f985 
44.21 ms