-
Notifications
You must be signed in to change notification settings - Fork 2
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
Yieltoken uni migration #154
Conversation
await weth.connect(account1).approve(migration.address, max); | ||
await weth.connect(account0).approve(singleAssetVault.address, max); | ||
await weth.connect(account1).approve(singleAssetVault.address, max); | ||
await dai.connect(account1).approve(migration.address, max); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did we remove weth
from this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because here we are testing only curve changes the vault changes are tested in resubscribe multiple changes
@@ -185,9 +185,10 @@ const setup = async () => { | |||
expect(meTokenInfo.balanceLocked).to.equal(0); | |||
}); | |||
it("burn() [buyer]: assets received based on initial refundRatio", async () => { | |||
const collateralDeposited = tokenDeposited.mul(3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the motivation behind adding this multiplication?
return ethers.utils.parseEther(num.toString()); | ||
let res: BigNumber = BigNumber.from(0); | ||
let curNum = num.toString(); | ||
while (curNum.length > 1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What failing test case motivated this extra logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this make the conversion more robust if you try to convert a number with too many decimals/number
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review comments.
Let's say that you want to mint metokens but it is migrating from DAI to WETH before this PR the migration ends at the beginning of the mint whereas with this PR it happens at the end
Before this PR when migration ends if you want to mint for 1 Dai it will actually mint for 1 WETH. Therefore if you have no WETH it will revert but If you have one you actually mint for 1 WETH (roughly 3500 DAI now) instead of 1 DAI...
With this PR if you want to mint for 1 Dai it will actually mint for 1 DAI and it swaps all DAI for ETH and mark the migration as ended
also uniswap migration upgraded to SwapRouter V3