Overview
S Balance
0 S
S Value
-More Info
Private Name Tags
ContractCreator
Loading...
Loading
Contract Source Code Verified (Exact Match)
Contract Name:
Tower
Compiler Version
v0.8.28+commit.7893614a
Optimization Enabled:
Yes with 200 runs
Other Settings:
cancun EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.28; import "openzeppelin5/access/Ownable.sol"; /// @title Tower /// @notice Utility contract that stores addresses of any contracts contract Tower is Ownable { mapping(bytes32 => address) private _coordinates; event NewCoordinates(string key, address indexed newContract); event UpdateCoordinates(string key, address indexed newContract); event RemovedCoordinates(string key); error AddressZero(); error KeyIsTaken(); error EmptyCoordinates(); constructor() Ownable(msg.sender) {} /// @dev Registering new contract /// @param _key key under which contract will be stored /// @param _contract contract address function register(string calldata _key, address _contract) external virtual onlyOwner { bytes32 key = makeKey(_key); if (_coordinates[key] != address(0)) revert KeyIsTaken(); if (_contract == address(0)) revert AddressZero(); _coordinates[key] = _contract; emit NewCoordinates(_key, _contract); } /// @dev Removing coordinates /// @param _key key to remove function unregister(string calldata _key) external virtual onlyOwner { bytes32 key = makeKey(_key); if (_coordinates[key] == address(0)) revert EmptyCoordinates(); _coordinates[key] = address(0); emit RemovedCoordinates(_key); } /// @dev Update key with new contract address /// @param _key key under which new contract will be stored /// @param _contract contract address function update(string calldata _key, address _contract) external virtual onlyOwner { bytes32 key = makeKey(_key); if (_coordinates[key] == address(0)) revert EmptyCoordinates(); if (_contract == address(0)) revert AddressZero(); _coordinates[key] = _contract; emit UpdateCoordinates(_key, _contract); } /// @param _key string key /// @return address coordinates for the `_key` function coordinates(string calldata _key) external view virtual returns (address) { return _coordinates[makeKey(_key)]; } /// @param _key raw bytes32 key /// @return address coordinates for the raw `_key` function rawCoordinates(bytes32 _key) external view virtual returns (address) { return _coordinates[_key]; } /// @dev generating mapping key based on string /// @param _key string key /// @return bytes32 representation of the `_key` function makeKey(string calldata _key) public pure virtual returns (bytes32) { return keccak256(abi.encodePacked(_key)); } }
// 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); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.1) (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; } function _contextSuffixLength() internal view virtual returns (uint256) { return 0; } }
{ "remappings": [ "forge-std/=gitmodules/forge-std/src/", "silo-foundry-utils/=gitmodules/silo-foundry-utils/contracts/", "properties/=gitmodules/crytic/properties/contracts/", "silo-core/=silo-core/", "silo-oracles/=silo-oracles/", "silo-vaults/=silo-vaults/", "ve-silo/=ve-silo/", "@openzeppelin/=gitmodules/openzeppelin-contracts-5/contracts/", "morpho-blue/=gitmodules/morpho-blue/src/", "openzeppelin5/=gitmodules/openzeppelin-contracts-5/contracts/", "openzeppelin5-upgradeable/=gitmodules/openzeppelin-contracts-upgradeable-5/contracts/", "chainlink/=gitmodules/chainlink/contracts/src/", "chainlink-ccip/=gitmodules/chainlink-ccip/contracts/src/", "uniswap/=gitmodules/uniswap/", "@uniswap/v3-core/=gitmodules/uniswap/v3-core/", "balancer-labs/v2-solidity-utils/=external/balancer-v2-monorepo/pkg/solidity-utils/contracts/", "balancer-labs/v2-interfaces/=external/balancer-v2-monorepo/pkg/interfaces/contracts/", "balancer-labs/v2-liquidity-mining/=external/balancer-v2-monorepo/pkg/liquidity-mining/contracts/", "@balancer-labs/=node_modules/@balancer-labs/", "@ensdomains/=node_modules/@ensdomains/", "@openzeppelin/contracts-upgradeable/=gitmodules/openzeppelin-contracts-upgradeable-5/contracts/", "@openzeppelin/contracts/=gitmodules/openzeppelin-contracts-5/contracts/", "@solidity-parser/=node_modules/@solidity-parser/", "ERC4626/=gitmodules/crytic/properties/lib/ERC4626/contracts/", "crytic/=gitmodules/crytic/", "ds-test/=gitmodules/openzeppelin-contracts-5/lib/forge-std/lib/ds-test/src/", "erc4626-tests/=gitmodules/openzeppelin-contracts-5/lib/erc4626-tests/", "halmos-cheatcodes/=gitmodules/morpho-blue/lib/halmos-cheatcodes/src/", "hardhat/=node_modules/hardhat/", "openzeppelin-contracts-5/=gitmodules/openzeppelin-contracts-5/", "openzeppelin-contracts-upgradeable-5/=gitmodules/openzeppelin-contracts-upgradeable-5/", "openzeppelin-contracts/=gitmodules/openzeppelin-contracts-upgradeable-5/lib/openzeppelin-contracts/", "prettier-plugin-solidity/=node_modules/prettier-plugin-solidity/", "proposals/=node_modules/proposals/", "solmate/=gitmodules/crytic/properties/lib/solmate/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "useLiteralContent": false, "bytecodeHash": "ipfs", "appendCBOR": true }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "cancun", "viaIR": false, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AddressZero","type":"error"},{"inputs":[],"name":"EmptyCoordinates","type":"error"},{"inputs":[],"name":"KeyIsTaken","type":"error"},{"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":false,"internalType":"string","name":"key","type":"string"},{"indexed":true,"internalType":"address","name":"newContract","type":"address"}],"name":"NewCoordinates","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"key","type":"string"}],"name":"RemovedCoordinates","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"key","type":"string"},{"indexed":true,"internalType":"address","name":"newContract","type":"address"}],"name":"UpdateCoordinates","type":"event"},{"inputs":[{"internalType":"string","name":"_key","type":"string"}],"name":"coordinates","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_key","type":"string"}],"name":"makeKey","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_key","type":"bytes32"}],"name":"rawCoordinates","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"string","name":"_key","type":"string"},{"internalType":"address","name":"_contract","type":"address"}],"name":"register","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_key","type":"string"}],"name":"unregister","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_key","type":"string"},{"internalType":"address","name":"_contract","type":"address"}],"name":"update","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6080604052348015600e575f5ffd5b503380603357604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b603a81603f565b50608e565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6106848061009b5f395ff3fe608060405234801561000f575f5ffd5b5060043610610090575f3560e01c806388ecdb2f1161006357806388ecdb2f146100d75780638da5cb5b146100fd578063e94368b314610121578063f2fde38b14610149578063fe2cbfa81461015c575f5ffd5b80631e59c529146100945780632cff89c9146100a95780636598a1ae146100bc578063715018a6146100cf575b5f5ffd5b6100a76100a236600461054b565b61016f565b005b6100a76100b736600461054b565b61024b565b6100a76100ca36600461059b565b610318565b6100a76103bb565b6100ea6100e536600461059b565b6103ce565b6040519081526020015b60405180910390f35b5f546001600160a01b03165b6040516001600160a01b0390911681526020016100f4565b61010961012f3660046105da565b5f908152600160205260409020546001600160a01b031690565b6100a76101573660046105f1565b610400565b61010961016a36600461059b565b610442565b610177610470565b5f61018284846103ce565b5f818152600160205260409020549091506001600160a01b0316156101ba5760405163070ee79760e31b815260040160405180910390fd5b6001600160a01b0382166101e157604051639fabe1c160e01b815260040160405180910390fd5b5f818152600160205260409081902080546001600160a01b0319166001600160a01b03851690811790915590517f5327935b8796b9614e833d16c9e90ccb2b33e41e5181f8af0308fba0373c1caf9061023d9087908790610611565b60405180910390a250505050565b610253610470565b5f61025e84846103ce565b5f818152600160205260409020549091506001600160a01b03166102955760405163513cc0b960e01b815260040160405180910390fd5b6001600160a01b0382166102bc57604051639fabe1c160e01b815260040160405180910390fd5b5f818152600160205260409081902080546001600160a01b0319166001600160a01b03851690811790915590517faa96e0e6f7c38ef3ea5679180dc8034becfee398a6d177ee2c175663f96340e69061023d9087908790610611565b610320610470565b5f61032b83836103ce565b5f818152600160205260409020549091506001600160a01b03166103625760405163513cc0b960e01b815260040160405180910390fd5b5f818152600160205260409081902080546001600160a01b0319169055517efa112e0c05e3b86d5a0cfa46bcc87ad949adcbc84a5d02e510c236f19e2140906103ae9085908590610611565b60405180910390a1505050565b6103c3610470565b6103cc5f61049c565b565b5f82826040516020016103e292919061063f565b60405160208183030381529060405280519060200120905092915050565b610408610470565b6001600160a01b03811661043657604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61043f8161049c565b50565b5f60015f61045085856103ce565b815260208101919091526040015f20546001600160a01b03169392505050565b5f546001600160a01b031633146103cc5760405163118cdaa760e01b815233600482015260240161042d565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f5f83601f8401126104fb575f5ffd5b50813567ffffffffffffffff811115610512575f5ffd5b602083019150836020828501011115610529575f5ffd5b9250929050565b80356001600160a01b0381168114610546575f5ffd5b919050565b5f5f5f6040848603121561055d575f5ffd5b833567ffffffffffffffff811115610573575f5ffd5b61057f868287016104eb565b9094509250610592905060208501610530565b90509250925092565b5f5f602083850312156105ac575f5ffd5b823567ffffffffffffffff8111156105c2575f5ffd5b6105ce858286016104eb565b90969095509350505050565b5f602082840312156105ea575f5ffd5b5035919050565b5f60208284031215610601575f5ffd5b61060a82610530565b9392505050565b60208152816020820152818360408301375f818301604090810191909152601f909201601f19160101919050565b818382375f910190815291905056fea2646970667358221220848103b78a1bdb51b76e92bb1cfb38d1af43c0336b4f4a33b1a0aa54397b7d8b64736f6c634300081c0033
Deployed Bytecode
0x608060405234801561000f575f5ffd5b5060043610610090575f3560e01c806388ecdb2f1161006357806388ecdb2f146100d75780638da5cb5b146100fd578063e94368b314610121578063f2fde38b14610149578063fe2cbfa81461015c575f5ffd5b80631e59c529146100945780632cff89c9146100a95780636598a1ae146100bc578063715018a6146100cf575b5f5ffd5b6100a76100a236600461054b565b61016f565b005b6100a76100b736600461054b565b61024b565b6100a76100ca36600461059b565b610318565b6100a76103bb565b6100ea6100e536600461059b565b6103ce565b6040519081526020015b60405180910390f35b5f546001600160a01b03165b6040516001600160a01b0390911681526020016100f4565b61010961012f3660046105da565b5f908152600160205260409020546001600160a01b031690565b6100a76101573660046105f1565b610400565b61010961016a36600461059b565b610442565b610177610470565b5f61018284846103ce565b5f818152600160205260409020549091506001600160a01b0316156101ba5760405163070ee79760e31b815260040160405180910390fd5b6001600160a01b0382166101e157604051639fabe1c160e01b815260040160405180910390fd5b5f818152600160205260409081902080546001600160a01b0319166001600160a01b03851690811790915590517f5327935b8796b9614e833d16c9e90ccb2b33e41e5181f8af0308fba0373c1caf9061023d9087908790610611565b60405180910390a250505050565b610253610470565b5f61025e84846103ce565b5f818152600160205260409020549091506001600160a01b03166102955760405163513cc0b960e01b815260040160405180910390fd5b6001600160a01b0382166102bc57604051639fabe1c160e01b815260040160405180910390fd5b5f818152600160205260409081902080546001600160a01b0319166001600160a01b03851690811790915590517faa96e0e6f7c38ef3ea5679180dc8034becfee398a6d177ee2c175663f96340e69061023d9087908790610611565b610320610470565b5f61032b83836103ce565b5f818152600160205260409020549091506001600160a01b03166103625760405163513cc0b960e01b815260040160405180910390fd5b5f818152600160205260409081902080546001600160a01b0319169055517efa112e0c05e3b86d5a0cfa46bcc87ad949adcbc84a5d02e510c236f19e2140906103ae9085908590610611565b60405180910390a1505050565b6103c3610470565b6103cc5f61049c565b565b5f82826040516020016103e292919061063f565b60405160208183030381529060405280519060200120905092915050565b610408610470565b6001600160a01b03811661043657604051631e4fbdf760e01b81525f60048201526024015b60405180910390fd5b61043f8161049c565b50565b5f60015f61045085856103ce565b815260208101919091526040015f20546001600160a01b03169392505050565b5f546001600160a01b031633146103cc5760405163118cdaa760e01b815233600482015260240161042d565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f5f83601f8401126104fb575f5ffd5b50813567ffffffffffffffff811115610512575f5ffd5b602083019150836020828501011115610529575f5ffd5b9250929050565b80356001600160a01b0381168114610546575f5ffd5b919050565b5f5f5f6040848603121561055d575f5ffd5b833567ffffffffffffffff811115610573575f5ffd5b61057f868287016104eb565b9094509250610592905060208501610530565b90509250925092565b5f5f602083850312156105ac575f5ffd5b823567ffffffffffffffff8111156105c2575f5ffd5b6105ce858286016104eb565b90969095509350505050565b5f602082840312156105ea575f5ffd5b5035919050565b5f60208284031215610601575f5ffd5b61060a82610530565b9392505050565b60208152816020820152818360408301375f818301604090810191909152601f909201601f19160101919050565b818382375f910190815291905056fea2646970667358221220848103b78a1bdb51b76e92bb1cfb38d1af43c0336b4f4a33b1a0aa54397b7d8b64736f6c634300081c0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
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.