Skip to content

Commit 6e6f29f

Browse files
committed
feat: update ide settings
1 parent 7f7040c commit 6e6f29f

23 files changed

+272
-52
lines changed

Diff for: .github/workflows/solidity.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ jobs:
8282
PAT_TOKEN: op://platform/github-commit-pat/credential
8383

8484
- name: Checkout
85-
uses: namespacelabs/nscloud-checkout-action@v5
85+
uses: namespacelabs/nscloud-checkout-action@v6
8686
with:
8787
token: ${{ env.PAT_TOKEN }}
8888

Diff for: .vscode/extensions.json

+10-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
{
22
"recommendations": [
33
"nomicfoundation.hardhat-solidity",
4-
"genieai.chatgpt-vscode",
54
"esbenp.prettier-vscode",
65
"cnshenj.vscode-task-manager",
76
"catppuccin.catppuccin-vsc-icons",
8-
"catppuccin.catppuccin-vsc"
7+
"catppuccin.catppuccin-vsc",
8+
"oven.bun-vscode",
9+
"editorconfig.editorconfig",
10+
"dbaeumer.vscode-eslint",
11+
"golang.go",
12+
"graphql.vscode-graphql-syntax",
13+
"yoavbls.pretty-ts-errors",
14+
"rooveterinaryinc.roo-cline",
15+
"bradlc.vscode-tailwindcss",
16+
"shardulm94.trailing-spaces"
917
]
1018
}

Diff for: lib/forge-std/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ forge install foundry-rs/forge-std
1313
## Contracts
1414
### stdError
1515

16-
This is a helper contract for errors and reverts. In Forge, this contract is particularly helpful for the `expectRevert` cheatcode, as it provides all compiler builtin errors.
16+
This is a helper contract for errors and reverts. In Forge, this contract is particularly helpful for the `expectRevert` cheatcode, as it provides all compiler built-in errors.
1717

1818
See the contract itself for all error codes.
1919

Diff for: lib/forge-std/foundry.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ optimizer_runs = 200
55

66
[rpc_endpoints]
77
# The RPC URLs are modified versions of the default for testing initialization.
8-
mainnet = "https://eth-mainnet.alchemyapi.io/v2/WV407BEiBmjNJfKo9Uo_55u0z0ITyCOX" # Different API key.
8+
mainnet = "https://eth.merkle.io" # Different API key.
99
optimism_sepolia = "https://sepolia.optimism.io/" # Adds a trailing slash.
1010
arbitrum_one_sepolia = "https://sepolia-rollup.arbitrum.io/rpc/" # Adds a trailing slash.
1111
needs_undefined_env_var = "${UNDEFINED_RPC_URL_PLACEHOLDER}"

Diff for: lib/forge-std/src/Base.sol

+16-9
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,26 @@ import {StdStorage} from "./StdStorage.sol";
55
import {Vm, VmSafe} from "./Vm.sol";
66

77
abstract contract CommonBase {
8-
// Cheat code address, 0x7109709ECfa91a80626fF3989D68f67F5b1DD12D.
9-
address internal constant VM_ADDRESS = address(uint160(uint256(keccak256("hevm cheat code"))));
10-
// console.sol and console2.sol work by executing a staticcall to this address.
8+
/// @dev Cheat code address.
9+
/// Calculated as `address(uint160(uint256(keccak256("hevm cheat code"))))`.
10+
address internal constant VM_ADDRESS = 0x7109709ECfa91a80626fF3989D68f67F5b1DD12D;
11+
/// @dev console.sol and console2.sol work by executing a staticcall to this address.
12+
/// Calculated as `address(uint160(uint88(bytes11("console.log"))))`.
1113
address internal constant CONSOLE = 0x000000000000000000636F6e736F6c652e6c6f67;
12-
// Used when deploying with create2, https://github.com/Arachnid/deterministic-deployment-proxy.
14+
/// @dev Used when deploying with create2.
15+
/// Taken from https://github.com/Arachnid/deterministic-deployment-proxy.
1316
address internal constant CREATE2_FACTORY = 0x4e59b44847b379578588920cA78FbF26c0B4956C;
14-
// Default address for tx.origin and msg.sender, 0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38.
15-
address internal constant DEFAULT_SENDER = address(uint160(uint256(keccak256("foundry default caller"))));
16-
// Address of the test contract, deployed by the DEFAULT_SENDER.
17+
/// @dev The default address for tx.origin and msg.sender.
18+
/// Calculated as `address(uint160(uint256(keccak256("foundry default caller"))))`.
19+
address internal constant DEFAULT_SENDER = 0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38;
20+
/// @dev The address of the first contract `CREATE`d by a running test contract.
21+
/// When running tests, each test contract is `CREATE`d by `DEFAULT_SENDER` with nonce 1.
22+
/// Calculated as `VM.computeCreateAddress(VM.computeCreateAddress(DEFAULT_SENDER, 1), 1)`.
1723
address internal constant DEFAULT_TEST_CONTRACT = 0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f;
18-
// Deterministic deployment address of the Multicall3 contract.
24+
/// @dev Deterministic deployment address of the Multicall3 contract.
25+
/// Taken from https://www.multicall3.com.
1926
address internal constant MULTICALL3_ADDRESS = 0xcA11bde05977b3631167028862bE2a173976CA11;
20-
// The order of the secp256k1 curve.
27+
/// @dev The order of the secp256k1 curve.
2128
uint256 internal constant SECP256K1_ORDER =
2229
115792089237316195423570985008687907852837564279074904382605163141518161494337;
2330

Diff for: lib/forge-std/src/Script.sol

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {console2} from "./console2.sol";
1010
import {safeconsole} from "./safeconsole.sol";
1111
import {StdChains} from "./StdChains.sol";
1212
import {StdCheatsSafe} from "./StdCheats.sol";
13+
import {StdConstants} from "./StdConstants.sol";
1314
import {stdJson} from "./StdJson.sol";
1415
import {stdMath} from "./StdMath.sol";
1516
import {StdStorage, stdStorageSafe} from "./StdStorage.sol";

Diff for: lib/forge-std/src/StdChains.sol

+1-3
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,7 @@ abstract contract StdChains {
196196

197197
// If adding an RPC here, make sure to test the default RPC URL in `test_Rpcs` in `StdChains.t.sol`
198198
setChainWithDefaultRpcUrl("anvil", ChainData("Anvil", 31337, "http://127.0.0.1:8545"));
199-
setChainWithDefaultRpcUrl(
200-
"mainnet", ChainData("Mainnet", 1, "https://eth-mainnet.alchemyapi.io/v2/pwc5rmJhrdoaSEfimoKEmsvOjKSmPDrP")
201-
);
199+
setChainWithDefaultRpcUrl("mainnet", ChainData("Mainnet", 1, "https://eth.llamarpc.com"));
202200
setChainWithDefaultRpcUrl(
203201
"sepolia", ChainData("Sepolia", 11155111, "https://sepolia.infura.io/v3/b9794ad1ddf84dfb8c34d6bb5dca2001")
204202
);

Diff for: lib/forge-std/src/StdConstants.sol

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity >=0.6.2 <0.9.0;
3+
4+
import {IMulticall3} from "./interfaces/IMulticall3.sol";
5+
import {Vm} from "./Vm.sol";
6+
7+
library StdConstants {
8+
/// @dev Cheat code address.
9+
/// Calculated as `address(uint160(uint256(keccak256("hevm cheat code"))))`.
10+
Vm internal constant VM = Vm(0x7109709ECfa91a80626fF3989D68f67F5b1DD12D);
11+
/// @dev console.sol and console2.sol work by executing a staticcall to this address.
12+
/// Calculated as `address(uint160(uint88(bytes11("console.log"))))`.
13+
address internal constant CONSOLE = 0x000000000000000000636F6e736F6c652e6c6f67;
14+
/// @dev Used when deploying with create2.
15+
/// Taken from https://github.com/Arachnid/deterministic-deployment-proxy.
16+
address internal constant CREATE2_FACTORY = 0x4e59b44847b379578588920cA78FbF26c0B4956C;
17+
/// @dev The default address for tx.origin and msg.sender.
18+
/// Calculated as `address(uint160(uint256(keccak256("foundry default caller"))))`.
19+
address internal constant DEFAULT_SENDER = 0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38;
20+
/// @dev The address of the first contract `CREATE`d by a running test contract.
21+
/// When running tests, each test contract is `CREATE`d by `DEFAULT_SENDER` with nonce 1.
22+
/// Calculated as `VM.computeCreateAddress(VM.computeCreateAddress(DEFAULT_SENDER, 1), 1)`.
23+
address internal constant DEFAULT_TEST_CONTRACT = 0x5615dEB798BB3E4dFa0139dFa1b3D433Cc23b72f;
24+
/// @dev Deterministic deployment address of the Multicall3 contract.
25+
/// Taken from https://www.multicall3.com.
26+
IMulticall3 internal constant MULTICALL3_ADDRESS = IMulticall3(0xcA11bde05977b3631167028862bE2a173976CA11);
27+
/// @dev The order of the secp256k1 curve.
28+
uint256 internal constant SECP256K1_ORDER =
29+
115792089237316195423570985008687907852837564279074904382605163141518161494337;
30+
}

Diff for: lib/forge-std/src/Test.sol

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {safeconsole} from "./safeconsole.sol";
1313
import {StdAssertions} from "./StdAssertions.sol";
1414
import {StdChains} from "./StdChains.sol";
1515
import {StdCheats} from "./StdCheats.sol";
16+
import {StdConstants} from "./StdConstants.sol";
1617
import {stdError} from "./StdError.sol";
1718
import {StdInvariant} from "./StdInvariant.sol";
1819
import {stdJson} from "./StdJson.sol";

Diff for: lib/forge-std/src/interfaces/IERC1155.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity >=0.6.2;
33

4-
import "./IERC165.sol";
4+
import {IERC165} from "./IERC165.sol";
55

66
/// @title ERC-1155 Multi Token Standard
77
/// @dev See https://eips.ethereum.org/EIPS/eip-1155

Diff for: lib/forge-std/src/interfaces/IERC4626.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity >=0.6.2;
33

4-
import "./IERC20.sol";
4+
import {IERC20} from "./IERC20.sol";
55

66
/// @dev Interface of the ERC4626 "Tokenized Vault Standard", as defined in
77
/// https://eips.ethereum.org/EIPS/eip-4626

Diff for: lib/forge-std/src/interfaces/IERC6909.sol

+72
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity >=0.6.2;
3+
4+
import {IERC165} from "./IERC165.sol";
5+
6+
/// @dev Required interface of an ERC-6909 compliant contract, as defined in
7+
/// https://eips.ethereum.org/EIPS/eip-6909
8+
interface IERC6909 is IERC165 {
9+
/// @dev Emitted when the allowance of a `spender` for an `owner` is set for a token of type `id`.
10+
event Approval(address indexed owner, address indexed spender, uint256 indexed id, uint256 amount);
11+
12+
/// @dev Emitted when `owner` grants or revokes operator status for a `spender`.
13+
event OperatorSet(address indexed owner, address indexed spender, bool approved);
14+
15+
/// @dev Emitted when `amount` tokens of type `id` are moved from `sender` to `receiver` initiated by `caller`.
16+
event Transfer(
17+
address caller, address indexed sender, address indexed receiver, uint256 indexed id, uint256 amount
18+
);
19+
20+
///@dev Returns the amount of tokens of type `id` owned by `owner`.
21+
function balanceOf(address owner, uint256 id) external view returns (uint256);
22+
23+
/// @dev Returns the amount of tokens of type `id` that `spender` is allowed to spend on behalf of `owner`.
24+
/// NOTE: Does not include operator allowances.
25+
function allowance(address owner, address spender, uint256 id) external view returns (uint256);
26+
27+
/// @dev Returns true if `spender` is set as an operator for `owner`.
28+
function isOperator(address owner, address spender) external view returns (bool);
29+
30+
/// @dev Sets an approval to `spender` for `amount` tokens of type `id` from the caller's tokens.
31+
/// Must return true.
32+
function approve(address spender, uint256 id, uint256 amount) external returns (bool);
33+
34+
/// @dev Grants or revokes unlimited transfer permission of any token id to `spender` for the caller's tokens.
35+
/// Must return true.
36+
function setOperator(address spender, bool approved) external returns (bool);
37+
38+
/// @dev Transfers `amount` of token type `id` from the caller's account to `receiver`.
39+
/// Must return true.
40+
function transfer(address receiver, uint256 id, uint256 amount) external returns (bool);
41+
42+
/// @dev Transfers `amount` of token type `id` from `sender` to `receiver`.
43+
/// Must return true.
44+
function transferFrom(address sender, address receiver, uint256 id, uint256 amount) external returns (bool);
45+
}
46+
47+
/// @dev Optional extension of {IERC6909} that adds metadata functions.
48+
interface IERC6909Metadata is IERC6909 {
49+
/// @dev Returns the name of the token of type `id`.
50+
function name(uint256 id) external view returns (string memory);
51+
52+
/// @dev Returns the ticker symbol of the token of type `id`.
53+
function symbol(uint256 id) external view returns (string memory);
54+
55+
/// @dev Returns the number of decimals for the token of type `id`.
56+
function decimals(uint256 id) external view returns (uint8);
57+
}
58+
59+
/// @dev Optional extension of {IERC6909} that adds content URI functions.
60+
interface IERC6909ContentURI is IERC6909 {
61+
/// @dev Returns URI for the contract.
62+
function contractURI() external view returns (string memory);
63+
64+
/// @dev Returns the URI for the token of type `id`.
65+
function tokenURI(uint256 id) external view returns (string memory);
66+
}
67+
68+
/// @dev Optional extension of {IERC6909} that adds a token supply function.
69+
interface IERC6909TokenSupply is IERC6909 {
70+
/// @dev Returns the total supply of the token of type `id`.
71+
function totalSupply(uint256 id) external view returns (uint256);
72+
}

Diff for: lib/forge-std/src/interfaces/IERC721.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity >=0.6.2;
33

4-
import "./IERC165.sol";
4+
import {IERC165} from "./IERC165.sol";
55

66
/// @title ERC-721 Non-Fungible Token Standard
77
/// @dev See https://eips.ethereum.org/EIPS/eip-721

Diff for: lib/forge-std/src/interfaces/IERC7540.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity >=0.6.2;
33

4-
import "./IERC7575.sol";
4+
import {IERC7575} from "./IERC7575.sol";
55

66
/// @dev Interface of the base operator logic of ERC7540, as defined in
77
/// https://eips.ethereum.org/EIPS/eip-7540

Diff for: lib/forge-std/src/interfaces/IERC7575.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity >=0.6.2;
33

4-
import "./IERC165.sol";
4+
import {IERC165} from "./IERC165.sol";
55

66
/// @dev Interface of the ERC7575 "Multi-Asset ERC-4626 Vaults", as defined in
77
/// https://eips.ethereum.org/EIPS/eip-7575

Diff for: lib/forge-std/test/CommonBase.t.sol

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity >=0.7.0 <0.9.0;
3+
4+
import {CommonBase} from "../src/Base.sol";
5+
import {StdConstants} from "../src/StdConstants.sol";
6+
import {Test} from "../src/Test.sol";
7+
8+
contract CommonBaseTest is Test {
9+
function testVmAddressValue() public pure {
10+
assertEq(VM_ADDRESS, address(StdConstants.VM));
11+
}
12+
13+
function testConsoleValue() public pure {
14+
assertEq(CONSOLE, StdConstants.CONSOLE);
15+
}
16+
17+
function testCreate2FactoryValue() public pure {
18+
assertEq(CREATE2_FACTORY, StdConstants.CREATE2_FACTORY);
19+
}
20+
21+
function testDefaultSenderValue() public pure {
22+
assertEq(DEFAULT_SENDER, StdConstants.DEFAULT_SENDER);
23+
}
24+
25+
function testDefaultTestContractValue() public pure {
26+
assertEq(DEFAULT_TEST_CONTRACT, StdConstants.DEFAULT_TEST_CONTRACT);
27+
}
28+
29+
function testMulticall3AddressValue() public pure {
30+
assertEq(MULTICALL3_ADDRESS, address(StdConstants.MULTICALL3_ADDRESS));
31+
}
32+
33+
function testSecp256k1OrderValue() public pure {
34+
assertEq(SECP256K1_ORDER, StdConstants.SECP256K1_ORDER);
35+
}
36+
37+
function testUint256MaxValue() public pure {
38+
assertEq(UINT256_MAX, type(uint256).max);
39+
}
40+
41+
function testVmValue() public pure {
42+
assertEq(address(vm), address(StdConstants.VM));
43+
}
44+
}

Diff for: lib/forge-std/test/StdChains.t.sol

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ contract StdChainsMock is Test {
2424
contract StdChainsTest is Test {
2525
function test_ChainRpcInitialization() public {
2626
// RPCs specified in `foundry.toml` should be updated.
27-
assertEq(getChain(1).rpcUrl, "https://eth-mainnet.alchemyapi.io/v2/WV407BEiBmjNJfKo9Uo_55u0z0ITyCOX");
27+
assertEq(getChain(1).rpcUrl, "https://eth.merkle.io");
2828
assertEq(getChain("optimism_sepolia").rpcUrl, "https://sepolia.optimism.io/");
2929
assertEq(getChain("arbitrum_one_sepolia").rpcUrl, "https://sepolia-rollup.arbitrum.io/rpc/");
3030

@@ -36,7 +36,7 @@ contract StdChainsTest is Test {
3636

3737
// Cannot override RPCs defined in `foundry.toml`
3838
vm.setEnv("MAINNET_RPC_URL", "myoverride2");
39-
assertEq(getChain("mainnet").rpcUrl, "https://eth-mainnet.alchemyapi.io/v2/WV407BEiBmjNJfKo9Uo_55u0z0ITyCOX");
39+
assertEq(getChain("mainnet").rpcUrl, "https://eth.merkle.io");
4040

4141
// Other RPCs should remain unchanged.
4242
assertEq(getChain(31337).rpcUrl, "http://127.0.0.1:8545");

0 commit comments

Comments
 (0)