forked from compound-finance/comet
-
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.
Polygon cUSDCv3 deploy (compound-finance#598)
* Polygon cUSDCv3 deploy delete unused import Polygon OZ feedback (compound-finance#666) * consistent GRACE_PERIOD check * L-03 inconstent usage of uint across loops * L-04 Lack of indexed parameter * update bridge receiver test for GRACE_PERIOD check * change FxChild to IFxMessageProcessor; delete vendoza manifest * replace messageSender with rootMessageSender * replace ProposalNotQueued with ProposalNotExecutable * doc strings for ITimelock.sol * update additional rootMessageSender instances * doc strings for PolygonBridgeReceiver * typo, missing word * additional messageSender updates Address incorrectly setting `localTimelock` (compound-finance#665) * M-01 remove functions to update timelock * Check that local timelock's admin is the bridge receiver in initialize * Scenario to test L2 governance contracts upgrade flow * Remove comment * Fix lint * Small refactor --------- Co-authored-by: kevincheng96 <[email protected]> Polygon collateral assets (compound-finance#668) * update assets for polygon * update deploy script * WMATIC as alias * reorder assets * update bulker scens * lint * use WBTC / USD price feed * supply caps to 0 * bump supply cap for WMATIC update NativeTokenConstraint; add Polygon whales (compound-finance#670) Deploy Mumbai (compound-finance#595) * empty roots.json * Modified deployment roots from GitHub Actions * Clear out roots for redeploy * Modified deployment roots from GitHub Actions --------- Co-authored-by: GitHub Actions Bot <> Co-authored-by: kevincheng96 <[email protected]> Remove unused events from BaseBridgeReceiver Fix mumbai deploy script and re-deploy (compound-finance#676) * Modify mumbai deploy script to use polygon WETH and empty roots for re-deploy * Modified deployment roots from GitHub Actions * Fix bulker args in deploy script and remove bulker from roots * Modified deployment roots from GitHub Actions --------- Co-authored-by: GitHub Actions Bot <> Polygon Liquidator updates (compound-finance#677) remove (Polygon) from name (compound-finance#684) update Polygon timelock delay (compound-finance#682) * update polygon timelock delay * HOUR and DAY Define RewardTokenAddress in polygon configuration.json (compound-finance#683) * Update roots.json after deploy * Polygon enable cUSDCv3 proposal (compound-finance#672) * Polygon supply cap proposal update enact fn type update isBridgeProposal definition update proposal to take both deployment managers; target configurator instead of bridgeReceiver add fxRoot to roots.json update getCompWhales update MigrationConstraint logic to impersonate governanceDM's proposer update enact call in task update targetReserves Set entire Comet configuration (compound-finance#680) This allows us to update a variety of configs (e.g. CF, supply caps) more easily. Bridge USDC reserves and COMP rewards to Polygon Comet (compound-finance#681) This PR adds ERC20 bridging actions to the proposal for bridging USDC reserves and COMP rewards. I also added support for relaying Polygon token bridging events to our scenarios. Add official markets ENS records to the Polygon proposal (compound-finance#674) Fix Polygon scenarios (compound-finance#686) * Fix issue where proposer did not have enough gas * Actually fix gas issue, which also fixes the unrecognized events issue * Fix reward scenarios for Comets where the reward token is not a collateral asset * Lower amount of WBTC to liquidate on Polygon * Use isBridgedDeployment; fix usages of matchesDeployment * Use matchesDeployment instead of isBridgedDeployment * Skip liquidation bot scens for mainnet-weth because we are trying to source too much base assets rn * Support multiple connections to Seacrest in Enact (compound-finance#692) Currently, running `Enact` in CI using Seacrest will fail when multiple networks are used (e.g. for cross-chain governance proposals that read from Polygon and write to mainnet). This is because Seacrest's connection with WalletConnect is for a specific chain, so trying to access a different chain will result in a `could not detect network` error. This change supports making multiple connections to Seacrest/WalletConnect, all from a single phone. We introduce optional `GOV_NETWORK` and `GOV_NETWORK_PROVIDER` env variables to override the provider for a specific chain when creating the HREs. The `Enact` CI job determines the `GOV_NETWORK` based on what the original selected network is. * Set pause guardian to new Polygon multisig (compound-finance#693) * Final Gauntlet recommendations and migration of cUSDT rewards (compound-finance#694) * Final Gauntlet recommendations and migration of cUSDT rewards * Keep cUSDT borrow speed * Fix Liquidation Bot scenarios (compound-finance#688) * update TokenBalanceConstraint to take fn as argument; update Liquidation Bot scenario amounts * update WETH amount * Update the proposal text (compound-finance#695) * Update the proposal text * Link to public Gauntlet post * Update token amounts to bridge (compound-finance#697) * Modified migration from GitHub Actions * Adapt Polygon proposal to Mumbai (compound-finance#690) * Adapt Polygon proposal to Mumbai * Update name of proposal * Enacted --------- Co-authored-by: Kevin Cheng <[email protected]> Co-authored-by: Jared Flatow <[email protected]> Co-authored-by: GitHub Actions Bot <> * Pick up incomplete bridged proposals too (compound-finance#707) --------- Co-authored-by: kevincheng96 <[email protected]> Co-authored-by: Jared Flatow <[email protected]>
- Loading branch information
1 parent
92cc65c
commit 9ce9aa9
Showing
51 changed files
with
1,910 additions
and
496 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
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
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
File renamed without changes.
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 |
---|---|---|
@@ -1,33 +1,48 @@ | ||
// SPDX-License-Identifier: BUSL-1.1 | ||
pragma solidity 0.8.15; | ||
|
||
import "../vendor/fx-portal/contracts/FxChild.sol"; | ||
import "./IFxMessageProcessor.sol"; | ||
import "../BaseBridgeReceiver.sol"; | ||
|
||
contract PolygonBridgeReceiver is IFxMessageProcessor, BaseBridgeReceiver { | ||
error InvalidChild(); | ||
|
||
event NewFxChild(address indexed oldFxChild, address indexed newFxChild); | ||
|
||
/// @notice Address of Polygon's bridged message receiver | ||
address public fxChild; | ||
|
||
/** | ||
* @notice Construct a new PolygonBridgeReceiver instance | ||
* @param _fxChild Address of Polygon bridged message receiver | ||
**/ | ||
constructor(address _fxChild) { | ||
fxChild = _fxChild; | ||
} | ||
|
||
/** | ||
* @notice Update the fxChild address | ||
* @param newFxChild New value for fxAddress | ||
*/ | ||
function changeFxChild(address newFxChild) public { | ||
if (msg.sender != localTimelock) revert Unauthorized(); | ||
address oldFxChild = fxChild; | ||
fxChild = newFxChild; | ||
emit NewFxChild(oldFxChild, newFxChild); | ||
} | ||
|
||
/** | ||
* @notice Receive bridged message and enqueue in the Timelock | ||
* @param stateId Value provided by fxChild when function is called; ignored | ||
* @param rootMessageSender Mainnet address that initiated the bridged message | ||
* @param data ABI-encoded data of the bridged message | ||
*/ | ||
function processMessageFromRoot( | ||
uint256 stateId, | ||
address messageSender, | ||
address rootMessageSender, | ||
bytes calldata data | ||
) public override { | ||
if (msg.sender != fxChild) revert InvalidChild(); | ||
processMessage(messageSender, data); | ||
processMessage(rootMessageSender, data); | ||
} | ||
} |
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.