Skip to content

Instantly share code, notes, and snippets.

View Maxcutex's full-sized avatar

Prince Eno Bassey Maxcutex

View GitHub Profile
@Maxcutex
Maxcutex / 2_deploy_contracts.js
Created April 7, 2019 20:31
Election Project - Migration File
var Election = artifacts.require("./Election.sol");
module.exports = function(deployer) {
deployer.deploy(Election);
};
@Maxcutex
Maxcutex / election_init.sol
Last active April 7, 2019 17:56
ElectionProject
pragma solidity 0.4.24;
contract Election {
// Read/write candidate
string public candidate;
// Constructor
constructor () public {
candidate = "Candidate 1";
}
@Maxcutex
Maxcutex / App.js
Last active April 7, 2019 17:51
Election Voting App
App = {
web3Provider: null,
contracts: {},
account: '0x0',
init: function() {
return App.initWeb3();
},
initWeb3: function() {
@Maxcutex
Maxcutex / election.js
Last active March 30, 2019 11:35
Election
var Election = artifacts.require("./Election.sol");
contract("Election", function(accounts) {
var electionInstance;
it("initializes with two candidates", function() {
return Election.deployed().then(function(instance) {
return instance.candidatesCount();
}).then(function(count) {
assert.equal(count, 2);