Skip to content

Instantly share code, notes, and snippets.

@TheBojda
Created August 19, 2017 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheBojda/32ef1f9f9526bdd0896bc454b48f0f31 to your computer and use it in GitHub Desktop.
Save TheBojda/32ef1f9f9526bdd0896bc454b48f0f31 to your computer and use it in GitHub Desktop.
$(document).ready(function() {
$("#blockchain button.set").click(function() {
var value = parseInt($("#blockchain input.text").val(), 10);
SimpleStorage.set(value);
addToLog("#blockchain", "SimpleStorage.set(" + value + ")");
});
$("#blockchain button.get").click(function() {
SimpleStorage.get().then(function(value) {
$("#blockchain .value").html(value.toNumber());
});
addToLog("#blockchain", "SimpleStorage.get()");
});
SimpleStorage.TestEvent().then(function(e) {
alert(e.args.from + " - " + e.args.value);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment