Skip to content
Verified contractExactMIT

TransparentUpgradeableProxy

Address0xd75ab4b69f2edfb072fdfd7e2d15a875f95ae5ae
Balance

0 ETH

 

Transactions

33

 

Compiler

solc 0.8.20

 

Same code

1,298 more contracts

 

Details

Compiler
solc 0.8.20+commit.a1b79de6
Language
solidity
Optimization
Yes, 200 runs
EVM version
paris
License
MIT
Match
Exactcreation code: yes, runtime code: yes
Verified on Sourcify
Created in block
21,853,673
Creation transaction
0xb37e190e08…3bcb276f48
Proxy implementation
0xe1f4c214…ca1e5076source code not verified
Main copy (most transactions)
0xda5e1988…847cbef6

112 files

The source code is large: one file is shown at a time. Choose a file in the list.

contracts/XERC20/XERC20Lockbox.sol

// // SPDX-License-Identifier: MIT
// pragma solidity ^0.8.20;

// import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
// import "@openzeppelin/contracts/utils/math/SafeCast.sol";

// import "../interfaces/IXERC20Lockbox.sol";
// import "../interfaces/IXERC20.sol";

// contract XERC20Lockbox is IXERC20Lockbox {
//     using SafeERC20 for IERC20;
//     using SafeCast for uint256;

//     /**
//      * @notice The XERC20 token of this contract
//      */
//     IXERC20 public immutable XERC20;

//     /**
//      * @notice The ERC20 token of this contract
//      */
//     IERC20 public immutable ERC20;

//     /**
//      * @notice Whether the ERC20 token is the native gas token of this chain
//      */
//     bool public immutable IS_NATIVE;

//     /**
//      * @param _xerc20 The address of the XERC20 contract
//      * @param _erc20 The address of the ERC20 contract
//      * @param _isNative Whether the ERC20 token is the native gas token of this chain or not
//      */
//     constructor(address _xerc20, address _erc20, bool _isNative) payable {
//         XERC20 = IXERC20(_xerc20);
//         ERC20 = IERC20(_erc20);
//         IS_NATIVE = _isNative;
//     }

//     /**
//      * @notice Deposit native tokens into the lockbox
//      */
//     function depositNative() public payable {
//         if (!IS_NATIVE) revert IXERC20Lockbox_NotNative();
//         _deposit(msg.sender, msg.value);
//     }

//     /**
//      * @notice Deposit ERC20 tokens into the lockbox
//      * @param _amount The amount of tokens to deposit
//      */
//     function deposit(uint256 _amount) external {
//         if (IS_NATIVE) revert IXERC20Lockbox_Native();
//         _deposit(msg.sender, _amount);
//     }

//     /**
//      * @notice Deposit ERC20 tokens into the lockbox, and send the XERC20 to a user
//      * @param _to The user to send the XERC20 to
//      * @param _amount The amount of tokens to deposit
//      */
//     function depositTo(address _to, uint256 _amount) external {
//         if (IS_NATIVE) revert IXERC20Lockbox_Native();
//         _deposit(_to, _amount);
//     }

//     /**
//      * @notice Deposit the native asset into the lockbox, and send the XERC20 to a user
//      * @param _to The user to send the XERC20 to
//      */
//     function depositNativeTo(address _to) external payable {
//         if (!IS_NATIVE) revert IXERC20Lockbox_NotNative();
//         _deposit(_to, msg.value);
//     }

//     /**
//      * @notice Withdraw ERC20 tokens from the lockbox
//      * @param _amount The amount of tokens to withdraw
//      */
//     function withdraw(uint256 _amount) external {
//         _withdraw(msg.sender, _amount);
//     }

//     /**
//      * @notice Withdraw tokens from the lockbox
//      * @param _to The user to withdraw to
//      * @param _amount The amount of tokens to withdraw
//      */
//     function withdrawTo(address _to, uint256 _amount) external {
//         _withdraw(_to, _amount);
//     }

//     /**
//      * @notice Withdraw tokens from the lockbox
//      * @param _to The user to withdraw to
//      * @param _amount The amount of tokens to withdraw
//      */
//     function _withdraw(address _to, uint256 _amount) internal {
//         if (_to == address(this)) revert IXERC20Lockbox_WrongReceiver();
//         XERC20.burn(msg.sender, _amount);
//         if (IS_NATIVE) {
//             (bool _success, ) = payable(_to).call{value: _amount}("");
//             if (!_success) revert IXERC20Lockbox_WithdrawFailed();
//         } else {
//             ERC20.safeTransfer(_to, _amount);
//         }
//         emit Withdraw(_to, _amount);
//     }

//     /**
//      * @notice Deposit tokens into the lockbox
//      * @param _to The address to send the XERC20 to
//      * @param _amount The amount of tokens to deposit
//      */
//     function _deposit(address _to, uint256 _amount) internal {
//         if (_to == address(this)) revert IXERC20Lockbox_WrongReceiver();
//         if (!IS_NATIVE)
//             ERC20.safeTransferFrom(msg.sender, address(this), _amount);

//         XERC20.mint(_to, _amount);
//         emit Deposit(_to, _amount);
//     }

//     /**
//      * @notice Fallback function to deposit native tokens
//      */
//     receive() external payable {
//         depositNative();
//     }
// }
Compiler settingsShow
{
  "metadata": {
    "bytecodeHash": "ipfs"
  },
  "libraries": {},
  "optimizer": {
    "runs": 200,
    "enabled": true
  },
  "evmVersion": "paris",
  "remappings": []
}

Source code and metadata: Sourcify.

The source code belongs to the authors of the contract.