Skip to content

Instantly share code, notes, and snippets.

@savepong
Created August 28, 2018 04:38
Show Gist options
  • Save savepong/913072e4dc487beb2c20b230df4f0c04 to your computer and use it in GitHub Desktop.
Save savepong/913072e4dc487beb2c20b230df4f0c04 to your computer and use it in GitHub Desktop.
Simple Smart Contract
pragma solidity ^0.4.18;
contract SimpleContract {
uint balance;
constructor() public {
// Set initial balance as 1000
balance = 1000;
}
function setBalance(uint newBalance) public {
// Set new balance
balance = newBalance;
}
function getBalance() public view returns(uint) {
return balance;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment