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 ERC20Token{ | |
| string public name; | |
| mapping (address => uint256) public balances; | |
| function mint() public { | |
| balances[tx.origin] += 1; | |
| } | |
| } | |
| contract Wallet_ETH { |
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
| // SPDX-License-Identifier: GPL-3.0 | |
| pragma solidity >=0.7.0 <0.8.0; | |
| /** | |
| * @title Storage | |
| * @dev Store & retrieve value in a variable | |
| */ | |
| contract Storage { |
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 Person_Data_BlockChain_Base { | |
| uint256 public peopleCount = 0; | |
| mapping(uint => Person) public people; | |
| struct Person { | |
| uint id; | |
| string firstname; | |
| string lastname; | |
| } |
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 Person_Data_BlockChain_Base { | |
| uint256 public peopleCount = 0; | |
| mapping(uint => Person) public people; | |
| struct Person { | |
| uint id; | |
| string firstname; | |
| string lastname; | |
| } |
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; |