mirror of
https://github.com/luxfi/bridge.git
synced 2026-09-24 00:26:46 +00:00
update: smart contracts
This commit is contained in:
@@ -0,0 +1,719 @@
|
||||
import { Network } from "@/types/teleport";
|
||||
|
||||
export const sourceNetworks: Network[] = [
|
||||
{
|
||||
display_name: "Ethereum",
|
||||
internal_name: "ETHEREUM_MAINNET",
|
||||
native_currency: "ETH",
|
||||
logo: "https://cdn.lux.network/bridge/networks/ethereum_mainnet.png",
|
||||
is_testnet: false,
|
||||
is_featured: true,
|
||||
average_completion_time: "00:01:04.0494430",
|
||||
chain_id: 8888, // lux test
|
||||
// chain_id: 1,
|
||||
status: "active",
|
||||
type: "evm",
|
||||
refuel_amount_in_usd: 0.5,
|
||||
transaction_explorer_template: "https://explore.lux-test.network/tx/{0}",
|
||||
account_explorer_template: "https://explore.lux-test.network/address/{0}",
|
||||
node: "https://api.lux-test.network",
|
||||
currencies: [
|
||||
{
|
||||
name: "ETH",
|
||||
asset: "ETH",
|
||||
logo: "https://cdn.lux.network/bridge/currencies/eth.png",
|
||||
contract_address: null,
|
||||
decimals: 18,
|
||||
status: "active",
|
||||
is_deposit_enabled: true,
|
||||
is_withdrawal_enabled: true,
|
||||
is_refuel_enabled: false,
|
||||
max_withdrawal_amount: 1,
|
||||
deposit_fee: 0.001462,
|
||||
withdrawal_fee: 0.001462,
|
||||
source_base_fee: 0.000456,
|
||||
destination_base_fee: 0.000456,
|
||||
is_native: true
|
||||
},
|
||||
{
|
||||
name: "BKT",
|
||||
asset: "BKT",
|
||||
logo: "https://cdn.lux.network/bridge/currencies/bkt.png",
|
||||
contract_address: "0x9d62526f5Ce701950c30F2cACa70Edf70f9fbf0F",
|
||||
decimals: 18,
|
||||
status: "inactive",
|
||||
is_deposit_enabled: false,
|
||||
is_withdrawal_enabled: false,
|
||||
is_refuel_enabled: false,
|
||||
max_withdrawal_amount: 0,
|
||||
deposit_fee: 0,
|
||||
withdrawal_fee: 0,
|
||||
source_base_fee: 0,
|
||||
destination_base_fee: 0,
|
||||
is_native: false
|
||||
},
|
||||
{
|
||||
name: "ASTR",
|
||||
asset: "ASTR",
|
||||
logo: "https://cdn.lux.network/bridge/currencies/astr.png",
|
||||
contract_address: "0x9bBAf650DcD8D3583195715Fc46b1118c3CfDdfd",
|
||||
decimals: 18,
|
||||
status: "inactive",
|
||||
is_deposit_enabled: false,
|
||||
is_withdrawal_enabled: false,
|
||||
is_refuel_enabled: false,
|
||||
max_withdrawal_amount: 0,
|
||||
deposit_fee: 0,
|
||||
withdrawal_fee: 0,
|
||||
source_base_fee: 0,
|
||||
destination_base_fee: 0,
|
||||
is_native: false
|
||||
},
|
||||
{
|
||||
name: "ZKS",
|
||||
asset: "ZKS",
|
||||
logo: "https://cdn.lux.network/bridge/currencies/zks.png",
|
||||
contract_address: "0xe4815AE53B124e7263F08dcDBBB757d41Ed658c6",
|
||||
decimals: 18,
|
||||
status: "inactive",
|
||||
is_deposit_enabled: true,
|
||||
is_withdrawal_enabled: false,
|
||||
is_refuel_enabled: false,
|
||||
max_withdrawal_amount: 10000,
|
||||
deposit_fee: 166.865654,
|
||||
withdrawal_fee: 65.820981,
|
||||
source_base_fee: 26.053974,
|
||||
destination_base_fee: 26.053974,
|
||||
is_native: false
|
||||
},
|
||||
{
|
||||
name: "USDT",
|
||||
asset: "USDT",
|
||||
logo: "https://cdn.lux.network/bridge/currencies/usdt.png",
|
||||
contract_address: "0xFa005D52398B4BdAAf73C4e2E3AF8095533D790E",
|
||||
decimals: 6,
|
||||
status: "active",
|
||||
is_deposit_enabled: false,
|
||||
is_withdrawal_enabled: false,
|
||||
is_refuel_enabled: false,
|
||||
max_withdrawal_amount: 0,
|
||||
deposit_fee: 4.68,
|
||||
withdrawal_fee: 2.24,
|
||||
source_base_fee: 1,
|
||||
destination_base_fee: 1,
|
||||
is_native: false
|
||||
},
|
||||
{
|
||||
name: "USDC",
|
||||
asset: "USDC",
|
||||
logo: "https://cdn.lux.network/bridge/currencies/usdc.png",
|
||||
contract_address: "0x42449554b0c7D85EbD488e14D7D48c6A78D3F9Be",
|
||||
decimals: 6,
|
||||
status: "active",
|
||||
is_deposit_enabled: true,
|
||||
is_withdrawal_enabled: true,
|
||||
is_refuel_enabled: true,
|
||||
max_withdrawal_amount: 3000,
|
||||
deposit_fee: 12.79,
|
||||
withdrawal_fee: 6.4,
|
||||
source_base_fee: 0.99,
|
||||
destination_base_fee: 0.99,
|
||||
is_native: false
|
||||
},
|
||||
{
|
||||
name: "DAI",
|
||||
asset: "DAI",
|
||||
logo: "https://cdn.lux.network/bridge/currencies/dai.png",
|
||||
contract_address: "0xc16ECFE3cB80e142d7110b97a442d4caAA203ABf",
|
||||
decimals: 18,
|
||||
status: "active",
|
||||
is_deposit_enabled: true,
|
||||
is_withdrawal_enabled: true,
|
||||
is_refuel_enabled: true,
|
||||
max_withdrawal_amount: 3000,
|
||||
deposit_fee: 12.79,
|
||||
withdrawal_fee: 6.4,
|
||||
source_base_fee: 0.99,
|
||||
destination_base_fee: 0.99,
|
||||
is_native: false
|
||||
},
|
||||
{
|
||||
name: "LRC",
|
||||
asset: "LRC",
|
||||
logo: "https://cdn.lux.network/bridge/currencies/lrc.png",
|
||||
contract_address: "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
|
||||
decimals: 18,
|
||||
status: "inactive",
|
||||
is_deposit_enabled: true,
|
||||
is_withdrawal_enabled: true,
|
||||
is_refuel_enabled: true,
|
||||
max_withdrawal_amount: 10000,
|
||||
deposit_fee: 52.455252,
|
||||
withdrawal_fee: 21.830179,
|
||||
source_base_fee: 4.435022,
|
||||
destination_base_fee: 4.435022,
|
||||
is_native: false
|
||||
},
|
||||
{
|
||||
name: "IMX",
|
||||
asset: "IMX",
|
||||
logo: "https://cdn.lux.network/bridge/currencies/imx.png",
|
||||
contract_address: "0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF",
|
||||
decimals: 18,
|
||||
status: "inactive",
|
||||
is_deposit_enabled: true,
|
||||
is_withdrawal_enabled: true,
|
||||
is_refuel_enabled: false,
|
||||
max_withdrawal_amount: 500,
|
||||
deposit_fee: 6.377331,
|
||||
withdrawal_fee: 2.65567,
|
||||
source_base_fee: 0.555555,
|
||||
destination_base_fee: 0.555555,
|
||||
is_native: false
|
||||
},
|
||||
{
|
||||
name: "SNX",
|
||||
asset: "SNX",
|
||||
logo: "https://cdn.lux.network/bridge/currencies/snx.png",
|
||||
contract_address: "0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F",
|
||||
decimals: 18,
|
||||
status: "inactive",
|
||||
is_deposit_enabled: true,
|
||||
is_withdrawal_enabled: true,
|
||||
is_refuel_enabled: true,
|
||||
max_withdrawal_amount: 500,
|
||||
deposit_fee: 6.676014,
|
||||
withdrawal_fee: 4.652934,
|
||||
source_base_fee: 0.316455,
|
||||
destination_base_fee: 0.316455,
|
||||
is_native: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
display_name: "Binance Smart Chain",
|
||||
internal_name: "BSC_MAINNET",
|
||||
native_currency: "BNB",
|
||||
logo: "https://cdn.lux.network/bridge/networks/bsc_mainnet.png",
|
||||
is_testnet: false,
|
||||
is_featured: false,
|
||||
average_completion_time: "00:01:04.0494430",
|
||||
chain_id: 56,
|
||||
status: "inactive",
|
||||
type: "evm",
|
||||
refuel_amount_in_usd: 0.5,
|
||||
transaction_explorer_template: "https://etherscan.io/tx/{0}",
|
||||
account_explorer_template: "https://etherscan.io/address/{0}",
|
||||
node: "https://eth-mainnet.g.alchemy.com/v2/-z4Zrujiou9ajXAplVapFFWWrPuLPSm7",
|
||||
currencies: [
|
||||
{
|
||||
name: "BNB",
|
||||
asset: "BNB",
|
||||
logo: "https://cdn.lux.network/bridge/networks/ethereum_mainnet.png",
|
||||
contract_address: null,
|
||||
decimals: 18,
|
||||
status: "active",
|
||||
is_deposit_enabled: true,
|
||||
is_withdrawal_enabled: true,
|
||||
is_refuel_enabled: false,
|
||||
max_withdrawal_amount: 1,
|
||||
deposit_fee: 0.001462,
|
||||
withdrawal_fee: 0.001462,
|
||||
source_base_fee: 0.000456,
|
||||
destination_base_fee: 0.000456,
|
||||
is_native: true
|
||||
},
|
||||
{
|
||||
name: "BKT",
|
||||
asset: "BKT",
|
||||
logo: "https://cdn.lux.network/bridge/networks/ethereum_mainnet.png",
|
||||
contract_address: "0x9d62526f5Ce701950c30F2cACa70Edf70f9fbf0F",
|
||||
decimals: 18,
|
||||
status: "inactive",
|
||||
is_deposit_enabled: false,
|
||||
is_withdrawal_enabled: false,
|
||||
is_refuel_enabled: false,
|
||||
max_withdrawal_amount: 0,
|
||||
deposit_fee: 0,
|
||||
withdrawal_fee: 0,
|
||||
source_base_fee: 0,
|
||||
destination_base_fee: 0,
|
||||
is_native: false
|
||||
},
|
||||
{
|
||||
name: "ASTR",
|
||||
asset: "ASTR",
|
||||
logo: "https://cdn.lux.network/bridge/networks/ethereum_mainnet.png",
|
||||
contract_address: "0x9bBAf650DcD8D3583195715Fc46b1118c3CfDdfd",
|
||||
decimals: 18,
|
||||
status: "inactive",
|
||||
is_deposit_enabled: false,
|
||||
is_withdrawal_enabled: false,
|
||||
is_refuel_enabled: false,
|
||||
max_withdrawal_amount: 0,
|
||||
deposit_fee: 0,
|
||||
withdrawal_fee: 0,
|
||||
source_base_fee: 0,
|
||||
destination_base_fee: 0,
|
||||
is_native: false
|
||||
},
|
||||
{
|
||||
name: "ZKS",
|
||||
asset: "ZKS",
|
||||
logo: "https://cdn.lux.network/bridge/networks/ethereum_mainnet.png",
|
||||
contract_address: "0xe4815AE53B124e7263F08dcDBBB757d41Ed658c6",
|
||||
decimals: 18,
|
||||
status: "inactive",
|
||||
is_deposit_enabled: true,
|
||||
is_withdrawal_enabled: false,
|
||||
is_refuel_enabled: false,
|
||||
max_withdrawal_amount: 10000,
|
||||
deposit_fee: 166.865654,
|
||||
withdrawal_fee: 65.820981,
|
||||
source_base_fee: 26.053974,
|
||||
destination_base_fee: 26.053974,
|
||||
is_native: false
|
||||
},
|
||||
{
|
||||
name: "USDT",
|
||||
asset: "USDT",
|
||||
logo: "https://cdn.lux.network/bridge/networks/ethereum_mainnet.png",
|
||||
contract_address: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
|
||||
decimals: 6,
|
||||
status: "active",
|
||||
is_deposit_enabled: false,
|
||||
is_withdrawal_enabled: false,
|
||||
is_refuel_enabled: false,
|
||||
max_withdrawal_amount: 0,
|
||||
deposit_fee: 4.68,
|
||||
withdrawal_fee: 2.24,
|
||||
source_base_fee: 1,
|
||||
destination_base_fee: 1,
|
||||
is_native: false
|
||||
},
|
||||
{
|
||||
name: "USDC",
|
||||
asset: "USDC",
|
||||
logo: "https://cdn.lux.network/bridge/networks/ethereum_mainnet.png",
|
||||
contract_address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
||||
decimals: 6,
|
||||
status: "active",
|
||||
is_deposit_enabled: true,
|
||||
is_withdrawal_enabled: true,
|
||||
is_refuel_enabled: true,
|
||||
max_withdrawal_amount: 3000,
|
||||
deposit_fee: 12.79,
|
||||
withdrawal_fee: 6.4,
|
||||
source_base_fee: 0.99,
|
||||
destination_base_fee: 0.99,
|
||||
is_native: false
|
||||
},
|
||||
|
||||
{
|
||||
name: "LRC",
|
||||
asset: "LRC",
|
||||
logo: "https://cdn.lux.network/bridge/networks/ethereum_mainnet.png",
|
||||
contract_address: "0xbbbbca6a901c926f240b89eacb641d8aec7aeafd",
|
||||
decimals: 18,
|
||||
status: "inactive",
|
||||
is_deposit_enabled: true,
|
||||
is_withdrawal_enabled: true,
|
||||
is_refuel_enabled: true,
|
||||
max_withdrawal_amount: 10000,
|
||||
deposit_fee: 52.455252,
|
||||
withdrawal_fee: 21.830179,
|
||||
source_base_fee: 4.435022,
|
||||
destination_base_fee: 4.435022,
|
||||
is_native: false
|
||||
},
|
||||
{
|
||||
name: "IMX",
|
||||
asset: "IMX",
|
||||
logo: "https://cdn.lux.network/bridge/networks/ethereum_mainnet.png",
|
||||
contract_address: "0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF",
|
||||
decimals: 18,
|
||||
status: "inactive",
|
||||
is_deposit_enabled: true,
|
||||
is_withdrawal_enabled: true,
|
||||
is_refuel_enabled: false,
|
||||
max_withdrawal_amount: 500,
|
||||
deposit_fee: 6.377331,
|
||||
withdrawal_fee: 2.65567,
|
||||
source_base_fee: 0.555555,
|
||||
destination_base_fee: 0.555555,
|
||||
is_native: false
|
||||
},
|
||||
{
|
||||
name: "SNX",
|
||||
asset: "SNX",
|
||||
logo: "https://cdn.lux.network/bridge/networks/ethereum_mainnet.png",
|
||||
contract_address: "0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F",
|
||||
decimals: 18,
|
||||
status: "inactive",
|
||||
is_deposit_enabled: true,
|
||||
is_withdrawal_enabled: true,
|
||||
is_refuel_enabled: true,
|
||||
max_withdrawal_amount: 500,
|
||||
deposit_fee: 6.676014,
|
||||
withdrawal_fee: 4.652934,
|
||||
source_base_fee: 0.316455,
|
||||
destination_base_fee: 0.316455,
|
||||
is_native: false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
display_name: "BASE",
|
||||
internal_name: "BASE_MAINNET",
|
||||
native_currency: "ETH",
|
||||
logo: "https://cdn.lux.network/bridge/networks/base_mainnet.png",
|
||||
is_testnet: false,
|
||||
is_featured: false,
|
||||
average_completion_time: "00:01:04.0494430",
|
||||
chain_id: 56,
|
||||
status: "inactive",
|
||||
type: "evm",
|
||||
refuel_amount_in_usd: 0.5,
|
||||
transaction_explorer_template: "https://etherscan.io/tx/{0}",
|
||||
account_explorer_template: "https://etherscan.io/address/{0}",
|
||||
node: "https://eth-mainnet.g.alchemy.com/v2/-z4Zrujiou9ajXAplVapFFWWrPuLPSm7",
|
||||
currencies: []
|
||||
},
|
||||
{
|
||||
display_name: "Arbitrum",
|
||||
internal_name: "ARBITRUM_MAINNET",
|
||||
native_currency: "ETH",
|
||||
logo: "https://cdn.lux.network/bridge/networks/arbitrum_mainnet.png",
|
||||
is_testnet: false,
|
||||
is_featured: false,
|
||||
average_completion_time: "00:01:04.0494430",
|
||||
chain_id: 56,
|
||||
status: "inactive",
|
||||
type: "evm",
|
||||
refuel_amount_in_usd: 0.5,
|
||||
transaction_explorer_template: "https://etherscan.io/tx/{0}",
|
||||
account_explorer_template: "https://etherscan.io/address/{0}",
|
||||
node: "https://eth-mainnet.g.alchemy.com/v2/-z4Zrujiou9ajXAplVapFFWWrPuLPSm7",
|
||||
currencies: []
|
||||
},
|
||||
{
|
||||
display_name: "Evmos",
|
||||
internal_name: "EVMOS_MAINNET",
|
||||
native_currency: "EVMOS",
|
||||
logo: "https://cdn.lux.network/bridge/networks/evmos_mainnet.png",
|
||||
is_testnet: false,
|
||||
is_featured: false,
|
||||
average_completion_time: "00:01:04.0494430",
|
||||
chain_id: 9001,
|
||||
status: "inactive",
|
||||
type: "evm",
|
||||
refuel_amount_in_usd: 0.5,
|
||||
transaction_explorer_template: "https://etherscan.io/tx/{0}",
|
||||
account_explorer_template: "https://etherscan.io/address/{0}",
|
||||
node: "https://eth-mainnet.g.alchemy.com/v2/-z4Zrujiou9ajXAplVapFFWWrPuLPSm7",
|
||||
currencies: []
|
||||
},
|
||||
{
|
||||
display_name: "Mantle",
|
||||
internal_name: "MANTLE_MAINNET",
|
||||
native_currency: "MNT",
|
||||
logo: "https://cdn.lux.network/bridge/networks/mantle_mainnet.png",
|
||||
is_testnet: false,
|
||||
is_featured: false,
|
||||
average_completion_time: "00:01:04.0494430",
|
||||
chain_id: 9001,
|
||||
status: "inactive",
|
||||
type: "evm",
|
||||
refuel_amount_in_usd: 0.5,
|
||||
transaction_explorer_template: "https://etherscan.io/tx/{0}",
|
||||
account_explorer_template: "https://etherscan.io/address/{0}",
|
||||
node: "https://eth-mainnet.g.alchemy.com/v2/-z4Zrujiou9ajXAplVapFFWWrPuLPSm7",
|
||||
currencies: []
|
||||
},
|
||||
|
||||
]
|
||||
|
||||
export const destinationNetworks: Network[] = [
|
||||
{
|
||||
display_name: "Ethereum",
|
||||
internal_name: "ETHERUM_MAINNET",
|
||||
native_currency: "LUX",
|
||||
logo: "https://cdn.lux.network/bridge/networks/ethereum_mainnet.png",
|
||||
is_testnet: false,
|
||||
is_featured: true,
|
||||
average_completion_time: "00:00:07.7777777",
|
||||
chain_id: 1,
|
||||
status: "inactive",
|
||||
type: "evm",
|
||||
refuel_amount_in_usd: 1,
|
||||
transaction_explorer_template: "https://explore.lux.network/tx/{0}",
|
||||
account_explorer_template: "https://explore.lux.network/address/{0}",
|
||||
node: "https://eth-mainnet.g.alchemy.com/v2/-z4Zrujiou9ajXAplVapFFWWrPuLPSm7",
|
||||
currencies: []
|
||||
},
|
||||
{
|
||||
display_name: "Lux",
|
||||
internal_name: "LUX_MAINNET",
|
||||
native_currency: "LUX",
|
||||
logo: "https://cdn.lux.network/bridge/networks/lux_mainnet.png",
|
||||
is_testnet: false,
|
||||
is_featured: true,
|
||||
average_completion_time: "00:00:07.7777777",
|
||||
chain_id: 7777,
|
||||
status: "active",
|
||||
type: "evm",
|
||||
refuel_amount_in_usd: 1,
|
||||
transaction_explorer_template: "https://explore.lux.network/tx/{0}",
|
||||
account_explorer_template: "https://explore.lux.network/address/{0}",
|
||||
node: "https://api.lux.network",
|
||||
currencies: [
|
||||
{
|
||||
name: "LUX",
|
||||
asset: "LUX",
|
||||
logo: "https://cdn.lux.network/bridge/networks/lux_mainnet.png",
|
||||
contract_address: null,
|
||||
decimals: 18,
|
||||
status: "active",
|
||||
is_deposit_enabled: true,
|
||||
is_withdrawal_enabled: true,
|
||||
is_refuel_enabled: false,
|
||||
max_withdrawal_amount: 1,
|
||||
deposit_fee: 0.001462,
|
||||
withdrawal_fee: 0.001462,
|
||||
source_base_fee: 0.000456,
|
||||
destination_base_fee: 0.000456,
|
||||
is_native: true
|
||||
},
|
||||
{
|
||||
name: "LETH",
|
||||
asset: "LETH",
|
||||
logo: "https://cdn.lux.network/bridge/networks/lux_mainnet.png",
|
||||
contract_address: "0x42449554b0c7D85EbD488e14D7D48c6A78D3F9Be",
|
||||
decimals: 18,
|
||||
status: "active",
|
||||
is_deposit_enabled: true,
|
||||
is_withdrawal_enabled: true,
|
||||
is_refuel_enabled: false,
|
||||
max_withdrawal_amount: 1,
|
||||
deposit_fee: 0.001462,
|
||||
withdrawal_fee: 0.001462,
|
||||
source_base_fee: 0.000456,
|
||||
destination_base_fee: 0.000456,
|
||||
is_native: false
|
||||
},
|
||||
{
|
||||
name: "LUSD",
|
||||
asset: "LUSD",
|
||||
logo: "https://cdn.lux.network/bridge/currencies/lusd.png",
|
||||
contract_address: "0xc16ECFE3cB80e142d7110b97a442d4caAA203ABf",
|
||||
decimals: 18,
|
||||
status: "active",
|
||||
is_deposit_enabled: true,
|
||||
is_withdrawal_enabled: true,
|
||||
is_refuel_enabled: false,
|
||||
max_withdrawal_amount: 1,
|
||||
deposit_fee: 0.001462,
|
||||
withdrawal_fee: 0.001462,
|
||||
source_base_fee: 0.000456,
|
||||
destination_base_fee: 0.000456,
|
||||
is_native: false
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
display_name: "BNB Smart Chain",
|
||||
internal_name: "BSC_MAINNET",
|
||||
native_currency: "BNB",
|
||||
logo: "https://cdn.lux.network/bridge/networks/bsc_mainnet.png",
|
||||
is_testnet: false,
|
||||
is_featured: true,
|
||||
average_completion_time: "00:00:07.7777777",
|
||||
chain_id: 56,
|
||||
status: "inactive",
|
||||
type: "evm",
|
||||
refuel_amount_in_usd: 1,
|
||||
transaction_explorer_template: "https://explore.lux.network/tx/{0}",
|
||||
account_explorer_template: "https://explore.lux.network/address/{0}",
|
||||
node: "https://eth-mainnet.g.alchemy.com/v2/-z4Zrujiou9ajXAplVapFFWWrPuLPSm7",
|
||||
currencies: []
|
||||
},
|
||||
{
|
||||
display_name: "POLYGON",
|
||||
internal_name: "POLYGON_MAINNET",
|
||||
native_currency: "MATIC",
|
||||
logo: "https://cdn.lux.network/bridge/networks/polygon_mainnet.png",
|
||||
is_testnet: false,
|
||||
is_featured: true,
|
||||
average_completion_time: "00:00:07.7777777",
|
||||
chain_id: 137,
|
||||
status: "inactive",
|
||||
type: "evm",
|
||||
refuel_amount_in_usd: 1,
|
||||
transaction_explorer_template: "https://explore.lux.network/tx/{0}",
|
||||
account_explorer_template: "https://explore.lux.network/address/{0}",
|
||||
node: "https://eth-mainnet.g.alchemy.com/v2/-z4Zrujiou9ajXAplVapFFWWrPuLPSm7",
|
||||
currencies: []
|
||||
},
|
||||
{
|
||||
display_name: "Arbitrum One",
|
||||
internal_name: "ARBITRUM_MAINNET",
|
||||
native_currency: "ETH",
|
||||
logo: "https://cdn.lux.network/bridge/networks/arbitrum_mainnet.png",
|
||||
is_testnet: false,
|
||||
is_featured: true,
|
||||
average_completion_time: "00:00:07.7777777",
|
||||
chain_id: 42161,
|
||||
status: "inactive",
|
||||
type: "evm",
|
||||
refuel_amount_in_usd: 1,
|
||||
transaction_explorer_template: "https://explore.lux.network/tx/{0}",
|
||||
account_explorer_template: "https://explore.lux.network/address/{0}",
|
||||
node: "https://eth-mainnet.g.alchemy.com/v2/-z4Zrujiou9ajXAplVapFFWWrPuLPSm7",
|
||||
currencies: []
|
||||
},
|
||||
{
|
||||
display_name: "Avalanche One",
|
||||
internal_name: "AVAX_MAINNET",
|
||||
native_currency: "ETH",
|
||||
logo: "https://cdn.lux.network/bridge/networks/avax_mainnet.png",
|
||||
is_testnet: false,
|
||||
is_featured: true,
|
||||
average_completion_time: "00:00:07.7777777",
|
||||
chain_id: 43114,
|
||||
status: "inactive",
|
||||
type: "evm",
|
||||
refuel_amount_in_usd: 1,
|
||||
transaction_explorer_template: "https://explore.lux.network/tx/{0}",
|
||||
account_explorer_template: "https://explore.lux.network/address/{0}",
|
||||
node: "https://eth-mainnet.g.alchemy.com/v2/-z4Zrujiou9ajXAplVapFFWWrPuLPSm7",
|
||||
currencies: []
|
||||
},
|
||||
{
|
||||
display_name: "BASE",
|
||||
internal_name: "BASE_MAINNET",
|
||||
native_currency: "ETH",
|
||||
logo: "https://cdn.lux.network/bridge/networks/base_mainnet.png",
|
||||
is_testnet: false,
|
||||
is_featured: false,
|
||||
average_completion_time: "00:01:04.0494430",
|
||||
chain_id: 56,
|
||||
status: "inactive",
|
||||
type: "evm",
|
||||
refuel_amount_in_usd: 0.5,
|
||||
transaction_explorer_template: "https://etherscan.io/tx/{0}",
|
||||
account_explorer_template: "https://etherscan.io/address/{0}",
|
||||
node: "https://eth-mainnet.g.alchemy.com/v2/-z4Zrujiou9ajXAplVapFFWWrPuLPSm7",
|
||||
currencies: []
|
||||
},
|
||||
{
|
||||
display_name: "Evmos",
|
||||
internal_name: "EVMOS_MAINNET",
|
||||
native_currency: "EVMOS",
|
||||
logo: "https://cdn.lux.network/bridge/networks/evmos_mainnet.png",
|
||||
is_testnet: false,
|
||||
is_featured: false,
|
||||
average_completion_time: "00:01:04.0494430",
|
||||
chain_id: 9001,
|
||||
status: "inactive",
|
||||
type: "evm",
|
||||
refuel_amount_in_usd: 0.5,
|
||||
transaction_explorer_template: "https://etherscan.io/tx/{0}",
|
||||
account_explorer_template: "https://etherscan.io/address/{0}",
|
||||
node: "https://eth-mainnet.g.alchemy.com/v2/-z4Zrujiou9ajXAplVapFFWWrPuLPSm7",
|
||||
currencies: []
|
||||
},
|
||||
{
|
||||
display_name: "Mantle",
|
||||
internal_name: "MANTLE_MAINNET",
|
||||
native_currency: "MNT",
|
||||
logo: "https://cdn.lux.network/bridge/networks/mantle_mainnet.png",
|
||||
is_testnet: false,
|
||||
is_featured: false,
|
||||
average_completion_time: "00:01:04.0494430",
|
||||
chain_id: 9001,
|
||||
status: "inactive",
|
||||
type: "evm",
|
||||
refuel_amount_in_usd: 0.5,
|
||||
transaction_explorer_template: "https://etherscan.io/tx/{0}",
|
||||
account_explorer_template: "https://etherscan.io/address/{0}",
|
||||
node: "https://eth-mainnet.g.alchemy.com/v2/-z4Zrujiou9ajXAplVapFFWWrPuLPSm7",
|
||||
currencies: []
|
||||
},
|
||||
{
|
||||
display_name: "Zora",
|
||||
internal_name: "ZORA_MAINNET",
|
||||
native_currency: "ETH",
|
||||
logo: "https://cdn.lux.network/bridge/networks/zora_mainnet.png",
|
||||
is_testnet: false,
|
||||
is_featured: false,
|
||||
average_completion_time: "00:01:04.0494430",
|
||||
chain_id: 7777777,
|
||||
status: "inactive",
|
||||
type: "evm",
|
||||
refuel_amount_in_usd: 0.5,
|
||||
transaction_explorer_template: "https://etherscan.io/tx/{0}",
|
||||
account_explorer_template: "https://etherscan.io/address/{0}",
|
||||
node: "https://eth-mainnet.g.alchemy.com/v2/-z4Zrujiou9ajXAplVapFFWWrPuLPSm7",
|
||||
currencies: []
|
||||
},
|
||||
{
|
||||
display_name: "Rollux",
|
||||
internal_name: "ROLLUX_MAINNET",
|
||||
native_currency: "SYS",
|
||||
logo: "https://cdn.lux.network/bridge/networks/rollux_mainnet.png",
|
||||
is_testnet: false,
|
||||
is_featured: false,
|
||||
average_completion_time: "00:01:04.0494430",
|
||||
chain_id: 570,
|
||||
status: "inactive",
|
||||
type: "evm",
|
||||
refuel_amount_in_usd: 0.5,
|
||||
transaction_explorer_template: "https://etherscan.io/tx/{0}",
|
||||
account_explorer_template: "https://etherscan.io/address/{0}",
|
||||
node: "https://eth-mainnet.g.alchemy.com/v2/-z4Zrujiou9ajXAplVapFFWWrPuLPSm7",
|
||||
currencies: []
|
||||
},
|
||||
{
|
||||
display_name: "Manta Pacific",
|
||||
internal_name: "MANTA_MAINNET",
|
||||
native_currency: "ETH",
|
||||
logo: "https://cdn.lux.network/bridge/networks/manta_mainnet.png",
|
||||
is_testnet: false,
|
||||
is_featured: false,
|
||||
average_completion_time: "00:01:04.0494430",
|
||||
chain_id: 169,
|
||||
status: "inactive",
|
||||
type: "evm",
|
||||
refuel_amount_in_usd: 0.5,
|
||||
transaction_explorer_template: "https://etherscan.io/tx/{0}",
|
||||
account_explorer_template: "https://etherscan.io/address/{0}",
|
||||
node: "https://eth-mainnet.g.alchemy.com/v2/-z4Zrujiou9ajXAplVapFFWWrPuLPSm7",
|
||||
currencies: []
|
||||
},
|
||||
{
|
||||
display_name: "opBNB",
|
||||
internal_name: "OPBNB_MAINNET",
|
||||
native_currency: "BNB",
|
||||
logo: "https://cdn.lux.network/bridge/networks/bsc_mainnet.png",
|
||||
is_testnet: false,
|
||||
is_featured: false,
|
||||
average_completion_time: "00:01:04.0494430",
|
||||
chain_id: 204,
|
||||
status: "inactive",
|
||||
type: "evm",
|
||||
refuel_amount_in_usd: 0.5,
|
||||
transaction_explorer_template: "https://etherscan.io/tx/{0}",
|
||||
account_explorer_template: "https://etherscan.io/address/{0}",
|
||||
node: "https://eth-mainnet.g.alchemy.com/v2/-z4Zrujiou9ajXAplVapFFWWrPuLPSm7",
|
||||
currencies: []
|
||||
},
|
||||
]
|
||||
|
||||
export const CONTRACTS = {
|
||||
11155111: {
|
||||
teleporter: "0x568BF299E115D78a1fBa57BafdAe0fD8A26BFb7e",
|
||||
},
|
||||
7777: {
|
||||
teleporter: "0xB2237fb7DBB19Ff09BBD64029064eC05B3C369Ac"
|
||||
}
|
||||
}
|
||||
@@ -467,7 +467,7 @@ export const sourceNetworks: Network[] = [
|
||||
{
|
||||
display_name: "POLYGON",
|
||||
internal_name: "POLYGON_MAINNET",
|
||||
native_currency: "MATIC",
|
||||
native_currency: "POL",
|
||||
logo: "https://cdn.lux.network/bridge/networks/polygon_mainnet.png",
|
||||
is_testnet: false,
|
||||
is_featured: true,
|
||||
|
||||
@@ -14,7 +14,7 @@ import FromNetworkForm from './from/NetworkFormField';
|
||||
import ToNetworkForm from './to/NetworkFormField';
|
||||
import SwapDetails from "./SwapDetails";
|
||||
import { Token, Network } from "@/types/teleport";
|
||||
import { sourceNetworks, destinationNetworks } from "@/components/teleport/constants/settings";
|
||||
import { sourceNetworks, destinationNetworks } from "@/components/teleport/constants/settings.sandbox";
|
||||
import { useAtom } from "jotai";
|
||||
|
||||
import {
|
||||
|
||||
@@ -107,6 +107,7 @@
|
||||
"@types/bn.js": "^5.1.0",
|
||||
"@types/crypto-js": "^4.1.1",
|
||||
"@types/mdx": "^2.0.9",
|
||||
"@types/node": "^20.10.7",
|
||||
"@types/react": "18.2.48",
|
||||
"@types/react-dom": "18.2.18",
|
||||
"@types/web3": "^1.2.2",
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
module.exports = [
|
||||
[
|
||||
"0xFa005D52398B4BdAAf73C4e2E3AF8095533D790E", //usdt
|
||||
"0x42449554b0c7D85EbD488e14D7D48c6A78D3F9Be", //usdc
|
||||
"0xc16ECFE3cB80e142d7110b97a442d4caAA203ABf", //dai
|
||||
]
|
||||
];
|
||||
@@ -256,6 +256,59 @@ contract Bridge is Ownable, AccessControl {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev split ECDSA signature to r, s, v
|
||||
* @param sig ECDSA signature
|
||||
* @return splitted_ v,s,r
|
||||
*/
|
||||
function splitSignature(
|
||||
bytes memory sig
|
||||
) internal pure returns (uint8, bytes32, bytes32) {
|
||||
require(sig.length == 65, "invalid Length");
|
||||
bytes32 r;
|
||||
bytes32 s;
|
||||
uint8 v;
|
||||
|
||||
assembly {
|
||||
// first 32 bytes, after the length prefix
|
||||
r := mload(add(sig, 32))
|
||||
// second 32 bytes
|
||||
s := mload(add(sig, 64))
|
||||
// final byte (first byte of the next 32 bytes)
|
||||
v := byte(0, mload(add(sig, 96)))
|
||||
}
|
||||
|
||||
return (v, r, s);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev recover signer from message and ECDSA signature
|
||||
* @param message_ message to be signed
|
||||
* @param sig_ ECDSA signature
|
||||
* @return signer signer of ECDSA
|
||||
*/
|
||||
function recoverSigner(
|
||||
bytes32 message_,
|
||||
bytes memory sig_
|
||||
) internal pure returns (address) {
|
||||
uint8 v;
|
||||
bytes32 r;
|
||||
bytes32 s;
|
||||
(v, r, s) = splitSignature(sig_);
|
||||
return ecrecover(message_, v, r, s);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Builds a prefixed hash to mimic the behavior of eth_sign
|
||||
* @return prefixed prefixed msg
|
||||
*/
|
||||
function prefixed(bytes32 hash) internal pure returns (bytes32) {
|
||||
return
|
||||
keccak256(
|
||||
abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Sig is specific to recipient target address, hashed txid, amount, block height, target token and target chain
|
||||
* @notice Sets the vault address. Sig can only be claimed once.
|
||||
@@ -328,57 +381,18 @@ contract Bridge is Ownable, AccessControl {
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev split ECDSA signature to r, s, v
|
||||
* @param sig ECDSA signature
|
||||
* @return splitted_ v,s,r
|
||||
* @dev Sig is specific to recipient target address, hashed txid, amount, block height, target token and target chain
|
||||
* @notice Sets the vault address. Sig can only be claimed once.
|
||||
* @param amt_ token amount that is burnt in source chain
|
||||
* @param hashedId_ hashed tx id in source chain
|
||||
* @param toTargetAddrStr_ destinatoin address to withdraw in destination chain
|
||||
* @param signedTXInfo_ mpc signed msg from teleport oracle network
|
||||
* @param tokenAddrStr_ token address in destination chain
|
||||
* @param chainId_ chain id
|
||||
* @param fromTokenDecimal_ token decimal of source token
|
||||
* @param vault_ if usage of vault
|
||||
* @return signer return signer address of message
|
||||
*/
|
||||
function splitSignature(
|
||||
bytes memory sig
|
||||
) internal pure returns (uint8, bytes32, bytes32) {
|
||||
require(sig.length == 65, "invalid Length");
|
||||
bytes32 r;
|
||||
bytes32 s;
|
||||
uint8 v;
|
||||
|
||||
assembly {
|
||||
// first 32 bytes, after the length prefix
|
||||
r := mload(add(sig, 32))
|
||||
// second 32 bytes
|
||||
s := mload(add(sig, 64))
|
||||
// final byte (first byte of the next 32 bytes)
|
||||
v := byte(0, mload(add(sig, 96)))
|
||||
}
|
||||
|
||||
return (v, r, s);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev recover signer from message and ECDSA signature
|
||||
* @param message_ message to be signed
|
||||
* @param sig_ ECDSA signature
|
||||
* @return signer signer of ECDSA
|
||||
*/
|
||||
function recoverSigner(
|
||||
bytes32 message_,
|
||||
bytes memory sig_
|
||||
) internal pure returns (address) {
|
||||
uint8 v;
|
||||
bytes32 r;
|
||||
bytes32 s;
|
||||
(v, r, s) = splitSignature(sig_);
|
||||
return ecrecover(message_, v, r, s);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Builds a prefixed hash to mimic the behavior of eth_sign.
|
||||
*/
|
||||
function prefixed(bytes32 hash) internal pure returns (bytes32) {
|
||||
return
|
||||
keccak256(
|
||||
abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)
|
||||
);
|
||||
}
|
||||
|
||||
function bridgeWithdrawStealth(
|
||||
uint256 amt_,
|
||||
string memory hashedId_,
|
||||
@@ -432,7 +446,7 @@ contract Bridge is Ownable, AccessControl {
|
||||
emit BridgeWithdrawn(msg.sender, tokenAddrStr_, amount_);
|
||||
|
||||
// return signer;
|
||||
return address(0);
|
||||
return signer;
|
||||
}
|
||||
|
||||
receive() external payable {}
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
||||
|
||||
contract DAI is ERC20 {
|
||||
constructor() ERC20("Dai Stablecoin", "DAI") {
|
||||
_mint(msg.sender, 10000000000 * 10 ** decimals());
|
||||
}
|
||||
|
||||
// DAI uses 18 decimals by default, so no need to override decimals function
|
||||
}
|
||||
@@ -3,9 +3,7 @@ pragma solidity ^0.8.0;
|
||||
|
||||
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
||||
|
||||
|
||||
contract ETHVault is ERC20 {
|
||||
|
||||
// Event to emit when ETH is deposited
|
||||
event Deposit(address indexed user, uint256 amount);
|
||||
|
||||
@@ -20,26 +18,39 @@ contract ETHVault is ERC20 {
|
||||
// Function to receive ETH and mint shares
|
||||
receive() external payable {}
|
||||
|
||||
function deposit(uint256 amount, address receiver) external payable {
|
||||
require(msg.value > 0 && amount == msg.value, "Must send ETH");
|
||||
/**
|
||||
* @dev deposit ETH
|
||||
* @param amount_ eth amount
|
||||
* @param receiver_ receiver's address
|
||||
*/
|
||||
function deposit(uint256 amount_, address receiver_) external payable {
|
||||
require(msg.value > 0 && amount_ == msg.value, "Must send ETH");
|
||||
// Calculate the number of shares to mint
|
||||
uint256 shares = msg.value; // For simplicity, 1 ETH = 1 share
|
||||
// Mint the shares to the sender
|
||||
_mint(receiver, shares);
|
||||
_mint(receiver_, shares);
|
||||
emit Deposit(msg.sender, msg.value);
|
||||
}
|
||||
|
||||
// Allow owner to withdraw all ETH
|
||||
function withdraw(uint256 amount, address receiver, address owner) external {
|
||||
require(amount <= address(this).balance, "Insufficient balance");
|
||||
if (msg.sender != owner) {
|
||||
uint256 allowed = allowance(owner, msg.sender);
|
||||
require(allowed >= amount, "Invalid alowance");
|
||||
/**
|
||||
* @dev withdraw eth
|
||||
* @param amount_ eth amount
|
||||
* @param receiver_ receiver's address
|
||||
* @param owner_ owner's share address
|
||||
*/
|
||||
function withdraw(
|
||||
uint256 amount_,
|
||||
address receiver_,
|
||||
address owner_
|
||||
) external {
|
||||
require(amount_ <= address(this).balance, "Insufficient balance");
|
||||
if (msg.sender != owner_) {
|
||||
uint256 allowed = allowance(owner_, msg.sender);
|
||||
require(allowed >= amount_, "Invalid alowance");
|
||||
}
|
||||
_burn(owner, amount);
|
||||
(bool success, ) = payable(receiver).call{value:amount}("");
|
||||
_burn(owner_, amount_);
|
||||
(bool success, ) = payable(receiver_).call{value: amount_}("");
|
||||
require(success, "sending failed");
|
||||
emit Withdraw(msg.sender, receiver, owner, amount);
|
||||
emit Withdraw(msg.sender, receiver_, owner_, amount_);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,10 +23,12 @@ import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
|
||||
contract LuxVault is Ownable {
|
||||
mapping(address => address) public erc20Vault;
|
||||
address payable public ethVaultAddress;
|
||||
|
||||
event ERC20VaultCreated(
|
||||
address indexed asset,
|
||||
address indexed vaultAddress
|
||||
);
|
||||
|
||||
constructor(address[] memory _assets) Ownable(msg.sender) {
|
||||
for (uint i = 0; i < _assets.length; ++i) {
|
||||
_addNewERC20Vault(_assets[i]);
|
||||
@@ -34,66 +36,93 @@ contract LuxVault is Ownable {
|
||||
ETHVault _newETHVault = new ETHVault("Native Vault", "ethVault");
|
||||
ethVaultAddress = payable(address(_newETHVault));
|
||||
}
|
||||
|
||||
function concat(
|
||||
string memory a,
|
||||
string memory b
|
||||
) internal pure returns (string memory) {
|
||||
return string(abi.encodePacked(a, b));
|
||||
}
|
||||
function addNewERC20Vault(address _asset) external onlyOwner {
|
||||
_addNewERC20Vault(_asset);
|
||||
|
||||
/**
|
||||
* @dev add new ERC20 vault
|
||||
* @param asset_ ERC20 token address
|
||||
*/
|
||||
function addNewERC20Vault(address asset_) external onlyOwner {
|
||||
_addNewERC20Vault(asset_);
|
||||
}
|
||||
function _addNewERC20Vault(address _asset) private {
|
||||
require(_asset != address(0), "Invalid asset address.");
|
||||
require(erc20Vault[_asset] == address(0), "Already exist.");
|
||||
|
||||
/**
|
||||
* @dev add new ERC20 vault
|
||||
* @param asset_ ERC20 token address
|
||||
*/
|
||||
function _addNewERC20Vault(address asset_) private {
|
||||
require(asset_ != address(0), "Invalid asset address.");
|
||||
require(erc20Vault[asset_] == address(0), "Vault already exists.");
|
||||
LERC4626 newERC20Vault = new LERC4626(
|
||||
IERC20(_asset),
|
||||
concat(ERC20(_asset).name(), " vault"),
|
||||
concat("v", ERC20(_asset).symbol())
|
||||
IERC20(asset_),
|
||||
concat(ERC20(asset_).name(), " vault"),
|
||||
concat("v", ERC20(asset_).symbol())
|
||||
);
|
||||
address newVaultAddress = address(newERC20Vault);
|
||||
erc20Vault[_asset] = newVaultAddress;
|
||||
IERC20(_asset).approve(newVaultAddress, type(uint256).max);
|
||||
emit ERC20VaultCreated(_asset, newVaultAddress);
|
||||
erc20Vault[asset_] = newVaultAddress;
|
||||
IERC20(asset_).approve(newVaultAddress, type(uint256).max);
|
||||
emit ERC20VaultCreated(asset_, newVaultAddress);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev deposit asset
|
||||
* @param asset_ ERC20 token address
|
||||
* @param amount_ token amount
|
||||
*/
|
||||
function deposit(
|
||||
address _asset,
|
||||
uint256 _amount
|
||||
address asset_,
|
||||
uint256 amount_
|
||||
) external payable onlyOwner {
|
||||
if (_asset == address(0)) {
|
||||
require(msg.value == _amount, "Insufficient ETH amount");
|
||||
ETHVault(ethVaultAddress).deposit{value: _amount}(_amount, owner());
|
||||
if (asset_ == address(0)) {
|
||||
require(msg.value >= amount_, "Insufficient ETH amount");
|
||||
ETHVault(ethVaultAddress).deposit{value: amount_}(amount_, owner());
|
||||
} else {
|
||||
ERC4626(erc20Vault[_asset]).deposit(_amount, owner());
|
||||
ERC4626(erc20Vault[asset_]).deposit(amount_, owner());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev withdraw asset
|
||||
* @param asset_ ERC20 token address
|
||||
* @param receiver_ receiver's address
|
||||
* @param amount_ token amount
|
||||
*/
|
||||
function withdraw(
|
||||
address _asset,
|
||||
address receiver,
|
||||
uint256 _amount
|
||||
address asset_,
|
||||
address receiver_,
|
||||
uint256 amount_
|
||||
) external onlyOwner {
|
||||
if (_asset == address(0)) {
|
||||
ETHVault(ethVaultAddress).withdraw(_amount, receiver, owner());
|
||||
if (asset_ == address(0)) {
|
||||
ETHVault(ethVaultAddress).withdraw(amount_, receiver_, owner());
|
||||
} else {
|
||||
ERC4626(erc20Vault[_asset]).withdraw(_amount, receiver, owner());
|
||||
ERC4626(erc20Vault[asset_]).withdraw(amount_, receiver_, owner());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev preview withdraw
|
||||
* @param asset_ ERC20 token address
|
||||
* @param amount_ token amount
|
||||
* @return value true it possible to withdraw
|
||||
*/
|
||||
function previewWithdraw(
|
||||
address _asset,
|
||||
uint256 _amount
|
||||
address asset_,
|
||||
uint256 amount_
|
||||
) public view returns (bool) {
|
||||
if (_asset == address(0)) {
|
||||
if (ETHVault(ethVaultAddress).balanceOf(owner()) >= _amount)
|
||||
if (asset_ == address(0)) {
|
||||
if (ETHVault(ethVaultAddress).balanceOf(owner()) >= amount_)
|
||||
return true;
|
||||
return false;
|
||||
} else {
|
||||
if (ERC4626(erc20Vault[_asset]).maxWithdraw(owner()) >= _amount)
|
||||
if (ERC4626(erc20Vault[asset_]).maxWithdraw(owner()) >= amount_)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
receive() external payable {}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
pragma solidity ^0.8.19;
|
||||
|
||||
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
||||
|
||||
contract USDC is ERC20 {
|
||||
constructor() ERC20("USD Coin", "USDC") {
|
||||
_mint(msg.sender, 10000000000 * 10 ** decimals());
|
||||
}
|
||||
|
||||
// Override the decimals function to return 6, like USDT
|
||||
function decimals() public view virtual override returns (uint8) {
|
||||
return 6;
|
||||
}
|
||||
}
|
||||
@@ -3,20 +3,13 @@ pragma solidity ^0.8.19;
|
||||
|
||||
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
|
||||
|
||||
contract USDTToken is ERC20 {
|
||||
constructor() ERC20("USDT Coin", "USDT") {
|
||||
contract USDT is ERC20 {
|
||||
constructor() ERC20("Tether USD", "USDT") {
|
||||
_mint(msg.sender, 10000000000 * 10 ** decimals());
|
||||
}
|
||||
|
||||
function decimals() public view override returns (uint8) {
|
||||
// Override the decimals function to return 6, like USDT
|
||||
function decimals() public view virtual override returns (uint8) {
|
||||
return 6;
|
||||
}
|
||||
|
||||
function mint(address account, uint256 amount) public {
|
||||
_mint(account, amount);
|
||||
}
|
||||
|
||||
function burn(address account, uint256 amount) public {
|
||||
_burn(account, amount);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ const SEPOLIA_RPC: string = process.env.SEPOLIA_RPC!;
|
||||
const BASE_RPC: string = process.env.BASE_RPC!;
|
||||
const BSC_TESTNET_RPC: string = process.env.BSC_TESTNET_RPC!;
|
||||
const LUX_MAINNET_RPC: string = process.env.LUX_MAINNET_RPC!;
|
||||
const LUX_TESTNET_RPC: string = process.env.LUX_TESTNET_RPC!;
|
||||
|
||||
const config: HardhatUserConfig = {
|
||||
solidity: "0.8.20",
|
||||
@@ -30,13 +31,18 @@ const config: HardhatUserConfig = {
|
||||
url: LUX_MAINNET_RPC,
|
||||
accounts: [`0x${PRIVATE_KEY}`],
|
||||
},
|
||||
"lux-test": {
|
||||
url: LUX_TESTNET_RPC,
|
||||
accounts: [`0x${PRIVATE_KEY}`]
|
||||
}
|
||||
},
|
||||
etherscan: {
|
||||
apiKey: {
|
||||
sepolia: process.env.ETHERSCAN_API_KEY!,
|
||||
bsc: process.env.BSCSCAN_API_KEY!,
|
||||
bscTestnet: process.env.BSCSCAN_API_KEY!,
|
||||
lux: "your API key" // Leave empty if not applicable
|
||||
lux: "your API key", // Leave empty if not applicable
|
||||
"lux-test": "your API key" // Leave empty if not applicable
|
||||
},
|
||||
customChains: [
|
||||
{
|
||||
@@ -46,7 +52,15 @@ const config: HardhatUserConfig = {
|
||||
apiURL: "https://api.explore.lux.network/api",
|
||||
browserURL: "https://explore.lux.network"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
network: "lux-test",
|
||||
chainId: 8888,
|
||||
urls: {
|
||||
apiURL: "https://api.explore.lux-test.network/api",
|
||||
browserURL: "https://explore.lux-test.network"
|
||||
}
|
||||
},
|
||||
]
|
||||
},
|
||||
sourcify: {
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import { ethers } from "hardhat";
|
||||
|
||||
async function main() {
|
||||
const [deployer] = await ethers.getSigners();
|
||||
|
||||
|
||||
/////LuxVault
|
||||
const assets = [
|
||||
"0xFa005D52398B4BdAAf73C4e2E3AF8095533D790E", //usdt
|
||||
"0x42449554b0c7D85EbD488e14D7D48c6A78D3F9Be", //usdc
|
||||
"0xc16ECFE3cB80e142d7110b97a442d4caAA203ABf", //dai
|
||||
]
|
||||
|
||||
const _signer = await ethers.getContractFactory("LuxVault");
|
||||
const token = await _signer.deploy(assets);
|
||||
await token.waitForDeployment();
|
||||
console.log("LuxVault sepolia address:", await token.getAddress());
|
||||
}
|
||||
|
||||
main()
|
||||
.then(() => process.exit(0))
|
||||
.catch((error) => {
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
});
|
||||
@@ -6,13 +6,12 @@ async function main() {
|
||||
|
||||
/////LuxVault
|
||||
const assets = [
|
||||
"0xa92E09451140d645A2fE262c9631Dd808439dDEd", //usdt
|
||||
"0xB587bAb3d507d720625D30544C2889D661446BF7", //usdc
|
||||
"0xa92E09451140d645A2fE262c9631Dd808439dDEd", //dai
|
||||
"0xFa005D52398B4BdAAf73C4e2E3AF8095533D790E", //usdt
|
||||
"0x42449554b0c7D85EbD488e14D7D48c6A78D3F9Be", //usdc
|
||||
"0xc16ECFE3cB80e142d7110b97a442d4caAA203ABf", //dai
|
||||
]
|
||||
|
||||
const _signer = await ethers.getContractFactory("LuxVault");
|
||||
// const token = await _signer.deploy(["0xa92E09451140d645A2fE262c9631Dd808439dDEd","0xB587bAb3d507d720625D30544C2889D661446BF7", "0xa92E09451140d645A2fE262c9631Dd808439dDEd"]);
|
||||
const token = await _signer.deploy(assets);
|
||||
await token.waitForDeployment();
|
||||
console.log("LuxVault sepolia address:", await token.getAddress());
|
||||
|
||||
Generated
+6338
-6678
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user