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

Permit 2 trusted forwarder lf 11889 #939

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
151 changes: 121 additions & 30 deletions config/permit2Proxy.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,122 @@
{
"mainnet": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
"arbitrum": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
"aurora": "",
"avalanche": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
"base": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
"blast": "0x000000000022d473030f116ddee9f6b43ac78ba3",
"boba": "",
"bsc": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
"celo": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
"fantom": "",
"fraxtal": "",
"fuse": "",
"gnosis": "",
"gravity": "",
"immutablezkevm": "",
"linea": "",
"mantle": "",
"metis": "",
"mode": "",
"moonbeam": "",
"moonriver": "",
"optimism": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
"polygon": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
"polygonzkevm": "",
"rootstock": "",
"scroll": "",
"sei": "",
"taiko": "",
"zksync": "0x0000000000225e31d15943971f47ad3022f714fa"
}
"mainnet": {
"Permit2": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
"TrustedForwarders": ["0xd8253782c45a12053594b9deB72d8e8aB2Fca54c"]
},
"arbitrum": {
"Permit2": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
"TrustedForwarders": ["0xd8253782c45a12053594b9deB72d8e8aB2Fca54c"]
},
"aurora": {
"Permit2": "",
"TrustedForwarders": [""]
},
"avalanche": {
"Permit2": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
"TrustedForwarders": ["0xd8253782c45a12053594b9deB72d8e8aB2Fca54c"]
},
"base": {
"Permit2": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
"TrustedForwarders": ["0xd8253782c45a12053594b9deB72d8e8aB2Fca54c"]
},
"blast": {
"Permit2": "0x000000000022d473030f116ddee9f6b43ac78ba3",
"TrustedForwarders": ["0xd8253782c45a12053594b9deB72d8e8aB2Fca54c"]
},
"boba": {
"Permit2": "",
"TrustedForwarders": [""]
},
"bsc": {
"Permit2": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
"TrustedForwarders": ["0xd8253782c45a12053594b9deB72d8e8aB2Fca54c"]
},
"celo": {
"Permit2": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
"TrustedForwarders": [""]
},
"fantom": {
"Permit2": "",
"TrustedForwarders": [""]
},
"fraxtal": {
"Permit2": "",
"TrustedForwarders": [""]
},
"fuse": {
"Permit2": "",
"TrustedForwarders": [""]
},
"gnosis": {
"Permit2": "",
"TrustedForwarders": ["0xd8253782c45a12053594b9deB72d8e8aB2Fca54c"]
},
"gravity": {
"Permit2": "",
"TrustedForwarders": [""]
},
"immutablezkevm": {
"Permit2": "",
"TrustedForwarders": [""]
},
"linea": {
"Permit2": "",
"TrustedForwarders": ["0xd8253782c45a12053594b9deB72d8e8aB2Fca54c"]
},
"mantle": {
"Permit2": "",
"TrustedForwarders": [""]
},
"metis": {
"Permit2": "",
"TrustedForwarders": ["0xd8253782c45a12053594b9deB72d8e8aB2Fca54c"]
},
"mode": {
"Permit2": "",
"TrustedForwarders": ["0xd8253782c45a12053594b9deB72d8e8aB2Fca54c"]
},
"moonbeam": {
"Permit2": "",
"TrustedForwarders": [""]
},
"moonriver": {
"Permit2": "",
"TrustedForwarders": [""]
},
"optimism": {
"Permit2": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
"TrustedForwarders": ["0xd8253782c45a12053594b9deB72d8e8aB2Fca54c"]
},
"polygon": {
"Permit2": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
"TrustedForwarders": ["0xd8253782c45a12053594b9deB72d8e8aB2Fca54c"]
},
"polygonzkevm": {
"Permit2": "",
"TrustedForwarders": ["0xd8253782c45a12053594b9deB72d8e8aB2Fca54c"]
},
"rootstock": {
"Permit2": "",
"TrustedForwarders": ["0xd8253782c45a12053594b9deB72d8e8aB2Fca54c"]
},
"scroll": {
"Permit2": "",
"TrustedForwarders": [""]
},
"sei": {
"Permit2": "",
"TrustedForwarders": [""]
},
"sonic": {
"Permit2": "",
"TrustedForwarders": ["0x61F2976610970AFeDc1d83229e1E21bdc3D5cbE4"]
},
"taiko": {
"Permit2": "",
"TrustedForwarders": [""]
},
"zksync": {
"Permit2": "0x0000000000225e31d15943971f47ad3022f714fa",
"TrustedForwarders": ["0x97015cD4C3d456997DD1C40e2a18c79108FCc412"]
}
}
22 changes: 22 additions & 0 deletions deployments/_deployments_log_file.json
Original file line number Diff line number Diff line change
Expand Up @@ -25843,6 +25843,16 @@
"SALT": "",
"VERIFIED": "true"
}
],
"1.1.0": [
{
"ADDRESS": "0xb33Fe241BEd9bf5F694101D7498F63a0d060F999",
"OPTIMIZER_RUNS": "1000000",
"TIMESTAMP": "2025-01-22 07:56:36",
"CONSTRUCTOR_ARGS": "0x000000000000000000000000d3b2b0ac0afdd0d166a495f5e9fca4ecc715a782000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba30000000000000000000000009e606d0d2bba344b911e2f4eab95d9235a83fe1500000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000d8253782c45a12053594b9deb72d8e8ab2fca54c",
"SALT": "",
"VERIFIED": "false"
Comment on lines +25849 to +25854
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Production contract needs verification.

The contract at 0xb33Fe241BEd9bf5F694101D7498F63a0d060F999 is not verified in the production environment. This makes it difficult to verify the deployed bytecode matches the source code.

Please verify the contract on the blockchain explorer to ensure transparency and security.

}
]
},
"production": {
Expand Down Expand Up @@ -25896,6 +25906,18 @@
"VERIFIED": "true"
}
]
},
"staging": {
"1.1.0": [
{
"ADDRESS": "0xb33Fe241BEd9bf5F694101D7498F63a0d060F999",
"OPTIMIZER_RUNS": "1000000",
"TIMESTAMP": "2025-01-22 07:57:22",
"CONSTRUCTOR_ARGS": "0x000000000000000000000000d3b2b0ac0afdd0d166a495f5e9fca4ecc715a782000000000000000000000000000000000022d473030f116ddee9f6b43ac78ba3000000000000000000000000a8892ea3fddef2aa8afb1e3643a3284f978a511400000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000001000000000000000000000000d8253782c45a12053594b9deb72d8e8ab2fca54c",
"SALT": "",
"VERIFIED": "true"
}
]
}
},
"mainnet": {
Expand Down
2 changes: 1 addition & 1 deletion deployments/arbitrum.diamond.staging.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"GasZipPeriphery": "",
"LiFiDEXAggregator": "",
"LiFuelFeeCollector": "0x94EA56D8049e93E0308B9c7d1418Baf6A7C68280",
"Permit2Proxy": "0x6FC01BC9Ff6Cdab694Ec8Ca41B21a2F04C8c37E5",
"Permit2Proxy": "0xb33Fe241BEd9bf5F694101D7498F63a0d060F999",
"ReceiverAcrossV3": "0xe4F3DEF14D61e47c696374453CD64d438FD277F8",
"Receiver": "0x36E9B2E8A627474683eF3b1E9Df26D2bF04396f3",
"ReceiverStargateV2": "",
Expand Down
3 changes: 1 addition & 2 deletions deployments/arbitrum.staging.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"DeBridgeDlnFacet": "0xE15C7585636e62b88bA47A40621287086E0c2E33",
"MayanFacet": "0xd596C903d78870786c5DB0E448ce7F87A65A0daD",
"StandardizedCallFacet": "0xA7ffe57ee70Ac4998e9E9fC6f17341173E081A8f",
"MayanFacet": "0xd596C903d78870786c5DB0E448ce7F87A65A0daD",
"GenericSwapFacetV3": "0xFf6Fa203573Baaaa4AE375EB7ac2819d539e16FF",
"CalldataVerificationFacet": "0x90B5b319cA20D9E466cB5b843952363C34d1b54E",
"AcrossFacetPacked": "0x7A3770a9504924d99D38BBba4F0116B756393Eb3",
Expand All @@ -47,7 +46,7 @@
"LiFuelFeeCollector": "0x94EA56D8049e93E0308B9c7d1418Baf6A7C68280",
"TokenWrapper": "0xF63b27AE2Dc887b88f82E2Cc597d07fBB2E78E70",
"EmergencyPauseFacet": "0x17Bb203F42d8e404ac7E8dB6ff972B7E8473850b",
"Permit2Proxy": "0x6FC01BC9Ff6Cdab694Ec8Ca41B21a2F04C8c37E5",
"Permit2Proxy": "0xb33Fe241BEd9bf5F694101D7498F63a0d060F999",
"AcrossFacetV3": "0x08BfAc22A3B41637edB8A7920754fDb30B18f740",
"ReceiverAcrossV3": "0xe4F3DEF14D61e47c696374453CD64d438FD277F8",
"AcrossFacetPackedV3": "0x21767081Ff52CE5563A29f27149D01C7127775A2",
Expand Down
2 changes: 1 addition & 1 deletion deployments/optimism.diamond.staging.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
"GasZipPeriphery": "",
"LiFiDEXAggregator": "",
"LiFuelFeeCollector": "0x94EA56D8049e93E0308B9c7d1418Baf6A7C68280",
"Permit2Proxy": "",
"Permit2Proxy": "0xb33Fe241BEd9bf5F694101D7498F63a0d060F999",
"ReceiverAcrossV3": "0x3877f47B560819E96BBD7e7700a02dfACe36D696",
"Receiver": "0x36E9B2E8A627474683eF3b1E9Df26D2bF04396f3",
"ReceiverStargateV2": "",
Expand Down
3 changes: 2 additions & 1 deletion deployments/optimism.staging.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@
"AcrossFacetV3": "0x7A7dA456a99B5C8fef3D3E3c032a9F13949AdF07",
"ReceiverAcrossV3": "0x3877f47B560819E96BBD7e7700a02dfACe36D696",
"AcrossFacetPackedV3": "0x4352459F6BE1C7D1278F8c34Bb598b0feeB50f8b",
"RelayFacet": "0x3cf7dE0e31e13C93c8Aada774ADF1C7eD58157f5"
"RelayFacet": "0x3cf7dE0e31e13C93c8Aada774ADF1C7eD58157f5",
"Permit2Proxy": "0xb33Fe241BEd9bf5F694101D7498F63a0d060F999"
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"test": "forge test --evm-version 'shanghai'",
"test:fix": "npm run lint:fix; npm run format:fix; npm run test",
"gas": "forge snapshot --match-path 'test/solidity/Gas/**/*' -vvv",
"coverage": "rm -rf coverage && rm -f lcov-filtered.info && rm -f lcov.info && forge coverage --report lcov --evm-version 'shanghai' --ir-minimum && ts-node script/utils/filter_lcov.ts lcov.info lcov-filtered.info 'test/' 'script/' && genhtml lcov-filtered.info --branch-coverage --output-dir coverage && open coverage/index.html",
"coverage": "rm -rf coverage && rm -f lcov-filtered.info && rm -f lcov.info && forge coverage --report lcov --ir-minimum && ts-node script/utils/filter_lcov.ts lcov.info lcov-filtered.info 'test/' 'script/' && genhtml lcov-filtered.info --branch-coverage --output-dir coverage && open coverage/index.html",
"execute": "node ./_scripts.js run",
"abi:generate": "forge clean && rm -fr typechain/* && forge build --skip script --skip test --skip Base --skip Test && hardhat diamondABI",
"typechain": "forge clean && rm -rf typechain/* && forge build src && typechain --target ethers-v5 'out/*.sol/*.json' --out-dir typechain",
Expand Down Expand Up @@ -123,4 +123,4 @@
"solhint --fix"
]
}
}
}
98 changes: 98 additions & 0 deletions script/deploy/_targetState.json
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,56 @@
"ReceiverStargateV2": "1.0.0",
"SymbiosisFacet": "1.0.0"
}
},
"staging": {
"LiFiDiamond": {
"DiamondCutFacet": "1.0.0",
"DiamondLoupeFacet": "1.0.0",
"OwnershipFacet": "1.0.0",
"DexManagerFacet": "1.0.1",
"AccessManagerFacet": "1.0.0",
"WithdrawFacet": "1.0.0",
"PeripheryRegistryFacet": "1.0.0",
"GenericSwapFacet": "1.0.0",
"GenericSwapFacetV3": "1.0.1",
"LIFuelFacet": "1.0.1",
"CalldataVerificationFacet": "1.1.2",
"StandardizedCallFacet": "1.1.0",
"EmergencyPauseFacet": "1.0.1",
"LiFiDiamond": "1.0.0",
"ERC20Proxy": "1.0.0",
"Executor": "2.0.0",
"FeeCollector": "1.0.0",
"Receiver": "2.0.2",
"LiFuelFeeCollector": "1.0.1",
"TokenWrapper": "1.0.0",
"LiFiDEXAggregator": "1.0.0",
"Permit2Proxy": "1.0.0",
"GasZipPeriphery": "1.0.0",
"AcrossFacet": "2.0.0",
"AcrossFacetPacked": "1.0.0",
"AcrossFacetV3": "1.0.0",
"AcrossFacetPackedV3": "1.0.0",
"ReceiverAcrossV3": "1.0.0",
"AllBridgeFacet": "2.0.0",
"AmarokFacet": "3.0.0",
"AmarokFacetPacked": "1.0.0",
"CBridgeFacet": "1.0.0",
"CBridgeFacetPacked": "1.0.3",
"CelerCircleBridgeFacet": "1.0.1",
"RelayerCelerIM": "2.0.0",
"CelerIMFacetMutable": "2.0.0",
"GasZipFacet": "2.0.0",
"HopFacet": "2.0.0",
"HopFacetPacked": "1.0.6",
"HopFacetOptimized": "2.0.0",
"MayanFacet": "1.0.0",
"SquidFacet": "1.0.0",
"StargateFacet": "2.2.0",
"StargateFacetV2": "1.0.1",
"ReceiverStargateV2": "1.0.0",
"SymbiosisFacet": "1.0.0"
}
}
},
"optimism": {
Expand Down Expand Up @@ -444,6 +494,54 @@
"ReceiverStargateV2": "1.0.0",
"SymbiosisFacet": "1.0.0"
}
},
"staging": {
"LiFiDiamond": {
"DiamondCutFacet": "1.0.0",
"DiamondLoupeFacet": "1.0.0",
"OwnershipFacet": "1.0.0",
"DexManagerFacet": "1.0.1",
"AccessManagerFacet": "1.0.0",
"WithdrawFacet": "1.0.0",
"PeripheryRegistryFacet": "1.0.0",
"GenericSwapFacet": "1.0.0",
"GenericSwapFacetV3": "1.0.1",
"LIFuelFacet": "1.0.1",
"CalldataVerificationFacet": "1.1.2",
"StandardizedCallFacet": "1.1.0",
"EmergencyPauseFacet": "1.0.1",
"LiFiDiamond": "1.0.0",
"ERC20Proxy": "1.0.0",
"Executor": "2.0.0",
"FeeCollector": "1.0.0",
"Receiver": "2.0.2",
"LiFuelFeeCollector": "1.0.1",
"TokenWrapper": "1.0.0",
"LiFiDEXAggregator": "1.0.0",
"Permit2Proxy": "1.0.0",
"GasZipPeriphery": "1.0.0",
"AcrossFacet": "2.0.0",
"AcrossFacetPacked": "1.0.0",
"AcrossFacetV3": "1.0.0",
"AcrossFacetPackedV3": "1.0.0",
"ReceiverAcrossV3": "1.0.0",
"AllBridgeFacet": "2.0.0",
"AmarokFacet": "3.0.0",
"AmarokFacetPacked": "1.0.0",
"CBridgeFacet": "1.0.0",
"CBridgeFacetPacked": "1.0.3",
"CelerCircleBridgeFacet": "1.0.1",
"RelayerCelerIM": "2.0.0",
"CelerIMFacetMutable": "2.0.0",
"GasZipFacet": "2.0.0",
"HopFacet": "2.0.0",
"HopFacetPacked": "1.0.6",
"HopFacetOptimized": "2.0.0",
"StargateFacet": "2.2.0",
"StargateFacetV2": "1.0.1",
"ReceiverStargateV2": "1.0.0",
"SymbiosisFacet": "1.0.0"
}
}
},
"moonriver": {
Expand Down
18 changes: 16 additions & 2 deletions script/deploy/facets/DeployPermit2Proxy.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,15 @@ contract DeployScript is DeployScriptBase {
string memory permit2ProxyConfigJSON = vm.readFile(permit2ProxyConfig);

address permit2Address = permit2ProxyConfigJSON.readAddress(
string.concat(".", network)
string.concat(".", network, ".Permit2")
);

bytes memory rawForwarders = permit2ProxyConfigJSON.parseRaw(
string.concat(".", network, ".TrustedForwarders")
);
address[] memory trustedForwarders = abi.decode(
rawForwarders,
(address[])
);

// get the multisig SAFE address for the given network
Expand All @@ -57,6 +65,12 @@ contract DeployScript is DeployScriptBase {
string.concat(".", network, ".safeAddress")
);

return abi.encode(diamond, permit2Address, safeAddress);
return
abi.encode(
diamond,
permit2Address,
safeAddress,
trustedForwarders
);
}
}
Loading
Loading