Address Contract Verified
Address
0x35D173cdfE4d484BC5985fDa55FABad5892c7B82
Balance
1240.82 ETH
Nonce
1
Code Size
797 bytes
Creator
0x344A908d...6dE9 at tx 0x88b927f1...9ab1b8
Proxy
EIP-1967 Proxy Implementation: 0xa9B4AB2E...Ee3c
Indexed Transactions
1 (24,447,623 → 24,447,623)
Value (indexed)
↓ 0.024000 ETH
Gas Used (indexed)
71,468
Contract Bytecode
797 bytes
0x60806040526004361015610018575b366102a4576102a4565b6000803560e01c908163439fab911461006b575080635a99719e1461006657806382e7a14c14610061578063c3f596871461005c5763f00e6a2a0361000e576101fc565b610188565b61014d565b6100de565b346100d75760203660031901126100d75760043567ffffffffffffffff8082116100da57366023830112156100da5781600401359081116100da57369101602401116100d75762461bcd60e51b6080526020608452600560a45264696e69313160d81b60c45260646080fd5b80fd5b8280fd5b34610126576000366003190112610126577fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546040516001600160a01b039091168152602090f35b600080fd5b6020906003190112610126576004356001600160a01b03811681036101265790565b346101265761015b3661012b565b61016433610244565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55005b34610126576101963661012b565b61019f33610244565b6001600160a01b038116156101d2577fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355005b60405162461bcd60e51b81526020600482015260026024820152610c5960f21b6044820152606490fd5b34610126576000366003190112610126577f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546040516001600160a01b039091168152602090f35b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103546001600160a01b0390811691160361027a57565b60405162461bcd60e51b8152602060048201526002602482015261316360f01b6044820152606490fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5460008060405192368285378336915af4903d91826000833e156102e557f35bfdfea26469706673582212208b790aa68e3e9e957eef060249709f8a442c64e0d44f8699fe2c43d6eac73d3c64736f6c63430008120033
Verified Source Code Full Match
Compiler: v0.8.18+commit.87f61d96
EVM: paris
Optimization: Yes (200 runs)
Proxy.sol 98 lines
pragma solidity ^0.8.0;
// SPDX-License-Identifier: MIT OR Apache-2.0
import "./Ownable.sol";
import "./Upgradeable.sol";
import "./UpgradeableMaster.sol";
/// @title Proxy Contract
/// @dev NOTICE: Proxy must implement UpgradeableMaster interface to prevent calling some function of it not by master of proxy
/// @author Matter Labs
contract Proxy is Upgradeable, Ownable {
/// @dev Storage position of "target" (actual implementation address: keccak256('eip1967.proxy.implementation') - 1)
bytes32 private constant TARGET_POSITION = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
/// @notice Contract constructor
/// @dev Calls Ownable contract constructor and initialize target
/// @param target Initial implementation address
/// @param targetInitializationParameters Target initialization parameters
constructor(address target, bytes memory targetInitializationParameters) Ownable(msg.sender) {
setTarget(target);
// solhint-disable-next-line avoid-low-level-calls
(bool initializationSuccess, ) = getTarget().delegatecall(abi.encodeWithSignature("initialize(bytes)", targetInitializationParameters));
require(initializationSuccess, "uin11"); // uin11 - target initialization failed
}
/// @notice Intercepts initialization calls
function initialize(bytes calldata) external pure {
revert("ini11"); // ini11 - interception of initialization call
}
/// @notice Returns target of contract
/// @return target Actual implementation address
function getTarget() public view returns (address target) {
bytes32 position = TARGET_POSITION;
assembly {
target := sload(position)
}
}
/// @notice Sets new target of contract
/// @param _newTarget New actual implementation address
function setTarget(address _newTarget) internal {
bytes32 position = TARGET_POSITION;
assembly {
sstore(position, _newTarget)
}
}
/// @notice Upgrades target
/// @param newTarget New target
function upgradeTarget(address newTarget) external override {
requireMaster(msg.sender);
setTarget(newTarget);
}
/// @notice Performs a delegatecall to the contract implementation
/// @dev Fallback function allowing to perform a delegatecall to the given implementation
/// This function will return whatever the implementation call returns
function _fallback() internal {
address _target = getTarget();
assembly {
// The pointer to the free memory slot
let ptr := mload(0x40)
// Copy function signature and arguments from calldata at zero position into memory at pointer position
calldatacopy(ptr, 0x0, calldatasize())
// Delegatecall method of the implementation contract, returns 0 on error
let result := delegatecall(gas(), _target, ptr, calldatasize(), 0x0, 0)
// Get the size of the last return data
let size := returndatasize()
// Copy the size length of bytes from return data at zero position to pointer position
returndatacopy(ptr, 0x0, size)
// Depending on result value
switch result
case 0 {
// End execution and revert state changes
revert(ptr, size)
}
default {
// Return data with length of size at pointers position
return(ptr, size)
}
}
}
/// @notice Will run when no functions matches call data
fallback() external payable {
_fallback();
}
/// @notice Same as fallback but called when calldata is empty
receive() external payable {
_fallback();
}
}
Ownable.sol 51 lines
pragma solidity ^0.8.0;
// SPDX-License-Identifier: MIT OR Apache-2.0
/// @title Ownable Contract
/// @author Matter Labs
contract Ownable {
/// @dev Storage position of the masters address (keccak256('eip1967.proxy.admin') - 1)
bytes32 private constant MASTER_POSITION = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;
/// @notice Contract constructor
/// @dev Sets msg sender address as masters address
/// @param masterAddress Master address
constructor(address masterAddress) {
setMaster(masterAddress);
}
/// @notice Check if specified address is master
/// @param _address Address to check
function requireMaster(address _address) internal view {
require(_address == getMaster(), "1c"); // oro11 - only by master
}
/// @notice Returns contract masters address
/// @return master Master's address
function getMaster() public view returns (address master) {
bytes32 position = MASTER_POSITION;
assembly {
master := sload(position)
}
}
/// @dev Sets new masters address
/// @param _newMaster New master's address
function setMaster(address _newMaster) internal {
bytes32 position = MASTER_POSITION;
assembly {
sstore(position, _newMaster)
}
}
/// @notice Transfer mastership of the contract to new master
/// @param _newMaster New masters address
function transferMastership(address _newMaster) external {
requireMaster(msg.sender);
require(_newMaster != address(0), "1d"); // otp11 - new masters address can't be zero address
setMaster(_newMaster);
}
}
Upgradeable.sol 13 lines
pragma solidity ^0.8.0;
// SPDX-License-Identifier: MIT OR Apache-2.0
/// @title Interface of the upgradeable contract
/// @author Matter Labs
interface Upgradeable {
/// @notice Upgrades target of upgradeable contract
/// @param newTarget New target
function upgradeTarget(address newTarget) external;
}
UpgradeableMaster.sol 16 lines
pragma solidity ^0.8.0;
// SPDX-License-Identifier: MIT OR Apache-2.0
/// @title Interface of the upgradeable master contract (defines notice period duration and allows finish upgrade during preparation of it)
/// @author Matter Labs
interface UpgradeableMaster {
/// @notice Notice period before activation preparation status of upgrade mode
function getNoticePeriod() external returns (uint256);
/// @notice Checks that contract is ready for upgrade
/// @return bool flag indicating that contract is ready for upgrade
function isReadyForUpgrade() external returns (bool);
}
Read Contract
getMaster 0x5a99719e → address
getTarget 0xf00e6a2a → address
initialize 0x439fab91
Write Contract 2 functions
These functions modify contract state and require a wallet transaction to execute.
transferMastership 0xc3f59687
address _newMaster
upgradeTarget 0x82e7a14c
address newTarget
Top Interactions
| Address | Txns | Sent | Received |
|---|---|---|---|
| 0x10921Cbd...cC1c | 1 | 1 |
Token Balances (4)
View Transfers →Recent Transactions
|
| Hash | Block | Age | From/To | Value | |
|---|---|---|---|---|---|
| 0x3cdac9f1...38686b | 24,447,623 | IN | 0x10921Cbd...cC1c | 0.024000 ETH |