@@ -607,7 +607,9 @@ export const encodeOperation = (
607607 actions . push ( {
608608 type : "morphoSupply" ,
609609 args : [
610- market . params ,
610+ // Avoid passing the reference of a revokable proxy that would fail
611+ // accessing its underlying value after revocation.
612+ getCurrent ( market . params ) ,
611613 assets ,
612614 shares ,
613615 maxSharePrice ,
@@ -644,7 +646,9 @@ export const encodeOperation = (
644646 actions . push ( {
645647 type : "morphoWithdraw" ,
646648 args : [
647- market . params ,
649+ // Avoid passing the reference of a revokable proxy that would fail
650+ // accessing its underlying value after revocation.
651+ getCurrent ( market . params ) ,
648652 assets ,
649653 shares ,
650654 minSharePrice ,
@@ -682,7 +686,9 @@ export const encodeOperation = (
682686 actions . push ( {
683687 type : "morphoBorrow" ,
684688 args : [
685- market . params ,
689+ // Avoid passing the reference of a revokable proxy that would fail
690+ // accessing its underlying value after revocation.
691+ getCurrent ( market . params ) ,
686692 assets ,
687693 shares ,
688694 minSharePrice ,
@@ -723,7 +729,9 @@ export const encodeOperation = (
723729 actions . push ( {
724730 type : "morphoRepay" ,
725731 args : [
726- market . params ,
732+ // Avoid passing the reference of a revokable proxy that would fail
733+ // accessing its underlying value after revocation.
734+ getCurrent ( market . params ) ,
727735 assets ,
728736 shares ,
729737 maxSharePrice ,
@@ -761,7 +769,9 @@ export const encodeOperation = (
761769 actions . push ( {
762770 type : "morphoSupplyCollateral" ,
763771 args : [
764- params ,
772+ // Avoid passing the reference of a revokable proxy that would fail
773+ // accessing its underlying value after revocation.
774+ getCurrent ( params ) ,
765775 assets ,
766776 onBehalf ,
767777 callbackBundle ?. actions ?? [ ] ,
@@ -778,7 +788,14 @@ export const encodeOperation = (
778788
779789 actions . push ( {
780790 type : "morphoWithdrawCollateral" ,
781- args : [ params , assets , receiver , operation . skipRevert ] ,
791+ args : [
792+ // Avoid passing the reference of a revokable proxy that would fail
793+ // accessing its underlying value after revocation.
794+ getCurrent ( params ) ,
795+ assets ,
796+ receiver ,
797+ operation . skipRevert ,
798+ ] ,
782799 } ) ;
783800
784801 break ;
@@ -906,10 +923,14 @@ export const encodeOperation = (
906923 operation . address ,
907924 fee ,
908925 withdrawals . map ( ( { id, assets } ) => ( {
909- marketParams : dataBefore . getMarket ( id ) . params ,
926+ // Avoid passing the reference of a revokable proxy that would fail
927+ // accessing its underlying value after revocation.
928+ marketParams : getCurrent ( dataBefore . getMarket ( id ) . params ) ,
910929 amount : assets ,
911930 } ) ) ,
912- dataBefore . getMarket ( supplyMarketId ) . params ,
931+ // Avoid passing the reference of a revokable proxy that would fail
932+ // accessing its underlying value after revocation.
933+ getCurrent ( dataBefore . getMarket ( supplyMarketId ) . params ) ,
913934 operation . skipRevert ,
914935 ] ,
915936 } ) ;
0 commit comments