This file contains hidden or 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.5.1; | |
| contract variable_ex { | |
| string variable; | |
| constructor() public { | |
| variable = "Default"; | |
| } | |
| function get() public view returns(string memory) { | |
| return variable; |
This file contains hidden or 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.5.1; | |
| contract Var_TypesCon { | |
| string public stringVar = "Default"; | |
| bool public boolvar = true; | |
| int public intvar = 1; | |
| uint public uintvar = 1; | |
| uint8 public uint8var = 8; | |
| uint256 public uint256var = 99; | |
| } |
This file contains hidden or 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.5.1; | |
| contract Computer_State{ | |
| enum State { Running, ShutDown, SavedState, Hibernated, Sleeped, Terminated } | |
| State public state; | |
| constructor() public { | |
| state = State.Running; | |
| } | |
| function Terminate_Computer() public { | |
| state = State.Terminated; |
This file contains hidden or 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.24; | |
| contract Message_SEND_AND_RECIEVE { | |
| string message ; | |
| function SEND(string message_to_send) public { | |
| message = message_to_send; | |
| } | |
| function RETRIEVE() public constant returns(string) { | |
| return message; | |
| } |
This file contains hidden or 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.21; | |
| contract Election { | |
| struct Candidate { | |
| string name; | |
| uint voteCount; | |
| } | |
| struct Voter { | |
| bool authorized; | |
| bool voted; | |
| uint vote; |
NewerOlder