Commit 6d084ee5 authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge branch 'develop' into clabby/ctb/invariant-tests

parents cf06d5ff fade339f
......@@ -108,7 +108,7 @@ describe('ERC721 Bridge', () => {
expect(await L1ERC721Bridge.otherBridge()).to.equal(L2ERC721Bridge.address)
expect(await L2ERC721Bridge.otherBridge()).to.equal(L1ERC721Bridge.address)
expect(await OptimismMintableERC721Factory.bridge()).to.equal(
expect(await OptimismMintableERC721Factory.BRIDGE()).to.equal(
L2ERC721Bridge.address
)
......
......@@ -84,7 +84,7 @@ func TestBuildL1DeveloperGenesis(t *testing.T) {
factory, err := bindings.NewOptimismMintableERC20(predeploys.DevOptimismMintableERC20FactoryAddr, sim)
require.NoError(t, err)
bridgeAddr, err := factory.Bridge(callOpts)
bridgeAddr, err := factory.BRIDGE(callOpts)
require.NoError(t, err)
require.Equal(t, predeploys.DevL1StandardBridgeAddr, bridgeAddr)
......
......@@ -226,21 +226,19 @@ OptimismMintableERC20_Test:test_legacy_succeeds() (gas: 14344)
OptimismMintableERC20_Test:test_mint_notBridge_reverts() (gas: 11121)
OptimismMintableERC20_Test:test_mint_succeeds() (gas: 63609)
OptimismMintableERC20_Test:test_remoteToken_succeeds() (gas: 7622)
OptimismMintableTokenFactory_Test:test_bridge_succeeds() (gas: 7577)
OptimismMintableTokenFactory_Test:test_createStandardL2Token_remoteIsZero_succeeds() (gas: 9413)
OptimismMintableTokenFactory_Test:test_createStandardL2Token_sameTwice_succeeds() (gas: 2176713)
OptimismMintableTokenFactory_Test:test_createStandardL2Token_succeeds() (gas: 1095296)
OptimismMintableTokenFactory_Test:test_bridge_succeeds() (gas: 7602)
OptimismMintableTokenFactory_Test:test_createStandardL2Token_remoteIsZero_succeeds() (gas: 9390)
OptimismMintableTokenFactory_Test:test_createStandardL2Token_sameTwice_succeeds() (gas: 2176667)
OptimismMintableTokenFactory_Test:test_createStandardL2Token_succeeds() (gas: 1095273)
OptimismMintableERC721_Test:test_burn_notBridge_reverts() (gas: 136922)
OptimismMintableERC721_Test:test_burn_succeeds() (gas: 118779)
OptimismMintableERC721_Test:test_constructor_succeeds() (gas: 24162)
OptimismMintableERC721_Test:test_safeMint_notBridge_reverts() (gas: 11142)
OptimismMintableERC721_Test:test_safeMint_succeeds() (gas: 140502)
OptimismMintableERC721_Test:test_tokenURI_succeeds() (gas: 163420)
OptimismMintableERC721Factory_Test:test_constructor_succeeds() (gas: 10005)
OptimismMintableERC721Factory_Test:test_constructor_zeroBridge_reverts() (gas: 39114)
OptimismMintableERC721Factory_Test:test_constructor_zeroRemoteChainId_reverts() (gas: 41287)
OptimismMintableERC721Factory_Test:test_createOptimismMintableERC721_succeeds() (gas: 2276374)
OptimismMintableERC721Factory_Test:test_createOptimismMintableERC721_zeroRemoteToken_reverts() (gas: 9373)
OptimismMintableERC721Factory_Test:test_constructor_succeeds() (gas: 8262)
OptimismMintableERC721Factory_Test:test_createOptimismMintableERC721_succeeds() (gas: 2276440)
OptimismMintableERC721Factory_Test:test_createOptimismMintableERC721_zeroRemoteToken_reverts() (gas: 9395)
OptimismPortalUpgradeable_Test:test_initialize_cannotInitImpl_reverts() (gas: 10791)
OptimismPortalUpgradeable_Test:test_initialize_cannotInitProxy_reverts() (gas: 15833)
OptimismPortalUpgradeable_Test:test_params_initValuesOnProxy_succeeds() (gas: 16011)
......
......@@ -13,6 +13,8 @@ import { FeeVault } from "../universal/FeeVault.sol";
contract BaseFeeVault is FeeVault, Semver {
/**
* @custom:semver 0.0.1
*
* @param _recipient Address that will receive the accumulated fees.
*/
constructor(address _recipient) FeeVault(_recipient, 10 ether) Semver(0, 0, 1) {}
}
......@@ -13,6 +13,8 @@ import { FeeVault } from "../universal/FeeVault.sol";
contract L1FeeVault is FeeVault, Semver {
/**
* @custom:semver 0.0.1
*
* @param _recipient Address that will receive the accumulated fees.
*/
constructor(address _recipient) FeeVault(_recipient, 10 ether) Semver(0, 0, 1) {}
}
......@@ -32,6 +32,8 @@ contract SequencerFeeVaultLegacySpacer {
contract SequencerFeeVault is SequencerFeeVaultLegacySpacer, FeeVault, Semver {
/**
* @custom:semver 0.0.1
*
* @param _recipient Address that will receive the accumulated fees.
*/
constructor(address _recipient) FeeVault(_recipient, 10 ether) Semver(0, 0, 1) {}
......
......@@ -17,7 +17,7 @@ contract OptimismMintableTokenFactory_Test is Bridge_Initializer {
}
function test_bridge_succeeds() external {
assertEq(address(L2TokenFactory.bridge()), address(L2Bridge));
assertEq(address(L2TokenFactory.BRIDGE()), address(L2Bridge));
}
function test_createStandardL2Token_succeeds() external {
......
......@@ -27,22 +27,10 @@ contract OptimismMintableERC721Factory_Test is ERC721Bridge_Initializer {
}
function test_constructor_succeeds() external {
assertEq(factory.bridge(), address(L2Bridge));
assertEq(factory.remoteChainId(), 1);
assertEq(factory.BRIDGE(), address(L2Bridge));
assertEq(factory.REMOTE_CHAIN_ID(), 1);
}
function test_constructor_zeroBridge_reverts() external {
vm.expectRevert("OptimismMintableERC721Factory: bridge cannot be address(0)");
new OptimismMintableERC721Factory(address(0), 1);
}
function test_constructor_zeroRemoteChainId_reverts() external {
vm.expectRevert("OptimismMintableERC721Factory: remote chain id cannot be zero");
new OptimismMintableERC721Factory(address(L2Bridge), 0);
}
function test_createOptimismMintableERC721_succeeds() external {
// Predict the address based on the factory address and nonce.
address predicted = LibRLP.computeAddress(address(factory), 1);
......
......@@ -6,11 +6,16 @@ import { Predeploys } from "../libraries/Predeploys.sol";
/**
* @title FeeVault
* @notice The FeeVault contract has the base logic for handling transaction fees.
* @notice The FeeVault contract contains the basic logic for the various different vault contracts
* used to hold fee revenue generated by the L2 system.
*/
abstract contract FeeVault {
/**
* @notice Emits each time that a withdrawal occurs
* @notice Emits each time that a withdrawal occurs.
*
* @param value Amount that was withdrawn (in wei).
* @param to Address that the funds were sent to.
* @param from Address that triggered the withdrawal.
*/
event Withdrawal(uint256 value, address to, address from);
......@@ -30,9 +35,8 @@ abstract contract FeeVault {
uint256 public totalProcessed;
/**
* @param _recipient - The L1 account that funds can be withdrawn to.
* @param _minWithdrawalAmount - The min amount of funds before a withdrawal
* can be triggered.
* @param _recipient Wallet that will receive the fees on L1.
* @param _minWithdrawalAmount Minimum balance before a withdrawal can be triggered.
*/
constructor(address _recipient, uint256 _minWithdrawalAmount) {
MIN_WITHDRAWAL_AMOUNT = _minWithdrawalAmount;
......
......@@ -50,16 +50,6 @@ contract OptimismMintableERC20Factory is Semver {
BRIDGE = _bridge;
}
/**
* @custom:legacy
* @notice Legacy getter for StandardBridge address.
*
* @return Address of the StandardBridge on this chain.
*/
function bridge() external view returns (address) {
return BRIDGE;
}
/**
* @custom:legacy
* @notice Creates an instance of the OptimismMintableERC20 contract. Legacy version of the
......
......@@ -41,41 +41,13 @@ contract OptimismMintableERC721Factory is Semver {
* @custom:semver 1.0.0
*
* @param _bridge Address of the ERC721 bridge on this network.
* @param _remoteChainId Chain ID for the remote network.
*/
constructor(address _bridge, uint256 _remoteChainId) Semver(1, 0, 0) {
require(
_bridge != address(0),
"OptimismMintableERC721Factory: bridge cannot be address(0)"
);
require(
_remoteChainId != 0,
"OptimismMintableERC721Factory: remote chain id cannot be zero"
);
BRIDGE = _bridge;
REMOTE_CHAIN_ID = _remoteChainId;
}
/**
* @custom:legacy
* @notice Legacy getter for ERC721 bridge address.
*
* @return Address of the ERC721 bridge on this network.
*/
function bridge() external view returns (address) {
return BRIDGE;
}
/**
* @custom:legacy
* @notice Legacy getter for remote chain ID.
*
* @notice Chain ID for the remote network.
*/
function remoteChainId() external view returns (uint256) {
return REMOTE_CHAIN_ID;
}
/**
* @notice Creates an instance of the standard ERC721.
*
......
......@@ -264,7 +264,7 @@ const deployFn: DeployFunction = async (hre) => {
// Check OptimismMintableERC20Factory was initialized properly.
await assertContractVariable(
OptimismMintableERC20Factory,
'bridge',
'BRIDGE',
L1StandardBridge.address
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment