false
true
0

Contract Address Details

0x689F82b4078aA07F443af9ae308534bD2Ff545D3

Contract Name
RelayerRegistry
Creator
0xc3c7e0–8a5d11 at 0x6ff2e4–72873e
Balance
0 PLS ( )
Tokens
Fetching tokens...
Transactions
1 Transactions
Transfers
0 Transfers
Gas Used
28,530
Last Balance Update
25963622
Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
Contract name:
RelayerRegistry




Optimization enabled
true
Compiler version
v0.8.18+commit.87f61d96




Optimization runs
200
EVM Version
default




Verified at
2026-01-12T22:09:07.742021Z

contracts/registries/RelayerRegistry.sol

//SPDX-License-Identifier: MIT

import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { AddressArrayUtils } from "../external/AddressArrayUtils.sol";
import { IRelayerRegistry } from "../interfaces/IRelayerRegistry.sol";

pragma solidity ^0.8.18;

contract RelayerRegistry is Ownable, IRelayerRegistry {

    using AddressArrayUtils for address[];
    
    /* ============ Events ============ */
    event RelayerAdded(address indexed relayer);
    event RelayerRemoved(address indexed relayer);
    

    /* ============ State Variables ============ */
    mapping(address => bool) public isWhitelistedRelayer;
    address[] public relayers;

    /* ============ Constructor ============ */
    constructor() Ownable() {}
    
    /* ============ External Functions ============ */

    /**
     * ONLY OWNER: Adds a relayer to the whitelist.
     *
     * @param _relayer   The relayer address to add
     */
    function addRelayer(address _relayer) external onlyOwner {
        require(_relayer != address(0), "Relayer cannot be zero address");
        require(!isWhitelistedRelayer[_relayer], "Relayer already whitelisted");
        
        isWhitelistedRelayer[_relayer] = true;
        relayers.push(_relayer);
        
        emit RelayerAdded(_relayer);
    }

    /**
     * ONLY OWNER: Removes a relayer from the whitelist.
     *
     * @param _relayer   The relayer address to remove
     */
    function removeRelayer(address _relayer) external onlyOwner {
        require(isWhitelistedRelayer[_relayer], "Relayer not whitelisted");
        
        isWhitelistedRelayer[_relayer] = false;
        relayers.removeStorage(_relayer);
        
        emit RelayerRemoved(_relayer);
    }



    /* ============ External View Functions ============ */

    function getWhitelistedRelayers() external view returns (address[] memory) {
        return relayers;
    }
} 
        

@openzeppelin/contracts/access/Ownable.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
          

@openzeppelin/contracts/utils/Context.sol

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}
          

contracts/external/AddressArrayUtils.sol

/*
    Copyright 2020 Set Labs Inc.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

    SPDX-License-Identifier: MIT
*/

pragma solidity ^0.8.17;

/**
 * @title AddressArrayUtils
 * @author Set Protocol
 *
 * Utility functions to handle Address Arrays
 *
 * CHANGELOG:
 * - 4/21/21: Added validatePairsWithArray methods
 */
library AddressArrayUtils {

    uint256 constant internal MAX_INT = 2**256 - 1;

    /**
     * Finds the index of the first occurrence of the given element.
     * @param A The input array to search
     * @param a The value to find
     * @return Returns (index and isIn) for the first occurrence starting from index 0
     */
    function indexOf(address[] memory A, address a) internal pure returns (uint256, bool) {
        uint256 length = A.length;
        for (uint256 i = 0; i < length; i++) {
            if (A[i] == a) {
                return (i, true);
            }
        }
        return (MAX_INT, false);
    }

    /**
    * Returns true if the value is present in the list. Uses indexOf internally.
    * @param A The input array to search
    * @param a The value to find
    * @return Returns isIn for the first occurrence starting from index 0
    */
    function contains(address[] memory A, address a) internal pure returns (bool) {
        (, bool isIn) = indexOf(A, a);
        return isIn;
    }

    /**
    * Returns true if there are 2 elements that are the same in an array
    * @param A The input array to search
    * @return Returns boolean for the first occurrence of a duplicate
    */
    function hasDuplicate(address[] memory A) internal pure returns(bool) {
        require(A.length > 0, "A is empty");

        for (uint256 i = 0; i < A.length - 1; i++) {
            address current = A[i];
            for (uint256 j = i + 1; j < A.length; j++) {
                if (current == A[j]) {
                    return true;
                }
            }
        }
        return false;
    }

    /**
     * @param A The input array to search
     * @param a The address to remove
     * @return Returns the array with the object removed.
     */
    function remove(address[] memory A, address a)
        internal
        pure
        returns (address[] memory)
    {
        (uint256 index, bool isIn) = indexOf(A, a);
        if (!isIn) {
            revert("Address not in array.");
        } else {
            (address[] memory _A,) = pop(A, index);
            return _A;
        }
    }

    /**
     * @param A The input array to search
     * @param a The address to remove
     */
    function removeStorage(address[] storage A, address a)
        internal
    {
        (uint256 index, bool isIn) = indexOf(A, a);
        if (!isIn) {
            revert("Address not in array.");
        } else {
            uint256 lastIndex = A.length - 1; // If the array would be empty, the previous line would throw, so no underflow here
            if (index != lastIndex) { A[index] = A[lastIndex]; }
            A.pop();
        }
    }

    /**
    * Removes specified index from array
    * @param A The input array to search
    * @param index The index to remove
    * @return Returns the new array and the removed entry
    */
    function pop(address[] memory A, uint256 index)
        internal
        pure
        returns (address[] memory, address)
    {
        uint256 length = A.length;
        require(index < A.length, "Index must be < A length");
        address[] memory newAddresses = new address[](length - 1);
        for (uint256 i = 0; i < index; i++) {
            newAddresses[i] = A[i];
        }
        for (uint256 j = index + 1; j < length; j++) {
            newAddresses[j - 1] = A[j];
        }
        return (newAddresses, A[index]);
    }
}
          

contracts/interfaces/IRelayerRegistry.sol

//SPDX-License-Identifier: MIT

pragma solidity ^0.8.18;

interface IRelayerRegistry {
    function isWhitelistedRelayer(address _relayer) external view returns (bool);
    function getWhitelistedRelayers() external view returns (address[] memory);
}
          

Compiler Settings

{"viaIR":true,"outputSelection":{"*":{"*":["abi","evm.bytecode","evm.deployedBytecode","evm.methodIdentifiers","metadata","devdoc","userdoc","storageLayout","evm.gasEstimates"],"":["ast"]}},"optimizer":{"runs":200,"enabled":true},"metadata":{"useLiteralContent":true},"libraries":{}}
              

Contract ABI

[{"type":"constructor","stateMutability":"nonpayable","inputs":[]},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RelayerAdded","inputs":[{"type":"address","name":"relayer","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"RelayerRemoved","inputs":[{"type":"address","name":"relayer","internalType":"address","indexed":true}],"anonymous":false},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"addRelayer","inputs":[{"type":"address","name":"_relayer","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address[]","name":"","internalType":"address[]"}],"name":"getWhitelistedRelayers","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isWhitelistedRelayer","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"relayers","inputs":[{"type":"uint256","name":"","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"removeRelayer","inputs":[{"type":"address","name":"_relayer","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]}]
              

Contract Creation Code

0x6080806040523461005b5760008054336001600160a01b0319821681178355916001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09080a36107dd90816100618239f35b600080fdfe608060408181526004908136101561001657600080fd5b600092833560e01c9081631c98849b146105b45750806345d58d741461054a57806360f0a5ac14610379578063715018a61461031f5780638da5cb5b146102f75780639a48e7f9146102b3578063dd39f00d146101485763f2fde38b1461007c57600080fd5b34610144576020366003190112610144576001600160a01b03823581811693919290849003610140576100ad61063d565b83156100ee57505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8480fd5b8280fd5b508290346102af5760203660031901126102af5782356001600160a01b038116918282036102ab5761017861063d565b821561026957828452600160205260ff81852054166102275782845260016020528320600160ff198254161790556002546801000000000000000081101561021457906101ce8260016101ed94016002556105f0565b90919082549060031b9160018060a01b03809116831b921b1916179055565b7f03580ee9f53a62b7cb409a2cb56f9be87747dd15017afc5cef6eef321e4fb2c58280a280f35b634e487b7160e01b845260418552602484fd5b5162461bcd60e51b8152602081860152601b60248201527f52656c6179657220616c72656164792077686974656c697374656400000000006044820152606490fd5b5162461bcd60e51b8152602081860152601e60248201527f52656c617965722063616e6e6f74206265207a65726f206164647265737300006044820152606490fd5b8380fd5b5080fd5b5090346101445760203660031901126101445735916002548310156102f457506102de6020926105f0565b905491519160018060a01b039160031b1c168152f35b80fd5b8382346102af57816003193601126102af57905490516001600160a01b039091168152602090f35b83346102f457806003193601126102f45761033861063d565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b5082346102f45760203660031901126102f45782356001600160a01b03818116918281036102ab576103a961063d565b828452600160205260ff858520541615610507576103ef90838552600160205285852060ff19815416905585516103ea816103e381610695565b03826106fb565b610733565b61042e57845162461bcd60e51b8152602081880152601560248201527420b2323932b9b9903737ba1034b71030b93930bc9760591b6044820152606490fd5b85600254600019928382019182116104f4579081818693036104ae575b50505060025490811561049b57500190610464826105f0565b909182549160031b1b191690556002557f10e1f7ce9fd7d1b90a66d13a2ab3cb8dd7f29f3f8d520b143b063ccfbab6906b8280a280f35b634e487b7160e01b865260319052602485fd5b6104ec926104be6104c7936105f0565b939054926105f0565b92909360031b1c169082549060031b9160018060a01b03809116831b921b1916179055565b82868061044b565b634e487b7160e01b875260118352602487fd5b845162461bcd60e51b8152602081880152601760248201527f52656c61796572206e6f742077686974656c69737465640000000000000000006044820152606490fd5b8382346102af57816003193601126102af57805161056b816103e381610695565b815192839260208080860192818752855180945286019401925b82811061059457505050500390f35b83516001600160a01b031685528695509381019392810192600101610585565b929050346102ab5760203660031901126102ab57356001600160a01b038116908190036102ab5783526001602090815292205460ff1615158152f35b6002548110156106275760026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0190600090565b634e487b7160e01b600052603260045260246000fd5b6000546001600160a01b0316330361065157565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b6002549081815260208091019160026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace916000905b8282106106db575050505090565b83546001600160a01b0316855293840193600193840193909101906106cd565b90601f8019910116810190811067ffffffffffffffff82111761071d57604052565b634e487b7160e01b600052604160045260246000fd5b919082519260005b84811061075057506000199350600092915050565b815181101561062757600581901b8201602001516001600160a01b0384811691161461079d5760001981146107875760010161073b565b634e487b7160e01b600052601160045260246000fd5b935060019291505056fea2646970667358221220bafd8cd5d198f5505be481cb74047fca5aabd30a11ba3923c6557dd21fe583af64736f6c63430008120033

Deployed ByteCode

0x608060408181526004908136101561001657600080fd5b600092833560e01c9081631c98849b146105b45750806345d58d741461054a57806360f0a5ac14610379578063715018a61461031f5780638da5cb5b146102f75780639a48e7f9146102b3578063dd39f00d146101485763f2fde38b1461007c57600080fd5b34610144576020366003190112610144576001600160a01b03823581811693919290849003610140576100ad61063d565b83156100ee57505082546001600160a01b0319811683178455167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b906020608492519162461bcd60e51b8352820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152fd5b8480fd5b8280fd5b508290346102af5760203660031901126102af5782356001600160a01b038116918282036102ab5761017861063d565b821561026957828452600160205260ff81852054166102275782845260016020528320600160ff198254161790556002546801000000000000000081101561021457906101ce8260016101ed94016002556105f0565b90919082549060031b9160018060a01b03809116831b921b1916179055565b7f03580ee9f53a62b7cb409a2cb56f9be87747dd15017afc5cef6eef321e4fb2c58280a280f35b634e487b7160e01b845260418552602484fd5b5162461bcd60e51b8152602081860152601b60248201527f52656c6179657220616c72656164792077686974656c697374656400000000006044820152606490fd5b5162461bcd60e51b8152602081860152601e60248201527f52656c617965722063616e6e6f74206265207a65726f206164647265737300006044820152606490fd5b8380fd5b5080fd5b5090346101445760203660031901126101445735916002548310156102f457506102de6020926105f0565b905491519160018060a01b039160031b1c168152f35b80fd5b8382346102af57816003193601126102af57905490516001600160a01b039091168152602090f35b83346102f457806003193601126102f45761033861063d565b80546001600160a01b03198116825581906001600160a01b03167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08280a380f35b5082346102f45760203660031901126102f45782356001600160a01b03818116918281036102ab576103a961063d565b828452600160205260ff858520541615610507576103ef90838552600160205285852060ff19815416905585516103ea816103e381610695565b03826106fb565b610733565b61042e57845162461bcd60e51b8152602081880152601560248201527420b2323932b9b9903737ba1034b71030b93930bc9760591b6044820152606490fd5b85600254600019928382019182116104f4579081818693036104ae575b50505060025490811561049b57500190610464826105f0565b909182549160031b1b191690556002557f10e1f7ce9fd7d1b90a66d13a2ab3cb8dd7f29f3f8d520b143b063ccfbab6906b8280a280f35b634e487b7160e01b865260319052602485fd5b6104ec926104be6104c7936105f0565b939054926105f0565b92909360031b1c169082549060031b9160018060a01b03809116831b921b1916179055565b82868061044b565b634e487b7160e01b875260118352602487fd5b845162461bcd60e51b8152602081880152601760248201527f52656c61796572206e6f742077686974656c69737465640000000000000000006044820152606490fd5b8382346102af57816003193601126102af57805161056b816103e381610695565b815192839260208080860192818752855180945286019401925b82811061059457505050500390f35b83516001600160a01b031685528695509381019392810192600101610585565b929050346102ab5760203660031901126102ab57356001600160a01b038116908190036102ab5783526001602090815292205460ff1615158152f35b6002548110156106275760026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace0190600090565b634e487b7160e01b600052603260045260246000fd5b6000546001600160a01b0316330361065157565b606460405162461bcd60e51b815260206004820152602060248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152fd5b6002549081815260208091019160026000527f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace916000905b8282106106db575050505090565b83546001600160a01b0316855293840193600193840193909101906106cd565b90601f8019910116810190811067ffffffffffffffff82111761071d57604052565b634e487b7160e01b600052604160045260246000fd5b919082519260005b84811061075057506000199350600092915050565b815181101561062757600581901b8201602001516001600160a01b0384811691161461079d5760001981146107875760010161073b565b634e487b7160e01b600052601160045260246000fd5b935060019291505056fea2646970667358221220bafd8cd5d198f5505be481cb74047fca5aabd30a11ba3923c6557dd21fe583af64736f6c63430008120033