> For the complete documentation index, see [llms.txt](https://doken.gitbook.io/doken-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doken.gitbook.io/doken-documentation/dividend-hub/dokenhubproxy-deployment.md).

# DoKENHubProxy Deployment

Lets say you already have deployed token which implement like for example roger wu dividend interface or something else, and want to register into DoKEN Dividend Hub.

Technically, you have to implements those function mentioned on the [Dividend Hub Installation](/doken-documentation/dividend-hub/dividend-hub-installation.md) page to make your token compatible with our Dividend Hub.

But changing your token smart contract code would be impossible, so what is your option ?&#x20;

Fortunately, we can do some "little-trick" to make your contract compatible to our Dividend Hub, by creating new contract that will have a role as a proxy or middle man, which later helps our Dividend Hub to communicate with your smart contract.

Feel free to deploy the smart contract  boiler plate below, and dont forget to changes to make it follow your real token project.

Once you get the deployed DoKENHubProxy address, use that address to register on our DividendHub Registration page, and turn on the "This is DoKENHub Proxy Address"

```
// SPDX-License-Identifier: MIT License

pragma solidity ^0.8.6;


/**
 * MainTokenInterface is an interface which represent functions on your
 * main token contract that is able to returns the value which is required by DoKENDividendHub
 **/
 
interface MainTokenInterface {
    // please adjust the function names below to follow with your real project function names,
    // this is just an example
    function mainTokenFunctionWhichReturnRewardAddress() external view returns(address);
    function mainTokenFunctionWhichReturnRewardOnPool() external view returns(uint256);
    function mainTokenFunctionWhichReturnTokenFees() external view returns(uint256,uint256,uint256,uint256,uint256,uint256);
    function mainTokenFunctionWhichReturnGetTotalDividendsDistributed() external view returns(uint256);
    function mainTokenFunctionWhichReturnGetAccount(address account) external view returns(address,
          int256,
          int256,
          uint256,
          uint256,
          uint256,
          uint256,
          uint256,
          uint256
          );
    function mainTokenFunctionWhichProcessAccount(address payable account, bool automatic) external;
    function mainTokenFunctionWhichGetNumberOfTokenHolders() external view returns(uint256);
}

contract DoKENHubProxy {
    
    address public realProjectAddress = 0xf9A2d40589271Be17612A3F57A9028A568f56e3d; // change it to your token / project address
    address public dividendTrackerAddress = someaddresshere;
    MainTokenInterface public realProject = MainTokenInterface(realProjectAddress);
    
    // this function is mandatory, 
    function DoKENGetMainAddress() external view returns(address){
        return realProjectAddress;
    }
    
    function DoKENDividendTrackerAddress() external view returns(address){
        return dividendTrackerAddress;
    }
    
    // You have to make a call to your main contract, which returns the value
    // that is required by DoKENDiviendHub Interface
    // pls adjust it to follow with your project contract
    
    function DoKENRewardAddress() external view returns (address) {
        return realProject.mainTokenFunctionWhichReturnRewardAddress(); // this is just an example
    }
    
    function DoKENRewardOnPool() external view returns (uint256) {
        return realProject.mainTokenFunctionWhichReturnRewardOnPool();
    }
    
    function DoKENTokenFees() external view 
    returns ( uint256,uint256,uint256,uint256,uint256,uint256)
      {
        return realProject.mainTokenFunctionWhichReturnTokenFees();
      }
    
    function DoKENRewardDistributed() external view returns (uint256) {
        return realProject.mainTokenFunctionWhichReturnGetTotalDividendsDistributed();
    }
    
    function DoKENGetAccountDividendsInfo(address account)
    public
    view
        returns (
          address,
          int256,
          int256,
          uint256,
          uint256,
          uint256,
          uint256,
          uint256,
          uint256
        )
      {
         return realProject.mainTokenFunctionWhichReturnGetAccount(account);
      }
      
   function DoKENRewardPaid(address holder) external view returns (uint256) {
       (, , , , uint256 paidAmount, , , , ) = DoKENGetAccountDividendsInfo(holder);
       return paidAmount;
   }
   
    
    function DoKENRewardUnPaid(address holder) external view returns (uint256) {
        (, , , uint256 unpaidAmount, , , , , ) = DoKENGetAccountDividendsInfo(
          holder
        );
       
        return unpaidAmount;
    }
    
    
    function DoKENNumberOfDividendTokenHolders() external view returns (uint256) {
        return realProject.mainTokenFunctionWhichGetNumberOfTokenHolders();
    }
    
    
}
```

{% hint style="warning" %}
Manual Claim can be worked if you have "claim" function without any parameters on your main contract if you are using DoKENHubProxy Implementation
{% endhint %}

Smart Contract above are boilerplate of DoKENHubProxy, if you like to see real example you can visit this url&#x20;

{% embed url="<https://bscscan.com/address/0x66b268b07524C5065807930B85b053fA1B016D76#code>" %}
DoKEN Hub using DoKENHubProxy
{% endembed %}

{% embed url="<https://bscscan.com/address/0x820c54f2dFE0ADa455c9F75f62555c348f62fa14#code>" %}
MetaGrow Hub using DoKENHubProxy
{% endembed %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://doken.gitbook.io/doken-documentation/dividend-hub/dokenhubproxy-deployment.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
