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 { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; /** * @title Delegator * @author Railgun Contributors * @notice 'Owner' contract for all railgun contracts * delegates permissions to other contracts (voter, role) */ contract Delegator is Ownable { /* Mapping structure is calling address => contract => function signature 0 is used as a wildcard, so permission for contract 0 is permission for any contract, and permission for function signature 0 is permission for any function. Comments below use * to signify wildcard and . notation to separate address/contract/function. caller.*.* allows caller to call any function on any contract caller.X.* allows caller to call any function on contract X caller.*.Y allows caller to call function Y on any contract */ mapping(address => mapping(address => mapping(bytes4 => bool))) public permissions; event GrantPermission( address indexed caller, address indexed contractAddress, bytes4 indexed selector ); event RevokePermission( address indexed caller, address indexed contractAddress, bytes4 indexed selector ); /** * @notice Sets initial admin */ constructor(address _admin) { Ownable.transferOwnership(_admin); } /** * @notice Sets permission bit * @dev See comment on permissions mapping for wildcard format * @param _caller - caller to set permissions for * @param _contract - contract to set permissions for * @param _selector - selector to set permissions for * @param _permission - permission bit to set */ function setPermission( address _caller, address _contract, bytes4 _selector, bool _permission ) public onlyOwner { // If permission set is different to new permission then we execute, otherwise skip if (permissions[_caller][_contract][_selector] != _permission) { // Set permission bit permissions[_caller][_contract][_selector] = _permission; // Emit event if (_permission) { emit GrantPermission(_caller, _contract, _selector); } else { emit RevokePermission(_caller, _contract, _selector); } } } /** * @notice Checks if caller has permission to execute function * @param _caller - caller to check permissions for * @param _contract - contract to check * @param _selector - function signature to check * @return if caller has permission */ function checkPermission( address _caller, address _contract, bytes4 _selector ) public view returns (bool) { /* See comment on permissions mapping for structure Comments below use * to signify wildcard and . notation to separate contract/function */ return (_caller == Ownable.owner() || permissions[_caller][_contract][_selector] || // Owner always has global permissions permissions[_caller][_contract][0x0] || // Permission for function is given permissions[_caller][address(0)][_selector] || // Permission for _contract.* is given permissions[_caller][address(0)][0x0]); // Global permission is given } /** * @notice Calls function * @dev calls to functions on this contract are intercepted and run directly * this is so the voting contract doesn't need to have special cases for calling * functions other than this one. * @param _contract - contract to call * @param _data - calldata to pass to contract * @return success - whether call succeeded * @return returnData - return data from function call */ function callContract( address _contract, bytes calldata _data, uint256 _value ) public returns (bool success, bytes memory returnData) { // Get selector bytes4 selector = bytes4(_data); // Intercept calls to this contract if (_contract == address(this)) { if (selector == this.setPermission.selector) { // Decode call data (address caller, address calledContract, bytes4 _permissionSelector, bool permission) = abi .decode(abi.encodePacked(_data[4:]), (address, address, bytes4, bool)); // Call setPermission setPermission(caller, calledContract, _permissionSelector, permission); // Return success with empty ReturnData bytes bytes memory empty; return (true, empty); } else if (selector == this.transferOwnership.selector) { // Decode call data address newOwner = abi.decode(abi.encodePacked(_data[4:]), (address)); // Call transferOwnership Ownable.transferOwnership(newOwner); // Return success with empty ReturnData bytes bytes memory empty; return (true, empty); } else if (selector == this.renounceOwnership.selector) { // Call renounceOwnership Ownable.renounceOwnership(); // Return success with empty ReturnData bytes bytes memory empty; return (true, empty); } else { // Return failed with empty ReturnData bytes bytes memory empty; return (false, empty); } } // Check permissions require( checkPermission(msg.sender, _contract, selector), "Delegator: Caller doesn't have permission" ); // Call external contract and return // solhint-disable-next-line avoid-low-level-calls return _contract.call{ value: _value }(_data); } }
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)
0x000000000000000000000000b94333ca4de54f79b24294582471c9c336acb7c0
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