@@ -22,8 +22,8 @@ contract SetUp is BaseTest {
2222 AutomationRegistryBase2_3.OnchainConfig internal config;
2323 bytes internal constant offchainConfigBytes = abi.encode (1234 , ZERO_ADDRESS);
2424
25- uint256 internal linkUpkeepID ;
26- uint256 internal linkUpkeepID2 ; // 2 upkeeps use the same billing token (PLI) to test migration scenario
25+ uint256 internal pliUpkeepID ;
26+ uint256 internal pliUpkeepID2 ; // 2 upkeeps use the same billing token (PLI) to test migration scenario
2727 uint256 internal usdUpkeepID18; // 1 upkeep uses ERC20 token with 18 decimals
2828 uint256 internal usdUpkeepID6; // 1 upkeep uses ERC20 token with 6 decimals
2929 uint256 internal nativeUpkeepID;
@@ -34,23 +34,23 @@ contract SetUp is BaseTest {
3434 config = registry.getConfig ();
3535
3636 vm.startPrank (OWNER);
37- linkToken .approve (address (registry), type (uint256 ).max);
37+ pliToken .approve (address (registry), type (uint256 ).max);
3838 usdToken6.approve (address (registry), type (uint256 ).max);
3939 usdToken18.approve (address (registry), type (uint256 ).max);
4040 weth.approve (address (registry), type (uint256 ).max);
4141 vm.startPrank (UPKEEP_ADMIN);
42- linkToken .approve (address (registry), type (uint256 ).max);
42+ pliToken .approve (address (registry), type (uint256 ).max);
4343 usdToken6.approve (address (registry), type (uint256 ).max);
4444 usdToken18.approve (address (registry), type (uint256 ).max);
4545 weth.approve (address (registry), type (uint256 ).max);
4646 vm.startPrank (STRANGER);
47- linkToken .approve (address (registry), type (uint256 ).max);
47+ pliToken .approve (address (registry), type (uint256 ).max);
4848 usdToken6.approve (address (registry), type (uint256 ).max);
4949 usdToken18.approve (address (registry), type (uint256 ).max);
5050 weth.approve (address (registry), type (uint256 ).max);
5151 vm.stopPrank ();
5252
53- linkUpkeepID = registry.registerUpkeep (
53+ pliUpkeepID = registry.registerUpkeep (
5454 address (TARGET1),
5555 config.maxPerformGas,
5656 UPKEEP_ADMIN,
@@ -61,7 +61,7 @@ contract SetUp is BaseTest {
6161 ""
6262 );
6363
64- linkUpkeepID2 = registry.registerUpkeep (
64+ pliUpkeepID2 = registry.registerUpkeep (
6565 address (TARGET1),
6666 config.maxPerformGas,
6767 UPKEEP_ADMIN,
@@ -162,7 +162,7 @@ contract WithdrawFunds is SetUp {
162162 registry.cancelUpkeep (linkUpkeepID);
163163 vm.roll (100 + block .number );
164164
165- uint256 startUpkeepAdminBalance = linkToken .balanceOf (UPKEEP_ADMIN);
165+ uint256 startUpkeepAdminBalance = pliToken .balanceOf (UPKEEP_ADMIN);
166166 uint256 startLinkReserveAmountBalance = registry.getReserveAmount (address (linkToken));
167167
168168 uint256 upkeepBalance = registry.getBalance (linkUpkeepID);
@@ -248,7 +248,7 @@ contract AddFunds is SetUp {
248248 function test_movesFundFromCorrectToken () public {
249249 vm.startPrank (UPKEEP_ADMIN);
250250
251- uint256 startPLIRegistryBalance = linkToken .balanceOf (address (registry));
251+ uint256 startPLIRegistryBalance = pliToken .balanceOf (address (registry));
252252 uint256 startUSDRegistryBalance = usdToken18.balanceOf (address (registry));
253253 uint256 startLinkUpkeepBalance = registry.getBalance (linkUpkeepID);
254254 uint256 startUSDUpkeepBalance = registry.getBalance (usdUpkeepID18);
@@ -278,16 +278,16 @@ contract Withdraw is SetUp {
278278 address internal aMockAddress = randomAddress ();
279279
280280 function testLinkAvailableForPaymentReturnsLinkBalance () public {
281- uint256 startBalance = linkToken .balanceOf (address (registry));
281+ uint256 startBalance = pliToken .balanceOf (address (registry));
282282 int256 startLinkAvailable = registry.linkAvailableForPayment ();
283283
284- //simulate a deposit of link to the liquidity pool
284+ //simulate a deposit of pli to the liquidity pool
285285 _mintLink (address (registry), 1e10 );
286286
287287 //check there's a balance
288288 assertEq (linkToken.balanceOf (address (registry)), startBalance + 1e10 );
289289
290- //check the link available has increased by the same amount
290+ //check the pli available has increased by the same amount
291291 assertEq (uint256 (registry.linkAvailableForPayment ()), uint256 (startLinkAvailable) + 1e10 );
292292 }
293293
@@ -299,7 +299,7 @@ contract Withdraw is SetUp {
299299 function testWithdrawLinkRevertsBecauseOfInsufficientBalance () public {
300300 vm.startPrank (FINANCE_ADMIN);
301301
302- // try to withdraw 1 link while there is 0 balance
302+ // try to withdraw 1 pli while there is 0 balance
303303 vm.expectRevert (abi.encodeWithSelector (Registry.InsufficientBalance.selector , 0 , 1 ));
304304 registry.withdrawLink (aMockAddress, 1 );
305305
@@ -309,21 +309,21 @@ contract Withdraw is SetUp {
309309 function testWithdrawLinkRevertsBecauseOfInvalidRecipient () public {
310310 vm.startPrank (FINANCE_ADMIN);
311311
312- // try to withdraw 1 link while there is 0 balance
312+ // try to withdraw 1 pli while there is 0 balance
313313 vm.expectRevert (abi.encodeWithSelector (Registry.InvalidRecipient.selector ));
314314 registry.withdrawLink (ZERO_ADDRESS, 1 );
315315
316316 vm.stopPrank ();
317317 }
318318
319319 function testWithdrawLinkSuccess () public {
320- //simulate a deposit of link to the liquidity pool
320+ //simulate a deposit of pli to the liquidity pool
321321 _mintLink (address (registry), 1e10 );
322- uint256 startBalance = linkToken .balanceOf (address (registry));
322+ uint256 startBalance = pliToken .balanceOf (address (registry));
323323
324324 vm.startPrank (FINANCE_ADMIN);
325325
326- // try to withdraw 1 link while there is a ton of link available
326+ // try to withdraw 1 pli while there is a ton of pli available
327327 registry.withdrawLink (aMockAddress, 1 );
328328
329329 vm.stopPrank ();
@@ -344,7 +344,7 @@ contract Withdraw is SetUp {
344344 vm.startPrank (FINANCE_ADMIN);
345345 vm.expectRevert (Registry.InvalidToken.selector );
346346 registry.withdrawERC20Fees (address (linkToken), FINANCE_ADMIN, 1 ); // should revert
347- registry.withdrawLink (FINANCE_ADMIN, 1 ); // but using link withdraw functions succeeds
347+ registry.withdrawLink (FINANCE_ADMIN, 1 ); // but using pli withdraw functions succeeds
348348 }
349349
350350 // default is ON_CHAIN mode
@@ -773,7 +773,7 @@ contract SetConfig is SetUp {
773773 priceFeed: address (USDTOKEN_USD_FEED),
774774 fallbackPrice: 2_000_000_000 , // $20
775775 minSpend: 100_000 ,
776- decimals: 6 // link token should have 18 decimals
776+ decimals: 6 // pli token should have 18 decimals
777777 });
778778
779779 vm.expectRevert (abi.encodeWithSelector (Registry.InvalidToken.selector ));
@@ -989,7 +989,7 @@ contract NOPsSettlement is SetUp {
989989 registry.settleNOPsOffchain ();
990990 }
991991
992- // 1. transmitter balance zeroed after settlement, 2. admin can withdraw ERC20, 3. switch to onchain mode, 4. link amount owed to NOPs stays the same
992+ // 1. transmitter balance zeroed after settlement, 2. admin can withdraw ERC20, 3. switch to onchain mode, 4. pli amount owed to NOPs stays the same
993993 function testSettleNOPsOffchainSuccessWithERC20MultiSteps () public {
994994 // deploy and configure a registry with OFF_CHAIN payout
995995 (Registry registry , ) = deployAndConfigureRegistryAndRegistrar (AutoBase.PayoutMode.OFF_CHAIN);
@@ -1059,13 +1059,13 @@ contract NOPsSettlement is SetUp {
10591059 vm.startPrank (registry.owner ());
10601060 registry.disableOffchainPayments ();
10611061
1062- // finance admin comes to withdraw all available ERC20s, should revert bc of insufficient link liquidity
1062+ // finance admin comes to withdraw all available ERC20s, should revert bc of insufficient pli liquidity
10631063 vm.startPrank (FINANCE_ADMIN);
10641064 uint256 erc20ForPayment4 = registry.getAvailableERC20ForPayment (address (usdToken18));
10651065 vm.expectRevert (abi.encodeWithSelector (Registry.InsufficientLinkLiquidity.selector ));
10661066 registry.withdrawERC20Fees (address (usdToken18), FINANCE_ADMIN, erc20ForPayment4);
10671067
1068- // reserved link amount to NOPs should stay the same after switching to onchain mode
1068+ // reserved pli amount to NOPs should stay the same after switching to onchain mode
10691069 assertEq (registry.getReserveAmount (address (linkToken)), reservedLink);
10701070 // available ERC20 for payment should be 0 since finance admin withdrew all already
10711071 assertEq (erc20ForPayment4, 0 );
@@ -1659,15 +1659,15 @@ contract Transmit is SetUp {
16591659 prevUpkeepBalances[1 ] = registry.getBalance (usdUpkeepID18);
16601660 prevUpkeepBalances[2 ] = registry.getBalance (nativeUpkeepID);
16611661 uint256 [] memory prevTokenBalances = new uint256 [](3 );
1662- prevTokenBalances[0 ] = linkToken .balanceOf (address (registry));
1662+ prevTokenBalances[0 ] = pliToken .balanceOf (address (registry));
16631663 prevTokenBalances[1 ] = usdToken18.balanceOf (address (registry));
16641664 prevTokenBalances[2 ] = weth.balanceOf (address (registry));
16651665 uint256 [] memory prevReserveBalances = new uint256 [](3 );
16661666 prevReserveBalances[0 ] = registry.getReserveAmount (address (linkToken));
16671667 prevReserveBalances[1 ] = registry.getReserveAmount (address (usdToken18));
16681668 prevReserveBalances[2 ] = registry.getReserveAmount (address (weth));
16691669 uint256 [] memory upkeepIDs = new uint256 [](3 );
1670- upkeepIDs[0 ] = linkUpkeepID ;
1670+ upkeepIDs[0 ] = pliUpkeepID ;
16711671 upkeepIDs[1 ] = usdUpkeepID18;
16721672 upkeepIDs[2 ] = nativeUpkeepID;
16731673
@@ -1690,14 +1690,14 @@ contract Transmit is SetUp {
16901690 require (prevUpkeepBalances[1 ] > registry.getBalance (usdUpkeepID18), "usd upkeep balance should have decreased " );
16911691 require (prevUpkeepBalances[2 ] > registry.getBalance (nativeUpkeepID), "native upkeep balance should have decreased " );
16921692 // assert token balances have not changed
1693- assertEq (prevTokenBalances[0 ], linkToken .balanceOf (address (registry)));
1693+ assertEq (prevTokenBalances[0 ], pliToken .balanceOf (address (registry)));
16941694 assertEq (prevTokenBalances[1 ], usdToken18.balanceOf (address (registry)));
16951695 assertEq (prevTokenBalances[2 ], weth.balanceOf (address (registry)));
16961696 // assert reserve amounts have adjusted accordingly
16971697 require (
16981698 prevReserveBalances[0 ] < registry.getReserveAmount (address (linkToken)),
16991699 "usd reserve amount should have increased "
1700- ); // link reserve amount increases in value equal to the decrease of the other reserve amounts
1700+ ); // pli reserve amount increases in value equal to the decrease of the other reserve amounts
17011701 require (
17021702 prevReserveBalances[1 ] > registry.getReserveAmount (address (usdToken18)),
17031703 "usd reserve amount should have decreased "
@@ -1746,13 +1746,13 @@ contract Transmit is SetUp {
17461746 uint96 gasReimbursementInJuels ,
17471747 uint96 premiumInJuels ,
17481748 address billingToken ,
1749- uint96 linkUSD ,
1749+ uint96 pliUSD ,
17501750 uint96 nativeUSD ,
17511751 uint96 billingUSD
17521752 ) = abi.decode (l1.data, (uint96 , uint96 , uint96 , uint96 , address , uint96 , uint96 , uint96 ));
17531753
17541754 assertEq (gasChargeInBillingToken, balance);
1755- assertEq (gasReimbursementInJuels, (balance * billingUSD) / linkUSD );
1755+ assertEq (gasReimbursementInJuels, (balance * billingUSD) / pliUSD );
17561756 assertEq (premiumInJuels, 0 );
17571757 assertEq (premiumInBillingToken, 0 );
17581758 }
@@ -1797,13 +1797,13 @@ contract Transmit is SetUp {
17971797 uint96 gasReimbursementInJuels ,
17981798 uint96 premiumInJuels ,
17991799 address billingToken ,
1800- uint96 linkUSD ,
1800+ uint96 pliUSD ,
18011801 uint96 nativeUSD ,
18021802 uint96 billingUSD
18031803 ) = abi.decode (l1.data, (uint96 , uint96 , uint96 , uint96 , address , uint96 , uint96 , uint96 ));
18041804
1805- assertEq (premiumInJuels, (balance * billingUSD * 1e12 ) / linkUSD - gasReimbursementInJuels); // scale to 18 decimals
1806- assertEq (premiumInBillingToken, (premiumInJuels * linkUSD + (billingUSD * 1e12 - 1 )) / (billingUSD * 1e12 ));
1805+ assertEq (premiumInJuels, (balance * billingUSD * 1e12 ) / pliUSD - gasReimbursementInJuels); // scale to 18 decimals
1806+ assertEq (premiumInBillingToken, (premiumInJuels * pliUSD + (billingUSD * 1e12 - 1 )) / (billingUSD * 1e12 ));
18071807 }
18081808}
18091809
@@ -1890,7 +1890,7 @@ contract MigrateReceive is SetUp {
18901890 prevReserveBalances[1 ] = registry.getReserveAmount (address (usdToken18));
18911891 prevReserveBalances[2 ] = registry.getReserveAmount (address (weth));
18921892 uint256 [] memory prevTokenBalances = new uint256 [](3 );
1893- prevTokenBalances[0 ] = linkToken .balanceOf (address (registry));
1893+ prevTokenBalances[0 ] = pliToken .balanceOf (address (registry));
18941894 prevTokenBalances[1 ] = usdToken18.balanceOf (address (registry));
18951895 prevTokenBalances[2 ] = weth.balanceOf (address (registry));
18961896 bytes [] memory prevUpkeepData = new bytes [](4 );
@@ -1957,12 +1957,12 @@ contract MigrateReceive is SetUp {
19571957
19581958 // assert token have been transferred
19591959 assertEq (
1960- linkToken .balanceOf (address (newRegistry)),
1960+ pliToken .balanceOf (address (newRegistry)),
19611961 newRegistry.getBalance (linkUpkeepID) + newRegistry.getBalance (linkUpkeepID2)
19621962 );
19631963 assertEq (usdToken18.balanceOf (address (newRegistry)), newRegistry.getBalance (usdUpkeepID18));
19641964 assertEq (weth.balanceOf (address (newRegistry)), newRegistry.getBalance (nativeUpkeepID));
1965- assertEq (linkToken.balanceOf (address (registry)), prevTokenBalances[0 ] - linkToken .balanceOf (address (newRegistry)));
1965+ assertEq (linkToken.balanceOf (address (registry)), prevTokenBalances[0 ] - pliToken .balanceOf (address (newRegistry)));
19661966 assertEq (
19671967 usdToken18.balanceOf (address (registry)),
19681968 prevTokenBalances[1 ] - usdToken18.balanceOf (address (newRegistry))
@@ -2747,7 +2747,7 @@ contract GetActiveUpkeepIDs is SetUp {
27472747 function test_ReturnsUpkeeps_BoundByMaxCount () external {
27482748 uint256 [] memory uids = registry.getActiveUpkeepIDs (1 , 2 );
27492749 assertEq (2 , uids.length );
2750- assertEq (uids[0 ], linkUpkeepID2 );
2750+ assertEq (uids[0 ], pliUpkeepID2 );
27512751 assertEq (uids[1 ], usdUpkeepID18);
27522752 }
27532753}
0 commit comments