Skip to content

Commit

Permalink
rebrand soulwallet to Elytro
Browse files Browse the repository at this point in the history
  • Loading branch information
davidinsuomi committed Oct 24, 2024
1 parent fc7cc08 commit ad4b055
Show file tree
Hide file tree
Showing 51 changed files with 429 additions and 450 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: test
on:
push:
branches:
- '*'
- "*"
pull_request:
types: [opened, reopened, synchronize]

Expand All @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: true

name: SoulWallet Contract
name: Elytro Contract
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -36,4 +36,4 @@ jobs:
- name: Run Forge tests
run: |
forge test -vvv
id: test
id: test
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<div align="center">
<h1 align="center">SoulWallet Contracts [draft version]</h1>
<h1 align="center">Elytro Contracts [Formerly SoulWallet Contracts]</h1>
</div>

<div align="center">
<img src="https://github.com/SoulWallet/soul-wallet-contract/assets/1399563/8678c33d-2e86-4cd8-99b3-4a856e8ee60e">
<img src="./logo.png">
</div>

## Features
Expand All @@ -13,11 +13,11 @@
- Upgradability: The smart contract for this wallet can be upgraded in a secure way to add new features or fix vulnerabilities in the future.
- Stablecoin pay gas: Users can pay transaction gas fees with stablecoins such as USDC, USDT, DAI, etc.

## Architecutre
## Architecture

The smart contract comprises three main logic components:

1. SoulWallet Core:
1.Elytro Core:

- This is the primary wallet logic.
- Supports the ERC4337 interface.
Expand All @@ -36,7 +36,7 @@ The smart contract comprises three main logic components:

## Repository Structure

All contracts are held within the `soul-wallet-contract/contracts` folder.
All contracts are held within the `Elytro-wallet-contract/contracts` folder.

```
contracts
Expand Down Expand Up @@ -69,7 +69,7 @@ npm run test

## Integration

Third parties can build new modules/plugins on top of SoulWallet to add additional functionality.
Third parties can build new modules/plugins on top of Elytro to add additional functionality.

### Module

Expand Down
24 changes: 10 additions & 14 deletions bug-bounty.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Soul Wallet Bug Bounty Program
# Elytro Wallet Bug Bounty Program

## Overview

As of August 20th, 2024, the [soulwallet-core](https://github.com/Soulwallet/soulwallet-core) and [soul-wallet-contract](https://github.com/SoulWallet/soul-wallet-contract) repositories are included in the Soulwallet Bug Bounty Program (the Program) to encourage the responsible disclosure of vulnerabilities.
The [soulwallet-core](https://github.com/Soulwallet/soulwallet-core) and [elytro-wallet-contract](https://github.com/SoulWallet/Elytro-wallet-contract) repositories are included in the Elytro Bug Bounty Program (the "Program") to encourage the responsible disclosure of vulnerabilities.

The Program is focused exclusively on critical and high-severity bugs, with rewards of up to $50,000. Good luck and happy hunting!

Expand All @@ -22,15 +22,11 @@ The Program is limited to bugs that fall under the following categories:
- Temporary freezing of funds
- Temporary freezing of NFTs

**Temporary Exclusion**

- We are aware of issues related to `FCL_elliptic.sol` and are currently working on modifications. Until these modifications are completed, we will not be accepting bug submissions related to `FCL_elliptic.sol`. Thank you for your understanding.

The following items are not covered under this Program:

- Any contract found under the `contracts/test` directory.
- Bugs in any third-party contracts or platforms interacting with Soulwallet.
- Issues already reported or discovered in contracts created by third parties on Soulwallet.
- Bugs in any third-party contracts or platforms interacting with Elytro.
- Issues already reported or discovered in contracts created by third parties on Elytro.
- Previously reported vulnerabilities.

Additionally, vulnerabilities depending on any of the following are also excluded from this Program:
Expand All @@ -44,7 +40,7 @@ Additionally, vulnerabilities depending on any of the following are also exclude

## Rewards

Rewards will be determined based on the severity of the reported bug and will be assessed and allocated at the discretion of the Soulwallet team. For critical vulnerabilities that could result in user fund losses, rewards of up to $50,000 may be awarded. Lower severity issues will be rewarded at the team's discretion.
Rewards will be determined based on the severity of the reported bug and will be assessed and allocated at the discretion of the Elytro team. For critical vulnerabilities that could result in user fund losses, rewards of up to $50,000 may be awarded. Lower severity issues will be rewarded at the team's discretion.

## Reward Calculation for High-Level Reports

Expand All @@ -61,7 +57,7 @@ All other impacts classified as Critical will receive a flat reward of USD $5,00

All discovered vulnerabilities must be reported exclusively to the following email: [[email protected]](mailto:[email protected]).

The vulnerability must not be publicly disclosed or shared with anyone else until Soulwallet has been informed, the issue has been resolved, and permission for public disclosure has been granted. Furthermore, disclosure must occur within 24 hours of discovering the vulnerability.
The vulnerability must not be publicly disclosed or shared with anyone else until Elytro has been informed, the issue has been resolved, and permission for public disclosure has been granted. Furthermore, disclosure must occur within 24 hours of discovering the vulnerability.

A detailed report of the vulnerability increases the likelihood of receiving a reward and may lead to a higher reward amount. Please include as much information as possible about the vulnerability, such as:

Expand All @@ -75,19 +71,19 @@ Anyone who reports a unique, previously undisclosed vulnerability that results i

To qualify for a reward under this Program, you must:

- Be the first to disclose the unique vulnerability to [[email protected]](mailto:[email protected]), in accordance with the disclosure requirements above. If similar vulnerabilities are reported within the same 24-hour period, rewards will be divided at Soulwallet's discretion.
- Be the first to disclose the unique vulnerability to [[email protected]](mailto:[email protected]), in accordance with the disclosure requirements above. If similar vulnerabilities are reported within the same 24-hour period, rewards will be divided at Elytro's discretion.
- Provide sufficient information for our engineers to reproduce and fix the vulnerability.
- Not engage in any unlawful conduct when disclosing the bug, including through threats, demands, or other coercive tactics.
- Not exploit the vulnerability in any way, including making it public or profiting from it (other than receiving a reward under this Program).
- Make a good faith effort to avoid privacy violations, data destruction, or interruption or degradation of Soulwallet.
- Make a good faith effort to avoid privacy violations, data destruction, or interruption or degradation of Elytro.
- Submit only one vulnerability per report, unless it is necessary to chain vulnerabilities to demonstrate impact.
- Not submit a vulnerability caused by an underlying issue that has already been rewarded under this Program.
- Not be a current or former employee, vendor, or contractor of Soulwallet, or an employee of any of our vendors or contractors.
- Not be a current or former employee, vendor, or contractor of Elytro, or an employee of any of our vendors or contractors.
- Not be subject to U.S. sanctions or reside in a U.S.-embargoed country.
- Be at least 18 years old or, if younger, submit the vulnerability with the consent of a parent or guardian.

## Other Terms

By submitting a report, you grant Soulwallet all rights necessary, including intellectual property rights, to validate, mitigate, and disclose the vulnerability. All reward decisions, including eligibility and amounts of rewards and the method of payment, are at our sole discretion.
By submitting a report, you grant Elytro all rights necessary, including intellectual property rights, to validate, mitigate, and disclose the vulnerability. All reward decisions, including eligibility and amounts of rewards and the method of payment, are at our sole discretion.

The terms and conditions of this Program may be changed at any time.
24 changes: 12 additions & 12 deletions contracts/SoulWallet.sol → contracts/Elytro.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,30 @@ import {IERC1271} from "@openzeppelin/contracts/interfaces/IERC1271.sol";
import {Errors} from "./libraries/Errors.sol";
import {Initializable} from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import "./abstract/ERC1271Handler.sol";
import {SoulWalletOwnerManager} from "./abstract/SoulWalletOwnerManager.sol";
import {SoulWalletModuleManager} from "./abstract/SoulWalletModuleManager.sol";
import {SoulWalletHookManager} from "./abstract/SoulWalletHookManager.sol";
import {SoulWalletUpgradeManager} from "./abstract/SoulWalletUpgradeManager.sol";
import {ElytroOwnerManager} from "./abstract/ElytroOwnerManager.sol";
import {ElytroModuleManager} from "./abstract/ElytroModuleManager.sol";
import {ElytroHookManager} from "./abstract/ElytroHookManager.sol";
import {ElytroUpgradeManager} from "./abstract/ElytroUpgradeManager.sol";

/**
* @title SoulWallet
* @dev This contract is the main entry point for the SoulWallet. It implements the IAccount and IERC1271 interfaces,
* @title Elytro
* @dev This contract is the main entry point for the Elytro. It implements the IAccount and IERC1271 interfaces,
* and is compatible with the ERC-4337 standard.
* It inherits from multiple base contracts and managers to provide the core functionality of the wallet.
* This includes managing entry points, owners, modules, hooks, and upgrades, as well as handling ERC1271 signatures and providing a fallback function.
*/
contract SoulWallet is
contract Elytro is
Initializable,
IAccount,
IERC1271,
EntryPointManager,
SoulWalletOwnerManager,
SoulWalletModuleManager,
SoulWalletHookManager,
ElytroOwnerManager,
ElytroModuleManager,
ElytroHookManager,
StandardExecutor,
ValidatorManager,
FallbackManager,
SoulWalletUpgradeManager,
ElytroUpgradeManager,
ERC1271Handler
{
string public constant VERSION = "1.1.0";
Expand All @@ -46,7 +46,7 @@ contract SoulWallet is
}

/**
* @notice Initializes the SoulWallet contract
* @notice Initializes the Elytro contract
* @dev This function can only be called once. It sets the initial owners, default callback handler, modules, and hooks.
*/
function initialize(
Expand Down
4 changes: 2 additions & 2 deletions contracts/abstract/ERC1271Handler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ abstract contract ERC1271Handler is Authority {
// Constants indicating different invalid states
bytes4 internal constant INVALID_ID = 0xffffffff;

bytes32 private constant SOUL_WALLET_MSG_TYPEHASH = keccak256("SoulWalletMessage(bytes32 message)");
bytes32 private constant ELYTRO_WALLET_MSG_TYPEHASH = keccak256("ElytroMessage(bytes32 message)");

bytes32 private constant DOMAIN_SEPARATOR_TYPEHASH =
keccak256("EIP712Domain(uint256 chainId,address verifyingContract)");

function _encodeRawHash(bytes32 rawHash) internal view returns (bytes32) {
bytes32 encode1271MessageHash = keccak256(abi.encode(SOUL_WALLET_MSG_TYPEHASH, rawHash));
bytes32 encode1271MessageHash = keccak256(abi.encode(ELYTRO_WALLET_MSG_TYPEHASH, rawHash));
bytes32 domainSeparator = keccak256(abi.encode(DOMAIN_SEPARATOR_TYPEHASH, getChainId(), address(this)));
return keccak256(abi.encodePacked(bytes1(0x19), bytes1(0x01), domainSeparator, encode1271MessageHash));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
pragma solidity ^0.8.20;

import {HookManager} from "@soulwallet-core/contracts/base/HookManager.sol";
import {ISoulWalletHookManager} from "../interfaces/ISoulWalletHookManager.sol";
import {IElytroHookManager} from "../interfaces/IElytroHookManager.sol";

abstract contract SoulWalletHookManager is ISoulWalletHookManager, HookManager {
abstract contract ElytroHookManager is IElytroHookManager, HookManager {
function _installHook(bytes calldata hookAndDataWithFlag) internal virtual {
_installHook(
address(bytes20(hookAndDataWithFlag[:20])),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
pragma solidity ^0.8.20;

import {ModuleManager} from "@soulwallet-core/contracts/base/ModuleManager.sol";
import {ISoulWalletModuleManager} from "../interfaces/ISoulWalletModuleManager.sol";
import {ISoulWalletModule} from "../modules/interfaces/ISoulWalletModule.sol";
import {IElytroModuleManager} from "../interfaces/IElytroModuleManager.sol";
import {IElytroModule} from "../modules/interfaces/IElytroModule.sol";
import {Errors} from "../libraries/Errors.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";

abstract contract SoulWalletModuleManager is ISoulWalletModuleManager, ModuleManager {
abstract contract ElytroModuleManager is IElytroModuleManager, ModuleManager {
function installModule(bytes calldata moduleAndData) external override {
pluginManagementAccess();
_addModule(moduleAndData);
Expand All @@ -19,7 +19,7 @@ abstract contract SoulWalletModuleManager is ISoulWalletModuleManager, ModuleMan
*/
function _isSupportsModuleInterface(address moduleAddress) internal view override returns (bool supported) {
bytes memory callData =
abi.encodeWithSelector(IERC165.supportsInterface.selector, type(ISoulWalletModule).interfaceId);
abi.encodeWithSelector(IERC165.supportsInterface.selector, type(IElytroModule).interfaceId);
assembly ("memory-safe") {
// memorySafe: The scratch space between memory offset 0 and 64.
let result := staticcall(gas(), moduleAddress, add(callData, 0x20), mload(callData), 0x00, 0x20)
Expand All @@ -29,7 +29,7 @@ abstract contract SoulWalletModuleManager is ISoulWalletModuleManager, ModuleMan

function _addModule(bytes calldata moduleAndData) internal {
address moduleAddress = address(bytes20(moduleAndData[:20]));
ISoulWalletModule aModule = ISoulWalletModule(moduleAddress);
IElytroModule aModule = IElytroModule(moduleAddress);
bytes4[] memory requiredFunctions = aModule.requiredFunctions();
if (requiredFunctions.length == 0) {
revert Errors.MODULE_SELECTORS_EMPTY();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
pragma solidity ^0.8.20;

import {OwnerManager} from "@soulwallet-core/contracts/base/OwnerManager.sol";
import {ISoulWalletOwnerManager} from "../interfaces/ISoulWalletOwnerManager.sol";
import {IElytroOwnerManager} from "../interfaces/IElytroOwnerManager.sol";

abstract contract SoulWalletOwnerManager is ISoulWalletOwnerManager, OwnerManager {
abstract contract ElytroOwnerManager is IElytroOwnerManager, OwnerManager {
function _addOwners(bytes32[] calldata owners) internal {
for (uint256 i = 0; i < owners.length;) {
_addOwner(owners[i]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ pragma solidity ^0.8.20;
import "../interfaces/IUpgradable.sol";
import "../libraries/Errors.sol";
/**
* @title SoulWalletUpgradeManager
* @title ElytroUpgradeManager
* @dev This contract allows for the logic of a proxy to be upgraded
*/

abstract contract SoulWalletUpgradeManager is IUpgradable {
abstract contract ElytroUpgradeManager is IUpgradable {
/**
* @dev Storage slot with the address of the current implementation
* This is the keccak-256 hash of "eip1967.proxy.implementation" subtracted by 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
pragma solidity ^0.8.20;

import {ValidatorManager} from "@soulwallet-core/contracts/base/ValidatorManager.sol";
import {ISoulWalletValidatorManager} from "../interfaces/ISoulWalletValidatorManager.sol";
import {IElytroValidatorManager} from "../interfaces/IElytroValidatorManager.sol";

abstract contract SoulWalletValidatorManager is ISoulWalletValidatorManager, ValidatorManager {
abstract contract ElytroValidatorManager is IElytroValidatorManager, ValidatorManager {
function installValidator(bytes calldata validatorAndData) external virtual override {
validatorManagementAccess();
_installValidator(address(bytes20(validatorAndData[:20])), validatorAndData[20:]);
Expand Down
6 changes: 3 additions & 3 deletions contracts/dev/NewImplementation.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

pragma solidity ^0.8.20;

import "../abstract/SoulWalletUpgradeManager.sol";
import "../abstract/ElytroUpgradeManager.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";

contract NewImplementation is Initializable, SoulWalletUpgradeManager {
contract NewImplementation is Initializable, ElytroUpgradeManager {
address public immutable WALLETIMPL;
bytes32 public constant CURRENT_UPGRADE_SLOT = keccak256("soul.wallet.upgradeTo_NewImplementation");
bytes32 public constant CURRENT_UPGRADE_SLOT = keccak256("elytro.wallet.upgradeTo_NewImplementation");

constructor() {
WALLETIMPL = address(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@ pragma solidity ^0.8.20;
/* solhint-disable no-inline-assembly */
/* solhint-disable reason-string */

import "../SoulWallet.sol";
import "../Elytro.sol";
import {Create2} from "@openzeppelin/contracts/utils/Create2.sol";
import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

/**
* @title SoulWalletFactory
* @author soulwallet team
* @notice A factory contract to create soul wallets
* @title ElytroFactory
* @author Elytro team
* @notice A factory contract to create elytro wallets
* @dev This contract is called by the entrypoint which uses the "initCode" to create and return the sender's wallet address
*/
contract SoulWalletFactory is Ownable {
contract ElytroFactory is Ownable {
address public immutable _WALLETIMPL;
IEntryPoint public immutable entryPoint;
string public constant VERSION = "0.0.1";

event SoulWalletCreation(address indexed proxy);
event ElytroCreation(address indexed proxy);

/**
* @dev Initializes the factory with the wallet implementation and entry point addresses
* @param _walletImpl Address of the SoulWallet implementation
* @param _walletImpl Address of the Elytro implementation
* @param _entryPoint Address of the EntryPoint contract
* @param _owner Address of the contract owner
*/
Expand All @@ -41,7 +41,7 @@ contract SoulWalletFactory is Ownable {
}

/**
* @dev Deploys the SoulWallet using a proxy and returns the proxy's address
* @dev Deploys the Elytro using a proxy and returns the proxy's address
* @param _initializer Initialization data
* @param _salt Salt for the create2 deployment
* @return proxy Address of the deployed proxy
Expand All @@ -65,12 +65,12 @@ contract SoulWalletFactory is Ownable {
let succ := call(gas(), proxy, 0, add(_initializer, 0x20), mload(_initializer), 0, 0)
if eq(succ, 0) { revert(0, 0) }
}
emit SoulWalletCreation(proxy);
emit ElytroCreation(proxy);
}

/**
* @notice Returns the proxy's creation code
* @dev Used by soulwalletlib to calculate the SoulWallet address
* @dev Used by ElytroLib to calculate the Elytro address
* @return Byte array representing the proxy's creation code
*/
function proxyCode() external view returns (bytes memory) {
Expand All @@ -89,10 +89,10 @@ contract SoulWalletFactory is Ownable {
}

/**
* @notice Calculates the counterfactual address of the SoulWallet as it would be returned by `createWallet`
* @notice Calculates the counterfactual address of the Elytro as it would be returned by `createWallet`
* @param _initializer Initialization data
* @param _salt Salt for the create2 deployment
* @return proxy Counterfactual address of the SoulWallet
* @return proxy Counterfactual address of the Elytro
*/
function getWalletAddress(bytes memory _initializer, bytes32 _salt) public view returns (address proxy) {
bytes memory deploymentData = _proxyCode(_WALLETIMPL);
Expand Down
Loading

0 comments on commit ad4b055

Please sign in to comment.