Class CrossCurrencyRenegotiation

Builds the fixed swap/repay/originate composition using deployed contracts.

Hierarchy

Constructors

Methods

  • Quotes deadline-bounded repayment, conversion, flash fees and borrower spending.

    IMPLEMENTATION NOTE: QuoterV2's non-view quoteExactOutput is simulated with eth_call; its first result is the new currency required for an exact old-currency output. Aave's fee is read from FLASHLOAN_PREMIUM_TOTAL. Reserve configuration flags and the legacy reserve tuple follow Aave V3's ReserveConfiguration and DataTypes libraries. https://docs.uniswap.org/contracts/v3/reference/periphery/lens/QuoterV2 https://aave.com/docs/aave-v3/guides/flash-loans

    Returns Promise<Readonly<{
        borrower: `0x${string}`;
        previousContract: `0x${string}`;
        replacementContract: `0x${string}`;
        purchaseBundler: `0x${string}`;
        positionMigrator: `0x${string}`;
        loanId: bigint;
        loanHash: `0x${string}`;
        executionHash: `0x${string}`;
        oldCurrency: `0x${string}`;
        newCurrency: `0x${string}`;
        repaymentAmount: bigint;
        oldCurrencyApprovalAmount: bigint;
        quotedInput: bigint;
        maximumInput: bigint;
        premiumBps: bigint;
        premium: bigint;
        maximumFlashRepayment: bigint;
        newPrincipal: bigint;
        originationFee: bigint;
        replacementProtocolFeeBps: bigint;
        netNewPrincipal: bigint;
        maximumTopUp: bigint;
        minimumSurplus: bigint;
        slippageBps: bigint;
        deadline: bigint;
        blockNumber: bigint;
    }>>

  • Checks the bound quote and capped approvals, then simulates and broadcasts atomically.

    Parameters

    • __namedParameters: CrossCurrencyRenegotiationInput & {
          quote: Readonly<{
              borrower: `0x${string}`;
              previousContract: `0x${string}`;
              replacementContract: `0x${string}`;
              purchaseBundler: `0x${string}`;
              positionMigrator: `0x${string}`;
              loanId: bigint;
              loanHash: `0x${string}`;
              executionHash: `0x${string}`;
              oldCurrency: `0x${string}`;
              newCurrency: `0x${string}`;
              repaymentAmount: bigint;
              oldCurrencyApprovalAmount: bigint;
              quotedInput: bigint;
              maximumInput: bigint;
              premiumBps: bigint;
              premium: bigint;
              maximumFlashRepayment: bigint;
              newPrincipal: bigint;
              originationFee: bigint;
              replacementProtocolFeeBps: bigint;
              netNewPrincipal: bigint;
              maximumTopUp: bigint;
              minimumSurplus: bigint;
              slippageBps: bigint;
              deadline: bigint;
              blockNumber: bigint;
          }>;
      }

    Returns Promise<{
        txHash: `0x${string}`;
        waitTxInBlock: (() => Promise<{
            previousLoanId: bigint;
            loanId: bigint;
            loan: {
                id: string;
                contractAddress: `0x${string}`;
                borrower: `0x${string}`;
                nftCollateralTokenId: bigint;
                nftCollateralAddress: `0x${string}`;
                principalAddress: `0x${string}`;
                principalAmount: bigint;
                startTime: bigint;
                duration: bigint;
                tranche: readonly {
                    loanId: bigint;
                    floor: bigint;
                    principalAmount: bigint;
                    lender: `0x${string}`;
                    accruedInterest: bigint;
                    startTime: bigint;
                    aprBps: bigint;
                }[];
                protocolFee: bigint;
            } | {
                id: string;
                contractAddress: `0x${string}`;
                borrower: `0x${string}`;
                nftCollateralTokenId: bigint;
                nftCollateralAddress: `0x${string}`;
                principalAddress: `0x${string}`;
                principalAmount: bigint;
                startTime: bigint;
                duration: bigint;
                tranche: readonly {
                    loanId: bigint;
                    floor: bigint;
                    principalAmount: bigint;
                    lender: `0x${string}`;
                    accruedInterest: bigint;
                    startTime: bigint;
                    aprBps: bigint;
                }[];
                protocolFee: bigint;
            } | {
                id: string;
                contractAddress: `0x${string}`;
                borrower: `0x${string}`;
                nftCollateralTokenId: bigint;
                nftCollateralAddress: `0x${string}`;
                principalAddress: `0x${string}`;
                principalAmount: bigint;
                startTime: bigint;
                duration: bigint;
                tranche: readonly {
                    loanId: bigint;
                    floor: bigint;
                    principalAmount: bigint;
                    lender: `0x${string}`;
                    accruedInterest: bigint;
                    startTime: bigint;
                    aprBps: bigint;
                }[];
                protocolFee: bigint;
                lenderRefinanceDisabled: boolean;
            };
        }>);
    }>

  • Parameters

    • data: `0x${string}`
    • Optional value: bigint

    Returns Promise<{
        txHash: `0x${string}`;
        waitTxInBlock: (() => Promise<TransactionReceipt>);
    }>

Properties

previousMsl: MslV6
msl: MslV6
abi: readonly [{
    type: "constructor";
    inputs: readonly [{
        name: "_name";
        type: "string";
        internalType: "string";
    }, {
        name: "addressManager";
        type: "address";
        internalType: "address";
    }, {
        name: "aaveAddressProvider";
        type: "address";
        internalType: "address";
    }];
    stateMutability: "nonpayable";
}, {
    type: "function";
    name: "DOMAIN_SEPARATOR";
    inputs: readonly [];
    outputs: readonly [{
        name: "";
        type: "bytes32";
        internalType: "bytes32";
    }];
    stateMutability: "view";
}, {
    type: "function";
    name: "INITIAL_DOMAIN_SEPARATOR";
    inputs: readonly [];
    outputs: readonly [{
        name: "";
        type: "bytes32";
        internalType: "bytes32";
    }];
    stateMutability: "view";
}, {
    type: "function";
    name: "VERSION";
    inputs: readonly [];
    outputs: readonly [{
        name: "";
        type: "bytes";
        internalType: "bytes";
    }];
    stateMutability: "view";
}, {
    type: "function";
    name: "executeOperation";
    inputs: readonly [{
        name: "assets";
        type: "address[]";
        internalType: "address[]";
    }, {
        name: "amounts";
        type: "uint256[]";
        internalType: "uint256[]";
    }, {
        name: "premiums";
        type: "uint256[]";
        internalType: "uint256[]";
    }, {
        name: "initiator";
        type: "address";
        internalType: "address";
    }, {
        name: "params";
        type: "bytes";
        internalType: "bytes";
    }];
    outputs: readonly [{
        name: "";
        type: "bool";
        internalType: "bool";
    }];
    stateMutability: "nonpayable";
}, {
    type: "function";
    name: "getNonce";
    inputs: readonly [{
        name: "account";
        type: "address";
        internalType: "address";
    }];
    outputs: readonly [{
        name: "nonce";
        type: "uint256";
        internalType: "uint256";
    }];
    stateMutability: "view";
}, {
    type: "function";
    name: "name";
    inputs: readonly [];
    outputs: readonly [{
        name: "";
        type: "string";
        internalType: "string";
    }];
    stateMutability: "view";
}, {
    type: "function";
    name: "smartMigrate";
    inputs: readonly [{
        name: "args";
        type: "tuple";
        internalType: "struct IPositionMigrator.SmartMigrationArgs";
        components: readonly [{
            name: "migrationArgs";
            type: "tuple";
            internalType: "struct IPositionMigrator.PositionMigrationArgs";
            components: readonly [{
                name: "close";
                type: "tuple";
                internalType: "struct IPositionMigrator.Position";
                components: readonly [{
                    name: "contractAddress";
                    type: "address";
                    internalType: "address";
                }, {
                    name: "callData";
                    type: "bytes";
                    internalType: "bytes";
                }, {
                    name: "value";
                    type: "uint256";
                    internalType: "uint256";
                }];
            }, {
                name: "open";
                type: "tuple";
                internalType: "struct IPositionMigrator.Position";
                components: readonly [{
                    name: "contractAddress";
                    type: "address";
                    internalType: "address";
                }, {
                    name: "callData";
                    type: "bytes";
                    internalType: "bytes";
                }, {
                    name: "value";
                    type: "uint256";
                    internalType: "uint256";
                }];
            }, {
                name: "borrowArgs";
                type: "tuple";
                internalType: "struct IPositionMigrator.AaveBorrowArgs";
                components: readonly [{
                    name: "pool";
                    type: "address";
                    internalType: "contract IPool";
                }, {
                    name: "recipient";
                    type: "address";
                    internalType: "address";
                }, {
                    name: "assets";
                    type: "address[]";
                    internalType: "address[]";
                }, {
                    name: "amounts";
                    type: "uint256[]";
                    internalType: "uint256[]";
                }];
            }, {
                name: "approvalContract";
                type: "address";
                internalType: "address";
            }, {
                name: "migrator";
                type: "address";
                internalType: "address";
            }, {
                name: "nonce";
                type: "uint256";
                internalType: "uint256";
            }];
        }, {
            name: "migratorSignature";
            type: "bytes";
            internalType: "bytes";
        }];
    }];
    outputs: readonly [];
    stateMutability: "payable";
}, {
    type: "event";
    name: "SmartMigration";
    inputs: readonly [{
        name: "closeContract";
        type: "address";
        indexed: false;
        internalType: "address";
    }, {
        name: "openContract";
        type: "address";
        indexed: false;
        internalType: "address";
    }];
    anonymous: false;
}, {
    type: "error";
    name: "ECDSAInvalidSignature";
    inputs: readonly [];
}, {
    type: "error";
    name: "ECDSAInvalidSignatureLength";
    inputs: readonly [{
        name: "length";
        type: "uint256";
        internalType: "uint256";
    }];
}, {
    type: "error";
    name: "ECDSAInvalidSignatureS";
    inputs: readonly [{
        name: "s";
        type: "bytes32";
        internalType: "bytes32";
    }];
}, {
    type: "error";
    name: "InvalidNonceError";
    inputs: readonly [];
}, {
    type: "error";
    name: "InvalidPoolFlowError";
    inputs: readonly [];
}, {
    type: "error";
    name: "InvalidSignatureError";
    inputs: readonly [];
}, {
    type: "error";
    name: "NotWhitelistedAddressError";
    inputs: readonly [];
}, {
    type: "error";
    name: "TargetContractCallFailed";
    inputs: readonly [];
}]
address: `0x${string}`
bcClient: {}

Type declaration

    wallet: {}

    Type declaration

      contract: GetContractReturnType<readonly [{
          type: "constructor";
          inputs: readonly [{
              name: "_name";
              type: "string";
              internalType: "string";
          }, {
              name: "addressManager";
              type: "address";
              internalType: "address";
          }, {
              name: "aaveAddressProvider";
              type: "address";
              internalType: "address";
          }];
          stateMutability: "nonpayable";
      }, {
          type: "function";
          name: "DOMAIN_SEPARATOR";
          inputs: readonly [];
          outputs: readonly [{
              name: "";
              type: "bytes32";
              internalType: "bytes32";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          name: "INITIAL_DOMAIN_SEPARATOR";
          inputs: readonly [];
          outputs: readonly [{
              name: "";
              type: "bytes32";
              internalType: "bytes32";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          name: "VERSION";
          inputs: readonly [];
          outputs: readonly [{
              name: "";
              type: "bytes";
              internalType: "bytes";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          name: "executeOperation";
          inputs: readonly [{
              name: "assets";
              type: "address[]";
              internalType: "address[]";
          }, {
              name: "amounts";
              type: "uint256[]";
              internalType: "uint256[]";
          }, {
              name: "premiums";
              type: "uint256[]";
              internalType: "uint256[]";
          }, {
              name: "initiator";
              type: "address";
              internalType: "address";
          }, {
              name: "params";
              type: "bytes";
              internalType: "bytes";
          }];
          outputs: readonly [{
              name: "";
              type: "bool";
              internalType: "bool";
          }];
          stateMutability: "nonpayable";
      }, {
          type: "function";
          name: "getNonce";
          inputs: readonly [{
              name: "account";
              type: "address";
              internalType: "address";
          }];
          outputs: readonly [{
              name: "nonce";
              type: "uint256";
              internalType: "uint256";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          name: "name";
          inputs: readonly [];
          outputs: readonly [{
              name: "";
              type: "string";
              internalType: "string";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          name: "smartMigrate";
          inputs: readonly [{
              name: "args";
              type: "tuple";
              internalType: "struct IPositionMigrator.SmartMigrationArgs";
              components: readonly [{
                  name: "migrationArgs";
                  type: "tuple";
                  internalType: "struct IPositionMigrator.PositionMigrationArgs";
                  components: readonly [{
                      name: "close";
                      type: "tuple";
                      internalType: "struct IPositionMigrator.Position";
                      components: readonly [{
                          name: "contractAddress";
                          type: "address";
                          internalType: "address";
                      }, {
                          name: "callData";
                          type: "bytes";
                          internalType: "bytes";
                      }, {
                          name: "value";
                          type: "uint256";
                          internalType: "uint256";
                      }];
                  }, {
                      name: "open";
                      type: "tuple";
                      internalType: "struct IPositionMigrator.Position";
                      components: readonly [{
                          name: "contractAddress";
                          type: "address";
                          internalType: "address";
                      }, {
                          name: "callData";
                          type: "bytes";
                          internalType: "bytes";
                      }, {
                          name: "value";
                          type: "uint256";
                          internalType: "uint256";
                      }];
                  }, {
                      name: "borrowArgs";
                      type: "tuple";
                      internalType: "struct IPositionMigrator.AaveBorrowArgs";
                      components: readonly [{
                          name: "pool";
                          type: "address";
                          internalType: "contract IPool";
                      }, {
                          name: "recipient";
                          type: "address";
                          internalType: "address";
                      }, {
                          name: "assets";
                          type: "address[]";
                          internalType: "address[]";
                      }, {
                          name: "amounts";
                          type: "uint256[]";
                          internalType: "uint256[]";
                      }];
                  }, {
                      name: "approvalContract";
                      type: "address";
                      internalType: "address";
                  }, {
                      name: "migrator";
                      type: "address";
                      internalType: "address";
                  }, {
                      name: "nonce";
                      type: "uint256";
                      internalType: "uint256";
                  }];
              }, {
                  name: "migratorSignature";
                  type: "bytes";
                  internalType: "bytes";
              }];
          }];
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "event";
          name: "SmartMigration";
          inputs: readonly [{
              name: "closeContract";
              type: "address";
              indexed: false;
              internalType: "address";
          }, {
              name: "openContract";
              type: "address";
              indexed: false;
              internalType: "address";
          }];
          anonymous: false;
      }, {
          type: "error";
          name: "ECDSAInvalidSignature";
          inputs: readonly [];
      }, {
          type: "error";
          name: "ECDSAInvalidSignatureLength";
          inputs: readonly [{
              name: "length";
              type: "uint256";
              internalType: "uint256";
          }];
      }, {
          type: "error";
          name: "ECDSAInvalidSignatureS";
          inputs: readonly [{
              name: "s";
              type: "bytes32";
              internalType: "bytes32";
          }];
      }, {
          type: "error";
          name: "InvalidNonceError";
          inputs: readonly [];
      }, {
          type: "error";
          name: "InvalidPoolFlowError";
          inputs: readonly [];
      }, {
          type: "error";
          name: "InvalidSignatureError";
          inputs: readonly [];
      }, {
          type: "error";
          name: "NotWhitelistedAddressError";
          inputs: readonly [];
      }, {
          type: "error";
          name: "TargetContractCallFailed";
          inputs: readonly [];
      }], {} | {}>
      safeContractWrite: {
          executeOperation: ((args, options?) => Promise<`0x${string}`>);
          smartMigrate: ((args, options?) => Promise<`0x${string}`>);
      }

      Type declaration

      • executeOperation: ((args, options?) => Promise<`0x${string}`>)
          • (args, options?): Promise<`0x${string}`>
          • Parameters

            • args: readonly [readonly `0x${string}`[], readonly bigint[], readonly bigint[], `0x${string}`, `0x${string}`]
            • Optional options: SafeContractWriteOptions

            Returns Promise<`0x${string}`>

      • smartMigrate: ((args, options?) => Promise<`0x${string}`>)
          • (args, options?): Promise<`0x${string}`>
          • Parameters

            • args: readonly [{
                  migrationArgs: { close: { contractAddress: `0x${string}`; callData: `0x${string}`; value: bigint; }; open: { contractAddress: `0x${string}`; callData: `0x${string}`; value: bigint; }; borrowArgs: { pool: `0x${string}`; recipient: `0x${string}`; assets: readonly `0x${string}`[]; amounts: readonly bigint[]; }; approvalContract: `0x${string}`; migrator: `0x${string}`; nonce: bigint; };
                  migratorSignature: `0x${string}`;
              }]
            • Optional options: SafeContractWriteOptions

            Returns Promise<`0x${string}`>

      parseEventLogs: (<TFunctionName>(eventName, logs) => ParseEventLogsReturnType<readonly [{
          type: "constructor";
          inputs: readonly [{
              name: "_name";
              type: "string";
              internalType: "string";
          }, {
              name: "addressManager";
              type: "address";
              internalType: "address";
          }, {
              name: "aaveAddressProvider";
              type: "address";
              internalType: "address";
          }];
          stateMutability: "nonpayable";
      }, {
          type: "function";
          name: "DOMAIN_SEPARATOR";
          inputs: readonly [];
          outputs: readonly [{
              name: "";
              type: "bytes32";
              internalType: "bytes32";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          name: "INITIAL_DOMAIN_SEPARATOR";
          inputs: readonly [];
          outputs: readonly [{
              name: "";
              type: "bytes32";
              internalType: "bytes32";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          name: "VERSION";
          inputs: readonly [];
          outputs: readonly [{
              name: "";
              type: "bytes";
              internalType: "bytes";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          name: "executeOperation";
          inputs: readonly [{
              name: "assets";
              type: "address[]";
              internalType: "address[]";
          }, {
              name: "amounts";
              type: "uint256[]";
              internalType: "uint256[]";
          }, {
              name: "premiums";
              type: "uint256[]";
              internalType: "uint256[]";
          }, {
              name: "initiator";
              type: "address";
              internalType: "address";
          }, {
              name: "params";
              type: "bytes";
              internalType: "bytes";
          }];
          outputs: readonly [{
              name: "";
              type: "bool";
              internalType: "bool";
          }];
          stateMutability: "nonpayable";
      }, {
          type: "function";
          name: "getNonce";
          inputs: readonly [{
              name: "account";
              type: "address";
              internalType: "address";
          }];
          outputs: readonly [{
              name: "nonce";
              type: "uint256";
              internalType: "uint256";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          name: "name";
          inputs: readonly [];
          outputs: readonly [{
              name: "";
              type: "string";
              internalType: "string";
          }];
          stateMutability: "view";
      }, {
          type: "function";
          name: "smartMigrate";
          inputs: readonly [{
              name: "args";
              type: "tuple";
              internalType: "struct IPositionMigrator.SmartMigrationArgs";
              components: readonly [{
                  name: "migrationArgs";
                  type: "tuple";
                  internalType: "struct IPositionMigrator.PositionMigrationArgs";
                  components: readonly [{
                      name: "close";
                      type: "tuple";
                      internalType: "struct IPositionMigrator.Position";
                      components: readonly [{
                          name: "contractAddress";
                          type: "address";
                          internalType: "address";
                      }, {
                          name: "callData";
                          type: "bytes";
                          internalType: "bytes";
                      }, {
                          name: "value";
                          type: "uint256";
                          internalType: "uint256";
                      }];
                  }, {
                      name: "open";
                      type: "tuple";
                      internalType: "struct IPositionMigrator.Position";
                      components: readonly [{
                          name: "contractAddress";
                          type: "address";
                          internalType: "address";
                      }, {
                          name: "callData";
                          type: "bytes";
                          internalType: "bytes";
                      }, {
                          name: "value";
                          type: "uint256";
                          internalType: "uint256";
                      }];
                  }, {
                      name: "borrowArgs";
                      type: "tuple";
                      internalType: "struct IPositionMigrator.AaveBorrowArgs";
                      components: readonly [{
                          name: "pool";
                          type: "address";
                          internalType: "contract IPool";
                      }, {
                          name: "recipient";
                          type: "address";
                          internalType: "address";
                      }, {
                          name: "assets";
                          type: "address[]";
                          internalType: "address[]";
                      }, {
                          name: "amounts";
                          type: "uint256[]";
                          internalType: "uint256[]";
                      }];
                  }, {
                      name: "approvalContract";
                      type: "address";
                      internalType: "address";
                  }, {
                      name: "migrator";
                      type: "address";
                      internalType: "address";
                  }, {
                      name: "nonce";
                      type: "uint256";
                      internalType: "uint256";
                  }];
              }, {
                  name: "migratorSignature";
                  type: "bytes";
                  internalType: "bytes";
              }];
          }];
          outputs: readonly [];
          stateMutability: "payable";
      }, {
          type: "event";
          name: "SmartMigration";
          inputs: readonly [{
              name: "closeContract";
              type: "address";
              indexed: false;
              internalType: "address";
          }, {
              name: "openContract";
              type: "address";
              indexed: false;
              internalType: "address";
          }];
          anonymous: false;
      }, {
          type: "error";
          name: "ECDSAInvalidSignature";
          inputs: readonly [];
      }, {
          type: "error";
          name: "ECDSAInvalidSignatureLength";
          inputs: readonly [{
              name: "length";
              type: "uint256";
              internalType: "uint256";
          }];
      }, {
          type: "error";
          name: "ECDSAInvalidSignatureS";
          inputs: readonly [{
              name: "s";
              type: "bytes32";
              internalType: "bytes32";
          }];
      }, {
          type: "error";
          name: "InvalidNonceError";
          inputs: readonly [];
      }, {
          type: "error";
          name: "InvalidPoolFlowError";
          inputs: readonly [];
      }, {
          type: "error";
          name: "InvalidSignatureError";
          inputs: readonly [];
      }, {
          type: "error";
          name: "NotWhitelistedAddressError";
          inputs: readonly [];
      }, {
          type: "error";
          name: "TargetContractCallFailed";
          inputs: readonly [];
      }], TFunctionName, true, TFunctionName extends "SmartMigration"[]
          ? TFunctionName[number]
          : TFunctionName>)

      Type declaration

        • <TFunctionName>(eventName, logs): ParseEventLogsReturnType<readonly [{
              type: "constructor";
              inputs: readonly [{
                  name: "_name";
                  type: "string";
                  internalType: "string";
              }, {
                  name: "addressManager";
                  type: "address";
                  internalType: "address";
              }, {
                  name: "aaveAddressProvider";
                  type: "address";
                  internalType: "address";
              }];
              stateMutability: "nonpayable";
          }, {
              type: "function";
              name: "DOMAIN_SEPARATOR";
              inputs: readonly [];
              outputs: readonly [{
                  name: "";
                  type: "bytes32";
                  internalType: "bytes32";
              }];
              stateMutability: "view";
          }, {
              type: "function";
              name: "INITIAL_DOMAIN_SEPARATOR";
              inputs: readonly [];
              outputs: readonly [{
                  name: "";
                  type: "bytes32";
                  internalType: "bytes32";
              }];
              stateMutability: "view";
          }, {
              type: "function";
              name: "VERSION";
              inputs: readonly [];
              outputs: readonly [{
                  name: "";
                  type: "bytes";
                  internalType: "bytes";
              }];
              stateMutability: "view";
          }, {
              type: "function";
              name: "executeOperation";
              inputs: readonly [{
                  name: "assets";
                  type: "address[]";
                  internalType: "address[]";
              }, {
                  name: "amounts";
                  type: "uint256[]";
                  internalType: "uint256[]";
              }, {
                  name: "premiums";
                  type: "uint256[]";
                  internalType: "uint256[]";
              }, {
                  name: "initiator";
                  type: "address";
                  internalType: "address";
              }, {
                  name: "params";
                  type: "bytes";
                  internalType: "bytes";
              }];
              outputs: readonly [{
                  name: "";
                  type: "bool";
                  internalType: "bool";
              }];
              stateMutability: "nonpayable";
          }, {
              type: "function";
              name: "getNonce";
              inputs: readonly [{
                  name: "account";
                  type: "address";
                  internalType: "address";
              }];
              outputs: readonly [{
                  name: "nonce";
                  type: "uint256";
                  internalType: "uint256";
              }];
              stateMutability: "view";
          }, {
              type: "function";
              name: "name";
              inputs: readonly [];
              outputs: readonly [{
                  name: "";
                  type: "string";
                  internalType: "string";
              }];
              stateMutability: "view";
          }, {
              type: "function";
              name: "smartMigrate";
              inputs: readonly [{
                  name: "args";
                  type: "tuple";
                  internalType: "struct IPositionMigrator.SmartMigrationArgs";
                  components: readonly [{
                      name: "migrationArgs";
                      type: "tuple";
                      internalType: "struct IPositionMigrator.PositionMigrationArgs";
                      components: readonly [{
                          name: "close";
                          type: "tuple";
                          internalType: "struct IPositionMigrator.Position";
                          components: readonly [{
                              name: "contractAddress";
                              type: "address";
                              internalType: "address";
                          }, {
                              name: "callData";
                              type: "bytes";
                              internalType: "bytes";
                          }, {
                              name: "value";
                              type: "uint256";
                              internalType: "uint256";
                          }];
                      }, {
                          name: "open";
                          type: "tuple";
                          internalType: "struct IPositionMigrator.Position";
                          components: readonly [{
                              name: "contractAddress";
                              type: "address";
                              internalType: "address";
                          }, {
                              name: "callData";
                              type: "bytes";
                              internalType: "bytes";
                          }, {
                              name: "value";
                              type: "uint256";
                              internalType: "uint256";
                          }];
                      }, {
                          name: "borrowArgs";
                          type: "tuple";
                          internalType: "struct IPositionMigrator.AaveBorrowArgs";
                          components: readonly [{
                              name: "pool";
                              type: "address";
                              internalType: "contract IPool";
                          }, {
                              name: "recipient";
                              type: "address";
                              internalType: "address";
                          }, {
                              name: "assets";
                              type: "address[]";
                              internalType: "address[]";
                          }, {
                              name: "amounts";
                              type: "uint256[]";
                              internalType: "uint256[]";
                          }];
                      }, {
                          name: "approvalContract";
                          type: "address";
                          internalType: "address";
                      }, {
                          name: "migrator";
                          type: "address";
                          internalType: "address";
                      }, {
                          name: "nonce";
                          type: "uint256";
                          internalType: "uint256";
                      }];
                  }, {
                      name: "migratorSignature";
                      type: "bytes";
                      internalType: "bytes";
                  }];
              }];
              outputs: readonly [];
              stateMutability: "payable";
          }, {
              type: "event";
              name: "SmartMigration";
              inputs: readonly [{
                  name: "closeContract";
                  type: "address";
                  indexed: false;
                  internalType: "address";
              }, {
                  name: "openContract";
                  type: "address";
                  indexed: false;
                  internalType: "address";
              }];
              anonymous: false;
          }, {
              type: "error";
              name: "ECDSAInvalidSignature";
              inputs: readonly [];
          }, {
              type: "error";
              name: "ECDSAInvalidSignatureLength";
              inputs: readonly [{
                  name: "length";
                  type: "uint256";
                  internalType: "uint256";
              }];
          }, {
              type: "error";
              name: "ECDSAInvalidSignatureS";
              inputs: readonly [{
                  name: "s";
                  type: "bytes32";
                  internalType: "bytes32";
              }];
          }, {
              type: "error";
              name: "InvalidNonceError";
              inputs: readonly [];
          }, {
              type: "error";
              name: "InvalidPoolFlowError";
              inputs: readonly [];
          }, {
              type: "error";
              name: "InvalidSignatureError";
              inputs: readonly [];
          }, {
              type: "error";
              name: "NotWhitelistedAddressError";
              inputs: readonly [];
          }, {
              type: "error";
              name: "TargetContractCallFailed";
              inputs: readonly [];
          }], TFunctionName, true, TFunctionName extends "SmartMigration"[]
              ? TFunctionName[number]
              : TFunctionName>
        • Type Parameters

          • TFunctionName extends "SmartMigration"

          Parameters

          • eventName: TFunctionName
          • logs: Log<bigint, number, false>[]

          Returns ParseEventLogsReturnType<readonly [{
              type: "constructor";
              inputs: readonly [{
                  name: "_name";
                  type: "string";
                  internalType: "string";
              }, {
                  name: "addressManager";
                  type: "address";
                  internalType: "address";
              }, {
                  name: "aaveAddressProvider";
                  type: "address";
                  internalType: "address";
              }];
              stateMutability: "nonpayable";
          }, {
              type: "function";
              name: "DOMAIN_SEPARATOR";
              inputs: readonly [];
              outputs: readonly [{
                  name: "";
                  type: "bytes32";
                  internalType: "bytes32";
              }];
              stateMutability: "view";
          }, {
              type: "function";
              name: "INITIAL_DOMAIN_SEPARATOR";
              inputs: readonly [];
              outputs: readonly [{
                  name: "";
                  type: "bytes32";
                  internalType: "bytes32";
              }];
              stateMutability: "view";
          }, {
              type: "function";
              name: "VERSION";
              inputs: readonly [];
              outputs: readonly [{
                  name: "";
                  type: "bytes";
                  internalType: "bytes";
              }];
              stateMutability: "view";
          }, {
              type: "function";
              name: "executeOperation";
              inputs: readonly [{
                  name: "assets";
                  type: "address[]";
                  internalType: "address[]";
              }, {
                  name: "amounts";
                  type: "uint256[]";
                  internalType: "uint256[]";
              }, {
                  name: "premiums";
                  type: "uint256[]";
                  internalType: "uint256[]";
              }, {
                  name: "initiator";
                  type: "address";
                  internalType: "address";
              }, {
                  name: "params";
                  type: "bytes";
                  internalType: "bytes";
              }];
              outputs: readonly [{
                  name: "";
                  type: "bool";
                  internalType: "bool";
              }];
              stateMutability: "nonpayable";
          }, {
              type: "function";
              name: "getNonce";
              inputs: readonly [{
                  name: "account";
                  type: "address";
                  internalType: "address";
              }];
              outputs: readonly [{
                  name: "nonce";
                  type: "uint256";
                  internalType: "uint256";
              }];
              stateMutability: "view";
          }, {
              type: "function";
              name: "name";
              inputs: readonly [];
              outputs: readonly [{
                  name: "";
                  type: "string";
                  internalType: "string";
              }];
              stateMutability: "view";
          }, {
              type: "function";
              name: "smartMigrate";
              inputs: readonly [{
                  name: "args";
                  type: "tuple";
                  internalType: "struct IPositionMigrator.SmartMigrationArgs";
                  components: readonly [{
                      name: "migrationArgs";
                      type: "tuple";
                      internalType: "struct IPositionMigrator.PositionMigrationArgs";
                      components: readonly [{
                          name: "close";
                          type: "tuple";
                          internalType: "struct IPositionMigrator.Position";
                          components: readonly [{
                              name: "contractAddress";
                              type: "address";
                              internalType: "address";
                          }, {
                              name: "callData";
                              type: "bytes";
                              internalType: "bytes";
                          }, {
                              name: "value";
                              type: "uint256";
                              internalType: "uint256";
                          }];
                      }, {
                          name: "open";
                          type: "tuple";
                          internalType: "struct IPositionMigrator.Position";
                          components: readonly [{
                              name: "contractAddress";
                              type: "address";
                              internalType: "address";
                          }, {
                              name: "callData";
                              type: "bytes";
                              internalType: "bytes";
                          }, {
                              name: "value";
                              type: "uint256";
                              internalType: "uint256";
                          }];
                      }, {
                          name: "borrowArgs";
                          type: "tuple";
                          internalType: "struct IPositionMigrator.AaveBorrowArgs";
                          components: readonly [{
                              name: "pool";
                              type: "address";
                              internalType: "contract IPool";
                          }, {
                              name: "recipient";
                              type: "address";
                              internalType: "address";
                          }, {
                              name: "assets";
                              type: "address[]";
                              internalType: "address[]";
                          }, {
                              name: "amounts";
                              type: "uint256[]";
                              internalType: "uint256[]";
                          }];
                      }, {
                          name: "approvalContract";
                          type: "address";
                          internalType: "address";
                      }, {
                          name: "migrator";
                          type: "address";
                          internalType: "address";
                      }, {
                          name: "nonce";
                          type: "uint256";
                          internalType: "uint256";
                      }];
                  }, {
                      name: "migratorSignature";
                      type: "bytes";
                      internalType: "bytes";
                  }];
              }];
              outputs: readonly [];
              stateMutability: "payable";
          }, {
              type: "event";
              name: "SmartMigration";
              inputs: readonly [{
                  name: "closeContract";
                  type: "address";
                  indexed: false;
                  internalType: "address";
              }, {
                  name: "openContract";
                  type: "address";
                  indexed: false;
                  internalType: "address";
              }];
              anonymous: false;
          }, {
              type: "error";
              name: "ECDSAInvalidSignature";
              inputs: readonly [];
          }, {
              type: "error";
              name: "ECDSAInvalidSignatureLength";
              inputs: readonly [{
                  name: "length";
                  type: "uint256";
                  internalType: "uint256";
              }];
          }, {
              type: "error";
              name: "ECDSAInvalidSignatureS";
              inputs: readonly [{
                  name: "s";
                  type: "bytes32";
                  internalType: "bytes32";
              }];
          }, {
              type: "error";
              name: "InvalidNonceError";
              inputs: readonly [];
          }, {
              type: "error";
              name: "InvalidPoolFlowError";
              inputs: readonly [];
          }, {
              type: "error";
              name: "InvalidSignatureError";
              inputs: readonly [];
          }, {
              type: "error";
              name: "NotWhitelistedAddressError";
              inputs: readonly [];
          }, {
              type: "error";
              name: "TargetContractCallFailed";
              inputs: readonly [];
          }], TFunctionName, true, TFunctionName extends "SmartMigration"[]
              ? TFunctionName[number]
              : TFunctionName>