2 | | - | {-# SCRIPT_TYPE ACCOUNT #-} |
---|
3 | | - | {-# CONTENT_TYPE DAPP #-} |
---|
4 | | - | let RSAKey512 = fromBase64String("base64:MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAMZuLoLHV5fcuqP/KjHoQ6VsZSkSWF2AwRALrLgTUfXYsdJw1zv0t9v7IHR63g7YroCvUFSXm1RmOhS1Xjr5yIECAwEAAQ==") |
---|
5 | | - | |
---|
6 | | - | let RSAKey2048 = fromBase64String("base64:MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAlemr95J1jZUs7cJmrmmlN4zo7YVsBJzIeJdk8LDFGhUKSI6yfs20ZyJe21+6GJwNnKUU1Uyoc17wSWMKkrZ0MMvYE+Z5AiijvBK4sSJ3IgGjdU8/NhI8CBDu0F+xRM9q3TB3LLbDy5sBdudYfHfsUOc+MTvAD69n27db2Rh8+yZQMtubkuTQNp89sphHQaLGyQFaNlK/Na3lFx6omqzaa1gjoplUr6rvYKgfAICUB3zVmJShiEi7w7R0hWlNRD3qcZjCUONSpFo4WbzknGOazw84B+IMIFnIpXWzQL8RX0vNcfsBvLDfM6k2ZacqwyMKaLLqigdBiGdJ7W+0lOStOQIDAQAB") |
---|
7 | | - | |
---|
8 | | - | @Callable(i) |
---|
9 | | - | func checkSign (number,TxId,Signature,PublicKey) = { |
---|
10 | | - | let pmnt = extract(i.payment) |
---|
11 | | - | let assetIdcheck = isDefined(pmnt.assetId) |
---|
12 | | - | let assetId = match pmnt.assetId { |
---|
13 | | - | case a: ByteVector => |
---|
14 | | - | a |
---|
15 | | - | case _ => |
---|
16 | | - | "null" |
---|
17 | | - | } |
---|
18 | | - | let a = rsaVerify(SHA256, toBytes(TxId), Signature, RSAKey512) |
---|
19 | | - | WriteSet([DataEntry((number + "_Pub"), PublicKey), DataEntry((number + "_TXID"), TxId), DataEntry((number + "_Signature"), Signature), DataEntry((number + "_Verify"), a), DataEntry((number + "_assetIdDefined"), assetIdcheck), DataEntry((number + "_assetIdDefined"), assetId)]) |
---|
20 | | - | } |
---|
21 | | - | |
---|
22 | | - | |
---|
23 | | - | @Verifier(tx) |
---|
24 | | - | func verify () = true |
---|
25 | | - | |
---|
| 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) |
---|