Skip to content

Commit

Permalink
fix(WBTC): upgradeable WBTC
Browse files Browse the repository at this point in the history
  • Loading branch information
TuDo1403 committed Jan 22, 2025
1 parent d706388 commit d1cd018
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions src/tokens/erc20/WBTC.sol
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import { Initializable } from "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol";

contract WBTC is ERC20PresetMinterPauser {
contract WBTC is Initializable, ERC20PresetMinterPauser {
bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");

constructor(address admin, address minter, address burner, address pauser) ERC20PresetMinterPauser("Wrapped Bitcoin", "WBTC") {
constructor() ERC20PresetMinterPauser("", "") {
_revokeRole(DEFAULT_ADMIN_ROLE, _msgSender());
_revokeRole(MINTER_ROLE, _msgSender());
_revokeRole(PAUSER_ROLE, _msgSender());

_disableInitializers();
}

function initialize(address admin, address minter, address burner, address pauser) external initializer {
_grantRole(DEFAULT_ADMIN_ROLE, admin);
_grantRole(PAUSER_ROLE, pauser);
_grantRole(BURNER_ROLE, burner);
_grantRole(MINTER_ROLE, minter);
}

_revokeRole(DEFAULT_ADMIN_ROLE, _msgSender());
_revokeRole(MINTER_ROLE, _msgSender());
_revokeRole(PAUSER_ROLE, _msgSender());
/**
* @inheritdoc ERC20
*/
function name() public view virtual override returns (string memory) {
return "Wrapped Bitcoin";
}

/**
* @inheritdoc ERC20
*/
function symbol() public view virtual override returns (string memory) {
return "WBTC";
}

/**
Expand Down

0 comments on commit d1cd018

Please sign in to comment.