tx · 9CJ5bgRadpP1Dh6yShqVPpB4aAuTdFiZfMiKFcRGmdPR
3NCHkdhkeBBP1gfHpckmb2yPoYJ2CH7fxPN: -0.20000000 Waves
2019.03.17 11:47 [539972] smart account 3NCHkdhkeBBP1gfHpckmb2yPoYJ2CH7fxPN > SELF 0.00000000 Waves
{
"type": 13,
"id": "9CJ5bgRadpP1Dh6yShqVPpB4aAuTdFiZfMiKFcRGmdPR",
"fee": 20000000,
"feeAssetId": null,
"timestamp": 1552812500997,
"version": 1,
"sender": "3NCHkdhkeBBP1gfHpckmb2yPoYJ2CH7fxPN",
"senderPublicKey": "si2dSJdZCsTdJWYDXE6WbT5coL1B3jbUuKsBRG3hYUm",
"proofs": [
"TjZC3Thau8uqsKvhbXaSRQo9uPapEWRQABdQ9mV75uRB2mRM4s479YZ8bKPExGSzf3AJDZxiKVcDj4gfVKCscSt"
],
"script": "base64:AQQAAAANV2hpdGVsaXN0QWRkcgkBAAAAEWFkZHJlc3NGcm9tU3RyaW5nAAAAAQIAAAAjM043VG1QRkUxUVJLRXRLTkJjUXZQaUhxR2R2bTdSS2E2VjkEAAAACnZhbGlkU3RhdGUAAAAAAAAAA+gEAAAACnByb3RlY3RvcjEBAAAAIEsrHsqTbcDh9o7MyWEe8ZnH4ZcJJ2JKvnQlgjBcVqhGBAAAAApwcm90ZWN0b3IyAQAAACDuShUap7FLVAGsh+ULX9wbwT9+COcW2u8Z2z0HsoyzJgQAAAAKcHJvdGVjdG9yMwEAAAAg8OQWBfiA7fQMx+pB8DVMLroM7Lb9BDfGnZHXbDKxF24EAAAAByRtYXRjaDAFAAAAAnR4AwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABdNYXNzVHJhbnNmZXJUcmFuc2FjdGlvbgQAAAACdHgFAAAAByRtYXRjaDAHAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABNUcmFuc2ZlclRyYW5zYWN0aW9uBAAAAAJ0eAUAAAAHJG1hdGNoMAQAAAAJdXNlclN0YXRlCQ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AAAAAAAAAAAABAAAAAhwMnNpZ25lZAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAABBQAAAApwcm90ZWN0b3IyAAAAAAAAAAABAAAAAAAAAAAABAAAAAhwM3NpZ25lZAMJAAH0AAAAAwgFAAAAAnR4AAAACWJvZHlCeXRlcwkAAZEAAAACCAUAAAACdHgAAAAGcHJvb2ZzAAAAAAAAAAACBQAAAApwcm90ZWN0b3IzAAAAAAAAAAABAAAAAAAAAAAACQAAZwAAAAIJAABkAAAAAgkAAGQAAAACBQAAAAhwMXNpZ25lZAUAAAAIcDJzaWduZWQFAAAACHAzc2lnbmVkAAAAAAAAAAACAwkAAAEAAAACBQAAAAckbWF0Y2gwAgAAABBMZWFzZVRyYW5zYWN0aW9uBAAAAAJ0eAUAAAAHJG1hdGNoMAcDCQAAAQAAAAIFAAAAByRtYXRjaDACAAAAFVNwb25zb3JGZWVUcmFuc2FjdGlvbgQAAAACdHgFAAAAByRtYXRjaDAHCQAB9AAAAAMIBQAAAAJ0eAAAAAlib2R5Qnl0ZXMJAAGRAAAAAggFAAAAAnR4AAAABnByb29mcwAAAAAAAAAAAAgFAAAAAnR4AAAAD3NlbmRlclB1YmxpY0tleRSwJqc=",
"chainId": 84,
"height": 539972,
"spentComplexity": 0
}
View: original | compacted
Prev: 5GPGUpzqe6G6yE38aAurNY3ExQ78cPXBP8zk9RtigxwS
Next: A97PrM7zwmicFv1d8DbAHvnwskkypPNcMcLU3CCcJYkC
Diff:
Old | New | | Differences |
---|
2 | 2 | | {-# CONTENT_TYPE EXPRESSION #-} |
---|
3 | 3 | | let WhitelistAddr = addressFromString("3N7TmPFE1QRKEtKNBcQvPiHqGdvm7RKa6V9") |
---|
4 | 4 | | let validState = 1000 |
---|
| 5 | + | let protector1 = base58'64RiMxFkTamG4znZQBhi4oxs43nNrHiHdUYYwdYQhdPj' |
---|
| 6 | + | let protector2 = base58'H3BYxQ8MPzosmxYf3uj5ZLNDovW1XpbooD5K11K3vwkh' |
---|
| 7 | + | let protector3 = base58'HDLZwRd7786Tk7p7Bu4ziX7dzL24yNSkVzXctJPgPTLR' |
---|
5 | 8 | | match tx { |
---|
6 | 9 | | case tx: MassTransferTransaction => |
---|
7 | 10 | | false |
---|
|
19 | 22 | | then { |
---|
20 | 23 | | let curBalance = wavesBalance(extract(tx.sender)) |
---|
21 | 24 | | if ((extract(minAmount) > (curBalance - tx.amount))) |
---|
22 | | - | then throw(((((("Transfer is prohibited " + toString(curBalance)) + " ") + toString(tx.amount)) + " ") + toString(extract(minAmount)))) |
---|
| 25 | + | then throw("Transfer is prohibited") |
---|
23 | 26 | | else true |
---|
24 | 27 | | } |
---|
25 | 28 | | else true |
---|
26 | 29 | | } |
---|
27 | 30 | | else true |
---|
| 31 | + | case tx: SetScriptTransaction => |
---|
| 32 | + | let p1signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], protector1)) |
---|
| 33 | + | then 1 |
---|
| 34 | + | else 0 |
---|
| 35 | + | let p2signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], protector2)) |
---|
| 36 | + | then 1 |
---|
| 37 | + | else 0 |
---|
| 38 | + | let p3signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], protector3)) |
---|
| 39 | + | then 1 |
---|
| 40 | + | else 0 |
---|
| 41 | + | (((p1signed + p2signed) + p3signed) >= 2) |
---|
| 42 | + | case tx: LeaseTransaction => |
---|
| 43 | + | false |
---|
| 44 | + | case tx: SponsorFeeTransaction => |
---|
| 45 | + | false |
---|
28 | 46 | | case _ => |
---|
29 | 47 | | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
30 | 48 | | } |
---|
Full:
Old | New | | Differences |
---|
1 | 1 | | {-# STDLIB_VERSION 1 #-} |
---|
2 | 2 | | {-# CONTENT_TYPE EXPRESSION #-} |
---|
3 | 3 | | let WhitelistAddr = addressFromString("3N7TmPFE1QRKEtKNBcQvPiHqGdvm7RKa6V9") |
---|
4 | 4 | | let validState = 1000 |
---|
| 5 | + | let protector1 = base58'64RiMxFkTamG4znZQBhi4oxs43nNrHiHdUYYwdYQhdPj' |
---|
| 6 | + | let protector2 = base58'H3BYxQ8MPzosmxYf3uj5ZLNDovW1XpbooD5K11K3vwkh' |
---|
| 7 | + | let protector3 = base58'HDLZwRd7786Tk7p7Bu4ziX7dzL24yNSkVzXctJPgPTLR' |
---|
5 | 8 | | match tx { |
---|
6 | 9 | | case tx: MassTransferTransaction => |
---|
7 | 10 | | false |
---|
8 | 11 | | case tx: TransferTransaction => |
---|
9 | 12 | | let userState = getInteger(extract(WhitelistAddr), toBase58String(tx.sender.bytes)) |
---|
10 | 13 | | if (!(isDefined(userState))) |
---|
11 | 14 | | then throw("Address not in whitelist") |
---|
12 | 15 | | else if ((userState != validState)) |
---|
13 | 16 | | then throw("Not valid state") |
---|
14 | 17 | | else if (!(isDefined(tx.assetId))) |
---|
15 | 18 | | then { |
---|
16 | 19 | | let key = (toBase58String(tx.sender.bytes) + "_WAVES") |
---|
17 | 20 | | let minAmount = getInteger(extract(WhitelistAddr), key) |
---|
18 | 21 | | if (isDefined(minAmount)) |
---|
19 | 22 | | then { |
---|
20 | 23 | | let curBalance = wavesBalance(extract(tx.sender)) |
---|
21 | 24 | | if ((extract(minAmount) > (curBalance - tx.amount))) |
---|
22 | | - | then throw(((((("Transfer is prohibited " + toString(curBalance)) + " ") + toString(tx.amount)) + " ") + toString(extract(minAmount)))) |
---|
| 25 | + | then throw("Transfer is prohibited") |
---|
23 | 26 | | else true |
---|
24 | 27 | | } |
---|
25 | 28 | | else true |
---|
26 | 29 | | } |
---|
27 | 30 | | else true |
---|
| 31 | + | case tx: SetScriptTransaction => |
---|
| 32 | + | let p1signed = if (sigVerify(tx.bodyBytes, tx.proofs[0], protector1)) |
---|
| 33 | + | then 1 |
---|
| 34 | + | else 0 |
---|
| 35 | + | let p2signed = if (sigVerify(tx.bodyBytes, tx.proofs[1], protector2)) |
---|
| 36 | + | then 1 |
---|
| 37 | + | else 0 |
---|
| 38 | + | let p3signed = if (sigVerify(tx.bodyBytes, tx.proofs[2], protector3)) |
---|
| 39 | + | then 1 |
---|
| 40 | + | else 0 |
---|
| 41 | + | (((p1signed + p2signed) + p3signed) >= 2) |
---|
| 42 | + | case tx: LeaseTransaction => |
---|
| 43 | + | false |
---|
| 44 | + | case tx: SponsorFeeTransaction => |
---|
| 45 | + | false |
---|
28 | 46 | | case _ => |
---|
29 | 47 | | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
30 | 48 | | } |
---|