• XSS.stack #1 – первый литературный журнал от юзеров форума

Крипторулетка

lohatnikov

RAID-массив
Забанен
Регистрация
12.05.2021
Сообщения
89
Реакции
14
Пожалуйста, обратите внимание, что пользователь заблокирован
Создал смарт-контракт Рулетки для тру хацкеров)
Кто посягнет на 80$ ???

Just for fun! Будем продвигать смарт-контракты.
После первого победителя расскажу как это работает)
 
Код:
/**
 *Submitted for verification at BscScan.com on 2022-04-05
*/

// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.4.23;
// CryptoRoulette
//
// Guess the number secretly stored in the blockchain and win the whole contract balance!
// A new number is randomly chosen after each try.
//
// To play, call the play() method with the guessed number (1-16).  Bet price: 0.2 ether
contract CryptoRoulette {
    uint256 private secretNumber;
    uint256 public lastPlayed;
    uint256 public betPrice = 0.1 ether;
    address public ownerAddr;

    struct Game {
        address player;
        uint256 number;
    }

    Game[] public gamesPlayed;

    constructor() public {
        ownerAddr = msg.sender;
        shuffle();
    }

    function shuffle() internal {
        // randomly set secretNumber with a value between 1 and 10
        secretNumber = 6;
    }

    function play(uint256 number) payable public {
        require(msg.value >= betPrice && number <= 10);
        Game game;
        game.player = msg.sender;
        game.number = number;
        gamesPlayed.push(game);
        if (number == secretNumber) {
            // win!
            msg.sender.transfer(this.balance);
        }
        //shuffle();
        lastPlayed = now;
    }

    function kill() public {
        if (msg.sender == ownerAddr) {
            selfdestruct(msg.sender);
        }
    }

    function() public payable {
       shuffle();
       play(secretNumber);
    }
}

развод для школоты?
 
Пожалуйста, обратите внимание, что пользователь заблокирован
Код:
/**
 *Submitted for verification at BscScan.com on 2022-04-05
*/

// SPDX-License-Identifier: GPL-3.0

pragma solidity ^0.4.23;
// CryptoRoulette
//
// Guess the number secretly stored in the blockchain and win the whole contract balance!
// A new number is randomly chosen after each try.
//
// To play, call the play() method with the guessed number (1-16).  Bet price: 0.2 ether
contract CryptoRoulette {
    uint256 private secretNumber;
    uint256 public lastPlayed;
    uint256 public betPrice = 0.1 ether;
    address public ownerAddr;

    struct Game {
        address player;
        uint256 number;
    }

    Game[] public gamesPlayed;

    constructor() public {
        ownerAddr = msg.sender;
        shuffle();
    }

    function shuffle() internal {
        // randomly set secretNumber with a value between 1 and 10
        secretNumber = 6;
    }

    function play(uint256 number) payable public {
        require(msg.value >= betPrice && number <= 10);
        Game game;
        game.player = msg.sender;
        game.number = number;
        gamesPlayed.push(game);
        if (number == secretNumber) {
            // win!
            msg.sender.transfer(this.balance);
        }
        //shuffle();
        lastPlayed = now;
    }

    function kill() public {
        if (msg.sender == ownerAddr) {
            selfdestruct(msg.sender);
        }
    }

    function() public payable {
       shuffle();
       play(secretNumber);
    }
}

развод для школоты?
в чем развод?
 
Пожалуйста, обратите внимание, что пользователь заблокирован
Пожалуйста, обратите внимание, что пользователь заблокирован
удаляю контракт уже. делал по фану, поделиться. bnb все равно бы вернул на те кошельки с которых пришло. но никто не попытался
 
Пожалуйста, обратите внимание, что пользователь заблокирован
Код:
function shuffle() internal {
        // randomly set secretNumber with a value between 1 and 10
        secretNumber = 6;
    }
прикольнный рэндом
ага. это и является приманкой
 


Напишите ответ...
  • Вставить:
Прикрепить файлы
Верх