Skip to content

Instantly share code, notes, and snippets.

@bigmug
Created August 12, 2014 12:23
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 bigmug/06168670899d34580e49 to your computer and use it in GitHub Desktop.
Save bigmug/06168670899d34580e49 to your computer and use it in GitHub Desktop.
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
</head>
<body>
<p>
<div id="click_here">click_here_to_transact</div>
</p>
<script src="js/json3.min.js"></script>
<script src="js/jquery-1.10.1.min.js"></script>
<script>
$("#click_here").click(function(){
var payload = "";
// example:
var contract_address = "0xb170e2f619b307a5324b75a811ee01bf1fcaeaf5";
for (var i = 0; i < 37; i++){
payload += i.toString().pad(32);
}
// payload is the array of numbers padded to 32 bytes
eth.transact(eth.key, "0", contract_address, payload, "20000", eth.gasPrice);
// you can access the values with 0x0, 0x1, 0x2, etc,
// eth.storageAt(address, "0x1").dec()
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment