Platform: Code4rena
Start Date: 04/01/2023
Pot Size: $60,500 USDC
Total HM: 15
Participants: 105
Period: 5 days
Judge: gzeon
Total Solo HM: 1
Id: 200
League: ETH
Rank: 93/105
Findings: 1
Award: $36.50
π Selected for report: 0
π Solo Findings: 0
π Selected for report: 0xSmartContract
Also found by: 0x1f8b, 0xAgro, 0xdeadbeef0x, 0xhacksmithh, 2997ms, Atarpara, Bnke0x0, Diana, HE1M, IllIllI, Josiah, Kalzak, Lirios, MalfurionWhitehat, MyFDsYours, Raiders, RaymondFam, Rolezn, SaharDevep, Sathish9098, Udsen, Viktor_Cortess, adriro, ast3ros, betweenETHlines, btk, chaduke, chrisdior4, cryptostellar5, csanuragjain, giovannidisiena, gz627, hl_, horsefacts, joestakey, juancito, ladboy233, lukris02, nadin, oyc_109, pauliax, peanuts, prady, sorrynotsorry, zaskoh
36.5015 USDC - $36.50
Old version of Solidity is used 0.8.12, newer version can be used 0.8.17
scw-contracts/contracts/smart-contract-wallet/aa-4337/utils/Exec.sol
scw-contracts/contracts/smart-contract-wallet/paymasters/BasePaymaster.sol scw-contracts/contracts/smart-contract-wallet/aa-4337/core/SenderCreator.sol scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IAccount.sol scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IAggregatedAccount.sol scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IEntryPoint.sol scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IPaymaster.sol scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/IStakeManager.sol scw-contracts/contracts/smart-contract-wallet/aa-4337/interfaces/UserOperation.sol scw-contracts/contracts/smart-contract-wallet/aa-4337/utils/Exec.sol
The current form of relative path import is not recommended for use because it can unpredictably pollute the namespace. Instead, the Solidity docs recommend specifying imported symbols explicitly.
There are some automated tools that will flag a project as having higher complexity if there is inline-assembly, so itβs best to avoid using it where itβs not necessary
144: scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol
assembly{ id := chainid() } => uint256 id = block.chainid
Recommend considering implementing a two step process where the owner or admin nominates an account and the nominated account needs to call an acceptOwnership() function for the transfer of ownership to fully succeed. This ensures the nominated EOA account is a valid and active account.
scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol
scw-contracts/contracts/smart-contract-wallet/base/ModuleManager.sol
34,49: require(module != address(0) && module != SENTINEL_MODULES, "BSA101");
If the intention is for the Ether to be used, the function should call another function, otherwise it should revert
scw-contracts/contracts/smart-contract-wallet/SmartAccount.sol scw-contracts/contracts/smart-contract-wallet/SmartAccountNoAuth.sol
scw-contracts/contracts/smart-contract-wallet/aa-4337/core/EntryPoint.sol 261-272:
function _createSenderIfNeeded(uint256 opIndex, UserOpInfo memory opInfo, bytes calldata initCode) internal { if (initCode.length != 0) { address sender = opInfo.mUserOp.sender; if (sender.code.length != 0) revert FailedOp(opIndex, address(0), "AA10 sender already constructed"); address sender1 = senderCreator.createSender{gas : opInfo.mUserOp.verificationGasLimit}(initCode); if (sender1 == address(0)) revert FailedOp(opIndex, address(0), "AA13 initCode failed or OOG"); if (sender1 != sender) revert FailedOp(opIndex, address(0), "AA14 initCode must return sender"); if (sender1.code.length == 0) revert FailedOp(opIndex, address(0), "AA15 initCode must create sender"); address factory = address(bytes20(initCode[0 : 20])); emit AccountDeployed(opInfo.userOpHash, sender, factory, opInfo.mUserOp.paymaster); } }
#0 - c4-judge
2023-01-22T15:42:09Z
gzeon-c4 marked the issue as grade-b
#1 - c4-sponsor
2023-02-09T12:27:39Z
livingrockrises marked the issue as sponsor confirmed