Skip to content

Commit

Permalink
Config (sushiswap#23)
Browse files Browse the repository at this point in the history
* MirinMath: Cleanup and Tests

Removed all unused constants and functions
only sqrt() is left

* chore: reorg prettier config to js, and require @sushiswap/prettier-config

* chore: add solcover.js and ignore flat, interfaces & mocks

* chore: remove unused contract/tests

* chore: move MirinMathTest to mocks/MirinMathConsumerMock and update test

* chore: re-enable forking config, issue was fixed some time ago

* chore: better define example env

* chore: move examples to examples directory

* chore: remove redudent MirinMathNew

* chore: network configuration

* chore: explicitly set paths

* chore: explicitly typechain config

* chore: remove archieved version of typechain

* chore: compileUsingRemoteVersion 0.8.2

* chore: ignore types

* chore: solthintignore

* config: prettier

* config: prettierignore

* config: husky

* config: lint staged

Co-authored-by: nori <nori@sushi.com>
Co-authored-by: Mudit Gupta <guptamudit@ymail.com>
  • Loading branch information
3 people committed Jul 20, 2021
1 parent aef1db5 commit ef099c8
Show file tree
Hide file tree
Showing 22 changed files with 600 additions and 190 deletions.
6 changes: 5 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,12 @@ ALCHEMY_API_KEY=
COINMARKETCAP_API_KEY=
ETHERSCAN_API_KEY=
FORKING=false
HARDHAT_NETWORK=hardhat
HARDHAT_MAX_MEMORY=4096
HARDHAT_SHOW_STACK_TRACES=true
HARDHAT_VERBOSE=true
INFURA_API_KEY=
MNEMONIC="test test test test test test test test test test test junk"
REPORT_GAS=false
REPORT_GAS=git
TENDERLY_PROJECT=
TENDERLY_USERNAME=
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ artifacts/
deployments/

# Typechain
typechain/
types/

# Env
.env
Expand Down
5 changes: 5 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
yarn test
8 changes: 8 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export/
deployments/
artifacts/
cache/
coverage/
node_modules/
package.json
types/
31 changes: 0 additions & 31 deletions .prettierrc

This file was deleted.

18 changes: 18 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
...require("@sushiswap/prettier-config"),
// TODO: If a non-default solidity config is needed, we could add this to our
// config repo and import as @sushiswap/prettier-config/solidity. Also, feel
// free to add to the default config which is required above.
overrides: [
{
files: '*.sol',
options: {
printWidth: 120,
tabWidth: 4,
singleQuote: false,
bracketSpacing: false,
explicitTypes: 'always',
},
},
],
};
3 changes: 3 additions & 0 deletions .solcover.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
skipFiles: ["interfaces", "flat", "mocks"],
};
7 changes: 7 additions & 0 deletions .solhintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export/
deployments/
artifacts/
cache/
coverage/
node_modules/
types/
5 changes: 2 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
"mochaExplorer.files": "test/**/*.{j,t}s",
"mochaExplorer.fullTrace": true,
"mochaExplorer.exit": true,
"solidity.enableLocalNodeCompiler": false,
"solidity.compileUsingRemoteVersion": "v0.6.12+commit.27d51765",
"solidity.compileUsingRemoteVersion": "v0.8.2+commit.661d1103",
"solidity.compilerOptimization": 200,
"solidity.compileUsingLocalVersion": "",
"solidity.linter": "solhint",
"solidity.packageDefaultDependenciesContractsDirectory": "",
"solidity.packageDefaultDependenciesDirectory": "node_modules",
"solidity.enabledAsYouTypeCompilationErrorCheck": true,
"solidity.validationDelay": 1500,
"solidity.packageDefaultDependenciesDirectory": "node_modules"
}
File renamed without changes.
File renamed without changes.
11 changes: 11 additions & 0 deletions contracts/mocks/MirinMathConsumerMock.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: GPL-3.0-or-later

pragma solidity ^0.8.2;

import "../libraries/MirinMath.sol";

contract MirinMathConsumerMock {
function sqrt(uint256 x) public pure returns (uint256) {
return MirinMath.sqrt(x);
}
}
17 changes: 0 additions & 17 deletions contracts/test/C1.sol

This file was deleted.

12 changes: 0 additions & 12 deletions contracts/test/C2.sol

This file was deleted.

15 changes: 0 additions & 15 deletions contracts/test/ERC20Token1.sol

This file was deleted.

15 changes: 0 additions & 15 deletions contracts/test/ERC20Token2.sol

This file was deleted.

30 changes: 0 additions & 30 deletions contracts/test/FakeERC20Token.sol

This file was deleted.

34 changes: 0 additions & 34 deletions contracts/test/FakeERC20Token2.sol

This file was deleted.

Loading

0 comments on commit ef099c8

Please sign in to comment.