Skip to content
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

Large diffs are not rendered by default.

166 changes: 83 additions & 83 deletions packages/evm/broadcast/UpgradeTimeBased.s.sol/84532/run-latest.json

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import {TimeBasedIncentiveCampaign} from "contracts/timebased/TimeBasedIncentive
/// @title TimeBasedIncentiveManager
/// @notice Factory and orchestration contract for time-based incentive campaigns
/// @dev Deploys TimeBasedIncentiveCampaign clones and manages protocol fees. UUPS upgradeable.
/// @custom:oz-upgrades-from contracts/archive/TimeBasedIncentiveManagerV1.sol:TimeBasedIncentiveManagerV1
/// @custom:oz-upgrades-from contracts/archive/TimeBasedIncentives/TimeBasedIncentiveManagerV2.sol:TimeBasedIncentiveManagerV2
contract TimeBasedIncentiveManager is Initializable, UUPSUpgradeable, Ownable {
using SafeTransferLib for address;

Expand Down Expand Up @@ -598,6 +598,6 @@ contract TimeBasedIncentiveManager is Initializable, UUPSUpgradeable, Ownable {
/// @notice Get the version of the contract
/// @return The version string
function version() public pure virtual returns (string memory) {
return "2.0.0";
return "2.1.0";
}
}
4 changes: 2 additions & 2 deletions packages/evm/deploys/84532.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"SignerValidatorV2": "0xFF1DaA985E5FD471CFc6218EF702AE4DcBeB3d35",
"SimpleAllowList": "0x274cB0E382d2408C0517B3e83B5263954512d69D",
"SimpleDenyList": "0x26D4E00813e1A4F93C3DC91B6161CCbF24E57e07",
"TimeBasedIncentiveCampaign": "0xe20e335C56B5bC03AaDfe81529F0FD3136E15F91",
"TimeBasedIncentiveCampaign": "0x402BA5996CB53E759B5528F126Fa9Df61189757d",
"TimeBasedIncentiveManager": "0x81d1Bb513197F4e23E9676B4f3aaBC7de89b54D0",
"TransparentBudget": "0x778182f5df6Ab006F2E54898cfF315160208538F"
}
}
8 changes: 4 additions & 4 deletions packages/evm/script/solidity/ValidateTimeBasedUpgrade.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {Options} from "openzeppelin-foundry-upgrades/Options.sol";

/**
* @title ValidateTimeBasedUpgrade
* @notice Validate TimeBasedIncentiveManager upgrade safety against the V1 archive
* @notice Validate TimeBasedIncentiveManager upgrade safety against the V2 archive
* @dev Run: forge script script/solidity/ValidateTimeBasedUpgrade.s.sol
*
* Only validates the Manager (UUPS proxy). The Campaign is a plain contract
Expand All @@ -25,10 +25,10 @@ contract ValidateTimeBasedUpgrade is Script {
// These are false positives - Solady's patterns are secure but different from OZ
opts.unsafeAllow = "constructor,state-variable-immutable";

// Validate V2 against V1 storage layout
opts.referenceContract = "TimeBasedIncentiveManagerV1.sol:TimeBasedIncentiveManagerV1";
// Validate V2.1 against V2 storage layout
opts.referenceContract = "TimeBasedIncentiveManagerV2.sol:TimeBasedIncentiveManagerV2";

console.log("Validating TimeBasedIncentiveManager upgrade from V1...");
console.log("Validating TimeBasedIncentiveManager upgrade from V2...");
Upgrades.validateUpgrade("TimeBasedIncentiveManager.sol:TimeBasedIncentiveManager", opts);
console.log("[OK] TimeBasedIncentiveManager upgrade is safe!\n");

Expand Down
11 changes: 3 additions & 8 deletions packages/evm/test/timebased/TimeBasedIncentiveManager.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3533,9 +3533,8 @@ contract TimeBasedIncentiveManagerTest is Test {
// Set up merkle tree with two users
bytes32 leaf1 = _makeLeaf(CLAIMER, address(rewardToken), 3 ether);
bytes32 leaf2 = _makeLeaf(CLAIMER2, address(rewardToken), 2 ether);
bytes32 root = leaf1 < leaf2
? keccak256(abi.encodePacked(leaf1, leaf2))
: keccak256(abi.encodePacked(leaf2, leaf1));
bytes32 root =
leaf1 < leaf2 ? keccak256(abi.encodePacked(leaf1, leaf2)) : keccak256(abi.encodePacked(leaf2, leaf1));
bytes32[] memory proof1 = new bytes32[](1);
proof1[0] = leaf2;
bytes32[] memory proof2 = new bytes32[](1);
Expand Down Expand Up @@ -3589,11 +3588,7 @@ contract TimeBasedIncentiveManagerTest is Test {
vm.prank(CREATOR);
manager.withdraw(campaignId);

assertEq(
rewardToken.balanceOf(CREATOR),
creatorBalanceBefore + 2 ether,
"Creator should receive excess funds"
);
assertEq(rewardToken.balanceOf(CREATOR), creatorBalanceBefore + 2 ether, "Creator should receive excess funds");
}
}

Expand Down
Loading