-
Notifications
You must be signed in to change notification settings - Fork 2
Remove refund on withdraw #135
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
base: master
Are you sure you want to change the base?
Conversation
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.
Makes sense
/// * A `U128` value representing the amount that was withdrawn, or `0` if the promise was not | ||
/// successful and the funds were returned to the user's balance. | ||
#[private] | ||
pub fn withdraw_callback( |
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 think this function also needs to be removed from FastBridgeInterface
if let Some(msg) = msg { | ||
self.call_ft_transfer_call(token_id, amount, sender_id, recipient_id, msg) | ||
ext_token::ext(token_id) | ||
.with_static_gas(utils::tera_gas(50)) |
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.
Use const for provided gas
self.call_ft_transfer_call(token_id, amount, sender_id, recipient_id, msg) | ||
ext_token::ext(token_id) | ||
.with_static_gas(utils::tera_gas(50)) | ||
.with_attached_deposit(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.
use const
ext_token::ext(token_id) | ||
.with_static_gas(utils::tera_gas(5)) | ||
.with_attached_deposit(1) | ||
.ft_transfer(recipient_id, amount, memo) |
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.
we also should emit FastBridgeWithdrawEvent
The refund for the
ft_transfer_call
that has been introduced in this PR led to additional vulnerabilities, so we decided to remove this feature of auto refund.