Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!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