Created
August 21, 2025 19:12
-
-
Save irzhywau/505e978f7c2118d67dca98763ed7c7b0 to your computer and use it in GitHub Desktop.
Lit - Encryption process (backend)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // KID and CEK are parameters | |
| const { ciphertext, dataToEncryptHash, ...rest } = await lit.encrypt({ | |
| unifiedAccessControlConditions: [ | |
| { | |
| conditionType: "evmContract", | |
| chain: 'arbitrumSepolia', | |
| contractAddress: '0x4Ba1151B5bc5B39500ff8D3B277eC6d217cB33ee', | |
| functionName: 'hasAccessByContentId', | |
| functionParams: [':userAddress', KID], | |
| functionAbi: { | |
| inputs: [ | |
| { name: 'userAddress', type: 'address' }, | |
| { name: 'contentId', type: 'bytes16' } | |
| ], | |
| name: 'hasAccessByContentId', | |
| outputs: [{ name: 'hasAccess', type: 'bool' }], | |
| stateMutability: 'view', | |
| type: 'function' | |
| }, | |
| returnValueTest: { key: 'hasAccess', comparator: '=', value: 'true' } | |
| } | |
| ], | |
| dataToEncrypt: CEK | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment