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

feature/migrate-utils-to-ethers6 #188

Conversation

Le-Caignec
Copy link

No description provided.

@Le-Caignec Le-Caignec self-assigned this Feb 13, 2025
@Le-Caignec Le-Caignec changed the title Update dependencies and refactor event extraction logic feature/migrate-utils-to-ethers6 Feb 13, 2025
@Le-Caignec Le-Caignec changed the base branch from feature/migration-to-ether-v6 to feature/hardhat-and-ethers-upgrade-part1 February 13, 2025 16:14
Base automatically changed from feature/hardhat-and-ethers-upgrade-part1 to feature/migration-to-ether-v6 February 13, 2025 16:58
package.json Show resolved Hide resolved
@@ -292,7 +292,7 @@ export async function signOrder(
domain: TypedDataDomain,
order: Record<string, any>,
signer: SignerWithAddress,
): Promise<void> {
): Promise<Record<string, any>> {
Copy link
Member

Choose a reason for hiding this comment

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

Why is it needed?

Copy link
Author

Choose a reason for hiding this comment

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

It should be compatible with the signStruct function, which does not return a void Promise.

signStruct(primaryType: string, message: Record<string, any>, domain: TypedDataDomain, wallet: WalletInfo): Promise<Record<string, any>>

Copy link
Member

Choose a reason for hiding this comment

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

I don't see the return values of signStruct, signOrder, signOrderOperation used anywhere.
I think we need to refactor these functions to either make them pure or remove the return value. Ofc not necessarily for this PR.

utils/createOrders.ts Show resolved Hide resolved
utils/odb-tools.ts Show resolved Hide resolved
utils/tools.ts Outdated Show resolved Hide resolved
if (split.v == 1 || split.v == 28) {
const split = ethers.Signature.from(signature);
let vs = ethers.getBytes(split.s);
if (split.v == 27 || split.v == 28) {
Copy link
Author

Choose a reason for hiding this comment

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

I'm not sure to understand here why we need to replace 1 by 27. To be validated !

Copy link
Member

Choose a reason for hiding this comment

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

It seems that signature.v is the legacy method and signature.yParity is the new method.
But we should be careful before changing it and check first if we need to support legacy signatures.

@Le-Caignec Le-Caignec closed this Feb 17, 2025
@Le-Caignec Le-Caignec deleted the feature/migrate-utils-to-ethers6 branch February 17, 2025 11:43
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