false
false
Blockchain
Blocks
Blocks
Uncles
Forked Blocks (Reorgs)
Transactions
Validated
Pending
Verified contracts
Tokens
All
KCS
APIs
GraphQL
RPC
Eth RPC
/
Search
/
Search
Connection Lost
New Solidity Smart Contract Verification
Contract Address
The 0x address supplied on contract creation.
Is Yul contract
No
Yes
Select Yes if you want to verify Yul contract.
Contract Name
Must match the name specified in the code. For example, in
contract MyContract {..}
MyContract
is the contract name.
Include nightly builds
No
Yes
Select yes if you want to show nightly builds.
Compiler
The compiler version is specified in
pragma solidity X.X.X
. Use the compiler version rather than the nightly build. If using the Solidity compiler, run
solc —version
to check.
EVM Version
homestead
tangerineWhistle
spuriousDragon
byzantium
constantinople
petersburg
istanbul
berlin
london
paris
shanghai
default
The EVM version the contract is written for. If the bytecode does not match the version, we try to verify using the latest EVM version.
EVM version details
.
Optimization
No
Yes
If you enabled optimization during compilation, select yes.
Optimization runs
Enter the Solidity Contract Code
// SPDX-License-Identifier: MIT pragma solidity ^0.7.0; interface OwnableInterface { function owner() external returns (address); function transferOwnership(address recipient) external; function acceptOwnership() external; } // File contracts/ConfirmedOwnerWithProposal.sol /** * @title The ConfirmedOwner contract * @notice A contract with helpers for basic contract ownership. */ contract ConfirmedOwnerWithProposal is OwnableInterface { address private s_owner; address private s_pendingOwner; event OwnershipTransferRequested(address indexed from, address indexed to); event OwnershipTransferred(address indexed from, address indexed to); constructor(address newOwner, address pendingOwner) { require(newOwner != address(0), "Cannot set owner to zero"); s_owner = newOwner; if (pendingOwner != address(0)) { _transferOwnership(pendingOwner); } } /** * @notice Allows an owner to begin transferring ownership to a new address, * pending. */ function transferOwnership(address to) public override onlyOwner { _transferOwnership(to); } /** * @notice Allows an ownership transfer to be completed by the recipient. */ function acceptOwnership() external override { require(msg.sender == s_pendingOwner, "Must be proposed owner"); address oldOwner = s_owner; s_owner = msg.sender; s_pendingOwner = address(0); emit OwnershipTransferred(oldOwner, msg.sender); } /** * @notice Get the current owner */ function owner() public view override returns (address) { return s_owner; } /** * @notice validate, transfer ownership, and emit relevant events */ function _transferOwnership(address to) private { require(to != msg.sender, "Cannot transfer to self"); s_pendingOwner = to; emit OwnershipTransferRequested(s_owner, to); } /** * @notice validate access */ function _validateOwnership() internal view { require(msg.sender == s_owner, "Only callable by owner"); } /** * @notice Reverts if called by anyone other than the contract owner. */ modifier onlyOwner() { _validateOwnership(); _; } } // File contracts/ConfirmedOwner.sol /** * @title The ConfirmedOwner contract * @notice A contract with helpers for basic contract ownership. */ contract ConfirmedOwner is ConfirmedOwnerWithProposal { constructor(address newOwner) ConfirmedOwnerWithProposal(newOwner, address(0)) {} } // File contracts/interfaces/IMojitoOracle.sol interface IMojitoOracle { function getMojitoTwap(bytes32 pairId) external view returns (uint256); function currencyPairId(string memory) external view returns (bytes32); function lookupERC2362ID(bytes32 _erc2362id) external view returns (string memory _caption); } // File contracts/mojito/MojitoOracleProxy.sol contract MojitoOracleProxy is IMojitoOracle, ConfirmedOwner { IMojitoOracle private s_currentMojitoOracle; IMojitoOracle private s_proposedMojitoOracle; event MojitoOracleProposed(address indexed current, address indexed proposed); event MojitoOracleConfirmed(address indexed previous, address indexed latest); constructor(address mojitoOracleAddress) ConfirmedOwner(msg.sender) { setMojitoOracle(mojitoOracleAddress); } function setMojitoOracle(address mojitoOracleAddress) internal { s_currentMojitoOracle = IMojitoOracle(mojitoOracleAddress); } function getMojitoTwap(bytes32 pairId) external view override returns (uint256) { return s_currentMojitoOracle.getMojitoTwap(pairId); } /** * @notice returns the current mojito oracle address. */ function mojitoOracle() external view returns (address) { return address(s_currentMojitoOracle); } /** * @notice returns the current proposed mojito oracle */ function proposedMojitoOracle() external view returns (address) { return address(s_proposedMojitoOracle); } /** * @notice Allows the owner to propose a new address for the mojito oracle * @param mojitoOracleAddress The new address for the mojito oracle contract */ function proposeMojitoOracle(address mojitoOracleAddress) external onlyOwner { s_proposedMojitoOracle = IMojitoOracle(mojitoOracleAddress); emit MojitoOracleProposed(address(s_currentMojitoOracle), mojitoOracleAddress); } /** * @notice Allows the owner to confirm and change the address * to the proposed mojito oracle * @dev Reverts if the given address doesn't match what was previously * proposed * @param mojitoOracleAddress The new address for the mojito oracle contract */ function confirmMojitoOracle(address mojitoOracleAddress) external onlyOwner { require(mojitoOracleAddress == address(s_proposedMojitoOracle), "Invalid proposed mojito oracle"); address previousMojitoOracle = address(s_currentMojitoOracle); delete s_proposedMojitoOracle; setMojitoOracle(mojitoOracleAddress); emit MojitoOracleConfirmed(previousMojitoOracle, mojitoOracleAddress); } function proposedGetMojitoTwap(bytes32 pairId) external view hasProposal returns (uint256) { return s_proposedMojitoOracle.getMojitoTwap(pairId); } function currencyPairId(string memory _caption) external view override returns (bytes32) { return s_currentMojitoOracle.currencyPairId(_caption); } function lookupERC2362ID(bytes32 pairId) external view override returns (string memory _caption) { return s_currentMojitoOracle.lookupERC2362ID(pairId); } /* * Modifiers */ modifier hasProposal() { require(address(s_proposedMojitoOracle) != address(0), "No proposed mojito oracle present"); _; } }
We recommend using flattened code. This is necessary if your code utilizes a library or inherits dependencies. Use the
POA solidity flattener or the
truffle flattener
.
Try to fetch constructor arguments automatically
No
Yes
ABI-encoded Constructor Arguments (if required by the contract)
0000000000000000000000001f57afc1eb83e8b0f12aeb4c88b902a2da5cf9e8
Add arguments in
ABI hex encoded form
. Constructor arguments are written right to left, and will be found at the end of the input created bytecode. They may also be
parsed here.
Add Contract Libraries
Contract Libraries
Library 1 Name
A library name called in the .sol file. Multiple libraries (up to 10) may be added for each contract. Click the Add Library button to add an additional one.
Library 1 Address
The 0x library address. This can be found in the generated json file or Truffle output (if using truffle).
Library 2 Name
Library 2 Address
Library 3 Name
Library 3 Address
Library 4 Name
Library 4 Address
Library 5 Name
Library 5 Address
Library 6 Name
Library 6 Address
Library 7 Name
Library 7 Address
Library 8 Name
Library 8 Address
Library 9 Name
Library 9 Address
Library 10 Name
Library 10 Address
Add Library
Loading...
Verify & publish
Cancel
Ok
Ok
Ok
No
Yes