Unverified Commit 6d5a7381 by sunhurts Committed by GitHub

Fix ERC20Snapshot#_beforeTokenTransfer (#2328)

parent d1f336d8
...@@ -110,8 +110,12 @@ abstract contract ERC20Snapshot is ERC20 { ...@@ -110,8 +110,12 @@ abstract contract ERC20Snapshot is ERC20 {
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override { function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {
super._beforeTokenTransfer(from, to, amount); super._beforeTokenTransfer(from, to, amount);
if (from == address(0) || to == address(0)) { if (from == address(0)) {
// mint or burn // mint
_updateAccountSnapshot(to);
_updateTotalSupplySnapshot();
} else if (to == address(0)) {
// burn
_updateAccountSnapshot(from); _updateAccountSnapshot(from);
_updateTotalSupplySnapshot(); _updateTotalSupplySnapshot();
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment