Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge #809

Merged
merged 19 commits into from
Nov 28, 2024
Merged

Merge #809

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/deploy-bots.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ jobs:
MODE_MAINNET_RPC_URLS: ${{ secrets.MODE_MAINNET_RPC_URLS }}
BASE_MAINNET_RPC_URLS: ${{ secrets.BASE_MAINNET_RPC_URLS }}
OPTIMISM_MAINNET_RPC_URLS: ${{ secrets.OPTIMISM_MAINNET_RPC_URLS }}
LISK_MAINNET_RPC_URLS: ${{ secrets.LISK_MAINNET_RPC_URLS }}
FRAXTAL_MAINNET_RPC_URLS: ${{ secrets.FRAXTAL_MAINNET_RPC_URLS }}

steps:
- name: Checkout repository
Expand All @@ -360,8 +362,7 @@ jobs:
# - name: run smoke tests for feed verifier
# working-directory: ./ops
# run: make feed-verifier-smoke-test

# - name: run smoke tests for price verifier
# - name: run smoke tests for price verifier
# working-directory: ./ops
# run: make price-verifier-smoke-test

Expand Down Expand Up @@ -394,6 +395,8 @@ jobs:
MODE_MAINNET_RPC_URLS: ${{ secrets.MODE_MAINNET_RPC_URLS }}
BASE_MAINNET_RPC_URLS: ${{ secrets.BASE_MAINNET_RPC_URLS }}
OPTIMISM_MAINNET_RPC_URLS: ${{ secrets.OPTIMISM_MAINNET_RPC_URLS }}
LISK_MAINNET_RPC_URLS: ${{ secrets.LISK_MAINNET_RPC_URLS }}
FRAXTAL_MAINNET_RPC_URLS: ${{ secrets.FRAXTAL_MAINNET_RPC_URLS }}
steps:
- name: Checkout
uses: actions/checkout@master
Expand Down
614 changes: 307 additions & 307 deletions .yarn/releases/yarn-4.5.1.cjs → .yarn/releases/yarn-4.5.3.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ enableGlobalCache: false

nodeLinker: node-modules

yarnPath: .yarn/releases/yarn-4.5.1.cjs
yarnPath: .yarn/releases/yarn-4.5.3.cjs
4 changes: 4 additions & 0 deletions ops/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ prod-plan:
export TF_VAR_uptime_pyth_updater_api=${UPTIME_PYTH_UPDATER_API} && \
export TF_VAR_base_mainnet_rpcs=${BASE_MAINNET_RPC_URLS} && \
export TF_VAR_mode_mainnet_rpcs=${MODE_MAINNET_RPC_URLS} && \
export TF_VAR_lisk_mainnet_rpcs=${LISK_MAINNET_RPC_URLS} && \
export TF_VAR_fraxtal_mainnet_rpcs=${FRAXTAL_MAINNET_RPC_URLS} && \
terraform init && \
terraform plan

Expand Down Expand Up @@ -109,6 +111,8 @@ prod-deploy:
export TF_VAR_uptime_pyth_updater_api=${UPTIME_PYTH_UPDATER_API} && \
export TF_VAR_base_mainnet_rpcs=${BASE_MAINNET_RPC_URLS} && \
export TF_VAR_mode_mainnet_rpcs=${MODE_MAINNET_RPC_URLS} && \
export TF_VAR_lisk_mainnet_rpcs=${LISK_MAINNET_RPC_URLS} && \
export TF_VAR_fraxtal_mainnet_rpcs=${FRAXTAL_MAINNET_RPC_URLS} && \
terraform init && \
terraform apply -auto-approve

Expand Down
14 changes: 13 additions & 1 deletion ops/prod/config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,19 @@ locals {
LIFIAPIKEY = var.lifi_api_key,
}
)
liquidation_base_variables = merge(
liquidation_lisk_variables = merge(
local.shared_env_vars_lambda,
{
DISCORD_WEBHOOK_URL = var.liquidation_discord_webhook_url,
SENDGRID_API_KEY = var.liquidation_sendgrid_api_key,
SENDGRID_EMAIL_TO = var.liquidation_sendgrid_email_to,
UPTIME_LIQUIDATOR_API = var.uptime_liquidator_api,
DISCORD_SUCCESS_WEBHOOK_URL = var.discord_success_webhook_url,
DISCORD_FAILURE_WEBHOOK_URL = var.discord_failure_webhook_url,
LIFIAPIKEY = var.lifi_api_key,
}
)
liquidation_fraxtal_variables = merge(
local.shared_env_vars_lambda,
{
DISCORD_WEBHOOK_URL = var.liquidation_discord_webhook_url,
Expand Down
30 changes: 30 additions & 0 deletions ops/prod/fraxtal.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
locals {
# Base Network RPC URL (this will be passed in via GitHub Secrets)
fraxtal_mainnet_rpcs = var.fraxtal_mainnet_rpcs # List of RPC URLs from environment variable
fraxtal_mainnet_chain_id = "252"
}


module "fraxtal_mainnet_liquidator_ecs" {
source = "../modules/bot"

cluster_name = var.liquidator_cluster_name
task_definition_family = var.task_definition_family_fraxtal
ecr_repository_url = "${local.liquidator_ecr_repository_name}:${var.bots_image_tag}"
bots_image_tag = var.bots_image_tag
web3_http_provider_urls = local.fraxtal_mainnet_rpcs
target_chain_id = local.fraxtal_mainnet_chain_id
ethereum_admin_account = var.ethereum_admin_account
uptime_liquidator_api = var.uptime_liquidator_api
ethereum_admin_private_key = var.ethereum_admin_private_key
ecs_service_name = "${var.liquidator_service_name}-fraxtal"
desired_count = var.desired_count
liquidation_discord_webhook_url = var.liquidation_discord_webhook_url
discord_success_webhook_url = var.discord_success_webhook_url
discord_failure_webhook_url = var.discord_failure_webhook_url
lifi_api_key = var.lifi_api_key
subnet_ids = ["subnet-0cd439d262800846e"]
security_group_ids = ["sg-0a3996557af867ad0"]
region = var.region
liquidator_container_name = "${var.liquidator_container_name}-fraxtal"
}
30 changes: 30 additions & 0 deletions ops/prod/lisk.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
locals {
# Base Network RPC URL (this will be passed in via GitHub Secrets)
lisk_mainnet_rpcs = var.lisk_mainnet_rpcs # List of RPC URLs from environment variable
lisk_mainnet_chain_id = "1135"
}


module "lisk_mainnet_liquidator_ecs" {
source = "../modules/bot"

cluster_name = var.liquidator_cluster_name
task_definition_family = var.task_definition_family_lisk
ecr_repository_url = "${local.liquidator_ecr_repository_name}:${var.bots_image_tag}"
bots_image_tag = var.bots_image_tag
web3_http_provider_urls = local.lisk_mainnet_rpcs
target_chain_id = local.lisk_mainnet_chain_id
ethereum_admin_account = var.ethereum_admin_account
uptime_liquidator_api = var.uptime_liquidator_api
ethereum_admin_private_key = var.ethereum_admin_private_key
ecs_service_name = "${var.liquidator_service_name}-lisk"
desired_count = var.desired_count
liquidation_discord_webhook_url = var.liquidation_discord_webhook_url
discord_success_webhook_url = var.discord_success_webhook_url
discord_failure_webhook_url = var.discord_failure_webhook_url
lifi_api_key = var.lifi_api_key
subnet_ids = ["subnet-0cd439d262800846e"]
security_group_ids = ["sg-0a3996557af867ad0"]
region = var.region
liquidator_container_name = "${var.liquidator_container_name}-lisk"
}
4 changes: 3 additions & 1 deletion ops/prod/terraform.tfvars
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@ ecs_service_name = "opportunity_bot_service"
liquidator_service_name = "liquidator-service"
task_definition_family_optimism = "liquidator-optimism"
task_definition_family_base = "liquidator-base"
task_definition_family_mode = "liquidator-mode"
task_definition_family_mode = "liquidator-mode"
task_definition_family_lisk = "liquidator-lisk"
task_definition_family_fraxtal = "liquidator-fraxtal"
16 changes: 14 additions & 2 deletions ops/prod/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ variable "liquidation_sendgrid_api_key" {
variable "optimism_mainnet_rpcs" {
type = string
}
variable "lisk_mainnet_rpcs" {
type = string
}
variable "fraxtal_mainnet_rpcs" {
type = string
}

variable "liquidation_sendgrid_email_to" {
type = string
Expand All @@ -78,7 +84,6 @@ variable "uptime_liquidator_api" {
variable "uptime_pyth_updater_api" {
type = string
}
// ... existing variables ...

variable "task_definition_family_optimism" {
description = "Family name for the Optimism task definition"
Expand All @@ -94,8 +99,15 @@ variable "task_definition_family_mode" {
description = "Family name for the Mode task definition"
type = string
}
variable "task_definition_family_lisk" {
description = "Family name for the Lisk task definition"
type = string
}


variable "task_definition_family_fraxtal" {
description = "Family name for the Fraxtal task definition"
type = string
}


variable "ecr_repository_name" {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "monorepo",
"packageManager": "[email protected].1",
"packageManager": "[email protected].3",
"private": true,
"workspaces": [
"packages/bots/liquidator",
Expand Down
13 changes: 8 additions & 5 deletions packages/contracts/deploy/18-deploy-xerc20-adapters.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { DeployFunction } from "hardhat-deploy/types";
import { Address, fromBytes, pad, toBytes } from "viem";
import { base, bob, fraxtal, mode, optimism } from "viem/chains";
import { base, bob, fraxtal, lisk, mode, optimism } from "viem/chains";

const lzEndpoints: Record<number, Address> = {
[base.id]: "0x1a44076050125825900e736c501f859c50fE728c",
Expand All @@ -15,23 +15,26 @@ const hyperlaneEndpoints: Record<number, Address> = {
[bob.id]: "0x8358D8291e3bEDb04804975eEa0fe9fe0fAfB147",
[fraxtal.id]: "0x2f9DB5616fa3fAd1aB06cB2C906830BA63d135e3",
[mode.id]: "0x2f2aFaE1139Ce54feFC03593FeE8AB2aDF4a85A7",
[lisk.id]: "0x2f2aFaE1139Ce54feFC03593FeE8AB2aDF4a85A7",
[optimism.id]: "0xd4C1905BB1D26BC93DAC913e13CaCC278CdCC80D"
};

const hyperlaneDeployments: Record<number, Address> = {
const xerc20HyperlaneDeployments: Record<number, Address> = {
[optimism.id]: "0x80748Ff4c4505742e63ddf4Ab31114ce00Ee0B9e",
[base.id]: "0x04d3Fcc666616A76822f303aA4546321458B8F10",
[mode.id]: "0xb81ab95BEE03ed655C8a99d484EFfCfE335319EB",
[fraxtal.id]: "0x7F2aFd3Fa3f9CFFb66AaA2ccE0f7527B37C8bbfA",
[bob.id]: "0x5aB39DfE9eC8317825Ab6e1BCc7068c4C7897FB9"
[bob.id]: "0x5aB39DfE9eC8317825Ab6e1BCc7068c4C7897FB9",
[lisk.id]: "0x14A71B2822663491D98CBB8332bB15Db61c36f7a"
};

const ionTokens: Record<number, Address> = {
[base.id]: "0x3eE5e23eEE121094f1cFc0Ccc79d6C809Ebd22e5",
[optimism.id]: "0x887d1c6A4f3548279c2a8A9D0FA61B5D458d14fC",
[mode.id]: "0x18470019bf0e94611f15852f7e93cf5d65bc34ca",
[fraxtal.id]: "0x5BD5c0cB9E4404C63526433BcBd6d133C1d73ffE",
[bob.id]: "0xb90f229f27851e205d77fd46487989ad6e44c17c"
[bob.id]: "0xb90f229f27851e205d77fd46487989ad6e44c17c",
[lisk.id]: "0x3f608A49a3ab475dA7fBb167C1Be6b7a45cD7013"
};

const func: DeployFunction = async ({ viem, getNamedAccounts, deployments, getChainId }): Promise<void> => {
Expand Down Expand Up @@ -130,7 +133,7 @@ const func: DeployFunction = async ({ viem, getNamedAccounts, deployments, getCh
}
}

for (const [otherChainId, otherChainDeployment] of Object.entries(hyperlaneDeployments).filter(
for (const [otherChainId, otherChainDeployment] of Object.entries(xerc20HyperlaneDeployments).filter(
([otherChainId]) => +otherChainId !== chainId
)) {
const registeredBridge = await xerc20Hyperlane.read.mappedBridges([+otherChainId]);
Expand Down
Loading
Loading