-
Notifications
You must be signed in to change notification settings - Fork 0
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
added a script for computing contract addresses #48
Merged
RobinNagpal
merged 10 commits into
market_updte_v1_changes
from
other_chain_deployments
Oct 21, 2024
Merged
Changes from 2 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
8fea83f
added a script for computing contract addresses
MSamiTariq 1136b7b
added the missing constructor argument
MSamiTariq 5dd1d0a
grant write permission to fix dorny/test-reporter@v1 error
MSamiTariq 853fc84
skipping proposal 348 and 349
MSamiTariq 986c650
added a filter for RewardsScenario
MSamiTariq 9a94716
reduced the amount for the scenario to pass
MSamiTariq 8ee8fde
removed block number
MSamiTariq 119ebdb
added optional paramter `blockNumber`
MSamiTariq 8649c1d
Come cleanups
RobinNagpal 91176b7
addressed feedback
MSamiTariq File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
forge/script/marketupdates/ComputeContractsAddresses.s.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.0; | ||
|
||
import "@forge-std/src/Script.sol"; | ||
import "@forge-std/src/console.sol"; | ||
import "@comet-contracts/marketupdates/MarketUpdateTimelock.sol"; | ||
import "@comet-contracts/marketupdates/MarketUpdateProposer.sol"; | ||
import "@comet-contracts/Configurator.sol"; | ||
import "@comet-contracts/CometProxyAdmin.sol"; | ||
import "@comet-contracts/marketupdates/MarketAdminPermissionChecker.sol"; | ||
import "@comet-contracts/Create2DeployerInterface.sol"; | ||
import "./helpers/MarketUpdateAddresses.sol"; | ||
import "./helpers/MarketUpdateContractsDeployer.sol"; | ||
import "./helpers/ChainAddresses.sol"; | ||
|
||
contract ComputeContractAddresses is Script { | ||
address public deployedWalletAddress; | ||
|
||
address constant public create2DeployerAddress = 0x13b0D85CcB8bf860b6b79AF3029fCA081AE9beF2; | ||
address constant public ZER0_ADDRESS_MARKET_UPDATE_PROPOSAL_GUARDIAN = address(0); | ||
address constant public ZER0_ADDRESS_MARKET_ADMIN_PAUSE_GUARDIAN = address(0); | ||
address constant public INITIAL_ADDRESS_MARKET_UPDATE_MULTI_SIG = address(0x7e14050080306cd36b47DE61ce604b3a1EC70c4e); | ||
|
||
|
||
function run() external { | ||
uint256 passedChainId = vm.envUint("CHAIN_ID"); | ||
|
||
require(block.chainid == passedChainId, "Chain ID mismatch"); | ||
Check notice Code scanning / Semgrep OSS Semgrep Finding: rules.solidity.performance.use-custom-error-not-require Note
Consider using custom errors as they are more gas efficient while allowing developers
to describe the error in detail using NatSpec. |
||
|
||
ChainAddresses.Chain chain = ChainAddresses.getChainBasedOnChainId(passedChainId); | ||
ChainAddresses.ChainAddressesStruct memory chainAddresses = ChainAddresses.getChainAddresses(chain); | ||
|
||
console.log("Deploying contracts with sender: ", msg.sender); | ||
|
||
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY"); | ||
|
||
address deployer = vm.rememberKey(deployerPrivateKey); | ||
vm.startBroadcast(deployer); | ||
|
||
console.log("Broadcasting transaction with deployer: ", deployer); | ||
|
||
bytes32 salt = keccak256(abi.encodePacked(vm.envString("SALT"))); | ||
|
||
/// Call library function | ||
MarketUpdateContractsDeployer.DeployedContracts memory deployedContracts = MarketUpdateContractsDeployer._prepareAndDeployContracts( | ||
salt, | ||
msg.sender, | ||
chainAddresses.marketAdmin, | ||
chainAddresses.marketUpdatePauseGuardian, | ||
chainAddresses.marketUpdateProposalGuardian, | ||
chainAddresses.governorTimelockAddress, | ||
false // deploy flag set to false | ||
); | ||
|
||
/// Console log deployed contracts | ||
console.log("MarketUpdateTimelock: ", deployedContracts.marketUpdateTimelock); | ||
console.log("MarketUpdateProposer: ", deployedContracts.marketUpdateProposer); | ||
console.log("NewConfiguratorImplementation: ", deployedContracts.newConfiguratorImplementation); | ||
console.log("NewCometProxyAdmin: ", deployedContracts.newCometProxyAdmin); | ||
console.log("MarketAdminPermissionChecker: ", deployedContracts.marketAdminPermissionChecker); | ||
|
||
vm.stopBroadcast(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check notice
Code scanning / Semgrep OSS
Semgrep Finding: compound.solidity.constant-not-in-uppercase Note