Skip to content

Add ERC7579 modules #553

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions packages/core/solidity/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## Unreleased

- Add `erc7579` contract types for ERC-7579 modules.

## 0.5.5 (2025-05-13)

Expand Down
8 changes: 7 additions & 1 deletion packages/core/solidity/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ The following contract types are supported:
- `governor`
- `custom`

Note that `stablecoin`, `realWorldAsset`, and `account` are experimental and may be subject to change.
Note that `stablecoin`, `realWorldAsset`, `account`, and `erc7579` are experimental and may be subject to change.

Each contract type has functions/constants as defined below.

Expand All @@ -45,6 +45,9 @@ function print(opts?: StablecoinOptions): string
function print(opts?: AccountOptions): string
```
```js
function print(opts?: ERC7579Options): string
```
```js
function print(opts?: GovernorOptions): string
```
```js
Expand All @@ -69,6 +72,9 @@ const defaults: Required<StablecoinOptions>
const defaults: Required<AccountOptions>
```
```js
const defaults: Required<ERC7579Options>
```
```js
const defaults: Required<GovernorOptions>
```
```js
Expand Down
7 changes: 7 additions & 0 deletions packages/core/solidity/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import {
} from './stablecoin';
import type { AccountOptions } from './account';
import { printAccount, defaults as accountDefaults } from './account';
import type { ERC7579Options } from './erc7579';
import { printERC7579, defaults as erc7579Defaults } from './erc7579';
import type { GovernorOptions } from './governor';
import {
printGovernor,
Expand Down Expand Up @@ -64,6 +66,7 @@ export type ERC1155 = WizardContractAPI<ERC1155Options> & AccessControlAPI<ERC11
export type Stablecoin = WizardContractAPI<StablecoinOptions> & AccessControlAPI<StablecoinOptions>;
export type RealWorldAsset = WizardContractAPI<StablecoinOptions> & AccessControlAPI<StablecoinOptions>;
export type Account = WizardContractAPI<AccountOptions>;
export type ERC7579 = WizardContractAPI<ERC7579Options>;
export type Governor = WizardContractAPI<GovernorOptions> & AccessControlAPI<GovernorOptions>;
export type Custom = WizardContractAPI<CustomOptions> & AccessControlAPI<CustomOptions>;

Expand Down Expand Up @@ -91,6 +94,10 @@ export const account: Account = {
print: printAccount,
defaults: accountDefaults,
};
export const erc7579: ERC7579 = {
print: printERC7579,
defaults: erc7579Defaults,
};
export const realWorldAsset: RealWorldAsset = {
print: printStablecoin,
defaults: stablecoinDefaults,
Expand Down
6 changes: 6 additions & 0 deletions packages/core/solidity/src/build-generic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ import { buildGovernor } from './governor';
import type { Contract } from './contract';
import { buildAccount } from './account';
import type { AccountOptions } from './account';
import { buildERC7579 } from './erc7579';
import type { ERC7579Options } from './erc7579';

export interface KindedOptions {
ERC20: { kind: 'ERC20' } & ERC20Options;
Expand All @@ -21,6 +23,7 @@ export interface KindedOptions {
Stablecoin: { kind: 'Stablecoin' } & StablecoinOptions;
RealWorldAsset: { kind: 'RealWorldAsset' } & StablecoinOptions;
Account: { kind: 'Account' } & AccountOptions;
ERC7579: { kind: 'ERC7579' } & ERC7579Options;
Governor: { kind: 'Governor' } & GovernorOptions;
Custom: { kind: 'Custom' } & CustomOptions;
}
Expand All @@ -47,6 +50,9 @@ export function buildGeneric(opts: GenericOptions): Contract {
case 'Account':
return buildAccount(opts);

case 'ERC7579':
return buildERC7579(opts);

case 'Governor':
return buildGovernor(opts);

Expand Down
Loading
Loading