Skip to content

Commit

Permalink
a
Browse files Browse the repository at this point in the history
  • Loading branch information
6boris committed Oct 7, 2023
1 parent 21861f2 commit 3459e93
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"named-parameters-mapping": "warn",
"no-console": "off",
"not-rely-on-time": "off",
"one-contract-per-file": "off"
"one-contract-per-file": "off",
"custom-errors": "off"
}
}
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
VERSION = `git rev-parse --short HEAD`
PROGRAM=gin bar

all: fmt test
all: all test
@echo Run all scripts ...

fmt:
yarn prettier:write && yarn lint && yarn lint:sol
lint:
yarn lint

test:
forge test
8 changes: 3 additions & 5 deletions contracts/Ethernaut/01_Fallback.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Level } from "./00_Ethernaut.sol";
contract Fallback {
using Math for uint256;

mapping(address => uint256) public contributions;
mapping(address account => uint256 balance) public contributions;
address payable public owner;

constructor() payable {
Expand Down Expand Up @@ -38,10 +38,8 @@ contract Fallback {

function _fallback() private {
// naming has switched to fallback
require(
msg.value > 0 && contributions[msg.sender] > 0,
"tx must have value and msg.send must have made a contribution"
); // Add message with require
require(msg.value > 0 && contributions[msg.sender] > 0, "Not have made a contribution"); // Add message with
// require
owner = payable(msg.sender); // Type issues must be payable address
}

Expand Down
8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,9 @@
"private": true,
"scripts": {
"clean": "rm -rf cache out broadcast",
"build": "forge build",
"lint": "yarn lint:sol && yarn prettier:check",
"lint:sol": "forge fmt --check && yarn solhint foundry/{script,src,test}/**/*.sol",
"prettier:check": "prettier --check **/*.{json,md,yml} --ignore-path=.prettierignore",
"prettier:write": "prettier --write **/*.{json,md,yml} --ignore-path=.prettierignore",
"lint": "yarn lint:sol && yarn lint:prettier",
"lint:sol": "forge fmt && yarn solhint foundry/test/**/*.sol contracts/**/*.sol --fix",
"lint:prettier": "prettier --write **/*.{json,md,yml} --ignore-path=.prettierignore",
"test": "forge test",
"test:coverage": "forge coverage",
"test:coverage:report": "forge coverage --report lcov && genhtml lcov.info --branch-coverage --output-dir foundry/coverage"
Expand Down

0 comments on commit 3459e93

Please sign in to comment.