omurovec / foundry-zksync-era Goto Github PK
View Code? Open in Web Editor NEWFoundry plugin for zksync era contract deployment
Foundry plugin for zksync era contract deployment
Deploying directly from L2 requires some additional problem solving including sending custom eth_sendTransaction
calls which could require some changes to foundry or some messy ffi calls. Some more research has to be done here to figure out the proper solution.
address DIAMOND_PROXY_MAINNET = 0x1908e2BF4a88F91E4eF0DC72f02b8Ea36BEa2319; address DIAMOND_PROXY_GOERLI = 0x32400084C286CF3E17e7B677ea9583e60a000324;
Needs flipping
It would be good to also have a way to verify contracts properly. This will probably not be possible with foundry atm due to compiler differences however it should be possible through the block explorer interface.
The solc version should be set to whatever solc --version
evaluates to on your machine and the zksolc version should match the version specified in your Deployer()
constructor. Have tried this with optimized selected and without but does not seem to work correctly for me.
deployFromL1
should return the counterfactual addressdeployFromL1
functions could also return the response from requestL2Transaction
, which is the l2 tx hash.Currently we require users to add their operating system & architecture to their env variables (to use for downloading the correct compiler binary) however it would be much easier to run a script that can determine this automatically.
This is done in zksync-hardhat-solc but it is not as trivial using solidity/foundry.
The solution would most likely require some bash scripting.
Hi, I noticed you need to pass in value
to pass the _verifyDepositLimit
check inside the function being called. Thanks!
The broadcast param in deployFromL1
is used to toggle vm.broadcast
calls but this is unnecessary since broadcasts are not actually broadcast to the chain unless the --broadcast
flag is used. This means there is really no need to have this extra parameter.
When using this on non Apple Silicon macOS or on x64 Linux, foundry-zksync-era will download the macOS ARM binary & therefore not function as intended.
This is due to a bug in the way FFI has been implemented to detect system info. It just gets back $(uname -m)
verbatim from the ffi call, without evaluating the intended command, hence the ternary statements default to arch
and os
to macOS / arm64 respectively, which leads to the wrong binary being downloaded & executed.
Currently we hard-code the gas values for requestL2Transaction
to be the max values so that it never fails. What we should do instead is estimate the correct values that it is expected to cost.
It is somewhat unclear how to get these values, but the relative docs can be found here
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.