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

Fix/x allocation voting #34

Merged
merged 2 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 47 additions & 16 deletions CONTRACTS_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,48 @@ This document provides a detailed log of upgrades to the smart contract suite, e

## Version History

| Date | Contract(s) | Summary |
| ------------------- | ---------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| 4th December 2024 | `X2EarnApps` version `3`, `XAllocationVoting` version `4`, `XAllocationPool` version `4`, and `X2EarnRewardsPool` version `5` | Added endorsement cooldown feature to X2Earn contracts. |
| 29th November 2024 | `VeBetterPassport` version `3`, `GalaxyMember` version `3`, and `VoterRewards` version 4 | Added GM level as personhood check in VeBetter passport. |
| 28th November 2024 | `NodeManagement` version `2` | Added new functions to check node delegation status and improved node management capabilities. |
| 15th November 2024 | `GalaxyMember` version `2`, `VoterRewards` version `3`, `B3TRGovernor` version `5` | Added Vechain Node Binding with Galaxy Member feature |
| 15th November 2024 | `X2EarnApps` version `2` | Added X2Earn Apps Vechain Node Endorsement feature |
| 21th October 2024 | `VeBetterPassport` version `2` | Check if the entity is a delegatee when request is created |
| 11th October 2024 | `XAllocationVoting` version `2` | Check isPerson when casting vote & fixed weight during vote |
| 11th October 2024 | `B3TRGovernor` version `4` | Check isPerson when casting vote |
| 11th October 2024 | `X2EarnRewardsPool` version `3` | Register action in VeBetter Passport contract |
| 27th September 2024 | `Emissions` version `2` | Aligned emissions with the expected schedule |
| 13th September 2024 | `B3TRGovernor` version `3`, `XAllocationPool` version `2` | - Added toggling of quadratic voting and funding |
| 4th September 2024 | `X2EarnRewardsPool` version `2` | - Added impact key management and proof building |
| 31st August 2024 | `VoterRewards` version `2` | - Added quadratic rewarding features |
| 29th August 2024 | `B3TRGovernor` version `2` | Updated access control modifiers |
| Date | Contract(s) | Summary |
| ------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| 13th January 2025 | `XAllocationVoting` version `5` | Fixed issue with duplicate app voting in the same transaction. |
| 4th December 2024 | `X2EarnApps` version `3`, `XAllocationVoting` version `4`, `XAllocationPool` version `4`, and `X2EarnRewardsPool` version `5` | Added endorsement cooldown feature to X2Earn contracts. |
| 29th November 2024 | `VeBetterPassport` version `3`, `GalaxyMember` version `3`, and `VoterRewards` version 4 | Added GM level as personhood check in VeBetter passport. |
| 28th November 2024 | `NodeManagement` version `2` | Added new functions to check node delegation status and improved node management capabilities. |
| 15th November 2024 | `GalaxyMember` version `2`, `VoterRewards` version `3`, `B3TRGovernor` version `5` | Added Vechain Node Binding with Galaxy Member feature |
| 15th November 2024 | `X2EarnApps` version `2` | Added X2Earn Apps Vechain Node Endorsement feature |
| 21th October 2024 | `VeBetterPassport` version `2` | Check if the entity is a delegatee when request is created |
| 11th October 2024 | `XAllocationVoting` version `2` | Check isPerson when casting vote & fixed weight during vote |
| 11th October 2024 | `B3TRGovernor` version `4` | Check isPerson when casting vote |
| 11th October 2024 | `X2EarnRewardsPool` version `3` | Register action in VeBetter Passport contract |
| 27th September 2024 | `Emissions` version `2` | Aligned emissions with the expected schedule |
| 13th September 2024 | `B3TRGovernor` version `3`, `XAllocationPool` version `2` | - Added toggling of quadratic voting and funding |
| 4th September 2024 | `X2EarnRewardsPool` version `2` | - Added impact key management and proof building |
| 31st August 2024 | `VoterRewards` version `2` | - Added quadratic rewarding features |
| 29th August 2024 | `B3TRGovernor` version `2` | Updated access control modifiers |

---

## Upgrade `XAllocationVoting` to Version 5

Fixed issue with duplicate app voting in the same transaction.

### Changes 🚀

- **Upgraded Contract(s):**
- `XAllocationVoting.sol` to version `5`

### Storage Changes 📦

- None.

### New Features 🚀

- None.

### Bug Fixes 🐛

- **`RoundVotesCountingUpgradeable.sol`**:
- Updated `_countVote` function to check each app against all previous apps in the transaction to prevent duplicate voting.
- Added new `DuplicateAppVote` error

---

Expand All @@ -38,12 +64,14 @@ Updated `XAllocationVoting`, `XAllocationPool` and `X2EarnRewardsPool` to use ve
- `X2EarnRewardsPool.sol` to version `5`

### Storage Changes 📦

- **`X2EarnApps`**:
- Added `_endorsementRound` to store latest round Vechain Node endorsed an XApp.
- Added `_cooldownPeriod` to store cooldown period in terms of rounds.
- Added `_xAllocationVotingGovernor` to store `XAllocationVoting` address.

### New Features 🚀

- **`X2EarnApps`**:
- Added `checkCooldown()` to check if a vechain node is currently in cooldown period, this is a public function that is also used inside `endorseApp()` and `unendorseApp()`.
- Added `getXAllocationVotingGovernor()` to get the address of the `XAllocationVoting` contract.
Expand Down Expand Up @@ -73,10 +101,12 @@ Updated `VoterRewards` to use version `3` of `GalaxyMember` interface.
- `VoterRewards.sol` to version `4`

### Storage Changes 📦

- **`GalaxyMember`**:
- Added `_selectedTokenIDCheckpoints` to store checkpoints for selected GM token ID of the user.

### New Features 🚀

- **`VeBetterPassport`**:
- Updated `PassportPersonhoodLogic.sol` library's function `_checkPassport()` to include check for GM level.
- **`GalaxyMember`**:
Expand Down Expand Up @@ -105,6 +135,7 @@ Added new functions to check node delegation status and improved node management
- None.

### New Features 🚀

- **`NodeManagement`**:
- Added `isNodeDelegated()` to check if a specific node ID is delegated
- Added `isNodeDelegator()` to check if a user has delegated their node
Expand Down
1 change: 0 additions & 1 deletion contracts/NodeManagement.sol
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ contract NodeManagement is INodeManagement, AccessControlUpgradeable, UUPSUpgrad
/**
* @notice Retrieve the storage reference for node delegation data.
* @dev Internal pure function to get the storage slot for node delegation data using inline assembly.
* @return $ The storage reference for node delegation data.
*/
function _getNodeManagementStorage() internal pure returns (NodeManagementStorage storage $) {
assembly {
Expand Down
1 change: 0 additions & 1 deletion contracts/deprecated/V1/NodeManagementV1.sol
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ contract NodeManagementV1 is INodeManagementV1, AccessControlUpgradeable, UUPSUp
/**
* @notice Retrieve the storage reference for node delegation data.
* @dev Internal pure function to get the storage slot for node delegation data using inline assembly.
* @return $ The storage reference for node delegation data.
*/
function _getNodeManagementStorage() internal pure returns (NodeManagementStorage storage $) {
assembly {
Expand Down
2 changes: 1 addition & 1 deletion contracts/deprecated/V2/GalaxyMemberV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -830,4 +830,4 @@ contract GalaxyMemberV2 is
GalaxyMemberStorage storage $ = _getGalaxyMemberStorage();
return $._baseTokenURI;
}
}
}
Loading
Loading