Skip to content
Open
Show file tree
Hide file tree
Changes from 32 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
3fdf1cb
added deploy logs
mirooon Jan 22, 2026
d88f594
added viction
mirooon Jan 23, 2026
9908e5a
updated whitelist
mirooon Jan 23, 2026
385ae19
update
mirooon Jan 27, 2026
9a930ba
updated avalanche and viction
mirooon Jan 27, 2026
35a9349
added deployments
mirooon Jan 27, 2026
711d45e
added deploy logs for celo and fraxtal
mirooon Jan 27, 2026
853d65d
merged with smar-123 branch
mirooon Jan 27, 2026
ace70af
added verify proposal
mirooon Jan 27, 2026
2864640
merge main
mirooon Jan 27, 2026
0043b1e
added new whitelist
mirooon Jan 27, 2026
ecf2c22
added check script
mirooon Jan 27, 2026
619ed62
updates
mirooon Jan 28, 2026
131736a
added sophon logs
mirooon Jan 28, 2026
893c7f1
updated -Execute with Deployer
mirooon Jan 28, 2026
1c27264
updated script
mirooon Jan 28, 2026
85b6204
updates
mirooon Jan 28, 2026
37bd201
added megaeth logs
mirooon Jan 28, 2026
87dde1f
Merge branch 'deploy-gaszipperiphery-megaeth' into deploy-gaszipperip…
mirooon Jan 28, 2026
ff9bf4f
updated whitelist
mirooon Jan 28, 2026
bb488d1
fix confirm-safe-tx
mirooon Jan 28, 2026
1829c2e
Merge branch 'main' into deploy-gaszipperiphery
mirooon Jan 28, 2026
0bd3a69
Merge branch 'deploy-gaszipperiphery' of github.com:lifinance/contrac…
mirooon Jan 28, 2026
e5dceb1
added diamond deploy logs
mirooon Jan 28, 2026
5ccaeb6
updates
mirooon Jan 28, 2026
d6e01a0
Merge branch 'SMAR-123-Fix-automatic-contract-verification' into depl…
mirooon Jan 28, 2026
1df9c32
updates
mirooon Jan 28, 2026
2f694af
updates
mirooon Jan 28, 2026
ac2b8ab
updates
mirooon Jan 28, 2026
e8f2fc8
Merge branch 'main' into deploy-gaszipperiphery
mirooon Feb 9, 2026
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
1 change: 1 addition & 0 deletions .cursor/rules/000-global-standards.mdc
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ alwaysApply: true
- **Rules tracking**: Maintain active rules list (compact tags: `000-global-standards`, `100-solidity-basics`). List at task start/after context reset; only mention when rules change. If context stale/truncated, restate visible rules and ask for corrections.
- **Conventions**: Follow repo patterns; reuse existing helpers/libraries; avoid interface/storage changes unless requested.
- **Workflow**: Before edits: brief intent/scope/files/rules; plan → implement; update plan if scope changes.
- **Rule activation**: Before editing any file (even if not explicitly mentioned by the user), load and follow all `.cursor/rules/*.mdc` whose `globs` match that file path.
- **Design**: When multiple valid approaches exist, name ≥2 with tradeoffs; prefer minimal diffs unless conventions/security justify larger refactor.
- **Uncertainty**: Flag assumptions/risky edges; don't guess; ask one concise question.
40 changes: 40 additions & 0 deletions GasZipPeriphery_standard_json.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"language": "Solidity",
"sources": {
"src/Periphery/GasZipPeriphery.sol": {
"content": "// SPDX-License-Identifier: LGPL-3.0-only\npragma solidity ^0.8.17;\n\nimport { ILiFi } from \"../Interfaces/ILiFi.sol\";\nimport { IGasZip } from \"../Interfaces/IGasZip.sol\";\nimport { IWhitelistManagerFacet } from \"../Interfaces/IWhitelistManagerFacet.sol\";\nimport { LibSwap } from \"../Libraries/LibSwap.sol\";\nimport { LibAsset, IERC20 } from \"../Libraries/LibAsset.sol\";\nimport { LibUtil } from \"../Libraries/LibUtil.sol\";\nimport { WithdrawablePeriphery } from \"../Helpers/WithdrawablePeriphery.sol\";\nimport { SafeTransferLib } from \"solady/utils/SafeTransferLib.sol\";\nimport { InvalidCallData, ContractCallNotAllowed, InvalidConfig } from \"../Errors/GenericErrors.sol\";\n\n/// @title GasZipPeriphery\n/// @author LI.FI (https://li.fi)\n/// @notice Provides functionality to swap ERC20 tokens to use the gas.zip protocol as a pre-bridge step (https://www.gas.zip/)\n/// @custom:version 1.0.2\ncontract GasZipPeriphery is ILiFi, WithdrawablePeriphery {\n using SafeTransferLib for address;\n\n /// State ///\n IGasZip public immutable GAS_ZIP_ROUTER;\n address public immutable LIFI_DIAMOND;\n uint256 internal constant MAX_CHAINID_LENGTH_ALLOWED = 16;\n\n bytes4 internal constant APPROVE_TO_ONLY_SELECTOR = 0xffffffff;\n\n /// Errors ///\n error TooManyChainIds();\n error SwapOutputMustBeNative();\n\n /// Constructor ///\n constructor(\n address _gasZipRouter,\n address _liFiDiamond,\n address _owner\n ) WithdrawablePeriphery(_owner) {\n if (\n _gasZipRouter == address(0) ||\n _liFiDiamond == address(0) ||\n _owner == address(0)\n ) {\n revert InvalidConfig();\n }\n GAS_ZIP_ROUTER = IGasZip(_gasZipRouter);\n LIFI_DIAMOND = _liFiDiamond;\n }\n\n /// @notice Swaps ERC20 tokens to native and deposits these native tokens in the GasZip router contract\n /// Swaps are allowed via any whitelisted contract from the Diamond's WhitelistManagerFacet\n /// @dev this function can be used as a LibSwap.SwapData protocol step to combine it with any other bridge\n /// @param _swapData The swap data that executes the swap from ERC20 to native\n /// @param _gasZipData contains information about which chains gas should be sent to\n function depositToGasZipERC20(\n LibSwap.SwapData calldata _swapData,\n IGasZip.GasZipData calldata _gasZipData\n ) public {\n if (_swapData.receivingAssetId != address(0)) {\n revert SwapOutputMustBeNative();\n }\n\n IWhitelistManagerFacet whitelistManager = IWhitelistManagerFacet(\n LIFI_DIAMOND\n );\n\n /// This check ensures that either the swap execution contract (_swapData.callTo)\n /// is whitelisted for the specific call or the token spender (_swapData.approveTo)\n /// is whitelisted using the APPROVE_TO_ONLY_SELECTOR (0xffffffff).\n /// This prevents allowance leaks while supporting DEXs where the spender and\n /// the caller addresses are different.\n if (\n !whitelistManager.isContractSelectorWhitelisted(\n _swapData.callTo,\n bytes4(_swapData.callData[:4])\n ) ||\n (_swapData.approveTo != _swapData.callTo &&\n !whitelistManager.isContractSelectorWhitelisted(\n _swapData.approveTo,\n APPROVE_TO_ONLY_SELECTOR\n ))\n ) {\n revert ContractCallNotAllowed();\n }\n\n // deposit ERC20 asset from diamond\n LibAsset.depositAsset(_swapData.sendingAssetId, _swapData.fromAmount);\n\n // max approve to DEX, if not already done\n LibAsset.maxApproveERC20(\n IERC20(_swapData.sendingAssetId),\n _swapData.approveTo,\n _swapData.fromAmount\n );\n\n uint256 preSwapBal = address(this).balance;\n\n // execute swap using the whitelisted DEX\n // Note on slippage protection:\n // 1. Individual swap slippage is protected via minAmountOut parameter in _swapData.callData\n // 2. Final output amount slippage is checked at diamond contract level in SwapperV2._depositAndSwap()\n // solhint-disable-next-line avoid-low-level-calls\n (bool success, bytes memory res) = _swapData.callTo.call(\n _swapData.callData\n );\n if (!success) {\n LibUtil.revertWith(res);\n }\n\n uint256 swapOutputAmount = address(this).balance - preSwapBal;\n\n // deposit native tokens to Gas.zip protocol\n depositToGasZipNative(_gasZipData, swapOutputAmount);\n }\n\n /// @notice Deposits native tokens to the GasZip router contract\n /// @dev this function can be used as a LibSwap.SwapData protocol step to combine it with any other bridge\n /// @param _gasZipData contains information which chains and address gas should be sent to\n /// @param _amount the total amount to be deposited (will be split equally across all chains)\n function depositToGasZipNative(\n IGasZip.GasZipData calldata _gasZipData,\n uint256 _amount\n ) public payable {\n // make sure that receiverAddress is not 0\n if (_gasZipData.receiverAddress == bytes32(0))\n revert InvalidCallData();\n\n // We are depositing to a new contract that supports deposits for EVM chains + Solana (therefore 'receiver' address is bytes32)\n GAS_ZIP_ROUTER.deposit{ value: _amount }(\n _gasZipData.destinationChains,\n _gasZipData.receiverAddress\n );\n\n // return unused native value to msg.sender, if any\n // this is required due to LI.FI backend-internal requirements (money flow)\n uint256 remainingNativeBalance = address(this).balance;\n if (remainingNativeBalance > 0) {\n msg.sender.safeTransferETH(remainingNativeBalance);\n }\n }\n\n /// @dev Returns a value that signals to Gas.zip to which chains gas should be sent in equal parts\n /// @param _chainIds a list of Gas.zip-specific chainIds (not the original chainIds),\n /// see https://dev.gas.zip/gas/chain-support/outbound\n function getDestinationChainsValue(\n uint8[] calldata _chainIds\n ) external pure returns (uint256 destinationChains) {\n uint256 length = _chainIds.length;\n\n if (length > MAX_CHAINID_LENGTH_ALLOWED) revert TooManyChainIds();\n\n for (uint256 i; i < length; ++i) {\n // Shift destinationChains left by 16 bits and add the next chainID\n destinationChains =\n (destinationChains << 16) |\n uint256(_chainIds[i]);\n }\n }\n\n // Required to receive ETH from ERC20-to-Native swaps\n receive() external payable {}\n}"
}
},
"settings": {
"remappings": [
"lifi/=src/",
"solady/=lib/solady/src/",
"@openzeppelin/=lib/openzeppelin-contracts/",
"solmate/=lib/solmate/src/",
"permit2/=lib/Permit2/src/",
"forge-std/=lib/forge-std/src/",
"test/=test/"
],
"optimizer": {
"enabled": true,
"runs": 1000000
},
"evmVersion": "cancun",
"viaIR": false,
"outputSelection": {
"*": {
"*": [
"abi",
"evm.bytecode",
"evm.deployedBytecode",
"evm.bytecode.sourceMap",
"evm.deployedBytecode.sourceMap",
"metadata"
],
"": [
"ast"
]
}
}
}
}
14 changes: 12 additions & 2 deletions config/across.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"comment": "Note: this file is generated by a backend script, do not change it manually!",
"comment": "We are not deploying AcrossFacetPacked to any new chains so we dont need the custom token lists from the backend anymore",
"comment2": "Adding new networks here is OK. Please just be careful when editing / removing existing tokensToApprove",
"comment3": "In case of doubt please align with the backend team prior to changing this file",
"LinkToDeployedToAddresses": "https://github.com/across-protocol/contracts/tree/master/deployments",
"mainnet": {
"chainId": 1,
"acrossSpokePool": "0x5c7BCd6E7De5423a257D81B442095A1a6ced35C5",
Expand Down Expand Up @@ -132,6 +135,11 @@
"0xba9986d2381edf1da03b0b9c1f8b00dc4aacc369"
]
},
"megaeth": {
"chainId": 4326,
"acrossSpokePool": "0x3Db06DA8F0a24A525f314eeC954fC5c6a973d40E",
"tokensToApprove": []
},
"base": {
"chainId": 8453,
"acrossSpokePool": "0x09aea4b2242abC8bb4BB78D537A67a245A7bEC64",
Expand Down Expand Up @@ -180,7 +188,9 @@
"ink": {
"chainId": 57073,
"acrossSpokePool": "0xeF684C38F94F48775959ECf2012D7E864ffb9dd4",
"tokensToApprove": ["0x4200000000000000000000000000000000000006"]
"tokensToApprove": [
"0x4200000000000000000000000000000000000006"
]
},
"linea": {
"chainId": 59144,
Expand Down
4 changes: 4 additions & 0 deletions config/glacis.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"LinkToDeployedToAddresses": "https://github.com/glacislabs/airlift-evm/blob/main/config/diamond/latest.json",
"mainnet": {
"airlift": "0x023fa838682C115c2cFBA96Ef3791CB5Bd931Fc7"
},
Expand Down Expand Up @@ -65,6 +66,9 @@
"mantle": {
"airlift": "0x686893D73fA3817A13217E858652A4866B096dCa"
},
"megaeth": {
"airlift": "0xa908db975dCC10c41AF59572FD40AeE46942630E"
},
"mode": {
"airlift": "0x023fa838682C115c2cFBA96Ef3791CB5Bd931Fc7"
},
Expand Down
2 changes: 1 addition & 1 deletion config/networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@
"wrappedNativeAddress": "0xacc15dc74880c9944775448304b263d191c6077f",
"status": "active",
"type": "mainnet",
"rpcUrl": "https://moonbeam.public.blastapi.io",
"rpcUrl": "https://moonbeam-rpc.publicnode.com",
"verificationType": "etherscan",
"explorerUrl": "https://moonscan.io",
"explorerApiUrl": "https://api-moonbeam.moonscan.io/api",
Expand Down
Loading