# Proxy Contract

## Address

> Address : (not yet deployed)\
> on Klaytn Blockchain Main-net

## Summary

> Proxy contracts define contracts in Otherworld

* Defines the 'contract type' details.
  * Defines the type name.
  * A contract type can contain multiple contracts.
* Defines the 'contract' details.
  * Contracts are included in one contract type.
  * Defines the version.
  * Defines the contract address.

## Data

### Base

<table><thead><tr><th width="310.04311152764757">Name</th><th width="150">Type<select><option value="f59a4491161a4b9dbe758183bdcc8abe" label="Uint" color="blue"></option><option value="e60501f3a0c44f8b8e12409d4cb13cea" label="Boolean" color="blue"></option><option value="c1cc68a96f1640d0b3ee6c54288abf06" label="Address" color="blue"></option><option value="5a93deb4e03e4bb6b2cad62cef005788" label="String" color="blue"></option><option value="989f2aed8ec847658e1f3262650032fb" label="List (Uint)" color="blue"></option></select></th></tr></thead><tbody><tr><td>Created Timestamp</td><td><span data-option="f59a4491161a4b9dbe758183bdcc8abe">Uint</span></td></tr></tbody></table>

### Contract Type

<table><thead><tr><th width="319.3912577073985">Name</th><th width="150">Type<select><option value="f59a4491161a4b9dbe758183bdcc8abe" label="Uint" color="blue"></option><option value="e60501f3a0c44f8b8e12409d4cb13cea" label="Boolean" color="blue"></option><option value="c1cc68a96f1640d0b3ee6c54288abf06" label="Address" color="blue"></option><option value="5a93deb4e03e4bb6b2cad62cef005788" label="String" color="blue"></option><option value="b97b905bb0a844919c6c31611e10771d" label="List (Uint)" color="blue"></option></select></th></tr></thead><tbody><tr><td>ID</td><td><span data-option="f59a4491161a4b9dbe758183bdcc8abe">Uint</span></td></tr><tr><td>Name</td><td><span data-option="5a93deb4e03e4bb6b2cad62cef005788">String</span></td></tr></tbody></table>

### Contract

<table><thead><tr><th width="319.3912577073985">Name</th><th width="150">Type<select><option value="f59a4491161a4b9dbe758183bdcc8abe" label="Uint" color="blue"></option><option value="e60501f3a0c44f8b8e12409d4cb13cea" label="Boolean" color="blue"></option><option value="c1cc68a96f1640d0b3ee6c54288abf06" label="Address" color="blue"></option><option value="5a93deb4e03e4bb6b2cad62cef005788" label="String" color="blue"></option><option value="b97b905bb0a844919c6c31611e10771d" label="List (Uint)" color="blue"></option></select></th></tr></thead><tbody><tr><td>ID</td><td><span data-option="f59a4491161a4b9dbe758183bdcc8abe">Uint</span></td></tr><tr><td>Type ID</td><td><span data-option="f59a4491161a4b9dbe758183bdcc8abe">Uint</span></td></tr><tr><td>Version</td><td><span data-option="f59a4491161a4b9dbe758183bdcc8abe">Uint</span></td></tr><tr><td>Contract</td><td><span data-option="c1cc68a96f1640d0b3ee6c54288abf06">Address</span></td></tr><tr><td>Created Timestmap</td><td><span data-option="f59a4491161a4b9dbe758183bdcc8abe">Uint</span></td></tr></tbody></table>

## Event

### Contract Added

<table><thead><tr><th width="310.04311152764757">Name</th><th width="150">Type<select><option value="f59a4491161a4b9dbe758183bdcc8abe" label="Uint" color="blue"></option><option value="e60501f3a0c44f8b8e12409d4cb13cea" label="Boolean" color="blue"></option><option value="c1cc68a96f1640d0b3ee6c54288abf06" label="Address" color="blue"></option><option value="5a93deb4e03e4bb6b2cad62cef005788" label="String" color="blue"></option><option value="989f2aed8ec847658e1f3262650032fb" label="List (Uint)" color="blue"></option></select></th></tr></thead><tbody><tr><td>Type ID</td><td><span data-option="f59a4491161a4b9dbe758183bdcc8abe">Uint</span></td></tr><tr><td>Version</td><td><span data-option="f59a4491161a4b9dbe758183bdcc8abe">Uint</span></td></tr><tr><td>OWContract</td><td><span data-option="c1cc68a96f1640d0b3ee6c54288abf06">Address</span></td></tr></tbody></table>

## Interface

{% tabs %}
{% tab title="IOWProxy" %}

```solidity
interface IOWProxy {
    function addContractType(string calldata _type) external;

    function setContractType(uint256 _typeId, string calldata _type) external;

    function removeContractType(uint256 _typeId) external;

    function isExistContractTypeById(uint256 _typeId)
        external
        view
        returns (bool);

    function isExistContractType(string calldata _type)
        external
        view
        returns (bool);

    function getContractTypeId(string calldata _type)
        external
        view
        returns (uint256);

    function getContractTypeById(uint256 _typeId)
        external
        view
        returns (string memory);

    function getContractTypeIds() external view returns (uint256[] memory);

    function getContractTypes() external view returns (string[] memory);

    function addContract(uint256 _typeId, address _OWContract) external;

    function setContract(
        uint256 _typeId,
        uint256 _version,
        address _OWContract
    ) external;

    function removeLatestContract(uint256 _typeId) external;

    function getOWContractByTypeId(uint256 _typeId, uint256 _version)
        external
        view
        returns (address);

    function isValidVersion(uint256 _typeId, uint256 _version)
        external
        view
        returns (bool);

    function getLatestVersion(uint256 _typeId) external view returns (uint256);

    function getOWContractByType(string calldata _type, uint256 _version)
        external
        view
        returns (address);

    function getContractOfType(uint256 _typeId)
        external
        view
        returns (address[] memory);
}
```

{% endtab %}
{% endtabs %}
