Skip to content

Commit

Permalink
chore: husky and small fixe
Browse files Browse the repository at this point in the history
  • Loading branch information
rotnes committed Oct 27, 2022
1 parent 702a343 commit 72ebc67
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 14 deletions.
11 changes: 4 additions & 7 deletions contracts/ArrakisV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ contract ArrakisV2 is IUniswapV3MintCallback, ArrakisV2Storage {
) external onlyManager {
for (uint256 i = 0; i < ranges_.length; i++) {
(bool exist, ) = Position.rangeExist(ranges, ranges_[i]);
require(!exist, "R");
require(!exist, "NRRE");
// check that the pool exist on Uniswap V3.
address pool = factory.getPool(
address(token0),
Expand All @@ -237,7 +237,7 @@ contract ArrakisV2 is IUniswapV3MintCallback, ArrakisV2Storage {
require(pool != address(0), "NUP");
require(_pools.contains(pool), "P");
// TODO: can reuse the pool got previously.
require(Pool.validateTickSpacing(pool, ranges_[i]), "R");
require(Pool.validateTickSpacing(pool, ranges_[i]), "RTS");

ranges.push(ranges_[i]);
}
Expand All @@ -257,7 +257,7 @@ contract ArrakisV2 is IUniswapV3MintCallback, ArrakisV2Storage {
ranges,
rangesToRemove_[i]
);
require(exist, "NR");
require(exist, "RRNE");

Position.requireNotActiveRange(
factory,
Expand Down Expand Up @@ -371,9 +371,6 @@ contract ArrakisV2 is IUniswapV3MintCallback, ArrakisV2Storage {
);
require(success, "SC");

token0.safeApprove(address(rebalanceParams_.swap.router), 0);
token1.safeApprove(address(rebalanceParams_.swap.router), 0);

uint256 balance0After = token0.balanceOf(address(this));
uint256 balance1After = token1.balanceOf(address(this));

Expand Down Expand Up @@ -417,7 +414,7 @@ contract ArrakisV2 is IUniswapV3MintCallback, ArrakisV2Storage {
ranges,
rebalanceParams_.deposits[i].range
);
require(exist, "NR");
require(exist, "DRE");

(uint256 amt0, uint256 amt1) = pool.mint(
address(this),
Expand Down
4 changes: 2 additions & 2 deletions contracts/abstract/ArrakisV2FactoryStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ abstract contract ArrakisV2FactoryStorage is
(bool success, bytes memory returndata) = proxy.staticcall(
hex"f851a440"
);
require(success);
require(success, "PA");
return abi.decode(returndata, (address));
}

Expand All @@ -103,7 +103,7 @@ abstract contract ArrakisV2FactoryStorage is
(bool success, bytes memory returndata) = proxy.staticcall(
hex"5c60da1b"
);
require(success);
require(success, "PI");
return abi.decode(returndata, (address));
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/abstract/ArrakisV2Storage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ abstract contract ArrakisV2Storage is

function blacklistRouters(address[] calldata routers_) external onlyOwner {
for (uint256 i = 0; i < routers_.length; i++) {
require(_routers.contains(routers_[i]), "NR");
require(_routers.contains(routers_[i]), "RW");

_routers.remove(routers_[i]);
}
Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
"lint": "eslint --cache . && yarn lint:sol",
"lint:ts": "eslint -c .eslintrc.json --ext \"**/*.ts\" \"**/*.test.ts\"",
"lint:sol": "solhint 'contracts/**/*.sol'",
"postinstall": "yarn husky install",
"postinstall": "husky install",
"prepack": "pinst --disable",
"postpack": "pinst --enable",
"test": "npx hardhat test",
"verify": "npx hardhat etherscan-verify",
"script-matic:create-vault-v2": "npx hardhat --network polygon run ./scripts/createVaultV2.ts",
Expand Down Expand Up @@ -42,8 +44,8 @@
"@typescript-eslint/eslint-plugin": "5.28.0",
"@typescript-eslint/parser": "5.28.0",
"@uniswap/v3-core": "1.0.1",
"@uniswap/v3-sdk": "3.8.3",
"@uniswap/v3-periphery": "1.4.1",
"@uniswap/v3-sdk": "3.8.3",
"chai": "4.3.6",
"dotenv": "16.0.1",
"eslint": "8.18.0",
Expand All @@ -58,6 +60,7 @@
"jsbi": "^4.3.0",
"lint-staged": "13.0.2",
"node-fetch": "3.2.6",
"pinst": "^3.0.0",
"prettier": "2.5.1",
"prettier-plugin-solidity": "1.0.0-beta.24",
"solhint": "3.3.6",
Expand All @@ -73,7 +76,7 @@
},
"repository": {
"type": "git",
"url": "git+ssh://[email protected]/ArrakisFinance/vault-v2-core"
"url": "git+ssh://[email protected]/ArrakisFinance/v2-core"
},
"keywords": [
"arrakis",
Expand All @@ -92,5 +95,5 @@
"homepage": "https://github.com/ArrakisFinance/v2-core#readme",
"description": "Arrakis V2 Automated Market Maker",
"license": "MIT",
"version": "0.1.0"
"version": "0.1.1"
}
5 changes: 5 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8286,6 +8286,11 @@ pinkie@^2.0.0:
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
integrity sha512-MnUuEycAemtSaeFSjXKW/aroV7akBbY+Sv+RkyqFjgAe73F+MR0TBWKBRDkmfWq/HiFmdavfZ1G7h4SPZXaCSg==

pinst@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/pinst/-/pinst-3.0.0.tgz#80dec0a85f1f993c6084172020f3dbf512897eec"
integrity sha512-cengSmBxtCyaJqtRSvJorIIZXMXg+lJ3sIljGmtBGUVonMnMsVJbnzl6jGN1HkOWwxNuJynCJ2hXxxqCQrFDdw==

posix-character-classes@^0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
Expand Down

0 comments on commit 72ebc67

Please sign in to comment.