tx · 4zQ5KYA39GHnWQsnYLxQsgAA22FWdjhUKfo3TCawT6wp

3N9hKwuwtECrpiMAfy6krVKf2ovU1Si9ssu:  -1.10000000 Waves

2019.03.17 21:36 [540574] smart asset 3N9hKwuwtECrpiMAfy6krVKf2ovU1Si9ssu > SELF 0.00000000 SMTH

{ "type": 15, "id": "4zQ5KYA39GHnWQsnYLxQsgAA22FWdjhUKfo3TCawT6wp", "fee": 110000000, "feeAssetId": null, "timestamp": 1552847770605, "version": 1, "sender": "3N9hKwuwtECrpiMAfy6krVKf2ovU1Si9ssu", "senderPublicKey": "B1jCjJgfsJPUci2LqspvGwEFV7jFKVNf2NwRdVpWJkAb", "proofs": [ "S829HFcnKRhFiffeBNXKHcqmebWnjbqPnH4eitEu2tPsXay6sbgppUDiPXpyrAgevodSVVYs8SVx4XNYs8h7ANm" ], "assetId": "5aC18jdnA4KLsrtWQP3RuU9QhWvnmaMAFQq5fQjwJ49T", "script": "base64:AQQAAAAObWF0Y2hlckFkZHJlc3MJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAECAAAAIzNOQzJEUlVaRHNCYTRVeFZ1Wm9ldUxBckFoNVhuQ3VuV1lNBAAAAA5nYXRld2F5QWRkcmVzcwkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQIAAAAjM045aEt3dXd0RUNycGlNQWZ5NmtyVktmMm92VTFTaTlzc3UEAAAADVdoaXRlbGlzdEFkZHIJAQAAABFhZGRyZXNzRnJvbVN0cmluZwAAAAECAAAAIzNON1RtUEZFMVFSS0V0S05CY1F2UGlIcUdkdm03UkthNlY5BAAAAAp2YWxpZFN0YXRlAAAAAAAAAAPoBAAAAAckbWF0Y2gwBQAAAAJ0eAMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAAXTWFzc1RyYW5zZmVyVHJhbnNhY3Rpb24EAAAAAnR4BQAAAAckbWF0Y2gwBwMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATVHJhbnNmZXJUcmFuc2Fj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FjdAAAAAEFAAAAFHdoaXRlMUxpc3RBc3NldEVudHJ5CQAAZQAAAAIFAAAAC2N1cjFCYWxhbmNlCAUAAAACdHgAAAAGYW1vdW50CQAAAgAAAAECAAAAJkNhbm5vdCBzZW5kIGFtb3VudDogdW5kZXIgcmVzdHJpY3Rpb25zBgMJAAABAAAAAgUAAAAHJG1hdGNoMAIAAAATRXhjaGFuZ2VUcmFuc2FjdGlvbgQAAAACdHgFAAAAByRtYXRjaDAEAAAAEG91dGNvbWluZzFBbW91bnQIBQAAAAJ0eAAAAAZhbW91bnQEAAAAEG91dGNvbWluZzJBbW91bnQJAABrAAAAAwgFAAAAAnR4AAAABmFtb3VudAgFAAAAAnR4AAAABXByaWNlAAAAAAAF9eEACQAAAgAAAAEJAAEsAAAAAgkAASwAAAACCQABLAAAAAICAAAABGFtdD0JAAGkAAAAAQUAAAAQb3V0Y29taW5nMUFtb3VudAIAAAABLAkAAaQAAAABBQAAABBvdXRjb21pbmcyQW1vdW50BicRsc4=", "chainId": 84, "height": 540574, "spentComplexity": 0 } View: original | compacted Prev: vY5WcY6hSnWk1Jx5s3akPr7dTwH1ACgTqrY5C6fuuGC Next: 33bbjfBkyBssjWzfCeJVtCARSRJZrFq6HRvhjAYy5uKg Diff:
OldNewDifferences
3535 }
3636 }
3737 case tx: ExchangeTransaction =>
38- let outcoming1AssetId = tx.buyOrder.assetPair.amountAsset
39- let outcoming1Account = tx.buyOrder.sender
40- let outcoming2AssetId = tx.sellOrder.assetPair.priceAsset
41- let outcoming2Account = tx.sellOrder.sender
4238 let outcoming1Amount = tx.amount
4339 let outcoming2Amount = fraction(tx.amount, tx.price, 100000000)
44- let white1List = toBase58String(outcoming1Account.bytes)
45- let white1ListAsset = if (isDefined(outcoming1AssetId))
46- then (white1List + toBase58String(extract(outcoming1AssetId)))
47- else (white1List + "_WAVES")
48- let white2List = toBase58String(outcoming2Account.bytes)
49- let white2ListAsset = if (isDefined(outcoming2AssetId))
50- then (white2List + toBase58String(extract(outcoming2AssetId)))
51- else (white2List + "_WAVES")
52- let is1Waves = !(isDefined(outcoming1AssetId))
53- let is2Waves = !(isDefined(outcoming2AssetId))
54- let white1ListEntry = getInteger(extract(WhitelistAddr), toBase58String(outcoming1Account.bytes))
55- let white2ListEntry = getInteger(extract(WhitelistAddr), toBase58String(outcoming2Account.bytes))
56- if (if (!(isDefined(white1ListEntry)))
57- then true
58- else (white1ListEntry != validState))
59- then throw((("Account " + toBase58String(outcoming1Account.bytes)) + " not in white list"))
60- else if (if (!(isDefined(white2ListEntry)))
61- then true
62- else (white2ListEntry != validState))
63- then throw((("Account " + toBase58String(outcoming2Account.bytes)) + " not in white list"))
64- else if (!(isDefined(getInteger(extract(WhitelistAddr), toBase58String(outcoming2Account.bytes)))))
65- then throw((("Account " + toBase58String(outcoming2Account.bytes)) + " not in white list"))
66- else {
67- let min1Amount = getInteger(extract(WhitelistAddr), white1ListAsset)
68- let min2Amount = getInteger(extract(WhitelistAddr), white2ListAsset)
69- if (isDefined(min1Amount))
70- then {
71- let cur1Balance = if (is1Waves)
72- then wavesBalance(outcoming1Account)
73- else assetBalance(outcoming1Account, outcoming1AssetId)
74- if ((extract(min1Amount) > (cur1Balance - outcoming1Amount)))
75- then throw("Restricted min1 balance")
76- else true
77- }
78- else if (isDefined(min2Amount))
79- then {
80- let cur2Balance = if (is2Waves)
81- then wavesBalance(outcoming2Account)
82- else assetBalance(outcoming2Account, outcoming2AssetId)
83- if ((extract(min2Amount) > (cur2Balance - outcoming2Amount)))
84- then throw("Restricted min2 balance")
85- else true
86- }
87- else true
88- }
89- case tx: SetAssetScriptTransaction =>
90- true
40+ throw(((("amt=" + toString(outcoming1Amount)) + ",") + toString(outcoming2Amount)))
9141 case _ =>
9242 true
9343 }
Full:
OldNewDifferences
11 {-# STDLIB_VERSION 1 #-}
22 {-# CONTENT_TYPE EXPRESSION #-}
33 let matcherAddress = addressFromString("3NC2DRUZDsBa4UxVuZoeuLArAh5XnCunWYM")
44 let gatewayAddress = addressFromString("3N9hKwuwtECrpiMAfy6krVKf2ovU1Si9ssu")
55 let WhitelistAddr = addressFromString("3N7TmPFE1QRKEtKNBcQvPiHqGdvm7RKa6V9")
66 let validState = 1000
77 match tx {
88 case tx: MassTransferTransaction =>
99 false
1010 case tx: TransferTransaction =>
1111 if (if ((tx.sender != gatewayAddress))
1212 then (tx.recipient != gatewayAddress)
1313 else false)
1414 then false
1515 else if ((tx.sender == gatewayAddress))
1616 then true
1717 else {
1818 let white1List = toBase58String(tx.sender.bytes)
1919 let white1ListAsset = (white1List + toBase58String(extract(tx.assetId)))
2020 let white1ListEntry = getInteger(extract(WhitelistAddr), white1List)
2121 if (!(isDefined(white1ListEntry)))
2222 then throw("Sender not in white list")
2323 else if ((white1ListEntry != validState))
2424 then throw("Sender not in valid state")
2525 else {
2626 let white1ListAssetEntry = getInteger(extract(WhitelistAddr), white1ListAsset)
2727 if (!(isDefined(white1ListAssetEntry)))
2828 then true
2929 else {
3030 let cur1Balance = assetBalance(tx.sender, tx.assetId)
3131 if ((extract(white1ListAssetEntry) > (cur1Balance - tx.amount)))
3232 then throw("Cannot send amount: under restrictions")
3333 else true
3434 }
3535 }
3636 }
3737 case tx: ExchangeTransaction =>
38- let outcoming1AssetId = tx.buyOrder.assetPair.amountAsset
39- let outcoming1Account = tx.buyOrder.sender
40- let outcoming2AssetId = tx.sellOrder.assetPair.priceAsset
41- let outcoming2Account = tx.sellOrder.sender
4238 let outcoming1Amount = tx.amount
4339 let outcoming2Amount = fraction(tx.amount, tx.price, 100000000)
44- let white1List = toBase58String(outcoming1Account.bytes)
45- let white1ListAsset = if (isDefined(outcoming1AssetId))
46- then (white1List + toBase58String(extract(outcoming1AssetId)))
47- else (white1List + "_WAVES")
48- let white2List = toBase58String(outcoming2Account.bytes)
49- let white2ListAsset = if (isDefined(outcoming2AssetId))
50- then (white2List + toBase58String(extract(outcoming2AssetId)))
51- else (white2List + "_WAVES")
52- let is1Waves = !(isDefined(outcoming1AssetId))
53- let is2Waves = !(isDefined(outcoming2AssetId))
54- let white1ListEntry = getInteger(extract(WhitelistAddr), toBase58String(outcoming1Account.bytes))
55- let white2ListEntry = getInteger(extract(WhitelistAddr), toBase58String(outcoming2Account.bytes))
56- if (if (!(isDefined(white1ListEntry)))
57- then true
58- else (white1ListEntry != validState))
59- then throw((("Account " + toBase58String(outcoming1Account.bytes)) + " not in white list"))
60- else if (if (!(isDefined(white2ListEntry)))
61- then true
62- else (white2ListEntry != validState))
63- then throw((("Account " + toBase58String(outcoming2Account.bytes)) + " not in white list"))
64- else if (!(isDefined(getInteger(extract(WhitelistAddr), toBase58String(outcoming2Account.bytes)))))
65- then throw((("Account " + toBase58String(outcoming2Account.bytes)) + " not in white list"))
66- else {
67- let min1Amount = getInteger(extract(WhitelistAddr), white1ListAsset)
68- let min2Amount = getInteger(extract(WhitelistAddr), white2ListAsset)
69- if (isDefined(min1Amount))
70- then {
71- let cur1Balance = if (is1Waves)
72- then wavesBalance(outcoming1Account)
73- else assetBalance(outcoming1Account, outcoming1AssetId)
74- if ((extract(min1Amount) > (cur1Balance - outcoming1Amount)))
75- then throw("Restricted min1 balance")
76- else true
77- }
78- else if (isDefined(min2Amount))
79- then {
80- let cur2Balance = if (is2Waves)
81- then wavesBalance(outcoming2Account)
82- else assetBalance(outcoming2Account, outcoming2AssetId)
83- if ((extract(min2Amount) > (cur2Balance - outcoming2Amount)))
84- then throw("Restricted min2 balance")
85- else true
86- }
87- else true
88- }
89- case tx: SetAssetScriptTransaction =>
90- true
40+ throw(((("amt=" + toString(outcoming1Amount)) + ",") + toString(outcoming2Amount)))
9141 case _ =>
9242 true
9343 }

github/deemru/w8io/3ef1775 
37.45 ms