// Contract: NFTInfo
// Target function: function setArtPath(uint _tokennumber,address _holder,uint _pathno) external
pragma solidity ^0.6.12;
/*
 _    _                                _   _____                                   _             
| |  | |                              | | /  __ \                                 (_)            
| |  | |_ __ __ _ _ __  _ __   ___  __| | | /  \/ ___  _ __ ___  _ __   __ _ _ __  _  ___  _ __  
| |/\| | '__/ _` | '_ \| '_ \ / _ \/ _` | | |    / _ \| '_ ` _ \| '_ \ / _` | '_ \| |/ _ \| '_ \ 
\  /\  / | | (_| | |_) | |_) |  __/ (_| | | \__/\ (_) | | | | | | |_) | (_| | | | | | (_) | | | |
 \/  \/|_|  \__,_| .__/| .__/ \___|\__,_|  \____/\___/|_| |_| |_| .__/ \__,_|_| |_|_|\___/|_| |_|
                 | |   | |                                      | |                              
                 |_|   |_|                                      |_|                              
______      _          _____             _                  _                                    
|  _  \    | |        /  __ \           | |                | |                                   
| | | |__ _| |_ __ _  | /  \/ ___  _ __ | |_ _ __ __ _  ___| |_                                  
| | | / _` | __/ _` | | |    / _ \| '_ \| __| '__/ _` |/ __| __|                                 
| |/ / (_| | || (_| | | \__/\ (_) | | | | |_| | | (_| | (__| |_                                  
|___/ \__,_|\__\__,_|  \____/\___/|_| |_|\__|_|  \__,_|\___|\__|                                 
                                                                                                 
                                                                                               

-NFT data store to hold the following
- Wrapped Status
- Blocked NFT's
- Is Holder?
- Status of wrapped (fees)
- number of holders (For future use)
- Array for address storage for royalty cleanup
*/

//Interface to NFT contract
interface wrappedcompanion{
    ////Interface to RCVR
  function balanceOf(address owner) external view returns (uint256);
  function tokenURI(uint256 tokenId ) external view returns (string memory);
  function getArtApproval(uint _tokennumber,address _wallet)external view returns(bool);
  function ownerOf(uint256 tokenId) external view returns (address);
  function setStringArtPaths(uint _pathno,string memory _path,uint _tokenid,address _holder) external;

}
interface ogcompanion{
    ////Interface to RCVR
  function ownerOf(uint256 tokenId) external view returns (address);

}

contract NFTInfo{
    //Arrays///
    uint[] private blockednfts; //Array to handle a blocked nfts
    
    //Std Variables///
    address public wtcaddress = 0x16e2220Bba4a2c5C71f628f4DB2D5D1e0D6ad6e0;
    address public companion = 0x89af532726f48b7E77aE60705E166252e9Dcde15;
    address public Owner;
    address public manager; //Able to modify addresses at a lower level
    address public royaltywallet; //Wallet for royalties
    address public upgradecontract; //User management of art
    uint private numwraps;
    uint public numholders;
    uint public numblocked;
    ///////Important Mappings///////
    mapping(address => bool) internal wrapped; //Whether a holder has wrapped
    mapping(address => bool) internal holder; //Whether they are a holder
    mapping(address => uint) internal feespaid; //Status of users fees -> 0 -> Not paid for wrap 1-> Paid once 0.01ETH 2-> Paid up to limit of 0.02ETH
    mapping(uint => uint) internal artenabled; //Dynamic mapping of ar enabled/disabled
    mapping(address => string) internal artpath; //Dynamic mapping of art
    mapping(uint => bool) internal blocked; //blocking due to mapping
    mapping(address=> bool) internal blockedaddresses; //Additional addresses to blacklist
    ///////Array for holders////////
    address[] internal holderaddresses; //array to store the holders
    ////////////////////////////////
    
    modifier onlyOwner() {
        require(msg.sender == Owner);
        _;
    }
    
    constructor () public {
      Owner = msg.sender; //Owner of Contract
      manager = msg.sender; //Owner as default      
    }
    ///Update NB address if required
    function configNBAddresses(uint option,address _address) external onlyOwner{
        if (option==1)
        {
        wtcaddress = _address;
        }
        if (option==2)
        {
        royaltywallet = _address;
        }
        if (option==3)
        {
        companion = _address;
        }
        if (option==4)
        {
        upgradecontract = _address;
        }
            }
    //Setup ArtWork Manager address///
    function setManager(address _manager) external onlyOwner
    {
        manager = _manager;
    }
    //Obtain Art status for user
    function getArtStatus(uint _tokenid)public view returns(uint)
    {
        uint temp;
        temp = artenabled[_tokenid];
        return temp;
    }
    
    function setARTinWrapper(uint path,string memory _path,uint _tokenid,address _holder) public
    {

        require(msg.sender==Owner || msg.sender==upgradecontract,"Not Auth(U)");
      wrappedcompanion(wtcaddress).setStringArtPaths(path,_path,_tokenid,_holder);

    }