Skip to content

Commit

Permalink
latest
Browse files Browse the repository at this point in the history
  • Loading branch information
novaknole committed Feb 24, 2025
1 parent c89d161 commit e60d02d
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 0 deletions.
47 changes: 47 additions & 0 deletions src/escrow/increasing/VotingEscrowIncreasing.sol
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,53 @@ contract VotingEscrow is
_locked[_to] = newLockedTo;
}

// function split(
// uint256 _from,
// uint256 _value
// ) public returns (uint256 _tokenId1, uint256 _tokenId2) {
// LockedBalance memory locked = _locked[_from];
// address owner = _msgSender();

// if (_value == 0) revert ZeroAmount();
// if (locked.amount <= _value) revert("value too big");

// _value = _value.toUint208();

// uint256 startTime = IClock(clock).epochCurrentWeekTs();
// uint256 endTime = startTime + CurveConstantLib.MAX_TIME;

// IERC721EMB(lockNFT).burn(_from);
// _locked[_from] = LockedBalance(0, 0, false);
// _checkpoint(
// _from,
// LockedBalance(0, 0, 0),
// LockedBalance(0, startTime, endTime),
// uint48(block.timestamp - startTime)
// );

// locked.amount -= _value;
// _tokenId1 = _createSplitNFT(owner, locked);

// locked.amount = _value;
// _tokenId2 = _createSplitNFT(owner, locked);
// }

// function _createSplitNFT(
// address _to,
// LockedBalance memory _newLocked,
// uint48 _startTime
// ) private returns (uint256 _tokenId) {
// _tokenId = ++lastLockId;
// _locked[_tokenId] = _newLocked;
// _checkpoint(
// _tokenId,
// LockedBalance(0, 0, 0),
// _newLocked,
// uint48(block.timestamp - _startTime)
// );
// IERC721EMB(lockNFT).mint(_to, _tokenId);
// }

/// @notice Record per-user data to checkpoints. Used by VotingEscrow system.
/// @param _tokenId NFT token ID
/// @dev Old locked balance is unused in the increasing case, at least in this implementation
Expand Down
3 changes: 3 additions & 0 deletions test/test_merge.sol
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ contract TestMerge is Test {
30e18 + (30e18 / MAX_TIME) * (endTime - lockWeekStart) +
50e18 + (50e18 / MAX_TIME) * (endTime - lockWeekStart)
);

console.log("blaxoe10", b.supplyAt(mergeTime));
console.log("blaxoe20", b.supplyAt(mergeTime + 10));
}

function test_3() public {
Expand Down

0 comments on commit e60d02d

Please sign in to comment.