-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(contracts): add deploy configs and implementation deploy logic for kroma L1 contracts #2
base: feat/apply-kroma-v2.1.0
Are you sure you want to change the base?
Conversation
781feba
to
0309a5f
Compare
d4b9300
to
d0c6c59
Compare
I've rebased this onto the target branch to apply the fix that removes importing interfaces at contracts (ValidatorManager, AssetManager). Also, based on that changes, I've managed to address the latter consideration, by commit d0c6c59. +Addressed the first consideration by the following commit! |
packages/contracts-bedrock/scripts/deploy/KromaDeployImplementations.s.sol
Outdated
Show resolved
Hide resolved
packages/contracts-bedrock/scripts/deploy/KromaDeployImplementations.s.sol
Outdated
Show resolved
Hide resolved
packages/contracts-bedrock/scripts/deploy/KromaDeployImplementations.s.sol
Outdated
Show resolved
Hide resolved
packages/contracts-bedrock/scripts/deploy/KromaDeployImplementations.s.sol
Outdated
Show resolved
Hide resolved
packages/contracts-bedrock/scripts/deploy/KromaDeployImplementations.s.sol
Outdated
Show resolved
Hide resolved
packages/contracts-bedrock/scripts/deploy/KromaDeployImplementations.s.sol
Show resolved
Hide resolved
packages/contracts-bedrock/scripts/deploy/KromaDeployImplementations.s.sol
Show resolved
Hide resolved
packages/contracts-bedrock/scripts/deploy/KromaDeployImplementations.s.sol
Outdated
Show resolved
Hide resolved
add21db
to
6ae2273
Compare
Added 5 commits, doing the following things
|
@@ -15,7 +15,7 @@ import { IKromaMintableERC20 } from "interfaces/universal/IKromaMintableERC20.so | |||
/// use a KromaMintableRC20 as the L2 representation of an L1 token, or vice-versa. | |||
/// Designed to be backwards compatible with the older StandardL2ERC20 token which was only | |||
/// meant for use on L2. | |||
contract KromaMintableERC20 is IKromaMintableERC20, ERC20, ISemver { | |||
contract KromaMintableERC20 is ERC20, ISemver { |
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 remove L10.
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.
It is used at the supportInterface
function below, so removing it will generate a compile error.
48c784a
to
cd8c5c1
Compare
…ployImplementation.s.sol
…oxyAdmin, and TokenMultiSigWallet
cd8c5c1
to
2ed316a
Compare
In the previous PR2, `KromaPortal` was replaced with `OptimismPortal`, and this PR addresses and resolves the issues that arose during the rebase of that change.
// TODO: Temp. Remove the following line once the interface is fixed | ||
"IL2OutputOracle", "IL1CrossDomainMessenger", "IProxyAdmin", |
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've done enough work with Interface. Why don't we include this temporarily excluded part now?
Description
This PR does 2 things
KromaDeployImplementation.s.sol
, which is to deploy implementation contracts of kroma L1.KromaDeployImplementation
Background
The reason why I made this contract is, to make the future upstream process as easy as possible while not breaking the compatibility with future modifications on OP Stack. The current OP Stack highly depends on 2 script files when deploying the smart contract:
Deploy.s.sol
andL2Genesis.s.sol
. So adding kroma-specific one in that level will break the actions at devnet & testing.For example, recently OP Stack made a breaking change on its devnet structure, which uses kurtosis instead of custom python file to initiate devnet. The
optimism-package
at kurtosis relies onop-deployer
, andop-deployer
callsDeploy.s.sol
andL2Genesis.s.sol
internally.So I thought that instead of adding a separate deploy script for Kroma contracts, integrating the deployment process of Kroma specific contracts inside
Deploy.s.sol
andL2Genesis.s.sol
is much better. Please suggest any ideas if you have!Demonstration
The
KromaDeployImplementation.s.sol
contract takes the role of deploying the impl contracts, and doing the sanity checks of the deploy configs and deployment itself.The
KromaDeployImplementation
contract will be initialized inDeploy.s.sol
, and will be used to deploy kroma L1 contracts. There would be a function such asdeployKromaImplementations()
, which is similar withdeployImplementations
function. The full process will be like this:deployKromaImplementations()
function (which will be implemented in the following PR) will get the necessary constructor arguments fromDeployConfig.s.sol
and set it atKromaDeployImplementationsInput
contract.KromaDeployImplementation
, which will then deploy the whole contracts and return it at the output format ofKromaDeployImplementationsOutput
.Considerations
assertValidAssetManager()
function.abi.encodeCall
and<InterfaceName>.__constructor__
when deploying the impl contract, but I changed it toabi.encodeWithSelector
.abi.encodeCall
is a better one, since it checks the type of each variables when it is called, whileabi.encodeWithSelector
does not. The reason why I did like this was because ValidatorManager and AssetManager imports their own interfaces. If I add__constructor__(...)
at the interface files, the contracts that imports those interfaces breaks, since there's no__constructor__
function in their contract. Maybe removing interface imports from ValidatorManager and AssetManager will work, but not sure it's a good idea.Please lmk if you have any idea to solve those problems.