Contract

0xFf4cD89f549432c312c497628748d4d76AC180f6

Overview

S Balance

Sonic LogoSonic LogoSonic Logo0 S

S Value

-

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

Please try again later

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
StakerInfo

Compiler Version
v0.8.27+commit.40a35a09

Optimization Enabled:
Yes with 200 runs

Other Settings:
cancun EvmVersion
File 1 of 3 : StakerInfo.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.27;

import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

contract SfcInterface {
  mapping(address => uint256) public getValidatorID;
}

contract StakerInfo is Ownable {
  mapping (uint => string) public stakerInfos;

  address internal stakerContractAddress;

  constructor(address owner, address _stakerContractAddress) Ownable(owner) {
    stakerContractAddress = _stakerContractAddress;
  }

  function updateStakerContractAddress(address _stakerContractAddress) external onlyOwner {
    stakerContractAddress = _stakerContractAddress;
  }

  event InfoUpdated(uint256 stakerID);

  function updateInfo(string calldata _configUrl) external {
    SfcInterface sfcInterface = SfcInterface(stakerContractAddress);

    // Get staker ID from staker contract
    uint256 stakerID = sfcInterface.getValidatorID(msg.sender);

    // Check if address belongs to a staker
    require(stakerID != 0, "Address does not belong to a staker!");

    // Update config url
    stakerInfos[stakerID] = _configUrl;

    emit InfoUpdated(stakerID);
  }

  function getInfo(uint256 _stakerID) external view returns (string memory) {
    return stakerInfos[_stakerID];
  }
}

File 2 of 3 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../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.
 *
 * The initial owner is set to the address provided by the deployer. 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;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

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

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @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 {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @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 {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _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);
    }
}

File 3 of 3 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @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;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

Settings
{
  "evmVersion": "cancun",
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"_stakerContractAddress","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"OwnableInvalidOwner","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"OwnableUnauthorizedAccount","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"stakerID","type":"uint256"}],"name":"InfoUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[{"internalType":"uint256","name":"_stakerID","type":"uint256"}],"name":"getInfo","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"stakerInfos","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"string","name":"_configUrl","type":"string"}],"name":"updateInfo","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_stakerContractAddress","type":"address"}],"name":"updateStakerContractAddress","outputs":[],"stateMutability":"nonpayable","type":"function"}]

608060405234801561000f575f5ffd5b5060405161081e38038061081e83398101604081905261002e916100f6565b816001600160a01b03811661005c57604051631e4fbdf760e01b81525f600482015260240160405180910390fd5b6100658161008c565b50600280546001600160a01b0319166001600160a01b039290921691909117905550610127565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146100f1575f5ffd5b919050565b5f5f60408385031215610107575f5ffd5b610110836100db565b915061011e602084016100db565b90509250929050565b6106ea806101345f395ff3fe608060405234801561000f575f5ffd5b506004361061007a575f3560e01c80638da5cb5b116100585780638da5cb5b146100c4578063ab29511b146100de578063f2fde38b146100f1578063fb9cba3014610104575f5ffd5b80631a3cd59a1461007e57806333470433146100a7578063715018a6146100ba575b5f5ffd5b61009161008c366004610464565b610117565b60405161009e919061047b565b60405180910390f35b6100916100b5366004610464565b6101b6565b6100c261024d565b005b5f546040516001600160a01b03909116815260200161009e565b6100c26100ec3660046104b0565b610260565b6100c26100ff36600461051e565b610382565b6100c261011236600461051e565b6103bf565b5f8181526001602052604090208054606091906101339061054b565b80601f016020809104026020016040519081016040528092919081815260200182805461015f9061054b565b80156101aa5780601f10610181576101008083540402835291602001916101aa565b820191905f5260205f20905b81548152906001019060200180831161018d57829003601f168201915b50505050509050919050565b60016020525f9081526040902080546101ce9061054b565b80601f01602080910402602001604051908101604052809291908181526020018280546101fa9061054b565b80156102455780601f1061021c57610100808354040283529160200191610245565b820191905f5260205f20905b81548152906001019060200180831161022857829003601f168201915b505050505081565b6102556103e9565b61025e5f610415565b565b600254604051630135b1db60e01b81523360048201526001600160a01b03909116905f908290630135b1db90602401602060405180830381865afa1580156102aa573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102ce9190610583565b9050805f036103305760405162461bcd60e51b8152602060048201526024808201527f4164647265737320646f6573206e6f742062656c6f6e6720746f2061207374616044820152636b65722160e01b60648201526084015b60405180910390fd5b5f8181526001602052604090206103488486836105fa565b506040518181527f3a668b70276c6b5af986be90ab9921c67bbef483987bb44cd5145c4984e59f249060200160405180910390a150505050565b61038a6103e9565b6001600160a01b0381166103b357604051631e4fbdf760e01b81525f6004820152602401610327565b6103bc81610415565b50565b6103c76103e9565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b5f546001600160a01b0316331461025e5760405163118cdaa760e01b8152336004820152602401610327565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f60208284031215610474575f5ffd5b5035919050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b5f5f602083850312156104c1575f5ffd5b823567ffffffffffffffff8111156104d7575f5ffd5b8301601f810185136104e7575f5ffd5b803567ffffffffffffffff8111156104fd575f5ffd5b85602082840101111561050e575f5ffd5b6020919091019590945092505050565b5f6020828403121561052e575f5ffd5b81356001600160a01b0381168114610544575f5ffd5b9392505050565b600181811c9082168061055f57607f821691505b60208210810361057d57634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208284031215610593575f5ffd5b5051919050565b634e487b7160e01b5f52604160045260245ffd5b601f8211156105f557805f5260205f20601f840160051c810160208510156105d35750805b601f840160051c820191505b818110156105f2575f81556001016105df565b50505b505050565b67ffffffffffffffff8311156106125761061261059a565b61062683610620835461054b565b836105ae565b5f601f841160018114610657575f85156106405750838201355b5f19600387901b1c1916600186901b1783556105f2565b5f83815260208120601f198716915b828110156106865786850135825560209485019460019092019101610666565b50868210156106a2575f1960f88860031b161c19848701351681555b505060018560011b018355505050505056fea2646970667358221220658f1265433a878703813ca6af9d9b26fa19bc879af2ab7410c4a3589ad159e664736f6c634300081b0033000000000000000000000000f8fc6d1289734fdffe8b58d8d394b33fe8cc545f000000000000000000000000fc00face00000000000000000000000000000000

Deployed Bytecode

0x608060405234801561000f575f5ffd5b506004361061007a575f3560e01c80638da5cb5b116100585780638da5cb5b146100c4578063ab29511b146100de578063f2fde38b146100f1578063fb9cba3014610104575f5ffd5b80631a3cd59a1461007e57806333470433146100a7578063715018a6146100ba575b5f5ffd5b61009161008c366004610464565b610117565b60405161009e919061047b565b60405180910390f35b6100916100b5366004610464565b6101b6565b6100c261024d565b005b5f546040516001600160a01b03909116815260200161009e565b6100c26100ec3660046104b0565b610260565b6100c26100ff36600461051e565b610382565b6100c261011236600461051e565b6103bf565b5f8181526001602052604090208054606091906101339061054b565b80601f016020809104026020016040519081016040528092919081815260200182805461015f9061054b565b80156101aa5780601f10610181576101008083540402835291602001916101aa565b820191905f5260205f20905b81548152906001019060200180831161018d57829003601f168201915b50505050509050919050565b60016020525f9081526040902080546101ce9061054b565b80601f01602080910402602001604051908101604052809291908181526020018280546101fa9061054b565b80156102455780601f1061021c57610100808354040283529160200191610245565b820191905f5260205f20905b81548152906001019060200180831161022857829003601f168201915b505050505081565b6102556103e9565b61025e5f610415565b565b600254604051630135b1db60e01b81523360048201526001600160a01b03909116905f908290630135b1db90602401602060405180830381865afa1580156102aa573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906102ce9190610583565b9050805f036103305760405162461bcd60e51b8152602060048201526024808201527f4164647265737320646f6573206e6f742062656c6f6e6720746f2061207374616044820152636b65722160e01b60648201526084015b60405180910390fd5b5f8181526001602052604090206103488486836105fa565b506040518181527f3a668b70276c6b5af986be90ab9921c67bbef483987bb44cd5145c4984e59f249060200160405180910390a150505050565b61038a6103e9565b6001600160a01b0381166103b357604051631e4fbdf760e01b81525f6004820152602401610327565b6103bc81610415565b50565b6103c76103e9565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b5f546001600160a01b0316331461025e5760405163118cdaa760e01b8152336004820152602401610327565b5f80546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b5f60208284031215610474575f5ffd5b5035919050565b602081525f82518060208401528060208501604085015e5f604082850101526040601f19601f83011684010191505092915050565b5f5f602083850312156104c1575f5ffd5b823567ffffffffffffffff8111156104d7575f5ffd5b8301601f810185136104e7575f5ffd5b803567ffffffffffffffff8111156104fd575f5ffd5b85602082840101111561050e575f5ffd5b6020919091019590945092505050565b5f6020828403121561052e575f5ffd5b81356001600160a01b0381168114610544575f5ffd5b9392505050565b600181811c9082168061055f57607f821691505b60208210810361057d57634e487b7160e01b5f52602260045260245ffd5b50919050565b5f60208284031215610593575f5ffd5b5051919050565b634e487b7160e01b5f52604160045260245ffd5b601f8211156105f557805f5260205f20601f840160051c810160208510156105d35750805b601f840160051c820191505b818110156105f2575f81556001016105df565b50505b505050565b67ffffffffffffffff8311156106125761061261059a565b61062683610620835461054b565b836105ae565b5f601f841160018114610657575f85156106405750838201355b5f19600387901b1c1916600186901b1783556105f2565b5f83815260208120601f198716915b828110156106865786850135825560209485019460019092019101610666565b50868210156106a2575f1960f88860031b161c19848701351681555b505060018560011b018355505050505056fea2646970667358221220658f1265433a878703813ca6af9d9b26fa19bc879af2ab7410c4a3589ad159e664736f6c634300081b0033

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000f8fc6d1289734fdffe8b58d8d394b33fe8cc545f000000000000000000000000fc00face00000000000000000000000000000000

-----Decoded View---------------
Arg [0] : owner (address): 0xf8Fc6d1289734Fdffe8B58d8D394b33fe8CC545F
Arg [1] : _stakerContractAddress (address): 0xFC00FACE00000000000000000000000000000000

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000f8fc6d1289734fdffe8b58d8d394b33fe8cc545f
Arg [1] : 000000000000000000000000fc00face00000000000000000000000000000000


Block Transaction Gas Used Reward
view all blocks produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.