Skip to content

Commit

Permalink
fix(protocol): make snapshot return value (#16436)
Browse files Browse the repository at this point in the history
Co-authored-by: D <[email protected]>
  • Loading branch information
dantaik and adaki2004 authored Mar 14, 2024
1 parent 559d860 commit dcae54a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
14 changes: 7 additions & 7 deletions packages/protocol/contracts/L1/TaikoToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@ contract TaikoToken is EssentialContract, ERC20SnapshotUpgradeable, ERC20VotesUp
/// @param _from The address to burn tokens from.
/// @param _amount The amount of tokens to burn.
function burn(address _from, uint256 _amount) public onlyOwner {
_burn(_from, _amount);
return _burn(_from, _amount);
}

/// @notice Creates a new token snapshot.
function snapshot() public onlyFromOwnerOrNamed("snapshooter") {
_snapshot();
function snapshot() public onlyFromOwnerOrNamed("snapshooter") returns (uint256) {
return _snapshot();
}

/// @notice Transfers tokens to a specified address.
Expand Down Expand Up @@ -90,7 +90,7 @@ contract TaikoToken is EssentialContract, ERC20SnapshotUpgradeable, ERC20VotesUp
internal
override(ERC20Upgradeable, ERC20SnapshotUpgradeable)
{
super._beforeTokenTransfer(_from, _to, _amount);
return super._beforeTokenTransfer(_from, _to, _amount);
}

function _afterTokenTransfer(
Expand All @@ -101,7 +101,7 @@ contract TaikoToken is EssentialContract, ERC20SnapshotUpgradeable, ERC20VotesUp
internal
override(ERC20Upgradeable, ERC20VotesUpgradeable)
{
super._afterTokenTransfer(_from, _to, _amount);
return super._afterTokenTransfer(_from, _to, _amount);
}

function _mint(
Expand All @@ -111,7 +111,7 @@ contract TaikoToken is EssentialContract, ERC20SnapshotUpgradeable, ERC20VotesUp
internal
override(ERC20Upgradeable, ERC20VotesUpgradeable)
{
super._mint(_to, _amount);
return super._mint(_to, _amount);
}

function _burn(
Expand All @@ -121,6 +121,6 @@ contract TaikoToken is EssentialContract, ERC20SnapshotUpgradeable, ERC20VotesUp
internal
override(ERC20Upgradeable, ERC20VotesUpgradeable)
{
super._burn(_from, _amount);
return super._burn(_from, _amount);
}
}
2 changes: 1 addition & 1 deletion packages/protocol/contracts/L1/gov/TaikoGovernor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ contract TaikoGovernor is
internal
override(GovernorUpgradeable, GovernorTimelockControlUpgradeable)
{
super._execute(_proposalId, _targets, _values, _calldatas, _descriptionHash);
return super._execute(_proposalId, _targets, _values, _calldatas, _descriptionHash);
}

function _cancel(
Expand Down
16 changes: 8 additions & 8 deletions packages/protocol/contracts/tokenvault/BridgedERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ contract BridgedERC20 is
}

/// @notice Creates a new token snapshot.
function snapshot() external onlyOwnerOrSnapshooter {
_snapshot();
function snapshot() external onlyOwnerOrSnapshooter returns (uint256) {
return _snapshot();
}

/// @notice Gets the name of the token.
Expand Down Expand Up @@ -126,11 +126,11 @@ contract BridgedERC20 is
}

function _mintToken(address _account, uint256 _amount) internal override {
_mint(_account, _amount);
return _mint(_account, _amount);
}

function _burnToken(address _from, uint256 _amount) internal override {
_burn(_from, _amount);
return _burn(_from, _amount);
}

/// @dev For ERC20SnapshotUpgradeable and ERC20VotesUpgradeable, need to implement the following
Expand All @@ -145,7 +145,7 @@ contract BridgedERC20 is
{
if (_to == address(this)) revert BTOKEN_CANNOT_RECEIVE();
if (paused()) revert INVALID_PAUSE_STATUS();
super._beforeTokenTransfer(_from, _to, _amount);
return super._beforeTokenTransfer(_from, _to, _amount);
}

function _afterTokenTransfer(
Expand All @@ -156,7 +156,7 @@ contract BridgedERC20 is
internal
override(ERC20Upgradeable, ERC20VotesUpgradeable)
{
super._afterTokenTransfer(_from, _to, _amount);
return super._afterTokenTransfer(_from, _to, _amount);
}

function _mint(
Expand All @@ -166,7 +166,7 @@ contract BridgedERC20 is
internal
override(ERC20Upgradeable, ERC20VotesUpgradeable)
{
super._mint(_to, _amount);
return super._mint(_to, _amount);
}

function _burn(
Expand All @@ -176,6 +176,6 @@ contract BridgedERC20 is
internal
override(ERC20Upgradeable, ERC20VotesUpgradeable)
{
super._burn(_from, _amount);
return super._burn(_from, _amount);
}
}

0 comments on commit dcae54a

Please sign in to comment.