Skip to content

Commit

Permalink
feat: introduce SuperchainWETH and ETHLiquidity
Browse files Browse the repository at this point in the history
Introduces the SuperchainWETH and ETHLiquidity contracts. More
information about these contracts can be found in the OP Stack
Specs repository.
  • Loading branch information
smartcontracts committed Jun 28, 2024
1 parent 379973e commit 4adf624
Show file tree
Hide file tree
Showing 21 changed files with 1,652 additions and 59 deletions.
15 changes: 15 additions & 0 deletions packages/contracts-bedrock/scripts/L2Genesis.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ contract L2Genesis is Deployer {
if (cfg.useInterop()) {
setCrossL2Inbox(); // 22
setL2ToL2CrossDomainMessenger(); // 23
setSuperchainWETH(); // 24
setETHLiquidity(); // 25
}
}

Expand Down Expand Up @@ -475,6 +477,19 @@ contract L2Genesis is Deployer {
_setImplementationCode(Predeploys.L2_TO_L2_CROSS_DOMAIN_MESSENGER);
}

/// @notice This predeploy is following the saftey invariant #1.
/// This contract has no initializer.
function setETHLiquidity() internal {
_setImplementationCode(Predeploys.ETH_LIQUIDITY);
vm.deal(Predeploys.ETH_LIQUIDITY, type(uint248).max);
}

/// @notice This predeploy is following the saftey invariant #1.
/// This contract has no initializer.
function setSuperchainWETH() internal {
_setImplementationCode(Predeploys.SUPERCHAIN_WETH);
}

/// @notice Sets all the preinstalls.
/// Warning: the creator-accounts of the preinstall contracts have 0 nonce values.
/// When performing a regular user-initiated contract-creation of a preinstall,
Expand Down
83 changes: 83 additions & 0 deletions packages/contracts-bedrock/snapshots/abi/ETHLiquidity.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
[
{
"inputs": [],
"name": "burn",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "mint",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "version",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "caller",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "LiquidityBurned",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "caller",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "value",
"type": "uint256"
}
],
"name": "LiquidityMinted",
"type": "event"
},
{
"inputs": [],
"name": "NotCustomGasToken",
"type": "error"
},
{
"inputs": [],
"name": "Unauthorized",
"type": "error"
}
]
Loading

0 comments on commit 4adf624

Please sign in to comment.