From b0b3686293f1a54d8a30d5d796a256e98b215da7 Mon Sep 17 00:00:00 2001 From: thurendous Date: Tue, 10 Sep 2024 16:40:24 +0900 Subject: [PATCH] almost all the tests added --- lcov.info | 457 ++++++++++++++------- test/integration/VotingPowerExchange.t.sol | 115 +++++- test/unit/VotingPowerExchange.t.sol | 10 + 3 files changed, 431 insertions(+), 151 deletions(-) diff --git a/lcov.info b/lcov.info index 6b5fa77..d3dad5e 100644 --- a/lcov.info +++ b/lcov.info @@ -1,189 +1,350 @@ TN: +SF:script/DeployContracts.s.sol +FN:48,DeployContracts.run +FNDA:29,DeployContracts.run +DA:50,29 +BRDA:50,0,0,29 +BRDA:50,0,1,- +DA:51,29 +DA:52,29 +DA:53,0 +BRDA:53,1,0,- +BRDA:53,1,1,- +DA:54,0 +DA:56,0 +DA:69,0 +BRDA:69,2,0,- +DA:70,0 +DA:72,0 +DA:87,29 +FN:91,DeployContracts.deploymentsOnLocalNetwork +FNDA:0,DeployContracts.deploymentsOnLocalNetwork +DA:92,29 +DA:93,29 +DA:94,29 +DA:95,29 +DA:96,29 +DA:97,29 +DA:108,29 +DA:109,29 +DA:116,29 +DA:119,29 +DA:122,29 +DA:125,29 +DA:127,29 +DA:129,29 +DA:131,29 +DA:132,29 +DA:134,29 +FNF:2 +FNH:1 +LF:27 +LH:21 +BRF:5 +BRH:1 +end_of_record +TN: SF:src/AmbassadorNft.sol -FN:16,AmbassadorNft. -FNDA:0,AmbassadorNft. -DA:17,0 -DA:18,0 -DA:19,0 -DA:20,0 -FN:23,AmbassadorNft.setURI -FNDA:0,AmbassadorNft.setURI -DA:24,0 -FN:27,AmbassadorNft.mint -FNDA:0,AmbassadorNft.mint -DA:28,0 -FN:31,AmbassadorNft.mintBatch +FN:19,AmbassadorNft. +FNDA:12,AmbassadorNft. +DA:20,12 +BRDA:20,0,0,- +DA:21,12 +DA:22,12 +DA:23,12 +DA:24,12 +FN:27,AmbassadorNft.setURI +FNDA:2,AmbassadorNft.setURI +DA:28,1 +FN:31,AmbassadorNft.mint +FNDA:43,AmbassadorNft.mint +DA:32,39 +FN:35,AmbassadorNft.mintBatch FNDA:0,AmbassadorNft.mintBatch -DA:35,0 -FN:45,AmbassadorNft.burn -FNDA:0,AmbassadorNft.burn -DA:46,0 -FN:50,AmbassadorNft.supportsInterface +DA:39,0 +FN:49,AmbassadorNft.burn +FNDA:9,AmbassadorNft.burn +DA:50,6 +FN:54,AmbassadorNft.supportsInterface FNDA:0,AmbassadorNft.supportsInterface -DA:51,0 +DA:55,0 FNF:6 -FNH:0 -LF:9 -LH:0 -BRF:0 +FNH:4 +LF:10 +LH:8 +BRF:1 BRH:0 end_of_record TN: SF:src/ERC20UpgradeableTokenV1.sol -FN:29,ERC20UpgradeableTokenV1. -FNDA:0,ERC20UpgradeableTokenV1. -DA:30,0 -FN:33,ERC20UpgradeableTokenV1.initialize -FNDA:0,ERC20UpgradeableTokenV1.initialize -DA:42,0 -DA:43,0 -DA:44,0 -DA:45,0 -DA:46,0 -DA:47,0 -DA:49,0 -DA:50,0 -DA:51,0 -DA:52,0 -DA:53,0 -FN:56,ERC20UpgradeableTokenV1.pause -FNDA:0,ERC20UpgradeableTokenV1.pause -DA:57,0 -FN:60,ERC20UpgradeableTokenV1.unpause -FNDA:0,ERC20UpgradeableTokenV1.unpause -DA:61,0 -FN:64,ERC20UpgradeableTokenV1.mint -FNDA:0,ERC20UpgradeableTokenV1.mint -DA:65,0 -FN:73,ERC20UpgradeableTokenV1.burnByBurner -FNDA:0,ERC20UpgradeableTokenV1.burnByBurner -DA:74,0 -FN:77,ERC20UpgradeableTokenV1._authorizeUpgrade -FNDA:0,ERC20UpgradeableTokenV1._authorizeUpgrade -FN:80,ERC20UpgradeableTokenV1._update -FNDA:0,ERC20UpgradeableTokenV1._update -DA:84,0 +FN:34,ERC20UpgradeableTokenV1. +FNDA:42,ERC20UpgradeableTokenV1. +DA:35,42 +FN:38,ERC20UpgradeableTokenV1.initialize +FNDA:41,ERC20UpgradeableTokenV1.initialize +DA:47,41 +BRDA:47,0,0,- +DA:48,41 +DA:49,41 +DA:50,41 +DA:51,41 +DA:52,41 +DA:53,41 +DA:55,41 +DA:56,41 +DA:57,41 +DA:58,41 +DA:59,41 +FN:62,ERC20UpgradeableTokenV1.pause +FNDA:1,ERC20UpgradeableTokenV1.pause +DA:63,1 +FN:66,ERC20UpgradeableTokenV1.unpause +FNDA:1,ERC20UpgradeableTokenV1.unpause +DA:67,1 +FN:70,ERC20UpgradeableTokenV1.mint +FNDA:104,ERC20UpgradeableTokenV1.mint +DA:71,104 +FN:79,ERC20UpgradeableTokenV1.burnByBurner +FNDA:12,ERC20UpgradeableTokenV1.burnByBurner +DA:80,10 +FN:83,ERC20UpgradeableTokenV1._authorizeUpgrade +FNDA:1,ERC20UpgradeableTokenV1._authorizeUpgrade +FN:86,ERC20UpgradeableTokenV1._update +FNDA:121,ERC20UpgradeableTokenV1._update +DA:90,121 FNF:8 -FNH:0 -LF:17 -LH:0 -BRF:0 +FNH:8 +LF:18 +LH:18 +BRF:1 BRH:0 end_of_record TN: SF:src/GovToken.sol -FN:18,GovToken. -FNDA:0,GovToken. -DA:22,0 -DA:23,0 -DA:24,0 -FN:32,GovToken._update -FNDA:0,GovToken._update -DA:35,0 +FN:27,GovToken. +FNDA:41,GovToken. +DA:35,41 BRDA:35,0,0,- -DA:36,0 -DA:38,0 -FN:48,GovToken.burnByBurner -FNDA:0,GovToken.burnByBurner -DA:49,0 -FN:52,GovToken.mint -FNDA:0,GovToken.mint -DA:53,0 -FN:56,GovToken.clock +DA:37,41 +DA:38,41 +DA:39,41 +DA:40,41 +DA:41,41 +FN:49,GovToken._update +FNDA:74,GovToken._update +DA:52,74 +BRDA:52,1,0,4 +DA:53,4 +DA:55,70 +FN:65,GovToken.burnByBurner +FNDA:7,GovToken.burnByBurner +DA:66,5 +FN:69,GovToken.mint +FNDA:67,GovToken.mint +DA:70,65 +FN:79,GovToken.setBurnedAmountOfUtilToken +FNDA:13,GovToken.setBurnedAmountOfUtilToken +DA:83,11 +DA:84,11 +FN:87,GovToken.clock FNDA:0,GovToken.clock -DA:57,0 -FN:61,GovToken.CLOCK_MODE +DA:88,70 +FN:92,GovToken.CLOCK_MODE FNDA:0,GovToken.CLOCK_MODE -DA:62,0 -FN:65,GovToken.nonces +DA:93,0 +FN:96,GovToken.nonces FNDA:0,GovToken.nonces -DA:66,0 -FNF:7 -FNH:0 -LF:11 -LH:0 -BRF:1 -BRH:0 +DA:97,0 +FNF:8 +FNH:5 +LF:16 +LH:14 +BRF:2 +BRH:1 end_of_record TN: -SF:src/VotingPowerExchange.sol -FN:51,VotingPowerExchange. -FNDA:0,VotingPowerExchange. -DA:57,0 -DA:58,0 +SF:src/MyGovernor.sol +FN:26,MyGovernor. +FNDA:0,MyGovernor. +FN:36,MyGovernor.votingDelay +FNDA:0,MyGovernor.votingDelay +DA:37,0 +FN:40,MyGovernor.votingPeriod +FNDA:0,MyGovernor.votingPeriod +DA:41,0 +FN:44,MyGovernor.quorum +FNDA:0,MyGovernor.quorum +DA:50,0 +FN:53,MyGovernor.state +FNDA:0,MyGovernor.state DA:59,0 -DA:60,0 -FN:65,VotingPowerExchange.exchange -FNDA:0,VotingPowerExchange.exchange -DA:66,0 -BRDA:66,0,0,- -DA:67,0 -BRDA:67,1,0,- +FN:62,MyGovernor.proposalNeedsQueuing +FNDA:0,MyGovernor.proposalNeedsQueuing DA:68,0 -BRDA:68,2,0,- -DA:71,0 -DA:73,0 -BRDA:73,3,0,- -DA:76,0 -DA:78,0 -DA:80,0 +FN:71,MyGovernor.proposalThreshold +FNDA:0,MyGovernor.proposalThreshold +DA:72,0 +FN:75,MyGovernor._queueOperations +FNDA:0,MyGovernor._queueOperations DA:82,0 -DA:84,0 -DA:87,0 -DA:88,0 -FN:91,VotingPowerExchange.setHighestAmbassadorTokenId -FNDA:0,VotingPowerExchange.setHighestAmbassadorTokenId +FN:85,MyGovernor._executeOperations +FNDA:0,MyGovernor._executeOperations DA:92,0 -FN:100,VotingPowerExchange.getHighestERC1155TokenId -FNDA:0,VotingPowerExchange.getHighestERC1155TokenId -DA:103,0 -DA:104,0 +FN:95,MyGovernor._cancel +FNDA:0,MyGovernor._cancel +DA:101,0 +FN:104,MyGovernor._executor +FNDA:0,MyGovernor._executor DA:105,0 -BRDA:105,4,0,- -DA:106,0 -DA:109,0 -FN:114,VotingPowerExchange.authorizationState -FNDA:0,VotingPowerExchange.authorizationState -DA:115,0 -FN:124,VotingPowerExchange.sqrt -FNDA:0,VotingPowerExchange.sqrt -DA:125,0 -DA:126,0 -DA:127,0 -DA:128,0 -DA:129,0 -DA:130,0 -DA:132,0 -FN:135,VotingPowerExchange._setHighestAmbassadorTokenId -FNDA:0,VotingPowerExchange._setHighestAmbassadorTokenId -DA:136,0 -BRDA:136,6,0,- -DA:137,0 -DA:138,0 -FNF:7 +FNF:11 +FNH:0 +LF:10 +LH:0 +BRF:0 +BRH:0 +end_of_record +TN: +SF:src/Timelock.sol +FN:13,Timelock. +FNDA:0,Timelock. +FNF:1 FNH:0 -LF:33 +LF:0 LH:0 -BRF:6 +BRF:0 +BRH:0 +end_of_record +TN: +SF:src/VotingPowerExchange.sol +FN:66,VotingPowerExchange. +FNDA:40,VotingPowerExchange. +DA:69,40 +BRDA:69,0,0,1 +DA:70,39 +BRDA:70,1,0,- +DA:71,0 +DA:74,39 +DA:75,39 +DA:76,39 +DA:77,39 +DA:78,39 +DA:79,39 +FN:98,VotingPowerExchange.exchange +FNDA:11,VotingPowerExchange.exchange +DA:102,11 +BRDA:102,2,0,1 +DA:103,10 +BRDA:103,3,0,- +DA:104,10 +BRDA:104,4,0,- +DA:105,10 +BRDA:105,5,0,1 +DA:107,9 +DA:108,9 +BRDA:108,6,0,1 +DA:109,1 +DA:113,8 +DA:114,8 +BRDA:114,7,0,1 +DA:115,1 +DA:119,7 +DA:121,7 +DA:125,7 +DA:127,7 +DA:129,7 +BRDA:129,8,0,1 +DA:131,1 +DA:133,1 +DA:137,7 +DA:140,7 +DA:143,7 +DA:144,7 +FN:152,VotingPowerExchange.setVotingPowerCap +FNDA:4,VotingPowerExchange.setVotingPowerCap +DA:153,3 +BRDA:153,9,0,2 +DA:154,1 +FN:160,VotingPowerExchange.authorizationState +FNDA:8,VotingPowerExchange.authorizationState +DA:161,18 +FN:172,VotingPowerExchange._setVotingPowerCap +FNDA:40,VotingPowerExchange._setVotingPowerCap +DA:173,40 +DA:174,40 +FN:187,VotingPowerExchange.calculateIncrementedVotingPower +FNDA:26,VotingPowerExchange.calculateIncrementedVotingPower +DA:192,33 +DA:193,33 +FN:204,VotingPowerExchange.calculateVotingPowerFromBurnedAmount +FNDA:117,VotingPowerExchange.calculateVotingPowerFromBurnedAmount +DA:206,183 +DA:208,183 +DA:210,183 +DA:211,183 +FN:221,VotingPowerExchange.calculateIncrementedBurningAmount +FNDA:26,VotingPowerExchange.calculateIncrementedBurningAmount +DA:226,27 +DA:227,27 +FN:236,VotingPowerExchange.calculateBurningAmountFromVotingPower +FNDA:100,VotingPowerExchange.calculateBurningAmountFromVotingPower +DA:238,154 +DA:239,154 +DA:240,154 +FN:247,VotingPowerExchange.getVotingPowerCap +FNDA:4,VotingPowerExchange.getVotingPowerCap +DA:248,4 +FN:255,VotingPowerExchange.getConstants +FNDA:1,VotingPowerExchange.getConstants +DA:260,1 +DA:261,1 +DA:262,1 +DA:263,1 +FN:270,VotingPowerExchange.getTokenAddresses +FNDA:0,VotingPowerExchange.getTokenAddresses +DA:271,0 +DA:272,0 +FNF:12 +FNH:11 +LF:53 +LH:50 +BRF:10 +BRH:7 +end_of_record +TN: +SF:test/integration/utils/VotingPowerExchangeTestHelper.t.sol +FN:15,VotingPowerExchangeTestHelper.generateSignatureFromPrivateKey +FNDA:10,VotingPowerExchangeTestHelper.generateSignatureFromPrivateKey +DA:22,10 +DA:23,10 +DA:24,10 +DA:26,10 +DA:36,10 +DA:38,10 +DA:40,10 +FNF:1 +FNH:1 +LF:7 +LH:7 +BRF:0 BRH:0 end_of_record TN: SF:test/mocks/ERC20UpgradeableTokenV2.sol FN:14,ERC20UpgradeableTokenV2.initializeV2 -FNDA:0,ERC20UpgradeableTokenV2.initializeV2 -DA:15,0 -DA:16,0 -DA:19,0 +FNDA:1,ERC20UpgradeableTokenV2.initializeV2 +DA:15,1 +DA:16,1 +DA:19,1 FN:27,ERC20UpgradeableTokenV2.setTreasury FNDA:0,ERC20UpgradeableTokenV2.setTreasury DA:28,0 FN:35,ERC20UpgradeableTokenV2.getTreasury -FNDA:0,ERC20UpgradeableTokenV2.getTreasury -DA:36,0 +FNDA:1,ERC20UpgradeableTokenV2.getTreasury +DA:36,1 FNF:3 -FNH:0 +FNH:2 LF:5 -LH:0 +LH:4 BRF:0 BRH:0 end_of_record diff --git a/test/integration/VotingPowerExchange.t.sol b/test/integration/VotingPowerExchange.t.sol index 7af8125..c69b524 100644 --- a/test/integration/VotingPowerExchange.t.sol +++ b/test/integration/VotingPowerExchange.t.sol @@ -507,8 +507,10 @@ contract VotingPwoerExchangeTest is Test { votingPowerExchange.exchange(participant2, 2_200 * 1e18, nonce, expirationTime, signature); vm.stopPrank(); // check result for once - checkExchangeResult(participant2, 16 * 1e18, 85_240 * 1e18 - 2_200 * 1e18, 2_200 * 1e18, participant, 0, nonce, true); - + checkExchangeResult( + participant2, 16 * 1e18, 85_240 * 1e18 - 2_200 * 1e18, 2_200 * 1e18, participant, 0, nonce, true + ); + nonce = keccak256("1"); // when you exchange 73_040 utility token, you will get 98 voting power (bytes memory signature2,) = helper.generateSignatureFromPrivateKey( @@ -519,10 +521,52 @@ contract VotingPwoerExchangeTest is Test { emit VotingPowerExchange.VotingPowerReceived(participant2, 73_040 * 1e18, 83 * 1e18); votingPowerExchange.exchange(participant2, 73_040 * 1e18, nonce, expirationTime, signature2); vm.stopPrank(); - checkExchangeResult(participant2, 99 * 1e18, 85_240 * 1e18 - 75_240 * 1e18, 75_240 * 1e18, participant, 0, nonce, true); + checkExchangeResult( + participant2, 99 * 1e18, 85_240 * 1e18 - 75_240 * 1e18, 75_240 * 1e18, participant, 0, nonce, true + ); } ////// test failure cases ////// + /// failure cuz of reaching cap /// + // test description: this test means that when you exchange more than 75_240 utility token, you will only get 99 voting power token. + // At the same time, you can only burn 75_240 utility token which matches the 99 voting power token's burning amount to get the gov token itself. + function testExchangeTwiceToCrossVotingPowerCapFailureCase() public { + vm.prank(minter); + // user has already got 10_000 utility token + utilityToken.mint(participant2, 105_240 * 1e18); + bytes32 nonce = bytes32(0); + uint256 expirationTime = 3600; + (bytes memory signature,) = helper.generateSignatureFromPrivateKey( + dc.DEFAULT_ANVIL_KEY2(), 105_240 * 1e18, nonce, expirationTime, address(votingPowerExchange) + ); + vm.startPrank(exchanger); + // when you exchange more than 75_240 utility token, you will get 16 voting power + vm.expectEmit(); + emit VotingPowerExchange.VotingPowerReceived(participant2, 75_240 * 1e18, 99 * 1e18); + votingPowerExchange.exchange(participant2, 105_240 * 1e18, nonce, expirationTime, signature); + vm.stopPrank(); + // check result of this: + // Participant2 receives 99 governance tokens, has 115_240 * 1e18 - 75_240 * 1e18 utility tokens remaining, + // has burned 75_240 utility tokens, and uses a specific nonce, which is used, so the authorization state should be true + // Participant has burned 0 utility token + checkExchangeResult( + participant2, 99 * 1e18, 115_240 * 1e18 - 75_240 * 1e18, 75_240 * 1e18, participant, 0, nonce, true + ); + // under this circumstance, the user cannot call the exchange function anymore and it will revert and make sure the user do not cost his utility token when calling the exchange function + nonce = keccak256("1"); + vm.prank(exchanger); + vm.expectRevert( + abi.encodeWithSelector( + VotingPowerExchange.VotingPowerExchange__VotingPowerIsHigherThanCap.selector, 99 * 1e18 + ) + ); + votingPowerExchange.exchange(participant2, 1_100 * 1e18, nonce, expirationTime, signature); + // no state change this time, so the authorization state should be false. Others are the same as before. + checkExchangeResult( + participant2, 99 * 1e18, 115_240 * 1e18 - 75_240 * 1e18, 75_240 * 1e18, participant, 0, nonce, false + ); + } + function testExchangeFailsWhenSenderIsZeroAddress() public { bytes32 nonce = bytes32(0); uint256 expirationTime = 3600; @@ -535,6 +579,36 @@ contract VotingPwoerExchangeTest is Test { vm.stopPrank(); } + function testExchangeFailCaseWhenAmountIsTooSmall() public { + bytes32 nonce = bytes32(0); + uint256 expirationTime = 3600; + (bytes memory signature,) = helper.generateSignatureFromPrivateKey( + dc.DEFAULT_ANVIL_KEY2(), 9e14, nonce, expirationTime, address(votingPowerExchange) + ); + vm.startPrank(exchanger); + vm.expectRevert(VotingPowerExchange.VotingPowerExchange__AmountIsTooSmall.selector); + votingPowerExchange.exchange(participant2, 9e14, nonce, expirationTime, signature); + vm.stopPrank(); + } + + function testExchangeFailCaseWhenNonceIsUsed() public { + bytes32 nonce = bytes32(0); + uint256 expirationTime = 3600; + (bytes memory signature,) = helper.generateSignatureFromPrivateKey( + dc.DEFAULT_ANVIL_KEY2(), 1_100 * 1e18, nonce, expirationTime, address(votingPowerExchange) + ); + vm.startPrank(exchanger); + votingPowerExchange.exchange(participant2, 1_100 * 1e18, nonce, expirationTime, signature); + + // the nonce is used so it will revert if it is used again + (bytes memory signature2,) = helper.generateSignatureFromPrivateKey( + dc.DEFAULT_ANVIL_KEY2(), 100 * 1e18, nonce, expirationTime, address(votingPowerExchange) + ); + vm.expectRevert(VotingPowerExchange.VotingPowerExchange__InvalidNonce.selector); + votingPowerExchange.exchange(participant2, 100 * 1e18, nonce, expirationTime, signature2); + vm.stopPrank(); + } + function testExchangeFailCaseWhenSginatureExpired() public { bytes32 nonce = bytes32(0); uint256 expirationTime = 3600; @@ -565,6 +639,41 @@ contract VotingPwoerExchangeTest is Test { vm.stopPrank(); } + function testExchangeFailCaseWhenSignatureIsInvalid() public { + bytes32 nonce = bytes32(0); + uint256 expirationTime = 3600; + (bytes memory signature,) = helper.generateSignatureFromPrivateKey( + dc.DEFAULT_ANVIL_KEY2(), 1_10 * 1e18, nonce, expirationTime, address(votingPowerExchange) + ); + bytes32 digest = createDigest(participant2, 1_100 * 1e18, nonce, expirationTime); + vm.startPrank(exchanger); +vm.expectRevert(abi.encodeWithSelector(VotingPowerExchange.VotingPowerExchange__InvalidSignature.selector, digest, signature)); + votingPowerExchange.exchange(participant2, 1_100 * 1e18, nonce, expirationTime, signature); + vm.stopPrank(); + } + + function testExchangeFailCaseWhenUserGotMoreThanVotingPowerCap() public { + vm.prank(minter); + // user has already got 10_000 utility token + utilityToken.mint(participant2, 105_240 * 1e18); + vm.prank(minter); + govToken.mint(participant2, 101 * 1e18); + + bytes32 nonce = bytes32(0); + uint256 expirationTime = 3600; + (bytes memory signature,) = helper.generateSignatureFromPrivateKey( + dc.DEFAULT_ANVIL_KEY2(), 105_240 * 1e18, nonce, expirationTime, address(votingPowerExchange) + ); + vm.startPrank(exchanger); + vm.expectRevert( + abi.encodeWithSelector( + VotingPowerExchange.VotingPowerExchange__VotingPowerIsHigherThanCap.selector, 101 * 1e18 + ) + ); + votingPowerExchange.exchange(participant2, 105_240 * 1e18, nonce, expirationTime, signature); + vm.stopPrank(); + } + /** * @dev Creates a digest for EIP-712 * @param sender The address of the sender diff --git a/test/unit/VotingPowerExchange.t.sol b/test/unit/VotingPowerExchange.t.sol index cb0d748..9471d4c 100644 --- a/test/unit/VotingPowerExchange.t.sol +++ b/test/unit/VotingPowerExchange.t.sol @@ -14,6 +14,16 @@ contract VotingPowerExchangeUnitTest is Test { new VotingPowerExchange(address(this), address(this), address(this), address(this), address(this)); } + function testConstructorValidation() public { + // write a test to deploy the contract and test the validation in the constructor + vm.expectRevert(VotingPowerExchange.VotingPowerExchange__DefaultAdminCannotBeZero.selector); + new VotingPowerExchange(address(1),address(1), address(0), address(0), address(0)); + vm.expectRevert(VotingPowerExchange.VotingPowerExchange__GovOrUtilAddressIsZero.selector); + new VotingPowerExchange(address(1), address(0), address(1), address(0), address(0)); + vm.expectRevert(VotingPowerExchange.VotingPowerExchange__GovOrUtilAddressIsZero.selector); + new VotingPowerExchange(address(0), address(1), address(1), address(0), address(0)); + } + function testSpecialCasesForCalculateVotingPowerFromBurnedAmount() public view { // test case 1: 1950 * 1e18 -> 15 * 1e18 uint256 amount1 = 1950 * 1e18;