-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix failing of scenario and separate out calculation of create 2 addr…
…esses
- Loading branch information
1 parent
771d6f4
commit c60c008
Showing
9 changed files
with
231 additions
and
48 deletions.
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
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
63 changes: 63 additions & 0 deletions
63
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,63 @@ | ||
// 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; | ||
Check notice Code scanning / Semgrep OSS Semgrep Finding: compound.solidity.constant-not-in-uppercase Note
A constant name is not in UPPER_CASE like other constant variables.
|
||
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.calculateContractAddresses( | ||
salt, | ||
msg.sender, | ||
chainAddresses.marketAdmin, | ||
chainAddresses.marketUpdatePauseGuardian, | ||
chainAddresses.marketUpdateProposalGuardian, | ||
chainAddresses.governorTimelockAddress | ||
); | ||
|
||
/// 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
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.