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: add v4-core deployment address #7

Merged
merged 2 commits into from
Mar 26, 2024
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ The scripts are located in `/script` folder, deployed contract address can be fo
// set script config: /script/config/{SCRIPT_CONFIG}.json
export SCRIPT_CONFIG=ethereum-sepolia

// set rpc url
// set rpc url
export RPC_URL=https://

// private key need to be prefixed with 0x
Expand All @@ -33,11 +33,11 @@ export ETHERSCAN_API_KEY=xx

### Execute

Refer to the script source code for the exact command
Refer to the script source code for the exact command

Example. within `script/01_DeployVault.s.sol`
```
// remove --verify flag if etherscan_api_key is set
// remove --verify flag if etherscan_api_key is not set
forge script script/01_DeployVault.s.sol:DeployVaultScript -vvv \
--rpc-url $RPC_URL \
--broadcast \
Expand Down
6 changes: 4 additions & 2 deletions script/BaseScript.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ abstract contract BaseScript is Script {
console.log("[BaseScript] Reading config from: ", path);
}

// reference: https://github.com/foundry-rs/foundry/blob/master/testdata/cheats/Json.t.sol
// reference: https://github.com/foundry-rs/foundry/blob/master/testdata/default/cheats/Json.t.sol
function getAddressFromConfig(string memory key) public view returns (address) {
string memory json = vm.readFile(path);
bytes memory data = vm.parseJson(json, string.concat(".", key));

// seems like foundry decode as 0x20 when address is not set or as "0x"
address decodedData = abi.decode(data, (address));
require(decodedData != address(0), "Address ZERO");
require(decodedData != address(0x20), "Address not set");

return decodedData;
}
Expand Down
6 changes: 3 additions & 3 deletions script/config/ethereum-sepolia.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"vault": "0x",
"clPoolManager": "0x",
"binPoolManager": "0x"
"vault": "0x42A228A7fB040033Dc49FdD5ed909F2cA742271D",
"clPoolManager": "0xC6A2Db661D5a5690172d8eB0a7DEA2d3008665A3",
"binPoolManager": "0xFCa69D6639293799A650dB7D273bc688bAF71FA7"
}
Loading