-
Notifications
You must be signed in to change notification settings - Fork 135
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
fix: create in upstream merge #462
Conversation
feat(zk): more conversion traits
feat(zk): impl `SignableTransaction` for `Eip712Transaction`
fix(broadcast:zk): allow empty calldata fix(broadcast:zk): avoid max_fee_per_gas before rpc gas estimation
/// Given a `Project`'s output, removes the matching ABI, Bytecode and | ||
/// Runtime Bytecode of the given contract. | ||
#[track_caller] | ||
pub fn remove_zk_contract( |
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.
Should we move zk related helpers to a respective module/crate?
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.
We can refactor this once we have a better picture.
In general it's easier to have everything in one place, but we need to plan it properly as most times the "zk" functions are a copy-paste of the original ones with a few modifications. So when a upstream merge comes, we want to include those updates to the original function.
impl CreateArgs { | ||
/// Executes the command to create a contract | ||
pub async fn run(mut self) -> Result<()> { | ||
// Find Project & Compile | ||
let project = self.opts.project()?; | ||
let zksync = self.opts.compiler.zk.compile.unwrap_or_default(); | ||
if zksync { | ||
let target_path = if let Some(ref mut path) = self.contract.path { |
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.
This whole flow + helpers might also fit on a zksync/module crate as a function, that would make it cleaner for merge conflicts as well
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.
I think we'll need to follow this up with unification of the zk vs evm contracts like we had before (avoiding basically 2 different create depending if we are in zksync mode or not)
@@ -67,43 +73,54 @@ impl ZkTransactionMetadata { | |||
} | |||
|
|||
/// Creates a new signed EIP-712 transaction with the provided factory deps. | |||
pub async fn new_eip712_transaction<M: Middleware, S: Signer>( | |||
legacy_or_1559: TypedTransaction, | |||
pub async fn new_eip712_transaction< |
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.
isn't this (almost) what's present in script/src/broadcast.rs
? I think it makes sense to (at least partially) unify this
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.
We can do the refactor once we have a better picture.
Co-authored-by: Federico Rodríguez <[email protected]>
…ndry-zksync into nish-fix-upstream-create
Motivation
fixes create
Solution