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

merge from beets #376

Merged
merged 286 commits into from
Jan 7, 2025
Merged

merge from beets #376

merged 286 commits into from
Jan 7, 2025

Conversation

groninge01
Copy link
Contributor

No description provided.

Copy link
Collaborator

@agualis agualis left a comment

Choose a reason for hiding this comment

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

As a general comment, we could improve the config around code using isBalancerProject but I think you already talked about this with @garethfuller

Approved but let's wait for Gareth to do another review.

Comment on lines 155 to 186
export function parseLstStakeReceipt({ receiptLogs, userAddress, chain, getToken }: ParseProps) {
const receivedToken: HumanTokenAmount[] = getIncomingLogs(receiptLogs, userAddress).map(log => {
const tokenDecimals = getToken(log.address, chain)?.decimals
return _toHumanAmount(log.address, log.args.value, tokenDecimals)
})

return {
receivedToken,
}
}

export function parseLstUnstakeReceipt({ receiptLogs, userAddress, chain, getToken }: ParseProps) {
const receivedToken: HumanTokenAmount[] = getIncomingLogs(receiptLogs, userAddress).map(log => {
const tokenDecimals = getToken(log.address, chain)?.decimals
return _toHumanAmount(log.address, log.args.value, tokenDecimals)
})

return {
receivedToken,
}
}

export function parseLstWithdrawReceipt({ receiptLogs, userAddress, chain, getToken }: ParseProps) {
const receivedToken: HumanTokenAmount[] = getIncomingLogs(receiptLogs, userAddress).map(log => {
const tokenDecimals = getToken(log.address, chain)?.decimals
return _toHumanAmount(log.address, log.args.value, tokenDecimals)
})

return {
receivedToken,
}
}
Copy link
Contributor

@garethfuller garethfuller Jan 7, 2025

Choose a reason for hiding this comment

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

You shouldn't need to parse receipts for staking/unstaking because there is no
slippage. The only reason we do receipt states in the add/remove/swap flow is
because the amounts can change between preview and confirmation. I think it's
likely all this should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

for the unstaking you are right, there is no token transferred at that stage so i have removed it

for staking and withdrawing though, tokens are transferred and i have updated the parsers to correctly parse the logs for that
i also updated the tests for there 2 parsers

Copy link
Contributor

@garethfuller garethfuller left a comment

Choose a reason for hiding this comment

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

In general looks good, my biggest concern is the receipt parsers/steps for LST staking. I'm pretty sure we shouldn't be doing that. Like we don't use receipt steps for staking/unstaking bpt. Could be wrong though?

@agualis agualis merged commit 3cde3a8 into main Jan 7, 2025
11 checks passed
@agualis agualis deleted the beets/orig-main branch January 7, 2025 15:11
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.

4 participants