> For the complete documentation index, see [llms.txt](https://otherworld-1.gitbook.io/protocol-1/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://otherworld-1.gitbook.io/protocol-1/smart-contracts/oklay-erc-20-contract.md).

# oKLAY(ERC-20) Contract

## Address

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

## 개요

> **The oKLAY contract defines FT with a value that corresponds 1:1 to KLAY.**

* Defines the 'name'.
* Define the 'symbol'.
* Issues 'FT'.
  * Defines the token quantity.
  * The token balance of the deposit account will increase by the amount of KLAY deposited in the oKLAY contract.
  * oKLAY can be withdrawn as KLAY.
  * The total capacity of oKLAY is equal to the KLAY balance deposited in the oKLAY contract.

## 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>Name</td><td><span data-option="5a93deb4e03e4bb6b2cad62cef005788">String</span></td></tr><tr><td>Symbol</td><td><span data-option="5a93deb4e03e4bb6b2cad62cef005788">String</span></td></tr></tbody></table>

### FT

<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>Owner</td><td><span data-option="c1cc68a96f1640d0b3ee6c54288abf06">Address</span></td></tr><tr><td>Balance</td><td><span data-option="f59a4491161a4b9dbe758183bdcc8abe">Uint</span></td></tr></tbody></table>

## Event

### Transfer

<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>From</td><td><span data-option="c1cc68a96f1640d0b3ee6c54288abf06">Address</span></td></tr><tr><td>To</td><td><span data-option="c1cc68a96f1640d0b3ee6c54288abf06">Address</span></td></tr><tr><td>Value</td><td><span data-option="f59a4491161a4b9dbe758183bdcc8abe">Uint</span></td></tr></tbody></table>

### Approval

<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>Owner</td><td><span data-option="c1cc68a96f1640d0b3ee6c54288abf06">Address</span></td></tr><tr><td>Spender</td><td><span data-option="c1cc68a96f1640d0b3ee6c54288abf06">Address</span></td></tr><tr><td>Value</td><td><span data-option="f59a4491161a4b9dbe758183bdcc8abe">Uint</span></td></tr></tbody></table>

### Deposit

<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>From</td><td><span data-option="c1cc68a96f1640d0b3ee6c54288abf06">Address</span></td></tr><tr><td>Value</td><td><span data-option="f59a4491161a4b9dbe758183bdcc8abe">Uint</span></td></tr></tbody></table>

### Withdrawal

<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>To</td><td><span data-option="c1cc68a96f1640d0b3ee6c54288abf06">Address</span></td></tr><tr><td>Value</td><td><span data-option="f59a4491161a4b9dbe758183bdcc8abe">Uint</span></td></tr></tbody></table>

## Interface

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

```solidity
interface IOWOtherKlay {
    function deposit() external payable;

    function withdraw(uint256 amount) external;
}
```

{% endtab %}

{% tab title="IERC20Metadata" %}

```solidity
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}
```

{% endtab %}

{% tab title="IERC20" %}

```solidity
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}    /**interface IERC20Metadata is IERC20 {interface IERC20Metadata is IERC20 {
```

{% endtab %}

{% tab title="IERC165" %}

```solidity
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
```

{% endtab %}
{% endtabs %}
