Skip to content

Instantly share code, notes, and snippets.

@behaviary
Created June 21, 2017 21:16
Show Gist options
  • Save behaviary/833de0015749142dabb0008825c0381f to your computer and use it in GitHub Desktop.
Save behaviary/833de0015749142dabb0008825c0381f to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.0;
contract HelloEthereum {
string storedData;
function set (string name) {
storedData = name;
}
// function concatString(string a, string b) constant returns (string) {
// // TODO
// return a;
// }
function get() constant returns (string) {
return storedData;
}
}
@behaviary
Copy link
Author

behaviary commented Sep 6, 2022

For random people finding this gist and baffled why it's pinned on my gh profile: This was some example Solidity I wrote back in 2017. I sent this to a friend to show them how easy it was to write a smart contract on Ethereum. This was in Solidity 0.4.0, released in September of 2016. It was before Sol libraries and before proper string support. I feel like it's pretty nifty.

https://blog.soliditylang.org/2016/09/08/solidity-0.4.0-release-announcement/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment