# OCT\_YDL.sol

## Introduction

This contract converts assets and forwards them to the YDL.

{% embed url="<https://www.figma.com/board/qjuQ0uGQl9QD7KeBwyf73d/Zivoe-Visualization?node-id=207-552&t=8fVk5MSL8V4T10SB-4>" %}

#### State Variables

<table><thead><tr><th width="144.33333333333331">Type</th><th width="150">Name</th><th>Description</th></tr></thead><tbody><tr><td>address</td><td>GBL</td><td>The ZivoeGlobals contract.</td></tr></tbody></table>

## **Sections**

[#read-functions](#read-functions "mention")

* [#canpush](#canpush "mention") - Permission for owner to call `pushToLocker()`. See [zivoelocker.sol](https://docs.zivoe.com/developer-docs/core-contracts/zivoelocker.sol "mention")
* [#canpushmulti](#canpushmulti "mention") - Permission for owner to call `pushToLockerMulti()`. See [zivoelocker.sol](https://docs.zivoe.com/developer-docs/core-contracts/zivoelocker.sol "mention")
* [#canpull](#canpull "mention") - Permission for owner to call `pullFromLocker()`. See [zivoelocker.sol](https://docs.zivoe.com/developer-docs/core-contracts/zivoelocker.sol "mention")
* [#canpullmulti](#canpullmulti "mention") - Permission for owner to call `pullFromLockerMulti()`. See [zivoelocker.sol](https://docs.zivoe.com/developer-docs/core-contracts/zivoelocker.sol "mention")
* [#canpullpartial](#canpullpartial "mention") - Permission for owner to call `pullFromLockerPartial()`. See [zivoelocker.sol](https://docs.zivoe.com/developer-docs/core-contracts/zivoelocker.sol "mention")
* [#canpullpartialmulti](#canpullpartialmulti "mention") - Permission for owner to call `pullFromLockerMultiPartial()`. See [zivoelocker.sol](https://docs.zivoe.com/developer-docs/core-contracts/zivoelocker.sol "mention")

[#write-functions](#write-functions "mention")

* [#convertandforward](#convertandforward "mention") - Converts an asset to YDL.distributedAsset() and forwards it.

[#events](#events "mention")

* [#assetconvertedforwarded](#assetconvertedforwarded "mention")

## Read Functions

#### `canPush()`

Permission for owner to call `pushToLocker()`. See [zivoelocker.sol](https://docs.zivoe.com/developer-docs/core-contracts/zivoelocker.sol "mention")

```solidity
 function canPush() public override pure returns (bool) { return true; }
```

#### `canPushMulti()`

Permission for owner to call `pushToLockerMulti()`. See [zivoelocker.sol](https://docs.zivoe.com/developer-docs/core-contracts/zivoelocker.sol "mention")

```solidity
 function canPushMulti() public override pure returns (bool) { return true; }
```

#### `canPull()`

Permission for owner to call `pullFromLocker()`. See [zivoelocker.sol](https://docs.zivoe.com/developer-docs/core-contracts/zivoelocker.sol "mention")

```solidity
function canPull() public override pure returns (bool) { return true; }
```

#### `canPullMulti()`

Permission for owner to call `pullFromLockerMulti()`. See [zivoelocker.sol](https://docs.zivoe.com/developer-docs/core-contracts/zivoelocker.sol "mention")

```solidity
 function canPullMulti() public override pure returns (bool) { return true; }
```

#### `canPullPartial()`

Permission for owner to call `pullFromLockerPartial()`. See [zivoelocker.sol](https://docs.zivoe.com/developer-docs/core-contracts/zivoelocker.sol "mention")

```solidity
function canPullPartial() public override pure returns (bool) { return true; }
```

#### `canPullPartialMulti()`

Permission for owner to call `pullFromLockerMultiPartial()`. See [zivoelocker.sol](https://docs.zivoe.com/developer-docs/core-contracts/zivoelocker.sol "mention")

```solidity
 function canPullPartialMulti() public override pure returns (bool) { return true; }
```

## Write Functions

#### **`convertAndForward()`**

Converts an asset to YDL.distributedAsset() and forwards it.

```solidity
function convertAndForward(address asset, bytes calldata data) external; 
```

<table><thead><tr><th width="156.33333333333331">Type</th><th width="160">Name</th><th>Description</th></tr></thead><tbody><tr><td>address</td><td>asset</td><td>The asset to convert.</td></tr><tr><td>bytes</td><td>data</td><td>The payload containing conversion data, consumed by 1INCH_V5.</td></tr></tbody></table>

Emits the [#assetconvertedforwarded](#assetconvertedforwarded "mention") event

## Events

#### **`AssetConvertedForwarded()`**

Emitted during [#convertandforward](#convertandforward "mention")

<pre class="language-solidity"><code class="lang-solidity">event AssetConvertedForwarded(
<strong>    address indexed asset, 
</strong>    address indexed distributedAsset, 
    uint256 amountFrom, 
    uint256 amountTo
);
</code></pre>

<table><thead><tr><th width="127.33333333333331">Type</th><th width="98">Indexed</th><th width="163">Name</th><th>Description</th></tr></thead><tbody><tr><td>address</td><td>True</td><td>asset</td><td>The "asset" being converted.</td></tr><tr><td>address</td><td>True</td><td>distributedAsset</td><td>The ERC20 that we are converting "asset" to, based on YDL.distributedAsset().</td></tr><tr><td>uint256</td><td>False</td><td>amountFrom</td><td>The amount being converted.</td></tr><tr><td>uint256</td><td>False</td><td>amountTo</td><td>The amount of distibutedAsset received.</td></tr></tbody></table>
