Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ConfidentialVestingWallet/ConfidentialVestingWalletCliff #76

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

PacificYield
Copy link
Contributor

@PacificYield PacificYield commented Dec 3, 2024

This PR adds two Solidity contracts: ConfidentialVestingWallet.sol and ConfidentialVestingWalletCliff.sol.

@PacificYield PacificYield self-assigned this Dec 3, 2024
@PacificYield PacificYield changed the title feat: add ConfidentialVestingWallet.sol feat: add ConfidentialVestingWallet Dec 3, 2024
@PacificYield PacificYield changed the title feat: add ConfidentialVestingWallet feat: add ConfidentialVestingWallet (WIP) Dec 3, 2024
@PacificYield PacificYield added the enhancement New feature or request label Dec 3, 2024
@PacificYield PacificYield force-pushed the feat/VestingWallet.sol branch 3 times, most recently from e897ec7 to c593586 Compare December 10, 2024 09:34
@PacificYield PacificYield force-pushed the feat/VestingWallet.sol branch from c593586 to 7212873 Compare December 10, 2024 13:13
@PacificYield PacificYield changed the title feat: add ConfidentialVestingWallet (WIP) feat: add ConfidentialVestingWallet/ConfidentialVestingWalletCliff Dec 16, 2024
@PacificYield PacificYield marked this pull request as ready for review December 16, 2024 10:54
@PacificYield PacificYield force-pushed the feat/VestingWallet.sol branch 3 times, most recently from f9e27fd to 7501cdb Compare December 17, 2024 16:04
@immortal-tofu
Copy link
Collaborator

I prefer let @jatZama review it 🙏

@PacificYield PacificYield force-pushed the feat/VestingWallet.sol branch from 7501cdb to e536334 Compare December 19, 2024 16:16
*/
abstract contract ConfidentialVestingWallet {
/// @notice Emitted when tokens are released to the beneficiary address.
event ConfidentialERC20Released();
Copy link
Member

@jatZama jatZama Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why you didn't keep original OZ specs allowing different tokens? this event should then contain an address argument. It is always better to make standard contracts as generalizable as possible imo.

event ConfidentialERC20Released();

/// @notice Beneficiary address.
address public immutable BENEFICIARY;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, not sure why you didnt keep OZ's specs with a modifiable owner.

Copy link
Member

@jatZama jatZama Dec 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok for this one I understand because of ACL, yo can keep it immutable then maybe

IConfidentialERC20 public immutable CONFIDENTIAL_ERC20;

/// @notice Duration (in seconds).
uint64 public immutable DURATION;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you instead keep OZ's specs, with private variable and public getter functions?

} else if (timestamp >= END_TIMESTAMP) {
return totalAllocation;
} else {
return TFHE.div(TFHE.mul(totalAllocation, (timestamp - START_TIMESTAMP)), DURATION);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning: there is a critical risk in case of overflow here, you should cast the totalAllocation to an euint128 before doing the product this is very important

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants