Feat: add withdraw treasury fee script#534
Conversation
|
There was a problem hiding this comment.
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-feeHardhat task that readswithdrawTreasuryFee.ymland generates two txs per action (withdraw + transfer). - Extends the Treasurer SDK/interface with
withdrawTreasuryFeeandtransferTokentransaction builders. - Adds a
make withdraw-treasury-feeconvenience 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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
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.
ravinagill15
left a comment
There was a problem hiding this comment.
Looks good, just minor nits
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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 Treasurertransfer(underlyingToken, to, amountLD)— transfers the underlying token from the Treasurer to a recipientThe 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.tswith YAML-driven configExtended
ITreasurerinterface and Treasurer SDK with withdrawTreasuryFee and transferToken methodsAdded Makefile target:
make withdraw-treasury-fee(defaults to--onesig)Usage: Edit
devtools/tasks/treasuryFee/withdrawTreasuryFee.ymlwith chain, asset, amount (in shared decimals), and recipient, then run: