-
Notifications
You must be signed in to change notification settings - Fork 246
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
fix: reset amount inputs after successful deposit/withdrawal #1938
Conversation
@@ -41,11 +35,35 @@ export function WithdrawButton({ className }: WithdrawButtonReact) { | |||
[updateLifecycleStatus], | |||
); | |||
|
|||
const handleOnSuccess = useCallback( | |||
(res: TransactionResponse) => { | |||
console.log('res:', res); |
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.
nit: remove
@@ -16,9 +16,10 @@ export function buildWithdrawFromMorphoTx({ | |||
amount, | |||
receiverAddress, | |||
}: WithdrawFromMorphoParams): Call[] { | |||
console.log('amount:', amount); |
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.
nit: remove
const withdrawTxData = encodeFunctionData({ | ||
abi: MORPHO_VAULT_ABI, | ||
functionName: 'withdraw', | ||
functionName: 'redeem', // redeem is the number of *shares*, withdraw is the number of *assets* |
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.
I'm still unsure about the difference between shares
and assets
after reading this. That doesn't need to be clarified here, just calling out
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.
Fair point, I have another PR in the pipe to clean up some of this stuff, I can try and improve it then
What changed? Why?
This PR includes the following behavior changes for Earn:
redeem
method instead ofwithdraw
method on vault contract for greater decimal precisionNotes to reviewers
How has it been tested?