-
Notifications
You must be signed in to change notification settings - Fork 132
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
added assertion that asserts that the amount being transfered is larger than 0 #131
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.
Please remove other changes such as attaching storage
@@ -171,7 +176,10 @@ impl FungibleTokenResolver for Contract { | |||
amount | |||
} | |||
} | |||
PromiseResult::Failed => amount, | |||
PromiseResult::Failed => { | |||
Promise::new(sender_id.to_string()).transfer(initial_storage_deposit.into()); |
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 can be abused, since the receiver can return a promise that fails, which doesn't generate a refund.
So this fungible contract core implementation can't be sure that there was refund.
It's a limitation of NEAR protocol cross-contracts right now.
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.
Yup agreed, reset to 8da15fa
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.
Added change in 1240e83
The StorageManager trait is not fully compliant with the proposed standard interface.
fn storage_withdraw(&mut self, amount: Option<U128>) -> AccountStorageBalance; |
There is no use-case for transferring 0 tokens to an account and it could cause overflows on receiving contract's end.