2 | | - | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | | - | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let a = fromBase64String("base64:MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMZuLoLHV5fcuqP/KjHoQ6VsZSkSWF2AwRALrLgTUfXYsdJw1zv0t9v7IHR63g7YroCvUFSXm1RmOhS1Xjr5yIECAwEAAQ==") |
---|
5 | | - | |
---|
6 | | - | let b = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlemr95J1jZUs7cJmrmmlN4zo7YVsBJzIeJdk8LDFGhUKSI6yfs20ZyJe21+6GJwNnKUU1Uyoc17wSWMKkrZ0MMvYE+Z5AiijvBK4sSJ3IgGjdU8/NhI8CBDu0F+xRM9q3TB3LLbDy5sBdudYfHfsUOc+MTvAD69n27db2Rh8+yZQMtubkuTQNp89sphHQaLGyQFaNlK/Na3lFx6omqzaa1gjoplUr6rvYKgfAICUB3zVmJShiEi7w7R0hWlNRD3qcZjCUONSpFo4WbzknGOazw84B+IMIFnIpXWzQL8RX0vNcfsBvLDfM6k2ZacqwyMKaLLqigdBiGdJ7W+0lOStOQIDAQAB") |
---|
7 | | - | |
---|
8 | | - | @Callable(c) |
---|
9 | | - | func checkSign (d,e,f,g) = { |
---|
10 | | - | let h = extract(c.payment) |
---|
11 | | - | let i = isDefined(h.assetId) |
---|
12 | | - | let j = { |
---|
13 | | - | let k = h.assetId |
---|
14 | | - | if ($isInstanceOf(k, "ByteVector")) |
---|
15 | | - | then { |
---|
16 | | - | let l = k |
---|
17 | | - | l |
---|
18 | | - | } |
---|
19 | | - | else "null" |
---|
20 | | - | } |
---|
21 | | - | let l = rsaVerify(SHA256, toBytes(e), f, a) |
---|
22 | | - | WriteSet([DataEntry((d + "_Pub"), g), DataEntry((d + "_TXID"), e), DataEntry((d + "_Signature"), f), DataEntry((d + "_Verify"), l), DataEntry((d + "_assetIdDefined"), i), DataEntry((d + "_assetIdDefined"), j)]) |
---|
23 | | - | } |
---|
24 | | - | |
---|
25 | | - | |
---|
26 | | - | @Verifier(m) |
---|
27 | | - | func n () = true |
---|
28 | | - | |
---|
| 2 | + | {-# CONTENT_TYPE EXPRESSION #-} |
---|
| 3 | + | let PubKey1 = base58'854p8BYzrj6yBPRPmfQur3oF1Rjc1AJ548qRp5FT5kDa' |
---|
| 4 | + | let PubKey2 = base58'DKGFPozLrsiR8NM4NJzqQaBYC8NyGYjuw2hDYicQVjco' |
---|
| 5 | + | let sig1 = if (sigVerify(tx.bodyBytes, tx.proofs[0], PubKey1)) |
---|
| 6 | + | then 1 |
---|
| 7 | + | else 0 |
---|
| 8 | + | let sig2 = if (sigVerify(tx.bodyBytes, tx.proofs[1], PubKey2)) |
---|
| 9 | + | then 1 |
---|
| 10 | + | else 0 |
---|
| 11 | + | ((sig1 + sig2) > 0) |
---|