Removed mintingFinished. (#1351)

* Removed mintingFinished from ERC20Mintable.

* Removed MintingFinished from ERC721Mintable.

* Removed MintingFinished event.

(cherry picked from commit 5fdeaa81d5)
This commit is contained in:
Nicolás Venturo
2018-09-26 16:05:43 -03:00
committed by Francisco Giordano
parent 652243b7c3
commit 1b0c6b94b9
4 changed files with 21 additions and 207 deletions

View File

@ -9,22 +9,6 @@ import "../../access/roles/MinterRole.sol";
* @dev ERC20 minting logic
*/
contract ERC20Mintable is ERC20, MinterRole {
event MintingFinished();
bool private _mintingFinished = false;
modifier onlyBeforeMintingFinished() {
require(!_mintingFinished);
_;
}
/**
* @return true if the minting is finished.
*/
function mintingFinished() public view returns(bool) {
return _mintingFinished;
}
/**
* @dev Function to mint tokens
* @param to The address that will receive the minted tokens.
@ -37,25 +21,9 @@ contract ERC20Mintable is ERC20, MinterRole {
)
public
onlyMinter
onlyBeforeMintingFinished
returns (bool)
{
_mint(to, amount);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting()
public
onlyMinter
onlyBeforeMintingFinished
returns (bool)
{
_mintingFinished = true;
emit MintingFinished();
return true;
}
}

View File

@ -9,22 +9,6 @@ import "../../access/roles/MinterRole.sol";
* @dev ERC721 minting logic
*/
contract ERC721Mintable is ERC721Full, MinterRole {
event MintingFinished();
bool private _mintingFinished = false;
modifier onlyBeforeMintingFinished() {
require(!_mintingFinished);
_;
}
/**
* @return true if the minting is finished.
*/
function mintingFinished() public view returns(bool) {
return _mintingFinished;
}
/**
* @dev Function to mint tokens
* @param to The address that will receive the minted tokens.
@ -37,7 +21,6 @@ contract ERC721Mintable is ERC721Full, MinterRole {
)
public
onlyMinter
onlyBeforeMintingFinished
returns (bool)
{
_mint(to, tokenId);
@ -51,26 +34,10 @@ contract ERC721Mintable is ERC721Full, MinterRole {
)
public
onlyMinter
onlyBeforeMintingFinished
returns (bool)
{
mint(to, tokenId);
_setTokenURI(tokenId, tokenURI);
return true;
}
/**
* @dev Function to stop minting new tokens.
* @return True if the operation was successful.
*/
function finishMinting()
public
onlyMinter
onlyBeforeMintingFinished
returns (bool)
{
_mintingFinished = true;
emit MintingFinished();
return true;
}
}