Notable differences between the Bonding v1 and Bonding v2 smart contracts
Change to handling of bonding shares upon deposits/withdrawals using the bonding contract
We will no longer burn user bonding shares (the ERC-1155 non-fungible tokens used to represent a user's share of the LP and the proportion of seigniorage they are entitled to receive) upon withdrawals from the bonding v2 contract
Bonding share fields will be updated with new information as the user interacts with the bonding contract (i.e. makes withdrawals or deposits).
This information will include re-deposits via the addLiquidity function
Functions associated with the bonding contract size and time (including rewards) have been modified to accommodate for and utilize the permanent bonding share NFT.
Functions implemented for seamlessly handling migration from bonding v1 to bonding v2
The migrate function will handle the migration of existing user deposits in the bonding v1 contract to the bonding v2 contract: the user address, LP shares + rewards, and bonding duration will all carry over to the new contract. Users with multiple shares will have these deposits merged into a single new deposit in the bonding v2 contract, using the following weighted average formula:
addUserToMigrate exists in case any additional addresses need to be migrated which were not included in the original cohort (to be stored in _originals).
After the migration has been fully effectuated, and it is thoroughly agreed that these functions are no longer required, these functions will be effectively disabled by modifying the parameter migrating to false, and by setting the permissioned manager address to an inaccessible 0 address.
Other Design Modifications
Pausing has been enabled - this will allow the manager address, i.e. the address controlled by the governance decisions of the DAO, to reversibly disable specific functions of the bonding contract in the case of necessary emergency action.
Streaming rewards will no longer be available, as the Sablier-related functions have been removed.
The calculation used to determine bonding deposit durations has been corrected to be considerably more accurate.