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

Resolve SSW-306 #58

Merged
merged 2 commits into from
Mar 5, 2024
Merged

Resolve SSW-306 #58

merged 2 commits into from
Mar 5, 2024

Conversation

Quantumplation
Copy link
Member

Since we already know the number of LP tokens being minted, we can check
that it is correct with an is_sqrt function, rather than calculating the
sqrt directly.

We're not overly concerned with the pool creation, but it was simple
enough to implement.

Base:
│ PASS [mem: 1173694, cpu: 470849067] mint_test
Fixed:
│ PASS [mem: 1056495, cpu: 395561132] mint_test

Since we already know the number of LP tokens being minted, we can check
that it is correct with an is_sqrt function, rather than calculating the
sqrt directly.

We're not overly concerned with the pool creation, but it was simple
enough to implement.

Base:
    │ PASS [mem:  1173694, cpu:  470849067] mint_test
Fixed:
    │ PASS [mem:  1056495, cpu:  395561132] mint_test
@francolq
Copy link
Collaborator

Nice! Solves SSW-306. If in the future is_sqrt is included in Aiken's stdlib, it can be imported and used.

@Quantumplation Quantumplation merged commit 12a55da into main Mar 5, 2024
1 check passed
@Quantumplation Quantumplation deleted the pi/SSW-306-efficient-sqrt branch March 5, 2024 08:29
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.

2 participants