Skip to content

Commit b576d3e

Browse files
authored
Merge pull request #355 from morpho-org/fix/wrapping
fix(wrapping): fix wrapping owner
2 parents 1e47524 + 4d4915e commit b576d3e

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

packages/bundler-sdk-viem/src/operations.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@ export const populateSubBundle = (
246246

247247
// Redirect MetaMorpho operation owner.
248248
switch (draft.type) {
249+
case "Erc20_Wrap":
250+
if (isErc20Wrapper) break;
249251
case "MetaMorpho_Deposit":
250252
case "MetaMorpho_Withdraw":
251253
// Only if sender is owner otherwise the owner would be lost.

packages/bundler-sdk-viem/test/populateBundle.test.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4807,10 +4807,20 @@ describe("populateBundle", () => {
48074807
address: wNative,
48084808
args: {
48094809
amount: assets,
4810-
owner: client.account.address,
4810+
owner: generalAdapter1,
48114811
slippage: DEFAULT_SLIPPAGE_TOLERANCE,
48124812
},
48134813
},
4814+
{
4815+
address: wNative,
4816+
args: {
4817+
amount: maxUint256,
4818+
from: generalAdapter1,
4819+
to: client.account.address,
4820+
},
4821+
sender: generalAdapter1,
4822+
type: "Erc20_Transfer",
4823+
},
48144824
]);
48154825

48164826
expect(await client.balanceOf()).toBe(initialBalance - assets);

0 commit comments

Comments
 (0)