This document provides a detailed log of upgrades to the smart contract suite, ensuring clear tracking of changes, improvements, bug fixes, and versioning across all contracts.
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 |
Fixed issue with duplicate app voting in the same transaction.
- Upgraded Contract(s):
XAllocationVoting.sol
to version5
- None.
- None.
RoundVotesCountingUpgradeable.sol
:- Updated
_countVote
function to check each app against all previous apps in the transaction to prevent duplicate voting. - Added new
DuplicateAppVote
error
- Updated
Upgrade X2EarnApps
to Version 3, XAllocationVoting
to version 4
, XAllocationPool
to version 4
, and X2EarnRewardsPool
to version 5
Added new endorsement cooldown feature to X2EarnApps, in which vechain nodes enter a cooldown period after endorsing an XApp.
Updated XAllocationVoting
, XAllocationPool
and X2EarnRewardsPool
to use version 3
of X2EarnApps
interface.
- Upgraded Contract(s):
X2EarnApps.sol
to version3
XAllocationVoting.sol
to version4
XAllocationPool.sol
to version4
X2EarnRewardsPool.sol
to version5
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 storeXAllocationVoting
address.
- Added
X2EarnApps
:- Added
checkCooldown()
to check if a vechain node is currently in cooldown period, this is a public function that is also used insideendorseApp()
andunendorseApp()
. - Added
getXAllocationVotingGovernor()
to get the address of theXAllocationVoting
contract. - Added
cooldownPeriod()
to get the cooldown period in rounds. - Added
setXAllocationVotingGovernor()
to setXAllocationVoting
address. - Added
updateCooldownPeriod()
to update cooldown period.
- Added
- None.
Added new personhood check in VeBetter passport, if a user owns a GM with a level greater than 1 they are considered a person.
Updated GalaxyMember
to checkpoint selected GM NFT and allow admin to select token for user for GM levels go live.
Updated VoterRewards
to use version 3
of GalaxyMember
interface.
- Upgraded Contract(s):
VeBetterPassport.sol
to version3
GalaxyMember.sol
to version3
VoterRewards.sol
to version4
GalaxyMember
:- Added
_selectedTokenIDCheckpoints
to store checkpoints for selected GM token ID of the user.
- Added
VeBetterPassport
:- Updated
PassportPersonhoodLogic.sol
library's function_checkPassport()
to include check for GM level.
- Updated
GalaxyMember
:- Added
selectFor()
function to allow the admin to select a token for the user. - Added
clock()
andCLOCK_MODE()
functions to allow for custom time tracking. - Added
getSelectedTokenIdAtBlock()
to get the selected GM token ID for the user at a specific block number. - Updated Node Management interface to include new getters of Node Management V2 contract.
- Added
- None.
Added new functions to check node delegation status and improved node management capabilities.
- Upgraded Contract(s):
NodeManagement.sol
to version2
- None.
NodeManagement
:- Added
isNodeDelegated()
to check if a specific node ID is delegated - Added
isNodeDelegator()
to check if a user has delegated their node - Added
getDirectNodeOwnership()
to check direct node ownership without delegation - Added
isNodeHolder()
to check if a user is a node holder (both directly owned and indirectly through delegation) - Added
getUserNodes()
to get comprehensive node information including:- Node ID
- Node level
- Owner address
- Node holder status
- Delegation status
- Delegator status
- Delegatee status
- Delegatee address
- Added
- None.
Introduced a composition pattern to attach and detach Vechain nodes to/from Galaxy Member (GM) NFTs. This feature allows GM NFTs to dynamically acquire or lose levels based on the attached node's capabilities.
- Upgraded Contract(s):
GalaxyMember.sol
to version2
VoterRewards.sol
to version3
B3TRGovernor.sol
to version5
GalaxyMember.sol
:- Added
vechainNodes
to store the address of the Vechain Nodes contract. - Added
nodeManagement
to store the address of the Node Management contract. - Added
_nodeToTokenId
to track the XNode tied to the GM token ID. - Added
_tokenIdToNode
to track the GM token ID tied to the XNode token ID. - Added
_nodeToFreeUpgradeLevel
to track the GM level that can be upgraded for free for a given Vechain node level. - Added
_tokenIdToB3TRdonated
to store the mapping from GM Token ID to B3TR donated for upgrading. - Added
_selectedTokenID
to store the mapping from user address to selected GM token ID.
- Added
VoterRewards.sol
:- Added
proposalToGalaxyMemberToHasVoted
to keep track of whether a galaxy member has voted in a proposal. - Added
proposalToNodeToHasVoted
to keep track of whether a vechain node has been used while attached to a galaxy member NFT when voting for a proposal.
- Added
GalaxyMember.sol
:- Added
attachNode()
function to attach Vechain Node to GM NFT. - Added
detachNode()
function to detach Vechain Node from GM NFT. - Added
setVechainNodes()
function to update the Vechain Nodes contract address. - Added
setNodeToFreeUpgradeLevel()
to set the levelin which a Vechain Node can upgrade to for free. - Added
levelOf()
to get the level of GM token. - Added
getB3TRtoUpgradeToLevel()
to get the required B3TR to upgrade GM NFT to certain level. - Added
getB3TRtoUpgrade()
to get the required B3TR to upgrade GM NFT to the next level. - Added
getNodeLevelOf()
to get the level of a give Vechain node. - Added
getLevelAfterAttachingNode()
to get level of GM NFT after attaching particular GM NFT. - Added
getIdAttachedToNode()
to get GM NFT attached to Vechain node. - Added
getIdAttachedToNode()
to get Vechain node attached to GM NFT. - Added
getNodeToFreeLevel()
to get level in which GM NFT can be upgraded to for free if particular Vechain node is attached. - Added
getB3TRdonated()
to get the B3TR donated by a GM NFT so far to reach ther aquired level. - Added
getTokenInfoByTokenId()
to get infomation on particular GM NFT. - Added
getSelectedTokenInfoByOwner()
to get GM NFT user is using for rewards boosts. - Added
getTokensInfoByOwner()
to get infomation on GM NFTs owned by a particular address.
- Added
VoterRewards.sol
:- Added
getMultiplier()
to get the reward multiplier for a user in a specific proposal. - Added
hasNodeVoted()
to check if a Vechain Node has voted on a proposal. - Added
hasTokenVoted()
to check if a GM NFT has voted on a proposal.
- Added
GovernorVotesLogic.sol
:- Updated
castVote()
to pass proposalId instead of snapshot to Voter RewardsregisterVote()
function.
- Updated
GalaxyMember.sol
:- In Version 1, transfers that occur from an approved address are subject to underflow issues when updating the
_ownedLevels
map. This is fixed with Version 2 by also asserting updates are made on the owner of the token ID rather than the auth of the internal_update
function.
- In Version 1, transfers that occur from an approved address are subject to underflow issues when updating the
Added Vechain Node XApp Endorsement feature.
- Upgraded Contract(s):
X2EarnApps.sol
to version2
EndorsementUpgradeable.sol
:- Added
_unendorsedApps
to store the list of apps pending endorsement. - Added
_unendorsedAppsIndex
to store mapping from app ID to index in the _unendorsedApps array. - Added
_appEndorsers
to store the mapping of each app ID to an array of node IDs that have endorsed it. - Added
_nodeEnodorsmentScore
to score the endorsement score for each node level. - Added
_appGracePeriodStart
to store the grace period elapsed by the app since endorsed. - Added
_nodeToEndorsedApp
to store the mapping of a node ID to the app it currently endorses. - Added
_gracePeriodDuration
to store the grace period threshold for no endorsement in blocks. - Added
_endorsementScoreThreshold
to store the endorsement score threshold for an app to be eligible for voting. - Added
_appScores
to store the score of each app. - Added
_appSecurity
to store the security score of each app. - Added
_nodeManagementContract
to store the node management contract address. - Added
_veBetterPassport
to store the VeBetterPassport contract address.
- Added
EndorsementUpgradeable.sol
:- Added
_creators
to store a mapping of addresses that have a creators NFT and can manage interactions with Node holders for a specifc XApp. - Added
_creatorApps
to store the number of apps created by a creator. - Added
_x2EarnCreatorContract
to store the address of the X2Earn Creators contract.
- Added
VoteEligibilityUpgradeable.sol
:- Added
_blackList
to store a record blacklisted X2Earn appIds.
- Added
- Added
EndorsementUpgradeable.sol
module which makes up all X2EarnApps endorsement logic and functions (see docs for more info). - Replaced
appApp()
withsubmitApp()
. - Added getter
isBlacklisted()
to check if XApp is blacklisted. - Added
removeAppCreator()
,appCreators()
,isAppCreator()
andcreatorApps()
to manage and get info on X2Earn app creators.
-
- Added libraries
AdministrationUtils.sol
,EndorsementUtils.sol
,AppStorageUtils.sol
andVoteEligibilityUtils.sol
to store some of the logic for the X2EarnApps contracts modules to reduce contract size.
- Added libraries
Added check to ensure entity is not a delegatee or pending delegatee when making entity link request.
- Upgraded Contract(s):
VeBetterPassport.sol
to version2
- None.
- None.
VeBetterPassport.sol
:- Added check to ensure entity is not a delegatee or pending delegatee when making entity link request.
Upgrade XAllocationVoting
to Version 2, B3TRGovernor
to version 4, and X2EarnRewardsPool
to version 3 (9th October 2024)
This upgrade ensures that the isPerson
check is performed when casting a vote in the XAllocationVoting
and B3TRGovernor
contracts. Additionally, the X2EarnRewardsPool
contract now registers actions in the VeBetter Passport
contract.
Another change in the XAllocationVoting
contract is the fixed weight during the vote, ensuring that the weight cannot be lower than 1.
- Upgraded Contract(s):
XAllocationVoting.sol
to version2
B3TRGovernor.sol
to version4
X2EarnRewardsPool.sol
to version3
XAllocationVoting.sol
:- Added veBetterPassport contract address.
B3TRGovernor.sol
:- Added veBetterPassport contract address.
X2EarnRewardsPool.sol
:- Added veBetterPassport contract address.
XAllocationVoting.sol
:- Added
isPerson
check when casting a vote.
- Added
B3TRGovernor.sol
:- Added
isPerson
check when casting a vote.
- Added
X2EarnRewardsPool.sol
:- Register actions in the
VeBetter Passport
contract.
- Register actions in the
XAllocationVoting.sol
:- Fixed weight during vote to ensure it cannot be lower than 1.
This upgrade aligns the emissions with the expected schedule by correcting previous configuration errors.
- Upgraded Contract(s):
Emissions.sol
to version2
- Added
_isEmissionsNotAligned
to store the emissions alignment status.
- In
_calculateNextXAllocation
function, added logic to calculate the next X Allocation based on the emissions alignment status.
- Corrected
xAllocationsDecay
from912
to12
, fixing the erroneous value set in version1
. - Applied a reduction of
200,000
B3TR emissions for round14
to align with the expected emissions schedule.
This upgrade adds the ability to toggle quadratic voting and quadratic funding on or off, providing greater control over governance and allocation mechanisms.
- Upgraded Contract(s):
B3TRGovernor.sol
to version3
XAllocationPool.sol
to version2
B3TRGovernor.sol
:- Added
quadraticVotingDisabled
checkpoints to store the quadratic voting disabled status.
- Added
XAllocationPool.sol
:- Added
quadraticFundingDisabled
checkpoints to store the quadratic funding disabled status.
- Added
B3TRGovernor
:- Ability to toggle quadratic voting on or off.
XAllocationPool
:- Ability to toggle quadratic funding on or off.
- None.
This upgrade introduces impact key management and the ability to build proofs of sustainable impact.
- Upgraded Contract(s):
X2EarnRewardsPool.sol
to version2
- Added
impactKeyIndex
to store allowed impact keys index for proof of sustainable impact building. - Added
allowedImpactKeys
to store the array of allowed impact keys.
- Introduced the
IMPACT_KEY_MANAGER_ROLE
to manage allowed impact keys. - Introduced the
onlyRoleOrAdmin
modifier to restrict access to theIMPACT_KEY_MANAGER_ROLE
or admin. - Added
buildProof
function to build proof of sustainable impact.
- None.
This upgrade adds the ability to disable quadratic rewarding for specific cycles, providing greater flexibility in reward distribution. Introduced as first step of sybil mitigation.
- Upgraded Contract(s):
VoterRewards.sol
to version2
- Added
quadraticRewardingDisabled
checkpoints to store the quadratic rewarding status for each cycle.
- Added functions to:
- Disable or re-enable quadratic rewarding for specific cycles.
- Check if quadratic rewarding is disabled at a specific block number or for the current cycle.
- Added the
clock
function to get the current block number.
- None.
This upgrade enhances access control by allowing the DEFAULT_ADMIN_ROLE
to execute critical functions without requiring a governance proposal.
- Upgraded Contract(s):
B3TRGovernor.sol
to version2
- Storage Changes: None.
- Updated functions previously restricted by
onlyGovernance
to useonlyRoleOrGovernance
, permittingDEFAULT_ADMIN_ROLE
direct access.
- None.
- Quadratic Voting: A voting system where the cost of votes increases quadratically with the number of votes cast.
- Quadratic Funding: A funding mechanism that allocates resources based on the square of contributions received.
- Checkpoint: A recorded state at a specific point in time for tracking changes or status.