diff --git a/front/.env.local.example b/.env.local.example similarity index 100% rename from front/.env.local.example rename to .env.local.example diff --git a/front/.eslintrc.json b/.eslintrc.json similarity index 100% rename from front/.eslintrc.json rename to .eslintrc.json diff --git a/front/.npmrc b/.npmrc similarity index 100% rename from front/.npmrc rename to .npmrc diff --git a/front/.prettierrc b/.prettierrc similarity index 100% rename from front/.prettierrc rename to .prettierrc diff --git a/contracts/.env.example b/contracts/.env.example deleted file mode 100644 index 0eb91b3..0000000 --- a/contracts/.env.example +++ /dev/null @@ -1,2 +0,0 @@ -PRIVATE_KEY= -ETHERSCAN_API_KEY= \ No newline at end of file diff --git a/contracts/broadcast/SimpleAccountFactory.s.sol/11155111/run-latest.json b/contracts/broadcast/SimpleAccountFactory.s.sol/11155111/run-latest.json deleted file mode 100644 index 5450141..0000000 --- a/contracts/broadcast/SimpleAccountFactory.s.sol/11155111/run-latest.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "transactions": [ - { - "hash": "0xc70fe8b57bbe71707b6db85d3c4800bf76422f9cbab7507471b9d530f74f4404", - "transactionType": "CREATE", - "contractName": "SimpleAccountFactory", - "contractAddress": "0xE4e6BF50E1fb02b323ca855dF0d8D76a75290FfC", - "function": null, - "arguments": [ - "0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789" - ], - "transaction": { - "type": "0x02", - "from": "0x816a19a0e2babcc5c4980c7d0567e14f25d86ee5", - "gas": "0x3248d4", - "value": "0x0", - "data": "0x60c060405234801561001057600080fd5b50604051612e6e380380612e6e83398101604081905261002f91610096565b6001600160a01b03811660a052604051819061004a90610089565b6001600160a01b039091168152602001604051809103906000f080158015610076573d6000803e3d6000fd5b506001600160a01b0316608052506100c6565b611f5f80610f0f83390190565b6000602082840312156100a857600080fd5b81516001600160a01b03811681146100bf57600080fd5b9392505050565b60805160a051610e0f6101006000396000818161018b01526102830152600081816102060152818161032001526105720152610e0f6000f3fe608060405260043610620000845760003560e01c8063b0d691fe1162000054578063b0d691fe1462000177578063ba9a91a514620001ad578063c1e4ba2d14620001f2578063c9879c36146200022857600080fd5b8062ab22e51462000089578063365b98b214620000bd578063764a6793146200011c578063b0467deb1462000143575b600080fd5b620000a06200009a36600462000793565b6200024d565b6040516001600160a01b0390911681526020015b60405180910390f35b348015620000ca57600080fd5b50620000fe620000dc366004620007b2565b600060208190529081526040902080546003909101546001600160a01b031682565b604080519283526001600160a01b03909116602083015201620000b4565b3480156200012957600080fd5b50620001416200013b366004620007cc565b620003bf565b005b3480156200015057600080fd5b506200016862000162366004620007b2565b620004aa565b604051620000b49190620007fc565b3480156200018457600080fd5b50620000a07f000000000000000000000000000000000000000000000000000000000000000081565b348015620001ba57600080fd5b50620001e37f72bdef34ece1c5a6fd9603a115f1c4189005abc5197752eb93c03611952eb70881565b604051908152602001620000b4565b348015620001ff57600080fd5b50620000a07f000000000000000000000000000000000000000000000000000000000000000081565b3480156200023557600080fd5b50620000a06200024736600462000793565b62000523565b6000806200025b8362000523565b90503415620002e45760405163b760faf960e01b81526001600160a01b0382811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063b760faf99034906024016000604051808303818588803b158015620002c957600080fd5b505af1158015620002de573d6000803e3d6000fd5b50505050505b6001600160a01b0381163b8015620002fd575092915050565b7f72bdef34ece1c5a6fd9603a115f1c4189005abc5197752eb93c03611952eb7087f0000000000000000000000000000000000000000000000000000000000000000856040516024016200035291906200084f565b60408051601f198184030181529181526020820180516001600160e01b0316632d16032160e01b17905251620003889062000661565b62000395929190620008a8565b8190604051809103906000f5905080158015620003b6573d6000803e3d6000fd5b50949350505050565b6040518060600160405280838152602001828152602001306001600160a01b031663c9879c36846040518263ffffffff1660e01b81526004016200040491906200084f565b602060405180830381865afa15801562000422573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620004489190620008ec565b6001600160a01b0316905260008381526020818152604090912082518155908201516200047c90600183019060026200066f565b5060409190910151600390910180546001600160a01b0319166001600160a01b039092169190911790555050565b620004b4620006b2565b6000828152602081815260409182902082516060810184528154815283518085019485905290939192840191600184019060029082845b815481526020019060010190808311620004eb575050509183525050600391909101546001600160a01b031660209091015292915050565b60006200061b7f72bdef34ece1c5a6fd9603a115f1c4189005abc5197752eb93c03611952eb708604051806020016200055c9062000661565b6020820181038252601f19601f820116604052507f000000000000000000000000000000000000000000000000000000000000000085604051602401620005a491906200084f565b60408051601f19818403018152918152602080830180516001600160e01b0316632d16032160e01b1790529051620005df93929101620008a8565b60408051601f1981840301815290829052620005ff929160200162000917565b6040516020818303038152906040528051906020012062000621565b92915050565b60006200063083833062000637565b9392505050565b6000604051836040820152846020820152828152600b8101905060ff815360559020949350505050565b6104b8806200094b83390190565b8260028101928215620006a0579160200282015b82811115620006a057825182559160200191906001019062000683565b50620006ae929150620006db565b5090565b604051806060016040528060008152602001620006ce620006f2565b8152600060209091015290565b5b80821115620006ae5760008155600101620006dc565b60405180604001604052806002906020820280368337509192915050565b600082601f8301126200072257600080fd5b6040516040810181811067ffffffffffffffff821117156200075457634e487b7160e01b600052604160045260246000fd5b80604052508060408401858111156200076c57600080fd5b845b81811015620007885780358352602092830192016200076e565b509195945050505050565b600060408284031215620007a657600080fd5b62000630838362000710565b600060208284031215620007c557600080fd5b5035919050565b60008060608385031215620007e057600080fd5b82359150620007f3846020850162000710565b90509250929050565b8151815260208083015160808301919081840160005b6002811015620008315782518252918301919083019060010162000812565b50505050604092909201516001600160a01b03166060919091015290565b60408101818360005b60028110156200087957815183526020928301929091019060010162000858565b50505092915050565b60005b838110156200089f57818101518382015260200162000885565b50506000910152565b60018060a01b03831681526040602082015260008251806040840152620008d781606085016020870162000882565b601f01601f1916919091016060019392505050565b600060208284031215620008ff57600080fd5b81516001600160a01b03811681146200063057600080fd5b600083516200092b81846020880162000882565b8351908301906200094181836020880162000882565b0194935050505056fe60806040526040516104b83803806104b8833981016040819052610022916102de565b61002e82826000610035565b50506103fb565b61003e83610061565b60008251118061004b5750805b1561005c5761005a83836100a1565b505b505050565b61006a816100cd565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100c6838360405180606001604052806027815260200161049160279139610180565b9392505050565b6001600160a01b0381163b61013f5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc80546001600160a01b0319166001600160a01b0392909216919091179055565b6060600080856001600160a01b03168560405161019d91906103ac565b600060405180830381855af49150503d80600081146101d8576040519150601f19603f3d011682016040523d82523d6000602084013e6101dd565b606091505b5090925090506101ef868383876101f9565b9695505050505050565b60608315610268578251600003610261576001600160a01b0385163b6102615760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610136565b5081610272565b610272838361027a565b949350505050565b81511561028a5781518083602001fd5b8060405162461bcd60e51b815260040161013691906103c8565b634e487b7160e01b600052604160045260246000fd5b60005b838110156102d55781810151838201526020016102bd565b50506000910152565b600080604083850312156102f157600080fd5b82516001600160a01b038116811461030857600080fd5b60208401519092506001600160401b038082111561032557600080fd5b818501915085601f83011261033957600080fd5b81518181111561034b5761034b6102a4565b604051601f8201601f19908116603f01168101908382118183101715610373576103736102a4565b8160405282815288602084870101111561038c57600080fd5b61039d8360208301602088016102ba565b80955050505050509250929050565b600082516103be8184602087016102ba565b9190910192915050565b60208152600082518060208401526103e78160408501602087016102ba565b601f01601f19169190910160400192915050565b6088806104096000396000f3fe608060405236601057600e6013565b005b600e5b601f601b6021565b6058565b565b600060537f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156076573d6000f35b3d6000fdfea164736f6c6343000815000a416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a164736f6c6343000815000a60c0604052306080523480156200001557600080fd5b5060405162001f5f38038062001f5f833981016040819052620000389162000118565b6001600160a01b03811660a0526200004f62000056565b506200014a565b600054610100900460ff1615620000c35760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116101562000116576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6000602082840312156200012b57600080fd5b81516001600160a01b03811681146200014357600080fd5b9392505050565b60805160a051611dbe620001a1600039600081816101c301528181610373015281816105aa015261082a0152600081816104c801528181610508015281816106290152818161066901526106f80152611dbe6000f3fe6080604052600436106100845760003560e01c80633a871cdd116100565780633a871cdd1461012b5780634f1ef2861461015957806352d1902d1461016c57806363ffab3114610181578063b0d691fe146101b157005b80631626ba7e1461008d5780632d160321146100cb57806334fcd5be146100eb5780633659cfe61461010b57005b3661008b57005b005b34801561009957600080fd5b506100ad6100a8366004611633565b6101fd565b6040516001600160e01b031990911681526020015b60405180910390f35b3480156100d757600080fd5b5061008b6100e63660046116ee565b610250565b3480156100f757600080fd5b5061008b610106366004611763565b610368565b34801561011757600080fd5b5061008b6101263660046117f4565b6104be565b34801561013757600080fd5b5061014b61014636600461180f565b61059d565b6040519081526020016100c2565b61008b6101673660046118f0565b61061f565b34801561017857600080fd5b5061014b6106eb565b34801561018d57600080fd5b5060015460025461019c919082565b604080519283526020830191909152016100c2565b3480156101bd57600080fd5b506101e57f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100c2565b600061022b8460405160200161021591815260200190565b604051602081830303815290604052848461079e565b1561023e5750630b135d3f60e11b610249565b506001600160e01b03195b9392505050565b600054610100900460ff16158080156102705750600054600160ff909116105b8061028a5750303b15801561028a575060005460ff166001145b6102f25760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015610315576000805461ff0019166101001790555b61031e826107f2565b8015610364576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103d35760405162461bcd60e51b815260206004820152601060248201526f1bdb9b1e48195b9d1c9e481c1bda5b9d60821b60448201526064016102e9565b60005b818110156104b9576104a78383838181106103f3576103f361193e565b90506020028101906104059190611954565b6104139060208101906117f4565b8484848181106104255761042561193e565b90506020028101906104379190611954565b6020013585858581811061044d5761044d61193e565b905060200281019061045f9190611954565b61046d906040810190611974565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061088a92505050565b806104b1816119d8565b9150506103d6565b505050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036105065760405162461bcd60e51b81526004016102e9906119f1565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661054f600080516020611d2b833981519152546001600160a01b031690565b6001600160a01b0316146105755760405162461bcd60e51b81526004016102e990611a3d565b61057e81610901565b6040805160008082526020820190925261059a9183919061093c565b50565b6000336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461060a5760405162461bcd60e51b815260206004820152601060248201526f1bdb9b1e48195b9d1c9e481c1bda5b9d60821b60448201526064016102e9565b6106148484610aa7565b905061024982610c67565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036106675760405162461bcd60e51b81526004016102e9906119f1565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166106b0600080516020611d2b833981519152546001600160a01b031690565b6001600160a01b0316146106d65760405162461bcd60e51b81526004016102e990611a3d565b6106df82610901565b6103648282600161093c565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461078b5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016102e9565b50600080516020611d2b83398151915290565b6000806107ad83850185611a89565b90506107e9858260000151600084602001518560400151866060015187608001518860a0015160016000015460001c600180015460001c610cb4565b95945050505050565b6040805180820182528251808252602080850151928101839052600182905560028390558351808501855291825281019190915290517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316917f8a7fd7e24d60f649878f6c9c7e9114e6614218fd3dce2eb1d79549afaf161ab39161087f9190611b45565b60405180910390a250565b600080846001600160a01b031684846040516108a69190611b9a565b60006040518083038185875af1925050503d80600081146108e3576040519150601f19603f3d011682016040523d82523d6000602084013e6108e8565b606091505b5091509150816108fa57805160208201fd5b5050505050565b33301461059a5760405162461bcd60e51b815260206004820152600960248201526837b7363c9039b2b63360b91b60448201526064016102e9565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561096f576104b983610e76565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156109c9575060408051601f3d908101601f191682019092526109c691810190611bac565b60015b610a2c5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016102e9565b600080516020611d2b8339815191528114610a9b5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016102e9565b506104b9838383610f12565b604080516060818101835260008083526020830181905292820183905290369083906000610ad9610140890189611974565b9050905080600003610af357600195505050505050610c61565b6000610b036101408a018a611974565b6000818110610b1457610b1461193e565b919091013560f81c9150506001819003610beb576007821015610b405760019650505050505050610c61565b6000610b506101408b018b611974565b610b5f91600791600191611bc5565b610b6891611bef565b60d01c9050610b7b6101408b018b611974565b610b89916007908290611bc5565b6040516001600160f81b031960f886901b1660208201526001600160d01b031960d085901b166021820152602781018c9052919750955060470160408051601f1981840301815291815265ffffffffffff909216918501919091529550610bfa565b60019650505050505050610c61565b610c0586868661079e565b15610c5657610c4983600060d0826020015165ffffffffffff16901b60a0836040015165ffffffffffff16901b83600001516001600160a01b031617179050919050565b9650505050505050610c61565b600196505050505050505b92915050565b801561059a57604051600090339060001990849084818181858888f193505050503d80600081146108fa576040519150601f19603f3d011682016040523d82523d6000602084013e6108fa565b600060208a511080610cee5750610cec8a602081518110610cd757610cd761193e565b01602001516001600160f81b0319168a610f3d565b155b15610cfb57506000610e68565b604080518082019091526015815274113a3cb832911d113bb2b130baba34371733b2ba1160591b6020820152610d32818a89610fa3565b610d40576000915050610e68565b6000610d4b8d61105c565b9050600081604051602001610d609190611c1f565b6040516020818303038152906040529050610d7c818c8c610fa3565b610d8c5760009350505050610e68565b600060028c604051610d9e9190611b9a565b602060405180830381855afa158015610dbb573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610dde9190611bac565b9050600060028f83604051602001610df7929190611c60565b60408051601f1981840301815290829052610e1191611b9a565b602060405180830381855afa158015610e2e573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610e519190611bac565b9050610e60818b8b8b8b611274565b955050505050505b9a9950505050505050505050565b6001600160a01b0381163b610ee35760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102e9565b600080516020611d2b83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b610f1b83611358565b600082511180610f285750805b156104b957610f378383611398565b50505050565b6000600160f81b83811614610f5457506000610c61565b818015610f675750600160fa1b83811614155b15610f7457506000610c61565b600160fb1b83811614610f9a57600f60fc1b600160fc1b841601610f9a57506000610c61565b50600192915050565b825182516000918591859190845b8281101561104d5781610fc48289611c82565b10610fd757600095505050505050610249565b83610fe28289611c82565b81518110610ff257610ff261193e565b602001015160f81c60f81b6001600160f81b0319168582815181106110195761101961193e565b01602001516001600160f81b0319161461103b57600095505050505050610249565b80611045816119d8565b915050610fb1565b50600198975050505050505050565b60606000611069836113bd565b905060008190506000600282511180156110b45750816002835161108d9190611c95565b8151811061109d5761109d61193e565b6020910101516001600160f81b031916603d60f81b145b156110c15750600261110c565b60018251118015611103575081600183516110dc9190611c95565b815181106110ec576110ec61193e565b6020910101516001600160f81b031916603d60f81b145b1561110c575060015b600081835161111b9190611c95565b905060008167ffffffffffffffff811115611138576111386116af565b6040519080825280601f01601f191660200182016040528015611162576020820181803683370190505b50905060005b82811015611269578481815181106111825761118261193e565b01602001516001600160f81b031916602b60f81b036111ce57602d60f81b8282815181106111b2576111b261193e565b60200101906001600160f81b031916908160001a905350611257565b8481815181106111e0576111e061193e565b01602001516001600160f81b031916602f60f81b0361121057605f60f81b8282815181106111b2576111b261193e565b8481815181106112225761122261193e565b602001015160f81c60f81b82828151811061123f5761123f61193e565b60200101906001600160f81b031916908160001a9053505b80611261816119d8565b915050611168565b509695505050505050565b6040805160208101879052908101859052606081018490526080810183905260a08101829052600090819060c0016040516020818303038152906040529050600080737a29dc72fa3938705d91a9659455bc54731ed70f6001600160a01b0316836040516112e29190611b9a565b600060405180830381855afa9150503d806000811461131d576040519150601f19603f3d011682016040523d82523d6000602084013e611322565b606091505b50915091508161133457611334611ca8565b808060200190518101906113489190611bac565b6001149998505050505050505050565b61136181610e76565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606102498383604051806060016040528060278152602001611d8b60279139611510565b606081516000036113dc57505060408051602081019091526000815290565b6000604051806060016040528060408152602001611d4b604091399050600060038451600261140b9190611c82565b6114159190611cbe565b611420906004611ce0565b67ffffffffffffffff811115611438576114386116af565b6040519080825280601f01601f191660200182016040528015611462576020820181803683370190505b509050600182016020820185865187015b808210156114ce576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f8116850151845350600183019250611473565b50506003865106600181146114ea57600281146114fd57611505565b603d6001830353603d6002830353611505565b603d60018303535b509195945050505050565b6060600080856001600160a01b03168560405161152d9190611b9a565b600060405180830381855af49150503d8060008114611568576040519150601f19603f3d011682016040523d82523d6000602084013e61156d565b606091505b509150915061157e86838387611588565b9695505050505050565b606083156115f75782516000036115f0576001600160a01b0385163b6115f05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102e9565b5081611601565b6116018383611609565b949350505050565b8151156116195781518083602001fd5b8060405162461bcd60e51b81526004016102e99190611cf7565b60008060006040848603121561164857600080fd5b83359250602084013567ffffffffffffffff8082111561166757600080fd5b818601915086601f83011261167b57600080fd5b81358181111561168a57600080fd5b87602082850101111561169c57600080fd5b6020830194508093505050509250925092565b634e487b7160e01b600052604160045260246000fd5b60405160c0810167ffffffffffffffff811182821017156116e8576116e86116af565b60405290565b60006040828403121561170057600080fd5b82601f83011261170f57600080fd5b6040516040810181811067ffffffffffffffff82111715611732576117326116af565b806040525080604084018581111561174957600080fd5b845b8181101561150557803583526020928301920161174b565b6000806020838503121561177657600080fd5b823567ffffffffffffffff8082111561178e57600080fd5b818501915085601f8301126117a257600080fd5b8135818111156117b157600080fd5b8660208260051b85010111156117c657600080fd5b60209290920196919550909350505050565b80356001600160a01b03811681146117ef57600080fd5b919050565b60006020828403121561180657600080fd5b610249826117d8565b60008060006060848603121561182457600080fd5b833567ffffffffffffffff81111561183b57600080fd5b8401610160818703121561184e57600080fd5b95602085013595506040909401359392505050565b600082601f83011261187457600080fd5b813567ffffffffffffffff8082111561188f5761188f6116af565b604051601f8301601f19908116603f011681019082821181831017156118b7576118b76116af565b816040528381528660208588010111156118d057600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561190357600080fd5b61190c836117d8565b9150602083013567ffffffffffffffff81111561192857600080fd5b61193485828601611863565b9150509250929050565b634e487b7160e01b600052603260045260246000fd5b60008235605e1983360301811261196a57600080fd5b9190910192915050565b6000808335601e1984360301811261198b57600080fd5b83018035915067ffffffffffffffff8211156119a657600080fd5b6020019150368190038213156119bb57600080fd5b9250929050565b634e487b7160e01b600052601160045260246000fd5b6000600182016119ea576119ea6119c2565b5060010190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b600060208284031215611a9b57600080fd5b813567ffffffffffffffff80821115611ab357600080fd5b9083019060c08286031215611ac757600080fd5b611acf6116c5565b823582811115611ade57600080fd5b611aea87828601611863565b825250602083013582811115611aff57600080fd5b611b0b87828601611863565b60208301525060408301356040820152606083013560608201526080830135608082015260a083013560a082015280935050505092915050565b60408101818360005b6002811015611b6d578151835260209283019290910190600101611b4e565b50505092915050565b60005b83811015611b91578181015183820152602001611b79565b50506000910152565b6000825161196a818460208701611b76565b600060208284031215611bbe57600080fd5b5051919050565b60008085851115611bd557600080fd5b83861115611be257600080fd5b5050820193919092039150565b6001600160d01b03198135818116916006851015611c175780818660060360031b1b83161692505b505092915050565b6c1131b430b63632b733b2911d1160991b81528151600090611c4881600d850160208701611b76565b601160f91b600d939091019283015250600e01919050565b60008351611c72818460208801611b76565b9190910191825250602001919050565b80820180821115610c6157610c616119c2565b81810381811115610c6157610c616119c2565b634e487b7160e01b600052600160045260246000fd5b600082611cdb57634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610c6157610c616119c2565b6020815260008251806020840152611d16816040850160208701611b76565b601f01601f1916919091016040019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a164736f6c6343000815000a0000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d2789", - "nonce": "0x14", - "accessList": [] - }, - "additionalContracts": [ - { - "transactionType": "CREATE", - "address": "0xBF8c428F0347A3a3bafEbeD8b43070B4184508CD", - "initCode": "0x60c0604052306080523480156200001557600080fd5b5060405162001f5f38038062001f5f833981016040819052620000389162000118565b6001600160a01b03811660a0526200004f62000056565b506200014a565b600054610100900460ff1615620000c35760405162461bcd60e51b815260206004820152602760248201527f496e697469616c697a61626c653a20636f6e747261637420697320696e697469604482015266616c697a696e6760c81b606482015260840160405180910390fd5b60005460ff908116101562000116576000805460ff191660ff9081179091556040519081527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b565b6000602082840312156200012b57600080fd5b81516001600160a01b03811681146200014357600080fd5b9392505050565b60805160a051611dbe620001a1600039600081816101c301528181610373015281816105aa015261082a0152600081816104c801528181610508015281816106290152818161066901526106f80152611dbe6000f3fe6080604052600436106100845760003560e01c80633a871cdd116100565780633a871cdd1461012b5780634f1ef2861461015957806352d1902d1461016c57806363ffab3114610181578063b0d691fe146101b157005b80631626ba7e1461008d5780632d160321146100cb57806334fcd5be146100eb5780633659cfe61461010b57005b3661008b57005b005b34801561009957600080fd5b506100ad6100a8366004611633565b6101fd565b6040516001600160e01b031990911681526020015b60405180910390f35b3480156100d757600080fd5b5061008b6100e63660046116ee565b610250565b3480156100f757600080fd5b5061008b610106366004611763565b610368565b34801561011757600080fd5b5061008b6101263660046117f4565b6104be565b34801561013757600080fd5b5061014b61014636600461180f565b61059d565b6040519081526020016100c2565b61008b6101673660046118f0565b61061f565b34801561017857600080fd5b5061014b6106eb565b34801561018d57600080fd5b5060015460025461019c919082565b604080519283526020830191909152016100c2565b3480156101bd57600080fd5b506101e57f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b0390911681526020016100c2565b600061022b8460405160200161021591815260200190565b604051602081830303815290604052848461079e565b1561023e5750630b135d3f60e11b610249565b506001600160e01b03195b9392505050565b600054610100900460ff16158080156102705750600054600160ff909116105b8061028a5750303b15801561028a575060005460ff166001145b6102f25760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805460ff191660011790558015610315576000805461ff0019166101001790555b61031e826107f2565b8015610364576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15b5050565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146103d35760405162461bcd60e51b815260206004820152601060248201526f1bdb9b1e48195b9d1c9e481c1bda5b9d60821b60448201526064016102e9565b60005b818110156104b9576104a78383838181106103f3576103f361193e565b90506020028101906104059190611954565b6104139060208101906117f4565b8484848181106104255761042561193e565b90506020028101906104379190611954565b6020013585858581811061044d5761044d61193e565b905060200281019061045f9190611954565b61046d906040810190611974565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061088a92505050565b806104b1816119d8565b9150506103d6565b505050565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036105065760405162461bcd60e51b81526004016102e9906119f1565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031661054f600080516020611d2b833981519152546001600160a01b031690565b6001600160a01b0316146105755760405162461bcd60e51b81526004016102e990611a3d565b61057e81610901565b6040805160008082526020820190925261059a9183919061093c565b50565b6000336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461060a5760405162461bcd60e51b815260206004820152601060248201526f1bdb9b1e48195b9d1c9e481c1bda5b9d60821b60448201526064016102e9565b6106148484610aa7565b905061024982610c67565b6001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001630036106675760405162461bcd60e51b81526004016102e9906119f1565b7f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166106b0600080516020611d2b833981519152546001600160a01b031690565b6001600160a01b0316146106d65760405162461bcd60e51b81526004016102e990611a3d565b6106df82610901565b6103648282600161093c565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461078b5760405162461bcd60e51b815260206004820152603860248201527f555550535570677261646561626c653a206d757374206e6f742062652063616c60448201527f6c6564207468726f7567682064656c656761746563616c6c000000000000000060648201526084016102e9565b50600080516020611d2b83398151915290565b6000806107ad83850185611a89565b90506107e9858260000151600084602001518560400151866060015187608001518860a0015160016000015460001c600180015460001c610cb4565b95945050505050565b6040805180820182528251808252602080850151928101839052600182905560028390558351808501855291825281019190915290517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316917f8a7fd7e24d60f649878f6c9c7e9114e6614218fd3dce2eb1d79549afaf161ab39161087f9190611b45565b60405180910390a250565b600080846001600160a01b031684846040516108a69190611b9a565b60006040518083038185875af1925050503d80600081146108e3576040519150601f19603f3d011682016040523d82523d6000602084013e6108e8565b606091505b5091509150816108fa57805160208201fd5b5050505050565b33301461059a5760405162461bcd60e51b815260206004820152600960248201526837b7363c9039b2b63360b91b60448201526064016102e9565b7f4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd91435460ff161561096f576104b983610e76565b826001600160a01b03166352d1902d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156109c9575060408051601f3d908101601f191682019092526109c691810190611bac565b60015b610a2c5760405162461bcd60e51b815260206004820152602e60248201527f45524331393637557067726164653a206e657720696d706c656d656e7461746960448201526d6f6e206973206e6f74205555505360901b60648201526084016102e9565b600080516020611d2b8339815191528114610a9b5760405162461bcd60e51b815260206004820152602960248201527f45524331393637557067726164653a20756e737570706f727465642070726f786044820152681a58589b195555525160ba1b60648201526084016102e9565b506104b9838383610f12565b604080516060818101835260008083526020830181905292820183905290369083906000610ad9610140890189611974565b9050905080600003610af357600195505050505050610c61565b6000610b036101408a018a611974565b6000818110610b1457610b1461193e565b919091013560f81c9150506001819003610beb576007821015610b405760019650505050505050610c61565b6000610b506101408b018b611974565b610b5f91600791600191611bc5565b610b6891611bef565b60d01c9050610b7b6101408b018b611974565b610b89916007908290611bc5565b6040516001600160f81b031960f886901b1660208201526001600160d01b031960d085901b166021820152602781018c9052919750955060470160408051601f1981840301815291815265ffffffffffff909216918501919091529550610bfa565b60019650505050505050610c61565b610c0586868661079e565b15610c5657610c4983600060d0826020015165ffffffffffff16901b60a0836040015165ffffffffffff16901b83600001516001600160a01b031617179050919050565b9650505050505050610c61565b600196505050505050505b92915050565b801561059a57604051600090339060001990849084818181858888f193505050503d80600081146108fa576040519150601f19603f3d011682016040523d82523d6000602084013e6108fa565b600060208a511080610cee5750610cec8a602081518110610cd757610cd761193e565b01602001516001600160f81b0319168a610f3d565b155b15610cfb57506000610e68565b604080518082019091526015815274113a3cb832911d113bb2b130baba34371733b2ba1160591b6020820152610d32818a89610fa3565b610d40576000915050610e68565b6000610d4b8d61105c565b9050600081604051602001610d609190611c1f565b6040516020818303038152906040529050610d7c818c8c610fa3565b610d8c5760009350505050610e68565b600060028c604051610d9e9190611b9a565b602060405180830381855afa158015610dbb573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610dde9190611bac565b9050600060028f83604051602001610df7929190611c60565b60408051601f1981840301815290829052610e1191611b9a565b602060405180830381855afa158015610e2e573d6000803e3d6000fd5b5050506040513d601f19601f82011682018060405250810190610e519190611bac565b9050610e60818b8b8b8b611274565b955050505050505b9a9950505050505050505050565b6001600160a01b0381163b610ee35760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102e9565b600080516020611d2b83398151915280546001600160a01b0319166001600160a01b0392909216919091179055565b610f1b83611358565b600082511180610f285750805b156104b957610f378383611398565b50505050565b6000600160f81b83811614610f5457506000610c61565b818015610f675750600160fa1b83811614155b15610f7457506000610c61565b600160fb1b83811614610f9a57600f60fc1b600160fc1b841601610f9a57506000610c61565b50600192915050565b825182516000918591859190845b8281101561104d5781610fc48289611c82565b10610fd757600095505050505050610249565b83610fe28289611c82565b81518110610ff257610ff261193e565b602001015160f81c60f81b6001600160f81b0319168582815181106110195761101961193e565b01602001516001600160f81b0319161461103b57600095505050505050610249565b80611045816119d8565b915050610fb1565b50600198975050505050505050565b60606000611069836113bd565b905060008190506000600282511180156110b45750816002835161108d9190611c95565b8151811061109d5761109d61193e565b6020910101516001600160f81b031916603d60f81b145b156110c15750600261110c565b60018251118015611103575081600183516110dc9190611c95565b815181106110ec576110ec61193e565b6020910101516001600160f81b031916603d60f81b145b1561110c575060015b600081835161111b9190611c95565b905060008167ffffffffffffffff811115611138576111386116af565b6040519080825280601f01601f191660200182016040528015611162576020820181803683370190505b50905060005b82811015611269578481815181106111825761118261193e565b01602001516001600160f81b031916602b60f81b036111ce57602d60f81b8282815181106111b2576111b261193e565b60200101906001600160f81b031916908160001a905350611257565b8481815181106111e0576111e061193e565b01602001516001600160f81b031916602f60f81b0361121057605f60f81b8282815181106111b2576111b261193e565b8481815181106112225761122261193e565b602001015160f81c60f81b82828151811061123f5761123f61193e565b60200101906001600160f81b031916908160001a9053505b80611261816119d8565b915050611168565b509695505050505050565b6040805160208101879052908101859052606081018490526080810183905260a08101829052600090819060c0016040516020818303038152906040529050600080737a29dc72fa3938705d91a9659455bc54731ed70f6001600160a01b0316836040516112e29190611b9a565b600060405180830381855afa9150503d806000811461131d576040519150601f19603f3d011682016040523d82523d6000602084013e611322565b606091505b50915091508161133457611334611ca8565b808060200190518101906113489190611bac565b6001149998505050505050505050565b61136181610e76565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606102498383604051806060016040528060278152602001611d8b60279139611510565b606081516000036113dc57505060408051602081019091526000815290565b6000604051806060016040528060408152602001611d4b604091399050600060038451600261140b9190611c82565b6114159190611cbe565b611420906004611ce0565b67ffffffffffffffff811115611438576114386116af565b6040519080825280601f01601f191660200182016040528015611462576020820181803683370190505b509050600182016020820185865187015b808210156114ce576003820191508151603f8160121c168501518453600184019350603f81600c1c168501518453600184019350603f8160061c168501518453600184019350603f8116850151845350600183019250611473565b50506003865106600181146114ea57600281146114fd57611505565b603d6001830353603d6002830353611505565b603d60018303535b509195945050505050565b6060600080856001600160a01b03168560405161152d9190611b9a565b600060405180830381855af49150503d8060008114611568576040519150601f19603f3d011682016040523d82523d6000602084013e61156d565b606091505b509150915061157e86838387611588565b9695505050505050565b606083156115f75782516000036115f0576001600160a01b0385163b6115f05760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102e9565b5081611601565b6116018383611609565b949350505050565b8151156116195781518083602001fd5b8060405162461bcd60e51b81526004016102e99190611cf7565b60008060006040848603121561164857600080fd5b83359250602084013567ffffffffffffffff8082111561166757600080fd5b818601915086601f83011261167b57600080fd5b81358181111561168a57600080fd5b87602082850101111561169c57600080fd5b6020830194508093505050509250925092565b634e487b7160e01b600052604160045260246000fd5b60405160c0810167ffffffffffffffff811182821017156116e8576116e86116af565b60405290565b60006040828403121561170057600080fd5b82601f83011261170f57600080fd5b6040516040810181811067ffffffffffffffff82111715611732576117326116af565b806040525080604084018581111561174957600080fd5b845b8181101561150557803583526020928301920161174b565b6000806020838503121561177657600080fd5b823567ffffffffffffffff8082111561178e57600080fd5b818501915085601f8301126117a257600080fd5b8135818111156117b157600080fd5b8660208260051b85010111156117c657600080fd5b60209290920196919550909350505050565b80356001600160a01b03811681146117ef57600080fd5b919050565b60006020828403121561180657600080fd5b610249826117d8565b60008060006060848603121561182457600080fd5b833567ffffffffffffffff81111561183b57600080fd5b8401610160818703121561184e57600080fd5b95602085013595506040909401359392505050565b600082601f83011261187457600080fd5b813567ffffffffffffffff8082111561188f5761188f6116af565b604051601f8301601f19908116603f011681019082821181831017156118b7576118b76116af565b816040528381528660208588010111156118d057600080fd5b836020870160208301376000602085830101528094505050505092915050565b6000806040838503121561190357600080fd5b61190c836117d8565b9150602083013567ffffffffffffffff81111561192857600080fd5b61193485828601611863565b9150509250929050565b634e487b7160e01b600052603260045260246000fd5b60008235605e1983360301811261196a57600080fd5b9190910192915050565b6000808335601e1984360301811261198b57600080fd5b83018035915067ffffffffffffffff8211156119a657600080fd5b6020019150368190038213156119bb57600080fd5b9250929050565b634e487b7160e01b600052601160045260246000fd5b6000600182016119ea576119ea6119c2565b5060010190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b19195b1959d85d1958d85b1b60a21b606082015260800190565b6020808252602c908201527f46756e6374696f6e206d7573742062652063616c6c6564207468726f7567682060408201526b6163746976652070726f787960a01b606082015260800190565b600060208284031215611a9b57600080fd5b813567ffffffffffffffff80821115611ab357600080fd5b9083019060c08286031215611ac757600080fd5b611acf6116c5565b823582811115611ade57600080fd5b611aea87828601611863565b825250602083013582811115611aff57600080fd5b611b0b87828601611863565b60208301525060408301356040820152606083013560608201526080830135608082015260a083013560a082015280935050505092915050565b60408101818360005b6002811015611b6d578151835260209283019290910190600101611b4e565b50505092915050565b60005b83811015611b91578181015183820152602001611b79565b50506000910152565b6000825161196a818460208701611b76565b600060208284031215611bbe57600080fd5b5051919050565b60008085851115611bd557600080fd5b83861115611be257600080fd5b5050820193919092039150565b6001600160d01b03198135818116916006851015611c175780818660060360031b1b83161692505b505092915050565b6c1131b430b63632b733b2911d1160991b81528151600090611c4881600d850160208701611b76565b601160f91b600d939091019283015250600e01919050565b60008351611c72818460208801611b76565b9190910191825250602001919050565b80820180821115610c6157610c616119c2565b81810381811115610c6157610c616119c2565b634e487b7160e01b600052600160045260246000fd5b600082611cdb57634e487b7160e01b600052601260045260246000fd5b500490565b8082028115828204841417610c6157610c616119c2565b6020815260008251806020840152611d16816040850160208701611b76565b601f01601f1916919091016040019291505056fe360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc4142434445464748494a4b4c4d4e4f505152535455565758595a6162636465666768696a6b6c6d6e6f707172737475767778797a303132333435363738392b2f416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a164736f6c6343000815000a0000000000000000000000005ff137d4b0fdcd49dca30c7cf57e578a026d2789" - } - ], - "isFixedGasLimit": false - } - ], - "receipts": [ - { - "transactionHash": "0xc70fe8b57bbe71707b6db85d3c4800bf76422f9cbab7507471b9d530f74f4404", - "transactionIndex": "0x4", - "blockHash": "0x255e6bc31421d70f3b48972fa7fa587cc4cc06ae471de668dd156b9cddc8a4bd", - "blockNumber": "0x607d23", - "from": "0x816a19a0e2baBcC5c4980C7d0567e14f25D86ee5", - "to": null, - "cumulativeGasUsed": "0x298fd7", - "gasUsed": "0x26b30f", - "contractAddress": "0xE4e6BF50E1fb02b323ca855dF0d8D76a75290FfC", - "logs": [ - { - "address": "0xBF8c428F0347A3a3bafEbeD8b43070B4184508CD", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000ff", - "blockHash": "0x255e6bc31421d70f3b48972fa7fa587cc4cc06ae471de668dd156b9cddc8a4bd", - "blockNumber": "0x607d23", - "transactionHash": "0xc70fe8b57bbe71707b6db85d3c4800bf76422f9cbab7507471b9d530f74f4404", - "transactionIndex": "0x4", - "logIndex": "0x2", - "removed": false - } - ], - "status": "0x1", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000002000000000000000000000000000000000800000040000000000000000000000000000000000000000000", - "type": "0x2", - "effectiveGasPrice": "0xe6a0ff92" - } - ], - "libraries": [], - "pending": [], - "returns": {}, - "timestamp": 1721165263, - "chain": 11155111, - "multi": false, - "commit": "a0820a6" -} \ No newline at end of file diff --git a/contracts/foundry.toml b/contracts/foundry.toml deleted file mode 100644 index 8d0069c..0000000 --- a/contracts/foundry.toml +++ /dev/null @@ -1,11 +0,0 @@ -[profile.default] -src = "src" -out = "out" -libs = ["lib"] - -bytecode_hash = "none" -solc_version = "0.8.21" - -[rpc_endpoints] -base_goerli = "https://goerli.base.org" -sepolia = "https://rpc.ankr.com/eth_sepolia" diff --git a/contracts/lib/account-abstraction b/contracts/lib/account-abstraction deleted file mode 160000 index 94cf025..0000000 --- a/contracts/lib/account-abstraction +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 94cf025ef1c07b4b404ecd1c732266b378caaa92 diff --git a/contracts/lib/forge-std b/contracts/lib/forge-std deleted file mode 160000 index f73c73d..0000000 --- a/contracts/lib/forge-std +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f73c73d2018eb6a111f35e4dae7b4f27401e9421 diff --git a/contracts/lib/openzeppelin-contracts b/contracts/lib/openzeppelin-contracts deleted file mode 160000 index 0457042..0000000 --- a/contracts/lib/openzeppelin-contracts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0457042d93d9dfd760dbaa06a4d2f1216fdbe297 diff --git a/contracts/lib/p256-verifier b/contracts/lib/p256-verifier deleted file mode 160000 index f13149e..0000000 --- a/contracts/lib/p256-verifier +++ /dev/null @@ -1 +0,0 @@ -Subproject commit f13149e962eff9a0bddd06d8191f6f4fa7eb0896 diff --git a/contracts/remappings.txt b/contracts/remappings.txt deleted file mode 100644 index 1a375b4..0000000 --- a/contracts/remappings.txt +++ /dev/null @@ -1,3 +0,0 @@ -p256-verifier/=lib/p256-verifier/src/ -account-abstraction/=lib/account-abstraction/contracts/ -@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/ \ No newline at end of file diff --git a/contracts/script/SimpleAccountFactory.s.sol b/contracts/script/SimpleAccountFactory.s.sol deleted file mode 100644 index 29f98d2..0000000 --- a/contracts/script/SimpleAccountFactory.s.sol +++ /dev/null @@ -1,22 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.13; - -import "forge-std/Script.sol"; -import "account-abstraction/interfaces/IEntryPoint.sol"; -import {SimpleAccountFactory} from "../src/SimpleAccountFactory.sol"; - -contract DeploySimpleAccountFactory is Script { - function run() public { - vm.startBroadcast(); - - // From https://docs.stackup.sh/docs/entity-addresses#entrypoint - IEntryPoint entryPoint = IEntryPoint( - 0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789 - ); - - SimpleAccountFactory factory = new SimpleAccountFactory(entryPoint); - console2.log("SimpleAccountFactory deployed at", address(factory)); - vm.stopBroadcast(); - } -} diff --git a/contracts/script/bash/deploy_factory.sh b/contracts/script/bash/deploy_factory.sh deleted file mode 100644 index b627d01..0000000 --- a/contracts/script/bash/deploy_factory.sh +++ /dev/null @@ -1 +0,0 @@ -# forge script DeploySimpleAccountFactory --private-key $PRIVATE_KEY --rpc-url https://goerli.base.org/ --etherscan-api-key $ETHERSCAN_API_KEY --verify --slow --broadcast \ No newline at end of file diff --git a/contracts/src/P256.sol b/contracts/src/P256.sol deleted file mode 100644 index 8bac358..0000000 --- a/contracts/src/P256.sol +++ /dev/null @@ -1,45 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.21; - -import "forge-std/console2.sol"; - -/** - * Helper library for external contracts to verify P256 signatures. - **/ -library P256 { - // We use our own copy of the P256Verifier contract, to be able to use it on Sepolia - address constant VERIFIER = 0x7a29Dc72fa3938705d91A9659455BC54731eD70F; - - function verifySignatureAllowMalleability( - bytes32 message_hash, - uint256 r, - uint256 s, - uint256 x, - uint256 y - ) internal view returns (bool) { - bytes memory args = abi.encode(message_hash, r, s, x, y); - (bool success, bytes memory ret) = VERIFIER.staticcall(args); - assert(success); // never reverts, always returns 0 or 1 - - return abi.decode(ret, (uint256)) == 1; - } - - /// P256 curve order n/2 for malleability check - uint256 constant P256_N_DIV_2 = - 57896044605178124381348723474703786764998477612067880171211129530534256022184; - - function verifySignature( - bytes32 message_hash, - uint256 r, - uint256 s, - uint256 x, - uint256 y - ) internal view returns (bool) { - // check for signature malleability - if (s > P256_N_DIV_2) { - return false; - } - - return verifySignatureAllowMalleability(message_hash, r, s, x, y); - } -} diff --git a/contracts/src/SimpleAccount.sol b/contracts/src/SimpleAccount.sol deleted file mode 100644 index d9d89a2..0000000 --- a/contracts/src/SimpleAccount.sol +++ /dev/null @@ -1,198 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.13; - -import "forge-std/console2.sol"; -import "account-abstraction/interfaces/IAccount.sol"; -import "account-abstraction/interfaces/IEntryPoint.sol"; -import "account-abstraction/core/Helpers.sol"; -import {WebAuthn} from "src/WebAuthn.sol"; -import "openzeppelin-contracts/contracts/interfaces/IERC1271.sol"; -import "@openzeppelin/contracts/proxy/utils/Initializable.sol"; -import "@openzeppelin/contracts/proxy/utils/UUPSUpgradeable.sol"; - -struct Signature { - bytes authenticatorData; - string clientDataJSON; - uint256 challengeLocation; - uint256 responseTypeLocation; - uint256 r; - uint256 s; -} - -struct Call { - address dest; - uint256 value; - bytes data; -} - -contract SimpleAccount is IAccount, UUPSUpgradeable, Initializable, IERC1271 { - struct PublicKey { - bytes32 X; - bytes32 Y; - } - - IEntryPoint public immutable entryPoint; - PublicKey public publicKey; - - event SimpleAccountInitialized( - IEntryPoint indexed entryPoint, - bytes32[2] pubKey - ); - - // Return value in case of signature failure, with no time-range. - // Equivalent to _packValidationData(true,0,0) - uint256 private constant _SIG_VALIDATION_FAILED = 1; - - constructor(IEntryPoint _entryPoint) { - entryPoint = _entryPoint; - _disableInitializers(); - } - - /** - * @dev The _entryPoint member is immutable, to reduce gas consumption. To upgrade EntryPoint, - * a new implementation of SimpleAccount must be deployed with the new EntryPoint address, then upgrading - * the implementation by calling `upgradeTo()` - */ - function initialize( - bytes32[2] memory aPublicKey - ) public virtual initializer { - _initialize(aPublicKey); - } - - function _initialize(bytes32[2] memory aPublicKey) internal virtual { - publicKey = PublicKey(aPublicKey[0], aPublicKey[1]); - emit SimpleAccountInitialized(entryPoint, [publicKey.X, publicKey.Y]); - } - - // solhint-disable-next-line no-empty-blocks - receive() external payable {} - - // solhint-disable-next-line no-empty-blocks - fallback() external payable {} - - function _onlyOwner() internal view { - //directly through the account itself (which gets redirected through execute()) - require(msg.sender == address(this), "only account itself can call"); - } - - /// Execute multiple transactions atomically. - function executeBatch(Call[] calldata calls) external onlyEntryPoint { - for (uint256 i = 0; i < calls.length; i++) { - _call(calls[i].dest, calls[i].value, calls[i].data); - } - } - - function _validateSignature( - bytes memory message, - bytes calldata signature - ) private view returns (bool) { - Signature memory sig = abi.decode(signature, (Signature)); - - return - WebAuthn.verifySignature({ - challenge: message, - authenticatorData: sig.authenticatorData, - requireUserVerification: false, - clientDataJSON: sig.clientDataJSON, - challengeLocation: sig.challengeLocation, - responseTypeLocation: sig.responseTypeLocation, - r: sig.r, - s: sig.s, - x: uint256(publicKey.X), - y: uint256(publicKey.Y) - }); - } - - function isValidSignature( - bytes32 message, - bytes calldata signature - ) external view override returns (bytes4 magicValue) { - if (_validateSignature(abi.encodePacked(message), signature)) { - return IERC1271(this).isValidSignature.selector; - } - return 0xffffffff; - } - - function _validateUserOpSignature( - UserOperation calldata userOp, - bytes32 userOpHash - ) private view returns (uint256 validationData) { - bytes memory messageToVerify; - bytes calldata signature; - ValidationData memory returnIfValid; - - uint256 sigLength = userOp.signature.length; - if (sigLength == 0) return _SIG_VALIDATION_FAILED; - - uint8 version = uint8(userOp.signature[0]); - if (version == 1) { - if (sigLength < 7) return _SIG_VALIDATION_FAILED; - uint48 validUntil = uint48(bytes6(userOp.signature[1:7])); - - signature = userOp.signature[7:]; // keySlot, signature - messageToVerify = abi.encodePacked(version, validUntil, userOpHash); - returnIfValid.validUntil = validUntil; - } else { - return _SIG_VALIDATION_FAILED; - } - - if (_validateSignature(messageToVerify, signature)) { - return _packValidationData(returnIfValid); - } - return _SIG_VALIDATION_FAILED; - } - - function _call(address target, uint256 value, bytes memory data) internal { - (bool success, bytes memory result) = target.call{value: value}(data); - if (!success) { - assembly { - revert(add(result, 32), mload(result)) - } - } - } - - function validateUserOp( - UserOperation calldata userOp, - bytes32 userOpHash, - uint256 missingAccountFunds - ) - external - virtual - override - onlyEntryPoint - returns (uint256 validationData) - { - // Note: `forge coverage` incorrectly marks this function and downstream - // as non-covered. - validationData = _validateUserOpSignature(userOp, userOpHash); - _payPrefund(missingAccountFunds); - } - - function _payPrefund(uint256 missingAccountFunds) private { - if (missingAccountFunds != 0) { - (bool success, ) = payable(msg.sender).call{ - value: missingAccountFunds, - gas: type(uint256).max - }(""); - (success); // no-op; silence unused variable warning - } - } - - modifier onlySelf() { - require(msg.sender == address(this), "only self"); - _; - } - - modifier onlyEntryPoint() { - require(msg.sender == address(entryPoint), "only entry point"); - _; - } - - /// UUPSUpsgradeable: only allow self-upgrade. - function _authorizeUpgrade( - address newImplementation - ) internal view override onlySelf { - (newImplementation); // No-op; silence unused parameter warning - } -} diff --git a/contracts/src/SimpleAccountFactory.sol b/contracts/src/SimpleAccountFactory.sol deleted file mode 100644 index d978908..0000000 --- a/contracts/src/SimpleAccountFactory.sol +++ /dev/null @@ -1,96 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.12; - -import "openzeppelin-contracts/contracts/utils/Create2.sol"; -import "openzeppelin-contracts/contracts/proxy/ERC1967/ERC1967Proxy.sol"; -import "src/SimpleAccount.sol"; - -struct User { - uint256 id; - bytes32[2] publicKey; - address account; -} - -/** - * A sample factory contract for SimpleAccount - * A UserOperations "initCode" holds the address of the factory, and a method call (to createAccount, in this sample factory). - * The factory's createAccount returns the target account address even if it is already installed. - * This way, the entryPoint.getSenderAddress() can be called either before or after the account is created. - */ -contract SimpleAccountFactory { - SimpleAccount public immutable accountImplem; - IEntryPoint public immutable entryPoint; - bytes32 public constant SALT = keccak256("hocuspocusxyz"); - - mapping(uint256 id => User user) public users; - - constructor(IEntryPoint _entryPoint) { - entryPoint = _entryPoint; - accountImplem = new SimpleAccount(_entryPoint); - } - - function saveUser(uint256 id, bytes32[2] memory publicKey) external { - users[id] = User(id, publicKey, this.getAddress(publicKey)); - } - - function getUser(uint256 id) external view returns (User memory) { - return users[id]; - } - - /** - * Create an account, and return its address. - * Returns the address even if the account is already deployed. - * Note that during UserOperation execution, this method is called only if the account is not deployed. - * This method returns an existing account address so that entryPoint.getSenderAddress() would work even after account creation. - */ - function createAccount( - bytes32[2] memory publicKey - ) external payable returns (SimpleAccount) { - address addr = getAddress(publicKey); - - // Prefund the account with msg.value - if (msg.value > 0) { - entryPoint.depositTo{value: msg.value}(addr); - } - - // Otherwise, no-op if the account is already deployed - uint codeSize = addr.code.length; - if (codeSize > 0) { - return SimpleAccount(payable(addr)); - } - - return - SimpleAccount( - payable( - new ERC1967Proxy{salt: SALT}( - address(accountImplem), - abi.encodeCall(SimpleAccount.initialize, (publicKey)) - ) - ) - ); - } - - /** - * Calculate the counterfactual address of this account as it would be returned by createAccount() - */ - function getAddress( - bytes32[2] memory publicKey - ) public view returns (address) { - return - Create2.computeAddress( - SALT, - keccak256( - abi.encodePacked( - type(ERC1967Proxy).creationCode, - abi.encode( - address(accountImplem), - abi.encodeCall( - SimpleAccount.initialize, - (publicKey) - ) - ) - ) - ) - ); - } -} diff --git a/contracts/src/WebAuthn.sol b/contracts/src/WebAuthn.sol deleted file mode 100644 index 10f4956..0000000 --- a/contracts/src/WebAuthn.sol +++ /dev/null @@ -1,172 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity 0.8.21; - -import {P256} from "src/P256.sol"; -import "p256-verifier/utils/Base64URL.sol"; -import "forge-std/console2.sol"; - -/** - * Helper library for external contracts to verify WebAuthn signatures. - **/ -library WebAuthn { - /// Checks whether substr occurs in str starting at a given byte offset. - function contains( - string memory substr, - string memory str, - uint256 location - ) internal pure returns (bool) { - bytes memory substrBytes = bytes(substr); - bytes memory strBytes = bytes(str); - - uint256 substrLen = substrBytes.length; - uint256 strLen = strBytes.length; - - for (uint256 i = 0; i < substrLen; i++) { - if (location + i >= strLen) { - return false; - } - - if (substrBytes[i] != strBytes[location + i]) { - return false; - } - } - - return true; - } - - bytes1 constant AUTH_DATA_FLAGS_UP = 0x01; // Bit 0 - bytes1 constant AUTH_DATA_FLAGS_UV = 0x04; // Bit 2 - bytes1 constant AUTH_DATA_FLAGS_BE = 0x08; // Bit 3 - bytes1 constant AUTH_DATA_FLAGS_BS = 0x10; // Bit 4 - - /// Verifies the authFlags in authenticatorData. Numbers in inline comment - /// correspond to the same numbered bullets in - /// https://w3c.github.io/webauthn/#sctn-verifying-assertion. - function checkAuthFlags( - bytes1 flags, - bool requireUserVerification - ) internal pure returns (bool) { - // 17. Verify that the UP bit of the flags in authData is set. - if (flags & AUTH_DATA_FLAGS_UP != AUTH_DATA_FLAGS_UP) { - return false; - } - - // 18. If user verification was determined to be required, verify that - // the UV bit of the flags in authData is set. Otherwise, ignore the - // value of the UV flag. - if ( - requireUserVerification && - (flags & AUTH_DATA_FLAGS_UV) != AUTH_DATA_FLAGS_UV - ) { - return false; - } - - // 19. If the BE bit of the flags in authData is not set, verify that - // the BS bit is not set. - if (flags & AUTH_DATA_FLAGS_BE != AUTH_DATA_FLAGS_BE) { - if (flags & AUTH_DATA_FLAGS_BS == AUTH_DATA_FLAGS_BS) { - return false; - } - } - - return true; - } - - /** - * Verifies a Webauthn P256 signature (Authentication Assertion) as described - * in https://w3c.github.io/webauthn/#sctn-verifying-assertion. We do not - * verify all the steps as described in the specification, only ones relevant - * to our context. Please carefully read through this list before usage. - * Specifically, we do verify the following: - * - Verify that authenticatorData (which comes from the authenticator, - * such as iCloud Keychain) indicates a well-formed assertion. If - * requireUserVerification is set, checks that the authenticator enforced - * user verification. User verification should be required if, - * and only if, options.userVerification is set to required in the request - * - Verifies that the client JSON is of type "webauthn.get", i.e. the client - * was responding to a request to assert authentication. - * - Verifies that the client JSON contains the requested challenge. - * - Finally, verifies that (r, s) constitute a valid signature over both - * the authenicatorData and client JSON, for public key (x, y). - * - * We make some assumptions about the particular use case of this verifier, - * so we do NOT verify the following: - * - Does NOT verify that the origin in the clientDataJSON matches the - * Relying Party's origin: It is considered the authenticator's - * responsibility to ensure that the user is interacting with the correct - * RP. This is enforced by most high quality authenticators properly, - * particularly the iCloud Keychain and Google Password Manager were - * tested. - * - Does NOT verify That c.topOrigin is well-formed: We assume c.topOrigin - * would never be present, i.e. the credentials are never used in a - * cross-origin/iframe context. The website/app set up should disallow - * cross-origin usage of the credentials. This is the default behaviour for - * created credentials in common settings. - * - Does NOT verify that the rpIdHash in authData is the SHA-256 hash of an - * RP ID expected by the Relying Party: This means that we rely on the - * authenticator to properly enforce credentials to be used only by the - * correct RP. This is generally enforced with features like Apple App Site - * Association and Google Asset Links. To protect from edge cases in which - * a previously-linked RP ID is removed from the authorised RP IDs, - * we recommend that messages signed by the authenticator include some - * expiry mechanism. - * - Does NOT verify the credential backup state: This assumes the credential - * backup state is NOT used as part of Relying Party business logic or - * policy. - * - Does NOT verify the values of the client extension outputs: This assumes - * that the Relying Party does not use client extension outputs. - * - Does NOT verify the signature counter: Signature counters are intended - * to enable risk scoring for the Relying Party. This assumes risk scoring - * is not used as part of Relying Party business logic or policy. - * - Does NOT verify the attestation object: This assumes that - * response.attestationObject is NOT present in the response, i.e. the - * RP does not intend to verify an attestation. - */ - function verifySignature( - bytes memory challenge, - bytes memory authenticatorData, - bool requireUserVerification, - string memory clientDataJSON, - uint256 challengeLocation, - uint256 responseTypeLocation, - uint256 r, - uint256 s, - uint256 x, - uint256 y - ) internal view returns (bool) { - // Check that authenticatorData has good flags - if ( - authenticatorData.length < 32 || - !checkAuthFlags(authenticatorData[32], requireUserVerification) - ) { - return false; - } - - // Check that response is for an authentication assertion - string memory responseType = '"type":"webauthn.get"'; - if (!contains(responseType, clientDataJSON, responseTypeLocation)) { - return false; - } - - // Check that challenge is in the clientDataJSON - string memory challengeB64url = Base64URL.encode(challenge); - string memory challengeProperty = string.concat( - '"challenge":"', - challengeB64url, - '"' - ); - - if (!contains(challengeProperty, clientDataJSON, challengeLocation)) { - return false; - } - - // Check that the public key signed sha256(authenticatorData || sha256(clientDataJSON)) - bytes32 clientDataJSONHash = sha256(bytes(clientDataJSON)); - bytes32 messageHash = sha256( - abi.encodePacked(authenticatorData, clientDataJSONHash) - ); - - // check that the signature is valid while allowing malleability - return P256.verifySignatureAllowMalleability(messageHash, r, s, x, y); - } -} diff --git a/contracts/test/SendUserOp.t.sol b/contracts/test/SendUserOp.t.sol deleted file mode 100644 index 3193075..0000000 --- a/contracts/test/SendUserOp.t.sol +++ /dev/null @@ -1,240 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.13; - -import "forge-std/Test.sol"; -import {Utils} from "test/Utils.sol"; -// use Openzeppelin v4.8.1 to avoid `Failed to resolve file` error -import "account-abstraction/core/EntryPoint.sol"; -import {SimpleAccountFactory} from "src/SimpleAccountFactory.sol"; -import {SimpleAccount, Call} from "src/SimpleAccount.sol"; - -contract SendUserOpTest is Test { - using UserOperationLib for UserOperation; - - EntryPoint public entryPoint; - SimpleAccountFactory public factory; - address bigqDevAddress = 0x061060a65146b3265C62fC8f3AE977c9B27260fF; - - function setUp() public { - // setup fork - vm.createSelectFork("sepolia"); - - entryPoint = EntryPoint( - payable(0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789) - ); - factory = SimpleAccountFactory( - 0xDD0f9cB4Cf53d28b976C13e7ee4a169F841924c0 - ); - } - - /*** - * An event emitted after each successful request - * @param userOpHash - unique identifier for the request (hash its entire content, except signature). - * @param sender - the account that generates this request. - * @param paymaster - if non-null, the paymaster that pays for this request. - * @param nonce - the nonce value from the request. - * @param success - true if the sender transaction succeeded, false if reverted. - * @param actualGasCost - actual amount paid (by account or paymaster) for this UserOperation. - * @param actualGasUsed - total gas used by this UserOperation (including preVerification, creation, validation and execution). - */ - event UserOperationEvent( - bytes32 indexed userOpHash, - address indexed sender, - address indexed paymaster, - uint256 nonce, - bool success, - uint256 actualGasCost, - uint256 actualGasUsed - ); - - function testSimpleUserOp() public { - bytes32[2] memory publicKey = [ - bytes32( - 0xe7f630b0eb3594e991cfadbd4047cd5fecddf379b4a4458e3ea2b9566e09882a - ), - bytes32( - 0x3e9775709101f2b294ddec0536f0f260570b6f009bff2096995d3e1d986239dd - ) - ]; - - uint8 version = 1; - uint48 validUntil = 0; - bytes32 expectedUserOpHash = hex"e97f70cada097ce881426a3f199e4f95895765659985161e1930def8e1f7b04f"; - bytes memory challengeToSign = abi.encodePacked( - version, - validUntil, - expectedUserOpHash - ); - - bytes memory ownerSig = abi.encodePacked( - version, - validUntil, - abi.encode( // signature - Utils.rawSignatureToSignature({ - challenge: challengeToSign, - r: 0xafb3561771f09d5119b12350f9089874e21a193a37b40c3f872ff4a93730f727, - s: 0x9f2756dc68bd36de31ed67b3f775bf604e86547867796e9679d4b4673aef81e9 - }) - ) - ); - - SimpleAccount account = factory.createAccount(publicKey); - vm.deal(address(account), 1 ether); - - // dummy op - UserOperation memory op = UserOperation({ - sender: address(0), - nonce: 0, - initCode: hex"", - callData: hex"00", - callGasLimit: 0, - verificationGasLimit: 150000, - preVerificationGas: 21000, - maxFeePerGas: 0, - maxPriorityFeePerGas: 1e9, - paymasterAndData: hex"", - // signature must be empty when calculating hash - signature: hex"00" - }); - - // fill data - op.sender = address(account); - op.callGasLimit = 200000; - op.verificationGasLimit = 2000000; - op.maxFeePerGas = 3e9; - - bytes32 hash = entryPoint.getUserOpHash(op); - assertEq(expectedUserOpHash, hash); - - // add signature to op after calculating hash - op.signature = ownerSig; - - UserOperation[] memory ops = new UserOperation[](1); - ops[0] = op; - vm.expectEmit(true, true, true, false); - emit UserOperationEvent( - hash, - address(account), - address(0), - 0, // These and following are not checked. - false, - 0 gwei, - 0 - ); - entryPoint.handleOps(ops, payable(address(account))); - - // call validateUserOp directly - SimpleAccount account2 = new SimpleAccount(account.entryPoint()); - vm.store(address(account2), 0, 0); // set _initialized = 0 - account2.initialize(publicKey); - vm.prank(address(entryPoint)); - uint256 validationData = account2.validateUserOp(op, hash, 0); - assertEq(validationData, 0); - } - - function testUserOpWithInitCode() public { - bytes32[2] memory publicKey = [ - bytes32( - 0xe7f630b0eb3594e991cfadbd4047cd5fecddf379b4a4458e3ea2b9566e09882a - ), - bytes32( - 0x3e9775709101f2b294ddec0536f0f260570b6f009bff2096995d3e1d986239dd - ) - ]; - - uint8 version = 1; - uint48 validUntil = 0; - bytes32 expectedUserOpHash = hex"2215b15dca57f3e9431889b9355a2ad6f0de47ed49e225779f499cd851441528"; - bytes memory challengeToSign = abi.encodePacked( - version, - validUntil, - expectedUserOpHash - ); - - bytes memory ownerSig = abi.encodePacked( - version, - validUntil, - abi.encode( // signature - Utils.rawSignatureToSignature({ - challenge: challengeToSign, - r: 0x5bfe729e37e1849b62d5409c600e39c8394df69e86ba55f91de5728431fad828, - s: 0xb0ecaa260794c4993b46216ca08c4432f5c2fe070ea4e7347612c21663eca932 - }) - ) - ); - - // account not deployed yet - // we want to test the initCode feature of UserOperation - SimpleAccount account = SimpleAccount( - payable(0xa3ec6EEeDb3bBcAA232e5a8836A5745455098327) - ); - vm.deal(address(account), 1 ether); - - // get init code - bytes memory initCode = abi.encodePacked( - address(factory), - abi.encodeCall(factory.createAccount, (publicKey)) - ); - - // send 42 wei to another smart wallet - SimpleAccount otherAccount = factory.createAccount( - [bytes32(uint256(0x1)), bytes32(uint256(0x2))] - ); - Call[] memory calls = new Call[](1); - calls[0] = Call({dest: address(otherAccount), value: 42, data: hex""}); - - bytes memory callData = abi.encodeCall( - SimpleAccount.executeBatch, - (calls) - ); - - // dummy op - UserOperation memory op = UserOperation({ - sender: address(0), - nonce: 0, - initCode: hex"", - callData: callData, - callGasLimit: 200_000, - verificationGasLimit: 2_342_060, // 2_000_000 + 150_000 + initCode gas - preVerificationGas: 65_000, - maxFeePerGas: 3e9, - maxPriorityFeePerGas: 1e9, - paymasterAndData: hex"", - // signature must be empty when calculating hash - signature: hex"" - }); - - // fill data - op.sender = address(account); - op.initCode = initCode; - - bytes32 hash = entryPoint.getUserOpHash(op); - assertEq(expectedUserOpHash, hash); - - // add signature to op after calculating hash - op.signature = ownerSig; - - // compute balance before userOp validation and execution - uint256 balanceBefore = address(otherAccount).balance; - - UserOperation[] memory ops = new UserOperation[](1); - ops[0] = op; - - vm.expectEmit(true, true, true, false); - emit UserOperationEvent( - hash, - address(account), - address(0), - 0, // These and following are not checked. - false, - 0 gwei, - 0 - ); - entryPoint.handleOps(ops, payable(address(account))); - - // compute balance after userOp validation and execution - uint256 balanceAfter = address(otherAccount).balance; - assertEq(balanceAfter - balanceBefore, 42); - } -} diff --git a/contracts/test/SimpleFactory.t.sol b/contracts/test/SimpleFactory.t.sol deleted file mode 100644 index 0c348da..0000000 --- a/contracts/test/SimpleFactory.t.sol +++ /dev/null @@ -1,53 +0,0 @@ -// SPDX-License-Identifier: MIT - -pragma solidity ^0.8.13; - -import "forge-std/Test.sol"; -// use Openzeppelin v4.8.1 to avoid `Failed to resolve file` error -import "account-abstraction/core/EntryPoint.sol"; -import {SimpleAccountFactory, User} from "src/SimpleAccountFactory.sol"; -import {SimpleAccount} from "src/SimpleAccount.sol"; - -contract SimpleFactoryTest is Test { - using UserOperationLib for UserOperation; - - EntryPoint public entrypoint; - SimpleAccountFactory public factory; - - function setUp() public { - entrypoint = new EntryPoint(); - factory = new SimpleAccountFactory(entrypoint); - } - - function testDeploy() public { - // random public key - bytes32[2] memory pubKey = [bytes32(uint256(1)), bytes32(uint256(1))]; - - // deploy the account - SimpleAccount account = factory.createAccount{value: 0}(pubKey); - - // deploy again - should return the same address - SimpleAccount account2 = factory.createAccount{value: 2}(pubKey); - assertEq(address(account), address(account2)); - assertEq(entrypoint.getDepositInfo(address(account)).deposit, 2); - - // compute address manually - address expectedAddress = factory.getAddress(pubKey); - assertEq(address(account), expectedAddress); - } - - function testUserCreation() public { - // random public key - bytes32[2] memory pubKey = [bytes32(uint256(1)), bytes32(uint256(1))]; - - // create user - factory.saveUser(1, pubKey); - - // get user - User memory user = factory.getUser(1); - assertEq(user.id, 1); - assertEq(user.publicKey[0], pubKey[0]); - assertEq(user.publicKey[1], pubKey[1]); - assertEq(user.account, factory.getAddress(pubKey)); - } -} diff --git a/contracts/test/Utils.sol b/contracts/test/Utils.sol deleted file mode 100644 index 1d77897..0000000 --- a/contracts/test/Utils.sol +++ /dev/null @@ -1,40 +0,0 @@ -// SPDX-License-Identifier: MIT -pragma solidity ^0.8.13; - -import "forge-std/Test.sol"; -import "forge-std/console2.sol"; -import "../src/SimpleAccount.sol"; -import "p256-verifier/utils/Base64URL.sol"; - -library Utils { - function rawSignatureToSignature( - bytes memory challenge, - uint256 r, - uint256 s - ) public pure returns (Signature memory) { - string memory challengeb64url = Base64URL.encode(challenge); - string memory clientDataJSON = string( - abi.encodePacked( - '{"type":"webauthn.get","challenge":"', - challengeb64url, - '","origin":"http://localhost:3000","crossOrigin":false}' - ) - ); - - uint256 challengeLocation = 23; - uint256 responseTypeLocation = 1; - - bytes - memory authenticatorData = hex"49960de5880e8c687434170f6476605b8fe4aeb9a28632c7995cf3ba831d97630500000000"; - - return - Signature({ - authenticatorData: authenticatorData, - clientDataJSON: clientDataJSON, - challengeLocation: challengeLocation, - responseTypeLocation: responseTypeLocation, - r: r, - s: s - }); - } -} diff --git a/front/next.config.js b/next.config.js similarity index 100% rename from front/next.config.js rename to next.config.js diff --git a/front/package.json b/package.json similarity index 100% rename from front/package.json rename to package.json diff --git a/front/pnpm-lock.yaml b/pnpm-lock.yaml similarity index 100% rename from front/pnpm-lock.yaml rename to pnpm-lock.yaml diff --git a/front/src/app/(home)/page.tsx b/src/app/(home)/page.tsx similarity index 100% rename from front/src/app/(home)/page.tsx rename to src/app/(home)/page.tsx diff --git a/front/src/app/api/balance/[address]/route.ts b/src/app/api/balance/[address]/route.ts similarity index 100% rename from front/src/app/api/balance/[address]/route.ts rename to src/app/api/balance/[address]/route.ts diff --git a/front/src/app/api/price/route.ts b/src/app/api/price/route.ts similarity index 100% rename from front/src/app/api/price/route.ts rename to src/app/api/price/route.ts diff --git a/front/src/app/api/users/[pubKey]/route.ts b/src/app/api/users/[pubKey]/route.ts similarity index 100% rename from front/src/app/api/users/[pubKey]/route.ts rename to src/app/api/users/[pubKey]/route.ts diff --git a/front/src/app/api/users/save/route.ts b/src/app/api/users/save/route.ts similarity index 100% rename from front/src/app/api/users/save/route.ts rename to src/app/api/users/save/route.ts diff --git a/front/src/app/connect/page.tsx b/src/app/connect/page.tsx similarity index 100% rename from front/src/app/connect/page.tsx rename to src/app/connect/page.tsx diff --git a/front/src/app/favicon.ico b/src/app/favicon.ico similarity index 100% rename from front/src/app/favicon.ico rename to src/app/favicon.ico diff --git a/front/src/app/globals.css b/src/app/globals.css similarity index 100% rename from front/src/app/globals.css rename to src/app/globals.css diff --git a/front/src/app/layout.tsx b/src/app/layout.tsx similarity index 100% rename from front/src/app/layout.tsx rename to src/app/layout.tsx diff --git a/front/src/app/settings/page.tsx b/src/app/settings/page.tsx similarity index 100% rename from front/src/app/settings/page.tsx rename to src/app/settings/page.tsx diff --git a/front/src/components/Address/index.tsx b/src/components/Address/index.tsx similarity index 100% rename from front/src/components/Address/index.tsx rename to src/components/Address/index.tsx diff --git a/front/src/components/Balance/index.tsx b/src/components/Balance/index.tsx similarity index 100% rename from front/src/components/Balance/index.tsx rename to src/components/Balance/index.tsx diff --git a/front/src/components/BaseLogo/index.tsx b/src/components/BaseLogo/index.tsx similarity index 100% rename from front/src/components/BaseLogo/index.tsx rename to src/components/BaseLogo/index.tsx diff --git a/front/src/components/EIP712Renderer/index.tsx b/src/components/EIP712Renderer/index.tsx similarity index 100% rename from front/src/components/EIP712Renderer/index.tsx rename to src/components/EIP712Renderer/index.tsx diff --git a/front/src/components/History/index.tsx b/src/components/History/index.tsx similarity index 100% rename from front/src/components/History/index.tsx rename to src/components/History/index.tsx diff --git a/front/src/components/HomePage/index.tsx b/src/components/HomePage/index.tsx similarity index 100% rename from front/src/components/HomePage/index.tsx rename to src/components/HomePage/index.tsx diff --git a/front/src/components/LogoAnimated/index.tsx b/src/components/LogoAnimated/index.tsx similarity index 100% rename from front/src/components/LogoAnimated/index.tsx rename to src/components/LogoAnimated/index.tsx diff --git a/front/src/components/LogoAnimated/logo-animated.css b/src/components/LogoAnimated/logo-animated.css similarity index 100% rename from front/src/components/LogoAnimated/logo-animated.css rename to src/components/LogoAnimated/logo-animated.css diff --git a/front/src/components/LogoAnimatedLight/index.tsx b/src/components/LogoAnimatedLight/index.tsx similarity index 100% rename from front/src/components/LogoAnimatedLight/index.tsx rename to src/components/LogoAnimatedLight/index.tsx diff --git a/front/src/components/LogoAnimatedLight/logo-animated.css b/src/components/LogoAnimatedLight/logo-animated.css similarity index 100% rename from front/src/components/LogoAnimatedLight/logo-animated.css rename to src/components/LogoAnimatedLight/logo-animated.css diff --git a/front/src/components/NavBar/index.tsx b/src/components/NavBar/index.tsx similarity index 100% rename from front/src/components/NavBar/index.tsx rename to src/components/NavBar/index.tsx diff --git a/front/src/components/OnBoarding/index.tsx b/src/components/OnBoarding/index.tsx similarity index 100% rename from front/src/components/OnBoarding/index.tsx rename to src/components/OnBoarding/index.tsx diff --git a/front/src/components/QrReaderModal/index.tsx b/src/components/QrReaderModal/index.tsx similarity index 100% rename from front/src/components/QrReaderModal/index.tsx rename to src/components/QrReaderModal/index.tsx diff --git a/front/src/components/SendTxModal/index.tsx b/src/components/SendTxModal/index.tsx similarity index 100% rename from front/src/components/SendTxModal/index.tsx rename to src/components/SendTxModal/index.tsx diff --git a/front/src/components/SessionCard/index.tsx b/src/components/SessionCard/index.tsx similarity index 100% rename from front/src/components/SessionCard/index.tsx rename to src/components/SessionCard/index.tsx diff --git a/front/src/components/SettingsPage/index.tsx b/src/components/SettingsPage/index.tsx similarity index 100% rename from front/src/components/SettingsPage/index.tsx rename to src/components/SettingsPage/index.tsx diff --git a/front/src/components/Spinner/index.tsx b/src/components/Spinner/index.tsx similarity index 100% rename from front/src/components/Spinner/index.tsx rename to src/components/Spinner/index.tsx diff --git a/front/src/components/Spinner/spinner.css b/src/components/Spinner/spinner.css similarity index 100% rename from front/src/components/Spinner/spinner.css rename to src/components/Spinner/spinner.css diff --git a/front/src/components/ThemeButton/index.tsx b/src/components/ThemeButton/index.tsx similarity index 100% rename from front/src/components/ThemeButton/index.tsx rename to src/components/ThemeButton/index.tsx diff --git a/front/src/components/TopBar/index.tsx b/src/components/TopBar/index.tsx similarity index 100% rename from front/src/components/TopBar/index.tsx rename to src/components/TopBar/index.tsx diff --git a/front/src/components/WCNotSupportedModal/index.tsx b/src/components/WCNotSupportedModal/index.tsx similarity index 100% rename from front/src/components/WCNotSupportedModal/index.tsx rename to src/components/WCNotSupportedModal/index.tsx diff --git a/front/src/components/WCSendTransactionModal/index.tsx b/src/components/WCSendTransactionModal/index.tsx similarity index 100% rename from front/src/components/WCSendTransactionModal/index.tsx rename to src/components/WCSendTransactionModal/index.tsx diff --git a/front/src/components/WCSignModal/index.tsx b/src/components/WCSignModal/index.tsx similarity index 100% rename from front/src/components/WCSignModal/index.tsx rename to src/components/WCSignModal/index.tsx diff --git a/front/src/constants/abi/CoinbaseSmartWallet.ts b/src/constants/abi/CoinbaseSmartWallet.ts similarity index 100% rename from front/src/constants/abi/CoinbaseSmartWallet.ts rename to src/constants/abi/CoinbaseSmartWallet.ts diff --git a/front/src/constants/abi/CoinbaseSmartWalletFactory.ts b/src/constants/abi/CoinbaseSmartWalletFactory.ts similarity index 100% rename from front/src/constants/abi/CoinbaseSmartWalletFactory.ts rename to src/constants/abi/CoinbaseSmartWalletFactory.ts diff --git a/front/src/constants/client.ts b/src/constants/client.ts similarity index 100% rename from front/src/constants/client.ts rename to src/constants/client.ts diff --git a/front/src/constants/entryPoint.ts b/src/constants/entryPoint.ts similarity index 100% rename from front/src/constants/entryPoint.ts rename to src/constants/entryPoint.ts diff --git a/front/src/constants/factory.ts b/src/constants/factory.ts similarity index 100% rename from front/src/constants/factory.ts rename to src/constants/factory.ts diff --git a/front/src/constants/index.ts b/src/constants/index.ts similarity index 100% rename from front/src/constants/index.ts rename to src/constants/index.ts diff --git a/front/src/hooks/useDebounce.ts b/src/hooks/useDebounce.ts similarity index 100% rename from front/src/hooks/useDebounce.ts rename to src/hooks/useDebounce.ts diff --git a/front/src/libs/factory/getBalance.ts b/src/libs/factory/getBalance.ts similarity index 100% rename from front/src/libs/factory/getBalance.ts rename to src/libs/factory/getBalance.ts diff --git a/front/src/libs/factory/getUser.ts b/src/libs/factory/getUser.ts similarity index 100% rename from front/src/libs/factory/getUser.ts rename to src/libs/factory/getUser.ts diff --git a/front/src/libs/factory/index.ts b/src/libs/factory/index.ts similarity index 100% rename from front/src/libs/factory/index.ts rename to src/libs/factory/index.ts diff --git a/front/src/libs/factory/saveUser.ts b/src/libs/factory/saveUser.ts similarity index 100% rename from front/src/libs/factory/saveUser.ts rename to src/libs/factory/saveUser.ts diff --git a/front/src/libs/smart-wallet/SmartWalletProvider.tsx b/src/libs/smart-wallet/SmartWalletProvider.tsx similarity index 100% rename from front/src/libs/smart-wallet/SmartWalletProvider.tsx rename to src/libs/smart-wallet/SmartWalletProvider.tsx diff --git a/front/src/libs/smart-wallet/config/index.tsx b/src/libs/smart-wallet/config/index.tsx similarity index 100% rename from front/src/libs/smart-wallet/config/index.tsx rename to src/libs/smart-wallet/config/index.tsx diff --git a/front/src/libs/smart-wallet/hook/useSmartWalletHook.tsx b/src/libs/smart-wallet/hook/useSmartWalletHook.tsx similarity index 100% rename from front/src/libs/smart-wallet/hook/useSmartWalletHook.tsx rename to src/libs/smart-wallet/hook/useSmartWalletHook.tsx diff --git a/front/src/libs/smart-wallet/index.ts b/src/libs/smart-wallet/index.ts similarity index 100% rename from front/src/libs/smart-wallet/index.ts rename to src/libs/smart-wallet/index.ts diff --git a/front/src/libs/smart-wallet/service/actions/estimateUserOperationGas.ts b/src/libs/smart-wallet/service/actions/estimateUserOperationGas.ts similarity index 100% rename from front/src/libs/smart-wallet/service/actions/estimateUserOperationGas.ts rename to src/libs/smart-wallet/service/actions/estimateUserOperationGas.ts diff --git a/front/src/libs/smart-wallet/service/actions/getIsValidSignature.ts b/src/libs/smart-wallet/service/actions/getIsValidSignature.ts similarity index 100% rename from front/src/libs/smart-wallet/service/actions/getIsValidSignature.ts rename to src/libs/smart-wallet/service/actions/getIsValidSignature.ts diff --git a/front/src/libs/smart-wallet/service/actions/getUserOperationReceipt.ts b/src/libs/smart-wallet/service/actions/getUserOperationReceipt.ts similarity index 100% rename from front/src/libs/smart-wallet/service/actions/getUserOperationReceipt.ts rename to src/libs/smart-wallet/service/actions/getUserOperationReceipt.ts diff --git a/front/src/libs/smart-wallet/service/actions/index.ts b/src/libs/smart-wallet/service/actions/index.ts similarity index 100% rename from front/src/libs/smart-wallet/service/actions/index.ts rename to src/libs/smart-wallet/service/actions/index.ts diff --git a/front/src/libs/smart-wallet/service/actions/sendUserOperation.ts b/src/libs/smart-wallet/service/actions/sendUserOperation.ts similarity index 100% rename from front/src/libs/smart-wallet/service/actions/sendUserOperation.ts rename to src/libs/smart-wallet/service/actions/sendUserOperation.ts diff --git a/front/src/libs/smart-wallet/service/actions/waitForUserOperationReceipt.ts b/src/libs/smart-wallet/service/actions/waitForUserOperationReceipt.ts similarity index 100% rename from front/src/libs/smart-wallet/service/actions/waitForUserOperationReceipt.ts rename to src/libs/smart-wallet/service/actions/waitForUserOperationReceipt.ts diff --git a/front/src/libs/smart-wallet/service/decorators/index.ts b/src/libs/smart-wallet/service/decorators/index.ts similarity index 100% rename from front/src/libs/smart-wallet/service/decorators/index.ts rename to src/libs/smart-wallet/service/decorators/index.ts diff --git a/front/src/libs/smart-wallet/service/smart-wallet.ts b/src/libs/smart-wallet/service/smart-wallet.ts similarity index 100% rename from front/src/libs/smart-wallet/service/smart-wallet.ts rename to src/libs/smart-wallet/service/smart-wallet.ts diff --git a/front/src/libs/smart-wallet/service/userOps/builder.ts b/src/libs/smart-wallet/service/userOps/builder.ts similarity index 100% rename from front/src/libs/smart-wallet/service/userOps/builder.ts rename to src/libs/smart-wallet/service/userOps/builder.ts diff --git a/front/src/libs/smart-wallet/service/userOps/constants.ts b/src/libs/smart-wallet/service/userOps/constants.ts similarity index 100% rename from front/src/libs/smart-wallet/service/userOps/constants.ts rename to src/libs/smart-wallet/service/userOps/constants.ts diff --git a/front/src/libs/smart-wallet/service/userOps/index.ts b/src/libs/smart-wallet/service/userOps/index.ts similarity index 100% rename from front/src/libs/smart-wallet/service/userOps/index.ts rename to src/libs/smart-wallet/service/userOps/index.ts diff --git a/front/src/libs/smart-wallet/service/userOps/types.ts b/src/libs/smart-wallet/service/userOps/types.ts similarity index 100% rename from front/src/libs/smart-wallet/service/userOps/types.ts rename to src/libs/smart-wallet/service/userOps/types.ts diff --git a/front/src/libs/wallet-connect/ModalOnWCEvent.tsx b/src/libs/wallet-connect/ModalOnWCEvent.tsx similarity index 100% rename from front/src/libs/wallet-connect/ModalOnWCEvent.tsx rename to src/libs/wallet-connect/ModalOnWCEvent.tsx diff --git a/front/src/libs/wallet-connect/WalletConnectProvider.tsx b/src/libs/wallet-connect/WalletConnectProvider.tsx similarity index 100% rename from front/src/libs/wallet-connect/WalletConnectProvider.tsx rename to src/libs/wallet-connect/WalletConnectProvider.tsx diff --git a/front/src/libs/wallet-connect/config/EIP155.ts b/src/libs/wallet-connect/config/EIP155.ts similarity index 100% rename from front/src/libs/wallet-connect/config/EIP155.ts rename to src/libs/wallet-connect/config/EIP155.ts diff --git a/front/src/libs/wallet-connect/config/common.ts b/src/libs/wallet-connect/config/common.ts similarity index 100% rename from front/src/libs/wallet-connect/config/common.ts rename to src/libs/wallet-connect/config/common.ts diff --git a/front/src/libs/wallet-connect/config/index.ts b/src/libs/wallet-connect/config/index.ts similarity index 100% rename from front/src/libs/wallet-connect/config/index.ts rename to src/libs/wallet-connect/config/index.ts diff --git a/front/src/libs/wallet-connect/hook/useWalletConnectHook.tsx b/src/libs/wallet-connect/hook/useWalletConnectHook.tsx similarity index 100% rename from front/src/libs/wallet-connect/hook/useWalletConnectHook.tsx rename to src/libs/wallet-connect/hook/useWalletConnectHook.tsx diff --git a/front/src/libs/wallet-connect/index.ts b/src/libs/wallet-connect/index.ts similarity index 100% rename from front/src/libs/wallet-connect/index.ts rename to src/libs/wallet-connect/index.ts diff --git a/front/src/libs/wallet-connect/service/wallet-connect.ts b/src/libs/wallet-connect/service/wallet-connect.ts similarity index 100% rename from front/src/libs/wallet-connect/service/wallet-connect.ts rename to src/libs/wallet-connect/service/wallet-connect.ts diff --git a/front/src/libs/web-authn/index.ts b/src/libs/web-authn/index.ts similarity index 100% rename from front/src/libs/web-authn/index.ts rename to src/libs/web-authn/index.ts diff --git a/front/src/libs/web-authn/service/web-authn.ts b/src/libs/web-authn/service/web-authn.ts similarity index 100% rename from front/src/libs/web-authn/service/web-authn.ts rename to src/libs/web-authn/service/web-authn.ts diff --git a/front/src/libs/web-authn/types.ts b/src/libs/web-authn/types.ts similarity index 100% rename from front/src/libs/web-authn/types.ts rename to src/libs/web-authn/types.ts diff --git a/front/src/providers/BalanceProvider/index.tsx b/src/providers/BalanceProvider/index.tsx similarity index 100% rename from front/src/providers/BalanceProvider/index.tsx rename to src/providers/BalanceProvider/index.tsx diff --git a/front/src/providers/MeProvider/index.tsx b/src/providers/MeProvider/index.tsx similarity index 100% rename from front/src/providers/MeProvider/index.tsx rename to src/providers/MeProvider/index.tsx diff --git a/front/src/providers/ModalProvider/index.tsx b/src/providers/ModalProvider/index.tsx similarity index 100% rename from front/src/providers/ModalProvider/index.tsx rename to src/providers/ModalProvider/index.tsx diff --git a/front/src/providers/ThemeProvider/index.tsx b/src/providers/ThemeProvider/index.tsx similarity index 100% rename from front/src/providers/ThemeProvider/index.tsx rename to src/providers/ThemeProvider/index.tsx diff --git a/front/src/utils/SCWKeyManager.ts b/src/utils/SCWKeyManager.ts similarity index 100% rename from front/src/utils/SCWKeyManager.ts rename to src/utils/SCWKeyManager.ts diff --git a/front/src/utils/ScopedLocalStorage.ts b/src/utils/ScopedLocalStorage.ts similarity index 100% rename from front/src/utils/ScopedLocalStorage.ts rename to src/utils/ScopedLocalStorage.ts diff --git a/front/src/utils/arrayConcat.ts b/src/utils/arrayConcat.ts similarity index 100% rename from front/src/utils/arrayConcat.ts rename to src/utils/arrayConcat.ts diff --git a/front/src/utils/cipher.ts b/src/utils/cipher.ts similarity index 100% rename from front/src/utils/cipher.ts rename to src/utils/cipher.ts diff --git a/front/src/utils/fromBase64ToHex.ts b/src/utils/fromBase64ToHex.ts similarity index 100% rename from front/src/utils/fromBase64ToHex.ts rename to src/utils/fromBase64ToHex.ts diff --git a/front/src/utils/observe.ts b/src/utils/observe.ts similarity index 100% rename from front/src/utils/observe.ts rename to src/utils/observe.ts diff --git a/front/src/utils/removeLeadingZero.ts b/src/utils/removeLeadingZero.ts similarity index 100% rename from front/src/utils/removeLeadingZero.ts rename to src/utils/removeLeadingZero.ts diff --git a/front/src/utils/smartWalletUtils.ts b/src/utils/smartWalletUtils.ts similarity index 100% rename from front/src/utils/smartWalletUtils.ts rename to src/utils/smartWalletUtils.ts diff --git a/front/src/utils/stringify.ts b/src/utils/stringify.ts similarity index 100% rename from front/src/utils/stringify.ts rename to src/utils/stringify.ts diff --git a/front/src/utils/truncate.ts b/src/utils/truncate.ts similarity index 100% rename from front/src/utils/truncate.ts rename to src/utils/truncate.ts diff --git a/front/src/utils/utils.ts b/src/utils/utils.ts similarity index 100% rename from front/src/utils/utils.ts rename to src/utils/utils.ts diff --git a/front/src/utils/webauthn.ts b/src/utils/webauthn.ts similarity index 100% rename from front/src/utils/webauthn.ts rename to src/utils/webauthn.ts diff --git a/front/tsconfig.json b/tsconfig.json similarity index 100% rename from front/tsconfig.json rename to tsconfig.json