This repository has been archived by the owner on Apr 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 41
Examples
Omkara edited this page Jun 28, 2018
·
12 revisions
/* Hello world contract */
pragma solidity ^0.4.18;
import '../mortal/mortal.sol';
contract Greeter is Mortal {
/* Define variable greeting of the type string */
string greeting;
/* This runs when the contract is executed */
function Greeter(string _greeting) public {
greeting = _greeting;
}
/* Main function */
function greet() public constant returns (string) {
return greeting;
}
}
pragma solidity ^0.4.19;
contract Eventc {
event Top(string yolo);
function event_testing() public {
emit Top('Hello');
}
}
pragma solidity ^0.4.19;
contract Payable {
mapping(address => uint256) public vault;
event Deposit(
address indexed _from,
uint _value
);
function deposit() public payable {
// Events are emitted using `emit`, followed by
// the name of the event and the arguments
// (if any) in parentheses. Any such invocation
// (even deeply nested) can be detected from
// the JavaScript API by filtering for `Deposit`.
vault[msg.sender] = msg.value;
emit Deposit(msg.sender, msg.value);
}
}
pragma solidity ^0.4.19;
import 'https://github.com/OpenZeppelin/zeppelin-solidity/contracts/token/ERC20/MintableToken.sol';
contract GustavoCoin is MintableToken {
string public name = "GUSTAVO COIN";
string public symbol = "GUS";
uint8 public decimals = 18;
}