This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.17; | |
contract DecentrailzedQuiz { | |
mapping (address => uint256) public balances; | |
address public manager; | |
address[] public players; | |
function DecentrailzedQuiz() public { | |
manager = msg.sender; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function transferToWinner(address to, uint noOfWinners){ | |
to.transfer( balances/ noOfWinners); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
address[] public players; | |
function enterGame() public { | |
players.push(msg.sender); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mapping (address => uint256) public balances; | |
function setPrizeAmount() public payable{ | |
require(msg.value > .01 ether); | |
balances[msg.sender] += msg.value; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
address public manager; | |
function DecentrailzedQuiz() public { | |
manager = msg.sender; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.17; | |
contract helloWorld { | |
function greet() constant returns (string) { | |
return "Hello World"; | |
} | |
} |