Skip to content

Feat: add withdraw treasury fee script#534

Merged
ravinagill15 merged 19 commits intomainfrom
feat/add-withdraw-treasury-fee-script
Apr 28, 2026
Merged

Feat: add withdraw treasury fee script#534
ravinagill15 merged 19 commits intomainfrom
feat/add-withdraw-treasury-fee-script

Conversation

@clauBv23
Copy link
Copy Markdown
Contributor

@clauBv23 clauBv23 commented Apr 6, 2026

Adds a Hardhat task (stg:propose:withdraw-treasury-fee) that reads a YAML config and proposes two batched transactions per entry to the Treasurer contract:

withdrawTreasuryFee(stargate, amountSD) — withdraws accrued fees from the Stargate pool to the Treasurer
transfer(underlyingToken, to, amountLD) — transfers the underlying token from the Treasurer to a recipient

The task automatically resolves the Stargate pool address from a TokenName (e.g. USDC), reads the underlying token address and decimals on-chain, and converts SD to LD for the transfer call.

Changes:

New task at devtools/tasks/treasuryFee/proposeWithdrawTreasuryFee.ts with YAML-driven config
Extended ITreasurer interface and Treasurer SDK with withdrawTreasuryFee and transferToken methods
Added Makefile target: make withdraw-treasury-fee (defaults to --onesig)

Usage: Edit devtools/tasks/treasuryFee/withdrawTreasuryFee.yml with chain, asset, amount (in shared decimals), and recipient, then run:

make withdraw-treasury-fee

@clauBv23 clauBv23 requested a review from Copilot April 6, 2026 17:20
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 6, 2026

⚠️ No Changeset found

Latest commit: a8bc8be

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new Hardhat devtools task to propose/execute Treasurer treasury-fee withdrawals (and subsequent token transfers) driven by a YAML config, plus supporting Treasurer SDK methods and a Makefile target to run it.

Changes:

  • Introduces stg:propose:withdraw-treasury-fee Hardhat task that reads withdrawTreasuryFee.yml and generates two txs per action (withdraw + transfer).
  • Extends the Treasurer SDK/interface with withdrawTreasuryFee and transferToken transaction builders.
  • Adds a make withdraw-treasury-fee convenience target.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/stg-evm-v2/devtools/tasks/treasuryFee/withdrawTreasuryFee.yml Adds YAML configuration for treasury-fee withdrawal actions.
packages/stg-evm-v2/devtools/tasks/treasuryFee/proposeWithdrawTreasuryFee.ts Implements YAML parsing, Stargate resolution, and tx building for withdraw+transfer.
packages/stg-evm-v2/devtools/tasks/index.ts Registers the new treasury-fee propose task.
packages/stg-evm-v2/devtools/tasks/constants.ts Adds the new task constant stg:propose:withdraw-treasury-fee.
packages/stg-devtools-v2/src/treasurer/types.ts Extends ITreasurer with withdraw/transfer transaction builders.
packages/stg-devtools-evm-hardhat-v2/src/treasurer/sdk.ts Implements withdrawTreasuryFee and transferToken encoding on the Treasurer SDK.
Makefile Adds withdraw-treasury-fee phony target and command wiring.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/stg-evm-v2/devtools/tasks/treasuryFee/proposeWithdrawTreasuryFee.ts Outdated
Comment thread packages/stg-evm-v2/devtools/tasks/treasuryFee/withdrawTreasuryFee.yml Outdated
Comment thread packages/stg-devtools-evm-hardhat-v2/src/treasurer/sdk.ts Outdated
Comment thread packages/stg-devtools-v2/src/treasurer/types.ts Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/stg-evm-v2/devtools/tasks/treasuryFee/proposeWithdrawTreasuryFee.ts Outdated
Comment thread packages/stg-evm-v2/devtools/tasks/treasuryFee/proposeWithdrawTreasuryFee.ts Outdated
clauBv23 and others added 3 commits April 13, 2026 12:33
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/stg-evm-v2/devtools/tasks/treasuryFee/proposeWithdrawTreasuryFee.ts Outdated
ravinagill15
ravinagill15 previously approved these changes Apr 13, 2026
Copy link
Copy Markdown
Collaborator

@ravinagill15 ravinagill15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just minor nits

Comment thread packages/stg-devtools-evm-hardhat-v2/src/treasurer/sdk.ts
Comment thread packages/stg-evm-v2/devtools/tasks/treasuryFee/proposeWithdrawTreasuryFee.ts Outdated
Comment thread packages/stg-evm-v2/devtools/tasks/treasuryFee/proposeWithdrawTreasuryFee.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@clauBv23 clauBv23 requested a review from ravinagill15 April 28, 2026 12:57
@ravinagill15 ravinagill15 merged commit f928ee4 into main Apr 28, 2026
9 of 12 checks passed
@ravinagill15 ravinagill15 deleted the feat/add-withdraw-treasury-fee-script branch April 28, 2026 19:41
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.

3 participants