Skip to content
This repository has been archived by the owner on Oct 3, 2023. It is now read-only.

Commit

Permalink
chore: add husky pre-commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
amusingaxl committed Oct 19, 2022
1 parent 5165156 commit 6f72854
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx lint-staged
11 changes: 6 additions & 5 deletions src/Safebox.sol
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,7 @@ contract Safebox is WardsLike, CanLike, FileLike {
(bool success, bytes memory result) = token.call(
abi.encodeWithSelector(ERC20Like(address(0)).transferFrom.selector, from, to, amount)
);
require(
success && (result.length == 0 || abi.decode(result, (bool))),
"Safebox/token-transfer-from-failed"
);
require(success && (result.length == 0 || abi.decode(result, (bool))), "Safebox/token-transfer-from-failed");
}

function _safeTransfer(
Expand All @@ -136,7 +133,11 @@ contract Safebox is WardsLike, CanLike, FileLike {
interface ERC20Like {
function transfer(address to, uint256 amt) external returns (bool);

function transferFrom(address from, address to, uint256 amt) external returns (bool);
function transferFrom(
address from,
address to,
uint256 amt
) external returns (bool);

function balanceOf(address usr) external view returns (uint256);
}

0 comments on commit 6f72854

Please sign in to comment.