-
Notifications
You must be signed in to change notification settings - Fork 221
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
feat: Viem migration + Passkeys #931
Merged
Merged
Conversation
This file contains 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
* Add `SafeWebAuthnSignerFactory` contract * Add tests for passkey flow in `isOwner` function * Add tests for signTransaction + createAddOwnerTx (wip) * Add webauthnShim to emulate the Web Authentication API implemented in browsers Copied from [safe-modules repo](https://github.com/safe-global/safe-modules/blob/main/modules/passkey/test/utils/webauthnShim.ts) * Use webauthnShim for passkey mocks * Deploy `FCLP256Verifier` in local hardhat environment and use it as as WebAuthnContract * Run passkey tests only for contract versions 1.3.0 + 1.4.1 --------- Co-authored-by: Daniel Somoza <daniel.somoza@safe.global>
…f a hardcoded address
Passkey 4337 support
…#855) * Add test on the provider level
…e-sdk into passkey-support-viem # Conflicts: # packages/api-kit/package.json # packages/auth-kit/package.json # packages/onramp-kit/package.json # packages/protocol-kit/package.json # packages/protocol-kit/src/Safe.ts # packages/protocol-kit/src/SafeProvider.ts # packages/protocol-kit/src/contracts/SafeWebAuthnSharedSigner/SafeWebAuthnSharedSignerBaseContract.ts # packages/protocol-kit/src/contracts/SafeWebAuthnSharedSigner/v0.2.1/SafeWebAuthnSharedSignerContract_v0_2_1.ts # packages/protocol-kit/src/contracts/SafeWebAuthnSignerFactory/SafeWebAuthnSignerFactoryBaseContract.ts # packages/protocol-kit/src/contracts/SafeWebAuthnSignerFactory/v0.2.1/SafeWebAuthnSignerFactoryContract_v0_2_1.ts # packages/protocol-kit/src/contracts/config.ts # packages/protocol-kit/src/contracts/contractInstances.ts # packages/protocol-kit/src/contracts/utils.ts # packages/protocol-kit/src/index.ts # packages/protocol-kit/src/types/contracts.ts # packages/protocol-kit/src/types/safeProvider.ts # packages/protocol-kit/src/utils/passkeys/createPasskeyDeploymentTransaction.ts # packages/protocol-kit/src/utils/passkeys/getPasskeyOwnerAddress.ts # packages/protocol-kit/src/utils/passkeys/index.ts # packages/protocol-kit/src/utils/passkeys/isSharedSigner.ts # packages/protocol-kit/src/utils/transactions/utils.ts # packages/protocol-kit/tests/e2e/passkey.test.ts # packages/protocol-kit/tests/e2e/safeProvider.test.ts # packages/protocol-kit/tests/e2e/utils/passkeys.ts # packages/protocol-kit/tests/e2e/utils/setupContractNetworks.ts # packages/protocol-kit/tests/e2e/utils/setupContracts.ts # packages/relay-kit/package.json # packages/relay-kit/src/packs/safe-4337/Safe4337Pack.test.ts # packages/relay-kit/src/packs/safe-4337/Safe4337Pack.ts # packages/relay-kit/src/packs/safe-4337/utils.ts # packages/safe-core-sdk-types/package.json # packages/sdk-starter-kit/package.json # yarn.lock
Pull Request Test Coverage Report for Build 10813799887Details
💛 - Coveralls |
yagopv
reviewed
Sep 10, 2024
dasanra
reviewed
Sep 10, 2024
This reverts commit c60c3a5.
yagopv
approved these changes
Sep 10, 2024
This was referenced Sep 11, 2024
dasanra
approved these changes
Sep 11, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What it solves
Resolves issues #870 and #871.
How this PR fixes it
This pull request migrates the entire repository to
viem
, removingethers
as a dependency.ethers
is retained only as a devDependency for the test-utils inapi-kit
andprotocol-kit
.protocol-kit
getExternalProvider
now returns a viemPublicClient
(previously an ethersProvider
).getExternalSigner
now returns a viemWalletClient
(previously an ethersAbstractSigner
).getTransaction
now returns a viemTransaction
(previously an ethersTransactionResponse
).encodeParameters
anddecodeParameters
now expect astring
as the first parameter, containing the Human-readable ABI parameters (previously astring[]
).Abi
(previouslyJsonFragment | JsonFragment[]
). This affects:defaultAbi
andcustomContractAbi
in all Contract classes.customContractAbi
parameter in allget...ContractInstance
functions and in theGetContractProps
type.getSafeProxyFactoryContractInstance
function'ssignerOrProvider
parameter is now a viemPublicClient
.api-kit
SafeApiKit
'saddSafeDelegate
andremoveSafeDelegate
functions now expect a viemWalletClient
as the signer prop (previously an ethersSigner
).relay-kit
Safe4337Options
now expects abundlerClient
prop of viem's typePublicClient
(previously ethersJsonRpcProvider
).auth-kit
AuthKitEthereumProvider
type is now a viemEIP1193Provider
(previously ethersEip1193Provider
). This new type restricts the RPC methods for EIP-1193, as opposed to the ethers type, which accepted any string as a method name.Other context
Replaces #887