-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'development' into feat/veion-ui
- Loading branch information
Showing
50 changed files
with
22,859 additions
and
21,880 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
725 changes: 367 additions & 358 deletions
725
.yarn/releases/yarn-4.5.0.cjs → .yarn/releases/yarn-4.5.1.cjs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "monorepo", | ||
"packageManager": "[email protected].0", | ||
"packageManager": "[email protected].1", | ||
"private": true, | ||
"workspaces": [ | ||
"packages/bots/liquidator", | ||
|
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,80 @@ | ||
import { prepareAndLogTransaction } from "../logging"; | ||
import { DeployResult } from "hardhat-deploy/types"; | ||
import { Address } from "viem"; | ||
|
||
import { addUnderlyingsToMpo } from "./utils"; | ||
import { underlying } from "../utils"; | ||
import { AerodromeDeployFnParams, ChainlinkDeployFnParams } from "../../types"; | ||
|
||
export const deployApi3Oracle = async ({ | ||
viem, | ||
getNamedAccounts, | ||
deployments, | ||
deployConfig, | ||
assets | ||
}: ChainlinkDeployFnParams): Promise<{ apo: DeployResult }> => { | ||
const { deployer, multisig } = await getNamedAccounts(); | ||
const publicClient = await viem.getPublicClient(); | ||
let tx; | ||
|
||
//// API3 Oracle | ||
const apo = await deployments.deploy("API3PriceOracle", { | ||
from: deployer, | ||
args: [], | ||
log: true, | ||
proxy: { | ||
execute: { | ||
init: { | ||
methodName: "initialize", | ||
args: [deployConfig.stableToken, deployConfig.nativeTokenUsdChainlinkFeed] | ||
} | ||
}, | ||
proxyContract: "OpenZeppelinTransparentProxy", | ||
owner: multisig ?? deployer | ||
}, | ||
waitConfirmations: 1, | ||
skipIfAlreadyDeployed: true | ||
}); | ||
if (apo.transactionHash) await publicClient.waitForTransactionReceipt({ hash: apo.transactionHash as Address }); | ||
|
||
const api3 = await viem.getContractAt( | ||
"API3PriceOracle", | ||
(await deployments.get("API3PriceOracle")).address as Address | ||
); | ||
|
||
const underlyings = assets.map((c) => underlying(assets, c.symbol)); | ||
|
||
const mpo = await viem.getContractAt( | ||
"MasterPriceOracle", | ||
(await deployments.get("MasterPriceOracle")).address as Address | ||
); | ||
console.log("underlyings: ", underlyings); | ||
await addUnderlyingsToMpo(mpo as any, underlyings, api3.address, deployer, publicClient); | ||
|
||
const addressesProvider = await viem.getContractAt( | ||
"AddressesProvider", | ||
(await deployments.get("AddressesProvider")).address as Address | ||
); | ||
const api3Address = await addressesProvider.read.getAddress(["API3PriceOracle"]); | ||
if (api3Address !== api3.address) { | ||
if (((await addressesProvider.read.owner()) as Address).toLowerCase() === deployer.toLowerCase()) { | ||
tx = await addressesProvider.write.setAddress(["API3PriceOracle", api3.address]); | ||
await publicClient.waitForTransactionReceipt({ hash: tx }); | ||
console.log(`setAddress API3PriceOracle at ${tx}`); | ||
} else { | ||
prepareAndLogTransaction({ | ||
contractInstance: addressesProvider, | ||
functionName: "setAddress", | ||
args: ["API3PriceOracle", api3.address], | ||
description: "Set API3PriceOracle address on AddressProvider", | ||
inputs: [ | ||
{ internalType: "string", name: "id", type: "string" }, | ||
{ internalType: "address", name: "newAddress", type: "address" } | ||
] | ||
}); | ||
console.log("Logged Transaction to setAddress API3PriceOracle on AddressProvider"); | ||
} | ||
} | ||
|
||
return { apo }; | ||
}; |
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.
64 changes: 64 additions & 0 deletions
64
packages/contracts/contracts/external/aerodrome/IAerodromeSwapRouter.sol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// SPDX-License-Identifier: GPL-2.0-or-later | ||
pragma solidity ^0.8.10; | ||
|
||
/// @title Router token swapping functionality | ||
/// @notice Functions for swapping tokens via CL | ||
interface ISwapRouter_Aerodrome { | ||
struct ExactInputSingleParams { | ||
address tokenIn; | ||
address tokenOut; | ||
int24 tickSpacing; | ||
address recipient; | ||
uint256 deadline; | ||
uint256 amountIn; | ||
uint256 amountOutMinimum; | ||
uint160 sqrtPriceLimitX96; | ||
} | ||
|
||
/// @notice Swaps `amountIn` of one token for as much as possible of another token | ||
/// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata | ||
/// @return amountOut The amount of the received token | ||
function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut); | ||
|
||
struct ExactInputParams { | ||
bytes path; | ||
address recipient; | ||
uint256 deadline; | ||
uint256 amountIn; | ||
uint256 amountOutMinimum; | ||
} | ||
|
||
/// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path | ||
/// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata | ||
/// @return amountOut The amount of the received token | ||
function exactInput(ExactInputParams calldata params) external payable returns (uint256 amountOut); | ||
|
||
struct ExactOutputSingleParams { | ||
address tokenIn; | ||
address tokenOut; | ||
int24 tickSpacing; | ||
address recipient; | ||
uint256 deadline; | ||
uint256 amountOut; | ||
uint256 amountInMaximum; | ||
uint160 sqrtPriceLimitX96; | ||
} | ||
|
||
/// @notice Swaps as little as possible of one token for `amountOut` of another token | ||
/// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata | ||
/// @return amountIn The amount of the input token | ||
function exactOutputSingle(ExactOutputSingleParams calldata params) external payable returns (uint256 amountIn); | ||
|
||
struct ExactOutputParams { | ||
bytes path; | ||
address recipient; | ||
uint256 deadline; | ||
uint256 amountOut; | ||
uint256 amountInMaximum; | ||
} | ||
|
||
/// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed) | ||
/// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata | ||
/// @return amountIn The amount of the input token | ||
function exactOutput(ExactOutputParams calldata params) external payable returns (uint256 amountIn); | ||
} |
64 changes: 0 additions & 64 deletions
64
packages/contracts/contracts/external/aerodrome/ISwapRouter.sol
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.