Skip to content

Commit

Permalink
updated contract version
Browse files Browse the repository at this point in the history
  • Loading branch information
sogipec committed Dec 4, 2024
1 parent fc65005 commit 4f5bb3c
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions contracts/partners/tokenWrappers/PufferPointTokenWrapper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,15 @@ contract PufferPointTokenWrapper is UUPSHelper, ERC20Upgradeable {
if (from == distributor) {
_burn(to, amount);

// Creates a vesting for the `to` address
VestingData storage userVestingData = vestingData[to];
VestingID[] storage userAllVestings = userVestingData.allVestings;
userAllVestings.push(VestingID(uint128(amount), uint128(block.timestamp + cliffDuration)));
uint128 endTimestamp = uint128(block.timestamp + cliffDuration);
if (endTimestamp > block.timestamp) {
// Creates a vesting for the `to` address
VestingData storage userVestingData = vestingData[to];
VestingID[] storage userAllVestings = userVestingData.allVestings;
userAllVestings.push(VestingID(uint128(amount), uint128(block.timestamp + cliffDuration)));
} else {
IERC20(token()).safeTransfer(to, amount);
}
}
}

Expand Down Expand Up @@ -157,6 +162,12 @@ contract PufferPointTokenWrapper is UUPSHelper, ERC20Upgradeable {
_;
}

/// @notice Checks whether the `msg.sender` has the governor role or the guardian role
modifier onlyGuardian() {
if (!core.isGovernorOrGuardian(msg.sender)) revert NotGovernorOrGuardian();
_;
}

/// @inheritdoc UUPSUpgradeable
function _authorizeUpgrade(address) internal view override onlyGovernorUpgrader(core) {}

Expand All @@ -172,6 +183,10 @@ contract PufferPointTokenWrapper is UUPSHelper, ERC20Upgradeable {
distributionCreator = _distributionCreator;
}

function setCliffDuration(uint32 _newCliffDuration) external onlyGuardian {
cliffDuration = _newCliffDuration;
}

function setFeeRecipient() external {
feeRecipient = IDistributionCreator(distributionCreator).feeRecipient();
}
Expand Down

0 comments on commit 4f5bb3c

Please sign in to comment.