false
true
0
PulseChain Testnet v4
Blockchain
Blocks
Blocks
Uncles
Forked Blocks (Reorgs)
Transactions
Confirmed
Pending
Verified contracts
Tokens
All
tPLS
APIs
GraphQL
RPC
Eth RPC
Apps
Testnet V4 Beacon Explorer
PulseX
PulseChain Bridge
Testnet V4 Faucet
Become a Validator
PulseChain
Testnets
Testnet V4
/
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: UNLICENSED pragma solidity ^0.8.7; pragma abicoder v2; // OpenZeppelin v4 import { StorageSlot } from "@openzeppelin/contracts/utils/StorageSlot.sol"; import { Address } from "@openzeppelin/contracts/utils/Address.sol"; /** * @title PausableUpgradableProxy * @author Railgun Contributors * @notice Delegates calls to implementation address * @dev Calls are reverted if the contract is paused */ contract PausableUpgradableProxy { // Storage slot locations bytes32 private constant IMPLEMENTATION_SLOT = bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1); bytes32 private constant ADMIN_SLOT = bytes32(uint256(keccak256("eip1967.proxy.admin")) - 1); bytes32 private constant PAUSED_SLOT = bytes32(uint256(keccak256("eip1967.proxy.paused")) - 1); // Events event ProxyUpgrade(address previousImplementation, address newImplementation); event ProxyOwnershipTransfer(address previousOwner, address newOwner); event ProxyPause(); event ProxyUnpause(); /** * @notice Sets initial specified admin value * Implementation is set as 0x0 and contract is created as paused * @dev Implementation must be set before unpausing */ constructor(address _admin) { // Set initial value for admin StorageSlot.getAddressSlot(ADMIN_SLOT).value = _admin; // Explicitly initialize implementation as 0 StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value = address(0); // Explicitly initialize as paused StorageSlot.getBooleanSlot(PAUSED_SLOT).value = true; } /** * @notice Reverts if proxy is paused */ modifier notPaused() { // Revert if the contract is paused require(!StorageSlot.getBooleanSlot(PAUSED_SLOT).value, "Proxy: Contract is paused"); _; } /** * @notice Delegates call to implementation */ function delegate() internal notPaused { // Get implementation address implementation = StorageSlot.getAddressSlot(IMPLEMENTATION_SLOT).value; // Check that implementation exists require(Address.isContract(implementation), "Proxy: Implementation doesn't exist"); // solhint-disable-next-line no-inline-assembly 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(), implementation, 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()) } } } /** * @notice Prevents calls unless caller is owner * @dev This should be on all external/public functions that aren't the fallback */ modifier onlyOwner() { if (msg.sender == StorageSlot.getAddressSlot(ADMIN_SLOT).value) { _; } else { // Redirect to delegate if caller isn't owner delegate(); } } /** * @notice fallback function that delegates calls with calldata */ fallback() external payable { delegate(); } /** * @notice fallback function that delegates calls with no calldata */ receive() external payable { delegate(); } /** * @notice Transfers ownership to new address * @param _newOwner - Address to transfer ownership to */ function transferOwnership(address _newOwner) external onlyOwner { require(_newOwner != address(0), "Proxy: Preventing potential accidental burn"); // Get admin slot StorageSlot.AddressSlot storage admin = StorageSlot.getAddressSlot(ADMIN_SLOT); // Emit event emit ProxyOwnershipTransfer(admin.value, _newOwner); // Store new admin admin.value = _newOwner; } /** * @notice Upgrades implementation * @param _newImplementation - Address of the new implementation */ function upgrade(address _newImplementation) external onlyOwner { // Get implementation slot StorageSlot.AddressSlot storage implementation = StorageSlot.getAddressSlot( IMPLEMENTATION_SLOT ); // If new implementation is identical to old, skip if (implementation.value != _newImplementation) { // Emit event emit ProxyUpgrade(implementation.value, _newImplementation); // Store new implementation implementation.value = _newImplementation; } } /** * @notice Pauses contract */ function pause() external onlyOwner { // Get paused slot StorageSlot.BooleanSlot storage paused = StorageSlot.getBooleanSlot(PAUSED_SLOT); // If not already paused, pause if (!paused.value) { // Set paused to true paused.value = true; // Emit paused event emit ProxyPause(); } } /** * @notice Unpauses contract */ function unpause() external onlyOwner { // Get paused slot StorageSlot.BooleanSlot storage paused = StorageSlot.getBooleanSlot(PAUSED_SLOT); // If already unpaused, do nothing if (paused.value) { // Set paused to true paused.value = false; // Emit paused event emit ProxyUnpause(); } } }
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)
0x000000000000000000000000cf1696cb7ba72b76e624190916ad6fbf769e7cbe
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