Skip to content

Instantly share code, notes, and snippets.

@maheshmurthy
Created April 12, 2018 18:36
Show Gist options
  • Save maheshmurthy/f05f241e293c16ea4f67b6e70ee3dca4 to your computer and use it in GitHub Desktop.
Save maheshmurthy/f05f241e293c16ea4f67b6e70ee3dca4 to your computer and use it in GitHub Desktop.
var Voting = artifacts.require("./Voting.sol");
var ECRecovery = artifacts.require("./ECRecovery.sol");
const sigUtil = require("eth-sig-util")
var alice_vote_hash = sigUtil.typedSignatureHash([{ type: 'string', name: 'Message', value: "Vote for Alice"}])
var bob_vote_hash = sigUtil.typedSignatureHash([{ type: 'string', name: 'Message', value: "Vote for Bob"}])
var carol_vote_hash = sigUtil.typedSignatureHash([{ type: 'string', name: 'Message', value: "Vote for Carol"}])
module.exports = function(deployer) {
deployer.deploy(ECRecovery);
deployer.link(ECRecovery, Voting);
deployer.deploy(Voting, ['Alice', 'Bob', 'Carol'], [alice_vote_hash, bob_vote_hash, carol_vote_hash]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment