You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BIT tokens cannot be minted or burnt as the implemented code is guarded by requires that exclude the addresses required to mint or burn.
line 665 – (ERC20.sol)
function _transfer(address sender, address recipient, uint256 amount) internal virtual {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount, "ERC20: transfer amount exceeds balance");
_balances[recipient] = _balances[recipient].add(amount);
emit Transfer(sender, recipient, amount);
}
line 883 – (BitDAO.sol)
function _beforeTokenTransfer(
address from,
address to,
uint256 amount
) internal virtual override {
super._beforeTokenTransfer(from, to, amount);
if (from == address(0)) {
// mint
_updateAccountSnapshot(to);
_updateTotalSupplySnapshot();
} else if (to == address(0)) {
// burn
_updateAccountSnapshot(from);
_updateTotalSupplySnapshot();
} else {
// transfer
_updateAccountSnapshot(from);
_updateAccountSnapshot(to);
}
}
Behaviour demostrated with the two tests:
‘minting BIT not allowed’
‘burning BIT not allowed'
If the intention is not to support these operations, then _beforeTokenTransfer could be trimmed to exclude those flows that are not possible (not a pressing change, as it's currently dead code, wouldn't bump up gas costs), otherwise if those operations are meant to be available then an update is required.
The text was updated successfully, but these errors were encountered:
Yes, I suspect burning tokens will be a popular proposal. Following standard monetary theory, reducing the available pool of tokens the remaining tokens will increase in value, giving an incentive for a holder to propose other people tokens are burnt 🤔
burning can be accomplished by sending ERC-20 tokens to the 0x00 address.
The BitDAO ERC20 contract does have the function / code to burn, however it is gated to revert calls to transfer to that address, so sending to the empty address 0x0 does not burn the transferred tokens, it merely results in a reverted transaction.
To mimic burning tokens, we could deploy an empty (unowned) contract that would effectively loose the tokens sent (as nobody would have the private keys).
BIT tokens cannot be minted or burnt as the implemented code is guarded by requires that exclude the addresses required to mint or burn.
line 665 – (ERC20.sol)
line 883 – (BitDAO.sol)
Behaviour demostrated with the two tests:
If the intention is not to support these operations, then
_beforeTokenTransfer
could be trimmed to exclude those flows that are not possible (not a pressing change, as it's currently dead code, wouldn't bump up gas costs), otherwise if those operations are meant to be available then an update is required.The text was updated successfully, but these errors were encountered: