You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With addressable ids (#19), hats trees can likely be modeled in a more sophisticated way than previously. This also means that createHatsTree will need to be implemented;
/// @notice Creates a tree new Hats, where the root Hat is under admin control by the msg.sender. Especially useful for forking an existing Hat tree or initiating a template Hat tree structure.
/// @dev The admin for each Hat must exist before the Hat is created, so Hats must be created before Hats for which they serve as admin
/// @param _details Descriptions of the Hats
/// @param _maxSupplies The total instances of the Hats that can be worn at once
/// @param _firstAdmin The hatId of the admin of the first Hat to create; it must already exist
/// @param _adminOffsets The deltas between the ids of the Hats that will control who wears the newly created hat
/// @param _oracles The addresses that can report on the Hat wearers' standings
/// @param _conditions The addresses that can deactivate the Hats
/* subsequent Hats are assigned admins based on an offset.
Example: if nextHatId is 10, and the admin of the next Hat we want to create is id 8, then the offset would be 2.
*/
admin = nextHatId - _adminOffsets[i -1];
}
/* Only create the new Hat if it would not be a topHat (a Hat that is its own admin) and if the msg.sender serves as its admin, otherwise skip to the next item.
This requires that Hats must be created prior to any Hat(s) they are an admin for.
*/
if ((admin != nextHatId) &&isWearerOfHat(msg.sender, admin)) {
_createHat(
_details[i],
_maxSupplies[i],
admin,
_oracles[i],
_conditions[i]
);
}
}
}
The text was updated successfully, but these errors were encountered:
With addressable ids (#19), hats trees can likely be modeled in a more sophisticated way than previously. This also means that
createHatsTree
will need to be implemented;Reference: old approach to
createHatsTree
:hats-protocol/src/Hats.sol
Lines 168 to 223 in 8f40b1e
The text was updated successfully, but these errors were encountered: