From cd92eb610ff1bf55f3411e63925a55f2c672a7e1 Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Thu, 26 Sep 2024 17:27:08 +0300 Subject: [PATCH 01/11] feat: wUSDM price feed --- contracts/pricefeeds/WUSDMPriceFeed.sol | 86 +++++++++++++++++++ .../vendor/mountain/IMountainRateProvider.sol | 7 ++ 2 files changed, 93 insertions(+) create mode 100644 contracts/pricefeeds/WUSDMPriceFeed.sol create mode 100644 contracts/vendor/mountain/IMountainRateProvider.sol diff --git a/contracts/pricefeeds/WUSDMPriceFeed.sol b/contracts/pricefeeds/WUSDMPriceFeed.sol new file mode 100644 index 000000000..e87733bd1 --- /dev/null +++ b/contracts/pricefeeds/WUSDMPriceFeed.sol @@ -0,0 +1,86 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.15; + +import "../vendor/@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; +import "../vendor/mountain/IMountainRateProvider.sol"; +import "../IPriceFeed.sol"; + +/** + * @title wUSDM price feed + * @notice A custom price feed that calculates the price for wUSDM / USD + * @author Compound + */ +contract WUSDMPriceFeed is IPriceFeed { + /** Custom errors **/ + error BadDecimals(); + error InvalidInt256(); + + /// @notice Version of the price feed + uint public constant override version = 1; + + /// @notice Description of the price feed + string public constant override description = "Custom price feed for wUSDM / USD"; + + /// @notice Number of decimals for returned prices + uint8 public immutable override decimals; + + /// @notice Number of decimals for the wUSDM / USDM rate provider + uint8 wUSDMToUSDMPriceFeedDecimals; + + /// @notice Number of decimals for the USDM / USD price feed + uint8 USDMToUSDPriceFeedDecimals; + + /// @notice Mountain wUSDM / USDM rate provider + address public immutable wUSDMToUSDMRateProvider; + + /// @notice Chainlink USDM / USD price feed + address public immutable USDMToUSDPriceFeed; + + /// @notice Combined scale of the two underlying price feeds + int public immutable combinedScale; + + /// @notice Scale of this price feed + int public immutable priceFeedScale; + + /** + * @notice Construct a new wUSDM / USD price feed + * @param wUSDMToUSDMPriceFeed_ The address of the wUSDM / USDM price feed to fetch prices from + * @param USDMToUSDPriceFeed_ The address of the USDM / USD price feed to fetch prices from + * @param decimals_ The number of decimals for the returned prices + **/ + constructor(address wUSDMToUSDMPriceFeed_, address USDMToUSDPriceFeed_, uint8 decimals_) { + wUSDMToUSDMRateProvider = wUSDMToUSDMPriceFeed_; + USDMToUSDPriceFeed = USDMToUSDPriceFeed_; + wUSDMToUSDMPriceFeedDecimals = IMountainRateProvider(wUSDMToUSDMPriceFeed_).decimals(); + USDMToUSDPriceFeedDecimals = AggregatorV3Interface(USDMToUSDPriceFeed_).decimals(); + combinedScale = signed256(10 ** (wUSDMToUSDMPriceFeedDecimals + USDMToUSDPriceFeedDecimals)); + + if (decimals_ > 18) revert BadDecimals(); + decimals = decimals_; + priceFeedScale = int256(10 ** decimals); + } + + /** + * @notice wUSDM price for the latest round + * @return roundId Round id from the USDM / USD price feed + * @return answer Latest price for wUSDM / USD + * @return startedAt Timestamp when the round was started; passed on from the USDM / USD price feed + * @return updatedAt Timestamp when the round was last updated; passed on from the USDM / USD price feed + * @return answeredInRound Round id in which the answer was computed; passed on from the USDM / USD price feed + **/ + function latestRoundData() override external view returns (uint80, int256, uint256, uint256, uint80) { + uint256 wUSDMToUSDMPrice = IMountainRateProvider(wUSDMToUSDMRateProvider).convertToAssets(10**wUSDMToUSDMPriceFeedDecimals); + (uint80 roundId_, int256 USDMToUSDPrice, uint256 startedAt_, uint256 updatedAt_, uint80 answeredInRound_) = AggregatorV3Interface(USDMToUSDPriceFeed).latestRoundData(); + + // We return the round data of the USDM / USD price feed because of its shorter heartbeat (1hr vs 24hr) + if (wUSDMToUSDMPrice <= 0 || USDMToUSDPrice <= 0) return (roundId_, 0, startedAt_, updatedAt_, answeredInRound_); + + int256 price = signed256(wUSDMToUSDMPrice) * USDMToUSDPrice * priceFeedScale / combinedScale; + return (roundId_, price, startedAt_, updatedAt_, answeredInRound_); + } + + function signed256(uint256 n) internal pure returns (int256) { + if (n > uint256(type(int256).max)) revert InvalidInt256(); + return int256(n); + } +} \ No newline at end of file diff --git a/contracts/vendor/mountain/IMountainRateProvider.sol b/contracts/vendor/mountain/IMountainRateProvider.sol new file mode 100644 index 000000000..8c590296c --- /dev/null +++ b/contracts/vendor/mountain/IMountainRateProvider.sol @@ -0,0 +1,7 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +interface IMountainRateProvider { + function decimals() external view returns (uint8); + function convertToAssets(uint256) external view returns (uint256); +} From e7691388fdec29a78df9d76e1665d457c44b8b9c Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Fri, 27 Sep 2024 16:03:56 +0300 Subject: [PATCH 02/11] fix: rename --- contracts/IERC4626.sol | 230 ++++++++++++++++++ .../pricefeeds/PriceFeedWith4626Support.sol | 87 +++++++ contracts/pricefeeds/WUSDMPriceFeed.sol | 86 ------- .../vendor/mountain/IMountainRateProvider.sol | 7 - 4 files changed, 317 insertions(+), 93 deletions(-) create mode 100644 contracts/IERC4626.sol create mode 100644 contracts/pricefeeds/PriceFeedWith4626Support.sol delete mode 100644 contracts/pricefeeds/WUSDMPriceFeed.sol delete mode 100644 contracts/vendor/mountain/IMountainRateProvider.sol diff --git a/contracts/IERC4626.sol b/contracts/IERC4626.sol new file mode 100644 index 000000000..a162fc1b1 --- /dev/null +++ b/contracts/IERC4626.sol @@ -0,0 +1,230 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC4626.sol) + +pragma solidity 0.8.15; + +/** + * @dev Interface of the ERC-4626 "Tokenized Vault Standard", as defined in + * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626]. + */ +interface IERC4626 { + event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares); + + event Withdraw( + address indexed sender, + address indexed receiver, + address indexed owner, + uint256 assets, + uint256 shares + ); + + /// @dev Returns decimals of the Vault shares. + function decimals() external view returns (uint8); + + /** + * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing. + * + * - MUST be an ERC-20 token contract. + * - MUST NOT revert. + */ + function asset() external view returns (address assetTokenAddress); + + /** + * @dev Returns the total amount of the underlying asset that is “managed” by Vault. + * + * - SHOULD include any compounding that occurs from yield. + * - MUST be inclusive of any fees that are charged against assets in the Vault. + * - MUST NOT revert. + */ + function totalAssets() external view returns (uint256 totalManagedAssets); + + /** + * @dev Returns the amount of shares that the Vault would exchange for the amount of assets provided, in an ideal + * scenario where all the conditions are met. + * + * - MUST NOT be inclusive of any fees that are charged against assets in the Vault. + * - MUST NOT show any variations depending on the caller. + * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange. + * - MUST NOT revert. + * + * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the + * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and + * from. + */ + function convertToShares(uint256 assets) external view returns (uint256 shares); + + /** + * @dev Returns the amount of assets that the Vault would exchange for the amount of shares provided, in an ideal + * scenario where all the conditions are met. + * + * - MUST NOT be inclusive of any fees that are charged against assets in the Vault. + * - MUST NOT show any variations depending on the caller. + * - MUST NOT reflect slippage or other on-chain conditions, when performing the actual exchange. + * - MUST NOT revert. + * + * NOTE: This calculation MAY NOT reflect the “per-user” price-per-share, and instead should reflect the + * “average-user’s” price-per-share, meaning what the average user should expect to see when exchanging to and + * from. + */ + function convertToAssets(uint256 shares) external view returns (uint256 assets); + + /** + * @dev Returns the maximum amount of the underlying asset that can be deposited into the Vault for the receiver, + * through a deposit call. + * + * - MUST return a limited value if receiver is subject to some deposit limit. + * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of assets that may be deposited. + * - MUST NOT revert. + */ + function maxDeposit(address receiver) external view returns (uint256 maxAssets); + + /** + * @dev Allows an on-chain or off-chain user to simulate the effects of their deposit at the current block, given + * current on-chain conditions. + * + * - MUST return as close to and no more than the exact amount of Vault shares that would be minted in a deposit + * call in the same transaction. I.e. deposit should return the same or more shares as previewDeposit if called + * in the same transaction. + * - MUST NOT account for deposit limits like those returned from maxDeposit and should always act as though the + * deposit would be accepted, regardless if the user has enough tokens approved, etc. + * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees. + * - MUST NOT revert. + * + * NOTE: any unfavorable discrepancy between convertToShares and previewDeposit SHOULD be considered slippage in + * share price or some other type of condition, meaning the depositor will lose assets by depositing. + */ + function previewDeposit(uint256 assets) external view returns (uint256 shares); + + /** + * @dev Mints shares Vault shares to receiver by depositing exactly amount of underlying tokens. + * + * - MUST emit the Deposit event. + * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the + * deposit execution, and are accounted for during deposit. + * - MUST revert if all of assets cannot be deposited (due to deposit limit being reached, slippage, the user not + * approving enough underlying tokens to the Vault contract, etc). + * + * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token. + */ + function deposit(uint256 assets, address receiver) external returns (uint256 shares); + + /** + * @dev Returns the maximum amount of the Vault shares that can be minted for the receiver, through a mint call. + * - MUST return a limited value if receiver is subject to some mint limit. + * - MUST return 2 ** 256 - 1 if there is no limit on the maximum amount of shares that may be minted. + * - MUST NOT revert. + */ + function maxMint(address receiver) external view returns (uint256 maxShares); + + /** + * @dev Allows an on-chain or off-chain user to simulate the effects of their mint at the current block, given + * current on-chain conditions. + * + * - MUST return as close to and no fewer than the exact amount of assets that would be deposited in a mint call + * in the same transaction. I.e. mint should return the same or fewer assets as previewMint if called in the + * same transaction. + * - MUST NOT account for mint limits like those returned from maxMint and should always act as though the mint + * would be accepted, regardless if the user has enough tokens approved, etc. + * - MUST be inclusive of deposit fees. Integrators should be aware of the existence of deposit fees. + * - MUST NOT revert. + * + * NOTE: any unfavorable discrepancy between convertToAssets and previewMint SHOULD be considered slippage in + * share price or some other type of condition, meaning the depositor will lose assets by minting. + */ + function previewMint(uint256 shares) external view returns (uint256 assets); + + /** + * @dev Mints exactly shares Vault shares to receiver by depositing amount of underlying tokens. + * + * - MUST emit the Deposit event. + * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the mint + * execution, and are accounted for during mint. + * - MUST revert if all of shares cannot be minted (due to deposit limit being reached, slippage, the user not + * approving enough underlying tokens to the Vault contract, etc). + * + * NOTE: most implementations will require pre-approval of the Vault with the Vault’s underlying asset token. + */ + function mint(uint256 shares, address receiver) external returns (uint256 assets); + + /** + * @dev Returns the maximum amount of the underlying asset that can be withdrawn from the owner balance in the + * Vault, through a withdraw call. + * + * - MUST return a limited value if owner is subject to some withdrawal limit or timelock. + * - MUST NOT revert. + */ + function maxWithdraw(address owner) external view returns (uint256 maxAssets); + + /** + * @dev Allows an on-chain or off-chain user to simulate the effects of their withdrawal at the current block, + * given current on-chain conditions. + * + * - MUST return as close to and no fewer than the exact amount of Vault shares that would be burned in a withdraw + * call in the same transaction. I.e. withdraw should return the same or fewer shares as previewWithdraw if + * called + * in the same transaction. + * - MUST NOT account for withdrawal limits like those returned from maxWithdraw and should always act as though + * the withdrawal would be accepted, regardless if the user has enough shares, etc. + * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees. + * - MUST NOT revert. + * + * NOTE: any unfavorable discrepancy between convertToShares and previewWithdraw SHOULD be considered slippage in + * share price or some other type of condition, meaning the depositor will lose assets by depositing. + */ + function previewWithdraw(uint256 assets) external view returns (uint256 shares); + + /** + * @dev Burns shares from owner and sends exactly assets of underlying tokens to receiver. + * + * - MUST emit the Withdraw event. + * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the + * withdraw execution, and are accounted for during withdraw. + * - MUST revert if all of assets cannot be withdrawn (due to withdrawal limit being reached, slippage, the owner + * not having enough shares, etc). + * + * Note that some implementations will require pre-requesting to the Vault before a withdrawal may be performed. + * Those methods should be performed separately. + */ + function withdraw(uint256 assets, address receiver, address owner) external returns (uint256 shares); + + /** + * @dev Returns the maximum amount of Vault shares that can be redeemed from the owner balance in the Vault, + * through a redeem call. + * + * - MUST return a limited value if owner is subject to some withdrawal limit or timelock. + * - MUST return balanceOf(owner) if owner is not subject to any withdrawal limit or timelock. + * - MUST NOT revert. + */ + function maxRedeem(address owner) external view returns (uint256 maxShares); + + /** + * @dev Allows an on-chain or off-chain user to simulate the effects of their redeemption at the current block, + * given current on-chain conditions. + * + * - MUST return as close to and no more than the exact amount of assets that would be withdrawn in a redeem call + * in the same transaction. I.e. redeem should return the same or more assets as previewRedeem if called in the + * same transaction. + * - MUST NOT account for redemption limits like those returned from maxRedeem and should always act as though the + * redemption would be accepted, regardless if the user has enough shares, etc. + * - MUST be inclusive of withdrawal fees. Integrators should be aware of the existence of withdrawal fees. + * - MUST NOT revert. + * + * NOTE: any unfavorable discrepancy between convertToAssets and previewRedeem SHOULD be considered slippage in + * share price or some other type of condition, meaning the depositor will lose assets by redeeming. + */ + function previewRedeem(uint256 shares) external view returns (uint256 assets); + + /** + * @dev Burns exactly shares from owner and sends assets of underlying tokens to receiver. + * + * - MUST emit the Withdraw event. + * - MAY support an additional flow in which the underlying tokens are owned by the Vault contract before the + * redeem execution, and are accounted for during redeem. + * - MUST revert if all of shares cannot be redeemed (due to withdrawal limit being reached, slippage, the owner + * not having enough shares, etc). + * + * NOTE: some implementations will require pre-requesting to the Vault before a withdrawal may be performed. + * Those methods should be performed separately. + */ + function redeem(uint256 shares, address receiver, address owner) external returns (uint256 assets); +} \ No newline at end of file diff --git a/contracts/pricefeeds/PriceFeedWith4626Support.sol b/contracts/pricefeeds/PriceFeedWith4626Support.sol new file mode 100644 index 000000000..13861f06d --- /dev/null +++ b/contracts/pricefeeds/PriceFeedWith4626Support.sol @@ -0,0 +1,87 @@ +// SPDX-License-Identifier: BUSL-1.1 +pragma solidity 0.8.15; + +import "../vendor/@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; +import "../IERC4626.sol"; +import "../IPriceFeed.sol"; + +/** + * @title Price feed for ERC4626 assets + * @notice A custom price feed that calculates the price for an ERC4626 asset + * @author Compound + */ +contract PriceFeedWith4626Support is IPriceFeed { + /** Custom errors **/ + error BadDecimals(); + error InvalidInt256(); + + /// @notice Version of the price feed + uint public constant override version = 1; + + /// @notice Description of the price feed + string public override description; + + /// @notice Number of decimals for returned prices + uint8 public immutable override decimals; + + /// @notice Number of decimals for the 4626 rate provider + uint8 rateProviderDecimals; + + /// @notice Number of decimals for the underlying asset + uint8 underlyingDecimals; + + /// @notice 4626 rate provider + address public immutable rateProvider; + + /// @notice Chainlink oracle for the underlying asset + address public immutable underlyingPriceFeed; + + /// @notice Combined scale of the two underlying price feeds + int public immutable combinedScale; + + /// @notice Scale of this price feed + int public immutable priceFeedScale; + + /** + * @notice Construct a new 4626 price feed + * @param rateProvider_ The address of the 4626 rate provider + * @param underlyingPriceFeed_ The address of the underlying asset price feed to fetch prices from + * @param decimals_ The number of decimals for the returned prices + **/ + constructor(address rateProvider_, address underlyingPriceFeed_, uint8 decimals_, string memory description_) { + rateProvider = rateProvider_; + underlyingPriceFeed = underlyingPriceFeed_; + rateProviderDecimals = IERC4626(rateProvider_).decimals(); + underlyingDecimals = AggregatorV3Interface(underlyingPriceFeed_).decimals(); + combinedScale = signed256(10 ** (rateProviderDecimals + underlyingDecimals)); + description = description_; + + if (decimals_ > 18) revert BadDecimals(); + decimals = decimals_; + priceFeedScale = int256(10 ** decimals); + } + + /** + * @notice Get the latest price for the underlying asset + * @return roundId Round id from the underlying asset price feed + * @return answer Latest price for the underlying asset + * @return startedAt Timestamp when the round was started; passed on from the underlying asset price feed + * @return updatedAt Timestamp when the round was last updated; passed on from the underlying asset price feed + * @return answeredInRound Round id in which the answer was computed; passed on from the underlying asset price feed + **/ + function latestRoundData() override external view returns (uint80, int256, uint256, uint256, uint80) { + uint256 rate = IERC4626(rateProvider).convertToAssets(10**rateProviderDecimals); + (uint80 roundId_, int256 underlyingPrice, uint256 startedAt_, uint256 updatedAt_, uint80 answeredInRound_) = AggregatorV3Interface(underlyingPriceFeed).latestRoundData(); + + // We return the round data of the underlying asset price feed because of its shorter heartbeat (1hr vs 24hr) + if (rate <= 0 || underlyingPrice <= 0) return (roundId_, 0, startedAt_, updatedAt_, answeredInRound_); + + int256 price = signed256(rate) * underlyingPrice * priceFeedScale / combinedScale; + return (roundId_, price, startedAt_, updatedAt_, answeredInRound_); + } + + function signed256(uint256 n) internal pure returns (int256) { + if (n > uint256(type(int256).max)) revert InvalidInt256(); + return int256(n); + } +} \ No newline at end of file diff --git a/contracts/pricefeeds/WUSDMPriceFeed.sol b/contracts/pricefeeds/WUSDMPriceFeed.sol deleted file mode 100644 index e87733bd1..000000000 --- a/contracts/pricefeeds/WUSDMPriceFeed.sol +++ /dev/null @@ -1,86 +0,0 @@ -// SPDX-License-Identifier: BUSL-1.1 -pragma solidity 0.8.15; - -import "../vendor/@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol"; -import "../vendor/mountain/IMountainRateProvider.sol"; -import "../IPriceFeed.sol"; - -/** - * @title wUSDM price feed - * @notice A custom price feed that calculates the price for wUSDM / USD - * @author Compound - */ -contract WUSDMPriceFeed is IPriceFeed { - /** Custom errors **/ - error BadDecimals(); - error InvalidInt256(); - - /// @notice Version of the price feed - uint public constant override version = 1; - - /// @notice Description of the price feed - string public constant override description = "Custom price feed for wUSDM / USD"; - - /// @notice Number of decimals for returned prices - uint8 public immutable override decimals; - - /// @notice Number of decimals for the wUSDM / USDM rate provider - uint8 wUSDMToUSDMPriceFeedDecimals; - - /// @notice Number of decimals for the USDM / USD price feed - uint8 USDMToUSDPriceFeedDecimals; - - /// @notice Mountain wUSDM / USDM rate provider - address public immutable wUSDMToUSDMRateProvider; - - /// @notice Chainlink USDM / USD price feed - address public immutable USDMToUSDPriceFeed; - - /// @notice Combined scale of the two underlying price feeds - int public immutable combinedScale; - - /// @notice Scale of this price feed - int public immutable priceFeedScale; - - /** - * @notice Construct a new wUSDM / USD price feed - * @param wUSDMToUSDMPriceFeed_ The address of the wUSDM / USDM price feed to fetch prices from - * @param USDMToUSDPriceFeed_ The address of the USDM / USD price feed to fetch prices from - * @param decimals_ The number of decimals for the returned prices - **/ - constructor(address wUSDMToUSDMPriceFeed_, address USDMToUSDPriceFeed_, uint8 decimals_) { - wUSDMToUSDMRateProvider = wUSDMToUSDMPriceFeed_; - USDMToUSDPriceFeed = USDMToUSDPriceFeed_; - wUSDMToUSDMPriceFeedDecimals = IMountainRateProvider(wUSDMToUSDMPriceFeed_).decimals(); - USDMToUSDPriceFeedDecimals = AggregatorV3Interface(USDMToUSDPriceFeed_).decimals(); - combinedScale = signed256(10 ** (wUSDMToUSDMPriceFeedDecimals + USDMToUSDPriceFeedDecimals)); - - if (decimals_ > 18) revert BadDecimals(); - decimals = decimals_; - priceFeedScale = int256(10 ** decimals); - } - - /** - * @notice wUSDM price for the latest round - * @return roundId Round id from the USDM / USD price feed - * @return answer Latest price for wUSDM / USD - * @return startedAt Timestamp when the round was started; passed on from the USDM / USD price feed - * @return updatedAt Timestamp when the round was last updated; passed on from the USDM / USD price feed - * @return answeredInRound Round id in which the answer was computed; passed on from the USDM / USD price feed - **/ - function latestRoundData() override external view returns (uint80, int256, uint256, uint256, uint80) { - uint256 wUSDMToUSDMPrice = IMountainRateProvider(wUSDMToUSDMRateProvider).convertToAssets(10**wUSDMToUSDMPriceFeedDecimals); - (uint80 roundId_, int256 USDMToUSDPrice, uint256 startedAt_, uint256 updatedAt_, uint80 answeredInRound_) = AggregatorV3Interface(USDMToUSDPriceFeed).latestRoundData(); - - // We return the round data of the USDM / USD price feed because of its shorter heartbeat (1hr vs 24hr) - if (wUSDMToUSDMPrice <= 0 || USDMToUSDPrice <= 0) return (roundId_, 0, startedAt_, updatedAt_, answeredInRound_); - - int256 price = signed256(wUSDMToUSDMPrice) * USDMToUSDPrice * priceFeedScale / combinedScale; - return (roundId_, price, startedAt_, updatedAt_, answeredInRound_); - } - - function signed256(uint256 n) internal pure returns (int256) { - if (n > uint256(type(int256).max)) revert InvalidInt256(); - return int256(n); - } -} \ No newline at end of file diff --git a/contracts/vendor/mountain/IMountainRateProvider.sol b/contracts/vendor/mountain/IMountainRateProvider.sol deleted file mode 100644 index 8c590296c..000000000 --- a/contracts/vendor/mountain/IMountainRateProvider.sol +++ /dev/null @@ -1,7 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; - -interface IMountainRateProvider { - function decimals() external view returns (uint8); - function convertToAssets(uint256) external view returns (uint256); -} From 6f7d5ec38fd7a1d66dcb43e9bc7362c4ea5a00dc Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Tue, 1 Oct 2024 16:45:58 +0300 Subject: [PATCH 03/11] fix: sync version --- contracts/pricefeeds/PriceFeedWith4626Support.sol | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/contracts/pricefeeds/PriceFeedWith4626Support.sol b/contracts/pricefeeds/PriceFeedWith4626Support.sol index 13861f06d..c79578f97 100644 --- a/contracts/pricefeeds/PriceFeedWith4626Support.sol +++ b/contracts/pricefeeds/PriceFeedWith4626Support.sol @@ -16,7 +16,7 @@ contract PriceFeedWith4626Support is IPriceFeed { error InvalidInt256(); /// @notice Version of the price feed - uint public constant override version = 1; + uint public constant VERSION = 1; /// @notice Description of the price feed string public override description; @@ -84,4 +84,12 @@ contract PriceFeedWith4626Support is IPriceFeed { if (n > uint256(type(int256).max)) revert InvalidInt256(); return int256(n); } + + /** + * @notice Price for the latest round + * @return The version of the price feed contract + **/ + function version() external pure returns (uint256) { + return VERSION; + } } \ No newline at end of file From 53bc4b93b47d567e4bee02680b6735f3d1a5dd2e Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Tue, 22 Oct 2024 15:37:29 +0300 Subject: [PATCH 04/11] fix: remove comment --- contracts/pricefeeds/PriceFeedWith4626Support.sol | 1 - 1 file changed, 1 deletion(-) diff --git a/contracts/pricefeeds/PriceFeedWith4626Support.sol b/contracts/pricefeeds/PriceFeedWith4626Support.sol index c79578f97..2c309e6e1 100644 --- a/contracts/pricefeeds/PriceFeedWith4626Support.sol +++ b/contracts/pricefeeds/PriceFeedWith4626Support.sol @@ -73,7 +73,6 @@ contract PriceFeedWith4626Support is IPriceFeed { uint256 rate = IERC4626(rateProvider).convertToAssets(10**rateProviderDecimals); (uint80 roundId_, int256 underlyingPrice, uint256 startedAt_, uint256 updatedAt_, uint80 answeredInRound_) = AggregatorV3Interface(underlyingPriceFeed).latestRoundData(); - // We return the round data of the underlying asset price feed because of its shorter heartbeat (1hr vs 24hr) if (rate <= 0 || underlyingPrice <= 0) return (roundId_, 0, startedAt_, updatedAt_, answeredInRound_); int256 price = signed256(rate) * underlyingPrice * priceFeedScale / combinedScale; From ca4ff5e8f6078d87ffe799b0315ef9b654f618f5 Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Thu, 24 Oct 2024 14:29:44 +0300 Subject: [PATCH 05/11] feat: migration --- .../1729767867_add_wusdm_as_collateral.ts | 150 ++++++++++++++++++ deployments/optimism/usdt/relations.ts | 9 ++ scenario/constraints/ProposalConstraint.ts | 12 +- 3 files changed, 162 insertions(+), 9 deletions(-) create mode 100644 deployments/optimism/usdt/migrations/1729767867_add_wusdm_as_collateral.ts diff --git a/deployments/optimism/usdt/migrations/1729767867_add_wusdm_as_collateral.ts b/deployments/optimism/usdt/migrations/1729767867_add_wusdm_as_collateral.ts new file mode 100644 index 000000000..2cb02ad5e --- /dev/null +++ b/deployments/optimism/usdt/migrations/1729767867_add_wusdm_as_collateral.ts @@ -0,0 +1,150 @@ +import { expect } from 'chai'; +import { DeploymentManager } from '../../../../plugins/deployment_manager/DeploymentManager'; +import { migration } from '../../../../plugins/deployment_manager/Migration'; +import { calldata, exp, proposal } from '../../../../src/deploy'; +import { utils } from 'ethers'; + +const WUSDM_ADDRESS = '0x57F5E098CaD7A3D1Eed53991D4d66C45C9AF7812'; +const USDM_USD_PRICE_FEED_ADDRESS = '0xA45881b63ff9BE3F9a3439CA0c002686e65a8ED5'; +let newPriceFeedAddress: string; + +export default migration('1729767867_add_wusdm_as_collateral', { + async prepare(deploymentManager: DeploymentManager) { + const _wUSDMPriceFeed = await deploymentManager.deploy( + 'wUSDM:priceFeed', + 'pricefeeds/PriceFeedWith4626Support.sol', + [ + WUSDM_ADDRESS, // wUSDM / USDM price feed + USDM_USD_PRICE_FEED_ADDRESS, // USDM / USD price feed + 8, // decimals + 'wUSDM / USD price feed' // description + ] + ); + return { wUSDMPriceFeedAddress: _wUSDMPriceFeed.address }; + }, + + enact: async ( + deploymentManager: DeploymentManager, + govDeploymentManager: DeploymentManager, + { wUSDMPriceFeedAddress } + ) => { + const trace = deploymentManager.tracer(); + + const wUSDM = await deploymentManager.existing( + 'wUSDM', + WUSDM_ADDRESS, + 'optimism', + 'contracts/ERC20.sol:ERC20' + ); + const wUSDMPricefeed = await deploymentManager.existing( + 'wUSDM:priceFeed', + wUSDMPriceFeedAddress, + 'optimism' + ); + + const { + bridgeReceiver, + comet, + cometAdmin, + configurator, + } = await deploymentManager.getContracts(); + + const { governor, opL1CrossDomainMessenger } = await govDeploymentManager.getContracts(); + + const newAssetConfig = { + asset: wUSDM.address, + priceFeed: wUSDMPricefeed.address, + decimals: await wUSDM.decimals(), + borrowCollateralFactor: exp(0.88, 18), + liquidateCollateralFactor: exp(0.9, 18), + liquidationFactor: exp(0.95, 18), + supplyCap: exp(1_400_000, 18), + }; + + newPriceFeedAddress = wUSDMPricefeed.address; + + const addAssetCalldata = await calldata( + configurator.populateTransaction.addAsset(comet.address, newAssetConfig) + ); + const deployAndUpgradeToCalldata = utils.defaultAbiCoder.encode( + ['address', 'address'], + [configurator.address, comet.address] + ); + + const l2ProposalData = utils.defaultAbiCoder.encode( + ['address[]', 'uint256[]', 'string[]', 'bytes[]'], + [ + [configurator.address, cometAdmin.address], + [0, 0], + [ + 'addAsset(address,(address,address,uint8,uint64,uint64,uint64,uint128))', + 'deployAndUpgradeTo(address,address)', + ], + [addAssetCalldata, deployAndUpgradeToCalldata], + ] + ); + + const mainnetActions = [ + // Send the proposal to the L2 bridge + { + contract: opL1CrossDomainMessenger, + signature: 'sendMessage(address,bytes,uint32)', + args: [bridgeReceiver.address, l2ProposalData, 3_000_000] + }, + ]; + + const description = '# Add wUSDM as collateral into cUSDTv3 on Optimism\n\n## Proposal summary\n\nCompound Growth Program [AlphaGrowth] proposes to add wUSDM into cUSDTv3 on Optimism network. This proposal takes the governance steps recommended and necessary to update a Compound III USDT market on Optimism. Simulations have confirmed the market’s readiness, as much as possible, using the [Comet scenario suite](https://github.com/compound-finance/comet/tree/main/scenario). The new parameters include setting the risk parameters based off of the [recommendations from Gauntlet](https://www.comp.xyz/t/add-wusdm-as-a-collateral-on-usdc-usdt-markets-on-optimism/5664/4).\n\nFurther detailed information can be found on the corresponding [proposal pull request](https://github.com/compound-finance/comet/pull/944) and [forum discussion](https://www.comp.xyz/t/add-wusdm-as-a-collateral-on-usdc-usdt-markets-on-optimism/5664).\n\n\n## Proposal Actions\n\nThe first proposal action adds wUSDM to the USDT Comet on Optimism. This sends the encoded `addAsset` and `deployAndUpgradeTo` calls across the bridge to the governance receiver on Optimism.'; + const txn = await govDeploymentManager.retry(async () => + trace( + await governor.propose(...(await proposal(mainnetActions, description))) + ) + ); + + const event = txn.events.find( + (event) => event.event === 'ProposalCreated' + ); + const [proposalId] = event.args; + trace(`Created proposal ${proposalId}.`); + }, + + async enacted(): Promise { + return false; + }, + + async verify(deploymentManager: DeploymentManager) { + const { comet, configurator } = await deploymentManager.getContracts(); + + const wUSDMAssetIndex = Number(await comet.numAssets()) - 1; + + const wUSDMAssetConfig = { + asset: WUSDM_ADDRESS, + priceFeed: newPriceFeedAddress, + decimals: 18, + borrowCollateralFactor: exp(0.88, 18), + liquidateCollateralFactor: exp(0.9, 18), + liquidationFactor: exp(0.95, 18), + supplyCap: exp(1_400_000, 18), + }; + + // 1. Compare proposed asset config with Comet asset info + const wUSDMAssetInfo = await comet.getAssetInfoByAddress(WUSDM_ADDRESS); + expect(wUSDMAssetIndex).to.be.equal(wUSDMAssetInfo.offset); + expect(wUSDMAssetConfig.asset).to.be.equal(wUSDMAssetInfo.asset); + expect(wUSDMAssetConfig.priceFeed).to.be.equal(wUSDMAssetInfo.priceFeed); + expect(exp(1, wUSDMAssetConfig.decimals)).to.be.equal(wUSDMAssetInfo.scale); + expect(wUSDMAssetConfig.borrowCollateralFactor).to.be.equal(wUSDMAssetInfo.borrowCollateralFactor); + expect(wUSDMAssetConfig.liquidateCollateralFactor).to.be.equal(wUSDMAssetInfo.liquidateCollateralFactor); + expect(wUSDMAssetConfig.liquidationFactor).to.be.equal(wUSDMAssetInfo.liquidationFactor); + expect(wUSDMAssetConfig.supplyCap).to.be.equal(wUSDMAssetInfo.supplyCap); + + // 2. Compare proposed asset config with Configurator asset config + const configuratorWUSDMAssetConfig = (await configurator.getConfiguration(comet.address)).assetConfigs[wUSDMAssetIndex]; + expect(wUSDMAssetConfig.asset).to.be.equal(configuratorWUSDMAssetConfig.asset); + expect(wUSDMAssetConfig.priceFeed).to.be.equal(configuratorWUSDMAssetConfig.priceFeed); + expect(wUSDMAssetConfig.decimals).to.be.equal(configuratorWUSDMAssetConfig.decimals); + expect(wUSDMAssetConfig.borrowCollateralFactor).to.be.equal(configuratorWUSDMAssetConfig.borrowCollateralFactor); + expect(wUSDMAssetConfig.liquidateCollateralFactor).to.be.equal(configuratorWUSDMAssetConfig.liquidateCollateralFactor); + expect(wUSDMAssetConfig.liquidationFactor).to.be.equal(configuratorWUSDMAssetConfig.liquidationFactor); + expect(wUSDMAssetConfig.supplyCap).to.be.equal(configuratorWUSDMAssetConfig.supplyCap); + }, +}); diff --git a/deployments/optimism/usdt/relations.ts b/deployments/optimism/usdt/relations.ts index 898a13cd6..3d50ed7e5 100644 --- a/deployments/optimism/usdt/relations.ts +++ b/deployments/optimism/usdt/relations.ts @@ -36,4 +36,13 @@ export default { } } }, + + ERC1967Proxy: { + artifact: 'contracts/ERC20.sol:ERC20', + delegates: { + field: { + slot: '0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc' + } + } + }, }; diff --git a/scenario/constraints/ProposalConstraint.ts b/scenario/constraints/ProposalConstraint.ts index da4899ea3..d906d89fb 100644 --- a/scenario/constraints/ProposalConstraint.ts +++ b/scenario/constraints/ProposalConstraint.ts @@ -62,15 +62,9 @@ export class ProposalConstraint implements StaticConstra ); } - // temporary hack to skip proposal 339 - if (proposal.id.eq(339)) { - console.log('Skipping proposal 339'); - continue; - } - - // temporary hack to skip proposal 340 - if (proposal.id.eq(340)) { - console.log('Skipping proposal 340'); + // temporary hack to skip proposal 353 + if (proposal.id.eq(353)) { + console.log('Skipping proposal 353'); continue; } From b51bce6f44bbba634059800fb6989c4863573be7 Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Thu, 24 Oct 2024 14:31:10 +0300 Subject: [PATCH 06/11] fix: pr link --- .../usdt/migrations/1729767867_add_wusdm_as_collateral.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/optimism/usdt/migrations/1729767867_add_wusdm_as_collateral.ts b/deployments/optimism/usdt/migrations/1729767867_add_wusdm_as_collateral.ts index 2cb02ad5e..6c2583fe5 100644 --- a/deployments/optimism/usdt/migrations/1729767867_add_wusdm_as_collateral.ts +++ b/deployments/optimism/usdt/migrations/1729767867_add_wusdm_as_collateral.ts @@ -93,7 +93,7 @@ export default migration('1729767867_add_wusdm_as_collateral', { }, ]; - const description = '# Add wUSDM as collateral into cUSDTv3 on Optimism\n\n## Proposal summary\n\nCompound Growth Program [AlphaGrowth] proposes to add wUSDM into cUSDTv3 on Optimism network. This proposal takes the governance steps recommended and necessary to update a Compound III USDT market on Optimism. Simulations have confirmed the market’s readiness, as much as possible, using the [Comet scenario suite](https://github.com/compound-finance/comet/tree/main/scenario). The new parameters include setting the risk parameters based off of the [recommendations from Gauntlet](https://www.comp.xyz/t/add-wusdm-as-a-collateral-on-usdc-usdt-markets-on-optimism/5664/4).\n\nFurther detailed information can be found on the corresponding [proposal pull request](https://github.com/compound-finance/comet/pull/944) and [forum discussion](https://www.comp.xyz/t/add-wusdm-as-a-collateral-on-usdc-usdt-markets-on-optimism/5664).\n\n\n## Proposal Actions\n\nThe first proposal action adds wUSDM to the USDT Comet on Optimism. This sends the encoded `addAsset` and `deployAndUpgradeTo` calls across the bridge to the governance receiver on Optimism.'; + const description = '# Add wUSDM as collateral into cUSDTv3 on Optimism\n\n## Proposal summary\n\nCompound Growth Program [AlphaGrowth] proposes to add wUSDM into cUSDTv3 on Optimism network. This proposal takes the governance steps recommended and necessary to update a Compound III USDT market on Optimism. Simulations have confirmed the market’s readiness, as much as possible, using the [Comet scenario suite](https://github.com/compound-finance/comet/tree/main/scenario). The new parameters include setting the risk parameters based off of the [recommendations from Gauntlet](https://www.comp.xyz/t/add-wusdm-as-a-collateral-on-usdc-usdt-markets-on-optimism/5664/4).\n\nFurther detailed information can be found on the corresponding [proposal pull request](https://github.com/compound-finance/comet/pull/945) and [forum discussion](https://www.comp.xyz/t/add-wusdm-as-a-collateral-on-usdc-usdt-markets-on-optimism/5664).\n\n\n## Proposal Actions\n\nThe first proposal action adds wUSDM to the USDT Comet on Optimism. This sends the encoded `addAsset` and `deployAndUpgradeTo` calls across the bridge to the governance receiver on Optimism.'; const txn = await govDeploymentManager.retry(async () => trace( await governor.propose(...(await proposal(mainnetActions, description))) From 4295a53b11bca4bffc5073c3f456fb258eee725c Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Thu, 31 Oct 2024 12:24:54 +0200 Subject: [PATCH 07/11] fix: audit fix --- contracts/IERC20.sol | 79 +++++++++++++++++++ contracts/IERC20Metadata.sol | 26 ++++++ contracts/IERC4626.sol | 12 +-- .../pricefeeds/PriceFeedWith4626Support.sol | 5 +- 4 files changed, 114 insertions(+), 8 deletions(-) create mode 100644 contracts/IERC20.sol create mode 100644 contracts/IERC20Metadata.sol diff --git a/contracts/IERC20.sol b/contracts/IERC20.sol new file mode 100644 index 000000000..cb6edc109 --- /dev/null +++ b/contracts/IERC20.sol @@ -0,0 +1,79 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/IERC20.sol) + +pragma solidity ^0.8.15; + +/** + * @dev Interface of the ERC-20 standard as defined in the ERC. + */ +interface IERC20 { + /** + * @dev Emitted when `value` tokens are moved from one account (`from`) to + * another (`to`). + * + * Note that `value` may be zero. + */ + event Transfer(address indexed from, address indexed to, uint256 value); + + /** + * @dev Emitted when the allowance of a `spender` for an `owner` is set by + * a call to {approve}. `value` is the new allowance. + */ + event Approval(address indexed owner, address indexed spender, uint256 value); + + /** + * @dev Returns the value of tokens in existence. + */ + function totalSupply() external view returns (uint256); + + /** + * @dev Returns the value of tokens owned by `account`. + */ + function balanceOf(address account) external view returns (uint256); + + /** + * @dev Moves a `value` amount of tokens from the caller's account to `to`. + * + * Returns a boolean value indicating whether the operation succeeded. + * + * Emits a {Transfer} event. + */ + function transfer(address to, uint256 value) external returns (bool); + + /** + * @dev Returns the remaining number of tokens that `spender` will be + * allowed to spend on behalf of `owner` through {transferFrom}. This is + * zero by default. + * + * This value changes when {approve} or {transferFrom} are called. + */ + function allowance(address owner, address spender) external view returns (uint256); + + /** + * @dev Sets a `value` amount of tokens as the allowance of `spender` over the + * caller's tokens. + * + * Returns a boolean value indicating whether the operation succeeded. + * + * IMPORTANT: Beware that changing an allowance with this method brings the risk + * that someone may use both the old and the new allowance by unfortunate + * transaction ordering. One possible solution to mitigate this race + * condition is to first reduce the spender's allowance to 0 and set the + * desired value afterwards: + * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 + * + * Emits an {Approval} event. + */ + function approve(address spender, uint256 value) external returns (bool); + + /** + * @dev Moves a `value` amount of tokens from `from` to `to` using the + * allowance mechanism. `value` is then deducted from the caller's + * allowance. + * + * Returns a boolean value indicating whether the operation succeeded. + * + * Emits a {Transfer} event. + */ + function transferFrom(address from, address to, uint256 value) external returns (bool); +} \ No newline at end of file diff --git a/contracts/IERC20Metadata.sol b/contracts/IERC20Metadata.sol new file mode 100644 index 000000000..441d193e4 --- /dev/null +++ b/contracts/IERC20Metadata.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts (last updated v5.1.0) (token/ERC20/extensions/IERC20Metadata.sol) + +pragma solidity ^0.8.15; + +import {IERC20} from "./IERC20.sol"; + +/** + * @dev Interface for the optional metadata functions from the ERC-20 standard. + */ +interface IERC20Metadata is IERC20 { + /** + * @dev Returns the name of the token. + */ + function name() external view returns (string memory); + + /** + * @dev Returns the symbol of the token. + */ + function symbol() external view returns (string memory); + + /** + * @dev Returns the decimals places of the token. + */ + function decimals() external view returns (uint8); +} \ No newline at end of file diff --git a/contracts/IERC4626.sol b/contracts/IERC4626.sol index a162fc1b1..a92c33583 100644 --- a/contracts/IERC4626.sol +++ b/contracts/IERC4626.sol @@ -1,13 +1,16 @@ // SPDX-License-Identifier: MIT -// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/IERC4626.sol) +// OpenZeppelin Contracts (last updated v5.1.0) (interfaces/IERC4626.sol) -pragma solidity 0.8.15; +pragma solidity ^0.8.15; + +import {IERC20} from "./IERC20.sol"; +import {IERC20Metadata} from "./IERC20Metadata.sol"; /** * @dev Interface of the ERC-4626 "Tokenized Vault Standard", as defined in * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626]. */ -interface IERC4626 { +interface IERC4626 is IERC20, IERC20Metadata { event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares); event Withdraw( @@ -18,9 +21,6 @@ interface IERC4626 { uint256 shares ); - /// @dev Returns decimals of the Vault shares. - function decimals() external view returns (uint8); - /** * @dev Returns the address of the underlying token used for the Vault for accounting, depositing, and withdrawing. * diff --git a/contracts/pricefeeds/PriceFeedWith4626Support.sol b/contracts/pricefeeds/PriceFeedWith4626Support.sol index 2c309e6e1..3103d9a7d 100644 --- a/contracts/pricefeeds/PriceFeedWith4626Support.sol +++ b/contracts/pricefeeds/PriceFeedWith4626Support.sol @@ -25,10 +25,10 @@ contract PriceFeedWith4626Support is IPriceFeed { uint8 public immutable override decimals; /// @notice Number of decimals for the 4626 rate provider - uint8 rateProviderDecimals; + uint8 internal immutable rateProviderDecimals; /// @notice Number of decimals for the underlying asset - uint8 underlyingDecimals; + uint8 internal immutable underlyingDecimals; /// @notice 4626 rate provider address public immutable rateProvider; @@ -47,6 +47,7 @@ contract PriceFeedWith4626Support is IPriceFeed { * @param rateProvider_ The address of the 4626 rate provider * @param underlyingPriceFeed_ The address of the underlying asset price feed to fetch prices from * @param decimals_ The number of decimals for the returned prices + * @param description_ The description of the price feed **/ constructor(address rateProvider_, address underlyingPriceFeed_, uint8 decimals_, string memory description_) { rateProvider = rateProvider_; From b04a94671a89bf0e099643e35f7673c32200d502 Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Fri, 1 Nov 2024 15:20:02 +0200 Subject: [PATCH 08/11] fix: force deploy --- .../usdt/migrations/1729767867_add_wusdm_as_collateral.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/deployments/optimism/usdt/migrations/1729767867_add_wusdm_as_collateral.ts b/deployments/optimism/usdt/migrations/1729767867_add_wusdm_as_collateral.ts index 6c2583fe5..66751bf1a 100644 --- a/deployments/optimism/usdt/migrations/1729767867_add_wusdm_as_collateral.ts +++ b/deployments/optimism/usdt/migrations/1729767867_add_wusdm_as_collateral.ts @@ -18,7 +18,8 @@ export default migration('1729767867_add_wusdm_as_collateral', { USDM_USD_PRICE_FEED_ADDRESS, // USDM / USD price feed 8, // decimals 'wUSDM / USD price feed' // description - ] + ], + true ); return { wUSDMPriceFeedAddress: _wUSDMPriceFeed.address }; }, From 611613986d4200cbff950a4f042a990d17098978 Mon Sep 17 00:00:00 2001 From: vitalii-woof-software Date: Thu, 7 Nov 2024 23:34:29 +0900 Subject: [PATCH 09/11] feat: add ankr RPC for Optimism and Base --- .github/workflows/deploy-market.yaml | 4 ++-- .github/workflows/enact-migration.yaml | 6 +++--- .github/workflows/prepare-migration.yaml | 4 ++-- .github/workflows/run-contract-linter.yaml | 1 + .github/workflows/run-coverage.yaml | 1 + .github/workflows/run-eslint.yaml | 1 + .github/workflows/run-gas-profiler.yaml | 1 + .github/workflows/run-scenarios.yaml | 2 +- .github/workflows/run-semgrep.yaml | 1 + .github/workflows/run-unit-tests.yaml | 1 + hardhat.config.ts | 7 ++++--- 11 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deploy-market.yaml b/.github/workflows/deploy-market.yaml index fe6e35024..44930b029 100644 --- a/.github/workflows/deploy-market.yaml +++ b/.github/workflows/deploy-market.yaml @@ -36,7 +36,7 @@ jobs: ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }} SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }} INFURA_KEY: ${{ secrets.INFURA_KEY }} - QUICKNODE_KEY: ${{ secrets.QUICKNODE_KEY }} + ANKR_KEY: ${{ secrets.ANKR_KEY }} POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }} ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }} BASESCAN_KEY: ${{ secrets.BASESCAN_KEY }} @@ -48,7 +48,7 @@ jobs: with: wallet_connect_project_id: ${{ secrets.WALLET_CONNECT_PROJECT_ID }} requested_network: "${{ inputs.network }}" - ethereum_url: "${{ fromJSON('{\"optimism\":\"https://optimism-mainnet.infura.io/v3/$INFURA_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"goerli\":\"https://goerli.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"mumbai\":\"https://polygon-mumbai.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum-goerli\":\"https://arbitrum-goerli.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://fluent-prettiest-scion.base-mainnet.quiknode.pro/$QUICKNODE_KEY\",\"base-goerli\":\"https://base-goerli.infura.io/v3/$INFURA_KEY\",\"linea-goerli\":\"https://linea-goerli.infura.io/v3/$INFURA_KEY\",\"scroll-goerli\":\"https://alpha-rpc.scroll.io/l2\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}" + ethereum_url: "${{ fromJSON('{\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"goerli\":\"https://goerli.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"mumbai\":\"https://polygon-mumbai.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum-goerli\":\"https://arbitrum-goerli.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://rpc.ankr.com/base/$ANKR_KEY\",\"base-goerli\":\"https://base-goerli.infura.io/v3/$INFURA_KEY\",\"linea-goerli\":\"https://linea-goerli.infura.io/v3/$INFURA_KEY\",\"scroll-goerli\":\"https://alpha-rpc.scroll.io/l2\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}" port: 8585 if: github.event.inputs.eth_pk == '' diff --git a/.github/workflows/enact-migration.yaml b/.github/workflows/enact-migration.yaml index d2d62842e..96f03db83 100644 --- a/.github/workflows/enact-migration.yaml +++ b/.github/workflows/enact-migration.yaml @@ -53,7 +53,7 @@ jobs: ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }} SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }} INFURA_KEY: ${{ secrets.INFURA_KEY }} - QUICKNODE_KEY: ${{ secrets.QUICKNODE_KEY }} + ANKR_KEY: ${{ secrets.ANKR_KEY }} POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }} ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }} BASESCAN_KEY: ${{ secrets.BASESCAN_KEY }} @@ -76,7 +76,7 @@ jobs: with: wallet_connect_project_id: ${{ secrets.WALLET_CONNECT_PROJECT_ID }} requested_network: "${{ inputs.network }}" - ethereum_url: "${{ fromJSON('{\"optimism\":\"https://optimism-mainnet.infura.io/v3/$INFURA_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"goerli\":\"https://goerli.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"mumbai\":\"https://polygon-mumbai.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum-goerli\":\"https://arbitrum-goerli.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://fluent-prettiest-scion.base-mainnet.quiknode.pro/$QUICKNODE_KEY\",\"base-goerli\":\"https://base-goerli.infura.io/v3/$INFURA_KEY\",\"linea-goerli\":\"https://linea-goerli.infura.io/v3/$INFURA_KEY\",\"scroll-goerli\":\"https://alpha-rpc.scroll.io/l2\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}" + ethereum_url: "${{ fromJSON('{\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"goerli\":\"https://goerli.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"mumbai\":\"https://polygon-mumbai.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum-goerli\":\"https://arbitrum-goerli.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://rpc.ankr.com/base/$ANKR_KEY\",\"base-goerli\":\"https://base-goerli.infura.io/v3/$INFURA_KEY\",\"linea-goerli\":\"https://linea-goerli.infura.io/v3/$INFURA_KEY\",\"scroll-goerli\":\"https://alpha-rpc.scroll.io/l2\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}" port: 8585 if: github.event.inputs.eth_pk == '' @@ -85,7 +85,7 @@ jobs: with: wallet_connect_project_id: ${{ secrets.WALLET_CONNECT_PROJECT_ID }} requested_network: "${{ env.GOV_NETWORK }}" - ethereum_url: "${{ fromJSON('{\"optimism\":\"https://optimism-mainnet.infura.io/v3/$INFURA_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"goerli\":\"https://goerli.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"mumbai\":\"https://polygon-mumbai.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum-goerli\":\"https://arbitrum-goerli.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\"}')[env.GOV_NETWORK] }}" + ethereum_url: "${{ fromJSON('{\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"goerli\":\"https://goerli.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"mumbai\":\"https://polygon-mumbai.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum-goerli\":\"https://arbitrum-goerli.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\"}')[env.GOV_NETWORK] }}" port: 8685 if: github.event.inputs.eth_pk == '' && env.GOV_NETWORK != '' diff --git a/.github/workflows/prepare-migration.yaml b/.github/workflows/prepare-migration.yaml index 9d6206a18..62afbd974 100644 --- a/.github/workflows/prepare-migration.yaml +++ b/.github/workflows/prepare-migration.yaml @@ -36,7 +36,7 @@ jobs: ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }} SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }} INFURA_KEY: ${{ secrets.INFURA_KEY }} - QUICKNODE_KEY: ${{ secrets.QUICKNODE_KEY }} + ANKR_KEY: ${{ secrets.ANKR_KEY }} POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }} ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }} BASESCAN_KEY: ${{ secrets.BASESCAN_KEY }} @@ -48,7 +48,7 @@ jobs: with: wallet_connect_project_id: ${{ secrets.WALLET_CONNECT_PROJECT_ID }} requested_network: "${{ inputs.network }}" - ethereum_url: "${{ fromJSON('{\"optimism\":\"https://optimism-mainnet.infura.io/v3/$INFURA_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"goerli\":\"https://goerli.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"mumbai\":\"https://polygon-mumbai.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum-goerli\":\"https://arbitrum-goerli.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://fluent-prettiest-scion.base-mainnet.quiknode.pro/$QUICKNODE_KEY\",\"base-goerli\":\"https://base-goerli.infura.io/v3/$INFURA_KEY\",\"linea-goerli\":\"https://linea-goerli.infura.io/v3/$INFURA_KEY\",\"scroll-goerli\":\"https://alpha-rpc.scroll.io/l2\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}" + ethereum_url: "${{ fromJSON('{\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"goerli\":\"https://goerli.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"mumbai\":\"https://polygon-mumbai.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum-goerli\":\"https://arbitrum-goerli.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://rpc.ankr.com/base/$ANKR_KEY\",\"base-goerli\":\"https://base-goerli.infura.io/v3/$INFURA_KEY\",\"linea-goerli\":\"https://linea-goerli.infura.io/v3/$INFURA_KEY\",\"scroll-goerli\":\"https://alpha-rpc.scroll.io/l2\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}" port: 8585 if: github.event.inputs.eth_pk == '' diff --git a/.github/workflows/run-contract-linter.yaml b/.github/workflows/run-contract-linter.yaml index 2513cc18c..1732c7b2c 100644 --- a/.github/workflows/run-contract-linter.yaml +++ b/.github/workflows/run-contract-linter.yaml @@ -10,6 +10,7 @@ jobs: ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }} SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }} INFURA_KEY: ${{ secrets.INFURA_KEY }} + ANKR_KEY: ${{ secrets.ANKR_KEY }} POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }} ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }} LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }} diff --git a/.github/workflows/run-coverage.yaml b/.github/workflows/run-coverage.yaml index b28829b56..b0e651d5c 100644 --- a/.github/workflows/run-coverage.yaml +++ b/.github/workflows/run-coverage.yaml @@ -12,6 +12,7 @@ jobs: ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }} SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }} INFURA_KEY: ${{ secrets.INFURA_KEY }} + ANKR_KEY: ${{ secrets.ANKR_KEY }} POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }} ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }} LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }} diff --git a/.github/workflows/run-eslint.yaml b/.github/workflows/run-eslint.yaml index 1961fec4c..024eb689c 100644 --- a/.github/workflows/run-eslint.yaml +++ b/.github/workflows/run-eslint.yaml @@ -10,6 +10,7 @@ jobs: ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }} SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }} INFURA_KEY: ${{ secrets.INFURA_KEY }} + ANKR_KEY: ${{ secrets.ANKR_KEY }} POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }} ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }} LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }} diff --git a/.github/workflows/run-gas-profiler.yaml b/.github/workflows/run-gas-profiler.yaml index d49ba9152..14ab7926a 100644 --- a/.github/workflows/run-gas-profiler.yaml +++ b/.github/workflows/run-gas-profiler.yaml @@ -11,6 +11,7 @@ jobs: ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }} SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }} INFURA_KEY: ${{ secrets.INFURA_KEY }} + ANKR_KEY: ${{ secrets.ANKR_KEY }} POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }} ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }} LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }} diff --git a/.github/workflows/run-scenarios.yaml b/.github/workflows/run-scenarios.yaml index 5da35d811..d1fcdcb47 100644 --- a/.github/workflows/run-scenarios.yaml +++ b/.github/workflows/run-scenarios.yaml @@ -13,7 +13,7 @@ jobs: ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }} SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }} INFURA_KEY: ${{ secrets.INFURA_KEY }} - QUICKNODE_KEY: ${{ secrets.QUICKNODE_KEY }} + ANKR_KEY: ${{ secrets.ANKR_KEY }} POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }} ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }} BASESCAN_KEY: ${{ secrets.BASESCAN_KEY }} diff --git a/.github/workflows/run-semgrep.yaml b/.github/workflows/run-semgrep.yaml index dad4eb51a..61900fb42 100644 --- a/.github/workflows/run-semgrep.yaml +++ b/.github/workflows/run-semgrep.yaml @@ -17,6 +17,7 @@ jobs: ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }} SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }} INFURA_KEY: ${{ secrets.INFURA_KEY }} + ANKR_KEY: ${{ secrets.ANKR_KEY }} POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }} OPTIMISMSCAN_KEY: ${{ secrets.OPTIMISMSCAN_KEY }} container: diff --git a/.github/workflows/run-unit-tests.yaml b/.github/workflows/run-unit-tests.yaml index 49779a40f..58c7166bc 100644 --- a/.github/workflows/run-unit-tests.yaml +++ b/.github/workflows/run-unit-tests.yaml @@ -10,6 +10,7 @@ jobs: ETHERSCAN_KEY: ${{ secrets.ETHERSCAN_KEY }} SNOWTRACE_KEY: ${{ secrets.SNOWTRACE_KEY }} INFURA_KEY: ${{ secrets.INFURA_KEY }} + ANKR_KEY: ${{ secrets.ANKR_KEY }} POLYGONSCAN_KEY: ${{ secrets.POLYGONSCAN_KEY }} ARBISCAN_KEY: ${{ secrets.ARBISCAN_KEY }} LINEASCAN_KEY: ${{ secrets.LINEASCAN_KEY }} diff --git a/hardhat.config.ts b/hardhat.config.ts index f2cf294fc..22c2cf4b4 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -65,7 +65,7 @@ const { LINEASCAN_KEY, OPTIMISMSCAN_KEY, INFURA_KEY, - QUICKNODE_KEY, + ANKR_KEY, MNEMONIC = 'myth like bonus scare over problem client lizard pioneer submit female collect', REPORT_GAS = 'false', NETWORK_PROVIDER = '', @@ -92,6 +92,7 @@ export function requireEnv(varName, msg?: string): string { 'ETHERSCAN_KEY', 'SNOWTRACE_KEY', 'INFURA_KEY', + 'ANKR_KEY', 'POLYGONSCAN_KEY', 'ARBISCAN_KEY', 'LINEASCAN_KEY', @@ -121,12 +122,12 @@ const networkConfigs: NetworkConfig[] = [ { network: 'optimism', chainId: 10, - url: `https://optimism-mainnet.infura.io/v3/${INFURA_KEY}`, + url: `https://rpc.ankr.com/optimism/${ANKR_KEY}`, }, { network: 'base', chainId: 8453, - url: `https://fluent-prettiest-scion.base-mainnet.quiknode.pro/${QUICKNODE_KEY}`, + url: `https://rpc.ankr.com/base/${ANKR_KEY}`, }, { network: 'arbitrum', From 304667869f71aca4328951ced1d93d31a3f0e34b Mon Sep 17 00:00:00 2001 From: MishaShWoof Date: Tue, 19 Nov 2024 12:15:47 +0200 Subject: [PATCH 10/11] set enacted true --- .../usdt/migrations/1729767867_add_wusdm_as_collateral.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployments/optimism/usdt/migrations/1729767867_add_wusdm_as_collateral.ts b/deployments/optimism/usdt/migrations/1729767867_add_wusdm_as_collateral.ts index 66751bf1a..e6a897b79 100644 --- a/deployments/optimism/usdt/migrations/1729767867_add_wusdm_as_collateral.ts +++ b/deployments/optimism/usdt/migrations/1729767867_add_wusdm_as_collateral.ts @@ -109,7 +109,7 @@ export default migration('1729767867_add_wusdm_as_collateral', { }, async enacted(): Promise { - return false; + return true; }, async verify(deploymentManager: DeploymentManager) { From ddcdcce2c8384188d0b78b84a4a6c47c448f1c5e Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Tue, 19 Nov 2024 12:30:21 +0200 Subject: [PATCH 11/11] fix: undo changes --- .github/workflows/enact-migration.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/enact-migration.yaml b/.github/workflows/enact-migration.yaml index 076d60a6c..3d74677e2 100644 --- a/.github/workflows/enact-migration.yaml +++ b/.github/workflows/enact-migration.yaml @@ -87,7 +87,7 @@ jobs: with: wallet_connect_project_id: ${{ secrets.WALLET_CONNECT_PROJECT_ID }} requested_network: "${{ env.GOV_NETWORK }}" - ethereum_url: "${{ fromJSON('{\"mantle\":\"https://mantle-mainnet.infura.io/v3/$INFURA_KEY\",\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"goerli\":\"https://goerli.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"mumbai\":\"https://polygon-mumbai.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum-goerli\":\"https://arbitrum-goerli.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\",\"base\":\"https://rpc.ankr.com/base/$ANKR_KEY\",\"base-goerli\":\"https://base-goerli.infura.io/v3/$INFURA_KEY\",\"linea-goerli\":\"https://linea-goerli.infura.io/v3/$INFURA_KEY\",\"scroll-goerli\":\"https://alpha-rpc.scroll.io/l2\",\"scroll\":\"https://rpc.scroll.io\"}')[inputs.network] }}" + ethereum_url: "${{ fromJSON('{\"mantle\":\"https://mantle-mainnet.infura.io/v3/$INFURA_KEY\",\"optimism\":\"https://rpc.ankr.com/optimism/$ANKR_KEY\",\"fuji\":\"https://api.avax-test.network/ext/bc/C/rpc\",\"mainnet\":\"https://mainnet.infura.io/v3/$INFURA_KEY\",\"goerli\":\"https://goerli.infura.io/v3/$INFURA_KEY\",\"sepolia\":\"https://sepolia.infura.io/v3/$INFURA_KEY\",\"mumbai\":\"https://polygon-mumbai.infura.io/v3/$INFURA_KEY\",\"polygon\":\"https://polygon-mainnet.infura.io/v3/$INFURA_KEY\",\"arbitrum-goerli\":\"https://arbitrum-goerli.infura.io/v3/$INFURA_KEY\",\"arbitrum\":\"https://arbitrum-mainnet.infura.io/v3/$INFURA_KEY\"}')[env.GOV_NETWORK] }}" port: 8685 if: github.event.inputs.eth_pk == '' && env.GOV_NETWORK != '' && github.event.inputs.impersonateAccount == ''