Skip to content

Tutorial issues: wrong default EntryPoint address and incorrect viem destructuring #134

@Pan-Beibei

Description

@Pan-Beibei

Tutorial: https://docs.openzeppelin.com/contracts/5.x/learn/webauthn-smart-accounts


Issue 1: Default entryPoint() doesn't match the tutorial's EntryPoint address

Account.sol defaults to ENTRYPOINT_V09 (0x433709009B8330FDa32311DF1C2AFA402eD8D009), but the tutorial uses ENTRYPOINT_V08 (0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108). This mismatch causes validateUserOp to revert with AA23 because the onlyEntryPoint check fails.

The fix is to add this override to AccountWebAuthn:

function entryPoint() public view virtual override returns (IEntryPoint) {
    return ERC4337Utils.ENTRYPOINT_V08;
}

Issue 2: predictAddress return value incorrectly destructured

The tutorial uses array destructuring on a function that returns a single address:

// ❌ Wrong - destructures the address string as a char array, predictedAddress = "0"
const [predictedAddress] = await publicClient.readContract({ ... });

// ✅ Correct
const predictedAddress = await publicClient.readContract({ ... });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions