Skip to content

Conversation

@ryzen-xp
Copy link

Description

Adds governance‑gated execute_transfer for ERC‑20 tokens and execute_eth_transfer for native STRK using the STRK ERC‑20 dispatcher, emits FundsWithdrawn on success, and implements #[receive] to accept incoming STRK deposits, matching Starknet ERC‑20 interaction patterns in Cairo.[4][5]

Changes Made

  • Implemented execute_transfer(token_address, recipient, amount) calling token.transfer with _only_governance(), pre‑checks, and FundsWithdrawn event emission.[5][4]
  • Implemented execute_eth_transfer(recipient, amount) using stored STRK token address and ERC‑20 transfer with _only_governance(), balance checks, and FundsWithdrawn event emission.[4][5]
  • Added #[receive] to accept STRK deposits and emit DepositReceived for observability, following Cairo contract patterns for funds reception.[6][4]
  • Added assertions for zero addresses and zero amounts; verified dispatcher usage aligns with Cairo book examples for ERC‑20 interaction.[5][4]

Checklist

  • I have tested my changes locally with unit tests for governance gating, success paths, and failure reverts on zero address/amount and insufficient balance.[3][1]
  • I have updated the documentation (treasury README: how to configure STRK token address and governance module).[2][1]
  • I have added/updated unit tests covering event emission and dispatcher calls.[1][3]
  • My code follows the project's coding standards and common Starknet/Cairo dispatcher patterns.[4][5]
  • My changes do not introduce new warnings or errors in build/test runs.[2][3]

Related Issues

Screenshots or Screen Recording

Screenshot from 2025-08-30 09-13-51

Close #90

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.

Implement execute_transfer for ERC-20 and STRK

1 participant