-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v1.5.1: Add Uniswap v3 TWAP as a fallback oracle to Chainlink (#152)
* Update coverage [skip ci] * Deploy LINK/USDC to base sepolia * v1.5 testnet redeploy to redo migration * Add SizeFactory and SizeRegistry (#5) * Add SizeFactory * Split factory/registry due to contract size limit * Create SizeRegistryFactoryTest * Add more tests for 2 markets * Test createMarket * Add more tests * Add fork test * Bump * Bump CI * Refactor SizeRegistryFactoryTest * Add isMarket function * Change description to percent instead of BP * Fix fork test * Use ISize and implementation in constructor * Add PriceFeed factory * Fix slither * Change _ by | on descriptions * Fix test * Remove unused code * v1.5 migration with `reinitialize` (#7) * Create migration function * Create NonTransferrableScaledTokenV1_5Test (WIP) * Attempt build * Fix circular dependency * Add Size deployment to SizeRegistry on tests * Pin foundry version * WIP * WIP + compiling * Alternate branch * Fix getUserView * Create withdrawV1_2 function * Do migration in a single reinitialize * Add testFork_ForkReinitializeV1_5_set_2_existing_markets * Create separate tests to check gas usage * Add v1.5 at the end of NonTransferrableScaledTokenV1_5 * Fix _testFork_ForkReinitializeV1_5_migrate * Rollback SizeDataView struct to not break integrations * Fix getMarketsDescriptions * Fix tests * Fix compilation warnings * Fix fork test * Attempt fix slither * fix slither * attempt fix slither * Fix slither * Fix slither * Add more consistency checks * Add more checks to reinitialize fn * Remove blank line * Add new methods * Add more tests * Disable slither calls-loop * Fix checks by using only scaled balances * Fix fork test * Fix CI * Add v1 token to /deprecated folder * Remove unused code * getBorrowATokensDescriptionsV1_5 * Fix README * Increase test coverage * Upgrade SizeView.version to v1.5 * Add withdraw checks * Fix tests * Add comment * Fix NonTransferrableScaledTokenV1_5.allowance * Create deposit/withdraw fork test * Deploy LINK/USDC to base sepolia * Deploy SizeRegistry, SizeFactory to base-sepolia * Update migration procedure * Add audit tests * Add per user checks * Fix recommendations from v1.5 review * Fix error * v1.5 libraries on prepare_crytic * Redeploy SizeFactory to base-sepolia * Update coverage [skip ci] * Deploy SizeFactory to production * "$@" * Add more information about the deployment process * Add Uniswap v3 oracle WIP * Done UniswapV3PriceFeed (does not compile) * Compiling * Fix SizeFactory tests * Add ChainlinkSequencerUptimeFeedTest * Fix tests * Finish UniswapV3PriceFeedTest * Fix PriceFeed tests * Add averageBlockTime to increase the cardinality * Fix unit tests * Add Custodia Security audit * Fix CI * Fix fork test * Restructure folders * Add IPriceFeedV1_5_1 interface * Ignore warnings from Aave v3 compilation * format * Remove unused code * Increase the coverage on price feeds to 100% * Change variable name from pool to uniswapV3Pool * Addresses issues from ChainDefenders review * Deploy SizeFactory v1.5.1 --------- Co-authored-by: Size <[email protected]>
- Loading branch information
Showing
51 changed files
with
3,659 additions
and
274 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,3 +39,6 @@ medusa | |
|
||
# Custom | ||
selectors.txt | ||
|
||
# Typechain | ||
types/ |
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
Binary file not shown.
Binary file not shown.
1,077 changes: 1,077 additions & 0 deletions
1,077
broadcast/UpgradeSizeFactory.s.sol/8453/run-1734432794.json
Large diffs are not rendered by default.
Oops, something went wrong.
1,077 changes: 1,077 additions & 0 deletions
1,077
broadcast/UpgradeSizeFactory.s.sol/8453/run-latest.json
Large diffs are not rendered by default.
Oops, something went wrong.
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
Submodule v3-periphery
added at
b325bb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity 0.8.23; | ||
|
||
import {EnumerableMap} from "@openzeppelin/contracts/utils/structs/EnumerableMap.sol"; | ||
import {console} from "forge-std/Script.sol"; | ||
|
||
import {Vm} from "forge-std/Vm.sol"; | ||
|
||
import {BaseScript} from "@script/BaseScript.sol"; | ||
import {Deploy} from "@script/Deploy.sol"; | ||
import {Networks} from "@script/Networks.sol"; | ||
|
||
contract GetChainlinkAggregatorInformationScript is BaseScript, Networks, Deploy { | ||
EnumerableMap.AddressToUintMap addresses; | ||
|
||
function setUp() public {} | ||
|
||
event NewRound(uint256 roundId, address startedBy, uint256 startedAt); | ||
|
||
function run() public ignoreGas { | ||
uint256 deploymentBlock = 17147278; | ||
address aggregator = 0x330eC3210511cC8f5A87A737A08905092e033AF3; | ||
|
||
bytes32[] memory topics = new bytes32[](1); | ||
topics[0] = NewRound.selector; | ||
|
||
uint256 toBlock = vm.getBlockNumber(); | ||
uint256 fromBlock = deploymentBlock; | ||
uint256 batchSize = 100_000; | ||
|
||
Vm.EthGetLogs[] memory logs; | ||
|
||
while (fromBlock < toBlock) { | ||
uint256 endBlock = (fromBlock + batchSize > toBlock) ? toBlock : fromBlock + batchSize; | ||
|
||
logs = vm.eth_getLogs(fromBlock, endBlock, aggregator, topics); | ||
|
||
for (uint256 j = 0; j < logs.length; j++) { | ||
Vm.EthGetLogs memory log = logs[j]; | ||
uint64 blockNumber = log.blockNumber; | ||
console.log("%s", blockNumber); | ||
} | ||
|
||
fromBlock = endBlock + 1; | ||
} | ||
} | ||
} |
Oops, something went wrong.