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.
- @openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.solmain6.37 KB
- @openzeppelin/contracts-upgradeable/../proxy/utils/Initializable.sol8.91 KB
- @openzeppelin/contracts-upgradeable/../utils/ContextUpgradeable.sol1.19 KB
- @openzeppelin/contracts-upgradeable/../utils/introspection/ERC165Upgradeable.sol1.18 KB
- @openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol4.03 KB
- @openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol8.91 KB
- @openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol19.4 KB
- @openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol1.19 KB
- @openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol3.86 KB
- @openzeppelin/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol4.36 KB
- @openzeppelin/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol1.18 KB
- @openzeppelin/contracts/access/AccessControl.sol7.05 KB
- @openzeppelin/contracts/access/IAccessControl.sol3.26 KB
- @openzeppelin/contracts/access/Ownable.sol3.1 KB
- @openzeppelin/contracts/contracts-upgradeable/../proxy/utils/Initializable.sol8.91 KB
- @openzeppelin/contracts/contracts-upgradeable/../utils/ContextUpgradeable.sol1.19 KB
- @openzeppelin/contracts/contracts-upgradeable/../utils/introspection/ERC165Upgradeable.sol1.18 KB
- @openzeppelin/contracts/contracts-upgradeable/access/OwnableUpgradeable.sol4.03 KB
- @openzeppelin/contracts/contracts-upgradeable/proxy/utils/Initializable.sol8.91 KB
- @openzeppelin/contracts/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol19.4 KB
- @openzeppelin/contracts/contracts-upgradeable/utils/ContextUpgradeable.sol1.19 KB
- @openzeppelin/contracts/contracts-upgradeable/utils/PausableUpgradeable.sol3.86 KB
- @openzeppelin/contracts/contracts-upgradeable/utils/ReentrancyGuardUpgradeable.sol4.36 KB
- @openzeppelin/contracts/contracts-upgradeable/utils/introspection/ERC165Upgradeable.sol1.18 KB
- @openzeppelin/contracts/interfaces/IERC1967.sol636 B
- @openzeppelin/contracts/interfaces/IERC20.sol181 B
- @openzeppelin/contracts/interfaces/IERC20Metadata.sol216 B
- @openzeppelin/contracts/interfaces/IERC5267.sol739 B
- @openzeppelin/contracts/interfaces/draft-IERC6093.sol6.53 KB
- @openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol1.72 KB
- @openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol6.72 KB
- @openzeppelin/contracts/proxy/Proxy.sol2.67 KB
- @openzeppelin/contracts/proxy/beacon/BeaconProxy.sol2.31 KB
- @openzeppelin/contracts/proxy/beacon/IBeacon.sol472 B
- @openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol2.22 KB
- @openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol1.95 KB
- @openzeppelin/contracts/proxy/utils/Initializable.sol8.91 KB
- @openzeppelin/contracts/token/ERC20/ERC20.sol11.14 KB
- @openzeppelin/contracts/token/ERC20/IERC20.sol2.78 KB
- @openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol1.18 KB
- @openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol2.77 KB
- @openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol683 B
- @openzeppelin/contracts/token/ERC20/extensions/IERC20Permit.sol3.8 KB
- @openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol5.77 KB
- @openzeppelin/contracts/token/ERC721/IERC721.sol4.93 KB
- @openzeppelin/contracts/token/ERC721/IERC721Receiver.sol995 B
- @openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol792 B
- @openzeppelin/contracts/utils/Address.sol6.26 KB
- @openzeppelin/contracts/utils/Context.sol963 B
- @openzeppelin/contracts/utils/ContextUpgradeable.sol1.19 KB
- @openzeppelin/contracts/utils/Create2.sol4.37 KB
- @openzeppelin/contracts/utils/Nonces.sol1.49 KB
- @openzeppelin/contracts/utils/ShortStrings.sol4.31 KB
- @openzeppelin/contracts/utils/StorageSlot.sol3.93 KB
- @openzeppelin/contracts/utils/Strings.sol3.1 KB
- @openzeppelin/contracts/utils/cryptography/ECDSA.sol7.73 KB
- @openzeppelin/contracts/utils/cryptography/EIP712.sol6.61 KB
- @openzeppelin/contracts/utils/cryptography/MessageHashUtils.sol3.76 KB
- @openzeppelin/contracts/utils/introspection/ERC165.sol911 B
- @openzeppelin/contracts/utils/introspection/ERC165Upgradeable.sol1.18 KB
- @openzeppelin/contracts/utils/introspection/IERC165.sol869 B
- @openzeppelin/contracts/utils/math/Math.sol15.12 KB
- @openzeppelin/contracts/utils/math/SignedMath.sol1.26 KB
- @openzeppelin/proxy/utils/Initializable.sol8.91 KB
- @openzeppelin/utils/ContextUpgradeable.sol1.19 KB
- @openzeppelin/utils/introspection/ERC165Upgradeable.sol1.18 KB
- contracts/NFT/ERC721V1.sol6.77 KB
- contracts/NFT/ERC721V2.sol1.14 KB
- contracts/NFT/burnRegistry/BurnRegistryV1.sol4.14 KB
- contracts/Proxies.sol218 B
- contracts/XERC20/XERC20.sol10.99 KB
- contracts/XERC20/XERC20Lockbox.sol4.34 KB
- contracts/bridge/InceptionBridge.sol11.92 KB
- contracts/bridge/InceptionBridgeStorage.sol8.87 KB
- contracts/bridgeMiddleware/BridgeMiddleware.sol2.01 KB
- contracts/bridgeMiddleware/MinimalProxyFactory.sol2.17 KB
- contracts/factory/BridgeFactory.sol6.78 KB
- contracts/governance/GovernorMultisig.sol1.64 KB
- contracts/governance/Multiownable.sol8.52 KB
- contracts/interfaces/IAcrossSpokePool.sol655 B
- contracts/interfaces/IERC20.sol874 B
- contracts/interfaces/IFactory.sol1.45 KB
- contracts/interfaces/IInceptionBridge.sol2.05 KB
- contracts/interfaces/IInceptionBridgeErrors.sol1.02 KB
- contracts/interfaces/IInceptionRatioFeed.sol973 B
- contracts/interfaces/IPriceFeed.sol304 B
- contracts/interfaces/IRateProvider.sol178 B
- contracts/interfaces/IXERC20.sol4.25 KB
- contracts/interfaces/IXERC20Lockbox.sol2.47 KB
- contracts/lib/CallDataRLPReader.sol3.66 KB
- contracts/lib/EthereumVerifier.sol6.58 KB
- contracts/lib/ProofParser.sol1.19 KB
- contracts/lib/Utils.sol2.07 KB
- contracts/mock/AcrossSpokePoolMock.sol1.33 KB
- contracts/mock/ERC20Mock.sol507 B
- contracts/mock/PriceFeedMock.sol824 B
- contracts/multicall/Multicall3.sol9.61 KB
- contracts/proxy/InitializableERC1967Proxy.sol716 B
- contracts/proxy/InitializableTransparentUpgradeableProxy.sol6.28 KB
- contracts/proxy/Proxy.sol343 B
- contracts/rate_providers/InETH/InETHRateProvider.sol552 B
- contracts/rate_providers/InceptionRateProvider.sol1.59 KB
- contracts/rate_providers/InstETH/InstETHRateProvider.sol560 B
- contracts/ratio_feed/InceptionRatioFeed.sol6.26 KB
- contracts/storage/Storage.sol3.77 KB
- contracts/tests/ERC20Mintable.sol498 B
- contracts/tests/MultipleDepositor.sol848 B
- contracts/tokens/EVE.sol391 B
- contracts/tokens/USDC.sol927 B
- contracts/tokens/USDT.sol927 B
- contracts/treasury/TreasuryV1.sol2.34 KB
- contracts/vault/VaultV1.sol4.82 KB
contracts/vault/VaultV1.sol
// SPDX-License-Identifier: BSD-3-Clause
pragma solidity ^0.8.20;
import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
import {PausableUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/PausableUpgradeable.sol";
contract VaultV1 is OwnableUpgradeable, PausableUpgradeable {
/// @dev Disributed balances.
mapping(address => uint256) internal _balances;
/// @dev Distributors addresses.
mapping(address => bool) internal _distributors;
/// @dev Total number of distributed tokens.
uint256 internal _totalDistributed;
/// @dev Storage gap for future upgrades.
uint256[10] internal __gap;
/// @notice Emited if tokens distributed for account.
event Distribute(address indexed account, uint256 amount);
/// @notice Emited if distributed tokens have been revoked.
event Reset(address indexed account);
/// @notice Emited if distributed tokens have been withdrawal.
event Withdrawal(address indexed from, address indexed recipient, uint256 amount);
/// @notice Emited if distributor list changed.
event ChangeDistributor(address indexed distributor, bool isAdded);
error VaultWithdrawFailed(address recipient, uint256 amount);
error VaultInvalidDistributor(address distributor);
error VaultDistributeOverflow(uint256 balance, uint256 totalDistributed, uint256 amount);
constructor() {
_disableInitializers();
}
function initialize() public initializer {
__Ownable_init(_msgSender());
__Pausable_init();
}
receive() external payable {}
fallback() external payable {}
/// @return Total number of distributed tokens.
function totalDistributed() public view returns (uint256) {
return _totalDistributed;
}
/// @param account Target account.
/// @return Balance distributed tokens of account.
function balanceOf(address account) public view returns (uint256) {
return _balances[account];
}
/// @notice Add distributor address to distributors list.
/// @param distributor Target account.
function addDistributor(address distributor) external onlyOwner {
_distributors[distributor] = true;
emit ChangeDistributor(distributor, true);
}
/// @notice Remove distributor address to distributors list.
/// @param distributor Target account.
function removeDistributor(address distributor) external onlyOwner {
_distributors[distributor] = false;
emit ChangeDistributor(distributor, false);
}
/// @notice Distribute tokens for account.
/// @param account Target account.
/// @param amount Number of tokens distributed.
function distribute(address account, uint256 amount) external payable {
address distributor = _msgSender();
if (!_distributors[distributor]) {
revert VaultInvalidDistributor(distributor);
}
uint256 balance = address(this).balance;
if (balance < _totalDistributed + amount) {
revert VaultDistributeOverflow(balance, _totalDistributed, amount);
}
_balances[account] += amount;
_totalDistributed += amount;
emit Distribute(account, amount);
}
function pause() external onlyOwner {
_pause();
}
function unpause() external onlyOwner {
_unpause();
}
/// @dev Withdraw distributed tokens.
/// @param from Tokens owner address.
/// @param recipient Tokens recipient address.
function _withdraw(address from, address recipient) internal {
uint256 amount = balanceOf(from);
_balances[from] = 0;
_totalDistributed -= amount;
(bool sent, ) = recipient.call{value: amount}("");
if (!sent) revert VaultWithdrawFailed(recipient, amount);
emit Withdrawal(from, recipient, amount);
}
/// @notice Withdraw distributed tokens of transaction sender.
function withdraw() external whenNotPaused {
address recipient = _msgSender();
_withdraw(recipient, recipient);
}
/// @notice Withdraw distributed tokens.
/// @param from Tokens owner address.
/// @param recipient Tokens recipient address.
function withdrawFrom(address from, address recipient) external whenPaused onlyOwner {
_withdraw(from, recipient);
}
/// @notice Revoke distributed tokens.
/// @param account Targer account address.
function reset(address account) external whenPaused onlyOwner {
uint256 balance = _balances[account];
_balances[account] = 0;
_totalDistributed -= balance;
emit Reset(account);
}
/// @notice Withdraw not distributed tokens.
/// @param recipient Tokens recipient address.
function withdrawCrumbs(address recipient) external onlyOwner {
uint256 amount = address(this).balance - _totalDistributed;
(bool sent, ) = recipient.call{value: amount}("");
if (!sent) revert VaultWithdrawFailed(recipient, amount);
emit Withdrawal(address(this), recipient, amount);
}
}
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.