Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: P-885 add $network clause in solidity VC #3026

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

wli-pro
Copy link
Contributor

@wli-pro wli-pro commented Aug 28, 2024

Context

as title

Labels

Please apply following PR-related labels when appropriate:

  • C0-breaking: if your change could break the existing client, e.g. API change, critical logic change
  • C1-noteworthy: if your change is non-breaking, but is still worth noticing for the client, e.g. reference code improvement

How (Optional)

Testing Evidences

Please attach any relevant evidences if applicable

bean
./bin/litentry-cli -P 12000 trusted -d request-vc did:litentry:evm:0x6955512E5374D8fbD3ACF072e40bD4682ab2630a -a "dynamic 4431df14713fe74b7ab298cdbb50c1ca18f7982f 000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000046265616e00000000000000000000000000000000000000000000000000000000"

identity: Evm(Address20)
nonce: 0
assertions: [Dynamic(DynamicParams { smart_contract_id: 0x4431df14713fe74b7ab298cdbb50c1ca18f7982f, smart_contract_params: Some(BoundedVec([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 98, 101, 97, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 1024)), return_log: false })]
----Generated VC-----
{"@context":["https://www.w3.org/2018/credentials/v1","https://w3id.org/security/suites/ed25519-2020/v1"],"id":"0x5414a070382e258226b5c44f5cd3b6f420fb6c0c70be5be0d3a686197bf9563f","type":["VerifiableCredential"],"credentialSubject":{"id":"did:litentry:evm:0x6955512e5374d8fbd3acf072e40bd4682ab2630a","description":"The amount of a particular token you are holding","type":"Token Holding Amount","assertionText":"","assertions":[{"and":[{"src":"$token","op":"==","dst":"bean"},{"and":[{"src":"$network","op":"==","dst":"Bsc"},{"src":"$network","op":"==","dst":"Combo"}]},{"src":"$holding_amount","op":">","dst":"0"},{"src":"$holding_amount","op":"<","dst":"1500"}]}],"values":[true],"endpoint":"http://localhost:9933"},"issuer":{"id":"did:litentry:substrate:0x0b9df679f406a51a2e53b87d8e3fc86e792e277fe932d9535b40692bec9e3789","name":"Litentry TEE Worker","mrenclave":"13sNtq241mu2Lw7UXe7J2e4uitbQTM4P4QE5QJoxaZCN","runtimeVersion":{"parachain":9195,"sidechain":109}},"issuanceDate":"2024-08-28T01:41:12.292129666+00:00","parachainBlockNumber":67,"sidechainBlockNumber":125,"proof":{"created":"2024-08-28T01:41:12.292317080+00:00","type":"Ed25519Signature2020","proofPurpose":"assertionMethod","proofValue":"7b5c4906ef9f7f1544f6c9a90fc46fb6fea6f0168aea46bf1dbdb9ad93c77edf04d362aec8f52dfc2ac39e8dc87e56713b2d9ccba59493f599235bbfe918ce02","verificationMethod":"0x44da3459814cb003846aece78984e0d064f6b7c1b4c3e4c7bf03b598ea550ba4"},"credentialSchema":{"id":"https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/25-token-holding-amount/1-1-4.json","type":"JsonSchemaValidator2018"}}

dai
./bin/litentry-cli -P 12000 trusted -d request-vc did:litentry:evm:0xd85E038593d7A098614721EaE955EC2022B9B91B -a "dynamic 4431df14713fe74b7ab298cdbb50c1ca18f7982f 000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000036461690000000000000000000000000000000000000000000000000000000000"

identity: Evm(Address20)
nonce: 0
assertions: [Dynamic(DynamicParams { smart_contract_id: 0x4431df14713fe74b7ab298cdbb50c1ca18f7982f, smart_contract_params: Some(BoundedVec([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 100, 97, 105, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 1024)), return_log: false })]
----Generated VC-----
{"@context":["https://www.w3.org/2018/credentials/v1","https://w3id.org/security/suites/ed25519-2020/v1"],"id":"0xe4b07938ac26b7b32ffa98a00fcc14b3ab950dc4478dc5b8194c030d63909f4b","type":["VerifiableCredential"],"credentialSubject":{"id":"did:litentry:evm:0xd85e038593d7a098614721eae955ec2022b9b91b","description":"The amount of a particular token you are holding","type":"Token Holding Amount","assertionText":"","assertions":[{"and":[{"src":"$token","op":"==","dst":"dai"},{"and":[{"src":"$network","op":"==","dst":"Ethereum"},{"src":"$network","op":"==","dst":"Bsc"},{"src":"$network","op":"==","dst":"Solana"},{"src":"$network","op":"==","dst":"Arbitrum"},{"src":"$network","op":"==","dst":"Polygon"}]},{"src":"$holding_amount","op":">=","dst":"5000"}]}],"values":[true],"endpoint":"http://localhost:9933"},"issuer":{"id":"did:litentry:substrate:0x0b9df679f406a51a2e53b87d8e3fc86e792e277fe932d9535b40692bec9e3789","name":"Litentry TEE Worker","mrenclave":"13sNtq241mu2Lw7UXe7J2e4uitbQTM4P4QE5QJoxaZCN","runtimeVersion":{"parachain":9195,"sidechain":109}},"issuanceDate":"2024-08-28T01:40:37.970294288+00:00","parachainBlockNumber":64,"sidechainBlockNumber":120,"proof":{"created":"2024-08-28T01:40:37.970479786+00:00","type":"Ed25519Signature2020","proofPurpose":"assertionMethod","proofValue":"0848101368723fcecb55c50db53c1d06e1fde4f1d6b28c3e7bc1ef963d85cfd19ca03095c6686ecc71683a82af92a0d9bb7bb7838ba59a3c4e97273a4b82c702","verificationMethod":"0x44da3459814cb003846aece78984e0d064f6b7c1b4c3e4c7bf03b598ea550ba4"},"credentialSchema":{"id":"https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/25-token-holding-amount/1-1-4.json","type":"JsonSchemaValidator2018"}}

rats
./bin/litentry-cli -P 12000 trusted -d request-vc did:litentry:bitcoin:0x02e8c39e82aaaa143c3def8d3c7084a539b227244ac9067c3f7fc86cb73a0b7aed -a "dynamic 4431df14713fe74b7ab298cdbb50c1ca18f7982f 000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000047361747300000000000000000000000000000000000000000000000000000000"

identity: Bitcoin(Address33)
nonce: 0
assertions: [Dynamic(DynamicParams { smart_contract_id: 0x4431df14713fe74b7ab298cdbb50c1ca18f7982f, smart_contract_params: Some(BoundedVec([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 115, 97, 116, 115, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], 1024)), return_log: false })]
----Generated VC-----
{"@context":["https://www.w3.org/2018/credentials/v1","https://w3id.org/security/suites/ed25519-2020/v1"],"id":"0xaf32a000acd865cc23265f4b4697e609c42497c7096fece5217cba52d9fbd839","type":["VerifiableCredential"],"credentialSubject":{"id":"did:litentry:bitcoin:0x02e8c39e82aaaa143c3def8d3c7084a539b227244ac9067c3f7fc86cb73a0b7aed","description":"The amount of a particular token you are holding","type":"Token Holding Amount","assertionText":"","assertions":[{"and":[{"src":"$token","op":"==","dst":"sats"},{"and":[{"src":"$network","op":"==","dst":"BitcoinP2tr"},{"src":"$network","op":"==","dst":"BitcoinP2pkh"},{"src":"$network","op":"==","dst":"BitcoinP2sh"},{"src":"$network","op":"==","dst":"BitcoinP2wpkh"},{"src":"$network","op":"==","dst":"BitcoinP2wsh"}]},{"src":"$holding_amount","op":">","dst":"0"}]}],"values":[false],"endpoint":"http://localhost:9933"},"issuer":{"id":"did:litentry:substrate:0x0b9df679f406a51a2e53b87d8e3fc86e792e277fe932d9535b40692bec9e3789","name":"Litentry TEE Worker","mrenclave":"13sNtq241mu2Lw7UXe7J2e4uitbQTM4P4QE5QJoxaZCN","runtimeVersion":{"parachain":9195,"sidechain":109}},"issuanceDate":"2024-08-28T01:41:30.812963108+00:00","parachainBlockNumber":68,"sidechainBlockNumber":128,"proof":{"created":"2024-08-28T01:41:30.813153296+00:00","type":"Ed25519Signature2020","proofPurpose":"assertionMethod","proofValue":"803499f1bfe3cfbfbd3e97f00369a7e2e77b99801b6b4d0e04c81dd010c5e51b940dd1cc9871348de80dd69c9fede4845ededc6e1f23ffefdbd87a90d0589303","verificationMethod":"0x44da3459814cb003846aece78984e0d064f6b7c1b4c3e4c7bf03b598ea550ba4"},"credentialSchema":{"id":"https://raw.githubusercontent.com/litentry/vc-jsonschema/main/dist/schemas/25-token-holding-amount/1-1-4.json","type":"JsonSchemaValidator2018"}}

Copy link

linear bot commented Aug 28, 2024

@wli-pro wli-pro marked this pull request as ready for review August 28, 2024 02:14
@wli-pro wli-pro requested a review from a team August 28, 2024 02:15
@wli-pro wli-pro force-pushed the P-885-solidity-vc-network-clause branch from 26908bb to 0bd3e48 Compare August 28, 2024 09:13
@Kailai-Wang Kailai-Wang merged commit 61afbb7 into dev Aug 28, 2024
34 checks passed
@Kailai-Wang Kailai-Wang deleted the P-885-solidity-vc-network-clause branch August 28, 2024 13:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants