3 | | - | let WhitelistAddr = addressFromString("3N7TmPFE1QRKEtKNBcQvPiHqGdvm7RKa6V9") |
---|
4 | | - | let validState = 1000 |
---|
5 | | - | let protector1 = base58'64RiMxFkTamG4znZQBhi4oxs43nNrHiHdUYYwdYQhdPj' |
---|
6 | | - | let protector2 = base58'H3BYxQ8MPzosmxYf3uj5ZLNDovW1XpbooD5K11K3vwkh' |
---|
7 | | - | let protector3 = base58'HDLZwRd7786Tk7p7Bu4ziX7dzL24yNSkVzXctJPgPTLR' |
---|
8 | | - | match tx { |
---|
9 | | - | case tx: MassTransferTransaction => |
---|
10 | | - | false |
---|
11 | | - | case tx: TransferTransaction => |
---|
12 | | - | let userState = getInteger(extract(WhitelistAddr), toBase58String(tx.sender.bytes)) |
---|
13 | | - | if (!(isDefined(userState))) |
---|
14 | | - | then throw("Address not in whitelist") |
---|
15 | | - | else if ((userState != validState)) |
---|
16 | | - | then throw("Not valid state") |
---|
17 | | - | else if (!(isDefined(tx.assetId))) |
---|
18 | | - | then { |
---|
19 | | - | let key = (toBase58String(tx.sender.bytes) + "_WAVES") |
---|
20 | | - | let minAmount = getInteger(extract(WhitelistAddr), key) |
---|
21 | | - | if (isDefined(minAmount)) |
---|
22 | | - | then { |
---|
23 | | - | let curBalance = wavesBalance(extract(tx.sender)) |
---|
24 | | - | if ((extract(minAmount) > (curBalance - tx.amount))) |
---|
25 | | - | then throw("Transfer is prohibited") |
---|
26 | | - | else true |
---|
27 | | - | } |
---|
28 | | - | else true |
---|
29 | | - | } |
---|
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 |
---|
46 | | - | case _ => |
---|
47 | | - | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|
48 | | - | } |
---|
| 3 | + | sigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPublicKey) |
---|