Skip to content

kmurphypolygon/lxly-bridge-and-call

 
 

Repository files navigation

uLXLY BRIDGE AND CALL

NOTE: Work in Progress.

Testing and Deploying

First, copy .env.example to .env and set the appropriate environment variables (annotated with TODOs).

Testing (Mainnet Forks)

  1. Start anvil: two instances required, one for L1, and one for L2
# 1.1 start L1 (ethereum mainnet) anvil - NOTE: using port 8001 for L1
anvil --fork-url <https://eth-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_KEY> --chain-id 1 --port 8001 --fork-block-number 19370366

# 1.2 start L2 (polygon zkevm) anvil - NOTE: using port 8101 for L2
anvil --fork-url <https://polygonzkevm-mainnet.g.alchemy.com/v2/YOUR_ALCHEMY_KEY> --chain-id 1101 --port 8101 --fork-block-number 10484909
  1. Run the tests
forge test -vvvvv

or

forge test -vvvvv --match-contract NativeConverter
forge test -vvvvv --match-contract QuickSwap
forge test -vvvvv --match-contract KEOM

NOTE: testBridgeFromL2AndCallL1Uniswap might fail due to exchange rates, if you're not forking the expected block number. You can manually change the expected exchange rate in ZkEVM2ETHMainnet.t.sol#L124.

Deployment

NOTE: BridgeExtension (proxy) must be deployed to the same address in all chains

setup the DEPLOYER_PRIVATE_KEY, ADDRESS_PROXY_ADMIN, ADDRESS_LXLY_BRIDGE and run

export RPC=
forge script script/DeployInitBridgeAndCall.s.sol:DeployInitBridgeAndCall --rpc-url ${RPC} -vvvvv --legacy --broadcast

TODOs

  • TODO: create easier interfaces for bridging assets (gas token, lx weth, erc20)
  • TODO: helper claimBridgeAndCall function
  • TODO: ethers/viem example calling bridgeAndCall

Relevant Information

gm

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 100.0%