Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/v0.8/core/filecoin/Filecoin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/U
/// @title Filecoin
contract Filecoin is Initializable, UUPSUpgradeable, IFilecoin, RolesModifiers {
FilecoinType.Network public network;
IRoles private roles;
IRoles public roles;
/// @dev This empty reserved space is put in place to allow future versions to add new
uint256[32] private __gap;

Expand Down Expand Up @@ -142,4 +142,9 @@ contract Filecoin is Initializable, UUPSUpgradeable, IFilecoin, RolesModifiers {
/// @dev mock the filecoin claim data
// solhint-disable-next-line
function setMockClaimData(uint64 claimId, bytes memory _data) external {}

/// @notice Set the Roles contract.
function setRoles(address _roles) external onlyRole(roles, RolesType.DEFAULT_ADMIN_ROLE) {
roles = IRoles(_roles);
}
}
8 changes: 8 additions & 0 deletions src/v0.8/interfaces/core/IFilecoin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
pragma solidity ^0.8.21;

import {FilecoinType} from "src/v0.8/types/FilecoinType.sol";
import {IRoles} from "src/v0.8/interfaces/core/IRoles.sol";

/// @title IFilplus
interface IFilecoin {
Expand All @@ -43,4 +44,11 @@ interface IFilecoin {

/// @dev mock the filecoin claim data
function setMockClaimData(uint64 claimId, bytes memory _data) external;

/// @notice Set the Roles contract.
function setRoles(address _roles) external ;

/// @notice Get the Roles contract.
/// @return Roles contract address.
function roles() external view returns (IRoles);
}
5 changes: 4 additions & 1 deletion src/v0.8/mocks/core/filecoin/MockFilecoin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ contract MockFilecoin is
IFilecoin,
RolesModifiers
{
IRoles private roles;
IRoles public roles;
FilecoinType.DealState private mockDealState;
//bytes private mockClaimData;
mapping(uint64 => bytes) private mockClaimData; //matchingId=>Matchedstore
Expand Down Expand Up @@ -86,4 +86,7 @@ contract MockFilecoin is
) external view override returns (bytes memory) {
return mockClaimData[claimId];
}

/// @notice Set the Roles contract.
function setRoles(address _roles) external {}
}