Skip to content

Commit 995012c

Browse files
committed
Remove the workaround for the (non-existant) TimelockManager bug
1 parent e05d4a3 commit 995012c

2 files changed

Lines changed: 3 additions & 25 deletions

File tree

packages/pool/contracts/TimelockUtils.sol

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,7 @@ abstract contract TimelockUtils is ClaimUtils, ITimelockUtils {
6060

6161
/// @notice Called by the TimelockManager contract to deposit tokens on
6262
/// behalf of a user on a linear vesting schedule
63-
/// @dev Refer to `TimelockManager.sol` to see how this is used.
64-
/// Note that `releaseStart` gets updated as `releaseEnd - 1` if it is
65-
/// equal to or greater than `releaseEnd`. This is to accomodate for the
66-
/// already deployed TimelockManager. See the code below for more context.
63+
/// @dev Refer to `TimelockManager.sol` to see how this is used
6764
/// @param source Token source
6865
/// @param amount Token amount
6966
/// @param userAddress Address of the user who will receive the tokens
@@ -87,20 +84,10 @@ abstract contract TimelockUtils is ClaimUtils, ITimelockUtils {
8784
userToTimelock[userAddress].remainingAmount == 0,
8885
"Pool: User has active timelock"
8986
);
90-
/*
9187
require(
9288
releaseEnd > releaseStart,
9389
"Pool: Timelock start after end"
9490
);
95-
// While calling `depositWithVesting()`, if the time is later than
96-
// `releaseEnd`, TimelockManager may call this contract with
97-
// `releaseStart` that is larger than `releaseEnd`. Instead of
98-
// reverting, simply update `releaseStart`.
99-
*/
100-
if (releaseStart >= releaseEnd)
101-
{
102-
releaseStart = releaseEnd - 1;
103-
}
10491
require(
10592
amount != 0,
10693
"Pool: Timelock amount zero"

packages/pool/test/TimelockUtils.sol.js

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ describe("depositWithVesting", function () {
148148
});
149149
});
150150
context("Release end is not later than release start", function () {
151-
it("updates release start and deposits with vesting", async function () {
151+
it("reverts", async function () {
152152
const depositAmount = ethers.utils.parseEther("20" + "000" + "000");
153153
await api3Token
154154
.connect(roles.deployer)
@@ -171,16 +171,7 @@ describe("depositWithVesting", function () {
171171
releaseStart,
172172
releaseEnd
173173
)
174-
)
175-
.to.emit(api3Pool, "DepositedVesting")
176-
.withArgs(
177-
roles.user1.address,
178-
depositAmount,
179-
releaseEnd - 1,
180-
releaseEnd,
181-
depositAmount,
182-
depositAmount
183-
);
174+
).to.be.revertedWith("Pool: Timelock start after end");
184175
});
185176
});
186177
});

0 commit comments

Comments
 (0)