File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -66,6 +66,12 @@ export class AccountOpener {
6666 */
6767 public async openCreditAccounts ( targets : TargetAccount [ ] ) : Promise < void > {
6868 const borrower = await this . #prepareBorrower( targets ) ;
69+
70+ for ( const c of targets ) {
71+ const cm = this . sdk . marketRegister . findCreditManager ( c . creditManager ) ;
72+ await this . #approve( c . collateral , cm ) ;
73+ }
74+
6975 for ( const target of targets ) {
7076 try {
7177 await this . #openAccount( target ) ;
@@ -203,10 +209,6 @@ export class AccountOpener {
203209 if ( isAddress ( degenNFT ) && degenNFT !== ADDRESS_0X0 ) {
204210 degenNFTS [ degenNFT ] = ( degenNFTS [ degenNFT ] ?? 0 ) + 1 ;
205211 }
206-
207- for ( const t of Object . keys ( cm . collateralTokens ) ) {
208- await this . #approve( t as Address , cm ) ;
209- }
210212 }
211213 claimUSD = ( claimUSD * 11n ) / 10n ; // 10% more to be safe
212214
You can’t perform that action at this time.
0 commit comments