CustomPriceGetter

Description:

Smart contract deployed on Ethereum with Factory features.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

{{
  "language": "Solidity",
  "sources": {
    "contracts/price-getters/CustomPriceGetter.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity 0.7.6;

interface IPriceGetter {
  function getPrice() external view returns (uint256 price);
}

contract CustomPriceGetter is IPriceGetter {
  uint256 private _price;
  address public owner;

  constructor(uint256 price) {
    _price = price;
    owner = msg.sender;
  }

  function getPrice() external view override returns (uint256 price) {
    return _price;
  }

  function setPrice(uint256 newPrice) external onlyOwner {
    _price = newPrice;
  }

  function transferOwnership(address newOwner) external onlyOwner {
    require(newOwner != address(0), 'Ownable: new owner is the zero address');
    owner = newOwner;
  }

  modifier onlyOwner() {
    require(msg.sender == owner, 'Only owner can call this function.');
    _;
  }
}
"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": true,
      "runs": 200
    },
    "evmVersion": "istanbul",
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "libraries": {}
  }
}}

Tags:
Factory|addr:0x02da86a57432e3861b1ab183ab7b24fcf4aab6a8|verified:true|block:23440757|tx:0xb4f1b91599a0e2d41e79f71a647572daef31fc0f9628a2ef63641ffea6cc142e|first_check:1758811874

Submitted on: 2025-09-25 16:51:15

Comments

Log in to comment.

No comments yet.