Skip to content

Commit

Permalink
Fix VelocimeterV2 on base (looks like dex should be deprecated)
Browse files Browse the repository at this point in the history
  • Loading branch information
zZoMROT committed Feb 27, 2024
1 parent 20025dd commit 8847304
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions test/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ const tokens = {
BEAN: '0xBEA0000029AD1c77D3d5D23Ba2D8893dB9d1Efab',
'3CRV': '0x6c3F90f043a72FA612cbac8115EE7e52BDe6E490',
base: {
DAI: '0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb',
WETH: '0x4200000000000000000000000000000000000006',
USDC: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
DAI: '0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb',
axlUSDC: '0xEB466342C4d449BC9f53A865D5Cb90586f405215',
},
optimistic: {
WETH: '0x4200000000000000000000000000000000000006',
Expand Down Expand Up @@ -145,7 +145,7 @@ const deployParams = {
initcodeHash: '0x6ce8eb472fa82df5469c6ab6d485f17c3ad13c8cd7af59b3d4a8026c5ce0f7e2',
fees: [100, 500, 2500, 10000],
},
VelocimieterV2: { // base network
VelocimeterV2: { // base network
factory: '0xe21aac7f113bd5dc2389e4d8a8db854a87fd6951',
initcodeHash: '0x0ccd005ee58d5fb11632ef5c2e0866256b240965c62c8e990c0f84a97f311879',
},
Expand Down
28 changes: 14 additions & 14 deletions test/oracles/SolidlyOracle.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ const { deployContract } = require('@1inch/solidity-utils');
const { resetHardhatNetworkFork } = require('@1inch/solidity-utils/hardhat-setup');
const {
tokens,
deployParams: { VelocimieterV2, UniswapV3Base },
deployParams: { VelocimeterV2, UniswapV3Base },
testRate,
} = require('../helpers.js');

describe('SolidlyOracle', function () {
describe('VelocimieterV2', function () {
describe('VelocimeterV2', function () {
before(async function () {
await resetHardhatNetworkFork(network, 'base');
});
Expand All @@ -19,29 +19,29 @@ describe('SolidlyOracle', function () {
});

async function initContracts () {
const velocimieterV2Oracle = await deployContract('SolidlyOracle', [VelocimieterV2.factory, VelocimieterV2.initcodeHash]);
const velocimeterV2Oracle = await deployContract('SolidlyOracle', [VelocimeterV2.factory, VelocimeterV2.initcodeHash]);
const uniswapV3Oracle = await deployContract('UniswapV3LikeOracle', [UniswapV3Base.factory, UniswapV3Base.initcodeHash, UniswapV3Base.fees]);
return { velocimieterV2Oracle, uniswapV3Oracle };
return { velocimeterV2Oracle, uniswapV3Oracle };
}

it('WETH -> USDC', async function () {
const { velocimieterV2Oracle, uniswapV3Oracle } = await loadFixture(initContracts);
await testRate(tokens.base.WETH, tokens.base.USDC, tokens.NONE, velocimieterV2Oracle, uniswapV3Oracle);
it('WETH -> axlUSDC', async function () {
const { velocimeterV2Oracle, uniswapV3Oracle } = await loadFixture(initContracts);
await testRate(tokens.base.WETH, tokens.base.axlUSDC, tokens.NONE, velocimeterV2Oracle, uniswapV3Oracle);
});

it('USDC -> WETH', async function () {
const { velocimieterV2Oracle, uniswapV3Oracle } = await loadFixture(initContracts);
await testRate(tokens.base.USDC, tokens.base.WETH, tokens.NONE, velocimieterV2Oracle, uniswapV3Oracle);
it('axlUSDC -> WETH', async function () {
const { velocimeterV2Oracle, uniswapV3Oracle } = await loadFixture(initContracts);
await testRate(tokens.base.axlUSDC, tokens.base.WETH, tokens.NONE, velocimeterV2Oracle, uniswapV3Oracle);
});

it('WETH -> DAI', async function () {
const { velocimieterV2Oracle, uniswapV3Oracle } = await loadFixture(initContracts);
await testRate(tokens.base.WETH, tokens.base.DAI, tokens.NONE, velocimieterV2Oracle, uniswapV3Oracle);
const { velocimeterV2Oracle, uniswapV3Oracle } = await loadFixture(initContracts);
await testRate(tokens.base.WETH, tokens.base.DAI, tokens.NONE, velocimeterV2Oracle, uniswapV3Oracle, 0.1);
});

it('DAI -> WETH', async function () {
const { velocimieterV2Oracle, uniswapV3Oracle } = await loadFixture(initContracts);
await testRate(tokens.base.DAI, tokens.base.WETH, tokens.NONE, velocimieterV2Oracle, uniswapV3Oracle);
const { velocimeterV2Oracle, uniswapV3Oracle } = await loadFixture(initContracts);
await testRate(tokens.base.DAI, tokens.base.WETH, tokens.NONE, velocimeterV2Oracle, uniswapV3Oracle, 0.1);
});
});
});

0 comments on commit 8847304

Please sign in to comment.