Skip to content

Commit

Permalink
Merge branch 'main' into feat/foundry-reports
Browse files Browse the repository at this point in the history
  • Loading branch information
gas1cent authored May 20, 2024
2 parents c0a886b + 1e9f2a5 commit 2fd5d36
Show file tree
Hide file tree
Showing 9 changed files with 534 additions and 1,024 deletions.
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ sort_imports = true

[profile.default]
solc_version = '0.8.23'
libs = ['node_modules']
libs = ['node_modules', 'lib']
optimizer_runs = 10_000

[profile.optimized]
Expand Down
20 changes: 8 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"build": "forge build",
"build:optimized": "FOUNDRY_PROFILE=optimized forge build",
"coverage": "forge coverage --match-contract Unit",
"deploy:mainnet": "bash -c 'source .env && forge script Deploy --broadcast --chain mainnet --private-key $MAINNET_DEPLOYER_PK'",
"deploy:sepolia": "bash -c 'source .env && forge script Deploy --broadcast --chain sepolia --private-key $SEPOLIA_DEPLOYER_PK'",
"deploy:mainnet": "bash -c 'source .env && forge script Deploy -vvvvv --rpc-url $MAINNET_RPC --broadcast --chain mainnet --private-key $MAINNET_DEPLOYER_PK'",
"deploy:sepolia": "bash -c 'source .env && forge script Deploy -vvvvv --rpc-url $SEPOLIA_RPC --broadcast --chain sepolia --private-key $SEPOLIA_DEPLOYER_PK'",
"lint:check": "yarn lint:sol-tests && yarn lint:sol-logic && forge fmt --check",
"lint:fix": "sort-package-json && forge fmt && yarn lint:sol-tests --fix && yarn lint:sol-logic --fix",
"lint:natspec": "npx @defi-wonderland/natspec-smells --config natspec-smells.config.js",
Expand All @@ -32,18 +32,14 @@
"test/**/*.sol": "yarn lint:sol-tests",
"package.json": "sort-package-json"
},
"dependencies": {
"isolmate": "github:defi-wonderland/isolmate#59e1804"
},
"devDependencies": {
"@commitlint/cli": "17.0.3",
"@commitlint/config-conventional": "17.0.3",
"@defi-wonderland/natspec-smells": "1.0.3",
"ds-test": "github:dapphub/ds-test#e282159",
"forge-std": "github:foundry-rs/forge-std#4513bc2",
"@commitlint/cli": "19.3.0",
"@commitlint/config-conventional": "19.2.2",
"@defi-wonderland/natspec-smells": "1.1.1",
"forge-std": "github:foundry-rs/forge-std#1.8.2",
"husky": ">=8",
"lint-staged": ">=10",
"solhint": "github:solhint-community/solhint-community#v4.0.0-rc01",
"sort-package-json": "1.53.1"
"solhint-community": "4.0.0",
"sort-package-json": "2.10.0"
}
}
2 changes: 0 additions & 2 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
ds-test/=node_modules/ds-test/src
forge-std/=node_modules/forge-std/src
isolmate/=node_modules/isolmate/src

contracts/=src/contracts
interfaces/=src/interfaces
2 changes: 1 addition & 1 deletion script/Deploy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity 0.8.23;

import {Greeter} from 'contracts/Greeter.sol';
import {Script} from 'forge-std/Script.sol';
import {IERC20} from 'isolmate/interfaces/tokens/IERC20.sol';
import {IERC20} from 'forge-std/interfaces/IERC20.sol';

contract Deploy is Script {
struct DeploymentParams {
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/Greeter.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;

import {IERC20} from 'forge-std/interfaces/IERC20.sol';
import {IGreeter} from 'interfaces/IGreeter.sol';
import {IERC20} from 'isolmate/interfaces/tokens/IERC20.sol';

contract Greeter is IGreeter {
/**
Expand Down
23 changes: 11 additions & 12 deletions src/interfaces/IGreeter.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.23;

import {IERC20} from 'isolmate/interfaces/tokens/IERC20.sol';
import {IERC20} from 'forge-std/interfaces/IERC20.sol';

/**
* @title Greeter Contract
Expand Down Expand Up @@ -33,16 +33,6 @@ interface IGreeter {
*/
error Greeter_InvalidGreeting();

/*///////////////////////////////////////////////////////////////
LOGIC
//////////////////////////////////////////////////////////////*/
/**
* @notice Sets a new greeting
* @dev Only callable by the owner
* @param _newGreeting The new greeting to be set
*/
function setGreeting(string memory _newGreeting) external;

/*///////////////////////////////////////////////////////////////
VARIABLES
//////////////////////////////////////////////////////////////*/
Expand All @@ -65,9 +55,18 @@ interface IGreeter {
*/
function token() external view returns (IERC20 _token);

/*///////////////////////////////////////////////////////////////
LOGIC
//////////////////////////////////////////////////////////////*/
/**
* @notice Sets a new greeting
* @dev Only callable by the owner
* @param _newGreeting The new greeting to be set
*/
function setGreeting(string memory _newGreeting) external;

/**
* @notice Greets the caller
*
* @return _greeting The greeting
* @return _balance Current token balance of the caller
*/
Expand Down
2 changes: 1 addition & 1 deletion test/integration/IntegrationBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity 0.8.23;

import {Greeter, IGreeter} from 'contracts/Greeter.sol';
import {Test} from 'forge-std/Test.sol';
import {IERC20} from 'isolmate/interfaces/tokens/IERC20.sol';
import {IERC20} from 'forge-std/interfaces/IERC20.sol';

contract IntegrationBase is Test {
uint256 internal constant _FORK_BLOCK = 18_920_905;
Expand Down
2 changes: 1 addition & 1 deletion test/unit/Greeter.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity 0.8.23;

import {Greeter, IGreeter} from 'contracts/Greeter.sol';
import {Test} from 'forge-std/Test.sol';
import {IERC20} from 'isolmate/interfaces/tokens/IERC20.sol';
import {IERC20} from 'forge-std/interfaces/IERC20.sol';

abstract contract Base is Test {
address internal _owner = makeAddr('owner');
Expand Down
Loading

0 comments on commit 2fd5d36

Please sign in to comment.