// SPDX-License-Identifier: Apache-2.0 pragma solidity 0.8.2; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface ITreasury { event LogTreasurySuspended(); event LogTreasuryResumed(); event LogTreasuryProductTokenSet(uint256 productId, uint256 riskpoolId, address erc20Address); event LogTreasuryInstanceWalletSet(address walletAddress); event LogTreasuryRiskpoolWalletSet(uint256 riskpoolId, address walletAddress); event LogTreasuryPremiumFeesSet(uint256 productId, uint256 fixedFee, uint256 fractionalFee); event LogTreasuryCapitalFeesSet(uint256 riskpoolId, uint256 fixedFee, uint256 fractionalFee); event LogTreasuryPremiumTransferred(address from, address riskpoolWalletAddress, uint256 amount); event LogTreasuryPayoutTransferred(address riskpoolWalletAddress, address to, uint256 amount); event LogTreasuryCapitalTransferred(address from, address riskpoolWalletAddress, uint256 amount); event LogTreasuryFeesTransferred(address from, address instanceWalletAddress, uint256 amount); event LogTreasuryWithdrawalTransferred(address riskpoolWalletAddress, address to, uint256 amount); event LogTreasuryPremiumProcessed(bytes32 processId, uint256 amount); event LogTreasuryPayoutProcessed(uint256 riskpoolId, address to, uint256 amount); event LogTreasuryCapitalProcessed(uint256 riskpoolId, uint256 bundleId, uint256 amount); event LogTreasuryWithdrawalProcessed(uint256 riskpoolId, uint256 bundleId, uint256 amount); struct FeeSpecification { uint256 componentId; uint256 fixedFee; uint256 fractionalFee; bytes feeCalculationData; uint256 createdAt; uint256 updatedAt; } function setProductToken(uint256 productId, address erc20Address) external; function setInstanceWallet(address instanceWalletAddress) external; function setRiskpoolWallet(uint256 riskpoolId, address riskpoolWalletAddress) external; function createFeeSpecification( uint256 componentId, uint256 fixedFee, uint256 fractionalFee, bytes calldata feeCalculationData ) external view returns(FeeSpecification memory feeSpec); function setPremiumFees(FeeSpecification calldata feeSpec) external; function setCapitalFees(FeeSpecification calldata feeSpec) external; function processPremium(bytes32 processId) external returns( bool success, uint256 feeAmount, uint256 netPremiumAmount ); function processPremium(bytes32 processId, uint256 amount) external returns( bool success, uint256 feeAmount, uint256 netPremiumAmount ); function processPayout(bytes32 processId, uint256 payoutId) external returns( uint256 feeAmount, uint256 netPayoutAmount ); function processCapital(uint256 bundleId, uint256 capitalAmount) external returns( uint256 feeAmount, uint256 netCapitalAmount ); function processWithdrawal(uint256 bundleId, uint256 amount) external returns( uint256 feeAmount, uint256 netAmount ); function getComponentToken(uint256 componentId) external view returns(IERC20 token); function getFeeSpecification(uint256 componentId) external view returns(FeeSpecification memory feeSpecification); function getFractionFullUnit() external view returns(uint256); function getInstanceWallet() external view returns(address instanceWalletAddress); function getRiskpoolWallet(uint256 riskpoolId) external view returns(address riskpoolWalletAddress); }