¡El código fuente de este contrato está verificado!
Metadatos del Contrato
Compilador
0.6.12+commit.27d51765
Idioma
Solidity
Código Fuente del Contrato
Archivo 1 de 9: AccessControl.sol
Código Fuente del Contrato
Archivo 2 de 9: Address.sol
Código Fuente del Contrato
Archivo 3 de 9: Context.sol
Código Fuente del Contrato
Archivo 4 de 9: DISToken.sol
// SPDX-License-Identifier: MITpragmasolidity 0.6.12;import"https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/AccessControl.sol";
import"https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/GSN/Context.sol";
import"https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20Burnable.sol";
/**
* @dev {ERC20} token, including:
*
* - ability for holders to burn (destroy) their tokens
* - a minter role that allows for token minting (creation)
* - a pauser role that allows to stop all token transfers
*
* This contract uses {AccessControl} to lock permissioned functions using the
* different roles - head to its documentation for details.
*
* The account that deploys the contract will be granted the minter and pauser
* roles, as well as the default admin role, which will let it grant both minter
* and pauser roles to other accounts.
*/contractDISTokenisContext, AccessControl, ERC20Burnable{
bytes32publicconstant MINTER_ROLE =keccak256("MINTER_ROLE");
/**
* @dev Grants `DEFAULT_ADMIN_ROLE`, `MINTER_ROLE` and `PAUSER_ROLE` to the
* account that deploys the contract.
*
* See {ERC20-constructor}.
*/constructor(uint256 totalSupply,
stringmemory name,
stringmemory symbol
) publicERC20(name, symbol) {
_setupRole(DEFAULT_ADMIN_ROLE, _msgSender());
_setupRole(MINTER_ROLE, _msgSender());
_mint(msg.sender, totalSupply);
}
/**
* @dev Creates `amount` new tokens for `to`.
*
* See {ERC20-_mint}.
*
* Requirements:
*
* - the caller must have the `MINTER_ROLE`.
*/functionmint(address to, uint256 amount) publicvirtual{
require(
hasRole(MINTER_ROLE, _msgSender()),
"DISToken: must have minter role to mint"
);
_mint(to, amount);
}
}