Skip to content

Commit

Permalink
✨ fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
cmontecoding committed Nov 26, 2024
1 parent 11da26e commit c66f163
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 13 deletions.
3 changes: 1 addition & 2 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.25;

import {OptimismParameters} from
"./utils/parameters/OptimismParameters.sol";
import {OptimismParameters} from "./utils/parameters/OptimismParameters.sol";
import {Script} from "lib/forge-std/src/Script.sol";
import {Conversion} from "src/Conversion.sol";

Expand Down
5 changes: 3 additions & 2 deletions script/utils/parameters/OptimismParameters.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pragma solidity 0.8.25;

contract OptimismParameters {
address constant OPTIMISM_KWENTA = 0x920Cf626a271321C151D027030D5d08aF699456b;
address constant OPTIMISM_KWENTA =
0x920Cf626a271321C151D027030D5d08aF699456b;
address constant OPTIMISM_SNX = 0x8700dAec35aF8Ff88c16BdF0418774CB3D7599B4;
}
}
6 changes: 4 additions & 2 deletions test/Conversion.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,8 @@ contract ConversionTest is Bootstrap {

// withdraw

uint256 contractSNXBeforeWithdraw = SNXMock.balanceOf(address(conversion));
uint256 contractSNXBeforeWithdraw =
SNXMock.balanceOf(address(conversion));
uint256 ownerSNXBeforeWithdraw = SNXMock.balanceOf(SYNTHETIX_TREASURY);
assertEq(
contractSNXBeforeWithdraw, MINT_AMOUNT - (CONVERTED_SNX_AMOUNT / 2)
Expand All @@ -397,7 +398,8 @@ contract ConversionTest is Bootstrap {
assertEq(contractSNXFinal, 0);
assertEq(claimedSNXFinal, CONVERTED_SNX_AMOUNT / 2);

uint256 contractSNXAfterWithdraw = SNXMock.balanceOf(address(conversion));
uint256 contractSNXAfterWithdraw =
SNXMock.balanceOf(address(conversion));
uint256 ownerSNXAfterWithdraw = SNXMock.balanceOf(SYNTHETIX_TREASURY);
assertEq(contractSNXAfterWithdraw, 0);
assertEq(ownerSNXAfterWithdraw, MINT_AMOUNT - CONVERTED_SNX_AMOUNT / 2);
Expand Down
5 changes: 4 additions & 1 deletion test/ConversionOptimism.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,10 @@ contract ConversionTestOptimism is Bootstrap {
uint256 contractSNXAfterWithdraw = SNX.balanceOf(address(conversion));
uint256 ownerSNXAfterWithdraw = SNX.balanceOf(SYNTHETIX_TREASURY);
assertEq(contractSNXAfterWithdraw, 0);
assertEq(ownerSNXAfterWithdraw, ownerSNXBeforeWithdraw + MINT_AMOUNT - CONVERTED_SNX_AMOUNT / 2);
assertEq(
ownerSNXAfterWithdraw,
ownerSNXBeforeWithdraw + MINT_AMOUNT - CONVERTED_SNX_AMOUNT / 2
);
}

function testVestEmit() public {
Expand Down
9 changes: 5 additions & 4 deletions test/utils/Bootstrap.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ import {
import {Test} from "lib/forge-std/src/Test.sol";
import {MockToken} from "test/utils/MockToken.sol";
import {Constants} from "./Constants.sol";
import {IERC20} from "lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";
import {IERC20} from
"lib/openzeppelin-contracts/contracts/token/ERC20/IERC20.sol";

contract Bootstrap is Test, Constants {
using console2 for *;
Expand Down Expand Up @@ -41,15 +42,15 @@ contract Bootstrap is Test, Constants {
function initializeOptimism() internal {
vm.rollFork(OPTIMISM_BLOCK_NUMBER);
bootstrapOptimism = new BootstrapOptimism();
(address conversionAddress, address kwenta, address snx) = bootstrapOptimism.init();
(address conversionAddress, address kwenta, address snx) =
bootstrapOptimism.init();

conversion = Conversion(conversionAddress);
KWENTA = IERC20(kwenta);
SNX = IERC20(snx);
vm.prank(SYNTHETIX_TREASURY);
SNX.transfer(conversionAddress, MINT_AMOUNT);
}

}

contract BootstrapLocal is Setup {
Expand All @@ -66,4 +67,4 @@ contract BootstrapOptimism is DeployOptimism {

return (conversionAddress, OPTIMISM_KWENTA, OPTIMISM_SNX);
}
}
}
5 changes: 3 additions & 2 deletions test/utils/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ pragma solidity 0.8.25;
contract Constants {
address internal constant SYNTHETIX_TREASURY =
0xa5f7a39E55D7878bC5bd754eE5d6BD7a7662355b; //todo: change to actual address
address internal constant KWENTA_TREASURY = 0x82d2242257115351899894eF384f779b5ba8c695;
address internal constant KWENTA_TREASURY =
0x82d2242257115351899894eF384f779b5ba8c695;
address internal constant TEST_USER_1 = address(0x2);
address internal constant TEST_USER_2 = address(0x3);
uint256 internal constant TEST_AMOUNT = 1000 * 10 ** 18;
Expand All @@ -16,5 +17,5 @@ contract Constants {
uint256 internal constant LINEAR_VESTING_DURATION = 270 days;
uint256 internal constant MINT_AMOUNT = 1_000_000 * 10 ** 18;
// BLOCK_NUMBER corresponds to Nov-26-2024 04:11:27 PM +UTC
uint256 internal constant OPTIMISM_BLOCK_NUMBER = 128519355;
uint256 internal constant OPTIMISM_BLOCK_NUMBER = 128_519_355;
}

0 comments on commit c66f163

Please sign in to comment.