mirror of
https://github.com/tornadocash/tornado-core.git
synced 2025-05-07 16:55:02 -04:00
rename mimc mentions to a generic hasher
This commit is contained in:
parent
6b067f067f
commit
71b767ade1
6 changed files with 28 additions and 28 deletions
24
migrations/2_deploy_hasher.js
Normal file
24
migrations/2_deploy_hasher.js
Normal 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)
|
||||
})
|
||||
})
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue