Skip to content

Use commit reveal schema for LOP-bounty #6

@ssteiger

Description

@ssteiger

Problem:
https://twitter.com/PhABCD/status/1129987674213945344

Solution:
Implement a commit reveal schema:

def submitSolution(_solutionHash: bytes32) -> uint256:
   self.submittedSolutions[msg.sender] = _solutionHash

def revealSolution(_x1: unit256, _x2: uint256, _salt: string[16]) -> uint256:
    assert self.submittedSolutions[msg.sender] == keccak(_x1 + _x2 + _salt)
    newSolution: uint256
    newSolution = self._calculateNewSolution(_x1, _x2)
    if self.currentBestSolution < newSolution:
         self.self.currentBestSolution = newSolution
         self.addressOfWinner = msg.sender

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions