Address Contract Verified
Address
0xB0B195aEFA3650A6908f15CdaC7D92F8a5791B0B
Balance
0 ETH
Nonce
1
Code Size
1436 bytes
Creator
0xce0042B8...cf9f at tx 0x0e8ff46c...350594
Proxy
EIP-1967 Proxy Implementation: 0x4BF3C45E...5505
Indexed Transactions
0
Contract Bytecode
1436 bytes
0x60806040526004361061004a5760003560e01c80633659cfe61461009d5780634f1ef286146100bd5780635c60da1b146100d0578063704b6c021461010a578063f851a4401461012a575b60006100626000805160206105478339815191525490565b90506001600160a01b03811661007757600080fd5b3660008037600080366000845af43d6000803e808015610096573d6000f35b3d6000fd5b005b3480156100a957600080fd5b5061009b6100b836600461043a565b61013f565b61009b6100cb36600461045c565b610194565b3480156100dc57600080fd5b50600080516020610547833981519152545b6040516001600160a01b03909116815260200160405180910390f35b34801561011657600080fd5b5061009b61012536600461043a565b610293565b34801561013657600080fd5b506100ee6102dc565b600080516020610527833981519152546001600160a01b0316336001600160a01b0316146101885760405162461bcd60e51b815260040161017f906104df565b60405180910390fd5b610191816102f9565b50565b600080516020610527833981519152546001600160a01b0316336001600160a01b0316146101d45760405162461bcd60e51b815260040161017f906104df565b6101dd836102f9565b6000306001600160a01b03163484846040516101fa929190610516565b60006040518083038185875af1925050503d8060008114610237576040519150601f19603f3d011682016040523d82523d6000602084013e61023c565b606091505b505090508061028d5760405162461bcd60e51b815260206004820181905260248201527f4549503139363750726f78793a207570646174652063616c6c206661696c6564604482015260640161017f565b50505050565b600080516020610527833981519152546001600160a01b0316336001600160a01b0316146102d35760405162461bcd60e51b815260040161017f906104df565b61019181610388565b60006102f46000805160206105278339815191525490565b905090565b6001600160a01b03811661030c57600080fd5b806001600160a01b031661032c6000805160206105478339815191525490565b6001600160a01b03160361033f57600080fd5b6000805160206105478339815191528190556040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60006103926102dc565b90506001600160a01b0382166103a757600080fd5b816001600160a01b0316816001600160a01b0316036103c557600080fd5b600080516020610527833981519152829055604080516001600160a01b038084168252841660208201527f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f910160405180910390a15050565b80356001600160a01b038116811461043557600080fd5b919050565b60006020828403121561044c57600080fd5b6104558261041e565b9392505050565b60008060006040848603121561047157600080fd5b61047a8461041e565b9250602084013567ffffffffffffffff8082111561049757600080fd5b818601915086601f8301126104ab57600080fd5b8135818111156104ba57600080fd5b8760208285010111156104cc57600080fd5b6020830194508093505050509250925092565b6020808252601a908201527f4549503139363741646d696e3a206e6f7420616e2061646d696e000000000000604082015260600190565b818382376000910190815291905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbca26469706673582212203a120e4dd5f0849a0b6e92c874b8ff4e42363c90d20d52f4cac638a68ae33dcb64736f6c634300080f0033
Verified Source Code Full Match
Compiler: v0.8.15+commit.e14f2714
EVM: london
Optimization: Yes (200 runs)
EIP1967Admin.sol 24 lines
// SPDX-License-Identifier: CC0-1.0
pragma solidity 0.8.15;
/**
* @title EIP1967Admin
* @dev Upgradeable proxy pattern implementation according to minimalistic EIP1967.
*/
contract EIP1967Admin {
// EIP 1967
// bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1)
uint256 internal constant EIP1967_ADMIN_STORAGE = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
modifier onlyAdmin() {
require(msg.sender == _admin(), "EIP1967Admin: not an admin");
_;
}
function _admin() internal view returns (address res) {
assembly {
res := sload(EIP1967_ADMIN_STORAGE)
}
}
}
EIP1967Proxy.sol 133 lines
// SPDX-License-Identifier: CC0-1.0
pragma solidity 0.8.15;
import "./EIP1967Admin.sol";
/**
* @title EIP1967Proxy
* @dev Upgradeable proxy pattern implementation according to minimalistic EIP1967.
*/
contract EIP1967Proxy is EIP1967Admin {
// EIP 1967
// bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1)
uint256 internal constant EIP1967_IMPLEMENTATION_STORAGE =
0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
event Upgraded(address indexed implementation);
event AdminChanged(address previousAdmin, address newAdmin);
constructor(address _admin, address _implementation, bytes memory _data) payable {
_setAdmin(_admin);
_setImplementation(_implementation);
if (_data.length > 0) {
bool status;
assembly {
status := callcode(gas(), _implementation, callvalue(), add(_data, 32), mload(_data), 0, 0)
}
require(status, "EIP1967Proxy: initialize call failed");
}
}
/**
* @dev Tells the proxy admin account address.
* @return proxy admin address.
*/
function admin() public view returns (address) {
return _admin();
}
/**
* @dev Tells the proxy implementation contract address.
* @return res implementation address.
*/
function implementation() public view returns (address res) {
assembly {
res := sload(EIP1967_IMPLEMENTATION_STORAGE)
}
}
/**
* @dev Updates address of the proxy owner.
* Callable only by the proxy admin.
* @param _admin address of the new proxy admin.
*/
function setAdmin(address _admin) external onlyAdmin {
_setAdmin(_admin);
}
/**
* @dev Updates proxy implementation address.
* Callable only by the proxy admin.
* @param _implementation address of the new proxy implementation.
*/
function upgradeTo(address _implementation) external onlyAdmin {
_setImplementation(_implementation);
}
/**
* @dev Updates proxy implementation address and makes an initialization call to new implementation.
* Callable only by the proxy admin.
* @param _implementation address of the new proxy implementation.
* @param _data calldata to pass through the new implementation after the upgrade.
*/
function upgradeToAndCall(address _implementation, bytes calldata _data) external payable onlyAdmin {
_setImplementation(_implementation);
(bool status,) = address(this).call{value: msg.value}(_data);
require(status, "EIP1967Proxy: update call failed");
}
/**
* @dev Fallback function allowing to perform a delegatecall to the given implementation.
* This function will return whatever the implementation call returns
*/
fallback() external payable {
address impl = implementation();
require(impl != address(0));
assembly {
// Copy msg.data. We take full control of memory in this inline assembly
// block because it will not return to Solidity code. We overwrite the
// Solidity scratch pad at memory position 0.
calldatacopy(0, 0, calldatasize())
// Call the implementation.
// out and outsize are 0 because we don't know the size yet.
let result := delegatecall(gas(), impl, 0, calldatasize(), 0, 0)
// Copy the returned data.
returndatacopy(0, 0, returndatasize())
switch result
// delegatecall returns 0 on error.
case 0 { revert(0, returndatasize()) }
default { return(0, returndatasize()) }
}
}
/**
* @dev Internal function for transfer current admin rights to a different account.
* @param _admin address of the new administrator.
*/
function _setAdmin(address _admin) internal {
address previousAdmin = admin();
require(_admin != address(0));
require(previousAdmin != _admin);
assembly {
sstore(EIP1967_ADMIN_STORAGE, _admin)
}
emit AdminChanged(previousAdmin, _admin);
}
/**
* @dev Internal function for setting a new implementation address.
* @param _implementation address of the new implementation contract.
*/
function _setImplementation(address _implementation) internal {
require(_implementation != address(0));
require(implementation() != _implementation);
assembly {
sstore(EIP1967_IMPLEMENTATION_STORAGE, _implementation)
}
emit Upgraded(_implementation);
}
}
Read Contract
admin 0xf851a440 → address
implementation 0x5c60da1b → address
Write Contract 3 functions
These functions modify contract state and require a wallet transaction to execute.
setAdmin 0x704b6c02
address _admin
upgradeTo 0x3659cfe6
address _implementation
upgradeToAndCall 0x4f1ef286
address _implementation
bytes _data
Recent Transactions
No transactions found for this address