From 7c01332b5dbbefb6ce8c3c8fcb42f2522de88ba9 Mon Sep 17 00:00:00 2001 From: Kelvin Fichter Date: Fri, 9 Apr 2021 15:51:39 -0700 Subject: [PATCH] cleanup: Remove mockOVM_ECDSAContractAccount --- .../accounts/mockOVM_ECDSAContractAccount.sol | 95 ------------------- src/contract-deployment/config.ts | 3 - src/contract-dumps.ts | 1 - 3 files changed, 99 deletions(-) delete mode 100644 contracts/optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol diff --git a/contracts/optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol b/contracts/optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol deleted file mode 100644 index 15c51fcf2..000000000 --- a/contracts/optimistic-ethereum/mockOVM/accounts/mockOVM_ECDSAContractAccount.sol +++ /dev/null @@ -1,95 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity >0.5.0 <0.8.0; -pragma experimental ABIEncoderV2; - -/* Interface Imports */ -import { iOVM_ECDSAContractAccount } from "../../iOVM/accounts/iOVM_ECDSAContractAccount.sol"; - -/* Library Imports */ -import { Lib_OVMCodec } from "../../libraries/codec/Lib_OVMCodec.sol"; -import { Lib_ECDSAUtils } from "../../libraries/utils/Lib_ECDSAUtils.sol"; -import { Lib_SafeExecutionManagerWrapper } from "../../libraries/wrappers/Lib_SafeExecutionManagerWrapper.sol"; - -/** - * @title mockOVM_ECDSAContractAccount - */ -contract mockOVM_ECDSAContractAccount is iOVM_ECDSAContractAccount { - - /******************** - * Public Functions * - ********************/ - - /** - * Executes a signed transaction. - * @param _transaction Signed EOA transaction. - * @param _signatureType Hashing scheme used for the transaction (e.g., ETH signed message). - * param _v Signature `v` parameter. - * param _r Signature `r` parameter. - * param _s Signature `s` parameter. - * @return _success Whether or not the call returned (rather than reverted). - * @return _returndata Data returned by the call. - */ - function execute( - bytes memory _transaction, - Lib_OVMCodec.EOASignatureType _signatureType, - uint8, // _v, - bytes32, // _r, - bytes32 // _s - ) - override - public - returns ( - bool _success, - bytes memory _returndata - ) - { - bool isEthSign = _signatureType == Lib_OVMCodec.EOASignatureType.ETH_SIGNED_MESSAGE; - Lib_OVMCodec.EIP155Transaction memory decodedTx = Lib_OVMCodec.decodeEIP155Transaction(_transaction, isEthSign); - - // Need to make sure that the transaction nonce is right. - Lib_SafeExecutionManagerWrapper.safeREQUIRE( - decodedTx.nonce == Lib_SafeExecutionManagerWrapper.safeGETNONCE(), - "Transaction nonce does not match the expected nonce." - ); - - // Contract creations are signalled by sending a transaction to the zero address. - if (decodedTx.to == address(0)) { - (address created, ) = Lib_SafeExecutionManagerWrapper.safeCREATE( - decodedTx.gasLimit, - decodedTx.data - ); - - // If the created address is the ZERO_ADDRESS then we know the deployment failed, though not why - return (created != address(0), abi.encode(created)); - } else { - // We only want to bump the nonce for `ovmCALL` because `ovmCREATE` automatically bumps - // the nonce of the calling account. Normally an EOA would bump the nonce for both - // cases, but since this is a contract we'd end up bumping the nonce twice. - Lib_SafeExecutionManagerWrapper.safeINCREMENTNONCE(); - - return Lib_SafeExecutionManagerWrapper.safeCALL( - decodedTx.gasLimit, - decodedTx.to, - decodedTx.data - ); - } - } - - function qall( - uint256 _gasLimit, - address _to, - bytes memory _data - ) - public - returns ( - bool _success, - bytes memory _returndata - ) - { - return Lib_SafeExecutionManagerWrapper.safeCALL( - _gasLimit, - _to, - _data - ); - } -} diff --git a/src/contract-deployment/config.ts b/src/contract-deployment/config.ts index 5ddfc87b8..64b662ec1 100644 --- a/src/contract-deployment/config.ts +++ b/src/contract-deployment/config.ts @@ -225,9 +225,6 @@ export const makeContractDeployConfig = async ( OVM_ProxySequencerEntrypoint: { factory: getContractFactory('OVM_ProxySequencerEntrypoint'), }, - mockOVM_ECDSAContractAccount: { - factory: getContractFactory('mockOVM_ECDSAContractAccount'), - }, OVM_BondManager: { factory: getContractFactory('mockOVM_BondManager'), params: [AddressManager.address], diff --git a/src/contract-dumps.ts b/src/contract-dumps.ts index 697f35f12..3ae9a2be6 100644 --- a/src/contract-dumps.ts +++ b/src/contract-dumps.ts @@ -153,7 +153,6 @@ export const makeStateDump = async (cfg: RollupDeployConfig): Promise => { 'OVM_ExecutionManager', 'OVM_StateManager', 'OVM_ETH', - 'mockOVM_ECDSAContractAccount', ], deployOverrides: {}, waitForReceipts: false,