From fe60d98d50418189539f14d3072fe987550cdaad Mon Sep 17 00:00:00 2001 From: Ebrahim Karimi Date: Fri, 19 Jul 2024 13:55:33 +0330 Subject: [PATCH] test(fork): rename `ASSET` to `FORK_ASSET` (#969) * [Implement] issues #900 - Rename ASSET to FORK_ASSET in Fork.t.sol * [Fix] lint / forge-lint CLI tests * Update test/fork/Fork.t.sol Co-authored-by: smol-ninja * Update test/fork/Fork.t.sol Co-authored-by: smol-ninja * Update test/fork/Fork.t.sol Co-authored-by: smol-ninja * Update test/fork/LockupDynamic.t.sol Co-authored-by: smol-ninja * Update test/fork/LockupLinear.t.sol Co-authored-by: smol-ninja * Update test/fork/LockupTranched.t.sol Co-authored-by: smol-ninja --------- Co-authored-by: smol-ninja --- test/fork/Fork.t.sol | 32 ++++++++++++++++---------------- test/fork/LockupDynamic.t.sol | 34 ++++++++++++++++++---------------- test/fork/LockupLinear.t.sol | 33 +++++++++++++++++---------------- test/fork/LockupTranched.t.sol | 34 ++++++++++++++++++---------------- test/fork/assets/DAI.t.sol | 10 +++++----- test/fork/assets/EURS.t.sol | 10 +++++----- test/fork/assets/SHIB.t.sol | 10 +++++----- test/fork/assets/USDC.t.sol | 10 +++++----- test/fork/assets/USDT.t.sol | 10 +++++----- 9 files changed, 94 insertions(+), 89 deletions(-) diff --git a/test/fork/Fork.t.sol b/test/fork/Fork.t.sol index 770219d1d..93fd79188 100644 --- a/test/fork/Fork.t.sol +++ b/test/fork/Fork.t.sol @@ -12,17 +12,17 @@ abstract contract Fork_Test is Base_Test { STATE VARIABLES //////////////////////////////////////////////////////////////////////////*/ - IERC20 internal immutable ASSET; - address internal immutable HOLDER; + IERC20 internal immutable FORK_ASSET; + address internal immutable FORK_ASSET_HOLDER; uint256 internal initialHolderBalance; /*////////////////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////////////////*/ - constructor(IERC20 asset, address holder) { - ASSET = asset; - HOLDER = holder; + constructor(IERC20 forkAsset, address forkAssetHolder) { + FORK_ASSET = forkAsset; + FORK_ASSET_HOLDER = forkAssetHolder; } /*////////////////////////////////////////////////////////////////////////// @@ -39,11 +39,11 @@ abstract contract Fork_Test is Base_Test { // Label the contracts. labelContracts(); - // Make the ASSET HOLDER the caller in this test suite. - resetPrank({ msgSender: HOLDER }); + // Make the forked asset holder the caller in this test suite. + resetPrank({ msgSender: FORK_ASSET_HOLDER }); - // Query the initial balance of the ASSET HOLDER. - initialHolderBalance = ASSET.balanceOf(HOLDER); + // Query the initial balance of the forked asset holder. + initialHolderBalance = FORK_ASSET.balanceOf(FORK_ASSET_HOLDER); } /*////////////////////////////////////////////////////////////////////////// @@ -55,20 +55,20 @@ abstract contract Fork_Test is Base_Test { // The protocol does not allow the zero address to interact with it. vm.assume(sender != address(0) && recipient != address(0) && broker != address(0)); - // The goal is to not have overlapping users because the ASSET balance tests would fail otherwise. + // The goal is to not have overlapping users because the forked asset balance tests would fail otherwise. vm.assume(sender != recipient && sender != broker && recipient != broker); - vm.assume(sender != HOLDER && recipient != HOLDER && broker != HOLDER); + vm.assume(sender != FORK_ASSET_HOLDER && recipient != FORK_ASSET_HOLDER && broker != FORK_ASSET_HOLDER); vm.assume(sender != sablierContract && recipient != sablierContract && broker != sablierContract); // Avoid users blacklisted by USDC or USDT. - assumeNoBlacklisted(address(ASSET), sender); - assumeNoBlacklisted(address(ASSET), recipient); - assumeNoBlacklisted(address(ASSET), broker); + assumeNoBlacklisted(address(FORK_ASSET), sender); + assumeNoBlacklisted(address(FORK_ASSET), recipient); + assumeNoBlacklisted(address(FORK_ASSET), broker); } /// @dev Labels the most relevant contracts. function labelContracts() internal { - vm.label({ account: address(ASSET), newLabel: IERC20Metadata(address(ASSET)).symbol() }); - vm.label({ account: HOLDER, newLabel: "HOLDER" }); + vm.label({ account: address(FORK_ASSET), newLabel: IERC20Metadata(address(FORK_ASSET)).symbol() }); + vm.label({ account: FORK_ASSET_HOLDER, newLabel: "FORK_ASSET_HOLDER" }); } } diff --git a/test/fork/LockupDynamic.t.sol b/test/fork/LockupDynamic.t.sol index 67ccc5e4e..eab25f210 100644 --- a/test/fork/LockupDynamic.t.sol +++ b/test/fork/LockupDynamic.t.sol @@ -13,7 +13,7 @@ abstract contract LockupDynamic_Fork_Test is Fork_Test { CONSTRUCTOR //////////////////////////////////////////////////////////////////////////*/ - constructor(IERC20 asset, address holder) Fork_Test(asset, holder) { } + constructor(IERC20 forkAsset, address forkAssetHolder) Fork_Test(forkAsset, forkAssetHolder) { } /*////////////////////////////////////////////////////////////////////////// SET-UP FUNCTION @@ -24,7 +24,8 @@ abstract contract LockupDynamic_Fork_Test is Fork_Test { // Approve {SablierV2LockupDynamic} to transfer the holder's assets. // We use a low-level call to ignore reverts because the asset can have the missing return value bug. - (bool success,) = address(ASSET).call(abi.encodeCall(IERC20.approve, (address(lockupDynamic), MAX_UINT256))); + (bool success,) = + address(FORK_ASSET).call(abi.encodeCall(IERC20.approve, (address(lockupDynamic), MAX_UINT256))); success; } @@ -124,7 +125,7 @@ abstract contract LockupDynamic_Fork_Test is Fork_Test { }); // Make the holder the caller. - resetPrank(HOLDER); + resetPrank(FORK_ASSET_HOLDER); /*////////////////////////////////////////////////////////////////////////// CREATE @@ -132,7 +133,7 @@ abstract contract LockupDynamic_Fork_Test is Fork_Test { // Load the pre-create asset balances. vars.balances = - getTokenBalances(address(ASSET), Solarray.addresses(address(lockupDynamic), params.broker.account)); + getTokenBalances(address(FORK_ASSET), Solarray.addresses(address(lockupDynamic), params.broker.account)); vars.initialLockupDynamicBalance = vars.balances[0]; vars.initialBrokerBalance = vars.balances[1]; @@ -148,11 +149,11 @@ abstract contract LockupDynamic_Fork_Test is Fork_Test { vm.expectEmit({ emitter: address(lockupDynamic) }); emit CreateLockupDynamicStream({ streamId: vars.streamId, - funder: HOLDER, + funder: FORK_ASSET_HOLDER, sender: params.sender, recipient: params.recipient, amounts: vars.createAmounts, - asset: ASSET, + asset: FORK_ASSET, cancelable: true, transferable: true, segments: params.segments, @@ -166,7 +167,7 @@ abstract contract LockupDynamic_Fork_Test is Fork_Test { sender: params.sender, recipient: params.recipient, totalAmount: vars.totalAmount, - asset: ASSET, + asset: FORK_ASSET, cancelable: true, transferable: true, startTime: params.startTime, @@ -183,7 +184,7 @@ abstract contract LockupDynamic_Fork_Test is Fork_Test { // Assert that the stream has been created. LockupDynamic.StreamLD memory actualStream = lockupDynamic.getStream(vars.streamId); assertEq(actualStream.amounts, Lockup.Amounts(vars.createAmounts.deposit, 0, 0)); - assertEq(actualStream.asset, ASSET, "asset"); + assertEq(actualStream.asset, FORK_ASSET, "asset"); assertEq(actualStream.endTime, vars.timestamps.end, "endTime"); assertEq(actualStream.isCancelable, vars.isCancelable, "isCancelable"); assertEq(actualStream.isDepleted, false, "isDepleted"); @@ -217,8 +218,9 @@ abstract contract LockupDynamic_Fork_Test is Fork_Test { assertEq(vars.actualNFTOwner, vars.expectedNFTOwner, "post-create NFT owner"); // Load the post-create asset balances. - vars.balances = - getTokenBalances(address(ASSET), Solarray.addresses(address(lockupDynamic), HOLDER, params.broker.account)); + vars.balances = getTokenBalances( + address(FORK_ASSET), Solarray.addresses(address(lockupDynamic), FORK_ASSET_HOLDER, params.broker.account) + ); vars.actualLockupDynamicBalance = vars.balances[0]; vars.actualHolderBalance = vars.balances[1]; vars.actualBrokerBalance = vars.balances[2]; @@ -261,14 +263,14 @@ abstract contract LockupDynamic_Fork_Test is Fork_Test { if (params.withdrawAmount > 0) { // Load the pre-withdraw asset balances. vars.initialLockupDynamicBalance = vars.actualLockupDynamicBalance; - vars.initialRecipientBalance = ASSET.balanceOf(params.recipient); + vars.initialRecipientBalance = FORK_ASSET.balanceOf(params.recipient); // Expect the relevant events to be emitted. vm.expectEmit({ emitter: address(lockupDynamic) }); emit WithdrawFromLockupStream({ streamId: vars.streamId, to: params.recipient, - asset: ASSET, + asset: FORK_ASSET, amount: params.withdrawAmount }); vm.expectEmit({ emitter: address(lockupDynamic) }); @@ -296,7 +298,7 @@ abstract contract LockupDynamic_Fork_Test is Fork_Test { // Load the post-withdraw asset balances. vars.balances = - getTokenBalances(address(ASSET), Solarray.addresses(address(lockupDynamic), params.recipient)); + getTokenBalances(address(FORK_ASSET), Solarray.addresses(address(lockupDynamic), params.recipient)); vars.actualLockupDynamicBalance = vars.balances[0]; vars.actualRecipientBalance = vars.balances[1]; @@ -321,7 +323,7 @@ abstract contract LockupDynamic_Fork_Test is Fork_Test { if (!vars.isDepleted && !vars.isSettled) { // Load the pre-cancel asset balances. vars.balances = getTokenBalances( - address(ASSET), Solarray.addresses(address(lockupDynamic), params.sender, params.recipient) + address(FORK_ASSET), Solarray.addresses(address(lockupDynamic), params.sender, params.recipient) ); vars.initialLockupDynamicBalance = vars.balances[0]; vars.initialSenderBalance = vars.balances[1]; @@ -332,7 +334,7 @@ abstract contract LockupDynamic_Fork_Test is Fork_Test { vars.senderAmount = lockupDynamic.refundableAmountOf(vars.streamId); vars.recipientAmount = lockupDynamic.withdrawableAmountOf(vars.streamId); emit CancelLockupStream( - vars.streamId, params.sender, params.recipient, ASSET, vars.senderAmount, vars.recipientAmount + vars.streamId, params.sender, params.recipient, FORK_ASSET, vars.senderAmount, vars.recipientAmount ); vm.expectEmit({ emitter: address(lockupDynamic) }); emit MetadataUpdate({ _tokenId: vars.streamId }); @@ -348,7 +350,7 @@ abstract contract LockupDynamic_Fork_Test is Fork_Test { // Load the post-cancel asset balances. vars.balances = getTokenBalances( - address(ASSET), Solarray.addresses(address(lockupDynamic), params.sender, params.recipient) + address(FORK_ASSET), Solarray.addresses(address(lockupDynamic), params.sender, params.recipient) ); vars.actualLockupDynamicBalance = vars.balances[0]; vars.actualSenderBalance = vars.balances[1]; diff --git a/test/fork/LockupLinear.t.sol b/test/fork/LockupLinear.t.sol index 46fac970d..f10fde71c 100644 --- a/test/fork/LockupLinear.t.sol +++ b/test/fork/LockupLinear.t.sol @@ -14,7 +14,7 @@ abstract contract LockupLinear_Fork_Test is Fork_Test { CONSTRUCTOR //////////////////////////////////////////////////////////////////////////*/ - constructor(IERC20 asset, address holder) Fork_Test(asset, holder) { } + constructor(IERC20 forkAsset, address forkAssetHolder) Fork_Test(forkAsset, forkAssetHolder) { } /*////////////////////////////////////////////////////////////////////////// SET-UP FUNCTION @@ -25,7 +25,7 @@ abstract contract LockupLinear_Fork_Test is Fork_Test { // Approve {SablierV2LockupLinear} to transfer the asset holder's assets. // We use a low-level call to ignore reverts because the asset can have the missing return value bug. - (bool success,) = address(ASSET).call(abi.encodeCall(IERC20.approve, (address(lockupLinear), MAX_UINT256))); + (bool success,) = address(FORK_ASSET).call(abi.encodeCall(IERC20.approve, (address(lockupLinear), MAX_UINT256))); success; } @@ -134,7 +134,7 @@ abstract contract LockupLinear_Fork_Test is Fork_Test { boundUint40(params.timestamps.end, vars.endTimeLowerBound + 1 seconds, MAX_UNIX_TIMESTAMP); // Make the holder the caller. - resetPrank(HOLDER); + resetPrank(FORK_ASSET_HOLDER); /*////////////////////////////////////////////////////////////////////////// CREATE @@ -142,7 +142,7 @@ abstract contract LockupLinear_Fork_Test is Fork_Test { // Load the pre-create asset balances. vars.balances = - getTokenBalances(address(ASSET), Solarray.addresses(address(lockupLinear), params.broker.account)); + getTokenBalances(address(FORK_ASSET), Solarray.addresses(address(lockupLinear), params.broker.account)); vars.initialLockupLinearBalance = vars.balances[0]; vars.initialBrokerBalance = vars.balances[1]; @@ -158,11 +158,11 @@ abstract contract LockupLinear_Fork_Test is Fork_Test { vm.expectEmit({ emitter: address(lockupLinear) }); emit CreateLockupLinearStream({ streamId: vars.streamId, - funder: HOLDER, + funder: FORK_ASSET_HOLDER, sender: params.sender, recipient: params.recipient, amounts: vars.createAmounts, - asset: ASSET, + asset: FORK_ASSET, cancelable: true, transferable: true, timestamps: params.timestamps, @@ -175,7 +175,7 @@ abstract contract LockupLinear_Fork_Test is Fork_Test { sender: params.sender, recipient: params.recipient, totalAmount: params.totalAmount, - asset: ASSET, + asset: FORK_ASSET, cancelable: true, transferable: true, timestamps: params.timestamps, @@ -186,7 +186,7 @@ abstract contract LockupLinear_Fork_Test is Fork_Test { // Assert that the stream has been created. LockupLinear.StreamLL memory actualStream = lockupLinear.getStream(vars.streamId); assertEq(actualStream.amounts, Lockup.Amounts(vars.createAmounts.deposit, 0, 0)); - assertEq(actualStream.asset, ASSET, "asset"); + assertEq(actualStream.asset, FORK_ASSET, "asset"); assertEq(actualStream.cliffTime, params.timestamps.cliff, "cliffTime"); assertEq(actualStream.endTime, params.timestamps.end, "endTime"); assertEq(actualStream.isCancelable, true, "isCancelable"); @@ -215,8 +215,9 @@ abstract contract LockupLinear_Fork_Test is Fork_Test { assertEq(vars.actualNFTOwner, vars.expectedNFTOwner, "post-create NFT owner"); // Load the post-create asset balances. - vars.balances = - getTokenBalances(address(ASSET), Solarray.addresses(address(lockupLinear), HOLDER, params.broker.account)); + vars.balances = getTokenBalances( + address(FORK_ASSET), Solarray.addresses(address(lockupLinear), FORK_ASSET_HOLDER, params.broker.account) + ); vars.actualLockupLinearBalance = vars.balances[0]; vars.actualHolderBalance = vars.balances[1]; vars.actualBrokerBalance = vars.balances[2]; @@ -258,14 +259,14 @@ abstract contract LockupLinear_Fork_Test is Fork_Test { if (params.withdrawAmount > 0) { // Load the pre-withdraw asset balances. vars.initialLockupLinearBalance = vars.actualLockupLinearBalance; - vars.initialRecipientBalance = ASSET.balanceOf(params.recipient); + vars.initialRecipientBalance = FORK_ASSET.balanceOf(params.recipient); // Expect the relevant events to be emitted. vm.expectEmit({ emitter: address(lockupLinear) }); emit WithdrawFromLockupStream({ streamId: vars.streamId, to: params.recipient, - asset: ASSET, + asset: FORK_ASSET, amount: params.withdrawAmount }); vm.expectEmit({ emitter: address(lockupLinear) }); @@ -293,7 +294,7 @@ abstract contract LockupLinear_Fork_Test is Fork_Test { // Load the post-withdraw asset balances. vars.balances = - getTokenBalances(address(ASSET), Solarray.addresses(address(lockupLinear), params.recipient)); + getTokenBalances(address(FORK_ASSET), Solarray.addresses(address(lockupLinear), params.recipient)); vars.actualLockupLinearBalance = vars.balances[0]; vars.actualRecipientBalance = vars.balances[1]; @@ -316,7 +317,7 @@ abstract contract LockupLinear_Fork_Test is Fork_Test { if (!vars.isDepleted && !vars.isSettled) { // Load the pre-cancel asset balances. vars.balances = getTokenBalances( - address(ASSET), Solarray.addresses(address(lockupLinear), params.sender, params.recipient) + address(FORK_ASSET), Solarray.addresses(address(lockupLinear), params.sender, params.recipient) ); vars.initialLockupLinearBalance = vars.balances[0]; vars.initialSenderBalance = vars.balances[1]; @@ -327,7 +328,7 @@ abstract contract LockupLinear_Fork_Test is Fork_Test { vars.senderAmount = lockupLinear.refundableAmountOf(vars.streamId); vars.recipientAmount = lockupLinear.withdrawableAmountOf(vars.streamId); emit CancelLockupStream( - vars.streamId, params.sender, params.recipient, ASSET, vars.senderAmount, vars.recipientAmount + vars.streamId, params.sender, params.recipient, FORK_ASSET, vars.senderAmount, vars.recipientAmount ); vm.expectEmit({ emitter: address(lockupLinear) }); emit MetadataUpdate({ _tokenId: vars.streamId }); @@ -343,7 +344,7 @@ abstract contract LockupLinear_Fork_Test is Fork_Test { // Load the post-cancel asset balances. vars.balances = getTokenBalances( - address(ASSET), Solarray.addresses(address(lockupLinear), params.sender, params.recipient) + address(FORK_ASSET), Solarray.addresses(address(lockupLinear), params.sender, params.recipient) ); vars.actualLockupLinearBalance = vars.balances[0]; vars.actualSenderBalance = vars.balances[1]; diff --git a/test/fork/LockupTranched.t.sol b/test/fork/LockupTranched.t.sol index e39f0423d..e07a0c7e2 100644 --- a/test/fork/LockupTranched.t.sol +++ b/test/fork/LockupTranched.t.sol @@ -13,7 +13,7 @@ abstract contract LockupTranched_Fork_Test is Fork_Test { CONSTRUCTOR //////////////////////////////////////////////////////////////////////////*/ - constructor(IERC20 asset, address holder) Fork_Test(asset, holder) { } + constructor(IERC20 forkAsset, address forkAssetHolder) Fork_Test(forkAsset, forkAssetHolder) { } /*////////////////////////////////////////////////////////////////////////// SET-UP FUNCTION @@ -24,7 +24,8 @@ abstract contract LockupTranched_Fork_Test is Fork_Test { // Approve {SablierV2LockupTranched} to transfer the holder's assets. // We use a low-level call to ignore reverts because the asset can have the missing return value bug. - (bool success,) = address(ASSET).call(abi.encodeCall(IERC20.approve, (address(lockupTranched), MAX_UINT256))); + (bool success,) = + address(FORK_ASSET).call(abi.encodeCall(IERC20.approve, (address(lockupTranched), MAX_UINT256))); success; } @@ -124,7 +125,7 @@ abstract contract LockupTranched_Fork_Test is Fork_Test { }); // Make the holder the caller. - resetPrank(HOLDER); + resetPrank(FORK_ASSET_HOLDER); /*////////////////////////////////////////////////////////////////////////// CREATE @@ -132,7 +133,7 @@ abstract contract LockupTranched_Fork_Test is Fork_Test { // Load the pre-create asset balances. vars.balances = - getTokenBalances(address(ASSET), Solarray.addresses(address(lockupTranched), params.broker.account)); + getTokenBalances(address(FORK_ASSET), Solarray.addresses(address(lockupTranched), params.broker.account)); vars.initialLockupTranchedBalance = vars.balances[0]; vars.initialBrokerBalance = vars.balances[1]; @@ -148,11 +149,11 @@ abstract contract LockupTranched_Fork_Test is Fork_Test { vm.expectEmit({ emitter: address(lockupTranched) }); emit CreateLockupTranchedStream({ streamId: vars.streamId, - funder: HOLDER, + funder: FORK_ASSET_HOLDER, sender: params.sender, recipient: params.recipient, amounts: vars.createAmounts, - asset: ASSET, + asset: FORK_ASSET, cancelable: true, transferable: true, tranches: params.tranches, @@ -166,7 +167,7 @@ abstract contract LockupTranched_Fork_Test is Fork_Test { sender: params.sender, recipient: params.recipient, totalAmount: vars.totalAmount, - asset: ASSET, + asset: FORK_ASSET, cancelable: true, transferable: true, startTime: params.startTime, @@ -183,7 +184,7 @@ abstract contract LockupTranched_Fork_Test is Fork_Test { // Assert that the stream has been created. LockupTranched.StreamLT memory actualStream = lockupTranched.getStream(vars.streamId); assertEq(actualStream.amounts, Lockup.Amounts(vars.createAmounts.deposit, 0, 0)); - assertEq(actualStream.asset, ASSET, "asset"); + assertEq(actualStream.asset, FORK_ASSET, "asset"); assertEq(actualStream.endTime, vars.timestamps.end, "endTime"); assertEq(actualStream.isCancelable, vars.isCancelable, "isCancelable"); assertEq(actualStream.isDepleted, false, "isDepleted"); @@ -217,8 +218,9 @@ abstract contract LockupTranched_Fork_Test is Fork_Test { assertEq(vars.actualNFTOwner, vars.expectedNFTOwner, "post-create NFT owner"); // Load the post-create asset balances. - vars.balances = - getTokenBalances(address(ASSET), Solarray.addresses(address(lockupTranched), HOLDER, params.broker.account)); + vars.balances = getTokenBalances( + address(FORK_ASSET), Solarray.addresses(address(lockupTranched), FORK_ASSET_HOLDER, params.broker.account) + ); vars.actualLockupTranchedBalance = vars.balances[0]; vars.actualHolderBalance = vars.balances[1]; vars.actualBrokerBalance = vars.balances[2]; @@ -261,14 +263,14 @@ abstract contract LockupTranched_Fork_Test is Fork_Test { if (params.withdrawAmount > 0) { // Load the pre-withdraw asset balances. vars.initialLockupTranchedBalance = vars.actualLockupTranchedBalance; - vars.initialRecipientBalance = ASSET.balanceOf(params.recipient); + vars.initialRecipientBalance = FORK_ASSET.balanceOf(params.recipient); // Expect the relevant events to be emitted. vm.expectEmit({ emitter: address(lockupTranched) }); emit WithdrawFromLockupStream({ streamId: vars.streamId, to: params.recipient, - asset: ASSET, + asset: FORK_ASSET, amount: params.withdrawAmount }); vm.expectEmit({ emitter: address(lockupTranched) }); @@ -296,7 +298,7 @@ abstract contract LockupTranched_Fork_Test is Fork_Test { // Load the post-withdraw asset balances. vars.balances = - getTokenBalances(address(ASSET), Solarray.addresses(address(lockupTranched), params.recipient)); + getTokenBalances(address(FORK_ASSET), Solarray.addresses(address(lockupTranched), params.recipient)); vars.actualLockupTranchedBalance = vars.balances[0]; vars.actualRecipientBalance = vars.balances[1]; @@ -321,7 +323,7 @@ abstract contract LockupTranched_Fork_Test is Fork_Test { if (!vars.isDepleted && !vars.isSettled) { // Load the pre-cancel asset balances. vars.balances = getTokenBalances( - address(ASSET), Solarray.addresses(address(lockupTranched), params.sender, params.recipient) + address(FORK_ASSET), Solarray.addresses(address(lockupTranched), params.sender, params.recipient) ); vars.initialLockupTranchedBalance = vars.balances[0]; vars.initialSenderBalance = vars.balances[1]; @@ -332,7 +334,7 @@ abstract contract LockupTranched_Fork_Test is Fork_Test { vars.senderAmount = lockupTranched.refundableAmountOf(vars.streamId); vars.recipientAmount = lockupTranched.withdrawableAmountOf(vars.streamId); emit CancelLockupStream( - vars.streamId, params.sender, params.recipient, ASSET, vars.senderAmount, vars.recipientAmount + vars.streamId, params.sender, params.recipient, FORK_ASSET, vars.senderAmount, vars.recipientAmount ); vm.expectEmit({ emitter: address(lockupTranched) }); emit MetadataUpdate({ _tokenId: vars.streamId }); @@ -348,7 +350,7 @@ abstract contract LockupTranched_Fork_Test is Fork_Test { // Load the post-cancel asset balances. vars.balances = getTokenBalances( - address(ASSET), Solarray.addresses(address(lockupTranched), params.sender, params.recipient) + address(FORK_ASSET), Solarray.addresses(address(lockupTranched), params.sender, params.recipient) ); vars.actualLockupTranchedBalance = vars.balances[0]; vars.actualSenderBalance = vars.balances[1]; diff --git a/test/fork/assets/DAI.t.sol b/test/fork/assets/DAI.t.sol index 6bf507732..6ef555b06 100644 --- a/test/fork/assets/DAI.t.sol +++ b/test/fork/assets/DAI.t.sol @@ -8,11 +8,11 @@ import { LockupLinear_Fork_Test } from "../LockupLinear.t.sol"; import { LockupTranched_Fork_Test } from "../LockupTranched.t.sol"; /// @dev A typical 18-decimal ERC-20 asset with a normal total supply. -IERC20 constant ASSET = IERC20(0x6B175474E89094C44Da98b954EedeAC495271d0F); -address constant HOLDER = 0x66F62574ab04989737228D18C3624f7FC1edAe14; +IERC20 constant FORK_ASSET = IERC20(0x6B175474E89094C44Da98b954EedeAC495271d0F); +address constant FORK_ASSET_HOLDER = 0x66F62574ab04989737228D18C3624f7FC1edAe14; -contract DAI_LockupDynamic_Fork_Test is LockupDynamic_Fork_Test(ASSET, HOLDER) { } +contract DAI_LockupDynamic_Fork_Test is LockupDynamic_Fork_Test(FORK_ASSET, FORK_ASSET_HOLDER) { } -contract DAI_LockupLinear_Fork_Test is LockupLinear_Fork_Test(ASSET, HOLDER) { } +contract DAI_LockupLinear_Fork_Test is LockupLinear_Fork_Test(FORK_ASSET, FORK_ASSET_HOLDER) { } -contract DAI_LockupTranched_Fork_Test is LockupTranched_Fork_Test(ASSET, HOLDER) { } +contract DAI_LockupTranched_Fork_Test is LockupTranched_Fork_Test(FORK_ASSET, FORK_ASSET_HOLDER) { } diff --git a/test/fork/assets/EURS.t.sol b/test/fork/assets/EURS.t.sol index c27504e63..5abab703e 100644 --- a/test/fork/assets/EURS.t.sol +++ b/test/fork/assets/EURS.t.sol @@ -8,11 +8,11 @@ import { LockupLinear_Fork_Test } from "../LockupLinear.t.sol"; import { LockupTranched_Fork_Test } from "../LockupTranched.t.sol"; /// @dev An ERC-20 asset with 2 decimals. -IERC20 constant ASSET = IERC20(0xdB25f211AB05b1c97D595516F45794528a807ad8); -address constant HOLDER = 0x1bee4F735062CD00841d6997964F187f5f5F5Ac9; +IERC20 constant FORK_ASSET = IERC20(0xdB25f211AB05b1c97D595516F45794528a807ad8); +address constant FORK_ASSET_HOLDER = 0x1bee4F735062CD00841d6997964F187f5f5F5Ac9; -contract EURS_LockupDynamic_Fork_Test is LockupDynamic_Fork_Test(ASSET, HOLDER) { } +contract EURS_LockupDynamic_Fork_Test is LockupDynamic_Fork_Test(FORK_ASSET, FORK_ASSET_HOLDER) { } -contract EURS_LockupLinear_Fork_Test is LockupLinear_Fork_Test(ASSET, HOLDER) { } +contract EURS_LockupLinear_Fork_Test is LockupLinear_Fork_Test(FORK_ASSET, FORK_ASSET_HOLDER) { } -contract EURS_LockupTranched_Fork_Test is LockupTranched_Fork_Test(ASSET, HOLDER) { } +contract EURS_LockupTranched_Fork_Test is LockupTranched_Fork_Test(FORK_ASSET, FORK_ASSET_HOLDER) { } diff --git a/test/fork/assets/SHIB.t.sol b/test/fork/assets/SHIB.t.sol index 6d2f9dcbd..bf51113dc 100644 --- a/test/fork/assets/SHIB.t.sol +++ b/test/fork/assets/SHIB.t.sol @@ -8,11 +8,11 @@ import { LockupLinear_Fork_Test } from "../LockupLinear.t.sol"; import { LockupTranched_Fork_Test } from "../LockupTranched.t.sol"; /// @dev An ERC-20 asset with a large total supply. -IERC20 constant ASSET = IERC20(0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE); -address constant HOLDER = 0x73AF3bcf944a6559933396c1577B257e2054D935; +IERC20 constant FORK_ASSET = IERC20(0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE); +address constant FORK_ASSET_HOLDER = 0x73AF3bcf944a6559933396c1577B257e2054D935; -contract SHIB_LockupDynamic_Fork_Test is LockupDynamic_Fork_Test(ASSET, HOLDER) { } +contract SHIB_LockupDynamic_Fork_Test is LockupDynamic_Fork_Test(FORK_ASSET, FORK_ASSET_HOLDER) { } -contract SHIB_LockupLinear_Fork_Test is LockupLinear_Fork_Test(ASSET, HOLDER) { } +contract SHIB_LockupLinear_Fork_Test is LockupLinear_Fork_Test(FORK_ASSET, FORK_ASSET_HOLDER) { } -contract SHIB_LockupTranched_Fork_Test is LockupTranched_Fork_Test(ASSET, HOLDER) { } +contract SHIB_LockupTranched_Fork_Test is LockupTranched_Fork_Test(FORK_ASSET, FORK_ASSET_HOLDER) { } diff --git a/test/fork/assets/USDC.t.sol b/test/fork/assets/USDC.t.sol index f253f779a..09c3f5d30 100644 --- a/test/fork/assets/USDC.t.sol +++ b/test/fork/assets/USDC.t.sol @@ -8,11 +8,11 @@ import { LockupLinear_Fork_Test } from "../LockupLinear.t.sol"; import { LockupTranched_Fork_Test } from "../LockupTranched.t.sol"; /// @dev An ERC-20 asset with 6 decimals. -IERC20 constant ASSET = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48); -address constant HOLDER = 0x09528d637deb5857dc059dddE6316D465a8b3b69; +IERC20 constant FORK_ASSET = IERC20(0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48); +address constant FORK_ASSET_HOLDER = 0x09528d637deb5857dc059dddE6316D465a8b3b69; -contract USDC_LockupDynamic_Fork_Test is LockupDynamic_Fork_Test(ASSET, HOLDER) { } +contract USDC_LockupDynamic_Fork_Test is LockupDynamic_Fork_Test(FORK_ASSET, FORK_ASSET_HOLDER) { } -contract USDC_LockupLinear_Fork_Test is LockupLinear_Fork_Test(ASSET, HOLDER) { } +contract USDC_LockupLinear_Fork_Test is LockupLinear_Fork_Test(FORK_ASSET, FORK_ASSET_HOLDER) { } -contract USDC_LockupTranched_Fork_Test is LockupTranched_Fork_Test(ASSET, HOLDER) { } +contract USDC_LockupTranched_Fork_Test is LockupTranched_Fork_Test(FORK_ASSET, FORK_ASSET_HOLDER) { } diff --git a/test/fork/assets/USDT.t.sol b/test/fork/assets/USDT.t.sol index d2d803eec..da6199324 100644 --- a/test/fork/assets/USDT.t.sol +++ b/test/fork/assets/USDT.t.sol @@ -8,11 +8,11 @@ import { LockupLinear_Fork_Test } from "../LockupLinear.t.sol"; import { LockupTranched_Fork_Test } from "../LockupTranched.t.sol"; /// @dev An ERC-20 asset that suffers from the missing return value bug. -IERC20 constant ASSET = IERC20(0xdAC17F958D2ee523a2206206994597C13D831ec7); -address constant HOLDER = 0xee5B5B923fFcE93A870B3104b7CA09c3db80047A; +IERC20 constant FORK_ASSET = IERC20(0xdAC17F958D2ee523a2206206994597C13D831ec7); +address constant FORK_ASSET_HOLDER = 0xee5B5B923fFcE93A870B3104b7CA09c3db80047A; -contract USDT_LockupDynamic_Fork_Test is LockupDynamic_Fork_Test(ASSET, HOLDER) { } +contract USDT_LockupDynamic_Fork_Test is LockupDynamic_Fork_Test(FORK_ASSET, FORK_ASSET_HOLDER) { } -contract USDT_LockupLinear_Fork_Test is LockupLinear_Fork_Test(ASSET, HOLDER) { } +contract USDT_LockupLinear_Fork_Test is LockupLinear_Fork_Test(FORK_ASSET, FORK_ASSET_HOLDER) { } -contract USDT_LockupTranched_Fork_Test is LockupTranched_Fork_Test(ASSET, HOLDER) { } +contract USDT_LockupTranched_Fork_Test is LockupTranched_Fork_Test(FORK_ASSET, FORK_ASSET_HOLDER) { }