Skip to content

Commit

Permalink
Relay Bridge (v1.0.0) [RelayFacet v1.0.0,LibAsset v1.0.1] (#843)
Browse files Browse the repository at this point in the history
* Scaffold Relay Facet

* Add verification modifier

* Add calldata

* Implement ERC20

* Implement tests

* Deploy to staging

* Add deployment requirements

* Implement demo for Relay

* Update documentation

* Update doc link

* Deploy to POL and OP staging

* Remove unneeded comment

* Fixes

* Fixes

* Add swap and bridge TX to demo

* Add params needed to handle non EVM addresses

* Update tests to handle non-evm

* Redeploy to staging

* Update Relay Demo

* add revert case

* use standardized method for creating hash

* add comments for clarity

* add URL for listing chain ids

* fix typo

* add explicit test for non-evm chains

* add comments fix typo

* add NON_EVM_ADDRESS constant to LibAsset

* update name

* fix typo

* remove unused imports

* Update and redeploy to staging

* Use floating pragma

* Update version

* Add more tests

* Add even more tests

* Use mock to surgically make call fail

* Add explicit test for _getMappedChainId()

* update event

* prevent replay

* prevent empty non-evm addresses

* remove unused import

* Update audit log

* Update audit log

* Test constructor

* sort audited contracts
  • Loading branch information
ezynda3 authored Dec 13, 2024
1 parent 802a0d8 commit 729c4f7
Show file tree
Hide file tree
Showing 26 changed files with 1,767 additions and 30 deletions.
71 changes: 56 additions & 15 deletions audit/auditLog.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@
"auditReportPath": "./audit/reports/2024.11.22_Permit2Proxy.pdf",
"auditCommitHash": "0e3debb78abcdf9a9f934115338b611e16b039a0"
},
"audit20241202": {
"auditCompletedOn": "02.12.2024",
"auditedBy": "Sujith Somraaj (individual security researcher)",
"auditorGitHandle": "sujithsomraaj",
"auditReportPath": "./audit/reports/2024-12-02_RelayFacet(v1.0.0).pdf",
"auditCommitHash": "291d0a78bc4174b3ec29bb2ce0b27c6b5d3e8ec8"
},
"audit20241203": {
"auditCompletedOn": "03.12.2024",
"auditedBy": "Sujith Somraaj (individual security researcher)",
Expand All @@ -58,39 +65,73 @@
}
},
"auditedContracts": {
"AcrossFacetPackedV3": {
"1.0.0": [
"audit20241007"
]
},
"AcrossFacetV3": {
"1.0.0": ["audit20241007"]
"1.0.0": [
"audit20241007"
]
},
"AcrossFacetPackedV3": {
"1.0.0": ["audit20241007"]
"EmergencyPauseFacet": {
"1.0.0": [
"audit20240913"
],
"1.0.1": [
"audit20241105"
]
},
"GasZipFacet": {
"2.0.0": ["audit20241107"]
"2.0.0": [
"audit20241107"
]
},
"GasZipPeriphery": {
"1.0.0": ["audit20241107"]
"1.0.0": [
"audit20241107"
]
},
"IGasZip": {
"1.0.0": ["audit20241107"]
"1.0.0": [
"audit20241107"
]
},
"EmergencyPauseFacet": {
"1.0.0": ["audit20240913"],
"1.0.1": ["audit20241105"]
"LibAsset": {
"1.0.1": [
"audit20241202"
]
},
"LiFiDEXAggregator": {
"1.5.0": ["audit20241203"]
"1.5.0": [
"audit20241203"
]
},
"Permit2Proxy": {
"1.0.0": ["audit20241122"]
"1.0.0": [
"audit20241122"
]
},
"ReceiverAcrossV3": {
"1.0.0": ["audit20241007"]
"1.0.0": [
"audit20241007"
]
},
"RelayFacet": {
"1.0.0": [
"audit20241202"
]
},
"StargateFacetV2": {
"1.0.1": ["audit20240814"]
"1.0.1": [
"audit20240814"
]
},
"WithdrawablePeriphery": {
"1.0.0": ["audit20241014"]
"1.0.0": [
"audit20241014"
]
}
}
}
}
Binary file added audit/reports/2024-12-02_RelayFacet(v1.0.0).pdf
Binary file not shown.
46 changes: 46 additions & 0 deletions config/relay.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"mainnet": {
"relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
},
"optimism": {
"relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
},
"polygon": {
"relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
},
"boba": {
"relayReceiver": "0xa06e1351e2fd2d45b5d35633ca7ecf328684a109",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
},
"arbitrum": {
"relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
},
"avalanche": {
"relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
},
"blast": {
"relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
},
"mode": {
"relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
},
"linea": {
"relayReceiver": "0x00000000aa467eba42a3d604b3d74d63b2b6c6cb",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
},
"taiko": {
"relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
},
"scroll": {
"relayReceiver": "0xa5f565650890fba1824ee0f21ebbbf660a179934",
"relaySolver": "0xf70da97812CB96acDF810712Aa562db8dfA3dbEF"
}
}
44 changes: 44 additions & 0 deletions deployments/_deployments_log_file.json
Original file line number Diff line number Diff line change
Expand Up @@ -26126,5 +26126,49 @@
]
}
}
},
"RelayFacet": {
"arbitrum": {
"staging": {
"1.0.0": [
{
"ADDRESS": "0x3cf7dE0e31e13C93c8Aada774ADF1C7eD58157f5",
"OPTIMIZER_RUNS": "1000000",
"TIMESTAMP": "2024-11-07 14:15:11",
"CONSTRUCTOR_ARGS": "0x000000000000000000000000a5f565650890fba1824ee0f21ebbbf660a179934000000000000000000000000f70da97812cb96acdf810712aa562db8dfa3dbef",
"SALT": "",
"VERIFIED": "true"
}
]
}
},
"polygon": {
"staging": {
"1.0.0": [
{
"ADDRESS": "0x3cf7dE0e31e13C93c8Aada774ADF1C7eD58157f5",
"OPTIMIZER_RUNS": "1000000",
"TIMESTAMP": "2024-11-07 14:16:01",
"CONSTRUCTOR_ARGS": "0x000000000000000000000000a5f565650890fba1824ee0f21ebbbf660a179934000000000000000000000000f70da97812cb96acdf810712aa562db8dfa3dbef",
"SALT": "",
"VERIFIED": "true"
}
]
}
},
"optimism": {
"staging": {
"1.0.0": [
{
"ADDRESS": "0x3cf7dE0e31e13C93c8Aada774ADF1C7eD58157f5",
"OPTIMIZER_RUNS": "1000000",
"TIMESTAMP": "2024-11-07 14:17:16",
"CONSTRUCTOR_ARGS": "0x000000000000000000000000a5f565650890fba1824ee0f21ebbbf660a179934000000000000000000000000f70da97812cb96acdf810712aa562db8dfa3dbef",
"SALT": "",
"VERIFIED": "true"
}
]
}
}
}
}
8 changes: 4 additions & 4 deletions deployments/arbitrum.diamond.staging.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@
"Name": "",
"Version": ""
},
"0x2b64B62cbCfB38560222eBcfbbc4e65eC34c8Ce8": {
"Name": "",
"Version": ""
"0x74763722d92832d247cFa92825b06098cf72BAA2": {
"Name": "RelayFacet",
"Version": "1.0.0"
},
"0x6124C65B6264bE13f059b7C3A891a5b77DA8Bd95": {
"Name": "AcrossFacetV3",
Expand Down Expand Up @@ -160,8 +160,8 @@
"FeeCollector": "0x7F8E9bEBd1Dea263A36a6916B99bd84405B9654a",
"LiFiDEXAggregator": "",
"LiFuelFeeCollector": "0x94EA56D8049e93E0308B9c7d1418Baf6A7C68280",
"Receiver": "0x36E9B2E8A627474683eF3b1E9Df26D2bF04396f3",
"ReceiverAcrossV3": "0x3877f47B560819E96BBD7e7700a02dfACe36D696",
"Receiver": "0x36E9B2E8A627474683eF3b1E9Df26D2bF04396f3",
"ReceiverStargateV2": "",
"RelayerCelerIM": "0xa1Ed8783AC96385482092b82eb952153998e9b70",
"TokenWrapper": "0xF63b27AE2Dc887b88f82E2Cc597d07fBB2E78E70"
Expand Down
5 changes: 3 additions & 2 deletions deployments/arbitrum.staging.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,6 @@
"Permit2Proxy": "0x6FC01BC9Ff6Cdab694Ec8Ca41B21a2F04C8c37E5",
"AcrossFacetV3": "0x6124C65B6264bE13f059b7C3A891a5b77DA8Bd95",
"ReceiverAcrossV3": "0x3877f47B560819E96BBD7e7700a02dfACe36D696",
"AcrossFacetPackedV3": "0x4352459F6BE1C7D1278F8c34Bb598b0feeB50f8b"
}
"AcrossFacetPackedV3": "0x4352459F6BE1C7D1278F8c34Bb598b0feeB50f8b",
"RelayFacet": "0x3cf7dE0e31e13C93c8Aada774ADF1C7eD58157f5"
}
1 change: 1 addition & 0 deletions deployments/optimism.diamond.json
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
"Permit2Proxy": "0x6307119078556Fc8aD77781DFC67df20d75FB4f9",
"Receiver": "0x050e198E36A73a1e32F15C3afC58C4506d82f657",
"ReceiverAcrossV3": "0xB9CEc304899037E661F49DdFa7f64943b5920072",
"Receiver": "0x050e198E36A73a1e32F15C3afC58C4506d82f657",
"ReceiverStargateV2": "0x1493e7B8d4DfADe0a178dAD9335470337A3a219A",
"RelayerCelerIM": "0x6a8b11bF29C0546991DEcD6E0Db8cC7Fda22bA97",
"TokenWrapper": "0x5215E9fd223BC909083fbdB2860213873046e45d",
Expand Down
6 changes: 5 additions & 1 deletion deployments/optimism.diamond.staging.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,10 @@
"0x4352459F6BE1C7D1278F8c34Bb598b0feeB50f8b": {
"Name": "AcrossFacetPackedV3",
"Version": "1.0.0"
},
"0x74763722d92832d247cFa92825b06098cf72BAA2": {
"Name": "RelayFacet",
"Version": "1.0.0"
}
},
"Periphery": {
Expand All @@ -132,8 +136,8 @@
"FeeCollector": "0x7F8E9bEBd1Dea263A36a6916B99bd84405B9654a",
"LiFiDEXAggregator": "",
"LiFuelFeeCollector": "0x94EA56D8049e93E0308B9c7d1418Baf6A7C68280",
"Receiver": "0x36E9B2E8A627474683eF3b1E9Df26D2bF04396f3",
"ReceiverAcrossV3": "0x3877f47B560819E96BBD7e7700a02dfACe36D696",
"Receiver": "0x36E9B2E8A627474683eF3b1E9Df26D2bF04396f3",
"ReceiverStargateV2": "",
"RelayerCelerIM": "0xa1Ed8783AC96385482092b82eb952153998e9b70",
"TokenWrapper": "0xF63b27AE2Dc887b88f82E2Cc597d07fBB2E78E70"
Expand Down
5 changes: 3 additions & 2 deletions deployments/optimism.staging.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@
"EmergencyPauseFacet": "0x17Bb203F42d8e404ac7E8dB6ff972B7E8473850b",
"AcrossFacetV3": "0x6124C65B6264bE13f059b7C3A891a5b77DA8Bd95",
"ReceiverAcrossV3": "0x3877f47B560819E96BBD7e7700a02dfACe36D696",
"AcrossFacetPackedV3": "0x4352459F6BE1C7D1278F8c34Bb598b0feeB50f8b"
}
"AcrossFacetPackedV3": "0x4352459F6BE1C7D1278F8c34Bb598b0feeB50f8b",
"RelayFacet": "0x3cf7dE0e31e13C93c8Aada774ADF1C7eD58157f5"
}
6 changes: 5 additions & 1 deletion deployments/polygon.diamond.staging.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@
"0xE15C7585636e62b88bA47A40621287086E0c2E33": {
"Name": "",
"Version": ""
},
"0x74763722d92832d247cFa92825b06098cf72BAA2": {
"Name": "RelayFacet",
"Version": "1.0.0"
}
},
"Periphery": {
Expand All @@ -128,8 +132,8 @@
"FeeCollector": "0x7F8E9bEBd1Dea263A36a6916B99bd84405B9654a",
"LiFiDEXAggregator": "",
"LiFuelFeeCollector": "0x94EA56D8049e93E0308B9c7d1418Baf6A7C68280",
"Receiver": "0x36E9B2E8A627474683eF3b1E9Df26D2bF04396f3",
"ReceiverAcrossV3": "",
"Receiver": "0x36E9B2E8A627474683eF3b1E9Df26D2bF04396f3",
"ReceiverStargateV2": "",
"ReceiverAcrossV3": "",
"RelayerCelerIM": "0xa1Ed8783AC96385482092b82eb952153998e9b70",
Expand Down
3 changes: 2 additions & 1 deletion deployments/polygon.staging.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
"HopFacetOptimized": "0xf82135385765f1324257ffF74489F16382EBBb8A",
"SymbiosisFacet": "0x21571D628B0bCBeb954D5933A604eCac35bAF2c7",
"AcrossFacetV3": "0xe2e5428F972d9C0a5Ba433e0c402752b472dB248",
"RelayFacet": "0x3cf7dE0e31e13C93c8Aada774ADF1C7eD58157f5",
"Permit2Proxy": "0x6FC01BC9Ff6Cdab694Ec8Ca41B21a2F04C8c37E5"
}
}
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
- [Optimism Bridge Facet](./OptimismBridgeFacet.md)
- [Periphery Registry Facet](./PeripheryRegistryFacet.md)
- [Polygon Bridge Facet](./PolygonBridgeFacet.md)
- [Relay Facet](./RelayFacet.md)
- [Ronin Bridge Facet](./RoninBridgeFacet.md)
- [Squid Facet](./SquidFacet.md)
- [Standardized Call Facet](./StandardizedCallFacet.md)
Expand Down
Loading

0 comments on commit 729c4f7

Please sign in to comment.