Skip to content

Instantly share code, notes, and snippets.

@jigar23
Created May 11, 2018 16:26
Show Gist options
  • Save jigar23/796afe60ba09e1b7bb74985f839dd072 to your computer and use it in GitHub Desktop.
Save jigar23/796afe60ba09e1b7bb74985f839dd072 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.23+commit.124ca40d.js&optimize=false&gist=
pragma solidity ^0.4.0;
contract MyFirstContract {
string private name;
uint private age;
// Can use var newName but that by default will take 256 bits
function setName(string newName) {
name = newName;
}
function getName() returns (string) {
return name;
}
function setAge(uint newAge) {
age= newAge;
}
function getAge() returns (uint) {
return age;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment