1 Star 0 Fork 1

eshax/tornado-anonymity-mining

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
compileHasher.js 998 Bytes
一键复制 编辑 原始数据 按行查看 历史
poma 提交于 2020-12-15 18:08 . initial
// Generates Hasher artifact at compile-time using Truffle's external compiler
// mechanism
const path = require('path')
const fs = require('fs')
const genContract = require('circomlib/src/poseidon_gencontract.js')
// where Truffle will expect to find the results of the external compiler
// command
const outputPath = path.join(__dirname, 'build', 'contracts')
const outputPath2 = path.join(outputPath, 'Hasher2.json')
const outputPath3 = path.join(outputPath, 'Hasher3.json')
if (!fs.existsSync(outputPath)) {
fs.mkdirSync(outputPath, { recursive: true })
}
function main() {
const contract2 = {
contractName: 'Hasher2',
abi: genContract.generateABI(2),
bytecode: genContract.createCode(2),
}
fs.writeFileSync(outputPath2, JSON.stringify(contract2, null, 2))
const contract3 = {
contractName: 'Hasher3',
abi: genContract.generateABI(3),
bytecode: genContract.createCode(3),
}
fs.writeFileSync(outputPath3, JSON.stringify(contract3, null, 2))
}
main()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/eshax/tornado-anonymity-mining.git
git@gitee.com:eshax/tornado-anonymity-mining.git
eshax
tornado-anonymity-mining
tornado-anonymity-mining
master

搜索帮助