230 Commits

Author SHA1 Message Date
Dror Tirosh
abff2aca61 v0.6.0 (#270)
* v0.6.0
* deployments
2023-04-25 00:53:27 +03:00
Dror Tirosh
e7a2efc8c2 deploy script: deploy factory only on test networks. (#260)
* deploy script: deploy factory only on test networks.
2023-04-24 19:32:00 +03:00
Dror Tirosh
9b5f2e4bb3 AA-159 prevent recursive call into handleOps (#257)
* AA-159 prevent recursive call into handleOps
* added BeforeExecution event
  without this event, all events in validation are attributed to the first UserOperation.
  We can't attribute them to specific UseROp (unless there is exactly one) - but at least not always assign the to the first.
2023-04-09 19:11:40 +03:00
Dror Tirosh
19918cda7c AA-161 validate Nonce in EntryPoint (#247)
* EntryPoint to manage Nonce

- NonceManager to handle 2d nonces
   - _validateAndUpdateNonce() called after validateUserOp
   - getNonce(sender, key)

- remove nonce checking from BaseAccount
- BaseAccount implements getNonce() using ep.getNonce
2023-04-09 18:31:09 +03:00
Dror Tirosh
1b85cfbd46 AA-162 Inconsistent userOpHash (#245)
* Inconsistent userOpHash

As reported in #237, userOpHash might be manipulated by a caller.
While this is not a security vulnerability of any other account, it does
cause inconsistency in the output of external tools such as block explorers.
It might also cause applications that rely on the userOpHash uniqueness to fail

* use UserOp.hash()

* PR comments
2023-04-09 17:32:03 +03:00
Dror Tirosh
bd8e11437d Re-base gascheck (#252)
Change the base for "gascheck"
This is not a change in the contracts, but in the scripts to calculate the gas usage.
The default sample call now calls entryPoint() in the account, which returns a constant (entrypoint) instead of a variable (nonce)
The 2000 extra gas overhead seen results/gas-checker.txt in gas is actually a fix of a mistake: previously, accessing the "nonce" field was attributed to the "exec" call (because we called "nonce()"). Now it is rightfully attributed to the validation, not execution.
2023-03-27 14:10:25 +03:00
Dror Tirosh
f6b4160e54 Merge pull request #244 from VGLoic/fix/wrong-nonce-sig
fix: update invalid nonce method signature in test utils
2023-03-26 15:45:18 +03:00
Dror Tirosh
ad7ce4990b Merge pull request #228 from ququzone/develop
add token callback handler for account
2023-03-21 13:58:12 +02:00
VGLoic
a8d5ff92b7 fix: update invalid nonce method signature in test utils 2023-03-19 18:20:11 +01:00
Dror Tirosh
cedd0f66a1 sync EIP with master repository (#242)
mostly typos (and rename EIP back to ERC where it should)
2023-03-15 22:55:43 +02:00
Xueping Yang
3d97edbc0a Merge branch 'eth-infinitism:develop' into develop 2023-03-02 15:33:56 +08:00
Dror Tirosh
556f03fadc Merge pull request #232 from eth-infinitism/merge-main-conflict
Merge main conflict
2023-03-02 02:32:44 +02:00
Dror Tirosh
750ef609ea Merge branch 'main' into develop 2023-03-01 17:28:41 -07:00
Dror Tirosh
bf0b4cd8fc fix typechain error (#101) (#231) 2023-03-01 17:26:08 -07:00
Dror Tirosh
1ffdbec6a0 audit report 2023-03-02 02:12:14 +02:00
Dror Tirosh
d018c749ce deployments 2023-03-02 02:12:14 +02:00
Dror Tirosh
b18e2333d9 update package version to 0.5 2023-03-02 02:12:14 +02:00
ququzone
68e916520d fix ci-gas-calc fail 2023-02-27 21:23:44 +08:00
ququzone
f5a1eb782e replace hardcode to selector 2023-02-27 05:48:21 +08:00
ququzone
cc14e69cf6 add token callback handler for account 2023-02-24 16:03:25 +08:00
Derek Chiang
7368f3d1df fix typo in eip: remove aggregator from validateUserOp (#227) 2023-02-23 12:18:40 +02:00
Dror Tirosh
f3b5f79551 fix SimpleWallet slot allocations (#226)
Fit nonce and owner into the same slot, to save unneeded SLOAD during
validation
(They used to be in the same slot, and got "unaligned" when added a
proxy, since using "Initializeable" uses the first 2 bytes in the
storage.
2023-02-17 00:32:02 +02:00
Yoav Weiss
61f7d2898d Clarify that "simulation" is only for the validation function, not the entire op. (#224) 2023-02-17 00:31:26 +02:00
taek
d92fec8983 non-safe erc4337Manager to remove selfdestruct issues (#208) 2023-02-16 16:23:18 +02:00
taek
48854ef5ad Fix/verifying paymaster (#184)
* fixing VerifyingPaymaster
2023-02-16 03:13:14 +02:00
Dror Tirosh
d0e32bce19 fix solcover (#223) 2023-02-13 16:39:51 +02:00
Derek Chiang
e8290a3629 Make Gnosis account compatible with ERC-1271 (#191) 2023-02-13 15:50:30 +02:00
Dror Tirosh
1b78ed29c0 AA-148: remove FailedOp paymaster parameter (#222)
The "paymaster" parameter is not needed in FailedOp:
- reason code starts with "AA3x" to signify this is an error about a
paymaster
- the paymaster address can be extracted from the UserOperation itself.
- FailedOp can be caused by other entities too, such as factory (for
errors starting with "AA1x" or account itself ("AA2x")
2023-02-13 15:18:05 +02:00
Dror Tirosh
1f505c5889 AA-147 AA-134 N-03: remove aggregator from IAccount (#216)
* validateUserOp no longer receives an "aggregator" parameter.
* instead, validateUserOp returns "validationData" which includes aggregator, validAfter, validFrom
* helpers packValidationData, unpackValidationData can be used to pack and unpack this structure.
* removed IAggregatedAccount interface, as getAggregator is no longer needed.
* moved all validateSignatures calls to the beginning of the handleAggregatedOps, before any mutable calls of wallets or paymasters
2023-02-13 12:52:46 +02:00
Alex Forshtat
d6a2db7b26 AA-145 N-14: References to previously used "wallet" terminology [samples] (#210)
Co-authored-by: Dror Tirosh <dror@opengsn.org>
2023-02-09 17:40:45 +02:00
shahafn
679ac11877 AA-144 N-13 Removing unused ICreate2Deployer (#205)
Co-authored-by: Dror Tirosh <dror@opengsn.org>
2023-02-09 17:34:07 +02:00
shahafn
e019bbd673 AA-146 N-12 Removing unused imports (#206)
* Removing unused imports
---------

Co-authored-by: Dror Tirosh <dror@opengsn.org>
2023-02-09 17:33:36 +02:00
Dror Tirosh
b4ce311e12 AA-142 N-11 Typographical errors (#219)
Co-authored-by: shahafn <shahaflol@gmail.com>
2023-02-09 17:22:30 +02:00
Dror Tirosh
7bd9909f47 AA-138 N-07 rename vars and internal methods (#221)
* N-07 rename vars and internal methods
2023-02-09 17:05:37 +02:00
Dror Tirosh
80d5c89b61 N-10: remove "TODO" from code (#218)
These are notes to developers using these samples.

Co-authored-by: shahafn <shahaflol@gmail.com>
2023-02-09 01:56:18 +02:00
Alex Forshtat
419b7b04f9 AA-140 N-09: Stake size inconsistency [core] (#209)
* AA-140 N-09: Stake size inconsistency [core]
---------

Co-authored-by: shahafn <shahaflol@gmail.com>
2023-02-09 01:48:34 +02:00
Alex Forshtat
ca1b6495f2 AA-139 N-08: Inconsistent ordering [core and samples] (#211)
* AA-139 N-08: Inconsistent ordering [core and samples]

---------

Co-authored-by: shahafn <shahaflol@gmail.com>
2023-02-09 01:42:50 +02:00
shahafn
1633c063c3 AA-137 N-06 Indexing aggregator in SignatureAggregatorChanged event (#202)
* Indexing aggregator in SignatureAggregatorChanged event
2023-02-09 01:06:49 +02:00
shahafn
2600d7ef05 AA-136 N-05 Calling setPublicKey when initializing BLSAccount (#204)
* Calling _setPublicKey when initializing BLSAccount.
2023-02-09 01:05:04 +02:00
shahafn
fa46d5be28 AA-135 N-04 Changing validFrom, validUntil to uint64 (#203)
* Changing validFrom, validUntil to uint64
2023-02-09 00:42:23 +02:00
Dror Tirosh
f82cbbb364 AA-133: N-02: relocate tests and samples (#217)
* AA-133: N-02: relocate samples.
2023-02-09 00:29:58 +02:00
Dror Tirosh
998fa7dfe3 AA-132 N-01: rename uint to uint256 (#215) 2023-02-09 00:17:33 +02:00
Dror Tirosh
c0a69bf340 AA-131 L-12: Unsafe ABI encoding (#220)
remove encodeWithSignature, use direct call (with try/catch)
2023-02-09 00:10:11 +02:00
Dror Tirosh
3d8f4508b2 AA-130 L-11: Unrestrained revert reason (#200)
* AA-130 L-11: Unrestrained revert reason [core]

add prefix to revert reason from account (or paymaster)

---------

Co-authored-by: shahafn <shahaflol@gmail.com>
2023-02-09 00:04:01 +02:00
shahafn
4004ebf1fa AA-129 L-10 calling _disableInitializers() from account constructor (#201)
* calling _disableInitializers() from account constructor
2023-02-08 23:53:21 +02:00
Dror Tirosh
12d2ac0326 AA-128 L-09: document getBlsPublicKey (#199)
* AA-128 L-09: document getBlsPublicKey

remove confusing reference to non-existent (and non-standard) method
getAggregationInfo()
give "getBlsPublicKey" as an example.
2023-02-08 23:47:32 +02:00
Dror Tirosh
182b7d3387 AA-127 L-08: Missing error messages in require statements (#198)
add missing require message.
Note that account's addDeposit() now calls the paymaster's depositTo()
explicitly, instead of relying on the EntryPoint's receive() fallback
method.
2023-02-08 23:44:07 +02:00
Alex Forshtat
eeb93b2580 AA-126 L-07: Missing docstrings [core and samples] (#212) 2023-02-08 23:39:12 +02:00
Dror Tirosh
545a15cfdc AA-125 L-06 Mismatched StakeLocked event parameter (#197) 2023-02-08 23:31:39 +02:00
Dror Tirosh
5929ff8007 AA-124 L05 misleading spec (#196)
- clarify handling of FailedOp by bundler before handleOp.
- clarify entrypoint re-entrancy prevention.
2023-02-08 23:26:44 +02:00