Skip to content

Commit

Permalink
Removed Recursion (for now)
Browse files Browse the repository at this point in the history
  • Loading branch information
toledoroy committed Jun 17, 2022
1 parent 50b7da2 commit f108194
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
23 changes: 16 additions & 7 deletions contracts/JurisdictionUpgradable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import "./abstract/CommonYJUpgradable.sol";
import "./abstract/Rules.sol";
import "./abstract/ContractBase.sol";
import "./abstract/Opinions.sol";
import "./abstract/Recursion.sol";
import "./abstract/Posts.sol";
// import "./abstract/Recursion.sol";
// import "./abstract/Posts.sol";


/**
Expand All @@ -46,8 +46,8 @@ contract JurisdictionUpgradable is
ContractBase,
CommonYJUpgradable,
Opinions,
Recursion,
Posts,
// Recursion, //DEPRECATE / Cleanp
// Posts,
ERC1155RolesTrackerUp {
// ERC1155RolesUpgradable {

Expand All @@ -68,6 +68,13 @@ contract JurisdictionUpgradable is
// mapping(uint256 => address) internal _cases; // Mapping for Case Contracts //DEPRECATED - No need for Case IDs, Use Hash
mapping(address => bool) internal _active; // Mapping for Case Contracts

//Post Input Struct
struct PostInput {
uint256 tokenId;
string entRole;
string uri;
}

//--- Functions

/// ERC165 - Supported Interfaces
Expand All @@ -76,15 +83,17 @@ contract JurisdictionUpgradable is
|| interfaceId == type(IRules).interfaceId
|| super.supportsInterface(interfaceId);
}

/// Initializer
function initialize (address hub, string calldata name_, string calldata uri_) public override initializer {
//Initializers
// __ERC1155RolesUpgradable_init("");
__CommonYJ_init(hub);
__setTargetContract(IAssoc(address(_HUB)).getAssoc("avatar"));

//Init Recursion Controls
__Recursion_init(address(_HUB));
// __Recursion_init(address(_HUB)); //DEPRECATED

//Set Contract URI
_setContractURI(uri_);
//Identifiers
Expand Down Expand Up @@ -168,7 +177,7 @@ contract JurisdictionUpgradable is
function repAdd(address contractAddr, uint256 tokenId, string calldata domain, bool rating, uint8 amount) external override {
//Validate - Called by Child Case
require(caseHas(_msgSender()), "NOT A VALID CASE");
//Run
//Run on Self
_repAdd(contractAddr, tokenId, domain, rating, amount);
//Update Hub
_HUB.repAdd(contractAddr, tokenId, domain, rating, amount);
Expand Down
11 changes: 7 additions & 4 deletions contracts/abstract/Recursion.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,32 @@ import "../interfaces/IRecursion.sol";
import "../interfaces/IAssoc.sol";
import "../libraries/DataTypes.sol";
import "../libraries/AddressArray.sol";
import "../abstract/AssocExt.sol";
// import "../abstract/AssocExt.sol";
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";


/**
* @title Core Contract Recursion Functionality
* @dev Designed To Be Used by Jurisdictions
*/
contract Recursion is IRecursion, Initializable, AssocExt {
contract Recursion is IRecursion, Initializable {

//-- Storage

//Parent Addresses
using AddressArray for address[];
address[] _parentAddrs;

/* DEPRECATE - Get Directly from Hub
/// Initializer
function __Recursion_init(address hub) internal onlyInitializing {
//Fetch Repo From Hub
//Fetch Repo From Hub
address openRepo = IAssoc(hub).getAssoc("repo");
//Set Repo
_setRepo(openRepo);
}

*/

/// Check if a Contract Address is a an Immediate Parent of Current Contract
function isParent(address contractAddr) public view override returns (bool) {
//Flat Check
Expand Down

0 comments on commit f108194

Please sign in to comment.