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

feat: adding btt test for joinswap extern amount in #164

Merged
merged 4 commits into from
Jul 22, 2024

Conversation

0xteddybear
Copy link

No description provided.

Comment on lines 13 to 19
├── it emits LOG_CALL event
├── it sets the reentrancy lock
├── it emits LOG_JOIN event for token
├── it calls _pullUnderlying for token
├── it mints the pool shares
├── it sends pool shares to caller
└── it clears the reentrancy lock
Copy link
Member

Choose a reason for hiding this comment

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

queries token in balance? i feel we're forgetting it everywhere

uint256 public totalWeight = 10e18;
uint256 public tokenInBalance = 50e18;

// (((tokenAmountIn*(1-(1-tokenInWeight/totalWeight)*MIN_FEE)+tokenInBalance)/tokenInBalance)^(tokenInWeight/totalWeight))*INIT_POOL_SUPPLY - INIT_POOL_SUPPLY
Copy link
Member

Choose a reason for hiding this comment

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

can we reduce this formula to what's described in BMath? like, using wi or wT instead of full variable names, perhaps we can do this accross all tests

Copy link
Author

Choose a reason for hiding this comment

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

we could, but for that we could reference bmath directly. In these comments I explicitly implement the formulae as defined by bmath in a notation that's easily executable, using the same variable names that'll be found in the code, as both a sanity check and the way to independently compute them (this one got me searching for alternatives tobc tho, because of the non-integer exponent)

Copy link
Member

@wei3erHase wei3erHase left a comment

Choose a reason for hiding this comment

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

👍

@wei3erHase wei3erHase changed the title Test/btt bpool joinswap extern amount in feat: adding btt test for joinswap extern amount in Jul 22, 2024
@wei3erHase wei3erHase merged commit dfbed26 into dev Jul 22, 2024
1 check passed
@wei3erHase wei3erHase deleted the test/btt-bpool-joinswapExternAmountIn branch July 22, 2024 09:35
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