From 349472afc20d410652d50b29d94ef0d7336f943e Mon Sep 17 00:00:00 2001 From: Saleel Date: Wed, 18 Oct 2023 00:12:33 +0530 Subject: [PATCH] chore: minor fixes, remove unnecesary code --- packages/contracts/src/EmailWalletCore.sol | 34 ++++++++++----------- packages/contracts/src/interfaces/Types.sol | 4 +-- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/packages/contracts/src/EmailWalletCore.sol b/packages/contracts/src/EmailWalletCore.sol index 49cbbdf7..0013dcc8 100644 --- a/packages/contracts/src/EmailWalletCore.sol +++ b/packages/contracts/src/EmailWalletCore.sol @@ -49,6 +49,22 @@ contract EmailWalletCore is EmailWalletEvents, ReentrancyGuard, OwnableUpgradeab // Address of wallet implementation contract - used for deploying wallets for users via proxy address public immutable walletImplementation; + // Max fee per gas in wei that relayer can set in a UserOp + uint256 public immutable maxFeePerGas; + + // Time period until which a email is valid for EmailOp based on the timestamp of the email signature + uint256 public immutable emailValidityDuration; + + // Gas required to claim unclaimed funds. User (their relayer) who register unclaimed funds + // need to lock this amount which is relesed to the relayer who claims it + uint256 public immutable unclaimedFundClaimGas; + + // Gas required to claim unclaimed state + uint256 public immutable unclaimedStateClaimGas; + + // Default expiry duration for unclaimed funds and states + uint256 public immutable unclaimsExpiryDuration; + // Mapping of relayer's wallet address to relayer config mapping(address => RelayerConfig) public relayers; @@ -97,22 +113,6 @@ contract EmailWalletCore is EmailWalletEvents, ReentrancyGuard, OwnableUpgradeab // Mapping of emailAddrCommit to unclaimed state mapping(bytes32 => UnclaimedState) public unclaimedStateOfEmailAddrCommit; - // Max fee per gas in wei that relayer can set in a UserOp - uint256 public immutable maxFeePerGas; - - // Time period until which a email is valid for EmailOp based on the timestamp of the email signature - uint256 public immutable emailValidityDuration; - - // Gas required to claim unclaimed funds. User (their relayer) who register unclaimed funds - // need to lock this amount which is relesed to the relayer who claims it - uint256 public immutable unclaimedFundClaimGas; - - // Gas required to claim unclaimed state - uint256 public immutable unclaimedStateClaimGas; - - // Default expiry duration for unclaimed funds and states - uint256 public immutable unclaimsExpiryDuration; - // Context of currently executing EmailOp - reset on every EmailOp ExecutionContext internal currContext; @@ -587,7 +587,7 @@ contract EmailWalletCore is EmailWalletEvents, ReentrancyGuard, OwnableUpgradeab uint256 expiryTime, uint256 announceCommitRandomness, string memory announceEmailAddr - ) public payable nonReentrant { + ) public payable { if (expiryTime == 0) { expiryTime = block.timestamp + unclaimsExpiryDuration; } diff --git a/packages/contracts/src/interfaces/Types.sol b/packages/contracts/src/interfaces/Types.sol index d1d30899..08d5e827 100644 --- a/packages/contracts/src/interfaces/Types.sol +++ b/packages/contracts/src/interfaces/Types.sol @@ -19,11 +19,11 @@ struct EmailOp { uint256 timestamp; // Timestamp of the email string maskedSubject; // Subject string with email address masked string feeTokenName; // Name of the token to pay the fee - uint256 feePerGas; // Amount of ETH to be charged per gas + uint256 feePerGas; // Amount of wei to be charged per gas bytes executeCallData; // data if the the command is "Execute" address newWalletOwner; // Address of the new owner if the command is "Exit Email Wallet" address newDkimRegistry; // Address of the new dkim registry if the command is "DKIM" - WalletParams walletParams; // Params when command = "Transfer" / "Send" + WalletParams walletParams; // Params when command = "Send" ExtensionParams extensionParams; // Serialized params for the extension based on the template ExtensionManagerParams extManagerParams; // Params when command = "Install Extension" / "Uninstall Extension" bytes emailProof; // ZK Proof of Email receipt