Skip to content

Commit

Permalink
Simplifying contracts and versions
Browse files Browse the repository at this point in the history
  • Loading branch information
eloi010 committed Nov 13, 2023
1 parent f27f454 commit 6494760
Show file tree
Hide file tree
Showing 47 changed files with 41 additions and 3,095 deletions.
3 changes: 1 addition & 2 deletions contracts/core/BaseOpenfortAccount.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity =0.8.19;

import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {Ownable2StepUpgradeable} from "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";
Expand All @@ -14,7 +14,6 @@ import "account-abstraction/core/Helpers.sol" as Helpers;

/**
* @title BaseOpenfortAccount (Non-upgradeable)
* @author Eloi<[email protected]>
* @notice Minimal smart contract wallet with session keys following the ERC-4337 standard.
* It inherits from:
* - BaseAccount to comply with ERC-4337
Expand Down
3 changes: 1 addition & 2 deletions contracts/core/eip6551/EIP6551OpenfortAccount.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity =0.8.19;

import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import {ECDSAUpgradeable} from "@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol";
Expand All @@ -16,7 +16,6 @@ import "account-abstraction/core/Helpers.sol" as Helpers;

/**
* @title EIP6551OpenfortAccount (Non-upgradeable)
* @author Eloi<[email protected]>
* @notice Smart contract wallet with session keys following the ERC-4337 and EIP-6551 standards.
* It inherits from:
* - BaseAccount to comply with ERC-4337
Expand Down
2 changes: 1 addition & 1 deletion contracts/core/eip6551/interfaces/IERC6551Account.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity =0.8.19;

/// @dev the ERC-165 identifier for this interface is `0x400a0398`
interface IERC6551Account {
Expand Down
2 changes: 1 addition & 1 deletion contracts/core/eip6551/utils/Bytecode.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity =0.8.19;

library Bytecode {
error InvalidCodeAtRange(uint256 _size, uint256 _start, uint256 _end);
Expand Down
3 changes: 1 addition & 2 deletions contracts/core/managed/ManagedOpenfortAccount.sol
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity =0.8.19;

// Base account contract to inherit from and EntryPoint interface
import {BaseOpenfortAccount, IEntryPoint} from "../BaseOpenfortAccount.sol";

/**
* @title ManagedOpenfortAccount (Upgradeable via Beacon)
* @author Eloi<[email protected]>
* @notice Smart contract wallet managed via Beacon with session keys following the ERC-4337 standard.
* It inherits from:
* - BaseOpenfortAccount
Expand Down
3 changes: 1 addition & 2 deletions contracts/core/managed/ManagedOpenfortFactory.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity =0.8.19;

import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";
import {UpgradeableBeacon} from "@openzeppelin/contracts/proxy/beacon/UpgradeableBeacon.sol";
Expand All @@ -14,7 +14,6 @@ import {IEntryPoint} from "account-abstraction/interfaces/IEntryPoint.sol";

/**
* @title ManagedOpenfortFactory (Non-upgradeable)
* @author Eloi<[email protected]>
* @notice Contract to create an on-chain factory to deploy new ManagedOpenfortAccounts.
* It uses OpenZeppelin's Create2 and OpenfortBeaconProxy libraries.
* It inherits from:
Expand Down
3 changes: 1 addition & 2 deletions contracts/core/managed/OpenfortBeaconProxy.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity =0.8.19;

import {BeaconProxy} from "@openzeppelin/contracts/proxy/beacon/BeaconProxy.sol";

/**
* @title OpenfortBeaconProxy (Non-upgradeable)
* @author Eloi<[email protected]>
* @notice Contract to create the Beacon to determine implementation contract, which is where they will delegate all function calls.
* It inherits from:
* - BeaconProxy
Expand Down
3 changes: 1 addition & 2 deletions contracts/core/recoverable/OpenfortRecoverableProxy.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity =0.8.19;

import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";

/**
* @title OpenfortRecoverableProxy
* @author Eloi<[email protected]>
* @notice Contract to create the proxies
* It inherits from:
* - ERC1967Proxy
Expand Down
3 changes: 1 addition & 2 deletions contracts/core/recoverable/RecoverableOpenfortAccount.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity =0.8.19;

// Base account contract to inherit from and EntryPoint interface
import {BaseOpenfortAccount, IEntryPoint, SafeCastUpgradeable, ECDSAUpgradeable} from "../BaseOpenfortAccount.sol";
Expand All @@ -8,7 +8,6 @@ import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";

/**
* @title RecoverableOpenfortAccount
* @author Eloi<[email protected]>
* @notice Openfort account with session keys, guardians and pausability following the ERC-4337 standard.
* It inherits from:
* - BaseOpenfortAccount
Expand Down
3 changes: 1 addition & 2 deletions contracts/core/recoverable/RecoverableOpenfortFactory.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity =0.8.19;

import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";
// Smart wallet implementation to use
Expand All @@ -10,7 +10,6 @@ import {IBaseOpenfortFactory} from "../../interfaces/IBaseOpenfortFactory.sol";

/**
* @title RecoverableOpenfortFactory (Non-upgradeable)
* @author Eloi<[email protected]>
* @notice Contract to create an on-chain factory to deploy new RecoverableOpenfortAccounts.
* It uses OpenZeppelin's Create2 and OpenfortRecoverableProxy libraries.
* It inherits from:
Expand Down
50 changes: 0 additions & 50 deletions contracts/core/static/StaticOpenfortAccount.sol

This file was deleted.

64 changes: 0 additions & 64 deletions contracts/core/static/StaticOpenfortFactory.sol

This file was deleted.

3 changes: 1 addition & 2 deletions contracts/core/upgradeable/OpenfortUpgradeableProxy.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity =0.8.19;

import {ERC1967Proxy} from "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol";

/**
* @title OpenfortUpgradeableProxy (Non-upgradeable)
* @author Eloi<[email protected]>
* @notice Contract to create the proxies
* It inherits from:
* - ERC1967Proxy
Expand Down
3 changes: 1 addition & 2 deletions contracts/core/upgradeable/UpgradeableOpenfortAccount.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity =0.8.19;

// Base account contract to inherit from and EntryPoint interface
import {BaseOpenfortAccount, IEntryPoint} from "../BaseOpenfortAccount.sol";
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";

/**
* @title UpgradeableOpenfortAccount
* @author Eloi<[email protected]>
* @notice Minimal smart contract wallet with session keys following the ERC-4337 standard.
* It inherits from:
* - BaseOpenfortAccount
Expand Down
3 changes: 1 addition & 2 deletions contracts/core/upgradeable/UpgradeableOpenfortFactory.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity =0.8.19;

import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";
// Smart wallet implementation to use
Expand All @@ -10,7 +10,6 @@ import {IBaseOpenfortFactory} from "../../interfaces/IBaseOpenfortFactory.sol";

/**
* @title UpgradeableOpenfortFactory (Non-upgradeable)
* @author Eloi<[email protected]>
* @notice Contract to create an on-chain factory to deploy new UpgradeableOpenfortAccounts.
* It uses OpenZeppelin's Create2 and OpenfortUpgradeableProxy libraries.
* It inherits from:
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/IBaseOpenfortFactory.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity =0.8.19;

interface IBaseOpenfortFactory {
/// @notice Emitted when a new Account is created.
Expand Down
2 changes: 1 addition & 1 deletion contracts/interfaces/OpenfortErrorsAndEvents.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity =0.8.19;

interface OpenfortErrorsAndEvents {
/// @notice Error when a parameter is 0.
Expand Down
3 changes: 1 addition & 2 deletions contracts/mock/MockedV2ManagedOpenfortAccount.sol
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity =0.8.19;

// Base account contract to inherit from
import {BaseOpenfortAccount, IEntryPoint} from "../core/BaseOpenfortAccount.sol";

/**
* @title ManagedOpenfortAccount (Upgradeable via Beacon)
* @author Eloi<[email protected]>
* @notice Smart contract wallet managed via Beacon with session keys following the ERC-4337 standard.
* It inherits from:
* - BaseOpenfortAccount
Expand Down
3 changes: 1 addition & 2 deletions contracts/mock/MockedV2UpgradeableOpenfortAccount.sol
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity =0.8.19;

// Base account contract to inherit from
import {BaseOpenfortAccount, IEntryPoint} from "../core/BaseOpenfortAccount.sol";
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";

/**
* @title MockedV2UpgradeableOpenfortAccount
* @author Eloi<[email protected]>
* @notice Minimal smart contract wallet with session keys following the ERC-4337 standard.
* It inherits from:
* - BaseOpenfortAccount
Expand Down
2 changes: 1 addition & 1 deletion contracts/mock/Rewards.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity =0.8.19;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

Expand Down
5 changes: 3 additions & 2 deletions contracts/mock/SimpleNFT.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;
pragma solidity =0.8.19;

/* solhint-disable reason-string */
/* solhint-disable no-empty-blocks */

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";

// A simple ERC721 contract
contract SimpleNFT is ERC721 {
Expand Down
2 changes: 1 addition & 1 deletion contracts/mock/USDC.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity =0.8.19;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";

Expand Down
2 changes: 1 addition & 1 deletion contracts/mock/VipNFT.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: GPL-3.0
pragma solidity ^0.8.19;
pragma solidity =0.8.19;

import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";

Expand Down
Loading

0 comments on commit 6494760

Please sign in to comment.