Skip to content

Commit

Permalink
feat: add v4-core deployment address
Browse files Browse the repository at this point in the history
  • Loading branch information
ChefMist committed Mar 25, 2024
1 parent 7dbd664 commit e6f1ed8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ 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
export PRIVATE_KEY=0x
// optional. Only set if you want to verify contract on explorer
export ETHERSCAN_API_KEY=xx
export ETHERSCAN_API_KEY=
```

### 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"
}

0 comments on commit e6f1ed8

Please sign in to comment.