Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x7Ca54e9Aa3128bF15f764fa0f0f93e72b5267000
Balance 8.6549 ETH
Nonce 1
Code Size 3539 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

3539 bytes
0x6080604052600436106101185760003560e01c806369d0a802116100a0578063c07ea54111610064578063c07ea54114610356578063e22212af14610396578063f14210a6146103b6578063f2fde38b146103d6578063f6326fb3146103f657600080fd5b806369d0a802146102c3578063715018a6146102e35780638da5cb5b146102f8578063902af2d114610316578063a59a99731461033657600080fd5b80632f88be94116100e75780632f88be941461023057806343d03bd514610250578063489e5c0b1461027057806357de59de1461029057806358c3816e146102b057600080fd5b806308c8e616146101ab578063113aa8b1146101e857806316114acd146102085780632aa918cb1461022857600080fd5b366101a6573360008181526005602052604090205460ff161561014357506004546001600160a01b03165b6002546040516340c10f1960e01b81526001600160a01b038381166004830152346024830152909116906340c10f1990604401600060405180830381600087803b15801561019057600080fd5b505af11580156101a4573d6000803e3d6000fd5b005b600080fd5b3480156101b757600080fd5b506002546101cb906001600160a01b031681565b6040516001600160a01b0390911681526020015b60405180910390f35b3480156101f457600080fd5b506101a4610203366004610cac565b6103fe565b34801561021457600080fd5b506101a4610223366004610cac565b610482565b6101a4610514565b34801561023c57600080fd5b506101a461024b366004610cac565b61054b565b34801561025c57600080fd5b506001546101cb906001600160a01b031681565b34801561027c57600080fd5b506101a461028b366004610cdc565b6105c7565b34801561029c57600080fd5b506101a46102ab366004610d13565b610658565b6101a46102be366004610cac565b610728565b3480156102cf57600080fd5b506004546101cb906001600160a01b031681565b3480156102ef57600080fd5b506101a4610790565b34801561030457600080fd5b506000546001600160a01b03166101cb565b34801561032257600080fd5b506101a4610331366004610cac565b6107a4565b34801561034257600080fd5b506003546101cb906001600160a01b031681565b34801561036257600080fd5b50610386610371366004610cac565b60056020526000908152604090205460ff1681565b60405190151581526020016101df565b3480156103a257600080fd5b506101a46103b1366004610cac565b610820565b3480156103c257600080fd5b506101a46103d1366004610d13565b61089c565b3480156103e257600080fd5b506101a46103f1366004610cac565b6109c6565b6101a4610a3c565b610406610aa1565b6003546001600160a01b0380831691160361042057600080fd5b600380546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f1b71416b0353d88c20dda5c0a9e49d15b77898a3991a2779120aefe57da2e0a791015b60405180910390a15050565b6001546001600160a01b031661049757600080fd5b6001546040516370a0823160e01b81523060048201526105119183916001600160a01b03918216918316906370a0823190602401602060405180830381865afa1580156104e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061050c9190610d2c565b610b0a565b50565b60405134815233907fd7289cb4bb1d80932416fb1a5e3130055c190f63290d5762ff0389a3163b6e8a9060200160405180910390a2565b610553610aa1565b6004546001600160a01b0380831691160361056d57600080fd5b600480546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527ff474019b38de051f59c48553823b00ed0d6878e1ddc738cdfb9c865effebdc289101610476565b6105cf610aa1565b6001600160a01b03821660009081526005602052604090205481151560ff9091161515036105fc57600080fd5b6001600160a01b038216600081815260056020908152604091829020805460ff19168515159081179091558251938452908301527f70aa3f45b9d0a7dfa2d07214617857e523d5f6535f8192106cba1794099856ff9101610476565b610660610aa1565b6003546001600160a01b031661067557600080fd5b4781111561068257600080fd5b6003546040516000916001600160a01b03169083908381818185875af1925050503d80600081146106cf576040519150601f19603f3d011682016040523d82523d6000602084013e6106d4565b606091505b50509050806106e257600080fd5b6003546040518381526001600160a01b03909116907f8c8f77105ce8ee99e391fd4da140bc14a988eb4cf878b240bfed9b10ae7c67589060200160405180910390a25050565b6002546040516340c10f1960e01b81526001600160a01b038381166004830152346024830152909116906340c10f1990604401600060405180830381600087803b15801561077557600080fd5b505af1158015610789573d6000803e3d6000fd5b5050505050565b610798610aa1565b6107a26000610c40565b565b6107ac610aa1565b6002546001600160a01b038083169116036107c657600080fd5b600280546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527f35298af8e26eb2d59ae067158ad7005a6ff3d008b6906c6a2f1b313d15597d619101610476565b610828610aa1565b6001546001600160a01b0380831691160361084257600080fd5b600180546001600160a01b038381166001600160a01b031983168117909355604080519190921680825260208201939093527fd961bdc876de67ab892dce771ca242760d9512ce261e2f72cc48ce42996c54769101610476565b478111156109095760405162461bcd60e51b815260206004820152602f60248201527f496e73756666696369656e742066756e647320746f2072656465656d2074686160448201526e1d08185b5bdd5b9d081bd988160dd1608a1b60648201526084015b60405180910390fd5b600254604051632770a7eb60e21b8152336004820152602481018390526001600160a01b0390911690639dc29fac90604401600060405180830381600087803b15801561095557600080fd5b505af1158015610969573d6000803e3d6000fd5b50506040516000925033915083908381818185875af1925050503d80600081146109af576040519150601f19603f3d011682016040523d82523d6000602084013e6109b4565b606091505b50509050806109c257600080fd5b5050565b6109ce610aa1565b6001600160a01b038116610a335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610900565b61051181610c40565b6002546040516340c10f1960e01b81523360048201523460248201526001600160a01b03909116906340c10f1990604401600060405180830381600087803b158015610a8757600080fd5b505af1158015610a9b573d6000803e3d6000fd5b50505050565b33610ab46000546001600160a01b031690565b6001600160a01b0316146107a25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610900565b604080518082018252601981527f7472616e7366657228616464726573732c75696e74323536290000000000000060209182015281516001600160a01b0385811660248301526044808301869052845180840390910181526064909201845291810180516001600160e01b031663a9059cbb60e01b17905291516000928392871691610b969190610d45565b6000604051808303816000865af19150503d8060008114610bd3576040519150601f19603f3d011682016040523d82523d6000602084013e610bd8565b606091505b5091509150818015610c02575080511580610c02575080806020019051810190610c029190610d80565b6107895760405162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b6044820152606401610900565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b0381168114610ca757600080fd5b919050565b600060208284031215610cbe57600080fd5b610cc782610c90565b9392505050565b801515811461051157600080fd5b60008060408385031215610cef57600080fd5b610cf883610c90565b91506020830135610d0881610cce565b809150509250929050565b600060208284031215610d2557600080fd5b5035919050565b600060208284031215610d3e57600080fd5b5051919050565b6000825160005b81811015610d665760208186018101518583015201610d4c565b81811115610d75576000828501525b509190910192915050565b600060208284031215610d9257600080fd5b8151610cc781610cce56fea2646970667358221220564055893864aa4a70383650f1b48e4e9f5673dac190d27b749f5589b427aafe64736f6c634300080f0033

Verified Source Code Partial Match

Compiler: v0.8.15+commit.e14f2714 EVM: london Optimization: Yes (200 runs)
X7LendingPoolReserve.sol 265 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;

/*

 /$$   /$$ /$$$$$$$$       /$$$$$$$$ /$$
| $$  / $$|_____ $$/      | $$_____/|__/
|  $$/ $$/     /$$/       | $$       /$$ /$$$$$$$   /$$$$$$  /$$$$$$$   /$$$$$$$  /$$$$$$
 \  $$$$/     /$$/        | $$$$$   | $$| $$__  $$ |____  $$| $$__  $$ /$$_____/ /$$__  $$
  >$$  $$    /$$/         | $$__/   | $$| $$  \ $$  /$$$$$$$| $$  \ $$| $$      | $$$$$$$$
 /$$/\  $$  /$$/          | $$      | $$| $$  | $$ /$$__  $$| $$  | $$| $$      | $$_____/
| $$  \ $$ /$$/           | $$      | $$| $$  | $$|  $$$$$$$| $$  | $$|  $$$$$$$|  $$$$$$$
|__/  |__/|__/            |__/      |__/|__/  |__/ \_______/|__/  |__/ \_______/ \_______/

Contract: Smart Contract for minting and redeeming X7D and funding the Lending Pool with ETH.

This contract may be used to mint X7D and redeem X7D.

For ease of integration, contracts may choose to simply send ETH to this contract and they will receive X7D.
X7 ecosystem contracts that deposit funds in this manner have X7D minted to the X7 Token Time Lock.

However, it is recommended to use depositETH or depositETHForRecipient to guarantee that the X7D is only ever minted to the desired location.

A word of CAUTION for minters:

The full X7D ecosystem will evolve over time. While all ETH funds deposited to this contract will remain locked in X7 ecosystem smart contracts not all ETH will remain in THIS contract.
There is no risk for minting X7D on this contract - however, withdrawals will be on a first come/first serve basis. Some funds may be servicing loans.
the X7100 series tokens will eventually act as a liquidity sink and will backstop X7D redemptions if there is a temporary funding gap (due to outstanding loans).
You should NOT mint X7D from this contract unless you are willing to wait an indeterminate amount of time to withdraw your ETH on the first come/first serve basis.

This contract will NOT be renounced.

The following are the only functions that can be called on the contract that affect the contract:

    function setLendingPool(address lendingPool_) external onlyOwner {
        require(lendingPool != lendingPool_);
        address oldLendingPool = lendingPool;
        lendingPool = lendingPool_;

        emit LendingPoolSet(oldLendingPool, lendingPool_);
    }

    function setEcosystemRecipientAddress(address recipient) external onlyOwner {
        require(ecosystemRecipient != recipient);
        address oldRecipient = ecosystemRecipient;
        ecosystemRecipient = recipient;

        emit EcosystemRecipientSet(oldRecipient, recipient);
    }

    function setX7D(address X7DAddress) external onlyOwner {
        require(address(X7D) != X7DAddress);
        address oldX7D = address(X7D);
        X7D = IX7D(X7DAddress);

        emit X7DSet(oldX7D, X7DAddress);
    }

    function setEcosystemPayer(address ecosystemPayerAddress, bool value) external onlyOwner {
        require(isEcosystemPayer[ecosystemPayerAddress] != value);
        isEcosystemPayer[ecosystemPayerAddress] = value;

        emit EcosystemPayerSet(ecosystemPayerAddress, value);
    }

    function fundLendingPool(uint256 amount) external onlyOwner {
        require(lendingPool != address(0));
        require(amount <= address(this).balance);

        (bool success,) = lendingPool.call{value: amount}("");
        require(success);

        emit FundsSent(lendingPool, amount);
    }

    function setRecoveredTokenRecipient(address tokenRecipient_) external onlyOwner {
        require(recoveredTokenRecipient != tokenRecipient_);
        address oldRecipient = recoveredTokenRecipient;
        recoveredTokenRecipient = tokenRecipient_;

        emit RecoveredTokenRecipientSet(oldRecipient, tokenRecipient_);
    }

These functions will be passed to DAO governance once the ecosystem stabilizes.

*/

abstract contract Ownable {
    address private _owner;

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

    constructor(address owner_) {
        _transferOwnership(owner_);
    }

    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    function owner() public view virtual returns (address) {
        return _owner;
    }

    function _checkOwner() internal view virtual {
        require(owner() == msg.sender, "Ownable: caller is not the owner");
    }

    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

interface IERC20 {
    function balanceOf(address account) external view returns (uint256);
}

interface IX7D {
    function mint(address to, uint256 amount) external;
    function burn(address from, uint256 amount) external;
}

interface X7DMinter {
    // Call this function to explicitly mint X7D
    function depositETH() external payable;

    // Call this function to return ETH to this contract without minting X7D
    function returnETH() external payable;

    // Call this function to mint X7D to a recipient of your choosing
    function depositETHForRecipient(address recipient) external payable;
}

interface X7DBurner {
    // Call this function to redeem (burn) X7D for ETH
    function withdrawETH(uint256 amount) external;
}

abstract contract TokensCanBeRecovered is Ownable {
    bytes4 private constant TRANSFERSELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
    address public recoveredTokenRecipient;

    event RecoveredTokenRecipientSet(address oldRecipient, address newRecipient);

    function setRecoveredTokenRecipient(address tokenRecipient_) external onlyOwner {
        require(recoveredTokenRecipient != tokenRecipient_);
        address oldRecipient = recoveredTokenRecipient;
        recoveredTokenRecipient = tokenRecipient_;
        emit RecoveredTokenRecipientSet(oldRecipient, tokenRecipient_);
    }

    function recoverTokens(address tokenAddress) external {
        require(recoveredTokenRecipient != address(0));
        _safeTransfer(tokenAddress, recoveredTokenRecipient, IERC20(tokenAddress).balanceOf(address(this)));
    }

    function _safeTransfer(address token, address to, uint value) private {
        (bool success, bytes memory data) = token.call(abi.encodeWithSelector(TRANSFERSELECTOR, to, value));
        require(success && (data.length == 0 || abi.decode(data, (bool))), 'TRANSFER_FAILED');
    }
}

contract X7LendingPoolReserve is Ownable, TokensCanBeRecovered, X7DMinter, X7DBurner {
    IX7D public                     X7D;
    address public                  lendingPool;
    address public                  ecosystemRecipient;
    mapping(address => bool) public isEcosystemPayer;

    event X7DSet(address oldAddress, address newAddress);
    event EcosystemRecipientSet(address oldAddress, address newAddress);
    event EcosystemPayerSet(address payorAddress, bool isPayer);
    event LendingPoolSet(address oldAddress, address newAddress);
    event FundsSent(address indexed recipient, uint256 amount);
    event FundsReturned(address indexed sender, uint256 amount);

    constructor (address X7DAddress, address ecosystemRecipientAddress) Ownable(msg.sender) {
        X7D = IX7D(X7DAddress);
        ecosystemRecipient = ecosystemRecipientAddress;

        emit X7DSet(address(0), X7DAddress);
        emit EcosystemRecipientSet(address(0), ecosystemRecipientAddress);
    }

    receive () external payable {
        address recipient = msg.sender;

        if (isEcosystemPayer[msg.sender]) {
            recipient = ecosystemRecipient;
        }

        X7D.mint(recipient, msg.value);
    }

    function depositETH() external payable {
        X7D.mint(msg.sender, msg.value);
    }

    function depositETHForRecipient(address recipient) external payable {
        X7D.mint(recipient, msg.value);
    }

    function withdrawETH(uint256 amount) external {
        require(amount <= address(this).balance, "Insufficient funds to redeem that amount of X7D");
        X7D.burn(msg.sender, amount);
        (bool success,) = msg.sender.call{value: amount}("");
        require(success);
    }

    function returnETH() external payable {
        emit FundsReturned(msg.sender, msg.value);
    }

    function setLendingPool(address lendingPool_) external onlyOwner {
        require(lendingPool != lendingPool_);
        address oldLendingPool = lendingPool;
        lendingPool = lendingPool_;

        emit LendingPoolSet(oldLendingPool, lendingPool_);
    }

    function setEcosystemRecipientAddress(address recipient) external onlyOwner {
        require(ecosystemRecipient != recipient);
        address oldRecipient = ecosystemRecipient;
        ecosystemRecipient = recipient;

        emit EcosystemRecipientSet(oldRecipient, recipient);
    }

    function setX7D(address X7DAddress) external onlyOwner {
        require(address(X7D) != X7DAddress);
        address oldX7D = address(X7D);
        X7D = IX7D(X7DAddress);

        emit X7DSet(oldX7D, X7DAddress);
    }

    function setEcosystemPayer(address ecosystemPayerAddress, bool value) external onlyOwner {
        require(isEcosystemPayer[ecosystemPayerAddress] != value);
        isEcosystemPayer[ecosystemPayerAddress] = value;

        emit EcosystemPayerSet(ecosystemPayerAddress, value);
    }

    function fundLendingPool(uint256 amount) external onlyOwner {
        require(lendingPool != address(0));
        require(amount <= address(this).balance);

        (bool success,) = lendingPool.call{value: amount}("");
        require(success);

        emit FundsSent(lendingPool, amount);
    }
}

Read Contract

X7D 0x08c8e616 → address
ecosystemRecipient 0x69d0a802 → address
isEcosystemPayer 0xc07ea541 → bool
lendingPool 0xa59a9973 → address
owner 0x8da5cb5b → address
recoveredTokenRecipient 0x43d03bd5 → address

Write Contract 13 functions

These functions modify contract state and require a wallet transaction to execute.

depositETH 0xf6326fb3
No parameters
depositETHForRecipient 0x58c3816e
address recipient
fundLendingPool 0x57de59de
uint256 amount
recoverTokens 0x16114acd
address tokenAddress
renounceOwnership 0x715018a6
No parameters
returnETH 0x2aa918cb
No parameters
setEcosystemPayer 0x489e5c0b
address ecosystemPayerAddress
bool value
setEcosystemRecipientAddress 0x2f88be94
address recipient
setLendingPool 0x113aa8b1
address lendingPool_
setRecoveredTokenRecipient 0xe22212af
address tokenRecipient_
setX7D 0x902af2d1
address X7DAddress
transferOwnership 0xf2fde38b
address newOwner
withdrawETH 0xf14210a6
uint256 amount

Token Balances (1)

View Transfers →
WETH 0.01

Recent Transactions

No transactions found for this address