> For the complete documentation index, see [llms.txt](https://docs.shadow.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shadow.xyz/modify-contracts/how-tos/interdependent-shadow-contracts.md).

# Interdependent shadow contracts

{% hint style="info" %}
You can make interdependent shadow contract changes across multiple contracts by editing and deploying each contract separately.
{% endhint %}

In this example, we’ll be making interdependent changes to Blur’s `Blend` and `BlurPool` contracts.

We’ll be making changes so that the `BlurPool` contract will emit a new shadow event `TransferForLien` every time some ETH in the pool gets transferred due to an action taken on a given lien (e.g. borrow, repay, refinance). The `TransferForLien` shadow event will include metadata about the lien.

## Step 1 – Edit the BlurPool contract

Open the example on the Shadow Playground: <https://app.shadow.xyz/demo?example=blur_interdependent_contracts>, which will open the playground editor at the `BlurPool` contract.

In `BlurPool.sol` on L115, we’ve introduced a new function called `transferFromForLien`:

```solidity
function transferFromForLien(address from, address to, uint256 amount, uint256 lienId, Lien calldata lien, string calldata annotation) external returns (bool) {
    bool result = transferFrom(from, to, amount);
    emit TransferForLien(from, to, amount, lienId, lien, annotation);
    return result;
}
```

You can see the schema of the `TransferForLien` event in the `IBlurPool.sol` file:

```solidity
event TransferForLien(
    address indexed from,
    address indexed to,
    uint256 amount,
    uint256 lienId,
    Lien lien,
    string annotation
);
```

## Step 2 – **Deploy the BlurPool changes to your fork (optional)**

If you want to apply these changes on your shadow fork, click the button on the top right corner that says “Apply to your shadow fork”. This will take you to the editor for your shadow fork, where you can deploy the changes by hitting “Compile > Deploy”.

## Step 3 – **Edit the Blend contract**

Go to the following URL to open the `Blend` contract in the Shadow Playground for this example.:

<https://app.shadow.xyz/demo/0xb258ca5559b11cd702f363796522b04d7722ea56?example=blur_interdependent_contracts>

In `Blend.sol`, you’ll see that we updated all `BlurPool.transferFrom()` call sites to call the new `transferFromForLien` function we added earlier.

## Step 4 – **Test run your changes**

Click “Compile” > “Test Run” in the top right corner, and paste in the following transaction hashes to see these shadow changes in action:

* Borrow: [0x1546c9e1c3957e8a590414b35197f2b60b28a892d88a01e11c408687f368ae3f](https://etherscan.io/tx/0x1546c9e1c3957e8a590414b35197f2b60b28a892d88a01e11c408687f368ae3f)
* Repay: [0x82dcc906fcd8722168d87f69db819c1a56bf4075f69d37c5a53e5982b2bed702](https://etherscan.io/tx/0x82dcc906fcd8722168d87f69db819c1a56bf4075f69d37c5a53e5982b2bed702)
* Refinance: [0x645263376345423920a1dac7d5ca745c397d1f70c11e31b812f965bd4960654c](https://etherscan.io/tx/0x645263376345423920a1dac7d5ca745c397d1f70c11e31b812f965bd4960654c)

You should see your custom `TransferForLien` event in the output for each transaction!

## Step 5 – Deploy the Blend changes to your fork (optional)

If you want to apply these changes on your shadow fork, click the button on the top right corner that says “Apply to your shadow fork”.

This will take you to the editor for your shadow fork, where you can deploy the changes by hitting “Compile > Deploy”.


---

# 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://docs.shadow.xyz/modify-contracts/how-tos/interdependent-shadow-contracts.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.
