14 Commits

Author SHA1 Message Date
Dror Tirosh
b18e2333d9 update package version to 0.5 2023-03-02 02:12:14 +02:00
taek
48854ef5ad Fix/verifying paymaster (#184)
* fixing VerifyingPaymaster
2023-02-16 03:13:14 +02:00
Dror Tirosh
976d3f2758 AA-91 factories (#151)
* fix factories

BLSFactory use same model as SimpleAccount, using immutable wallet and
only user-specific params in initializer
add factory for TestAggregatedAccount sapmle contract
Create2Factory - use arachnid's de-facto standard deployer, instead of of
the nonstandard EIP2470 (specifically, arachnid's deployer revert on errors)

* gnosis account factory
now Gnosis-Safe  based account uses only standard gnosis contracts. The new GnosisSafeAcccountFactory only wraps the standard GnosisSafeProxyFactory to create the proxy (and initialize it with our modules)
2022-12-20 20:35:08 +02:00
Dror Tirosh
6fbc3cf006 AA-36: Support deterministic mutli-chain addresses (#100)
initCode as deployer+data, instead of constructor code
- supports any deployer contract
- initCode doesn't have to include entire CREATE2 constructor code (it is only a method call to the deployer contract)
2022-08-23 21:09:48 +03:00
Dror Tirosh
0cddeaa720 AA-22: Support aggregated signatures and BLS ref. implementation (#92)
* update the EIP to support aggregated signatures

* support creation of aggregated wallet (simulateValidation)

* simulateValidation with param offChainSigCheck

if false, calls aggregator.validateUserOpSignature
if true, returns also offChainSigInfo to be used by off-chain code to
validate the signature

* hash pubkey into requestId

Vitalik Buterin [01/08/2022 10:40]:
Basically, if one account has a pubkey P, someone can make an evil
account with key Q - P, where they know q (the privkey of Q), and then
they pass off a signature with q as being an "aggregate" signature of
the same message signed by both K1 = P and K2 = Q-P (because K1 + K2 =
Q)

The fix to this is to hash the pubkey into the msghash, so you never get
two different keys signing the same message.
And I think this has to be enforced at the BLS aggregate verifier layer

Co-authored-by: Alex Forshtat <forshtat1@gmail.com>
2022-08-21 15:19:20 +02:00
Dror Tirosh
925528be5a AA-29: gnosis proxy (#96)
* inital code

import Gnosis code as-is.
probably can remove all non-essential contracts (e.g. test, samples)
or better, import as external library.

* removed unused contracts (not used,fail compilation)

* initial Gnosis-Safe Proxy account

* refactor:

- use @gnosis.pm/safe-contracts package
- separate contracts into separate files.

* cleanup, single owner

* cleanup contracts

simpler fallback handler

* added tests

failure cases
counterfactual creation

* change to "Manager"

- manager is not a module, only fallback, entrypoint
- replaceManager now works

* ignore from coverage

(fails to compile for coverage)

* fix dangling test

* Fix lint

* Set expected code lenght to be 324

Co-authored-by: Alex Forshtat <forshtat1@gmail.com>
2022-07-27 18:40:57 +02:00
Dror Tirosh
e74604e3b7 AA-21: gas usage tests for different batch scenarios (#93)
use with "yarn gas-checker"
currently deploys batches of 1,2,20,21, and display the gas diff
2022-07-24 11:27:36 +03:00
Alex Forshtat
f5fed715b8 AA-30: Add eslint task to the repository (#97)
Co-authored-by: Dror Tirosh <dror@opengsn.org>
2022-07-07 23:23:20 +03:00
Dror Tirosh
296114f99e Solidity coverage (#31)
* solidity coverage tool
2022-01-24 02:38:28 +02:00
Dror Tirosh
e5cb0cdd8b add eth-gas-reporter to "yarn ci" build (#29)
* add eth-gas-reporter to "yarn ci" build
* `createWalletOwner()` (and `createAddress()`) now generate deterministic addresses, so they don't skew gas calculations (zero-bytes in calldata fluctuate gas usage)
2022-01-18 19:34:08 +02:00
Dror Tirosh
4a5c8a13a0 deployment script and deployments 2021-10-15 11:20:08 +03:00
Dror Tirosh
090b2ceb81 Gasopt profile (#16)
gas optimizations
* gas optimization, test tool (runop)
- [some] userOp accessors (calldata struct members are accessed badly)
- lighter signature calculation (by 1200gas)
  directly hash the UserOperation on from calldata, instead of copy fields
* execFromEntryPoint to call directly target
* compact nonce and sender into a single storage cell. 
  saves 15000k on wallet creation (first initialization of both fields).
  then saves ~1000 on each call)

- runop - run a single op against a local/remote network (for easier tenderly work)
- runop3 - run 3 txs to fit a bundle.

* support multiple requests in AASigner

- AASigner is now more robust. supports 3 modes of userop handling
-- rpcUserOpSender - connect to RPC that supports the
eth_sendUserOperation
-- queueUserOpSender - handler that collects requests over 5 seconds
before sending a bundle
  -- localUserOpSender - send each userop as it is received

- updated API: added nonce to events (so sender/nonce is a unique identifier)
2021-10-08 00:39:26 +03:00
Dror Tirosh
660465e15c use EIP2470 singleton creator. (#14)
* use EIP2470 singleton creator.
* deployEntryPoint(), to deploy entry point using create2
2021-10-06 02:49:46 +03:00
Dror Tirosh
a03088419a Gas overhead, Ban opcodes (#9)
* added perOpOverhead

* added batch tests , large batches for testing construction, large TXs, heavy cpu.

* test for banned opcodes in simulateWalletVerification

* removed banning of GAS opcode in payForSelf testing.

* add github test workflow
2021-09-23 16:33:46 +03:00