false
true
0
PulseChain
Blockchain
Blocks
Blocks
Uncles
Forked Blocks (Reorgs)
Transactions
Confirmed
Pending
Verified contracts
Tokens
All
PLS
APIs
GraphQL
RPC
Eth RPC
Apps
PulseChain Beacon Explorer
PulseX
PulseChain Bridge
Become a Validator
PulseChain
Mainnets
PulseChain Mainnet
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: MIT pragma solidity ^0.8.20; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; /** * @title PlaygroundToken * @dev ERC20 token with wrap/unwrap functionality using parent tokens * @notice Users can wrap parent tokens to receive PlaygroundTokens (burn function) * and unwrap PlaygroundTokens to get back parent tokens (claim function) */ contract PlaygroundToken is ERC20, Ownable, ReentrancyGuard { using SafeERC20 for IERC20; /// @dev Parent token address used for wrapping/unwrapping address public parent; /// @dev Token description string public description; /// @dev Maximum supply cap (immutable) uint256 public immutable maxSupply; /// @dev Factory address that can mint tokens (immutable) address public immutable factory; /** * @dev Constructor * @param name ERC20 token name * @param symbol ERC20 token symbol * @param factoryAddress Factory contract address (for minting access control) * @param parentToken Parent token address for wrapping/unwrapping * @param tokenDescription Token description * @param maxTokenSupply Maximum supply cap (must be >= 1 billion tokens) */ constructor( string memory name, string memory symbol, address factoryAddress, address parentToken, string memory tokenDescription, uint256 maxTokenSupply ) ERC20(name, symbol) Ownable(msg.sender) { require(parentToken != address(0), "PlaygroundToken: parent token cannot be zero address"); require( maxTokenSupply >= 1_000_000_000 * 10**18, "PlaygroundToken: maxSupply must be at least 1 billion tokens" ); parent = parentToken; description = tokenDescription; maxSupply = maxTokenSupply; factory = factoryAddress; } /** * @dev Wrap parent tokens into PlaygroundTokens * @notice Transfers parent tokens from user and mints PlaygroundTokens * @param amount Amount of parent tokens to wrap */ function burn(uint256 amount) external { require(amount > 0, "PlaygroundToken: amount must be greater than zero"); // Transfer parent tokens from user to this contract IERC20(parent).safeTransferFrom(msg.sender, address(this), amount); // Check max supply constraint require( totalSupply() + amount <= maxSupply, "PlaygroundToken: would exceed max supply" ); // Mint PlaygroundTokens to user _mint(msg.sender, amount); } /** * @dev Unwrap PlaygroundTokens back to parent tokens * @notice Burns PlaygroundTokens and transfers parent tokens to user * @param amount Amount of PlaygroundTokens to unwrap */ function claim(uint256 amount) external nonReentrant { require(amount > 0, "PlaygroundToken: amount must be greater than zero"); // Burn PlaygroundTokens from user _burn(msg.sender, amount); // Transfer parent tokens from contract to user IERC20(parent).safeTransfer(msg.sender, amount); } /** * @dev Mint tokens (only callable by factory) * @notice Used by factory during token creation and for future minting logic * @param to Address to mint tokens to * @param amount Amount of tokens to mint */ function mint(address to, uint256 amount) external { require(msg.sender == factory, "PlaygroundToken: only factory can mint"); require(amount > 0, "PlaygroundToken: amount must be greater than zero"); require( totalSupply() + amount <= maxSupply, "PlaygroundToken: would exceed max supply" ); _mint(to, amount); } }
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)
00000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000abef2874c5ef165fc2194c180e06894871724b05000000000000000000000000f6703dbff070f231eed966d33b1b6d7ef5207d2600000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000033b2e3c9fd0803ce8000000000000000000000000000000000000000000000000000000000000000000001363c3986578697374656e63652073746576656e00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000343c398000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000824c6574277320736565207768617420746865205a4552c3982066616d2063616e20646f20776974682074686520506c617967726f756e6473202d206c657427732073686f772074686520776f726c6420746865206d65616e696e67206f662022576f726b696e6720546f67657468657220746f2057696e20546f6765746865722122000000000000000000000000000000000000000000000000000000000000
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