Address Contract Verified
Address
0x643C4E15d7d62Ad0aBeC4a9BD4b001aA3Ef52d66
Balance
0 ETH
Nonce
1
Code Size
1326 bytes
Creator
0x763aC43a...7882 at tx 0x501a85d2...f35a2c
Proxy
EIP-1967 Proxy Implementation: 0x6eD767EB...7aec
Indexed Transactions
0
Contract Bytecode
1326 bytes
0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063d784d426146100bc575b60006100356100cf565b9050806001600160a01b03163b6000036100965760405162461bcd60e51b815260206004820152601f60248201527f4d54503a463a4e4f5f434f44455f4f4e5f494d504c454d454e544154494f4e0060448201526064015b60405180910390fd5b3660008037600080366000845af43d6000803e8080156100b5573d6000f35b3d6000fd5b005b6100ba6100ca3660046103a2565b610108565b60006101036100ff60017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd6103c6565b5490565b905090565b600061011261035a565b9050806001600160a01b0316630c340a246040518163ffffffff1660e01b8152600401602060405180830381865afa158015610152573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061017691906103ed565b6001600160a01b0316336001600160a01b0316146101cc5760405162461bcd60e51b815260206004820152601360248201527226aa281d29a49d2727aa2fa3a7ab22a92727a960691b604482015260640161008d565b60405163fd4c5b3760e01b81526000906001600160a01b0383169063fd4c5b3790610201903390309086903690600401610433565b602060405180830381865afa15801561021e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102429190610489565b9050806102885760405162461bcd60e51b81526020600482015260146024820152731355140e94d24e9393d517d4d0d211511553115160621b604482015260640161008d565b604051635ad5b6f760e11b81526001600160a01b0383169063b5ab6dee906102b990339060009036906004016104ab565b600060405180830381600087803b1580156102d357600080fd5b505af11580156102e7573d6000803e3d6000fd5b50610321925061031c9150600190507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd6103c6565b849055565b6040516001600160a01b038416907fab64f92ab780ecbf4f3866f57cee465ff36c89450dcce20237ca7a8d81fb7d1390600090a2505050565b60006101036100ff60017ff4037508c8ed7f0e515b497cc593e8b40edb624ea4250275737be9ad17ecd7436103c6565b6001600160a01b038116811461039f57600080fd5b50565b6000602082840312156103b457600080fd5b81356103bf8161038a565b9392505050565b818103818111156103e757634e487b7160e01b600052601160045260246000fd5b92915050565b6000602082840312156103ff57600080fd5b81516103bf8161038a565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b038581168252841660208201527526aa281d29a2aa2fa4a6a82622a6a2a72a20aa24a7a760511b604082015260806060820181905260009061047f908301848661040a565b9695505050505050565b60006020828403121561049b57600080fd5b815180151581146103bf57600080fd5b6001600160a01b03841681527526aa281d29a2aa2fa4a6a82622a6a2a72a20aa24a7a760511b60208201526060604082018190526000906104ef908301848661040a565b9594505050505056fea2646970667358221220ea6d23136d2ab9eb69ba68aeb539a855c1335cbc8e3b677b90c52cf474053cdb64736f6c63430008120033
Verified Source Code Full Match
Compiler: v0.8.18+commit.87f61d96
EVM: paris
Optimization: Yes (200 runs)
MapleTokenProxy.sol 99 lines
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.18;
import { IMapleTokenInitializerLike, IGlobalsLike } from "./interfaces/Interfaces.sol";
import { IMapleTokenProxy } from "./interfaces/IMapleTokenProxy.sol";
contract MapleTokenProxy is IMapleTokenProxy {
bytes32 internal constant GLOBALS_SLOT = bytes32(uint256(keccak256("eip1967.proxy.globals")) - 1);
bytes32 internal constant IMPLEMENTATION_SLOT = bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1);
constructor(address globals_, address implementation_, address initializer_, address tokenMigrator_) {
_setAddress(GLOBALS_SLOT, globals_);
_setAddress(IMPLEMENTATION_SLOT, implementation_);
( bool success_, ) = initializer_.delegatecall(abi.encodeWithSelector(
IMapleTokenInitializerLike(initializer_).initialize.selector,
tokenMigrator_,
IGlobalsLike(globals_).mapleTreasury()
));
require(success_, "MTP:INIT_FAILED");
}
/**************************************************************************************************************************************/
/*** Overridden Functions ***/
/**************************************************************************************************************************************/
function setImplementation(address newImplementation_) override external {
IGlobalsLike globals_ = IGlobalsLike(_globals());
require(msg.sender == globals_.governor(), "MTP:SI:NOT_GOVERNOR");
bool isScheduledCall_ = globals_.isValidScheduledCall(msg.sender, address(this), "MTP:SET_IMPLEMENTATION", msg.data);
require(isScheduledCall_, "MTP:SI:NOT_SCHEDULED");
globals_.unscheduleCall(msg.sender, "MTP:SET_IMPLEMENTATION", msg.data);
_setAddress(IMPLEMENTATION_SLOT, newImplementation_);
emit ImplementationSet(newImplementation_);
}
/**************************************************************************************************************************************/
/*** View Functions ***/
/**************************************************************************************************************************************/
function _globals() internal view returns (address globals_) {
globals_ = _getAddress(GLOBALS_SLOT);
}
function _implementation() internal view returns (address implementation_) {
implementation_ = _getAddress(IMPLEMENTATION_SLOT);
}
/**************************************************************************************************************************************/
/*** Utility Functions ***/
/**************************************************************************************************************************************/
function _setAddress(bytes32 slot_, address value_) internal {
assembly {
sstore(slot_, value_)
}
}
function _getAddress(bytes32 slot_) internal view returns (address value_) {
assembly {
value_ := sload(slot_)
}
}
/**************************************************************************************************************************************/
/*** Fallback Function ***/
/**************************************************************************************************************************************/
fallback() external {
address implementation_ = _implementation();
require(implementation_.code.length != 0, "MTP:F:NO_CODE_ON_IMPLEMENTATION");
assembly {
calldatacopy(0, 0, calldatasize())
let result := delegatecall(gas(), implementation_, 0, calldatasize(), 0, 0)
returndatacopy(0, 0, returndatasize())
switch result
case 0 {
revert(0, returndatasize())
}
default {
return(0, returndatasize())
}
}
}
}
Interfaces.sol 43 lines
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.18;
interface IERC20Like {
function burn(address from, uint256 value) external;
function mint(address to, uint256 value) external;
function totalSupply() external view returns (uint256 totalSupply);
}
interface IGlobalsLike {
function governor() external view returns (address governor);
function isInstanceOf(bytes32 instanceKey, address instance) external view returns (bool isInstance);
function isValidScheduledCall(
address caller,
address target,
bytes32 functionId,
bytes calldata callData
) external view returns (bool isValidScheduledCall);
function mapleTreasury() external view returns (address mapleTreasury);
function unscheduleCall(address caller, bytes32 functionId, bytes calldata callData) external;
}
interface IMapleTokenInitializerLike {
function initialize(address migrator, address treasury) external;
}
interface IMapleTokenLike is IERC20Like {
function globals() external view returns (address globals);
}
IMapleTokenProxy.sol 18 lines
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.18;
interface IMapleTokenProxy {
/**
* @dev Emitted when the implementation address is set.
* @param implementation The address of the new implementation.
*/
event ImplementationSet(address indexed implementation);
/**
* @dev Sets the implementation address.
* @param newImplementation The address to set the implementation to.
*/
function setImplementation(address newImplementation) external;
}
Write Contract 1 functions
These functions modify contract state and require a wallet transaction to execute.
setImplementation 0xd784d426
address newImplementation_
Token Balances (1)
View Transfers →Recent Transactions
No transactions found for this address