Skip to content

Commit

Permalink
fix: reopen radiant ethereum & base, remove arbitrum & bnb configs (#84)
Browse files Browse the repository at this point in the history
Co-authored-by: Bob Lu <[email protected]>
  • Loading branch information
LuPoYi and Bob Lu authored Nov 6, 2024
1 parent 9891e35 commit bdca9bf
Show file tree
Hide file tree
Showing 14 changed files with 73 additions and 80 deletions.
5 changes: 5 additions & 0 deletions .changeset/violet-emus-yell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@protocolink/logics': patch
---

reopen radiant ethereum & base, remove arbitrum & bnb configs
14 changes: 0 additions & 14 deletions src/logics/radiant-v2/configs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,13 @@ export const configs: Config[] = [
RadiantV2FlashLoanCallback: '0x6bfCE075A1c4F0fD4067A401dA8f159354e1a916',
},
},
{
chainId: common.ChainId.bnb,
contract: {
ProtocolDataProvider: '0x2f9D57E97C3DFED8676e605BC504a48E0c5917E9',
RadiantV2FlashLoanCallback: '0x6bfCE075A1c4F0fD4067A401dA8f159354e1a916',
},
},
{
chainId: common.ChainId.base,
contract: {
ProtocolDataProvider: '0x07d2DC09A1CbDD01e5f6Ca984b060A3Ff31b9EAF',
RadiantV2FlashLoanCallback: '0x6bfCE075A1c4F0fD4067A401dA8f159354e1a916',
},
},
{
chainId: common.ChainId.arbitrum,
contract: {
ProtocolDataProvider: '0x596B0cc4c5094507C50b579a662FE7e7b094A2cC',
RadiantV2FlashLoanCallback: '0x6bfCE075A1c4F0fD4067A401dA8f159354e1a916',
},
},
];

export const [supportedChainIds, configMap] = configs.reduce(
Expand Down
12 changes: 6 additions & 6 deletions src/logics/radiant-v2/logic.borrow.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { InterestRateMode } from './types';
import { LendingPool__factory } from './contracts';
import { LogicTestCase } from 'test/types';
import { Service } from './service';
import { arbitrumTokens } from './tokens';
import * as common from '@protocolink/common';
import { constants, utils } from 'ethers';
import * as core from '@protocolink/core';
import { expect } from 'chai';
import { mainnetTokens } from './tokens';

describe.skip('RadiantV2 BorrowLogic', () => {
describe('RadiantV2 BorrowLogic', () => {
context('Test getTokenList', async () => {
BorrowLogic.supportedChainIds.forEach((chainId) => {
it(`network: ${common.toNetworkId(chainId)}`, async () => {
Expand All @@ -21,7 +21,7 @@ describe.skip('RadiantV2 BorrowLogic', () => {
});

context('Test build', () => {
const chainId = common.ChainId.arbitrum;
const chainId = common.ChainId.mainnet;
const logic = new BorrowLogic(chainId);
let lendingPoolAddress: string;
const iface = LendingPool__factory.createInterface();
Expand All @@ -35,19 +35,19 @@ describe.skip('RadiantV2 BorrowLogic', () => {
const testCases: LogicTestCase<BorrowLogicFields>[] = [
{
fields: {
output: new common.TokenAmount(arbitrumTokens.ETH, '1'),
output: new common.TokenAmount(mainnetTokens.ETH, '1'),
interestRateMode: InterestRateMode.variable,
},
},
{
fields: {
output: new common.TokenAmount(arbitrumTokens.WETH, '1'),
output: new common.TokenAmount(mainnetTokens.WETH, '1'),
interestRateMode: InterestRateMode.variable,
},
},
{
fields: {
output: new common.TokenAmount(arbitrumTokens.USDC, '1'),
output: new common.TokenAmount(mainnetTokens.USDC, '1'),
interestRateMode: InterestRateMode.variable,
},
},
Expand Down
30 changes: 15 additions & 15 deletions src/logics/radiant-v2/logic.deposit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { DepositLogic, DepositLogicFields } from './logic.deposit';
import { LendingPool__factory } from './contracts';
import { LogicTestCase } from 'test/types';
import { Service } from './service';
import { arbitrumTokens } from './tokens';
import * as common from '@protocolink/common';
import { constants, utils } from 'ethers';
import * as core from '@protocolink/core';
import { expect } from 'chai';
import { mainnetTokens } from './tokens';

describe.skip('RadiantV2 DepositLogic', () => {
describe('RadiantV2 DepositLogic', () => {
context('Test getTokenList', async () => {
DepositLogic.supportedChainIds.forEach((chainId) => {
it(`network: ${common.toNetworkId(chainId)}`, async () => {
Expand All @@ -20,7 +20,7 @@ describe.skip('RadiantV2 DepositLogic', () => {
});

context('Test build', () => {
const chainId = common.ChainId.arbitrum;
const chainId = common.ChainId.mainnet;
const logic = new DepositLogic(chainId);
let lendingPoolAddress: string;
const iface = LendingPool__factory.createInterface();
Expand All @@ -34,40 +34,40 @@ describe.skip('RadiantV2 DepositLogic', () => {
const testCases: LogicTestCase<DepositLogicFields>[] = [
{
fields: {
input: new common.TokenAmount(arbitrumTokens.ETH, '1'),
output: new common.TokenAmount(arbitrumTokens.rWETH, '1'),
input: new common.TokenAmount(mainnetTokens.ETH, '1'),
output: new common.TokenAmount(mainnetTokens.rWETH, '1'),
},
},
{
fields: {
input: new common.TokenAmount(arbitrumTokens.WETH, '1'),
output: new common.TokenAmount(arbitrumTokens.rWETH, '1'),
input: new common.TokenAmount(mainnetTokens.WETH, '1'),
output: new common.TokenAmount(mainnetTokens.rWETH, '1'),
},
},
{
fields: {
input: new common.TokenAmount(arbitrumTokens.USDC, '1'),
output: new common.TokenAmount(arbitrumTokens.rUSDC, '1'),
input: new common.TokenAmount(mainnetTokens.USDC, '1'),
output: new common.TokenAmount(mainnetTokens.rUSDC, '1'),
},
},
{
fields: {
input: new common.TokenAmount(arbitrumTokens.ETH, '1'),
output: new common.TokenAmount(arbitrumTokens.rWETH, '1'),
input: new common.TokenAmount(mainnetTokens.ETH, '1'),
output: new common.TokenAmount(mainnetTokens.rWETH, '1'),
balanceBps: 5000,
},
},
{
fields: {
input: new common.TokenAmount(arbitrumTokens.WETH, '1'),
output: new common.TokenAmount(arbitrumTokens.rWETH, '1'),
input: new common.TokenAmount(mainnetTokens.WETH, '1'),
output: new common.TokenAmount(mainnetTokens.rWETH, '1'),
balanceBps: 5000,
},
},
{
fields: {
input: new common.TokenAmount(arbitrumTokens.USDC, '1'),
output: new common.TokenAmount(arbitrumTokens.rUSDC, '1'),
input: new common.TokenAmount(mainnetTokens.USDC, '1'),
output: new common.TokenAmount(mainnetTokens.rUSDC, '1'),
balanceBps: 5000,
},
},
Expand Down
8 changes: 4 additions & 4 deletions src/logics/radiant-v2/logic.flash-loan.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { FlashLoanLogic, FlashLoanLogicFields } from './logic.flash-loan';
import { LendingPool__factory } from './contracts';
import { LogicTestCase } from 'test/types';
import { Service } from './service';
import { arbitrumTokens } from './tokens';
import * as common from '@protocolink/common';
import { constants, utils } from 'ethers';
import { expect } from 'chai';
import { getContractAddress } from './configs';
import { mainnetTokens } from './tokens';

describe.skip('RadiantV2 FlashLoanLogic', () => {
describe('RadiantV2 FlashLoanLogic', () => {
context('Test getTokenList', async () => {
FlashLoanLogic.supportedChainIds.forEach((chainId) => {
it(`network: ${common.toNetworkId(chainId)}`, async () => {
Expand All @@ -20,7 +20,7 @@ describe.skip('RadiantV2 FlashLoanLogic', () => {
});

context('Test build', () => {
const chainId = common.ChainId.arbitrum;
const chainId = common.ChainId.mainnet;
const logic = new FlashLoanLogic(chainId);
let lendingPoolAddress: string;
const iface = LendingPool__factory.createInterface();
Expand All @@ -33,7 +33,7 @@ describe.skip('RadiantV2 FlashLoanLogic', () => {
const testCases: LogicTestCase<FlashLoanLogicFields>[] = [
{
fields: {
loans: new common.TokenAmounts([arbitrumTokens.WETH, '1'], [arbitrumTokens.USDC, '1']),
loans: new common.TokenAmounts([mainnetTokens.WETH, '1'], [mainnetTokens.USDC, '1']),
params: '0x',
},
},
Expand Down
18 changes: 9 additions & 9 deletions src/logics/radiant-v2/logic.repay.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import { LendingPool__factory } from './contracts';
import { LogicTestCase } from 'test/types';
import { RepayLogic, RepayLogicFields } from './logic.repay';
import { Service } from './service';
import { arbitrumTokens } from './tokens';
import * as common from '@protocolink/common';
import { constants, utils } from 'ethers';
import * as core from '@protocolink/core';
import { expect } from 'chai';
import { mainnetTokens } from './tokens';

describe.skip('RadiantV2 RepayLogic', () => {
describe('RadiantV2 RepayLogic', () => {
context('Test getTokenList', async () => {
RepayLogic.supportedChainIds.forEach((chainId) => {
it(`network: ${common.toNetworkId(chainId)}`, async () => {
Expand All @@ -21,7 +21,7 @@ describe.skip('RadiantV2 RepayLogic', () => {
});

context('Test build', () => {
const chainId = common.ChainId.arbitrum;
const chainId = common.ChainId.mainnet;
const logic = new RepayLogic(chainId);
let lendingPoolAddress: string;
const iface = LendingPool__factory.createInterface();
Expand All @@ -34,44 +34,44 @@ describe.skip('RadiantV2 RepayLogic', () => {
const testCases: LogicTestCase<RepayLogicFields>[] = [
{
fields: {
input: new common.TokenAmount(arbitrumTokens.ETH, '1'),
input: new common.TokenAmount(mainnetTokens.ETH, '1'),
interestRateMode: InterestRateMode.variable,
borrower: '0xaAaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa',
},
},
{
fields: {
input: new common.TokenAmount(arbitrumTokens.WETH, '1'),
input: new common.TokenAmount(mainnetTokens.WETH, '1'),
interestRateMode: InterestRateMode.variable,
borrower: '0xaAaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa',
},
},
{
fields: {
input: new common.TokenAmount(arbitrumTokens.USDC, '1'),
input: new common.TokenAmount(mainnetTokens.USDC, '1'),
interestRateMode: InterestRateMode.variable,
borrower: '0xaAaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa',
},
},
{
fields: {
input: new common.TokenAmount(arbitrumTokens.ETH, '1'),
input: new common.TokenAmount(mainnetTokens.ETH, '1'),
interestRateMode: InterestRateMode.variable,
borrower: '0xaAaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa',
balanceBps: 5000,
},
},
{
fields: {
input: new common.TokenAmount(arbitrumTokens.WETH, '1'),
input: new common.TokenAmount(mainnetTokens.WETH, '1'),
interestRateMode: InterestRateMode.variable,
borrower: '0xaAaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa',
balanceBps: 5000,
},
},
{
fields: {
input: new common.TokenAmount(arbitrumTokens.USDC, '1'),
input: new common.TokenAmount(mainnetTokens.USDC, '1'),
interestRateMode: InterestRateMode.variable,
borrower: '0xaAaAaAaaAaAaAaaAaAAAAAAAAaaaAaAaAaaAaaAa',
balanceBps: 5000,
Expand Down
30 changes: 15 additions & 15 deletions src/logics/radiant-v2/logic.withdraw.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { LendingPool__factory } from './contracts';
import { LogicTestCase } from 'test/types';
import { Service } from './service';
import { WithdrawLogic, WithdrawLogicFields } from './logic.withdraw';
import { arbitrumTokens } from './tokens';
import * as common from '@protocolink/common';
import { constants, utils } from 'ethers';
import * as core from '@protocolink/core';
import { expect } from 'chai';
import { mainnetTokens } from './tokens';

describe.skip('RadiantV2 WithdrawLogic', () => {
describe('RadiantV2 WithdrawLogic', () => {
context('Test getTokenList', async () => {
WithdrawLogic.supportedChainIds.forEach((chainId) => {
it(`network: ${common.toNetworkId(chainId)}`, async () => {
Expand All @@ -20,7 +20,7 @@ describe.skip('RadiantV2 WithdrawLogic', () => {
});

context('Test build', () => {
const chainId = common.ChainId.arbitrum;
const chainId = common.ChainId.mainnet;
const logic = new WithdrawLogic(chainId);
let lendingPoolAddress: string;
const iface = LendingPool__factory.createInterface();
Expand All @@ -34,40 +34,40 @@ describe.skip('RadiantV2 WithdrawLogic', () => {
const testCases: LogicTestCase<WithdrawLogicFields>[] = [
{
fields: {
input: new common.TokenAmount(arbitrumTokens.rWETH, '1'),
output: new common.TokenAmount(arbitrumTokens.ETH, '1'),
input: new common.TokenAmount(mainnetTokens.rWETH, '1'),
output: new common.TokenAmount(mainnetTokens.ETH, '1'),
},
},
{
fields: {
input: new common.TokenAmount(arbitrumTokens.rWETH, '1'),
output: new common.TokenAmount(arbitrumTokens.WETH, '1'),
input: new common.TokenAmount(mainnetTokens.rWETH, '1'),
output: new common.TokenAmount(mainnetTokens.WETH, '1'),
},
},
{
fields: {
input: new common.TokenAmount(arbitrumTokens.rUSDC, '1'),
output: new common.TokenAmount(arbitrumTokens.USDC, '1'),
input: new common.TokenAmount(mainnetTokens.rUSDC, '1'),
output: new common.TokenAmount(mainnetTokens.USDC, '1'),
},
},
{
fields: {
input: new common.TokenAmount(arbitrumTokens.rWETH, '1'),
output: new common.TokenAmount(arbitrumTokens.ETH, '1'),
input: new common.TokenAmount(mainnetTokens.rWETH, '1'),
output: new common.TokenAmount(mainnetTokens.ETH, '1'),
balanceBps: 5000,
},
},
{
fields: {
input: new common.TokenAmount(arbitrumTokens.rWETH, '1'),
output: new common.TokenAmount(arbitrumTokens.WETH, '1'),
input: new common.TokenAmount(mainnetTokens.rWETH, '1'),
output: new common.TokenAmount(mainnetTokens.WETH, '1'),
balanceBps: 5000,
},
},
{
fields: {
input: new common.TokenAmount(arbitrumTokens.rUSDC, '1'),
output: new common.TokenAmount(arbitrumTokens.USDC, '1'),
input: new common.TokenAmount(mainnetTokens.rUSDC, '1'),
output: new common.TokenAmount(mainnetTokens.USDC, '1'),
balanceBps: 5000,
},
},
Expand Down
Loading

0 comments on commit bdca9bf

Please sign in to comment.