Skip to content

feat(precompiles): implement UCDAO precompile#409

Open
n1n3b1t wants to merge 16 commits intohaqq-network:masterfrom
n1n3b1t:feature/ucdao-precompile
Open

feat(precompiles): implement UCDAO precompile#409
n1n3b1t wants to merge 16 commits intohaqq-network:masterfrom
n1n3b1t:feature/ucdao-precompile

Conversation

@n1n3b1t
Copy link

@n1n3b1t n1n3b1t commented Jan 27, 2026

Summary

  • Add UCDAO precompile at address 0x0000000000000000000000000000000000000805
  • Implement 13 methods: authorization (approve, revoke, increaseAllowance, decreaseAllowance, allowance), transactions (fund, transferOwnership, transferOwnershipWithRatio, transferOwnershipWithAmount), queries (balance, allBalances, totalBalance, enabled)
  • Full authorization support using Cosmos SDK authz with SendAuthorization
  • Emit events for Approval, Revocation, Fund, and TransferOwnership

Changes

  • x/evm/types/precompiles.go - Added UcdaoPrecompileAddress constant
  • x/evm/types/params.go - Added to DefaultStaticPrecompiles
  • x/evm/keeper/static_precompiles.go - Registered precompile
  • x/ucdao/keeper/keeper.go - Added IsModuleEnabled to Keeper interface
  • app/app.go - Added keeper parameter to precompile init
  • precompiles/ucdao/* - Full precompile implementation (9 files)

Test Plan

  • Unit tests for all argument parsers (10 test functions)
  • Unit tests for precompile (LoadABI, IsTransaction, RequiredGas, Address)
  • Build passes
  • All tests pass (go test ./precompiles/ucdao/...)

- Extract asSendAuthorization helper for type assertion pattern
- Add helper functions for event emission with two addresses
- Refactor executeTransfer with checkAndUpdateAuthorization and validateSpendLimit helpers
- Simplify ParseFundArgs by removing intermediate variable
- Remove unused ErrDifferentOriginFromOwner error constant

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant