From 6c218494374d8f706747bf3a9839af84740ebc42 Mon Sep 17 00:00:00 2001 From: Ruvaag Date: Mon, 28 Nov 2022 19:25:54 +0530 Subject: [PATCH] chore: delete deployment directory (#241) * Delete ArbiDeploymentFlow.md * Delete KovanDeployment.md * Delete interactions.md * Rename deployments/Deploy.sol to scripts/deploy.sol --- deployments/ArbiDeploymentFlow.md | 195 ------------------- deployments/KovanDeployment.md | 39 ---- deployments/interactions.md | 70 ------- deployments/Deploy.sol => scripts/deploy.sol | 2 +- 4 files changed, 1 insertion(+), 305 deletions(-) delete mode 100644 deployments/ArbiDeploymentFlow.md delete mode 100644 deployments/KovanDeployment.md delete mode 100644 deployments/interactions.md rename deployments/Deploy.sol => scripts/deploy.sol (99%) diff --git a/deployments/ArbiDeploymentFlow.md b/deployments/ArbiDeploymentFlow.md deleted file mode 100644 index 668ffd97..00000000 --- a/deployments/ArbiDeploymentFlow.md +++ /dev/null @@ -1,195 +0,0 @@ -# Deployment Strategy for Arb Mainnet - -## Contract deployment flow - -### Core Contracts - -1. Registry - 1. Deploy implementation - 2. Deploy proxy - 3. Call init() -2. Account - 1. Deploy implementation - 2. Register account implementation against "ACCOUNT" -3. AccountManager - 1. Deploy implementation - 2. Deploy proxy - 3. Register account manager proxy against "ACCOUNT_MANAGER" - 4. Call init(Registry) -4. RiskEngine - 1. Deploy contract(Registry) - 2. Register risk engine against "RISK_ENGINE" -5. Beacon - 1. Deploy contract(Account) - 2. Register beacon against "ACCOUNT_BEACON" -6. AccountFactory - 1. Deploy contract(Beacon) - 2. Register account factory against "ACCOUNT_FACTORY" -7. RateModel - 1. Deploy Contract - 2. Register rate model factory against "RATE_MODEL" -8. OracleFacade - 1. Deploy Contract - 2. Register oracle against "ORACLE_FACADE" -9. ControllerFacade - 1. Deploy Contract - 2. Register controller against "CONTROLLER_FACADE" - 3. Setting token allowance - 1. call controllerFacade.toggleTokenAllowance(token) -10. Initializing dependencies - 1. AccountManager.initDep() - 2. RiskEngine.initDep() - ---- - -### Lending Contracts - -1. ETH - 1. Deploy LEther implementation - 2. Deploy Proxy(LEther) - 3. call init(WETH), "LEther", "LEth", IRegistry, reserveFactor) - 4. call Registry.setLToken(WETH, Proxy) - 5. call accountManager.toggleCollateralStatus(token) - 6. call Proxy.initDep() -2. ERC-20 - 1. Deploy LToken implementation - 2. For Each token - 1. Deploy Proxy(LToken) - 2. call init(token, "LToken", "Token", IRegistry, reserveFactor) - 3. call Registry.setLToken(token, Proxy) - 4. call Proxy.initDep() - 3. Set collateral status for tokens - 4. [List of token addresses](deployment_strat_arbi.md/#arbitrum-token-addresses) - ---- - -## Interactions - -### Chain link Oracle - -1. Deploy ChainLinkOracle(ETH/USD) - 1. call oracleFacade.setOracle(token, ChainLinkOracle) -2. For every token call chainLinkOracle.setFeed(Token, Token/USD) - -#### Chain link oracle Contracts - -1. ETH/USD - 0x639fe6ab55c921f74e7fac1ee960c0b6293ba612 -2. BTC/USD - 0x6ce185860a4963106506c203335a2910413708e9 -3. STETH/USD - 0x07c5b924399cc23c24a95c8743de4006a32b7f2a -4. Other contracts are listed [here](https://data.chain.link/arbitrum/mainnet/crypto-usd) - ---- - -### Uniswap - -1. Deploy Controllers - 1. Deploy UniV3Controller(controllerFacade) - 2. call controllerFacade.updateController(Router, UniV3Controller) - -#### Uniswap Contracts - -1. Router - 0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45 -2. Quoter - 0xb27308f9F90D607463bb33eA1BeBb41C27CE5AB6 - ---- - -### SushiSwap - -1. Deploy Controller - 1. Deploy UniV2Controller(controllerFacade) - 2. call controllerFacade.updateController(SushiSwapRouter, UniV2Controller) -2. Deploy Oracle - 1. Deploy UniV2LPOracle(OracleFacade) - 2. call oracleFacade.setOracle(Pair, UniV2LPOracle) - -#### SushiSwap Contracts - -1. SushiSwap Router - 0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506 -2. Factory - 0xc35DADB65012eC5796536bD9864eD8773aBc74C4 -3. DPX/WETH - 0x0C1Cf6883efA1B496B01f654E247B9b419873054 -4. WETH/USDC - 0x905dfCD5649217c42684f23958568e533C711Aa3 -5. WETH/WBTC - 0x515e252b2b5c22b4b2b6Df66c2eBeeA871AA4d69 -6. WETH/USDT - 0xCB0E5bFa72bBb4d16AB5aA0c60601c438F04b4ad -7. WETH/DAI - 0x692a0B300366D1042679397e40f3d2cb4b8F7D30 - ---- - -### Aave - -1. Deploy Controller - 1. Deploy AaveV3Controller(controllerFacade) - 2. Deploy AaveEthController(aWeth) - 3. call controllerFacade.updateController(Pool, aaveV3Controller) - 4. call controllerFacade.updateController(WETHGateway, AaveEthController) -2. Deploy Oracle - 1. deploy aTokenOracle(oracleFacade) -3. For each lending pool: - 1. call oracleFacade.setOracle(aToken, aTokenOracle) - 2. call controllerFacade.toggleTokenAllowance(aToken) - -#### Aave contracts - -1. Pool - 0x794a61358D6845594F94dc1DB02A252b5b4814aD -2. PoolDataProvider - 0x69FA688f1Dc47d4B5d8029D5a35FB7a548310654 -3. WETHGateway - 0xC09e69E79106861dF5d289dA88349f10e2dc6b5C -4. aWeth - 0xe50fA9b3c56FfB159cB0FCA61F5c9D750e8128c8 -5. aDai - 0x82E64f49Ed5EC1bC6e43DAD4FC8Af9bb3A2312EE -6. aUSDC - 0x625E7708f30cA75bfd92586e17077590C60eb4cD -7. aUSDT - 0x6ab707Aca953eDAeFBc4fD23bA73294241490620 -8. aWBTC - 0x078f358208685046a11C85e8ad32895DED33A249 - ---- - -### WETH - -1. Deploy Controller - 1. Deploy WETHController(WETH) - 2. call controllerFacade.updateController(WETH, WETHController) - 3. call controllerFacade.toggleTokenAllowance(WETH) -2. Deploy Oracle - 1. Deploy WETHOracle() - 2. call oracleFacade.setOracle(WETH, WETHOracle) - ---- - -### Curve - -1. Deploy Controller - 1. Deploy CurveCryptoSwapController(controllerFacade) - 2. call controllerFacade.updateController(Pool, CurveCryptoSwapController) -2. Deploy Oracle - 1. Deploy CurveTriCryptoOracle(Pool) - 2. call oracleFacade.setOracle(crv3crypto, CurveTriCryptoOracle) - -#### Curve Contracts - -1. Pool - 0x960ea3e3C7FB317332d990873d354E18d7645590 -2. crv3crypto - 0x8e0B8c8BB9db49a46697F3a5Bb8A308e744821D2 - ---- - -### Yearn - -1. Deploy Controller - 1. Deploy YearnVaultController() - 2. call controllerFacade.updateController(Curve3CryptoVault, YearnVaultController) -2. Deploy Oracle - 1. Deploy YTokenOracle(oracleFacade) - 2. call oracle.setOracle(Curve3CryptoVault, YTokenOracle) - -#### Yearn Contracts - -1. Curve3Crypto Vault - 0x239e14A19DFF93a17339DCC444f74406C17f8E67 - ---- - -## Arbitrum token addresses - -1. WETH - 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1 -2. DAI - 0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1 -3. USDC - 0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8 -4. USDT - 0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9 -5. WBTC - 0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f -6. DPX - 0x6C2C06790b3E3E3c38e12Ee22F8183b37a13EE55 -7. RDPX - 0x32Eb7902D4134bf98A28b963D26de779AF92A212 -8. GMX - 0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a diff --git a/deployments/KovanDeployment.md b/deployments/KovanDeployment.md deleted file mode 100644 index 3e159b9e..00000000 --- a/deployments/KovanDeployment.md +++ /dev/null @@ -1,39 +0,0 @@ -# Kovan Deployment Addresses - -## Core Contracts - -| Contract | Address | Type | -|------------------|--------------------------------------------|----------------| -| Registry | 0x67aaf420ccd97f53aff4e2eaa5767d363584556a | Implementation | -| Registry | 0xf7a351d75a8ee354d9b9e6ee721711fdf4ae69e1 | Core/Proxy | -| RateModel | 0x8349dcbe9a631b30c9da8b49b204eb7f93ec46e5 | Core | -| AccountManager | 0x833286d4c23b25acb56111f9a3cdc08d72a24874 | Implementation | -| AccountManager | 0xd8acd6b4fd479fe72b1b4f3552487b1d97d0157e | Core/Proxy | -| Account | 0xf0dea16e72f20315ee4ac576523c859735e66de5 | Implementation | -| Account Beacon | 0x9b920cbb38523788f371d5148db892c8e7b0a073 | Beacon | -| AccountFactory | 0x6bdd40b7bef989336df3f1948e1c771044dac4a7 | Core | -| RiskEngine | 0x4f01fd5b2b0cc96401d350028a11afd49ce43d68 | Core | -| ControllerFacade | 0xf45f9761dfc708b31ba4bb6053c01ca3908cad0b | Controller | -| OracleFacade | 0xb47dc78d6120a1efec42ed96d14cd4142cffde2c | Oracle | -| LToken | 0x3734418c9438044b5c210042bb8ad97d646ed71f | Implementation | -| LEther | 0x20097a353397bc4e0e78c6d47aa89cf6657e5b51 | Implementation | -| LEther | 0x5f33f4b662134c82c639bff0f36aede452879e25 | Proxy/LEther | -| LDai | 0x3452d8381d7956b3e2d801399129518942668678 | Proxy/LToken | - -## Integrations - -| Interaction | Contract | Address | Type | -|-------------|----------------|--------------------------------------------|-------------| -| WETH | WETHController | 0xfc1bf3a3e12d89bf650d67ff1818320aa0f077bd | Controller | -| WETH | WETHOracle | 0x9990630889b46e4761dc0e260e95c266dcc7a06e | Oracle | -| WETH | WETH | 0xd0A1E359811322d97991E03f863a0C30C2cF029C | ERC-20 | -| AAVE | Pool | 0x329462f8ed05E5FfBF6dfB84106e76B69e6B1F94 | LendingPool | -| AAVE | WETHGateway | 0x509B2506FbA1BD41765F6A82C7B0Dd4229191768 | WETHGateway | -| AAVE | V3Controller | 0x0a92f059752ffaf2a6deab9726d5fb4525ba87ba | Controller | -| AAVE | EthController | 0xc4748d8f8c855298ee027443282071ad2185d41c | Controller | -| AAVE | ATokenOracle | 0x1262b19041606138f158d68147185c2391f3fb72 | Oracle | -| AAVE | aDAI | 0xE101EcB2283Acf0C91e05A428DDD8833Ac66B572 | aToken | -| AAVE | aWETH | 0xec6E5B3Bd3e8CC74756Af812994361d8D1EF30F8 | aToken | -| Uniswap | V3Controller | 0x9b14a22372cd9801819391502a840773fc752df7 | Controller | -| Uniswap | Router | 0xE592427A0AEce92De3Edee1F18E0157C05861564 | V3Router | -| chainlink | ChainlinkOracle| 0xe4c2a2768a7a51060508bbbce35dfc19a61bfb8e | Oracle | diff --git a/deployments/interactions.md b/deployments/interactions.md deleted file mode 100644 index 4cb366fe..00000000 --- a/deployments/interactions.md +++ /dev/null @@ -1,70 +0,0 @@ -# Sentiment Interactions - -Network - Arbitrum Mainnet - -## Uniswap V3 - -| Interaction | Signature | Sighash | Target | -|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|--------------------------------------------| -| Swap | multicall(bytes[] data) | 0xac9650d8 | 0xE592427A0AEce92De3Edee1F18E0157C05861564 | -| Swap | exactOutputSingle((address tokenIn, address tokenOut, uint24 fee, address recipient, uint256 amountOut, uint256 amountInMaximum, uint160 sqrtPriceLimitX96)) | 0x5023b4df | 0xE592427A0AEce92De3Edee1F18E0157C05861564 | -| Swap | exactInputSingle((address tokenIn, address tokenOut, uint24 fee, address recipient, uint256 amountIn, uint256 amountInMaximum, uint160 sqrtPriceLimitX96)) | 0x04e45aaf | 0xE592427A0AEce92De3Edee1F18E0157C05861564 | -| Unwrap | unwrapWETH9(uint256 amount, address recipient) | 0x49404b7c | 0xE592427A0AEce92De3Edee1F18E0157C05861564 | -| Refund | refundETH() | 0x12210e8a | 0xE592427A0AEce92De3Edee1F18E0157C05861564 | - ---- - -## Uniswap V2 - -| Interaction | Signature | Sighash | Target | -|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------|--------------------------------------------| -| Swap | swapExactTokensForTokens(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) | 0x38ed1739 | 0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506 | -| Swap | swapTokensForExactTokens(uint256 amountOut, uint256 amountInMax, address[] path, address to, uint256 deadline) | 0x8803dbee | 0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506 | -| Swap | swapExactETHForTokens(uint256 amountOutMin, address[] path , address to, uint256 deadline) | 0x7ff36ab5 | 0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506 | -| Swap | swapETHForExactTokens(uint256 amountOut, address[] path, address to, uint256 deadline) | 0xfb3bdb41 | 0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506 | -| Swap | swapExactTokensForETH(uint256 amountIn, uint256 amountOutMin, address[] path, address to, uint256 deadline) | 0x18cbafe5 | 0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506 | -| Swap | swapTokensForExactETH(uint256 amountOut, uint256 amountInMax, address[] path, address to, uint256 deadline) | 0x4a25d94a | 0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506 | -| Deposit | addLiquidity(address tokenA, address tokenB, uint256 amountADesired, uint256 amountBDesired, uint256 amountAmin, uint256 amountBmin, address to, uint256 deadline) | 0xe8e33700 | 0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506 | -| Withdraw | removeLiquidity(address tokenA, address tokenB, uint256 liquidity, uint256 amountAmin, uint256 amountBmin, address to, uint256 deadline) | 0xbaa2abde | 0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506 | -| Deposit Eth | addLiquidityETH(address token, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountEthMin, address to, uint256 liquidity) | 0xf305d719 | 0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506 | -| Withdraw Eth | removeLiquidityETH(address token, uint256 liquidity, uint256 amountTokenMin, uint256 amountEthMin, address to, uint256 deadline) | 0x02751cec | 0x1b02dA8Cb0d097eB8D57A175b88c7D8b47997506 | - ---- - -## Aave - -| Interaction | Signature | Sighash | Target | -|-------------|--------------------------------------------------------------------------------|------------|--------------------------------------------| -| Deposit | supply(address asset, uint256 amount, address onBehalfOf, uint16 referralCode) | 0x617ba037 | 0x794a61358D6845594F94dc1DB02A252b5b4814aD | -| Withdraw | withdraw(address asset, uint256 amount, address to) | 0x69328dec | 0x794a61358D6845594F94dc1DB02A252b5b4814aD | -| DepositEth | depositETH(address pool, address onBehalfOf, uint16 referralCode) | 0x474cf53d | 0xC09e69E79106861dF5d289dA88349f10e2dc6b5C | -| WithdrawEth | withdrawETH(address pool, uint256 amount, address to) | 0x80500d20 | 0xC09e69E79106861dF5d289dA88349f10e2dc6b5C | - ---- - -## WETH - -| Interaction | Signature | Sighash | Target | -|-------------|-----------------------|------------|--------------------------------------------| -| Wrap | deposit() | 0xd0e30db0 | 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1 | -| Unwrap | withdraw(uint256 amt) | 0x2e1a7d4d | 0x82aF49447D8a07e3bd95BD0d56f35241523fBab1 | - ---- - -## Curve - -| Interaction | Signature | Sighash | Target | -|-------------|---------------------------------------------------------------------------------------------|------------|--------------------------------------------| -| Swap | exchange(uint256 tokenOutId, uint256 tokenInID, uint256 amount, uint256 amountOutMin, bool useEth) | 0x394747c5 | 0x960ea3e3C7FB317332d990873d354E18d7645590 | -| Deposit | add_liquidity(uint256[3] amounts, uint256 amountOutMin) | 0x4515cef3 | 0x960ea3e3C7FB317332d990873d354E18d7645590 | -| Withdraw | remove_liquidity(uint256 amount, uint256[3] minAmounts) | 0xecb586a5 | 0x960ea3e3C7FB317332d990873d354E18d7645590 | -| Withdraw | remove_liquidity_one_coin(uint256 amount,uint256 coinId, uint256 amountOutMin) | 0xf1dc3cc9 | 0x960ea3e3C7FB317332d990873d354E18d7645590 | - ---- - -## Yearn - -| Interaction | Signature | Sighash | Target | -|-------------|--------------------------|------------|--------------------------------------------| -| Deposit | deposit(uint256 amount) | 0xb6b55f25 | 0x239e14A19DFF93a17339DCC444f74406C17f8E67 | -| Withdraw | withdraw(uint256 amount) | 0x2e1a7d4d | 0x239e14A19DFF93a17339DCC444f74406C17f8E67 | diff --git a/deployments/Deploy.sol b/scripts/deploy.sol similarity index 99% rename from deployments/Deploy.sol rename to scripts/deploy.sol index db6cadb6..56b217d1 100644 --- a/deployments/Deploy.sol +++ b/scripts/deploy.sol @@ -358,4 +358,4 @@ contract Deploy is Test { console.log("Curve Stable Swap Controller", address(curveStableSwapController)); console.log("Curve Crypto Swap Controller", address(curveTriCryptoController)); } -} \ No newline at end of file +}