Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gas reporter script #168

Merged
merged 1 commit into from
Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/VAnchor.md
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ Wrap the native token for the `msg.sender` into the TokenWrapper tokenThe amount
function wrapToken(address _tokenAddress, uint256 _amount) external nonpayable
```

Wraps a token for the `msg.sender` using the underlying FixedDepositAnchor's TokenWrapper contract
Wraps a token for the `msg.sender` using the underlying TokenWrapper contract



Expand Down
18 changes: 12 additions & 6 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { HardhatUserConfig } from 'hardhat/types';
import "hardhat-artifactor";
import 'hardhat-artifactor';
import 'hardhat-gas-reporter'
import '@typechain/hardhat';
import '@nomiclabs/hardhat-ethers'
import "@nomiclabs/hardhat-truffle5";
import '@nomiclabs/hardhat-truffle5';
import '@primitivefi/hardhat-dodoc';
import { subtask } from 'hardhat/config'

import poseidonContract from "circomlibjs/src/poseidon_gencontract.js";
import poseidonContract from 'circomlibjs/src/poseidon_gencontract.js';

const buildPoseidon = async (numInputs: number) => {
//@ts-ignore
Expand All @@ -26,7 +27,7 @@ const config: HardhatUserConfig = {
defaultNetwork: 'hardhat',
solidity: {
compilers: [{
version: "0.8.5",
version: '0.8.5',
settings: {
optimizer: {
enabled: true,
Expand All @@ -37,11 +38,16 @@ const config: HardhatUserConfig = {
},
// @ts-ignore
dodoc: {
include: ["FixedDepositAnchor", "AnchorBase", "LinkableAnchor", "AnchorHandler", "IAnchor", "IAnchorTrees", "ILinkableAnchor", "VAnchorEncodeInputs", "GovernedTokenWrapper", "TokenWrapperHandler", "Hasher", , "MerkleTreePoseidon", "MerkleTreeWithHistoryPoseidon", "Poseidon", "SnarkConstants", "LinkableVAnchor", "VAnchor", "VAnchorBase", "AnchorProxy", "Bridge"]
include: ['FixedDepositAnchor', 'AnchorBase', 'LinkableAnchor', 'AnchorHandler', 'IAnchor', 'IAnchorTrees', 'ILinkableAnchor', 'VAnchorEncodeInputs', 'GovernedTokenWrapper', 'TokenWrapperHandler', 'Hasher', , 'MerkleTreePoseidon', 'MerkleTreeWithHistoryPoseidon', 'Poseidon', 'SnarkConstants', 'LinkableVAnchor', 'VAnchor', 'VAnchorBase', 'AnchorProxy', 'Bridge']
},
mocha: {
timeout: 60000
}
},
gasReporter: {
enabled: (process.env.REPORT_GAS) ? true : false,
currency: 'USD',
gasPrice: 21
},
};

export default config;
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"setup:plonk:vanchor8": "./scripts/bash/plonk/vanchor/phase2_poseidon_vanchor8.sh",
"setup:plonk:semaphore-anchor2": "./scripts/bash/plonk/semaphore/phase2_semaphore_anchor_2.sh",
"setup:plonk": "./scripts/bash/setup_verifiers_plonk.sh",
"test": "npx hardhat test"
"test": "npx hardhat test",
"test:gas-reporter": "REPORT_GAS=true npx hardhat test"
},
"devDependencies": {
"@nomiclabs/hardhat-ethers": "^2.0.2",
Expand All @@ -50,6 +51,7 @@
"ffjavascript": "^0.2.38",
"ganache": "^7.0.2",
"hardhat": "^2.6.8",
"hardhat-gas-reporter": "^1.0.8",
"lerna": "~4.0.0",
"solparse": "^2.2.8",
"truffle-assertions": "^0.9.2",
Expand Down Expand Up @@ -82,7 +84,7 @@
"prettier-plugin-solidity": "^1.0.0-beta.18",
"snarkjs": "0.4.22",
"ts-node": "^10.1.0",
"typescript": "4.7.2",
"typechain": "^5.1.2"
"typechain": "^5.1.2",
"typescript": "4.7.2"
}
}
Loading