Skip to content

Commit

Permalink
add IBundleToken, some minor renamings
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaszimmermann committed Jul 29, 2022
1 parent 8c56549 commit 8b95581
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion contracts/components/Riskpool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ abstract contract Riskpool is
external override
onlyPool
{
require(_balance > amount, "ERROR:RPL-005:RISKPOOL_BALANCE_TOO_LOW");
require(_balance >= amount, "ERROR:RPL-005:RISKPOOL_BALANCE_TOO_LOW");

_decreaseBundleBalances(processId, amount);
_balance -= amount;
Expand Down
2 changes: 1 addition & 1 deletion contracts/modules/IPolicy.sol
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ interface IPolicy {
struct Payout {
uint256 claimId;
PayoutState state;
uint256 payoutAmount;
uint256 amount;
bytes data;
uint256 createdAt;
uint256 updatedAt;
Expand Down
2 changes: 2 additions & 0 deletions contracts/modules/ITreasury.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@ interface ITreasury {
event LogTreasuryCapitalFeesSet(uint256 riskpoolId, uint256 fixedFee, uint256 fractionalFee);

event LogTreasuryPremiumTransferred(address from, address riskpoolWalletAddress, uint256 amount, bool success);
event LogTreasuryPayoutTransferred(address riskpoolWalletAddress, address to, uint256 amount, bool success);
event LogTreasuryCapitalTransferred(address from, address riskpoolWalletAddress, uint256 amount, bool success);
event LogTreasuryFeesTransferred(address from, address instanceWalletAddress, uint256 amount, bool success);
event LogTreasuryWithdrawalTransferred(address riskpoolWalletAddress, address to, uint256 amount, bool success);

event LogTreasuryFullPremiumProcessed(bytes32 processId, uint256 amount, bool success);
event LogTreasuryPremiumProcessed(bytes32 processId, uint256 amount, bool success);
event LogTreasuryPayoutProcessed(uint256 riskpoolId, address to, uint256 amount, bool success);
event LogTreasuryCapitalProcessed(uint256 riskpoolId, uint256 bundleId, uint256 amount, bool success);
event LogTreasuryWithdrawalProcessed(uint256 riskpoolId, uint256 bundleId, uint256 amount, bool success);

Expand Down
9 changes: 5 additions & 4 deletions contracts/services/IInstanceService.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pragma solidity ^0.8.0;

import "../modules/IBundle.sol";
import "../modules/IPolicy.sol";
import "../tokens/IBundleToken.sol";
import "./IComponentOwnerService.sol";
import "./IInstanceOperatorService.sol";
import "./IOracleService.sol";
Expand All @@ -25,13 +26,13 @@ interface IInstanceService {
function getRiskpoolService() external view returns(IRiskpoolService service);

// access
function productOwnerRole() external view returns(bytes32 role);
function oracleProviderRole() external view returns(bytes32 role);
function riskpoolKeeperRole() external view returns(bytes32 role);
function getProductOwnerRole() external view returns(bytes32 role);
function getOracleProviderRole() external view returns(bytes32 role);
function getRiskpoolKeeperRole() external view returns(bytes32 role);
function hasRole(bytes32 role, address principal) external view returns (bool roleIsAssigned);

// bundles
function getBundleToken() external view returns(IERC721 token);
function getBundleToken() external view returns(IBundleToken token);
function bundles() external view returns(uint256 numberOfBundles);
function getBundle(uint256 bundleId) external view returns(IBundle.Bundle memory bundle);

Expand Down
16 changes: 16 additions & 0 deletions contracts/tokens/IBundleToken.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

interface IBundleToken is
IERC721
{
event LogBundleTokenMinted(uint256 bundleId, uint256 tokenId, address tokenOwner);
event LogBundleTokenBurned(uint256 bundleId, uint256 tokenId);

function burned(uint tokenId) external view returns(bool isBurned);
function exists(uint256 tokenId) external view returns(bool doesExist);
function getBundleId(uint256 tokenId) external view returns(uint256 bundleId);
function tokens() external view returns(uint256 tokenCount);
}

0 comments on commit 8b95581

Please sign in to comment.