x23.ai

alpha

#12: Microgrants changes

77 files changed

9810 additions

1975 deletions

9 commits

github.com

TL;DR:

The pull request brings major updates to the allo-v2-sdk repository, including changes to constants, functions, error types, events, and the MicroGrantsStrategy class. This includes the addition and removal of several functions and error types, updates to the MicroGrantsStrategy class to allow the strategy property to be undefined, and the renaming of method names and parameters for clarity and consistency.

The pull request introduces significant changes to the allo-v2-sdk repository. The modifications include updates to constants, removal and addition of functions, error types, and events, and changes to the MicroGrantsStrategy class.

Constants:

  • The address constant in allo.config.ts was updated.
  • The abi array was modified.

Functions:

  • Several functions were removed, including fundPool, getBaseFee, getFeeDenominator, getPercentFee, getPool, getRegistry, getRoleAdmin, getStrategy, getTreasury, and others.
  • New functions were added, including DEFAULT_ADMIN_ROLE, NATIVE, addPoolManager, addToCloneableStrategies, allocate, batchAllocate, batchRegisterRecipient, cancelOwnershipHandover, completeOwnershipHandover, createPool, createPoolWithCustomStrategy, distribute, grantRole, hasRole, initialize, isCloneableStrategy, isPoolAdmin, isPoolManager, owner, and others.

Error Types:

  • Error types "UNAUTHORIZED", "Unauthorized", and "ZERO_ADDRESS" were removed.
  • New error types were added, including ALLOCATION_ACTIVE, ALLOCATION_NOT_ACTIVE, ALLOCATION_NOT_ENDED, ALREADY_INITIALIZED, AMOUNT_MISMATCH, ANCHOR_ERROR, ARRAY_MISMATCH, INVALID, INVALID_ADDRESS, INVALID_FEE, INVALID_METADATA, INVALID_REGISTRATION, IS_APPROVED_STRATEGY, MISMATCH, NONCE_NOT_AVAILABLE, NOT_APPROVED_STRATEGY, NOT_ENOUGH_FUNDS, NOT_IMPLEMENTED, NOT_INITIALIZED, NOT_PENDING_OWNER, NewOwnerIsZeroAddress, NoHandoverRequest, POOL_ACTIVE, POOL_INACTIVE, RECIPIENT_ALREADY_ACCEPTED, RECIPIENT_ERROR, RECIPIENT_NOT_ACCEPTED, REGISTRATION_NOT_ACTIVE, UNAUTHORIZED, Unauthorized, ZERO_ADDRESS.

Events:

  • The PoolCreated event was removed.
  • Several new events were added, including "BaseFeePaid", "BaseFeeUpdated", "Initialized", "OwnershipHandoverCanceled", "OwnershipHandoverRequested", "OwnershipTransferred", "PercentFeeUpdated", "PoolFunded", "PoolMetadataUpdated", "RegistryUpdated", "RoleAdminChanged", "RoleGranted", "RoleRevoked", "StrategyApproved", "StrategyRemoved", and "TreasuryUpdated".

MicroGrantsStrategy Class:

  • The MicroGrantsStrategy class was updated to allow the strategy property to be undefined.
  • The constructor now uses extractChain to determine the chain to be used and checks if an address is provided before creating a contract and setting the strategy.
  • Two new methods, setContract and checkStrategy, were added.
  • All public methods now call checkStrategy before executing their logic.
  • Several method names and parameters were renamed for clarity and consistency.
  • The to property of the returned object in certain methods was changed from this.strategy to this.strategy!.
  • In the createStrategy() method, params.maxRequestedAmountAllowed was replaced with params.maxRequestedAmount.
  • The InitializeParams type was updated, with the property maxRequestedAmountAllowed being renamed to maxRequestedAmount.

Merged 5 days ago

Last updated 04/12 00:17