Skip to content

Commit

Permalink
fea: lsk
Browse files Browse the repository at this point in the history
  • Loading branch information
rhlsthrm committed Dec 2, 2024
1 parent d8027ef commit 3bc8f48
Show file tree
Hide file tree
Showing 8 changed files with 2,812 additions and 3 deletions.

Large diffs are not rendered by default.

1,016 changes: 1,016 additions & 0 deletions packages/contracts/deployments/lisk/IonicFlywheel_LSK.json

Large diffs are not rendered by default.

1,160 changes: 1,160 additions & 0 deletions packages/contracts/deployments/lisk/IonicFlywheel_LSK_Implementation.json

Large diffs are not rendered by default.

289 changes: 289 additions & 0 deletions packages/contracts/deployments/lisk/IonicFlywheel_LSK_Proxy.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/contracts/tasks/chain-specific/lisk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import "./rewards";

export const COMPTROLLER_MAIN = "0xF448A36feFb223B8E46e36FF12091baBa97bdF60";
export const ION = "0x3f608A49a3ab475dA7fBb167C1Be6b7a45cD7013";
export const LSK = "0xac485391EB2d7D88253a7F1eF18C37f4242D1A24";

export const WETH_MARKET = "0x1c3e2b1a167d8b6D85505E82f46495eeb34951F8";
export const USDC_MARKET = "0x7682C12F6D1af845479649c77A9E7729F0180D78";
Expand Down
40 changes: 39 additions & 1 deletion packages/contracts/tasks/chain-specific/lisk/rewards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { task } from "hardhat/config";
import { setupRewards } from "../../flywheel/setup";
import { parseEther } from "viem";
import { SUPPLY_DURATION } from "..";
import { ION, LSK_MARKET, USDC_MARKET, USDT_MARKET, WBTC_MARKET, WETH_MARKET } from ".";
import { ION, LSK, LSK_MARKET, USDC_MARKET, USDT_MARKET, WBTC_MARKET, WETH_MARKET } from ".";

task("lisk:add-rewards:epoch5:supply", "add rewards to a market").setAction(
async (_, { viem, deployments, getNamedAccounts }) => {
Expand Down Expand Up @@ -43,3 +43,41 @@ task("lisk:add-rewards:epoch5:supply", "add rewards to a market").setAction(
);
}
);

task("lisk:add-rewards:epoch5:supply:lsk", "add rewards to a market").setAction(
async (_, { viem, deployments, getNamedAccounts }) => {
const { deployer, multisig } = await getNamedAccounts();
const rewardToken = LSK;
const rewardTokenName = "LSK";
const market = WBTC_MARKET;
const _market = await viem.getContractAt("EIP20Interface", market);
const name = await _market.read.name();

const rewardAmount = (500).toString();

console.log("setting rewards for token: ", name, rewardAmount, rewardTokenName);
await new Promise((resolve) => setTimeout(resolve, 4000));

// Sending tokens
const _rewardToken = await viem.getContractAt("EIP20Interface", rewardToken);
let balance = await _rewardToken.read.balanceOf([market]);
console.log("balance: ", balance);
if (balance < parseEther(rewardAmount)) {
const tx = await _rewardToken.write.transfer([market, parseEther(rewardAmount) - balance]);
console.log(`Sent ${rewardAmount} ${rewardTokenName} to ${market} - ${tx}`);
} else {
console.log(`Market already has enough ${rewardTokenName} - ${market}`);
}

await setupRewards(
"supply",
market,
rewardTokenName,
rewardToken,
SUPPLY_DURATION,
deployer as Address,
viem,
deployments
);
}
);
12 changes: 12 additions & 0 deletions packages/sdk/deployments/lisk.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@
"IonicFlywheelDynamicRewards_ION_v3": {
"address": "0x3eE5e23eEE121094f1cFc0Ccc79d6C809Ebd22e5"
},
"IonicFlywheelDynamicRewards_LSK_v3": {
"address": "0xB828A7e95ae1097E3c3d0efB3c3544Ce6bcD77A1"
},
"IonicFlywheelLensRouter": {
"address": "0x1E2812B4dEcA77B5dD7Af9f2D6ec40102bcffD02"
},
Expand All @@ -86,6 +89,15 @@
"IonicFlywheel_ION_Proxy": {
"address": "0x523F183ECbBf9144403D937B444d8486aD752453"
},
"IonicFlywheel_LSK": {
"address": "0x8A48245Db7D3572AD118D41b2F7dFf0aaBEF37A7"
},
"IonicFlywheel_LSK_Implementation": {
"address": "0xD83ba0673090ba85f190e320a1C280AC816ba3aD"
},
"IonicFlywheel_LSK_Proxy": {
"address": "0x8A48245Db7D3572AD118D41b2F7dFf0aaBEF37A7"
},
"IonicUniV3Liquidator": {
"address": "0x50766FD9C93e65124f0160C8f301caC6f399B572"
},
Expand Down
8 changes: 6 additions & 2 deletions packages/ui/constants/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ export const REWARDS_TO_SYMBOL: Record<number, Record<Address, string>> = {
'0x887d1c6A4f3548279c2a8A9D0FA61B5D458d14fC': 'ION'
},
[lisk.id]: {
'0x3f608A49a3ab475dA7fBb167C1Be6b7a45cD7013': 'ION'
'0x3f608A49a3ab475dA7fBb167C1Be6b7a45cD7013': 'ION',
'0x523F183ECbBf9144403D937B444d8486aD752453': 'LSK'
}
};

Expand Down Expand Up @@ -133,7 +134,10 @@ export const FLYWHEEL_TYPE_MAP: Record<
borrow: []
},
[lisk.id]: {
supply: ['0x523F183ECbBf9144403D937B444d8486aD752453'],
supply: [
'0x523F183ECbBf9144403D937B444d8486aD752453',
'0x8A48245Db7D3572AD118D41b2F7dFf0aaBEF37A7'
],
borrow: []
}
};
Expand Down

0 comments on commit 3bc8f48

Please sign in to comment.