Created
May 14, 2016 18:30
-
-
Save colm/848fe63fdcb024724f97b3b60e289165 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based upon https://gist.github.com/jbaylina/2da7dba1496844f3ad2dc60b48cbc955 | |
var crypto = require('crypto'); | |
var fs= require('fs'); | |
var solc = require('solc'); | |
var input = { | |
'all.sol' : fs.readFileSync('all.sol', 'utf8') | |
}; | |
var input2 = { | |
'Token.sol' : fs.readFileSync('DAO/Token.sol', 'utf8'), | |
'TokenCreation.sol' : fs.readFileSync('DAO/TokenCreation.sol', 'utf8'), | |
'ManagedAccount.sol' : fs.readFileSync('DAO/ManagedAccount.sol', 'utf8'), | |
'DAO.sol' : fs.readFileSync('DAO/DAO.sol', 'utf8') | |
}; | |
for (i=0; i<10; i++) { | |
output = solc.compile({sources: input}, 1); | |
var hash = crypto.createHash('sha256').update(output.contracts.DAO.bytecode).digest('hex'); | |
console.log(hash); | |
output = solc.compile({sources: input2}, 1); // reset compiler state | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment