Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: rebrand components #157

Merged
merged 3 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cache/
out/
.vscode
.idea
.idea
12 changes: 6 additions & 6 deletions src/Components.sol
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.9.0;

import "./Assertions.sol";
import "./Cheats.sol";
import "./console.sol";
import "./console2.sol";
import "./Errors.sol";
import "./Math.sol";
import "./Storage.sol";
import "./Utils.sol";
import "./StdAssertions.sol";
import "./StdCheats.sol";
import "./StdError.sol";
import "./StdMath.sol";
import "./StdStorage.sol";
import "./StdUtils.sol";
import "./Vm.sol";
4 changes: 2 additions & 2 deletions src/Script.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.9.0;

import {CheatsSafe, console, console2, stdMath, stdStorageSafe, StdStorage, Utils, VmSafe} from "./Components.sol";
import {StdCheatsSafe, console, console2, stdMath, stdStorageSafe, StdStorage, StdUtils, VmSafe} from "./Components.sol";

abstract contract ScriptBase {
address internal constant VM_ADDRESS = address(uint160(uint256(keccak256("hevm cheat code"))));
Expand All @@ -10,6 +10,6 @@ abstract contract ScriptBase {
VmSafe internal constant vm = VmSafe(VM_ADDRESS);
}

abstract contract Script is ScriptBase, CheatsSafe, Utils {
abstract contract Script is ScriptBase, StdCheatsSafe, StdUtils {
bool public IS_SCRIPT = true;
}
4 changes: 2 additions & 2 deletions src/Assertions.sol → src/StdAssertions.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
pragma solidity >=0.6.0 <0.9.0;

import "ds-test/test.sol";
import "./Math.sol";
import "./StdMath.sol";

abstract contract Assertions is DSTest {
abstract contract StdAssertions is DSTest {
event log_array(uint256[] val);
event log_array(int256[] val);
event log_array(address[] val);
Expand Down
8 changes: 4 additions & 4 deletions src/Cheats.sol → src/StdCheats.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.9.0;

import "./Storage.sol";
import "./StdStorage.sol";
import "./Vm.sol";

abstract contract CheatsSafe {
abstract contract StdCheatsSafe {
VmSafe private constant vm = VmSafe(address(uint160(uint256(keccak256("hevm cheat code")))));

// Deploy a contract by fetching the contract bytecode from
Expand Down Expand Up @@ -76,8 +76,8 @@ abstract contract CheatsSafe {
}
}

// Wrappers around Cheats to avoid footguns
abstract contract Cheats is CheatsSafe {
// Wrappers around cheatcodes to avoid footguns
abstract contract StdCheats is StdCheatsSafe {
using stdStorage for StdStorage;

StdStorage private stdstore;
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 0 additions & 6 deletions src/Storage.sol → src/StdStorage.sol
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,6 @@ library stdStorage {
return stdStorageSafe.sigs(sigStr);
}

/// @notice find an arbitrary storage slot given a function sig, input data, address of the contract and a value to check against
// slot complexity:
// if flat, will be bytes32(uint256(uint));
// if map, will be keccak256(abi.encode(key, uint(slot)));
// if deep map, will be keccak256(abi.encode(key1, keccak256(abi.encode(key0, uint(slot)))));
// if map struct, will be bytes32(uint256(keccak256(abi.encode(key1, keccak256(abi.encode(key0, uint(slot)))))) + structFieldDepth);
mds1 marked this conversation as resolved.
Show resolved Hide resolved
function find(
StdStorage storage self
)
Expand Down
2 changes: 1 addition & 1 deletion src/Utils.sol → src/StdUtils.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma solidity >=0.6.0 <0.9.0;

import "./console2.sol";

abstract contract Utils {
abstract contract StdUtils {
uint256 internal constant UINT256_MAX =
115792089237316195423570985008687907853269984665640564039457584007913129639935;

Expand Down
2 changes: 1 addition & 1 deletion src/Test.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ abstract contract TestBase {
Vm internal constant vm = Vm(VM_ADDRESS);
}

abstract contract Test is TestBase, DSTest, Assertions, Cheats, Utils {}
abstract contract Test is TestBase, DSTest, StdAssertions, StdCheats, StdUtils {}
2 changes: 1 addition & 1 deletion src/test/StdCheats.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;

import "../Cheats.sol";
import "../StdCheats.sol";
import "../Test.sol";

contract StdCheatsTest is Test {
Expand Down
2 changes: 1 addition & 1 deletion src/test/StdError.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;

import "../Errors.sol";
import "../StdError.sol";
import "../Test.sol";

contract StdErrorsTest is Test {
Expand Down
2 changes: 1 addition & 1 deletion src/test/StdMath.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.8.0 <0.9.0;

import "../Math.sol";
import "../StdMath.sol";
import "../Test.sol";

contract StdMathTest is Test {
Expand Down
2 changes: 1 addition & 1 deletion src/test/StdStorage.t.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;

import "../Storage.sol";
import "../StdStorage.sol";
import "../Test.sol";

contract StdStorageTest is Test {
Expand Down