Skip to content

Latest commit

 

History

History
380 lines (206 loc) · 10.2 KB

File metadata and controls

380 lines (206 loc) · 10.2 KB

Defined in: admin/src/ProtocolGovernance.ts:20

ProtocolGovernance - L3 Pattern

Responsibilities:

  1. Global Protocol Parameter Management (Registry, EntryPoint)
  2. High-level Governance Operations (DAO Transfer, Upgrades)
  3. SuperPaymaster & Module Approval

Extends

Constructors

Constructor

new ProtocolGovernance(config): ProtocolGovernance

Defined in: admin/src/ProtocolGovernance.ts:24

Parameters

Parameter Type
config ClientConfig & object

Returns

ProtocolGovernance

Overrides

BaseClient.constructor

Properties

client

client: WalletClient

Defined in: core/dist/clients/BaseClient.d.ts:5

Inherited from

BaseClient.client


entryPointAddress

entryPointAddress: `0x${string}`

Defined in: admin/src/ProtocolGovernance.ts:22

Overrides

BaseClient.entryPointAddress


gTokenAddress?

protected optional gTokenAddress: `0x${string}`

Defined in: core/dist/clients/BaseClient.d.ts:8

Inherited from

BaseClient.gTokenAddress


gTokenStakingAddress?

protected optional gTokenStakingAddress: `0x${string}`

Defined in: core/dist/clients/BaseClient.d.ts:9

Inherited from

BaseClient.gTokenStakingAddress


paymasterFactoryAddress?

protected optional paymasterFactoryAddress: `0x${string}`

Defined in: core/dist/clients/BaseClient.d.ts:10

Inherited from

BaseClient.paymasterFactoryAddress


publicClient?

optional publicClient: PublicClient

Defined in: core/dist/clients/BaseClient.d.ts:6

Inherited from

BaseClient.publicClient


registryAddress

registryAddress: `0x${string}`

Defined in: admin/src/ProtocolGovernance.ts:21

Overrides

BaseClient.registryAddress

Methods

configureRole()

configureRole(params, options?): Promise<`0x${string}`>

Defined in: admin/src/ProtocolGovernance.ts:95

Configure a Role's parameters (Admin only). Reads the current on-chain config first, then merges the provided overrides and writes back the full struct via configureRole.

Parameters

Parameter Type
params { exitFeePercent?: bigint; minExitFee?: bigint; minStake?: bigint; roleId: `0x${string}`; ticketPrice?: bigint; }
params.exitFeePercent? bigint
params.minExitFee? bigint
params.minStake? bigint
params.roleId? `0x${string}`
params.ticketPrice? bigint
options? TransactionOptions

Returns

Promise<`0x${string}`>


getAddress()

getAddress(): `0x${string}`

Defined in: core/dist/clients/BaseClient.d.ts:16

Get the account address of the connected wallet

Returns

`0x${string}`

Inherited from

BaseClient.getAddress


getProtocolParams()

getProtocolParams(): Promise<ProtocolParams>

Defined in: admin/src/ProtocolGovernance.ts:137

Returns

Promise<ProtocolParams>


getStartPublicClient()

getStartPublicClient(): WalletClient<Transport, Chain | undefined, Account | undefined> | PublicClient

Defined in: core/dist/clients/BaseClient.d.ts:20

Helper to ensure public client exists or fallback to wallet client (if it supports read)

Returns

WalletClient<Transport, Chain | undefined, Account | undefined> | PublicClient

Inherited from

BaseClient.getStartPublicClient


requireEntryPoint()

protected requireEntryPoint(): `0x${string}`

Defined in: core/dist/clients/BaseClient.d.ts:25

Returns

`0x${string}`

Inherited from

BaseClient.requireEntryPoint


requireGToken()

protected requireGToken(): `0x${string}`

Defined in: core/dist/clients/BaseClient.d.ts:22

Returns

`0x${string}`

Inherited from

BaseClient.requireGToken


requireGTokenStaking()

protected requireGTokenStaking(): `0x${string}`

Defined in: core/dist/clients/BaseClient.d.ts:23

Returns

`0x${string}`

Inherited from

BaseClient.requireGTokenStaking


requirePaymasterFactory()

protected requirePaymasterFactory(): `0x${string}`

Defined in: core/dist/clients/BaseClient.d.ts:24

Returns

`0x${string}`

Inherited from

BaseClient.requirePaymasterFactory


requireRegistry()

protected requireRegistry(): `0x${string}`

Defined in: core/dist/clients/BaseClient.d.ts:21

Returns

`0x${string}`

Inherited from

BaseClient.requireRegistry


setStaking()

setStaking(staking, options?): Promise<`0x${string}`>

Defined in: admin/src/ProtocolGovernance.ts:82

Set the Staking contract address

Parameters

Parameter Type
staking `0x${string}`
options? TransactionOptions

Returns

Promise<`0x${string}`>


setSuperPaymaster()

setSuperPaymaster(paymaster, options?): Promise<`0x${string}`>

Defined in: admin/src/ProtocolGovernance.ts:71

Approve a new SuperPaymaster contract address

Parameters

Parameter Type
paymaster `0x${string}`
options? TransactionOptions

Returns

Promise<`0x${string}`>


setTreasury()

setTreasury(treasury, options?): Promise<`0x${string}`>

Defined in: admin/src/ProtocolGovernance.ts:40

Update the Global Treasury Address where protocol fees are collected

Parameters

Parameter Type
treasury `0x${string}`
options? TransactionOptions

Returns

Promise<`0x${string}`>


transferToDAO()

transferToDAO(daoAddress, options?): Promise<`0x${string}`>

Defined in: admin/src/ProtocolGovernance.ts:125

Transfer Protocol Ownership to a DAO (Multisig/Timelock) This is the final step of "Protocol Admin" lifecycle.

Parameters

Parameter Type
daoAddress `0x${string}`
options? TransactionOptions

Returns

Promise<`0x${string}`>


updateEntryPoint()

updateEntryPoint(entryPoint, options?): Promise<`0x${string}`>

Defined in: admin/src/ProtocolGovernance.ts:57

Update the supported EntryPoint address

Parameters

Parameter Type
entryPoint `0x${string}`
options? TransactionOptions

Returns

Promise<`0x${string}`>