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: [quanstamp-req] Contract data key #81

Merged
merged 1 commit into from
Jan 19, 2024

Conversation

adam-alchemy
Copy link
Contributor

Motivation

The Quanstamp audit team suggested rearranging the bit-alignment of the key to ContractData in SessionKeyPermissionsBase for consistency with other key definitions.

Solution

Changing the comment describing the key layout:

  • From // 12 padding zeros || associated address || CONTRACT_DATA_PREFIX || batch index || sessionKeyId || contractAddress || 12 padding zero bytes
  • Back to // 12 padding zeros || associated address || CONTRACT_DATA_PREFIX || batch index || sessionKeyId || 12 padding zero bytes || contractAddress

Changing the calculation of contractDataKey2:

  • From bytes32(bytes20(contractAddress))
  • To bytes32(uint256(uint160(contractAddress)))

@adam-alchemy adam-alchemy requested a review from jaypaik January 19, 2024 17:22
Base automatically changed from adam/session-key-merge to audit-2023-11-20 January 19, 2024 21:38
@adam-alchemy adam-alchemy force-pushed the adam/fix-contract-data-key branch from 615395b to 68f8c8f Compare January 19, 2024 22:26
@adam-alchemy adam-alchemy merged commit 27af95a into audit-2023-11-20 Jan 19, 2024
3 checks passed
@adam-alchemy adam-alchemy deleted the adam/fix-contract-data-key branch January 19, 2024 23:02
jaypaik pushed a commit that referenced this pull request Jan 25, 2024
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