rename mimc mentions to a generic hasher

This commit is contained in:
poma 2019-10-04 15:12:22 +03:00
parent 6b067f067f
commit 71b767ade1
6 changed files with 28 additions and 28 deletions

View file

@ -0,0 +1,24 @@
/* global artifacts */
const path = require('path')
const genContract = require('circomlib/src/mimcsponge_gencontract.js')
const Artifactor = require('truffle-artifactor')
const SEED = 'mimcsponge'
module.exports = function(deployer) {
return deployer.then( async () => {
const contractsDir = path.join(__dirname, '..', 'build/contracts')
let artifactor = new Artifactor(contractsDir)
let contractName = 'Hasher'
await artifactor.save({
contractName,
abi: genContract.abi,
unlinked_binary: genContract.createCode(SEED, 220),
}).then(async () => {
const hasherContract = artifacts.require(contractName)
await deployer.deploy(hasherContract)
})
})
}