-
Notifications
You must be signed in to change notification settings - Fork 26
feat: sync zone contracts with TIP-1091 #682
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,16 @@ | ||
| //! `ZoneFactory` — deployed on Tempo L1. | ||
|
|
||
| use alloy_primitives::{Address, address}; | ||
| use alloy_primitives::{Address, FixedBytes, address, fixed_bytes}; | ||
|
|
||
| pub use ZoneFactory::ZoneInfo; | ||
|
|
||
| /// Protocol-managed ZoneFactory address defined by TIP-1091. | ||
| pub const ZONE_FACTORY_ADDRESS: Address = address!("0x5aF2000000000000000000000000000000000000"); | ||
| pub const ZONE_PORTAL_PREFIX: FixedBytes<12> = fixed_bytes!("5AD000000000000000000000"); | ||
| pub const ZONE_PORTAL_IMPL_ADDRESS: Address = | ||
| address!("0x5AD1000000000000000000000000000000000000"); | ||
| pub const ZONE_VERIFIER_ADDRESS: Address = address!("0x5a56000000000000000000000000000000000000"); | ||
| pub const ZONE_MESSENGER_ADDRESS: Address = address!("0x5A4d000000000000000000000000000000000000"); | ||
|
|
||
| crate::sol! { | ||
| #[derive(Debug)] | ||
|
|
@@ -16,7 +21,6 @@ crate::sol! { | |
| address initialToken; | ||
| address admin; | ||
| address sequencer; | ||
| address verifier; | ||
| bytes32 genesisBlockHash; | ||
| bytes32 genesisTempoBlockHash; | ||
| uint64 genesisTempoBlockNumber; | ||
|
|
@@ -31,7 +35,6 @@ crate::sol! { | |
| address initialToken; | ||
| address admin; | ||
| address sequencer; | ||
| address verifier; | ||
| ZoneParams zoneParams; | ||
| string rpcUrl; | ||
| } | ||
|
|
@@ -47,10 +50,8 @@ crate::sol! { | |
| uint64 genesisTempoBlockNumber | ||
| ); | ||
| function createZone(CreateZoneParams calldata params) external returns (uint32 zoneId, address portal); | ||
| function verifier() external view returns (address); | ||
| function messenger() external view returns (address); | ||
| function zones(uint32 zoneId) external view returns (ZoneInfo memory); | ||
| function zoneCount() external view returns (uint32); | ||
| function nextZoneId() external view returns (uint32); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The existing skills in this repo still call the removed |
||
| function isZonePortal(address portal) external view returns (bool); | ||
| } | ||
| } | ||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ import { | |
| IWithdrawalReceiver, | ||
| IZoneFactory, | ||
| IZonePortal, | ||
| ZONE_MESSENGER_ADDRESS, | ||
| ZoneInfo | ||
| } from "../interfaces/IZone.sol"; | ||
| import { IStablecoinDEX } from "tempo-std/interfaces/IStablecoinDEX.sol"; | ||
|
|
@@ -73,7 +74,7 @@ contract SwapAndDepositRouter is IWithdrawalReceiver { | |
| external | ||
| returns (bytes4) | ||
| { | ||
| if (msg.sender != zoneFactory.messenger()) { | ||
| if (msg.sender != ZONE_MESSENGER_ADDRESS) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same thing here, this will break if we redeploy contracts on testnet until the precompiles are live. Can we update to remove this (and related changes) since we will need to redeploy on testnet before the precompiles are live? |
||
| revert UnauthorizedMessenger(); | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this break existing flows on Testnet before these are live?