mirror of
https://github.com/tornadocash/tornado-core.git
synced 2025-05-08 01:05:09 -04:00
Move contracts to repository root
This commit is contained in:
parent
ea51af1512
commit
b5b3474165
18 changed files with 514 additions and 5771 deletions
24
migrations/2_deploy_mimc.js
Normal file
24
migrations/2_deploy_mimc.js
Normal file
|
@ -0,0 +1,24 @@
|
|||
const path = require('path');
|
||||
|
||||
const mimcGenContract = 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 mimcContractName = 'MiMC';
|
||||
await artifactor.save({
|
||||
contractName: mimcContractName,
|
||||
abi: mimcGenContract.abi,
|
||||
unlinked_binary: mimcGenContract.createCode(SEED, 220),
|
||||
})
|
||||
.then(async () => {
|
||||
const MiMC = artifacts.require(mimcContractName);
|
||||
await deployer.deploy(MiMC);
|
||||
});
|
||||
});
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue