Skip to content

Commit

Permalink
add requires to check term param length and nominees length
Browse files Browse the repository at this point in the history
  • Loading branch information
Da-Colon committed Oct 23, 2024
1 parent 6e63069 commit c175538
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion contracts/DecentHats.sol
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,14 @@ contract DecentHats {
uint256 adminHatId,
Hat calldata hat
) internal {
require(
hat.termedParams.length == 1,
"DecentHats: termedParams length must be 1"
);
require(
hat.termedParams[0].nominatedWearers.length == 1,
"DecentHats: nominatedWearers length must be 1"
);
uint256 hatId = _createHat(
hatsProtocol,
adminHatId,
Expand Down Expand Up @@ -310,7 +318,7 @@ contract DecentHats {
LockupLinear.CreateWithTimestamps memory params = LockupLinear
.CreateWithTimestamps({
sender: sablierParams.sender,
recipient: hat.wearer,
recipient: hat.termedParams[0].nominatedWearers[0],
totalAmount: sablierParams.totalAmount,
asset: IERC20(sablierParams.asset),
cancelable: sablierParams.cancelable,
Expand Down

0 comments on commit c175538

Please sign in to comment.