tx · 4sQf9t3ka3Tb81Td3yj8Pttodipxr6yk66gi95cTaLkq

3N3AY9nVnberKPbN9sknhcEBQxygGmkUgNX:  -0.01000000 Waves

2020.04.22 19:37 [965962] smart account 3N3AY9nVnberKPbN9sknhcEBQxygGmkUgNX > SELF 0.00000000 Waves

{ "type": 13, "id": "4sQf9t3ka3Tb81Td3yj8Pttodipxr6yk66gi95cTaLkq", "fee": 1000000, "feeAssetId": null, "timestamp": 1587573423162, "version": 1, "sender": "3N3AY9nVnberKPbN9sknhcEBQxygGmkUgNX", "senderPublicKey": "2njDeTxdhvFz15MdpoQxQ8WoPbv6HpJeoFRx4jxMNG2t", "proofs": [ "4RSaZ5LpyZqso47zy4i7du9gb6ZkZvfTMsLTvjw5QqGpPhJFnjqbKM2uhA9HnAMHzXYcPJsVzuZuDMP1dWt4Rz5C" ], "script": "base64:AwQAAAALYWRkcmVzc0Jvb2sJAQAAAAdBZGRyZXNzAAAAAQEAAAAaAVRWgdR5NBM7vuJoxo7QLI34uXJ2wFdvAd4EAAAAE3doaXRlbGlzdEFkZHJlc3NLZXkCAAAAEHdoaXRlbGlzdEFkZHJlc3MEAAAAF2RBcHBXaGl0ZWxpc3RBZGRyZXNzS2V5AgAAABRkQXBwV2hpdGVsaXN0QWRkcmVzcwQAAAARbWF0Y2hlckFkZHJlc3NLZXkCAAAADm1hdGNoZXJBZGRyZXNzBAAAABFnYXRld2F5QWRkcmVzc0tleQIAAAAOZ2F0ZXdheUFkZHJlc3MEAAAAFmdhdGV3YXlDb250cm9sQXNzZXRLZXkCAAAAE2dhdGV3YXlDb250cm9sQXNzZXQEAAAACnZhbGlkU3RhdGUAAAAAAAAAA+gEAAAAA3ZlcgIAAAANNS4wLjAtdGVzdG5ldAoBAAAAE2dldEFkZHJlc3NCb29rVmFsdWUAAAABAAAAA2tleQQAAAAHJG1hdGNoMAkABB0AAAACCQEAAAAHZXh0cmFjdAAAAAEFAAAAC2FkZHJlc3NCb29rBQAAAANrZXkDCQAAAQAA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JYm9keUJ5dGVzCQABkQAAAAIIBQAAAAJ0eAAAAAZwcm9vZnMAAAAAAAAAAAAIBQAAAAJ0eAAAAA9zZW5kZXJQdWJsaWNLZXmV/GRL", "chainId": 84, "height": 965962, "spentComplexity": 0 } View: original | compacted Prev: none Next: none Full:
OldNewDifferences
1-# no script
1+{-# STDLIB_VERSION 3 #-}
2+{-# CONTENT_TYPE EXPRESSION #-}
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"
9+let validState = 1000
10+let ver = "5.0.0-testnet"
11+func getAddressBookValue (key) = match getString(extract(addressBook), key) {
12+ case a: String =>
13+ extract(addressFromString(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+
25+match tx {
26+ case o: Order =>
27+ if (sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey))
28+ then (addressFromPublicKey(o.matcherPublicKey) == getAddressBookValue(matcherAddressKey))
29+ else false
30+ case tx: TransferTransaction =>
31+ if (!(sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)))
32+ then throw("Transaction must be signed by owner")
33+ else {
34+ let userState = getInteger(getAddressBookValue(whitelistAddressKey), toBase58String(tx.sender.bytes))
35+ if (!(isDefined(userState)))
36+ then throw("Address not in whitelist")
37+ else if ((userState != validState))
38+ then throw("User not in valid state")
39+ else if (!(isDefined(tx.assetId)))
40+ then {
41+ let key = (toBase58String(tx.sender.bytes) + "_WAVES")
42+ let minAmount = getInteger(getAddressBookValue(whitelistAddressKey), key)
43+ if (isDefined(minAmount))
44+ then {
45+ let curBalance = wavesBalance(extract(tx.sender))
46+ if ((extract(minAmount) > (curBalance - tx.amount)))
47+ then throw("Unable to send such amount (type=2)")
48+ else true
49+ }
50+ else {
51+ let keyOverall = "res_WAVES"
52+ let minAmountOverall = getInteger(getAddressBookValue(whitelistAddressKey), keyOverall)
53+ if (isDefined(minAmountOverall))
54+ then {
55+ let curBalance = wavesBalance(extract(tx.sender))
56+ if ((extract(minAmountOverall) > (curBalance - tx.amount)))
57+ then throw("Unable to send such amount (type=1)")
58+ else true
59+ }
60+ else true
61+ }
62+ }
63+ else if ((tx.assetId == getAssetFromAddressBook()))
64+ then (tx.recipient == getAddressBookValue(gatewayAddressKey))
65+ else {
66+ let white1List = toBase58String(tx.sender.bytes)
67+ let assetTxt = toBase58String(extract(tx.assetId))
68+ let white1ListAsset = ((white1List + "_") + assetTxt)
69+ let white1ListOverall = ("res_" + assetTxt)
70+ let white1ListAssetEntry = getInteger(getAddressBookValue(whitelistAddressKey), white1ListAsset)
71+ if (!(isDefined(white1ListAssetEntry)))
72+ then {
73+ let white1ListOverallEntry = getInteger(getAddressBookValue(whitelistAddressKey), white1ListOverall)
74+ if (!(isDefined(white1ListOverallEntry)))
75+ then true
76+ else {
77+ let cur1Balance = assetBalance(tx.sender, tx.assetId)
78+ if ((extract(white1ListOverallEntry) > (cur1Balance - tx.amount)))
79+ then throw("Unable to send such amount (type=1)")
80+ else true
81+ }
82+ }
83+ else {
84+ let cur1Balance = assetBalance(tx.sender, tx.assetId)
85+ if ((extract(white1ListAssetEntry) > (cur1Balance - tx.amount)))
86+ then throw("Unable to send such amount (type=2)")
87+ else true
88+ }
89+ }
90+ }
91+ case tx: SetScriptTransaction =>
92+ let pAddress1 = getAddressBookValue("pAddress1")
93+ let pAddress2 = getAddressBookValue("pAddress2")
94+ let pAddress3 = getAddressBookValue("pAddress3")
95+ let pAddress4 = getAddressBookValue("pAddress4")
96+ let pAddress5 = getAddressBookValue("pAddress5")
97+ let pKey1Signed = if (isDefined(getInteger(pAddress1, toBase58String(tx.id))))
98+ then 1
99+ else 0
100+ let pKey2Signed = if (isDefined(getInteger(pAddress2, toBase58String(tx.id))))
101+ then 1
102+ else 0
103+ let pKey3Signed = if (isDefined(getInteger(pAddress3, toBase58String(tx.id))))
104+ then 1
105+ else 0
106+ let pKey4Signed = if (isDefined(getInteger(pAddress4, toBase58String(tx.id))))
107+ then 1
108+ else 0
109+ let pKey5Signed = if (isDefined(getInteger(pAddress5, toBase58String(tx.id))))
110+ then 1
111+ else 0
112+ (((((pKey1Signed + pKey2Signed) + pKey3Signed) + pKey4Signed) + pKey5Signed) >= 3)
113+ case tx: LeaseTransaction =>
114+ false
115+ case tx: SponsorFeeTransaction =>
116+ false
117+ case tx: MassTransferTransaction =>
118+ false
119+ case tx: IssueTransaction =>
120+ false
121+ case tx: ReissueTransaction =>
122+ false
123+ case tx: BurnTransaction =>
124+ false
125+ case tx: ExchangeTransaction =>
126+ false
127+ case tx: InvokeScriptTransaction =>
128+ match tx.payment {
129+ case a: AttachedPayment =>
130+ match getInteger(getAddressBookValue(dAppWhitelistAddressKey), toBase58String(addressFromRecipient(tx.dApp).bytes)) {
131+ case unused: Int =>
132+ true
133+ case _ =>
134+ false
135+ }
136+ case _ =>
137+ true
138+ }
139+ case _ =>
140+ sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey)
141+}

github/deemru/w8io/026f985 
42.58 ms