Contract 0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e11

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x545543d2bd3fbccdd4ad6a1f5a0a2d45a07888db9f395a5318da6a98920aa620Add Token Templa...6298812022-03-18 13:07:54253 days 2 hrs ago0xf87bc5535602077d340806d71f805ea9907a843d IN  0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e110 GLMR0.0103049
0xdcf800f76379f8c4d37991574063b527e1dd78dfd830bdba3408bb7a68b27152Add Token Templa...6298762022-03-18 13:06:48253 days 2 hrs ago0xf87bc5535602077d340806d71f805ea9907a843d IN  0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e110 GLMR0.0103049
0xdb4725864b351f7e7a342dcccfc404ff03f0c1c0647730ba244fab22e9ede39cAdd Token Templa...6298702022-03-18 13:05:36253 days 2 hrs ago0xf87bc5535602077d340806d71f805ea9907a843d IN  0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e110 GLMR0.0122926
0x0f9505bdf26026dcb7cbf01d1a8d105ace3b49d7df780c91292dd5eadee4fc0bInit MISO Token ...6298642022-03-18 13:04:24253 days 2 hrs ago0xf87bc5535602077d340806d71f805ea9907a843d IN  0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e110 GLMR0.0067193
0x7d378555193dac107b3f3e8a2509897ece46a6edaf5e3bc9ff0026bc8f787ce20x608060406298622022-03-18 13:04:00253 days 2 hrs ago0xf87bc5535602077d340806d71f805ea9907a843d IN  Create: MISOTokenFactory0 GLMR0.1593026
[ Download CSV Export 
Latest 18 internal transactions
Parent Txn Hash Block From To Value
0xfaf769de3302e802e44ba5a7f89b685e5bbb6c018a1c53af2f7a620f510dcac722998012022-11-15 2:37:1811 days 12 hrs ago 0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e11  Contract Creation0 GLMR
0x8362eaf4901d6020581c58ae9f787abce739f703b9bab7cd334725d001b458f320382812022-10-09 0:43:3648 days 14 hrs ago 0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e11  Contract Creation0 GLMR
0x6581545f9746895720bc9ffeebda89dfb4caa476e06b160f046cbafa6b259d1417235832022-08-25 0:06:0093 days 15 hrs ago 0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e11  Contract Creation0 GLMR
0x6c2a0156b99801adfc8b89503eff253783b51e142d8530b42b109454cd66a6a417234372022-08-24 23:36:2093 days 15 hrs ago 0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e11  Contract Creation0 GLMR
0x6189d6c3423572169bbd897e53cb5316765f7e210e448418b080c41ee20eb2f116177762022-08-09 19:01:06108 days 20 hrs ago 0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e11  Contract Creation0 GLMR
0x6e695623ed2f78ec038cf41d9dab6387fadceaa05e03702d3fa674951f9ab83812881812022-06-22 9:37:30157 days 5 hrs ago 0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e11  Contract Creation0 GLMR
0xa095a038d49037874a422046797b879ce3088e71ffdcd00e90ee6b0807b5912312878092022-06-22 8:16:54157 days 7 hrs ago 0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e11  Contract Creation0 GLMR
0x0312285de917be364b0d03f9740b4fd0df899f3e7c15811f9c34458e7a2c781a12184482022-06-11 22:18:00167 days 17 hrs ago 0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e11  Contract Creation0 GLMR
0xd5c0c9d15c27f5f81df2f98250d7d9049b832aa22d2586bf69a3a99c16c6ca0612139262022-06-11 6:15:24168 days 9 hrs ago 0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e11  Contract Creation0 GLMR
0xf2265636b093dde4660c113244f8f0bad79f788ee0d5a0889e94876a6785516011609612022-06-03 9:48:00176 days 5 hrs ago 0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e11  Contract Creation0 GLMR
0x4eb99efc9d61f2b101a5567090ad00f1708a935fe459ba34b21a4d7607b6adb110982332022-05-25 6:03:24185 days 9 hrs ago 0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e11  Contract Creation0 GLMR
0x33663327fdbc32a342bd50e653fb5c76d109cdd24dc689effc96d794f5a2d5ff10573362022-05-19 7:53:00191 days 7 hrs ago 0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e11  Contract Creation0 GLMR
0x71f1b42e16c51292c33819cef794d67789b543918c9aa2814796c747ad35a58810361192022-05-16 6:32:18194 days 8 hrs ago 0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e11  Contract Creation0 GLMR
0x5f5aacf10e7da76e6febf17302a5923ef0f86f55b755df2450b90d5abf3aaad89303522022-04-30 17:53:42209 days 21 hrs ago 0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e11  Contract Creation0 GLMR
0x1f3115827d9641353f5cbbf12b44f4d8b2673c93674609adfec7e4c8eb99c1f78460802022-04-18 14:05:36222 days 1 hr ago 0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e11  Contract Creation0 GLMR
0x55166a8888ecad233a8f962744542e0e98f5b9d468a1bbd3ba067b00c47bcd437021262022-03-28 22:19:30242 days 17 hrs ago 0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e11  Contract Creation0 GLMR
0x83f6a42755f1353daab6d4211534b53f8175c6b807b7b981f986827912459a706570462022-03-22 9:59:24249 days 5 hrs ago 0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e11  Contract Creation0 GLMR
0x9eb7e99d9ce42983d5328aa0758987468e870281c1cc0ff3c9a0f046f73184ab6400172022-03-19 23:52:42251 days 15 hrs ago 0x1dfe5ce9e3630f6d542187cbfb267c9aa1b31e11  Contract Creation0 GLMR
[ Download CSV Export 
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
MISOTokenFactory

Compiler Version
v0.6.12+commit.27d51765

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 10 : MISOTokenFactory.sol
pragma solidity 0.6.12;

//----------------------------------------------------------------------------------
//    I n s t a n t
//
//        .:mmm.         .:mmm:.       .ii.  .:SSSSSSSSSSSSS.     .oOOOOOOOOOOOo.  
//      .mMM'':Mm.     .:MM'':Mm:.     .II:  :SSs..........     .oOO'''''''''''OOo.
//    .:Mm'   ':Mm.   .:Mm'   'MM:.    .II:  'sSSSSSSSSSSSSS:.  :OO.           .OO:
//  .'mMm'     ':MM:.:MMm'     ':MM:.  .II:  .:...........:SS.  'OOo:.........:oOO'
//  'mMm'        ':MMmm'         'mMm:  II:  'sSSSSSSSSSSSSS'     'oOOOOOOOOOOOO'  
//
//----------------------------------------------------------------------------------
//
// Chef Gonpachi's MISO Token Factory
//
// A factory to conveniently deploy your own source code verified  token contracts
//
// Inspired by Bokky's EtherVendingMachince.io
// https://github.com/bokkypoobah/FixedSupplyTokenFactory
// 
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// The above copyright notice and this permission notice shall be included 
// in all copies or substantial portions of the Software.
//
// Made for Sushi.com 
// 
// Enjoy. (c) Chef Gonpachi 2021 
// <https://github.com/chefgonpachi/MISO/>
//
// ---------------------------------------------------------------------
// SPDX-License-Identifier: GPL-3.0                        
// ---------------------------------------------------------------------


import "./Utils/CloneFactory.sol";
import "./interfaces/IMisoToken.sol";
import "./Access/MISOAccessControls.sol";
import "./Utils/SafeTransfer.sol";
import "./interfaces/IERC20.sol";

contract MISOTokenFactory is CloneFactory, SafeTransfer{
    
    /// @notice Responsible for access rights to the contract
    MISOAccessControls public accessControls;
    bytes32 public constant TOKEN_MINTER_ROLE = keccak256("TOKEN_MINTER_ROLE");

    /// @notice Constant to indicate precision
    uint256 private constant INTEGRATOR_FEE_PRECISION = 1000;

    /// @notice Whether token factory has been initialized or not.
    bool private initialised;

    /// @notice Struct to track Token template.
    struct Token {
        bool exists;
        uint256 templateId;
        uint256 index;
    }

    /// @notice Mapping from token address created through this contract to Token struct.
    mapping(address => Token) public tokenInfo;

    /// @notice Array of tokens created using the factory.
    address[] public tokens;

    /// @notice Template id to track respective token template.
    uint256 public tokenTemplateId;

    /// @notice Mapping from token template id to token template address.
    mapping(uint256 => address) private tokenTemplates;

    /// @notice mapping from token template address to token template id
    mapping(address => uint256) private tokenTemplateToId;

    /// @notice mapping from template type to template id
    mapping(uint256 => uint256) public currentTemplateId;

    /// @notice Minimum fee to create a token through the factory.
    uint256 public minimumFee;
    uint256 public integratorFeePct;

    /// @notice Contract locked status. If locked, only minters can deploy
    bool public locked;

    /// @notice Any MISO dividends collected are sent here.
    address payable public misoDiv;

    /// @notice Event emitted when first initializing Miso Token Factory.
    event MisoInitTokenFactory(address sender);

    /// @notice Event emitted when a token is created using template id.
    event TokenCreated(address indexed owner, address indexed addr, address tokenTemplate);
    
    /// @notice event emitted when a token is initialized using template id
    event TokenInitialized(address indexed addr, uint256 templateId, bytes data);

    /// @notice Event emitted when a token template is added.
    event TokenTemplateAdded(address newToken, uint256 templateId);

    /// @notice Event emitted when a token template is removed.
    event TokenTemplateRemoved(address token, uint256 templateId);

    constructor() public {
    }

    /**
     * @notice Single gateway to initialize the MISO Token Factory with proper address.
     * @dev Can only be initialized once.
     * @param _accessControls Sets address to get the access controls from.
     */
    /// @dev GP: Migrate to the BentoBox.
    function initMISOTokenFactory(address _accessControls) external  {
        require(!initialised);
        initialised = true;
        locked = true;
        accessControls = MISOAccessControls(_accessControls);
        emit MisoInitTokenFactory(msg.sender);
    }

    /**
     * @notice Sets the minimum fee.
     * @param _amount Fee amount.
     */
    function setMinimumFee(uint256 _amount) external {
        require(
            accessControls.hasAdminRole(msg.sender),
            "MISOTokenFactory: Sender must be operator"
        );
        minimumFee = _amount;
    }

    /**
     * @notice Sets integrator fee percentage.
     * @param _amount Percentage amount.
     */
    function setIntegratorFeePct(uint256 _amount) external {
        require(
            accessControls.hasAdminRole(msg.sender),
            "MISOTokenFactory: Sender must be operator"
        );
        /// @dev this is out of 1000, ie 25% = 250
        require(
            _amount <= INTEGRATOR_FEE_PRECISION, 
            "MISOTokenFactory: Range is from 0 to 1000"
        );
        integratorFeePct = _amount;
    }

    /**
     * @notice Sets dividend address.
     * @param _divaddr Dividend address.
     */
    function setDividends(address payable _divaddr) external  {
        require(
            accessControls.hasAdminRole(msg.sender),
            "MISOTokenFactory: Sender must be operator"
        );
        require(_divaddr != address(0));
        misoDiv = _divaddr;
    }    
    
    /**
     * @notice Sets the factory to be locked or unlocked.
     * @param _locked bool.
     */
    function setLocked(bool _locked) external {
        require(
            accessControls.hasAdminRole(msg.sender),
            "MISOTokenFactory: Sender must be admin"
        );
        locked = _locked;
    }


    /**
     * @notice Sets the current template ID for any type.
     * @param _templateType Type of template.
     * @param _templateId The ID of the current template for that type
     */
    function setCurrentTemplateId(uint256 _templateType, uint256 _templateId) external {
        require(
            accessControls.hasAdminRole(msg.sender) ||
            accessControls.hasOperatorRole(msg.sender),
            "MISOTokenFactory: Sender must be admin"
        );
        require(tokenTemplates[_templateId] != address(0), "MISOTokenFactory: incorrect _templateId");
        require(IMisoToken(tokenTemplates[_templateId]).tokenTemplate() == _templateType, "MISOTokenFactory: incorrect _templateType");
        currentTemplateId[_templateType] = _templateId;
    }

    /**
     * @notice Used to check whether an address has the minter role
     * @param _address EOA or contract being checked
     * @return bool True if the account has the role or false if it does not
     */
    function hasTokenMinterRole(address _address) public view returns (bool) {
        return accessControls.hasRole(TOKEN_MINTER_ROLE, _address);
    }



    /**
     * @notice Creates a token corresponding to template id and transfers fees.
     * @dev Initializes token with parameters passed
     * @param _templateId Template id of token to create.
     * @param _integratorFeeAccount Address to pay the fee to.
     * @return token Token address.
     */
    function deployToken(
        uint256 _templateId,
        address payable _integratorFeeAccount
    )
        public payable returns (address token)
    {
        /// @dev If the contract is locked, only admin and minters can deploy. 
        if (locked) {
            require(accessControls.hasAdminRole(msg.sender) 
                    || accessControls.hasMinterRole(msg.sender)
                    || hasTokenMinterRole(msg.sender),
                "MISOTokenFactory: Sender must be minter if locked"
            );
        }
        require(msg.value >= minimumFee, "MISOTokenFactory: Failed to transfer minimumFee");
        require(tokenTemplates[_templateId] != address(0), "MISOTokenFactory: incorrect _templateId");
        uint256 integratorFee = 0;
        uint256 misoFee = msg.value;
        if (_integratorFeeAccount != address(0) && _integratorFeeAccount != misoDiv) {
            integratorFee = misoFee * integratorFeePct / INTEGRATOR_FEE_PRECISION;
            misoFee = misoFee - integratorFee;
        }
        token = createClone(tokenTemplates[_templateId]);
        /// @dev GP: Triple check the token index is correct.
        tokenInfo[token] = Token(true, _templateId, tokens.length);
        tokens.push(token);
        emit TokenCreated(msg.sender, token, tokenTemplates[_templateId]);
        if (misoFee > 0) {
            misoDiv.transfer(misoFee);
        }
        if (integratorFee > 0) {
            _integratorFeeAccount.transfer(integratorFee);
        }
    }

    /**
     * @notice Creates a token corresponding to template id.
     * @dev Initializes token with parameters passed.
     * @param _templateId Template id of token to create.
     * @param _integratorFeeAccount Address to pay the fee to.
     * @param _data Data to be passed to the token contract for init.
     * @return token Token address.
     */
    function createToken(
        uint256 _templateId,
        address payable _integratorFeeAccount,
        bytes calldata _data
    )
        external payable returns (address token)
    {
        token = deployToken(_templateId, _integratorFeeAccount);
        emit TokenInitialized(address(token), _templateId, _data);
        IMisoToken(token).initToken(_data);
        uint256 initialTokens = IERC20(token).balanceOf(address(this));
        if (initialTokens > 0 ) {
            _safeTransfer(token, msg.sender, initialTokens);
        }
    }

    /**
     * @notice Function to add a token template to create through factory.
     * @dev Should have operator access.
     * @param _template Token template to create a token.
     */
    function addTokenTemplate(address _template) external {
        require(
            accessControls.hasAdminRole(msg.sender) ||
            accessControls.hasOperatorRole(msg.sender),
            "MISOTokenFactory: Sender must be operator"
        );
        uint256 templateType = IMisoToken(_template).tokenTemplate();
        require(templateType > 0, "MISOTokenFactory: Incorrect template code ");
        require(tokenTemplateToId[_template] == 0, "MISOTokenFactory: Template exists");
        tokenTemplateId++;
        tokenTemplates[tokenTemplateId] = _template;
        tokenTemplateToId[_template] = tokenTemplateId;
        currentTemplateId[templateType] = tokenTemplateId;
        emit TokenTemplateAdded(_template, tokenTemplateId);

    }

    /**
     * @notice Function to remove a token template.
     * @dev Should have operator access.
     * @param _templateId Refers to template that is to be deleted.
    */
    function removeTokenTemplate(uint256 _templateId) external {
        require(
            accessControls.hasAdminRole(msg.sender) ||
            accessControls.hasOperatorRole(msg.sender),
            "MISOTokenFactory: Sender must be operator"
        );
        require(tokenTemplates[_templateId] != address(0));
        address template = tokenTemplates[_templateId];
        uint256 templateType = IMisoToken(tokenTemplates[_templateId]).tokenTemplate();
        if (currentTemplateId[templateType] == _templateId) {
            delete currentTemplateId[templateType];
        }
        tokenTemplates[_templateId] = address(0);
        delete tokenTemplateToId[template];
        emit TokenTemplateRemoved(template, _templateId);
    }

    /**
     * @notice Get the total number of tokens in the factory.
     * @return Token count.
     */
    function numberOfTokens() external view returns (uint256) {
        return tokens.length;
    }

    function getTokens() external view returns (address[] memory) {
        return tokens;
    }

    /**
     * @notice Get the address based on template ID.
     * @param _templateId Token template ID.
     * @return Address of the required template ID.
     */
    function getTokenTemplate(uint256 _templateId) external view returns (address ) {
        return tokenTemplates[_templateId];
    }

    /**
     * @notice Get the ID based on template address.
     * @param _tokenTemplate Token template address.
     * @return ID of the required template address.
     */
    function getTemplateId(address _tokenTemplate) external view returns (uint256) {
        return tokenTemplateToId[_tokenTemplate];
    }
}

File 2 of 10 : CloneFactory.sol
pragma solidity 0.6.12;

// ----------------------------------------------------------------------------
// CloneFactory.sol
// From
// https://github.com/optionality/clone-factory/blob/32782f82dfc5a00d103a7e61a17a5dedbd1e8e9d/contracts/CloneFactory.sol
// ----------------------------------------------------------------------------

/*
The MIT License (MIT)
Copyright (c) 2018 Murray Software, LLC.
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
//solhint-disable max-line-length
//solhint-disable no-inline-assembly

contract CloneFactory {

  function createClone(address target) internal returns (address result) {
    bytes20 targetBytes = bytes20(target);
    assembly {
      let clone := mload(0x40)
      mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)
      mstore(add(clone, 0x14), targetBytes)
      mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)
      result := create(0, clone, 0x37)
    }
  }

  function isClone(address target, address query) internal view returns (bool result) {
    bytes20 targetBytes = bytes20(target);
    assembly {
      let clone := mload(0x40)
      mstore(clone, 0x363d3d373d3d3d363d7300000000000000000000000000000000000000000000)
      mstore(add(clone, 0xa), targetBytes)
      mstore(add(clone, 0x1e), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)

      let other := add(clone, 0x40)
      extcodecopy(query, other, 0, 0x2d)
      result := and(
        eq(mload(clone), mload(other)),
        eq(mload(add(clone, 0xd)), mload(add(other, 0xd)))
      )
    }
  }
}

File 3 of 10 : IMisoToken.sol
pragma solidity 0.6.12;

interface IMisoToken {
    function init(bytes calldata data) external payable;
    function initToken( bytes calldata data ) external;
    function tokenTemplate() external view returns (uint256);

}

File 4 of 10 : MISOAccessControls.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.6.12;

import "./MISOAdminAccess.sol";

/**
 * @notice Access Controls
 * @author Attr: BlockRocket.tech
 */
contract MISOAccessControls is MISOAdminAccess {
    /// @notice Role definitions
    bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
    bytes32 public constant SMART_CONTRACT_ROLE = keccak256("SMART_CONTRACT_ROLE");
    bytes32 public constant OPERATOR_ROLE = keccak256("OPERATOR_ROLE");

    /**
     * @notice The deployer is automatically given the admin role which will allow them to then grant roles to other addresses
     */
    constructor() public {
    }


    /////////////
    // Lookups //
    /////////////

    /**
     * @notice Used to check whether an address has the minter role
     * @param _address EOA or contract being checked
     * @return bool True if the account has the role or false if it does not
     */
    function hasMinterRole(address _address) public view returns (bool) {
        return hasRole(MINTER_ROLE, _address);
    }

    /**
     * @notice Used to check whether an address has the smart contract role
     * @param _address EOA or contract being checked
     * @return bool True if the account has the role or false if it does not
     */
    function hasSmartContractRole(address _address) public view returns (bool) {
        return hasRole(SMART_CONTRACT_ROLE, _address);
    }

    /**
     * @notice Used to check whether an address has the operator role
     * @param _address EOA or contract being checked
     * @return bool True if the account has the role or false if it does not
     */
    function hasOperatorRole(address _address) public view returns (bool) {
        return hasRole(OPERATOR_ROLE, _address);
    }

    ///////////////
    // Modifiers //
    ///////////////

    /**
     * @notice Grants the minter role to an address
     * @dev The sender must have the admin role
     * @param _address EOA or contract receiving the new role
     */
    function addMinterRole(address _address) external {
        grantRole(MINTER_ROLE, _address);
    }

    /**
     * @notice Removes the minter role from an address
     * @dev The sender must have the admin role
     * @param _address EOA or contract affected
     */
    function removeMinterRole(address _address) external {
        revokeRole(MINTER_ROLE, _address);
    }

    /**
     * @notice Grants the smart contract role to an address
     * @dev The sender must have the admin role
     * @param _address EOA or contract receiving the new role
     */
    function addSmartContractRole(address _address) external {
        grantRole(SMART_CONTRACT_ROLE, _address);
    }

    /**
     * @notice Removes the smart contract role from an address
     * @dev The sender must have the admin role
     * @param _address EOA or contract affected
     */
    function removeSmartContractRole(address _address) external {
        revokeRole(SMART_CONTRACT_ROLE, _address);
    }

    /**
     * @notice Grants the operator role to an address
     * @dev The sender must have the admin role
     * @param _address EOA or contract receiving the new role
     */
    function addOperatorRole(address _address) external {
        grantRole(OPERATOR_ROLE, _address);
    }

    /**
     * @notice Removes the operator role from an address
     * @dev The sender must have the admin role
     * @param _address EOA or contract affected
     */
    function removeOperatorRole(address _address) external {
        revokeRole(OPERATOR_ROLE, _address);
    }

}

File 5 of 10 : SafeTransfer.sol
pragma solidity 0.6.12;

contract SafeTransfer {

    address private constant ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

    /// @notice Event for token withdrawals.
    event TokensWithdrawn(address token, address to, uint256 amount);

    /// @dev Helper function to handle both ETH and ERC20 payments
    function _safeTokenPayment(
        address _token,
        address payable _to,
        uint256 _amount
    ) internal {
        if (address(_token) == ETH_ADDRESS) {
            _safeTransferETH(_to,_amount );
        } else {
            _safeTransfer(_token, _to, _amount);
        }

        emit TokensWithdrawn(_token, _to, _amount);
    }


    /// @dev Helper function to handle both ETH and ERC20 payments
    function _tokenPayment(
        address _token,
        address payable _to,
        uint256 _amount
    ) internal {
        if (address(_token) == ETH_ADDRESS) {
            _to.transfer(_amount);
        } else {
            _safeTransfer(_token, _to, _amount);
        }

        emit TokensWithdrawn(_token, _to, _amount);
    }


    /// @dev Transfer helper from UniswapV2 Router
    function _safeApprove(address token, address to, uint value) internal {
        // bytes4(keccak256(bytes('approve(address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x095ea7b3, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: APPROVE_FAILED');
    }


    /**
     * There are many non-compliant ERC20 tokens... this can handle most, adapted from UniSwap V2
     * Im trying to make it a habit to put external calls last (reentrancy)
     * You can put this in an internal function if you like.
     */
    function _safeTransfer(
        address token,
        address to,
        uint256 amount
    ) internal virtual {
        // solium-disable-next-line security/no-low-level-calls
        (bool success, bytes memory data) =
            token.call(
                // 0xa9059cbb = bytes4(keccak256("transfer(address,uint256)"))
                abi.encodeWithSelector(0xa9059cbb, to, amount)
            );
        require(success && (data.length == 0 || abi.decode(data, (bool)))); // ERC20 Transfer failed
    }

    function _safeTransferFrom(
        address token,
        address from,
        uint256 amount
    ) internal virtual {
        // solium-disable-next-line security/no-low-level-calls
        (bool success, bytes memory data) =
            token.call(
                // 0x23b872dd = bytes4(keccak256("transferFrom(address,address,uint256)"))
                abi.encodeWithSelector(0x23b872dd, from, address(this), amount)
            );
        require(success && (data.length == 0 || abi.decode(data, (bool)))); // ERC20 TransferFrom failed
    }

    function _safeTransferFrom(address token, address from, address to, uint value) internal {
        // bytes4(keccak256(bytes('transferFrom(address,address,uint256)')));
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(0x23b872dd, from, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TransferHelper: TRANSFER_FROM_FAILED');
    }

    function _safeTransferETH(address to, uint value) internal {
        (bool success,) = to.call{value:value}(new bytes(0));
        require(success, 'TransferHelper: ETH_TRANSFER_FAILED');
    }


}

File 6 of 10 : IERC20.sol
pragma solidity 0.6.12;

interface IERC20 {
  function totalSupply() external view returns (uint256);

  function balanceOf(address account) external view returns (uint256);

  function allowance(address owner, address spender) external view returns (uint256);

  function approve(address spender, uint256 amount) external returns (bool);

  function name() external view returns (string memory);

  function symbol() external view returns (string memory);

  function decimals() external view returns (uint8);

  event Transfer(address indexed from, address indexed to, uint256 value);
  event Approval(address indexed owner, address indexed spender, uint256 value);

  function transferFrom(
    address from,
    address to,
    uint256 amount
  ) external returns (bool);

  function permit(
    address owner,
    address spender,
    uint256 value,
    uint256 deadline,
    uint8 v,
    bytes32 r,
    bytes32 s
  ) external;
}

File 7 of 10 : MISOAdminAccess.sol
// SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.6.12;

import "../OpenZeppelin/access/AccessControl.sol";


contract MISOAdminAccess is AccessControl {

    /// @dev Whether access is initialised.
    bool private initAccess;

    /// @notice The deployer is automatically given the admin role which will allow them to then grant roles to other addresses.
    constructor() public {
    }

    /**
     * @notice Initializes access controls.
     * @param _admin Admins address.
     */
    function initAccessControls(address _admin) public {
        require(!initAccess, "Already initialised");
        require(_admin != address(0), "Incorrect input");
        _setupRole(DEFAULT_ADMIN_ROLE, _admin);
        initAccess = true;
    }

    /////////////
    // Lookups //
    /////////////

    /**
     * @notice Used to check whether an address has the admin role.
     * @param _address EOA or contract being checked.
     * @return bool True if the account has the role or false if it does not.
     */
    function hasAdminRole(address _address) public  view returns (bool) {
        return hasRole(DEFAULT_ADMIN_ROLE, _address);
    }

    ///////////////
    // Modifiers //
    ///////////////

    /**
     * @notice Grants the admin role to an address.
     * @dev The sender must have the admin role.
     * @param _address EOA or contract receiving the new role.
     */
    function addAdminRole(address _address) external {
        grantRole(DEFAULT_ADMIN_ROLE, _address);
    }

    /**
     * @notice Removes the admin role from an address.
     * @dev The sender must have the admin role.
     * @param _address EOA or contract affected.
     */
    function removeAdminRole(address _address) external {
        revokeRole(DEFAULT_ADMIN_ROLE, _address);
    }
}

File 8 of 10 : AccessControl.sol
pragma solidity 0.6.12;

import "../utils/EnumerableSet.sol";
import "../utils/Context.sol";

/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context {
    using EnumerableSet for EnumerableSet.AddressSet;

    struct RoleData {
        EnumerableSet.AddressSet members;
        bytes32 adminRole;
    }

    mapping (bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view returns (bool) {
        return _roles[role].members.contains(account);
    }

    /**
     * @dev Returns the number of accounts that have `role`. Can be used
     * together with {getRoleMember} to enumerate all bearers of a role.
     */
    function getRoleMemberCount(bytes32 role) public view returns (uint256) {
        return _roles[role].members.length();
    }

    /**
     * @dev Returns one of the accounts that have `role`. `index` must be a
     * value between 0 and {getRoleMemberCount}, non-inclusive.
     *
     * Role bearers are not sorted in any particular way, and their ordering may
     * change at any point.
     *
     * WARNING: When using {getRoleMember} and {getRoleMemberCount}, make sure
     * you perform all queries on the same block. See the following
     * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post]
     * for more information.
     */
    function getRoleMember(bytes32 role, uint256 index) public view returns (address) {
        return _roles[role].members.at(index);
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to grant");

        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) public virtual {
        require(hasRole(_roles[role].adminRole, _msgSender()), "AccessControl: sender must be an admin to revoke");

        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) public virtual {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        emit RoleAdminChanged(role, _roles[role].adminRole, adminRole);
        _roles[role].adminRole = adminRole;
    }

    function _grantRole(bytes32 role, address account) private {
        if (_roles[role].members.add(account)) {
            emit RoleGranted(role, account, _msgSender());
        }
    }

    function _revokeRole(bytes32 role, address account) private {
        if (_roles[role].members.remove(account)) {
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

File 9 of 10 : EnumerableSet.sol
pragma solidity 0.6.12;

/**
 * @dev Library for managing
 * https://en.wikipedia.org/wiki/Set_(abstract_data_type)[sets] of primitive
 * types.
 *
 * Sets have the following properties:
 *
 * - Elements are added, removed, and checked for existence in constant time
 * (O(1)).
 * - Elements are enumerated in O(n). No guarantees are made on the ordering.
 *
 * ```
 * contract Example {
 *     // Add the library methods
 *     using EnumerableSet for EnumerableSet.AddressSet;
 *
 *     // Declare a set state variable
 *     EnumerableSet.AddressSet private mySet;
 * }
 * ```
 *
 * As of v3.3.0, sets of type `bytes32` (`Bytes32Set`), `address` (`AddressSet`)
 * and `uint256` (`UintSet`) are supported.
 */
library EnumerableSet {
    // To implement this library for multiple types with as little code
    // repetition as possible, we write it in terms of a generic Set type with
    // bytes32 values.
    // The Set implementation uses private functions, and user-facing
    // implementations (such as AddressSet) are just wrappers around the
    // underlying Set.
    // This means that we can only create new EnumerableSets for types that fit
    // in bytes32.

    struct Set {
        // Storage of set values
        bytes32[] _values;

        // Position of the value in the `values` array, plus 1 because index 0
        // means a value is not in the set.
        mapping (bytes32 => uint256) _indexes;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function _add(Set storage set, bytes32 value) private returns (bool) {
        if (!_contains(set, value)) {
            set._values.push(value);
            // The value is stored at length-1, but we add 1 to all indexes
            // and use 0 as a sentinel value
            set._indexes[value] = set._values.length;
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function _remove(Set storage set, bytes32 value) private returns (bool) {
        // We read and store the value's index to prevent multiple reads from the same storage slot
        uint256 valueIndex = set._indexes[value];

        if (valueIndex != 0) { // Equivalent to contains(set, value)
            // To delete an element from the _values array in O(1), we swap the element to delete with the last one in
            // the array, and then remove the last element (sometimes called as 'swap and pop').
            // This modifies the order of the array, as noted in {at}.

            uint256 toDeleteIndex = valueIndex - 1;
            uint256 lastIndex = set._values.length - 1;

            // When the value to delete is the last one, the swap operation is unnecessary. However, since this occurs
            // so rarely, we still do the swap anyway to avoid the gas cost of adding an 'if' statement.

            bytes32 lastvalue = set._values[lastIndex];

            // Move the last value to the index where the value to delete is
            set._values[toDeleteIndex] = lastvalue;
            // Update the index for the moved value
            set._indexes[lastvalue] = toDeleteIndex + 1; // All indexes are 1-based

            // Delete the slot where the moved value was stored
            set._values.pop();

            // Delete the index for the deleted slot
            delete set._indexes[value];

            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function _contains(Set storage set, bytes32 value) private view returns (bool) {
        return set._indexes[value] != 0;
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function _length(Set storage set) private view returns (uint256) {
        return set._values.length;
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function _at(Set storage set, uint256 index) private view returns (bytes32) {
        require(set._values.length > index, "EnumerableSet: index out of bounds");
        return set._values[index];
    }

    // Bytes32Set

    struct Bytes32Set {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _add(set._inner, value);
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(Bytes32Set storage set, bytes32 value) internal returns (bool) {
        return _remove(set._inner, value);
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(Bytes32Set storage set, bytes32 value) internal view returns (bool) {
        return _contains(set._inner, value);
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(Bytes32Set storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(Bytes32Set storage set, uint256 index) internal view returns (bytes32) {
        return _at(set._inner, index);
    }

    // AddressSet

    struct AddressSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(AddressSet storage set, address value) internal returns (bool) {
        return _add(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(AddressSet storage set, address value) internal returns (bool) {
        return _remove(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(AddressSet storage set, address value) internal view returns (bool) {
        return _contains(set._inner, bytes32(uint256(uint160(value))));
    }

    /**
     * @dev Returns the number of values in the set. O(1).
     */
    function length(AddressSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(AddressSet storage set, uint256 index) internal view returns (address) {
        return address(uint160(uint256(_at(set._inner, index))));
    }


    // UintSet

    struct UintSet {
        Set _inner;
    }

    /**
     * @dev Add a value to a set. O(1).
     *
     * Returns true if the value was added to the set, that is if it was not
     * already present.
     */
    function add(UintSet storage set, uint256 value) internal returns (bool) {
        return _add(set._inner, bytes32(value));
    }

    /**
     * @dev Removes a value from a set. O(1).
     *
     * Returns true if the value was removed from the set, that is if it was
     * present.
     */
    function remove(UintSet storage set, uint256 value) internal returns (bool) {
        return _remove(set._inner, bytes32(value));
    }

    /**
     * @dev Returns true if the value is in the set. O(1).
     */
    function contains(UintSet storage set, uint256 value) internal view returns (bool) {
        return _contains(set._inner, bytes32(value));
    }

    /**
     * @dev Returns the number of values on the set. O(1).
     */
    function length(UintSet storage set) internal view returns (uint256) {
        return _length(set._inner);
    }

   /**
    * @dev Returns the value stored at position `index` in the set. O(1).
    *
    * Note that there are no guarantees on the ordering of values inside the
    * array, and it may change when more values are added or removed.
    *
    * Requirements:
    *
    * - `index` must be strictly less than {length}.
    */
    function at(UintSet storage set, uint256 index) internal view returns (uint256) {
        return uint256(_at(set._inner, index));
    }
}

File 10 of 10 : Context.sol
pragma solidity 0.6.12;

/*
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with GSN meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract ABI

[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"MisoInitTokenFactory","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"address","name":"tokenTemplate","type":"address"}],"name":"TokenCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"addr","type":"address"},{"indexed":false,"internalType":"uint256","name":"templateId","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"TokenInitialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"templateId","type":"uint256"}],"name":"TokenTemplateAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"templateId","type":"uint256"}],"name":"TokenTemplateRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokensWithdrawn","type":"event"},{"inputs":[],"name":"TOKEN_MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accessControls","outputs":[{"internalType":"contract MISOAccessControls","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_template","type":"address"}],"name":"addTokenTemplate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_templateId","type":"uint256"},{"internalType":"address payable","name":"_integratorFeeAccount","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"createToken","outputs":[{"internalType":"address","name":"token","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"currentTemplateId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_templateId","type":"uint256"},{"internalType":"address payable","name":"_integratorFeeAccount","type":"address"}],"name":"deployToken","outputs":[{"internalType":"address","name":"token","type":"address"}],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_tokenTemplate","type":"address"}],"name":"getTemplateId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_templateId","type":"uint256"}],"name":"getTokenTemplate","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getTokens","outputs":[{"internalType":"address[]","name":"","type":"address[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"}],"name":"hasTokenMinterRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_accessControls","type":"address"}],"name":"initMISOTokenFactory","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"integratorFeePct","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"locked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"minimumFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"misoDiv","outputs":[{"internalType":"address payable","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numberOfTokens","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_templateId","type":"uint256"}],"name":"removeTokenTemplate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_templateType","type":"uint256"},{"internalType":"uint256","name":"_templateId","type":"uint256"}],"name":"setCurrentTemplateId","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable","name":"_divaddr","type":"address"}],"name":"setDividends","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"setIntegratorFeePct","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_locked","type":"bool"}],"name":"setLocked","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"setMinimumFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"tokenInfo","outputs":[{"internalType":"bool","name":"exists","type":"bool"},{"internalType":"uint256","name":"templateId","type":"uint256"},{"internalType":"uint256","name":"index","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"tokenTemplateId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"tokens","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

608060405234801561001057600080fd5b50611bdc806100206000396000f3fe6080604052600436106101665760003560e01c8063748365ef116100d1578063ad8ff6691161008a578063cf30901211610064578063cf30901214610567578063d335ebda1461057c578063f5dab711146105af578063f9f16ef21461060257610166565b8063ad8ff669146104f5578063b3c9315114610528578063c9907b081461055257610166565b8063748365ef146103605780637b20bccf14610375578063870837d7146103a85780639e5940cc1461042d5780639e9188ea1461045d578063aa6ca8081461049057610166565b8063361dbb4a11610123578063361dbb4a146102865780633f1f44b0146102cd57806343efca82146102f75780634520ca751461030c5780634f64b2be14610321578063512b336d1461034b57610166565b8063042ab9b31461016b5780630bf18f85146101b1578063182a7506146101dd5780631a7626e714610209578063211e28b6146102305780632ed4f5781461025c575b600080fd5b34801561017757600080fd5b506101956004803603602081101561018e57600080fd5b5035610617565b604080516001600160a01b039092168252519081900360200190f35b610195600480360360408110156101c757600080fd5b50803590602001356001600160a01b0316610632565b3480156101e957600080fd5b506102076004803603602081101561020057600080fd5b50356109da565b005b34801561021557600080fd5b5061021e610a91565b60408051918252519081900360200190f35b34801561023c57600080fd5b506102076004803603602081101561025357600080fd5b50351515610a97565b34801561026857600080fd5b5061021e6004803603602081101561027f57600080fd5b5035610b5c565b34801561029257600080fd5b506102b9600480360360208110156102a957600080fd5b50356001600160a01b0316610b6e565b604080519115158252519081900360200190f35b3480156102d957600080fd5b50610207600480360360208110156102f057600080fd5b5035610c14565b34801561030357600080fd5b5061021e610d0c565b34801561031857600080fd5b5061021e610d12565b34801561032d57600080fd5b506101956004803603602081101561034457600080fd5b5035610d18565b34801561035757600080fd5b5061021e610d3f565b34801561036c57600080fd5b50610195610d63565b34801561038157600080fd5b506102076004803603602081101561039857600080fd5b50356001600160a01b0316610d72565b610195600480360360608110156103be57600080fd5b8135916001600160a01b03602082013516918101906060810160408201356401000000008111156103ee57600080fd5b82018360208201111561040057600080fd5b8035906020019184600183028401116401000000008311171561042257600080fd5b50909250905061102c565b34801561043957600080fd5b506102076004803603604081101561045057600080fd5b50803590602001356111ce565b34801561046957600080fd5b506102076004803603602081101561048057600080fd5b50356001600160a01b031661141c565b34801561049c57600080fd5b506104a5611509565b60408051602080825283518183015283519192839290830191858101910280838360005b838110156104e15781810151838201526020016104c9565b505050509050019250505060405180910390f35b34801561050157600080fd5b506102076004803603602081101561051857600080fd5b50356001600160a01b031661156b565b34801561053457600080fd5b506102076004803603602081101561054b57600080fd5b50356115f2565b34801561055e57600080fd5b5061019561185b565b34801561057357600080fd5b506102b961186f565b34801561058857600080fd5b5061021e6004803603602081101561059f57600080fd5b50356001600160a01b0316611878565b3480156105bb57600080fd5b506105e2600480360360208110156105d257600080fd5b50356001600160a01b0316611893565b604080519315158452602084019290925282820152519081900360600190f35b34801561060e57600080fd5b5061021e6118b9565b6000908152600460205260409020546001600160a01b031690565b60095460009060ff161561077f576000546040805163c395fcb360e01b815233600482015290516001600160a01b039092169163c395fcb391602480820192602092909190829003018186803b15801561068b57600080fd5b505afa15801561069f573d6000803e3d6000fd5b505050506040513d60208110156106b557600080fd5b50518061073557506000546040805163099db01760e01b815233600482015290516001600160a01b039092169163099db01791602480820192602092909190829003018186803b15801561070857600080fd5b505afa15801561071c573d6000803e3d6000fd5b505050506040513d602081101561073257600080fd5b50515b80610744575061074433610b6e565b61077f5760405162461bcd60e51b8152600401808060200182810382526031815260200180611b766031913960400191505060405180910390fd5b6007543410156107c05760405162461bcd60e51b815260040180806020018281038252602f815260200180611aaa602f913960400191505060405180910390fd5b6000838152600460205260409020546001600160a01b03166108135760405162461bcd60e51b8152600401808060200182810382526027815260200180611a5d6027913960400191505060405180910390fd5b6000346001600160a01b0384161580159061084157506009546001600160a01b038581166101009092041614155b1561085c576103e860085482028161085557fe5b0491508190035b60008581526004602052604090205461087d906001600160a01b03166118bf565b60408051606081018252600180825260208083018a8152600280548587019081526001600160a01b0388811660008181528787528981209851895460ff191690151517895594518888015591519683019690965581549485019091557f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace90930180546001600160a01b031916841790558a8152600482528490205484519316835292519396509233927fb5a149b73151b44553ff737ca050c61de65038e2ae67ec044215d3261cc6fa00928290030190a38015610994576009546040516101009091046001600160a01b0316906108fc8315029083906000818181858888f19350505050158015610992573d6000803e3d6000fd5b505b81156109d2576040516001600160a01b0385169083156108fc029084906000818181858888f193505050501580156109d0573d6000803e3d6000fd5b505b505092915050565b6000546040805163c395fcb360e01b815233600482015290516001600160a01b039092169163c395fcb391602480820192602092909190829003018186803b158015610a2557600080fd5b505afa158015610a39573d6000803e3d6000fd5b505050506040513d6020811015610a4f57600080fd5b5051610a8c5760405162461bcd60e51b8152600401808060200182810382526029815260200180611a346029913960400191505060405180910390fd5b600755565b60075481565b6000546040805163c395fcb360e01b815233600482015290516001600160a01b039092169163c395fcb391602480820192602092909190829003018186803b158015610ae257600080fd5b505afa158015610af6573d6000803e3d6000fd5b505050506040513d6020811015610b0c57600080fd5b5051610b495760405162461bcd60e51b8152600401808060200182810382526026815260200180611a846026913960400191505060405180910390fd5b6009805460ff1916911515919091179055565b60066020526000908152604090205481565b6000805460408051632474521560e21b81527fb3bb6029312d1001076133d40b75b7eca92ba54e4963b3ce24e1486a3d5a038b60048201526001600160a01b038581166024830152915191909216916391d14854916044808301926020929190829003018186803b158015610be257600080fd5b505afa158015610bf6573d6000803e3d6000fd5b505050506040513d6020811015610c0c57600080fd5b505192915050565b6000546040805163c395fcb360e01b815233600482015290516001600160a01b039092169163c395fcb391602480820192602092909190829003018186803b158015610c5f57600080fd5b505afa158015610c73573d6000803e3d6000fd5b505050506040513d6020811015610c8957600080fd5b5051610cc65760405162461bcd60e51b8152600401808060200182810382526029815260200180611a346029913960400191505060405180910390fd5b6103e8811115610d075760405162461bcd60e51b8152600401808060200182810382526029815260200180611b4d6029913960400191505060405180910390fd5b600855565b60035481565b60085481565b60028181548110610d2557fe5b6000918252602090912001546001600160a01b0316905081565b7fb3bb6029312d1001076133d40b75b7eca92ba54e4963b3ce24e1486a3d5a038b81565b6000546001600160a01b031681565b6000546040805163c395fcb360e01b815233600482015290516001600160a01b039092169163c395fcb391602480820192602092909190829003018186803b158015610dbd57600080fd5b505afa158015610dd1573d6000803e3d6000fd5b505050506040513d6020811015610de757600080fd5b505180610e67575060005460408051637e271f0560e11b815233600482015290516001600160a01b039092169163fc4e3e0a91602480820192602092909190829003018186803b158015610e3a57600080fd5b505afa158015610e4e573d6000803e3d6000fd5b505050506040513d6020811015610e6457600080fd5b50515b610ea25760405162461bcd60e51b8152600401808060200182810382526029815260200180611a346029913960400191505060405180910390fd5b6000816001600160a01b0316630814d3dd6040518163ffffffff1660e01b815260040160206040518083038186803b158015610edd57600080fd5b505afa158015610ef1573d6000803e3d6000fd5b505050506040513d6020811015610f0757600080fd5b5051905080610f475760405162461bcd60e51b815260040180806020018281038252602a815260200180611ad9602a913960400191505060405180910390fd5b6001600160a01b03821660009081526005602052604090205415610f9c5760405162461bcd60e51b8152600401808060200182810382526021815260200180611b036021913960400191505060405180910390fd5b60038054600101808255600090815260046020908152604080832080546001600160a01b0319166001600160a01b038816908117909155935484845260058352818420819055858452600683529281902083905580519384529083019190915280517f95595b6ea45697235ed18194d52346c97420d7edf2aa7fc902cb37e25f81962e9281900390910190a15050565b60006110388585610632565b9050806001600160a01b03167fb16d4375f452e77e87811cc8f3549effd92a08a60c760f79ba9e2de067c95e3086858560405180848152602001806020018281038252848482818152602001925080828437600083820152604051601f909101601f1916909201829003965090945050505050a260405162c1639960e71b8152602060048201908152602482018490526001600160a01b038316916360b1cc809186918691908190604401848480828437600081840152601f19601f8201169050808301925050509350505050600060405180830381600087803b15801561111f57600080fd5b505af1158015611133573d6000803e3d6000fd5b505050506000816001600160a01b03166370a08231306040518263ffffffff1660e01b815260040180826001600160a01b0316815260200191505060206040518083038186803b15801561118657600080fd5b505afa15801561119a573d6000803e3d6000fd5b505050506040513d60208110156111b057600080fd5b5051905080156111c5576111c5823383611911565b50949350505050565b6000546040805163c395fcb360e01b815233600482015290516001600160a01b039092169163c395fcb391602480820192602092909190829003018186803b15801561121957600080fd5b505afa15801561122d573d6000803e3d6000fd5b505050506040513d602081101561124357600080fd5b5051806112c3575060005460408051637e271f0560e11b815233600482015290516001600160a01b039092169163fc4e3e0a91602480820192602092909190829003018186803b15801561129657600080fd5b505afa1580156112aa573d6000803e3d6000fd5b505050506040513d60208110156112c057600080fd5b50515b6112fe5760405162461bcd60e51b8152600401808060200182810382526026815260200180611a846026913960400191505060405180910390fd5b6000818152600460205260409020546001600160a01b03166113515760405162461bcd60e51b8152600401808060200182810382526027815260200180611a5d6027913960400191505060405180910390fd5b600081815260046020818152604092839020548351630814d3dd60e01b8152935186946001600160a01b0390921693630814d3dd938382019390929190829003018186803b1580156113a257600080fd5b505afa1580156113b6573d6000803e3d6000fd5b505050506040513d60208110156113cc57600080fd5b50511461140a5760405162461bcd60e51b8152600401808060200182810382526029815260200180611b246029913960400191505060405180910390fd5b60009182526006602052604090912055565b6000546040805163c395fcb360e01b815233600482015290516001600160a01b039092169163c395fcb391602480820192602092909190829003018186803b15801561146757600080fd5b505afa15801561147b573d6000803e3d6000fd5b505050506040513d602081101561149157600080fd5b50516114ce5760405162461bcd60e51b8152600401808060200182810382526029815260200180611a346029913960400191505060405180910390fd5b6001600160a01b0381166114e157600080fd5b600980546001600160a01b0390921661010002610100600160a81b0319909216919091179055565b6060600280548060200260200160405190810160405280929190818152602001828054801561156157602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611543575b5050505050905090565b600054600160a01b900460ff161561158257600080fd5b600080546009805460ff191660011790556001600160a01b0383166001600160a01b031960ff60a01b19909216600160a01b17919091161790556040805133815290517f7baa9936e30f7ec15b3fe4357a0256402fa7ea6780f82e39784f1f27382bd15e9181900360200190a150565b6000546040805163c395fcb360e01b815233600482015290516001600160a01b039092169163c395fcb391602480820192602092909190829003018186803b15801561163d57600080fd5b505afa158015611651573d6000803e3d6000fd5b505050506040513d602081101561166757600080fd5b5051806116e7575060005460408051637e271f0560e11b815233600482015290516001600160a01b039092169163fc4e3e0a91602480820192602092909190829003018186803b1580156116ba57600080fd5b505afa1580156116ce573d6000803e3d6000fd5b505050506040513d60208110156116e457600080fd5b50515b6117225760405162461bcd60e51b8152600401808060200182810382526029815260200180611a346029913960400191505060405180910390fd5b6000818152600460205260409020546001600160a01b031661174357600080fd5b6000818152600460208181526040808420548151630814d3dd60e01b815291516001600160a01b0390911694938593630814d3dd9380830193919290829003018186803b15801561179357600080fd5b505afa1580156117a7573d6000803e3d6000fd5b505050506040513d60208110156117bd57600080fd5b50516000818152600660205260409020549091508314156117e8576000818152600660205260408120555b600083815260046020908152604080832080546001600160a01b03191690556001600160a01b0385168084526005835281842093909355805192835290820185905280517f11eaf16c318162956db9f4f1fc5f7696fabbbf409382c1ddcebfe74b20a92a839281900390910190a1505050565b60095461010090046001600160a01b031681565b60095460ff1681565b6001600160a01b031660009081526005602052604090205490565b600160208190526000918252604090912080549181015460029091015460ff9092169183565b60025490565b6000808260601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f0949350505050565b604080516001600160a01b038481166024830152604480830185905283518084039091018152606490920183526020820180516001600160e01b031663a9059cbb60e01b178152925182516000946060949389169392918291908083835b6020831061198e5780518252601f19909201916020918201910161196f565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d80600081146119f0576040519150601f19603f3d011682016040523d82523d6000602084013e6119f5565b606091505b5091509150818015611a23575080511580611a235750808060200190516020811015611a2057600080fd5b50515b611a2c57600080fd5b505050505056fe4d49534f546f6b656e466163746f72793a2053656e646572206d757374206265206f70657261746f724d49534f546f6b656e466163746f72793a20696e636f7272656374205f74656d706c61746549644d49534f546f6b656e466163746f72793a2053656e646572206d7573742062652061646d696e4d49534f546f6b656e466163746f72793a204661696c656420746f207472616e73666572206d696e696d756d4665654d49534f546f6b656e466163746f72793a20496e636f72726563742074656d706c61746520636f6465204d49534f546f6b656e466163746f72793a2054656d706c617465206578697374734d49534f546f6b656e466163746f72793a20696e636f7272656374205f74656d706c617465547970654d49534f546f6b656e466163746f72793a2052616e67652069732066726f6d203020746f20313030304d49534f546f6b656e466163746f72793a2053656e646572206d757374206265206d696e746572206966206c6f636b6564a2646970667358221220c53f08d6f77688bfcb7442a3a58ae9117044e936a4b6236846f7738a898e239f64736f6c634300060c0033

Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.