mirror of
https://github.com/semaphore-protocol/semaphore.git
synced 2026-01-09 14:48:12 -05:00
chore: update solidity version
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity ^0.8.0;
|
||||
pragma solidity ^0.8.4;
|
||||
|
||||
import {PoseidonT3, PoseidonT6} from "./Poseidon.sol";
|
||||
import { SnarkConstants } from "./SnarkConstants.sol";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity ^0.8.0;
|
||||
pragma solidity ^0.8.4;
|
||||
|
||||
import { SnarkConstants } from "./SnarkConstants.sol";
|
||||
import { Hasher } from "./Hasher.sol";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity ^0.8.0;
|
||||
pragma solidity ^0.8.4;
|
||||
|
||||
contract Ownable {
|
||||
address private _owner;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity ^0.8.0;
|
||||
pragma solidity ^0.8.4;
|
||||
|
||||
library PoseidonT3 {
|
||||
function poseidon(uint256[2] memory input) public pure returns (uint256) {}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity ^0.8.0;
|
||||
pragma solidity ^0.8.4;
|
||||
|
||||
import "./Verifier.sol";
|
||||
import { IncrementalQuinTree } from "./IncrementalMerkleTree.sol";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity ^0.8.0;
|
||||
pragma solidity ^0.8.4;
|
||||
|
||||
import { Semaphore } from './Semaphore.sol';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//SPDX-License-Identifier: GPL-3.0
|
||||
pragma solidity ^0.8.0;
|
||||
pragma solidity ^0.8.4;
|
||||
|
||||
|
||||
contract SnarkConstants {
|
||||
|
||||
@@ -6,15 +6,8 @@ import "@nomiclabs/hardhat-ethers"
|
||||
import "hardhat-deploy"
|
||||
|
||||
const hardhatConfig: HardhatUserConfig = {
|
||||
solidity: {
|
||||
version: "0.8.4",
|
||||
settings: {
|
||||
optimizer: {
|
||||
enabled: true,
|
||||
runs: 200
|
||||
}
|
||||
}
|
||||
},
|
||||
solidity: config.solidity,
|
||||
paths: config.paths,
|
||||
networks: {
|
||||
hardhat: {
|
||||
chainId: 1337,
|
||||
@@ -27,8 +20,7 @@ const hardhatConfig: HardhatUserConfig = {
|
||||
},
|
||||
namedAccounts: {
|
||||
deployer: 0
|
||||
},
|
||||
paths: config.paths
|
||||
}
|
||||
}
|
||||
|
||||
export default hardhatConfig
|
||||
|
||||
@@ -26,8 +26,7 @@
|
||||
"compile:circuits": "ts-node scripts/compile-circuits.ts",
|
||||
"deploy:localhost": "hardhat deploy --tags complete",
|
||||
"export:localhost": "mkdir -p exports && hardhat --network localhost export --export exports/localhost.json",
|
||||
"test": "hardhat test",
|
||||
"test:fullProof": "yarn compile:circuits && yarn test"
|
||||
"test": "hardhat test"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@nomiclabs/hardhat-ethers": "^2.0.4",
|
||||
@@ -52,6 +51,9 @@
|
||||
"typescript": "^4.5.5"
|
||||
},
|
||||
"config": {
|
||||
"solidity": {
|
||||
"version": "0.8.4"
|
||||
},
|
||||
"paths": {
|
||||
"contracts": "./contracts",
|
||||
"circuit": "./circuit",
|
||||
|
||||
@@ -20,6 +20,7 @@ async function exec(command: string) {
|
||||
|
||||
async function main() {
|
||||
const buildPath = config.paths.build.snark
|
||||
const solidityVersion = config.solidity.version
|
||||
|
||||
if (!fs.existsSync(buildPath)) {
|
||||
fs.mkdirSync(buildPath, { recursive: true })
|
||||
@@ -59,7 +60,7 @@ async function main() {
|
||||
{ groth16: fs.readFileSync("./node_modules/snarkjs/templates/verifier_groth16.sol.ejs", "utf8") },
|
||||
logger
|
||||
)
|
||||
verifierCode = verifierCode.replace(/pragma solidity \^\d+\.\d+\.\d+/, "pragma solidity ^0.8.0")
|
||||
verifierCode = verifierCode.replace(/pragma solidity \^\d+\.\d+\.\d+/, `pragma solidity ^${solidityVersion}`)
|
||||
|
||||
fs.writeFileSync(`${buildPath}/verification_key.json`, JSON.stringify(verificationKey), "utf-8")
|
||||
fs.writeFileSync(`${config.paths.contracts}/Verifier.sol`, verifierCode, "utf-8")
|
||||
|
||||
Reference in New Issue
Block a user