Open
Conversation
mihoward21
commented
Apr 1, 2024
| ); | ||
|
|
||
| DaimoAccountFactory factory = new DaimoAccountFactory{salt: 0}( | ||
| DaimoAccountFactory factory = new DaimoAccountFactory{salt: "splits.damioverifier.v0"}( |
mihoward21
commented
Apr 1, 2024
| address verifier = address(new DaimoVerifier{salt: keccak256("splits.damioverifier.v0")}()); | ||
| address initOwner = 0x8603fb56E2B6DeaF02F3e247110CEc6f4Cbb7C8F; // Daimo Ledger | ||
| new DaimoVerifierProxy{salt: 0}( | ||
| new DaimoVerifierProxy{salt: "splits.damioverifier.v0"}( |
wminshew
reviewed
Apr 1, 2024
|
|
||
| // TODO: this requires all signatures be valid. What | ||
| // if 2 sigs are required, 3 get passed in, and 1 is | ||
| // invalid. Should op succeed? |
There was a problem hiding this comment.
yeah wouldn't worry about it for now but probably for w/e we launch with we'd use a counter
wminshew
reviewed
Apr 1, 2024
| uint256 offset = 1; | ||
| for (uint256 i = 0; i < numSignatures;) { | ||
| uint8 keySlot = uint8(signature[offset]); | ||
| // TODO: is this even needed? can signatures vary in length? |
There was a problem hiding this comment.
i assume but don't know that different kinds of signatures might have different lengths. all passkey sigs have the same length i think and i think maybe same as EOAs (since technically it's the same curve with different params..?) idk we'll figure out later
wminshew
reviewed
Apr 1, 2024
| uint8 keySlot = uint8(signature[offset]); | ||
| // TODO: is this even needed? can signatures vary in length? | ||
| // TODO: best way to do this? | ||
| uint16 signatureLength = (uint16(uint8(signature[offset + 1])) << 8) + uint16(uint8(signature[offset + 2])); |
There was a problem hiding this comment.
i think you can do uint16(signature[offset+1:offset+3])
wminshew
reviewed
Apr 3, 2024
| // invalid. Should op succeed? | ||
| uint256 offset = 1; | ||
| for (uint256 i = 0; i < numSignatures;) { | ||
| uint8 keySlot = uint8(signature[offset]); |
There was a problem hiding this comment.
[reposting from gh so it doesn't get lost] need to add check to make sure keys aren't re-used
pseudo code that ~works gas-efficiently since we don't have access to maps in memory:
uint256 usedKeys;
loop i = each used keyslot {
uint256 bit = 1 << i;
uint256 flipped = usedKeys ^= bit;
if (flipped & bit == 0) revert Invalid();
}
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.