Files
smom-dbis-138/script/flash/ManageQuotePushTreasuryManager.s.sol
defiQUG 2b52cc6e32 refactor(archive): move historical contracts and adapters to archive directory
- Archived multiple non-EVM adapters (Algorand, Hedera, Tron, TON, Cosmos, Solana) and compliance contracts (IndyVerifier) to `archive/solidity/contracts/`.
- Updated documentation to reflect the historical status of archived components.
- Adjusted `foundry.toml` and `README.md` for clarity on historical dependencies and configurations.
- Enhanced Makefile and package.json scripts for improved contract testing and building processes.
- Removed obsolete contracts (AlltraCustomBridge, CommodityCCIPBridge, ISO4217WCCIPBridge, VaultBridgeAdapter) from the main directory.
- Updated implementation reports to indicate archived status for various components.
2026-04-12 18:21:05 -07:00

51 lines
2.1 KiB
Solidity

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {Script, console} from "forge-std/Script.sol";
import {QuotePushTreasuryManager} from "../../contracts/flash/QuotePushTreasuryManager.sol";
/**
* @title ManageQuotePushTreasuryManager
* @notice Harvest receiver surplus into the treasury manager and/or distribute
* quote to the configured gas and recycle recipients.
*
* Env:
* PRIVATE_KEY required
* QUOTE_PUSH_TREASURY_MANAGER_MAINNET required
* QUOTE_PUSH_TREASURY_HARVEST optional; default 1
* QUOTE_PUSH_TREASURY_GAS_DISTRIBUTION_RAW optional; default 0
* QUOTE_PUSH_TREASURY_RECYCLE_DISTRIBUTION_RAW optional; default 0
*/
contract ManageQuotePushTreasuryManager is Script {
function run() external {
uint256 pk = vm.envUint("PRIVATE_KEY");
address managerAddr = vm.envAddress("QUOTE_PUSH_TREASURY_MANAGER_MAINNET");
bool harvest = vm.envOr("QUOTE_PUSH_TREASURY_HARVEST", uint256(1)) == 1;
uint256 gasAmount = vm.envOr("QUOTE_PUSH_TREASURY_GAS_DISTRIBUTION_RAW", uint256(0));
uint256 recycleAmount = vm.envOr("QUOTE_PUSH_TREASURY_RECYCLE_DISTRIBUTION_RAW", uint256(0));
QuotePushTreasuryManager manager = QuotePushTreasuryManager(managerAddr);
console.log("manager", managerAddr);
console.log("harvest", harvest);
console.log("gasAmount", gasAmount);
console.log("recycleAmount", recycleAmount);
console.log("quoteBalanceBefore", manager.quoteBalance());
console.log("availableBefore", manager.availableQuote());
console.log("receiverSweepableBefore", manager.receiverSweepableQuote());
vm.startBroadcast(pk);
if (harvest) {
uint256 harvested = manager.harvestReceiverSurplus();
console.log("harvested", harvested);
}
if (gasAmount > 0 || recycleAmount > 0) {
manager.distributeToConfiguredRecipients(gasAmount, recycleAmount);
}
vm.stopBroadcast();
console.log("quoteBalanceAfter", manager.quoteBalance());
console.log("availableAfter", manager.availableQuote());
}
}