Skip to content

Conversation

@mihoward21
Copy link
Owner

No description provided.

);

DaimoAccountFactory factory = new DaimoAccountFactory{salt: 0}(
DaimoAccountFactory factory = new DaimoAccountFactory{salt: "splits.damioverifier.v0"}(
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sigh

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"}(
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙈


// TODO: this requires all signatures be valid. What
// if 2 sigs are required, 3 get passed in, and 1 is
// invalid. Should op succeed?
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah wouldn't worry about it for now but probably for w/e we launch with we'd use a counter

uint256 offset = 1;
for (uint256 i = 0; i < numSignatures;) {
uint8 keySlot = uint8(signature[offset]);
// TODO: is this even needed? can signatures vary in length?
Copy link

@wminshew wminshew Apr 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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]));
Copy link

@wminshew wminshew Apr 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you can do uint16(signature[offset+1:offset+3])

// invalid. Should op succeed?
uint256 offset = 1;
for (uint256 i = 0; i < numSignatures;) {
uint8 keySlot = uint8(signature[offset]);
Copy link

@wminshew wminshew Apr 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[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();
        }

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