-
Notifications
You must be signed in to change notification settings - Fork 35
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
optimization: support burn onbehalf of other #14
Conversation
…e of mint and burn function
if (allowed != type(uint256).max) allowance[from][msg.sender][currency] = allowed - amount; | ||
} | ||
|
||
_burn(from, currency, 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.
It seems that directly using the codes in the _burn function, will save some gas?
// _burn(from, currency, amount);
balanceOf[from][currency] -= amount;
emit Transfer(msg.sender, from, address(0), currency, 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.
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.
ok, lgtm
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.
created pancakeswap/pancake-v4-periphery#11 to track since a follow-up update on v4-periphery is required
Two major changes here per discussion:
burn(address from, Currency currency, uint256 amount)
: ppl can burn others vaultToken to finish payment as long as they have corresponding allowancefunction mint(Currency currency, address to, uint256 amount)
tofunction mint(address to, Currency currency, uint256 amount)
so as to aligns with burn function