1 | | - | {-# STDLIB_VERSION 1 #-} |
---|
2 | | - | {-# CONTENT_TYPE EXPRESSION #-} |
---|
3 | | - | let minimumTransfer = 100000000000 |
---|
4 | | - | let minimumPrice = 3141592 |
---|
5 | | - | let ASigned = "Cig3iF8UpyEMKGkfBYfaS68YEChw9yXq5k6Nfp7nuzgQ" |
---|
6 | | - | match tx { |
---|
7 | | - | case t: TransferTransaction => |
---|
8 | | - | let transaction = transactionById(extract(t.assetId)) |
---|
9 | | - | match transaction { |
---|
10 | | - | case issueTx: IssueTransaction => |
---|
11 | | - | let transactionByIssuer = (t.senderPublicKey == issueTx.senderPublicKey) |
---|
12 | | - | if (transactionByIssuer) |
---|
13 | | - | then if ((toBase58String(t.senderPublicKey) == ASigned)) |
---|
14 | | - | then true |
---|
15 | | - | else if ((minimumTransfer >= t.amount)) |
---|
16 | | - | then throw("Minimum transaction amount is 1,000 LuckyCoins") |
---|
17 | | - | else true |
---|
18 | | - | else false |
---|
19 | | - | case _ => |
---|
20 | | - | throw("Not issue tx") |
---|
21 | | - | } |
---|
22 | | - | case t: ExchangeTransaction => |
---|
23 | | - | if ((toBase58String(t.sellOrder.senderPublicKey) == ASigned)) |
---|
24 | | - | then true |
---|
25 | | - | else { |
---|
26 | | - | let buy = sigVerify(t.buyOrder.bodyBytes, t.buyOrder.proofs[0], t.buyOrder.senderPublicKey) |
---|
27 | | - | if (buy) |
---|
28 | | - | then true |
---|
29 | | - | else if ((t.amount >= minimumTransfer)) |
---|
30 | | - | then if ((t.price > minimumPrice)) |
---|
31 | | - | then true |
---|
32 | | - | else throw("Transaction is not allowed by token-script") |
---|
33 | | - | else throw("Minimum order amount is 1,000 LuckyCoins") |
---|
34 | | - | } |
---|
35 | | - | case t: SetScriptTransaction => |
---|
36 | | - | true |
---|
37 | | - | case t: ReissueTransaction => |
---|
38 | | - | true |
---|
39 | | - | case t: MassTransferTransaction => |
---|
40 | | - | if ((toBase58String(t.senderPublicKey) == ASigned)) |
---|
41 | | - | then true |
---|
42 | | - | else false |
---|
43 | | - | case _ => |
---|
44 | | - | throw("Transaction is not allowed by token-script") |
---|
45 | | - | } |
---|
| 1 | + | # no script |
---|