Add modifier to System ERC721 mint function
@@ -3,13 +3,20 @@ pragma solidity ^0.5.10;
import {ITBTCSystem} from "../interfaces/ITBTCSystem.sol";
import {DepositLog} from "../DepositLog.sol";
import "openzeppelin-solidity/contracts/token/ERC721/ERC721.sol";
+import "./ERC721MinterAuthority.sol";
-contract TBTCSystem is ITBTCSystem, ERC721, DepositLog {
+contract TBTCSystem is ITBTCSystem, ERC721, ERC721MinterAuthority, DepositLog {
uint256 currentDifficulty = 1;
uint256 previousDifficulty = 1;
uint256 oraclePrice = 10 ** 12;
+ constructor(address _depositFactory)
+ ERC721MinterAuthority(_depositFactory)
+ public{
+ // solium-disable-previous-line no-empty-blocks
+ }
+
// Price Oracle
function fetchOraclePrice() external view returns (uint256) {return oraclePrice;}
@@ -30,13 +37,11 @@ contract TBTCSystem is ITBTCSystem, ERC721, DepositLog {
}
}
- // ERC721
-
- /// @dev Function to mint a new token.
- /// Reverts if the given token ID already exists.
+ /// @notice Function to mint a new token.
+ /// @dev Reverts if the given token ID already exists.
/// @param _to The address that will own the minted token
/// @param _tokenId uint256 ID of the token to be minted
- function mint(address _to, uint256 _tokenId) public {
+ function mint(address _to, uint256 _tokenId) public onlyFactory {
_mint(_to, _tokenId);
}
