tx · FFqHhRsAEGRfwDNMU1unBpDGfQRKCooK28yyVv6HjUW2

3MpQWmaRq7s9k5HpbHMwGv8tXMJ8XfYa6F6:  -0.01400000 Waves

2020.08.10 16:47 [1126480] smart account 3MpQWmaRq7s9k5HpbHMwGv8tXMJ8XfYa6F6 > SELF 0.00000000 Waves

{ "type": 13, "id": "FFqHhRsAEGRfwDNMU1unBpDGfQRKCooK28yyVv6HjUW2", "fee": 1400000, "feeAssetId": null, "timestamp": 1597067219219, "version": 1, "sender": "3MpQWmaRq7s9k5HpbHMwGv8tXMJ8XfYa6F6", "senderPublicKey": "CAKJ5k7PNFstK6yQb3on3BDgYT2wQNSeCHSuPFMjkFJ3", "proofs": [ "3YENwBuqJyHPkGt1Suvu9TY2d5RMU8TcHBr9SBT3ffaunjMPSnWXo9XnimctKKfXQ1cqAgajB1tSaaP9Z4soLSEv", "5X7NZDXnJvthZYQViUPjRYsQbzuKbdU1k9p6Lg77s6gny1D1p8DEXYn8nhZxS3FB4vRWDUD7LGRtp7ggHnirmZMt", "4er6FK94dLw66RJFh3DQWBFxpXgnQvD7dJ3PA1ycS6LnmcGUd6cY9NR42xk2C5Ucg8qjQkYQQPACVPFw9joFZPB6" ], "script": "base64:AwQAAAALYWRkcmVzc0Jvb2sJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVRWgdR5NBM7vuJoxo7QLI34uXJ2wFdvAd4EAAAAE3doaXRlbGlzdEFkZHJlc3NLZXkCAAAAEHdoaXRlbGlzdEFkZHJlc3MEAAAAF2RBcHBXaGl0ZWxpc3RBZGRyZXNzS2V5AgAAABRkQXBwV2hpdGVsaXN0QWRkcmVzcwQAAAARbWF0Y2hlckFkZHJlc3NLZXkCAAAADm1hdGNoZXJBZGRyZXNzBAAAABFnYXRld2F5QWRkcmVzc0tleQIAAAAOZ2F0ZXdheUFkZHJlc3MEAAAAFmdhdGV3YXlDb250cm9sQXNzZXRLZXkCAAAAE2dhdGV3YXlDb250cm9sQXNzZXQEAAAACnZhb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bWF0Y2gwAgAAABJSZWlzc3VlVHJhbnNhY3Rpb24EAAAAAnR4BQAAAAckbWF0Y2gwBwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAPQnVyblRyYW5zYWN0aW9uBAAAAAJ0eAUAAAAHJG1hdGNoMAcDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAE0V4Y2hhbmdlVHJhbnNhY3Rpb24EAAAAAnR4BQAAAAckbWF0Y2gwBwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAXSW52b2tlU2NyaXB0VHJhbnNhY3Rpb24EAAAAAnR4BQAAAAckbWF0Y2gwBAAAAAckbWF0Y2gxCAUAAAACdHgAAAAHcGF5bWVudAMJAAABAAAAAgUAAAAHJG1hdGNoMQIAAAAPQXR0YWNoZWRQYXltZW50BAAAAAFhBQAAAAckbWF0Y2gxBAAAAAckbWF0Y2gyCQAEGgAAAAIJAQAAABJnZXRBZGRyZXNzRnJvbUJvb2sAAAABBQAAABdkQXBwV2hpdGVsaXN0QWRkcmVzc0tleQkAAlgAAAABCAkABCQAAAABCAUAAAACdHgAAAAEZEFwcAAAAAVieXRlcwMJAAABAAAAAgUAAAAHJG1hdGNoMgIAAAADSW50BAAAAAZ1bnVzZWQFAAAAByRtYXRjaDIGBwYJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAAACAUAAAACdHgAAAAPc2VuZGVyUHVibGljS2V5ILH5Jg==", "chainId": 84, "height": 1126480, "spentComplexity": 0 } View: original | compacted Prev: 2APNH94JeMChEkJAexC8fa8EGGfPM1Gs19j8Qd1u4h6F Next: none Diff:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# CONTENT_TYPE EXPRESSION #-}
3-let matcherAddress = addressFromString("3Ms8fSfAxBLDjKvNVgACRzQoBLCtCWxtawu")
4-let matcherPublicKey = base58'6d1nbhBxLCxjUyL9xXcX2VVxj2kcKiYny7VqH4FwbApv'
5-let gatewayAddress = addressFromString("3Mrhtzv9KEtjx4mG47oxgjahHKW33oTntEV")
6-let whitelistAddress = addressFromString("3N6DwWxT82nGJUwBwd7L514r2u71gr7WhwJ")
7-let dAppWhitelistAddress = Address(base58'3N1SPvLZgv6FMfe5WNUtnPzt3okYxcJhYnR')
8-let gatewayControlAssetAddress = base58'3w8UGTKzu3YvwRrvWeDuXkUVxdg1RuX1VCy6QRw86Fw4'
9-let pAddress1 = addressFromString("3NCVDaT1ASbRd42hBSw4EG6ojGVRGtvMiz1")
10-let pAddress2 = addressFromString("3Ms2kTAxdrcXDxwedfbNjSi6ewGCUqt3heZ")
11-let pAddress3 = addressFromString("3N6ognm7xnQSFiownS1Df1LacJUQXvfDFLe")
12-let pAddress4 = addressFromString("3MtVCmN9MZbWf9qxiMFoEPBrdc2fLp3SvuC")
13-let pAddress5 = addressFromString("3MuWG8gsTK4RQBsm97sMCuUXW99JvRxwYSg")
3+let addressBook = Address(base58'3MwoVRAPfC2NKuuYJKHVAVtUFhq8MyTEfQh')
4+let whitelistAddressKey = "whitelistAddress"
5+let dAppWhitelistAddressKey = "dAppWhitelistAddress"
6+let matcherAddressKey = "matcherAddress"
7+let gatewayAddressKey = "gatewayAddress"
8+let gatewayControlAssetKey = "gatewayControlAsset"
149 let validState = 1000
15-let ver = "2.0.0-testnet"
10+let ver = "5.0.4"
11+func getAddressFromBook (key) = match getString(addressBook, key) {
12+ case a: String =>
13+ Address(fromBase58String(a))
14+ case _ =>
15+ throw("no key")
16+}
17+
18+func getAssetFromAddressBook () = match getString(extract(addressBook), gatewayControlAssetKey) {
19+ case a: String =>
20+ toBytes(a)
21+ case _ =>
22+ throw("no key")
23+}
24+
1625 match tx {
1726 case o: Order =>
1827 if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
19- then (o.matcherPublicKey == matcherPublicKey)
28+ then (addressFromPublicKey(o.matcherPublicKey) == getAddressFromBook(matcherAddressKey))
2029 else false
2130 case tx: TransferTransaction =>
2231 if (!(sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)))
2332 then throw("Transaction must be signed by owner")
2433 else {
25- let userState = getInteger(extract(whitelistAddress), toBase58String(tx.sender.bytes))
34+ let userState = getInteger(getAddressFromBook(whitelistAddressKey), toBase58String(tx.sender.bytes))
2635 if (!(isDefined(userState)))
2736 then throw("Address not in whitelist")
2837 else if ((userState != validState))
3039 else if (!(isDefined(tx.assetId)))
3140 then {
3241 let key = (toBase58String(tx.sender.bytes) + "_WAVES")
33- let minAmount = getInteger(extract(whitelistAddress), key)
42+ let minAmount = getInteger(getAddressFromBook(whitelistAddressKey), key)
3443 if (isDefined(minAmount))
3544 then {
3645 let curBalance = wavesBalance(extract(tx.sender))
4049 }
4150 else {
4251 let keyOverall = "res_WAVES"
43- let minAmountOverall = getInteger(extract(whitelistAddress), keyOverall)
52+ let minAmountOverall = getInteger(getAddressFromBook(whitelistAddressKey), keyOverall)
4453 if (isDefined(minAmountOverall))
4554 then {
4655 let curBalance = wavesBalance(extract(tx.sender))
5160 else true
5261 }
5362 }
54- else if ((tx.assetId == gatewayControlAssetAddress))
55- then (tx.recipient == gatewayAddress)
63+ else if ((tx.assetId == getAssetFromAddressBook()))
64+ then (tx.recipient == getAddressFromBook(gatewayAddressKey))
5665 else {
5766 let white1List = toBase58String(tx.sender.bytes)
5867 let assetTxt = toBase58String(extract(tx.assetId))
5968 let white1ListAsset = ((white1List + "_") + assetTxt)
6069 let white1ListOverall = ("res_" + assetTxt)
61- let white1ListAssetEntry = getInteger(extract(whitelistAddress), white1ListAsset)
70+ let white1ListAssetEntry = getInteger(getAddressFromBook(whitelistAddressKey), white1ListAsset)
6271 if (!(isDefined(white1ListAssetEntry)))
6372 then {
64- let white1ListOverallEntry = getInteger(extract(whitelistAddress), white1ListOverall)
73+ let white1ListOverallEntry = getInteger(getAddressFromBook(whitelistAddressKey), white1ListOverall)
6574 if (!(isDefined(white1ListOverallEntry)))
6675 then true
6776 else {
8089 }
8190 }
8291 case tx: SetScriptTransaction =>
83- let pKey1Signed = if (isDefined(getInteger(extract(pAddress1), toBase58String(tx.id))))
92+ let txId = toBase58String(tx.id)
93+ let pAddress1 = getAddressFromBook("pAddress1")
94+ let pAddress2 = getAddressFromBook("pAddress2")
95+ let pAddress3 = getAddressFromBook("pAddress3")
96+ let pAddress4 = getAddressFromBook("pAddress4")
97+ let pAddress5 = getAddressFromBook("pAddress5")
98+ let pAddress6 = getAddressFromBook("pAddress6")
99+ let pAddress7 = getAddressFromBook("pAddress7")
100+ let pAddress8 = getAddressFromBook("pAddress8")
101+ let pKey1Signed = if (isDefined(getInteger(pAddress1, txId)))
84102 then 1
85103 else 0
86- let pKey2Signed = if (isDefined(getInteger(extract(pAddress2), toBase58String(tx.id))))
104+ let pKey2Signed = if (isDefined(getInteger(pAddress2, txId)))
87105 then 1
88106 else 0
89- let pKey3Signed = if (isDefined(getInteger(extract(pAddress3), toBase58String(tx.id))))
107+ let pKey3Signed = if (isDefined(getInteger(pAddress3, txId)))
90108 then 1
91109 else 0
92- let pKey4Signed = if (isDefined(getInteger(extract(pAddress4), toBase58String(tx.id))))
110+ let pKey4Signed = if (isDefined(getInteger(pAddress4, txId)))
93111 then 1
94112 else 0
95- let pKey5Signed = if (isDefined(getInteger(extract(pAddress5), toBase58String(tx.id))))
113+ let pKey5Signed = if (isDefined(getInteger(pAddress5, txId)))
96114 then 1
97115 else 0
98- (((((pKey1Signed + pKey2Signed) + pKey3Signed) + pKey4Signed) + pKey5Signed) >= 3)
116+ let pKey6Signed = if (isDefined(getInteger(pAddress6, txId)))
117+ then 1
118+ else 0
119+ let pKey7Signed = if (isDefined(getInteger(pAddress7, txId)))
120+ then 1
121+ else 0
122+ let pKey8Signed = if (isDefined(getInteger(pAddress8, txId)))
123+ then 1
124+ else 0
125+ ((((((((pKey1Signed + pKey2Signed) + pKey3Signed) + pKey4Signed) + pKey5Signed) + pKey6Signed) + pKey7Signed) + pKey8Signed) >= 3)
99126 case tx: LeaseTransaction =>
100127 false
101128 case tx: SponsorFeeTransaction =>
113140 case tx: InvokeScriptTransaction =>
114141 match tx.payment {
115142 case a: AttachedPayment =>
116- match getInteger(dAppWhitelistAddress, toBase58String(addressFromRecipient(tx.dApp).bytes)) {
143+ match getInteger(getAddressFromBook(dAppWhitelistAddressKey), toBase58String(addressFromRecipient(tx.dApp).bytes)) {
117144 case unused: Int =>
118145 true
119146 case _ =>
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 3 #-}
22 {-# CONTENT_TYPE EXPRESSION #-}
3-let matcherAddress = addressFromString("3Ms8fSfAxBLDjKvNVgACRzQoBLCtCWxtawu")
4-let matcherPublicKey = base58'6d1nbhBxLCxjUyL9xXcX2VVxj2kcKiYny7VqH4FwbApv'
5-let gatewayAddress = addressFromString("3Mrhtzv9KEtjx4mG47oxgjahHKW33oTntEV")
6-let whitelistAddress = addressFromString("3N6DwWxT82nGJUwBwd7L514r2u71gr7WhwJ")
7-let dAppWhitelistAddress = Address(base58'3N1SPvLZgv6FMfe5WNUtnPzt3okYxcJhYnR')
8-let gatewayControlAssetAddress = base58'3w8UGTKzu3YvwRrvWeDuXkUVxdg1RuX1VCy6QRw86Fw4'
9-let pAddress1 = addressFromString("3NCVDaT1ASbRd42hBSw4EG6ojGVRGtvMiz1")
10-let pAddress2 = addressFromString("3Ms2kTAxdrcXDxwedfbNjSi6ewGCUqt3heZ")
11-let pAddress3 = addressFromString("3N6ognm7xnQSFiownS1Df1LacJUQXvfDFLe")
12-let pAddress4 = addressFromString("3MtVCmN9MZbWf9qxiMFoEPBrdc2fLp3SvuC")
13-let pAddress5 = addressFromString("3MuWG8gsTK4RQBsm97sMCuUXW99JvRxwYSg")
3+let addressBook = Address(base58'3MwoVRAPfC2NKuuYJKHVAVtUFhq8MyTEfQh')
4+let whitelistAddressKey = "whitelistAddress"
5+let dAppWhitelistAddressKey = "dAppWhitelistAddress"
6+let matcherAddressKey = "matcherAddress"
7+let gatewayAddressKey = "gatewayAddress"
8+let gatewayControlAssetKey = "gatewayControlAsset"
149 let validState = 1000
15-let ver = "2.0.0-testnet"
10+let ver = "5.0.4"
11+func getAddressFromBook (key) = match getString(addressBook, key) {
12+ case a: String =>
13+ Address(fromBase58String(a))
14+ case _ =>
15+ throw("no key")
16+}
17+
18+func getAssetFromAddressBook () = match getString(extract(addressBook), gatewayControlAssetKey) {
19+ case a: String =>
20+ toBytes(a)
21+ case _ =>
22+ throw("no key")
23+}
24+
1625 match tx {
1726 case o: Order =>
1827 if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
19- then (o.matcherPublicKey == matcherPublicKey)
28+ then (addressFromPublicKey(o.matcherPublicKey) == getAddressFromBook(matcherAddressKey))
2029 else false
2130 case tx: TransferTransaction =>
2231 if (!(sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)))
2332 then throw("Transaction must be signed by owner")
2433 else {
25- let userState = getInteger(extract(whitelistAddress), toBase58String(tx.sender.bytes))
34+ let userState = getInteger(getAddressFromBook(whitelistAddressKey), toBase58String(tx.sender.bytes))
2635 if (!(isDefined(userState)))
2736 then throw("Address not in whitelist")
2837 else if ((userState != validState))
2938 then throw("User not in valid state")
3039 else if (!(isDefined(tx.assetId)))
3140 then {
3241 let key = (toBase58String(tx.sender.bytes) + "_WAVES")
33- let minAmount = getInteger(extract(whitelistAddress), key)
42+ let minAmount = getInteger(getAddressFromBook(whitelistAddressKey), key)
3443 if (isDefined(minAmount))
3544 then {
3645 let curBalance = wavesBalance(extract(tx.sender))
3746 if ((extract(minAmount) > (curBalance - tx.amount)))
3847 then throw("Unable to send such amount (type=2)")
3948 else true
4049 }
4150 else {
4251 let keyOverall = "res_WAVES"
43- let minAmountOverall = getInteger(extract(whitelistAddress), keyOverall)
52+ let minAmountOverall = getInteger(getAddressFromBook(whitelistAddressKey), keyOverall)
4453 if (isDefined(minAmountOverall))
4554 then {
4655 let curBalance = wavesBalance(extract(tx.sender))
4756 if ((extract(minAmountOverall) > (curBalance - tx.amount)))
4857 then throw("Unable to send such amount (type=1)")
4958 else true
5059 }
5160 else true
5261 }
5362 }
54- else if ((tx.assetId == gatewayControlAssetAddress))
55- then (tx.recipient == gatewayAddress)
63+ else if ((tx.assetId == getAssetFromAddressBook()))
64+ then (tx.recipient == getAddressFromBook(gatewayAddressKey))
5665 else {
5766 let white1List = toBase58String(tx.sender.bytes)
5867 let assetTxt = toBase58String(extract(tx.assetId))
5968 let white1ListAsset = ((white1List + "_") + assetTxt)
6069 let white1ListOverall = ("res_" + assetTxt)
61- let white1ListAssetEntry = getInteger(extract(whitelistAddress), white1ListAsset)
70+ let white1ListAssetEntry = getInteger(getAddressFromBook(whitelistAddressKey), white1ListAsset)
6271 if (!(isDefined(white1ListAssetEntry)))
6372 then {
64- let white1ListOverallEntry = getInteger(extract(whitelistAddress), white1ListOverall)
73+ let white1ListOverallEntry = getInteger(getAddressFromBook(whitelistAddressKey), white1ListOverall)
6574 if (!(isDefined(white1ListOverallEntry)))
6675 then true
6776 else {
6877 let cur1Balance = assetBalance(tx.sender, tx.assetId)
6978 if ((extract(white1ListOverallEntry) > (cur1Balance - tx.amount)))
7079 then throw("Unable to send such amount (type=1)")
7180 else true
7281 }
7382 }
7483 else {
7584 let cur1Balance = assetBalance(tx.sender, tx.assetId)
7685 if ((extract(white1ListAssetEntry) > (cur1Balance - tx.amount)))
7786 then throw("Unable to send such amount (type=2)")
7887 else true
7988 }
8089 }
8190 }
8291 case tx: SetScriptTransaction =>
83- let pKey1Signed = if (isDefined(getInteger(extract(pAddress1), toBase58String(tx.id))))
92+ let txId = toBase58String(tx.id)
93+ let pAddress1 = getAddressFromBook("pAddress1")
94+ let pAddress2 = getAddressFromBook("pAddress2")
95+ let pAddress3 = getAddressFromBook("pAddress3")
96+ let pAddress4 = getAddressFromBook("pAddress4")
97+ let pAddress5 = getAddressFromBook("pAddress5")
98+ let pAddress6 = getAddressFromBook("pAddress6")
99+ let pAddress7 = getAddressFromBook("pAddress7")
100+ let pAddress8 = getAddressFromBook("pAddress8")
101+ let pKey1Signed = if (isDefined(getInteger(pAddress1, txId)))
84102 then 1
85103 else 0
86- let pKey2Signed = if (isDefined(getInteger(extract(pAddress2), toBase58String(tx.id))))
104+ let pKey2Signed = if (isDefined(getInteger(pAddress2, txId)))
87105 then 1
88106 else 0
89- let pKey3Signed = if (isDefined(getInteger(extract(pAddress3), toBase58String(tx.id))))
107+ let pKey3Signed = if (isDefined(getInteger(pAddress3, txId)))
90108 then 1
91109 else 0
92- let pKey4Signed = if (isDefined(getInteger(extract(pAddress4), toBase58String(tx.id))))
110+ let pKey4Signed = if (isDefined(getInteger(pAddress4, txId)))
93111 then 1
94112 else 0
95- let pKey5Signed = if (isDefined(getInteger(extract(pAddress5), toBase58String(tx.id))))
113+ let pKey5Signed = if (isDefined(getInteger(pAddress5, txId)))
96114 then 1
97115 else 0
98- (((((pKey1Signed + pKey2Signed) + pKey3Signed) + pKey4Signed) + pKey5Signed) >= 3)
116+ let pKey6Signed = if (isDefined(getInteger(pAddress6, txId)))
117+ then 1
118+ else 0
119+ let pKey7Signed = if (isDefined(getInteger(pAddress7, txId)))
120+ then 1
121+ else 0
122+ let pKey8Signed = if (isDefined(getInteger(pAddress8, txId)))
123+ then 1
124+ else 0
125+ ((((((((pKey1Signed + pKey2Signed) + pKey3Signed) + pKey4Signed) + pKey5Signed) + pKey6Signed) + pKey7Signed) + pKey8Signed) >= 3)
99126 case tx: LeaseTransaction =>
100127 false
101128 case tx: SponsorFeeTransaction =>
102129 false
103130 case tx: MassTransferTransaction =>
104131 false
105132 case tx: IssueTransaction =>
106133 false
107134 case tx: ReissueTransaction =>
108135 false
109136 case tx: BurnTransaction =>
110137 false
111138 case tx: ExchangeTransaction =>
112139 false
113140 case tx: InvokeScriptTransaction =>
114141 match tx.payment {
115142 case a: AttachedPayment =>
116- match getInteger(dAppWhitelistAddress, toBase58String(addressFromRecipient(tx.dApp).bytes)) {
143+ match getInteger(getAddressFromBook(dAppWhitelistAddressKey), toBase58String(addressFromRecipient(tx.dApp).bytes)) {
117144 case unused: Int =>
118145 true
119146 case _ =>
120147 false
121148 }
122149 case _ =>
123150 true
124151 }
125152 case _ =>
126153 sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
127154 }

github/deemru/w8io/026f985 
34.80 ms