Skip to content

Commit

Permalink
openzeppeling remapping implemented on imports
Browse files Browse the repository at this point in the history
  • Loading branch information
cgrade committed Sep 2, 2024
1 parent 17689e8 commit 499d69a
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/DecntralizedStableCoin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@

pragma solidity ^0.8.19;

import {ERC20Burnable} from "lib/openzeppelin-contracts/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import {ERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol";
import {Ownable} from "lib/openzeppelin-contracts/contracts/access/Ownable.sol";
import {ERC20Burnable} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
/**
* @title Decentralized Stable Coin
* @author Abraham Elijah
Expand All @@ -38,21 +38,20 @@ import {Ownable} from "lib/openzeppelin-contracts/contracts/access/Ownable.sol";
*/

contract DecentralizedStableCoin is ERC20Burnable, Ownable {

/*//////////////////////////////////////////////////////////////
ERRORS
//////////////////////////////////////////////////////////////*/
error DecentralizedStableCoin__MustBeMoreThanZero();
error ERC20Burnable__BurnAmountExceedsBalance();
error DecentralizedStableCoin__NotZeroAddress();

constructor() ERC20("DecentralizedStableCoin", "DSC") Ownable(msg.sender){}
constructor() ERC20("DecentralizedStableCoin", "DSC") Ownable(msg.sender) {}

/**
/**
* @notice Burns tokens from the caller
* @dev This function burns tokens from the caller
* @param _amount: amount of tokens to burn
*/
*/
function burn(uint256 _amount) public override onlyOwner {
uint256 balance = balanceOf(msg.sender);
if (_amount <= 0) {
Expand All @@ -64,7 +63,6 @@ contract DecentralizedStableCoin is ERC20Burnable, Ownable {
super.burn(_amount);
}


/**
* @notice Mint new tokens
* @dev This function mints new tokens
Expand All @@ -83,4 +81,4 @@ contract DecentralizedStableCoin is ERC20Burnable, Ownable {
_mint(_to, _amount);
return true;
}
}
}

0 comments on commit 499d69a

Please sign in to comment.