You can make interdependent shadow contract changes across multiple contracts by editing and deploying each contract separately.
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.
In BlurPool.sol on L115, we’ve introduced a new function called transferFromForLien:
functiontransferFromForLien(addressfrom,addressto,uint256amount,uint256lienId,Liencalldatalien,stringcalldataannotation)externalreturns(bool){bool result =transferFrom(from, to, amount);emitTransferForLien(from, to, amount, lienId, lien, annotation);return result;}
You can see the schema of the TransferForLien event in the IBlurPool.sol file:
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.: