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

Feature/founders tokens #87

Merged
merged 40 commits into from
Jul 2, 2023
Merged

Feature/founders tokens #87

merged 40 commits into from
Jul 2, 2023

Conversation

wer32dr
Copy link
Contributor

@wer32dr wer32dr commented May 17, 2023

No description provided.

@vercel
Copy link

vercel bot commented May 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
farm-app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 2, 2023 5:27pm
storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 2, 2023 5:27pm

@wer32dr
Copy link
Contributor Author

wer32dr commented May 17, 2023

Copy link
Contributor

@LeoVS09 LeoVS09 left a comment

Choose a reason for hiding this comment

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

Good work. I checked only logic for now. Tests will check when the logic will be completed. Ask questions if you have

packages/contracts/src/Vault.sol Outdated Show resolved Hide resolved
packages/contracts/src/Vault.sol Outdated Show resolved Hide resolved
packages/contracts/src/Vault.sol Outdated Show resolved Hide resolved
packages/contracts/src/Vault.sol Outdated Show resolved Hide resolved
packages/contracts/src/Vault.sol Outdated Show resolved Hide resolved
packages/contracts/src/tokens/VaultFounderToken.sol Outdated Show resolved Hide resolved
packages/contracts/src/tokens/VaultFounderToken.sol Outdated Show resolved Hide resolved
packages/contracts/src/tokens/IVaultLifecycle.sol Outdated Show resolved Hide resolved

contract VaultFounderTokenMock is VaultFounderToken {
constructor() initializer {
__VaultFounderToken_init(3, 120, 200);
Copy link
Contributor

Choose a reason for hiding this comment

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

Make sure it works correctly also with 0 initial price. Better use fuzz testing to set each of this variables

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you elaborate how should it work with zero prices, please?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

packages/contracts/src/Vault.sol Outdated Show resolved Hide resolved
packages/contracts/src/tokens/ERC5484Upgradeable.sol Outdated Show resolved Hide resolved
packages/contracts/src/tokens/ERC5484Upgradeable.sol Outdated Show resolved Hide resolved
packages/contracts/src/tokens/IVaultLifecycle.sol Outdated Show resolved Hide resolved
packages/contracts/src/tokens/VaultFounderToken.sol Outdated Show resolved Hide resolved
function _priceOf(uint256 tokenId) internal view returns (uint256) {
uint256 price = _initialTokenPrice;
for (uint256 i = 0; i < tokenId; i++) {
price = (price * _nextTokenPriceMultiplier) / 100;
Copy link
Contributor

Choose a reason for hiding this comment

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

can we have a test to check for an overflow?

added role based access to ESBT
added mint ESBT to Vault
fixed some lint warnings
fixed tests
# Conflicts:
#	packages/contracts/src/Vault.sol
#	packages/contracts/test/unit/mocks/VaultMock.sol
merged the latest changes from main branch
added code coverage report generation
Copy link
Contributor

@LeoVS09 LeoVS09 left a comment

Choose a reason for hiding this comment

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

All this changes are critical

packages/contracts/src/Vault.sol Outdated Show resolved Hide resolved
/// @dev set vault
/// @notice that is mandatory to be set before reward can be claimed
function setVault(Vault vault_) external onlyRole(DEFAULT_ADMIN_ROLE) {
vault = vault_;
Copy link
Contributor

Choose a reason for hiding this comment

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

VFT cannot do it, but caller can. Just try add _setupRole(BALANCE_UPDATER_ROLE, vault_); it will work.

packages/contracts/src/tokens/RewardHolder.sol Outdated Show resolved Hide resolved
/// @dev set vault
/// @notice that is mandatory to be set before reward can be claimed
function setVault(Vault vault_) external onlyRole(DEFAULT_ADMIN_ROLE) {
vault = vault_;
Copy link
Contributor

Choose a reason for hiding this comment

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

Also add there _setupRole(MINTER_ROLE, vault_);

packages/contracts/src/tokens/VaultFounderToken.sol Outdated Show resolved Hide resolved
packages/contracts/src/tokens/VaultFounderToken.sol Outdated Show resolved Hide resolved
revisited security initialization procedure
revisited calculate a next token price logic
@socket-security
Copy link

socket-security bot commented Jul 2, 2023

No top level dependency changes detected. Learn more about Socket for GitHub ↗︎

@socket-security
Copy link

socket-security bot commented Jul 2, 2023

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

@wer32dr wer32dr changed the base branch from main to development July 2, 2023 13:49
calc reward logic changed
LeoVS09 and others added 3 commits July 2, 2023 17:13
🐛 fix(RewardHolder.sol): remove redundant initialization code
🐛 fix(VaultFounderToken.sol): remove redundant initialization code and fix logic error in safeMint function
✨ feat(VaultFounderToken.sol): add event to emit founder details when a new token is minted and token price is updated
The redundant initialization code in ERC5484Upgradeable.sol and RewardHolder.sol has been removed to improve code readability and reduce redundancy. In VaultFounderToken.sol, the logic error in the safeMint function has been fixed to correctly check if the total supply of tokens has reached the maximum count before minting a new token. Additionally, an event has been added to emit founder details when a new token is minted and the token price is updated. This event will be used to record the price of the current holder token in The Graph.
@LeoVS09 LeoVS09 merged commit af17681 into development Jul 2, 2023
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants