Skip to content

Commit

Permalink
🥢
Browse files Browse the repository at this point in the history
  • Loading branch information
z0r0z committed May 9, 2024
1 parent 2b17665 commit 75d1333
Show file tree
Hide file tree
Showing 29 changed files with 47 additions and 37 deletions.
12 changes: 6 additions & 6 deletions .gas-snapshot
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
AccountTest:testCdFallback() (gas: 457611)
AccountTest:testCdFallback2() (gas: 1220775)
AccountTest:testDelegateExecute() (gas: 398258)
AccountTest:testDelegateExecute(uint256) (runs: 257, μ: 385621, ~: 377738)
AccountTest:testDelegateExecute(uint256) (runs: 257, μ: 385788, ~: 377738)
AccountTest:testDelegateExecuteRevertsIfOwnerSlotValueChanged() (gas: 353412)
AccountTest:testDepositFunctions() (gas: 516452)
AccountTest:testDirectStorage() (gas: 70232)
Expand Down Expand Up @@ -43,10 +43,10 @@ PaymentValidatorTest:testFailPaymentPlanInvalidAllowance() (gas: 185387)
PaymentValidatorTest:testInstall() (gas: 170994)
PermitValidatorTest:testAddressPermission(address) (runs: 257, μ: 23863, ~: 23863)
PermitValidatorTest:testBoolPermission(bool) (runs: 257, μ: 22254, ~: 22254)
PermitValidatorTest:testEnumPermission(uint256) (runs: 257, μ: 27311, ~: 27366)
PermitValidatorTest:testEnumPermission(uint256) (runs: 257, μ: 27314, ~: 27366)
PermitValidatorTest:testInstall() (gas: 207683)
PermitValidatorTest:testTransferPermission(address,uint256,uint256,uint256) (runs: 256, μ: 8388, ~: 3728)
PermitValidatorTest:testUintPermission(uint256,uint256,uint256) (runs: 257, μ: 7667, ~: 3284)
PermitValidatorTest:testTransferPermission(address,uint256,uint256,uint256) (runs: 256, μ: 8668, ~: 3728)
PermitValidatorTest:testUintPermission(uint256,uint256,uint256) (runs: 257, μ: 7592, ~: 3284)
PermitValidatorTest:testValuePermission(uint256,uint256) (runs: 257, μ: 20038, ~: 20043)
PermitValidatorTest:test__codesize() (gas: 47950)
PointsTest:testCheck(uint256) (runs: 257, μ: 31230, ~: 31230)
Expand All @@ -62,5 +62,5 @@ TokenTest:testFailUnsafeTransfer(address) (runs: 257, μ: 11389, ~: 11389)
TokenTest:testInitBalance() (gas: 10629)
TokenTest:testNameAndSymbolAndDecimals() (gas: 12391)
TokenTest:testTotalSupply() (gas: 8366)
TokenTest:testTransfer(address,uint96) (runs: 257, μ: 43691, ~: 44310)
TokenTest:testTransferFromOwner(address,uint96) (runs: 257, μ: 43791, ~: 44410)
TokenTest:testTransfer(address,uint96) (runs: 257, μ: 43603, ~: 44310)
TokenTest:testTransferFromOwner(address,uint96) (runs: 257, μ: 43703, ~: 44410)
2 changes: 1 addition & 1 deletion docs/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Build the foundry project with `forge build`. Run contract tests with `forge tes

Chain | Factory | Implementation | Commit
----------------|-----------------------------------------|-----------------------------------------|------------------------------------------
Ethereum, Arbitrum / Nova, Optimism, Base, Zora, Blast, Gnosis, Polygon / zkEVM, BNB, Avalanche & testnets | [0x000000000000D7d630383B775342a83589950fb6](https://etherscan.io/address/0x000000000000D7d630383B775342a83589950fb6#code) | [0x000000000000120234A3A6926bCF3173E007876e](https://etherscan.io/address/0x000000000000120234A3A6926bCF3173E007876e#code) | [62e6273586d89aaf1fbab7524d5d1d692b2b6b69](https://github.com/NaniDAO/Account/commit/62e6273586d89aaf1fbab7524d5d1d692b2b6b69)
Ethereum, Arbitrum / Nova, Optimism, Base, Zora, Blast, Gnosis, Polygon / zkEVM, BNB, Avalanche & testnets | [0x000000000000D7d630383B775342a83589950fb6](https://etherscan.io/address/0x000000000000D7d630383B775342a83589950fb6#code) | [0x000000000000120234A3A6926bCF3173E007876e](https://etherscan.io/address/0x000000000000120234A3A6926bCF3173E007876e#code) | [62e6273586d89aaf1fbab7524d5d1d692b2b6b69](https://github.com/NaniDAO/Account/commit/02ab93bee68a899f7f84b457acff5201adfd6806)

### [Plugin Validators](https://ethereum-magicians.org/t/erc-7582-modular-accounts-with-delegated-validation/17640):

Expand Down
12 changes: 11 additions & 1 deletion docs/src/src/Account.sol/contract.Account.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Account
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/Account.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/Account.sol)

**Inherits:**
ERC4337
Expand All @@ -11,6 +11,16 @@ Simple extendable smart account implementation. Includes plugin tooling.


## State Variables
### _NULL_HASH
*Prehash of `keccak256("")` for validation efficiency.*


```solidity
bytes32 internal constant _NULL_HASH =
0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
```


### _VALIDATE_TYPEHASH
*EIP712 typehash as defined in https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct.
Derived from `userOp` without the signature and the time fields of `validUntil` and `validAfter`.*
Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/Accounts.sol/contract.Accounts.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Accounts
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/Accounts.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/Accounts.sol)

**Inherits:**
ERC4337Factory
Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/authority/Guard.sol/contract.Guard.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Guard
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/authority/Guard.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/authority/Guard.sol)

Simple smart account guard for installing asset transfer limits.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/authority/Guard.sol/interface.IAccount.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IAccount
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/authority/Guard.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/authority/Guard.sol)

Smart account execution interface.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/authority/Guard.sol/interface.IERC20.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IERC20
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/authority/Guard.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/authority/Guard.sol)

ERC20 token transfer interface.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/authority/Guard.sol/interface.IOwnable.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IOwnable
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/authority/Guard.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/authority/Guard.sol)

Simple smart account ownership interface.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/governance/Points.sol/contract.Points.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Points
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/governance/Points.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/governance/Points.sol)

Simple onchain points allocation protocol.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/governance/Points.sol/interface.IERC1271.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IERC1271
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/governance/Points.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/governance/Points.sol)

ERC1271 interface.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/governance/Points.sol/interface.IERC20.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IERC20
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/governance/Points.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/governance/Points.sol)

ERC20 interface.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/governance/Token.sol/contract.Token.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Token
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/governance/Token.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/governance/Token.sol)

**Author:**
nani.eth (Nani DAO)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/ownership/Keys.sol/contract.Keys.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Keys
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/ownership/Keys.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/ownership/Keys.sol)

**Author:**
nani.eth (https://github.com/NaniDAO/accounts/blob/main/src/ownership/Keys.sol)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/ownership/Keys.sol/interface.IAuth.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IAuth
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/ownership/Keys.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/ownership/Keys.sol)

Simple authority interface for contracts.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/ownership/Keys.sol/interface.IOwnable.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IOwnable
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/ownership/Keys.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/ownership/Keys.sol)

Simple ownership interface for handover requests.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/ownership/Passkeys.sol/contract.Passkeys.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Passkeys
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/ownership/Passkeys.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/ownership/Passkeys.sol)

*Simple singleton to store passkey ownership and backups for accounts.*

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/ownership/Passkeys.sol/interface.IOwnable.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IOwnable
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/ownership/Passkeys.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/ownership/Passkeys.sol)

Simple ownership interface for handover requests.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/paymasters/NEETH.sol/contract.NEETH.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NEETH
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/paymasters/NEETH.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/paymasters/NEETH.sol)

**Inherits:**
ERC20
Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/paymasters/NEETH.sol/interface.IEntryPoint.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IEntryPoint
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/paymasters/NEETH.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/paymasters/NEETH.sol)


## Functions
Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/paymasters/NEETH.sol/interface.ISwapRouter.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ISwapRouter
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/paymasters/NEETH.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/paymasters/NEETH.sol)

*Simple Uniswap V3 swapping interface.*

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Paymaster
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/paymasters/Paymaster.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/paymasters/Paymaster.sol)

**Author:**
nani.eth (https://github.com/NaniDAO/accounts/blob/main/src/paymasters/Paymaster.sol)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# JointValidator
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/validators/JointValidator.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/validators/JointValidator.sol)

**Author:**
nani.eth (https://github.com/NaniDAO/accounts/blob/main/src/validators/JointValidator.sol)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PaymentValidator
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/validators/PaymentValidator.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/validators/PaymentValidator.sol)

**Author:**
nani.eth (https://github.com/NaniDAO/accounts/blob/main/src/validators/PaymentValidator.sol)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IERC20
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/validators/PaymentValidator.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/validators/PaymentValidator.sol)

ERC20 interface.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# PermitValidator
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/validators/PermitValidator.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/validators/PermitValidator.sol)

**Inherits:**
EIP712
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# IExecutor
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/validators/PermitValidator.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/validators/PermitValidator.sol)

Executor interface.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# RecoveryValidator
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/validators/RecoveryValidator.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/validators/RecoveryValidator.sol)

Simple social recovery validator for smart accounts.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ITransferOwnership
[Git Source](https://github.com/NaniDAO/accounts/blob/02ab93bee68a899f7f84b457acff5201adfd6806/src/validators/RecoveryValidator.sol)
[Git Source](https://github.com/NaniDAO/accounts/blob/2b176650c1c7dc3fb29490114f14dad2292d0d08/src/validators/RecoveryValidator.sol)

*Simple ownership transfer interface.*

Expand Down
8 changes: 4 additions & 4 deletions src/Account.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import {EIP712, SignatureCheckerLib, ERC1271} from "@solady/src/accounts/ERC1271
/// @notice Simple extendable smart account implementation. Includes plugin tooling.
/// @author nani.eth (https://github.com/NaniDAO/accounts/blob/main/src/Account.sol)
contract Account is ERC4337 {
/// @dev Prehash of `keccak256("")` for validation efficiency.
bytes32 internal constant _NULL_HASH =
0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;

/// @dev EIP712 typehash as defined in https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct.
/// Derived from `userOp` without the signature and the time fields of `validUntil` and `validAfter`.
bytes32 internal constant _VALIDATE_TYPEHASH =
0xa9a214c6f6d90f71d094504e32920cfd4d8d53e5d7cf626f9a26c88af60081c7;

/// @dev Prehash of `keccak256("")` for validation efficiency.
bytes32 internal constant _NULL_HASH =
0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;

/// @dev Constructs
/// this implementation.
constructor() payable {}
Expand Down

0 comments on commit 75d1333

Please sign in to comment.