Using Interfaces, Which way is preferred?

About using interfaces which way is preferred?, for any good reason?

ILendingPool public lendingPool;
function constructor(ILendingPool _lendingPool) {
        lendingPool = _lendingPool;
}
function foo() {
        lendingPool.deposit(...);
}

or

address public lendingPool;
function constructor(address _lendingPool) {
        lendingPool = _lendingPool;
}
function foo() {
        ILendingPool(lendingPool).deposit(...);
}

There's no difference, however, it's possible to update the address in the second case.

1 Like