Skip to content

Commit 4e4524f

Browse files
committed
Version Optimism bridge contracts
1 parent 9830ea7 commit 4e4524f

File tree

3 files changed

+62
-6
lines changed

3 files changed

+62
-6
lines changed

contracts/v0.7/bridge/optimism/OVM_EOACodeHashSet.sol

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
// SPDX-License-Identifier: MIT
22
pragma solidity >0.6.0 <0.8.0;
33

4+
/* Interface Imports */
5+
import { ITypeAndVersion } from "../../../v0.6/ITypeAndVersion.sol";
6+
47
/* Library Imports */
58
import { EnumerableSet } from "../../../../vendor/OpenZeppelin/openzeppelin-contracts/contracts/utils/EnumerableSet.sol";
69

@@ -19,7 +22,7 @@ import { OwnableUpgradeable } from "../../../../vendor/OpenZeppelin/openzeppelin
1922
* As the OVM_ProxyEOA.sol contract source could potentially change in the future (i.e., due to a fork),
2023
* here we actually track a set of possible EOA proxy contracts.
2124
*/
22-
abstract contract OVM_EOACodeHashSet is /* Initializable, */ OwnableUpgradeable {
25+
abstract contract OVM_EOACodeHashSet is ITypeAndVersion, /* Initializable, */ OwnableUpgradeable {
2326
// Add the EnumerableSet library
2427
using EnumerableSet for EnumerableSet.Bytes32Set;
2528

@@ -34,13 +37,30 @@ abstract contract OVM_EOACodeHashSet is /* Initializable, */ OwnableUpgradeable
3437
// Optimism v0.3.0-rc
3538
bytes32 constant OVM_EOA_CODE_HASH_V4 = 0xef2ab076db773ffc554c9f287134123439a5228e92f5b3194a28fec0a0afafe3;
3639

40+
/**
41+
* @notice versions:
42+
*
43+
* - OVM_EOACodeHashSet 0.0.1: initial release
44+
*
45+
* @inheritdoc ITypeAndVersion
46+
*/
47+
function typeAndVersion()
48+
external
49+
pure
50+
override
51+
virtual
52+
returns (string memory)
53+
{
54+
return "OVM_EOACodeHashSet 0.0.1";
55+
}
56+
3757
function __OVM_EOACodeHashSet_init()
3858
internal
3959
initializer()
4060
{
41-
__Context_init_unchained();
42-
__Ownable_init_unchained();
43-
__OVM_EOACodeHashSet_init_unchained();
61+
__Context_init_unchained();
62+
__Ownable_init_unchained();
63+
__OVM_EOACodeHashSet_init_unchained();
4464
}
4565

4666
/// @notice Adds genesis OVM_ProxyEOA.sol EXTCODEHASH to the default set.

contracts/v0.7/bridge/optimism/OVM_L1ERC20Gateway.sol

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ pragma solidity >0.6.0 <0.8.0;
44
pragma experimental ABIEncoderV2;
55

66
/* Interface Imports */
7+
import { ITypeAndVersion } from "../../../v0.6/ITypeAndVersion.sol";
78
import { IERC20 } from "../../../../vendor/OpenZeppelin/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
89
import { IERC677Receiver } from "../../../v0.6/token/IERC677Receiver.sol";
910

@@ -28,7 +29,7 @@ import { Abs_L1TokenGateway } from "../../../../vendor/ethereum-optimism/optimis
2829
* Compiler used: solc
2930
* Runtime target: EVM
3031
*/
31-
contract OVM_L1ERC20Gateway is IERC677Receiver, Initializable, Abs_L1TokenGateway {
32+
contract OVM_L1ERC20Gateway is ITypeAndVersion, IERC677Receiver, Initializable, Abs_L1TokenGateway {
3233
// L1 token we are bridging to L2
3334
IERC20 public s_l1ERC20;
3435

@@ -41,6 +42,23 @@ contract OVM_L1ERC20Gateway is IERC677Receiver, Initializable, Abs_L1TokenGatewa
4142
public
4243
{}
4344

45+
/**
46+
* @notice versions:
47+
*
48+
* - OVM_L1ERC20Gateway 0.0.1: initial release
49+
*
50+
* @inheritdoc ITypeAndVersion
51+
*/
52+
function typeAndVersion()
53+
external
54+
pure
55+
override
56+
virtual
57+
returns (string memory)
58+
{
59+
return "OVM_L1ERC20Gateway 0.0.1";
60+
}
61+
4462
/**
4563
* @param l2ERC20Gateway L2 Gateway address on the chain being deposited into
4664
* @param l1Messenger Cross-domain messenger used by this contract.

contracts/v0.7/bridge/optimism/OVM_L2ERC20Gateway.sol

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ pragma solidity >0.6.0 <0.8.0;
33
pragma experimental ABIEncoderV2;
44

55
/* Interface Imports */
6+
import { ITypeAndVersion } from "../../../v0.6/ITypeAndVersion.sol";
67
import { IERC20Child } from "../token/IERC20Child.sol";
78
import { IERC677Receiver } from "../../../v0.6/token/IERC677Receiver.sol";
89

@@ -24,7 +25,7 @@ import { OVM_EOACodeHashSet } from "./OVM_EOACodeHashSet.sol";
2425
* Compiler used: optimistic-solc
2526
* Runtime target: OVM
2627
*/
27-
contract OVM_L2ERC20Gateway is IERC677Receiver, /* Initializable, */ OVM_EOACodeHashSet, Abs_L2DepositedToken {
28+
contract OVM_L2ERC20Gateway is ITypeAndVersion, IERC677Receiver, /* Initializable, */ OVM_EOACodeHashSet, Abs_L2DepositedToken {
2829
// Bridged L2 token
2930
IERC20Child public s_l2ERC20;
3031

@@ -36,6 +37,23 @@ contract OVM_L2ERC20Gateway is IERC677Receiver, /* Initializable, */ OVM_EOACode
3637
public
3738
{}
3839

40+
/**
41+
* @notice versions:
42+
*
43+
* - OVM_L2ERC20Gateway 0.0.1: initial release
44+
*
45+
* @inheritdoc ITypeAndVersion
46+
*/
47+
function typeAndVersion()
48+
external
49+
pure
50+
override(ITypeAndVersion, OVM_EOACodeHashSet)
51+
virtual
52+
returns (string memory)
53+
{
54+
return "OVM_L2ERC20Gateway 0.0.1";
55+
}
56+
3957
/**
4058
* @param l1ERC20Gateway L1 Gateway address on the chain being withdrawn into
4159
* @param l2Messenger Cross-domain messenger used by this contract.

0 commit comments

Comments
 (0)