-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: erc7579 modular accounts (#5487)
- Loading branch information
1 parent
b2b95a5
commit 5574c15
Showing
51 changed files
with
4,256 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
"thirdweb": patch | ||
--- | ||
|
||
BETA support for 7579 modular smart accounts | ||
|
||
You can now create modular smart wallets using the 7579 preset. | ||
|
||
Keep in mind that this is in BETA, and there might be breaking API changes. | ||
|
||
```typescript | ||
import { sepolia } from "thirdweb/chains"; | ||
import { smartWallet, Config } from "thirdweb/wallets/smart"; | ||
const modularSmartWallet = smartWallet( | ||
Config.erc7579({ | ||
chain: sepolia, | ||
sponsorGas: true, | ||
factoryAddress: "0x...", // the 7579 factory address | ||
validatorAddress: "0x...", // the default validator module address | ||
}), | ||
}); | ||
``` |
13 changes: 13 additions & 0 deletions
13
packages/thirdweb/scripts/generate/abis/erc7579/IERC7579Account.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[ | ||
"function accountId() view returns (string accountImplementationId)", | ||
"function execute(bytes32 mode, bytes executionCalldata) payable", | ||
"function executeFromExecutor(bytes32 mode, bytes executionCalldata) payable returns (bytes[] returnData)", | ||
"function installModule(uint256 moduleTypeId, address module, bytes initData) payable", | ||
"function isModuleInstalled(uint256 moduleTypeId, address module, bytes additionalContext) view returns (bool)", | ||
"function isValidSignature(bytes32 hash, bytes data) view returns (bytes4)", | ||
"function supportsExecutionMode(bytes32 encodedMode) view returns (bool)", | ||
"function supportsModule(uint256 moduleTypeId) view returns (bool)", | ||
"function uninstallModule(uint256 moduleTypeId, address module, bytes deInitData) payable", | ||
"event ModuleInstalled(uint256 moduleTypeId, address module)", | ||
"event ModuleUninstalled(uint256 moduleTypeId, address module)" | ||
] |
23 changes: 23 additions & 0 deletions
23
packages/thirdweb/scripts/generate/abis/erc7579/ModularAccountFactory.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[ | ||
"constructor(address _entrypoint, address _owner, address _accountImplementation)", | ||
"function accountImplementation() view returns (address)", | ||
"function addStake(uint32 unstakeDelaySec) payable", | ||
"function createAccountWithModules(address owner, bytes salt, (uint256 moduleTypeId, address module, bytes initData)[] modules) payable returns (address)", | ||
"function entrypoint() view returns (address)", | ||
"function getAddress(address owner, bytes salt) view returns (address account)", | ||
"function implementation() view returns (address result)", | ||
"function owner() view returns (address result)", | ||
"function renounceOwnership()", | ||
"function transferOwnership(address newOwner)", | ||
"function unlockStake()", | ||
"function upgradeTo(address newImplementation)", | ||
"function withdraw(address to, address token, uint256 amount)", | ||
"function withdrawStake(address to)", | ||
"event OwnershipTransferred(address indexed oldOwner, address indexed newOwner)", | ||
"event Upgraded(address indexed implementation)", | ||
"error InitializationFailed()", | ||
"error InvalidModule(address module)", | ||
"error NewImplementationHasNoCode()", | ||
"error NewOwnerIsZeroAddress()", | ||
"error Unauthorized()" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
...s/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/events/ModuleInstalled.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
...thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/events/ModuleUninstalled.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
71 changes: 71 additions & 0 deletions
71
packages/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/accountId.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
153 changes: 153 additions & 0 deletions
153
...s/thirdweb/src/extensions/erc7579/__generated__/IERC7579Account/read/isModuleInstalled.ts
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.