ETH Price: $3,324.61 (-1.05%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
AddressProvider

Compiler Version
v0.8.23+commit.f704f362

Optimization Enabled:
Yes with 100000 runs

Other Settings:
paris EvmVersion
File 1 of 5 : AddressProvider.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

import "@openzeppelin/contracts/access/Ownable.sol";

import "./IAddressProvider.sol";
import "../debt/IDebtController.sol";

contract AddressProvider is Ownable, IAddressProvider {
    IDebtController public debtController;
    address public feeReceiver;
    address public immutable wethAddress;

    constructor(
        IDebtController _debtController,
        address _feeReceiver,
        address _wethAddress
    ) Ownable(msg.sender) {
        debtController = _debtController;
        feeReceiver = _feeReceiver;
        wethAddress = _wethAddress;
    }

    /// @inheritdoc IAddressProvider
    function getDebtController()
        external
        view
        override
        returns (IDebtController)
    {
        return debtController;
    }

    /// @inheritdoc IAddressProvider
    function getFeeReceiver()
        external
        view
        override
        returns (address)
    {
        return feeReceiver;
    }

    /// @inheritdoc IAddressProvider
    function getWethAddress() external view returns (address) {
        return wethAddress;
    }

    /// @dev sets the debt controller
    /// @param _debtController the debt controller
    function setDebtController(IDebtController _debtController) external onlyOwner {
        debtController = _debtController;
    }

    /// @dev sets the fee controller
    /// @param _feeReceiver the fee receiver
    function setFeeReceiver(address _feeReceiver) external onlyOwner {
        feeReceiver = _feeReceiver;
    }
}

File 2 of 5 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 5 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 4 of 5 : IAddressProvider.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

import "../debt/IDebtController.sol";

interface IAddressProvider {

    /// @dev Returns the debt controller
    function getDebtController() external view returns (IDebtController);

    /// @dev Returns the fee receiver address
    function getFeeReceiver() external view returns (address);

    /// @dev Returns the WETH address
    function getWethAddress() external view returns (address);
}

File 5 of 5 : IDebtController.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.23;

interface IDebtController {
    /// @dev Computes the maximum interest
    /// @param _tokenAddress the token address
    /// @param _principal the principal borrowed
    /// @param _lastFundingTimestamp the timestamp where the loan was last funded
    /// @return maxInterest the maximum interest amount to pay for the loan
    function computeMaxInterest(
        address _tokenAddress,
        uint256 _principal,
        uint256 _lastFundingTimestamp
    ) external view returns(uint256 maxInterest);

    /// @dev Computes the maximum principal
    /// @param _collateralToken the collateral token address
    /// @param _principalToken the principal token address
    /// @param _downPayment the down payment the trader is paying
    /// @return maxPrincipal the maximum principal allowed to be borrowed
    function computeMaxPrincipal(
        address _collateralToken,
        address _principalToken,
        uint256 _downPayment
    ) external view returns (uint256 maxPrincipal);

    // function computeLiquidationThreshold(
    //     address _collateralToken,
    //     address _principalToken,
    //     uint256 _collateralAmount
    // ) external view returns (uint256 liquidationThreshold);
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 100000
  },
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IDebtController","name":"_debtController","type":"address"},{"internalType":"address","name":"_feeReceiver","type":"address"},{"internalType":"address","name":"_wethAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"debtController","outputs":[{"internalType":"contract IDebtController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"feeReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDebtController","outputs":[{"internalType":"contract IDebtController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getFeeReceiver","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getWethAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IDebtController","name":"_debtController","type":"address"}],"name":"setDebtController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_feeReceiver","type":"address"}],"name":"setFeeReceiver","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"wethAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

60a060405234801561001057600080fd5b506040516105eb3803806105eb83398101604081905261002f91610100565b338061005557604051631e4fbdf760e01b81526000600482015260240160405180910390fd5b61005e81610098565b50600180546001600160a01b03199081166001600160a01b039586161790915560028054909116928416929092179091551660805261014d565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b03811681146100fd57600080fd5b50565b60008060006060848603121561011557600080fd5b8351610120816100e8565b6020850151909350610131816100e8565b6040850151909250610142816100e8565b809150509250925092565b60805161047c61016f600039600081816101280152610151015261047c6000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c8063715018a611610081578063e8a353921161005b578063e8a35392146101d9578063efdcd974146101f7578063f2fde38b1461020a57600080fd5b8063715018a6146101935780638da5cb5b1461019b578063b3f00674146101b957600080fd5b806323a7b42a116100b257806323a7b42a146101265780634f0e0ef31461014c5780636ada93f51461017357600080fd5b8063200110c5146100ce578063233a2d0714610111575b600080fd5b60015473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61012461011f366004610422565b61021d565b005b7f00000000000000000000000000000000000000000000000000000000000000006100e8565b6100e87f000000000000000000000000000000000000000000000000000000000000000081565b6001546100e89073ffffffffffffffffffffffffffffffffffffffff1681565b61012461026c565b60005473ffffffffffffffffffffffffffffffffffffffff166100e8565b6002546100e89073ffffffffffffffffffffffffffffffffffffffff1681565b60025473ffffffffffffffffffffffffffffffffffffffff166100e8565b610124610205366004610422565b610280565b610124610218366004610422565b6102cf565b610225610338565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610274610338565b61027e600061038b565b565b610288610338565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6102d7610338565b73ffffffffffffffffffffffffffffffffffffffff811661032c576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024015b60405180910390fd5b6103358161038b565b50565b60005473ffffffffffffffffffffffffffffffffffffffff16331461027e576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610323565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b73ffffffffffffffffffffffffffffffffffffffff8116811461033557600080fd5b60006020828403121561043457600080fd5b813561043f81610400565b939250505056fea2646970667358221220c7e84d74c80c1abe61c9d9d4fe08aea64b11c4e68ee0d7d1c4bd9061bc6af3f864736f6c63430008170033000000000000000000000000fe7b8f5722ac881242e16bebc8ea0b28c3ee60c20000000000000000000000005c629f8c0b5368f523c85bfe79d2a8efb64fb0c8000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100c95760003560e01c8063715018a611610081578063e8a353921161005b578063e8a35392146101d9578063efdcd974146101f7578063f2fde38b1461020a57600080fd5b8063715018a6146101935780638da5cb5b1461019b578063b3f00674146101b957600080fd5b806323a7b42a116100b257806323a7b42a146101265780634f0e0ef31461014c5780636ada93f51461017357600080fd5b8063200110c5146100ce578063233a2d0714610111575b600080fd5b60015473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b61012461011f366004610422565b61021d565b005b7f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26100e8565b6100e87f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281565b6001546100e89073ffffffffffffffffffffffffffffffffffffffff1681565b61012461026c565b60005473ffffffffffffffffffffffffffffffffffffffff166100e8565b6002546100e89073ffffffffffffffffffffffffffffffffffffffff1681565b60025473ffffffffffffffffffffffffffffffffffffffff166100e8565b610124610205366004610422565b610280565b610124610218366004610422565b6102cf565b610225610338565b600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b610274610338565b61027e600061038b565b565b610288610338565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6102d7610338565b73ffffffffffffffffffffffffffffffffffffffff811661032c576040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600060048201526024015b60405180910390fd5b6103358161038b565b50565b60005473ffffffffffffffffffffffffffffffffffffffff16331461027e576040517f118cdaa7000000000000000000000000000000000000000000000000000000008152336004820152602401610323565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b73ffffffffffffffffffffffffffffffffffffffff8116811461033557600080fd5b60006020828403121561043457600080fd5b813561043f81610400565b939250505056fea2646970667358221220c7e84d74c80c1abe61c9d9d4fe08aea64b11c4e68ee0d7d1c4bd9061bc6af3f864736f6c63430008170033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000fe7b8f5722ac881242e16bebc8ea0b28c3ee60c20000000000000000000000005c629f8c0b5368f523c85bfe79d2a8efb64fb0c8000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2

-----Decoded View---------------
Arg [0] : _debtController (address): 0xFe7B8F5722ac881242e16beBc8Ea0B28c3EE60C2
Arg [1] : _feeReceiver (address): 0x5C629f8C0B5368F523C85bFe79d2A8EFB64fB0c8
Arg [2] : _wethAddress (address): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000fe7b8f5722ac881242e16bebc8ea0b28c3ee60c2
Arg [1] : 0000000000000000000000005c629f8c0b5368f523c85bfe79d2a8efb64fb0c8
Arg [2] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.