Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
LikoIlya committed Dec 20, 2024
1 parent 62deb71 commit 3c6fbc0
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 41 deletions.
14 changes: 6 additions & 8 deletions script/DeployMintableTokens.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'forge-std/Script.sol';
import {ERC20PresetMinterPauser} from '@openzeppelin/contracts/token/ERC20/presets/ERC20PresetMinterPauser.sol';

contract DeployMintableTokens is Script {

uint256 public amount;

// set values for params and unsupported
Expand All @@ -17,21 +16,20 @@ contract DeployMintableTokens is Script {
function run() public {
vm.startBroadcast();

ERC20PresetMinterPauser test1 = new ERC20PresetMinterPauser("Test1", "TEST1");
ERC20PresetMinterPauser test1 = new ERC20PresetMinterPauser('Test1', 'TEST1');
console2.log('Test1 Deployed to: %s', address(test1));
ERC20PresetMinterPauser test2 = new ERC20PresetMinterPauser("Test2", "TEST2");
ERC20PresetMinterPauser test2 = new ERC20PresetMinterPauser('Test2', 'TEST2');
console2.log('Test2 Deployed to: %s', address(test2));
ERC20PresetMinterPauser test3 = new ERC20PresetMinterPauser("Test3", "TEST3");
ERC20PresetMinterPauser test3 = new ERC20PresetMinterPauser('Test3', 'TEST3');
console2.log('Test3 Deployed to: %s', address(test3));

test1.mint(msg.sender, amount);
console2.log('Test1 mintedAmount: %s', amount/10**18);
console2.log('Test1 mintedAmount: %s', amount / 10 ** 18);
test2.mint(msg.sender, amount);
console2.log('Test2 mintedAmount: %s', amount/10**18);
console2.log('Test2 mintedAmount: %s', amount / 10 ** 18);
test3.mint(msg.sender, amount);
console2.log('Test3 mintedAmount: %s', amount/10**18);
console2.log('Test3 mintedAmount: %s', amount / 10 ** 18);

vm.stopBroadcast();
}

}
13 changes: 3 additions & 10 deletions test/integration-tests/Astra.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,7 @@ import { parseEvents, CLASSIC_EVENTS, CL_EVENTS } from './shared/parseEvents'
import { expect } from './shared/expect'
import { encodePath } from './shared/swapRouter02Helpers'
import { BigNumber, BigNumberish, Contract } from 'ethers'
import {
ERC20,
ERC20__factory,
ISAMB,
ISAMB__factory,
Permit2,
UniversalRouter,
} from '../../typechain'
import { ERC20, ERC20__factory, ISAMB, ISAMB__factory, Permit2, UniversalRouter } from '../../typechain'
import { BOND, KOS, resetFork, SAMB, USDC } from './shared/testnetForkHelpers'
import {
ADDRESS_THIS,
Expand Down Expand Up @@ -365,7 +358,7 @@ describe('Astra Classic and CL Tests:', () => {

const { gasSpent, ambBalanceBefore, ambBalanceAfter, classicSwapEventArgs } = await executeRouter(planner)
const { amount0Out: sambTraded } = classicSwapEventArgs!

expect(ambBalanceAfter.sub(ambBalanceBefore)).to.eq(sambTraded.sub(gasSpent))
})

Expand Down Expand Up @@ -1297,7 +1290,7 @@ describe('Astra Classic and CL Tests:', () => {
const sambBalanceBefore: BigNumber = await sambContract.balanceOf(bob.address)
const usdcBalanceBefore: BigNumber = await usdcContract.balanceOf(bob.address)
const bondBalanceBefore: BigNumber = await bondContract.balanceOf(bob.address)

const { commands, inputs } = planner
const tx = await router['execute(bytes,bytes[],uint256)'](commands, inputs, DEADLINE, { value })
const receipt = await tx.wait()
Expand Down
2 changes: 1 addition & 1 deletion test/integration-tests/UniversalRouter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('UniversalRouter', () => {
// mock rewards contracts
const tokenFactory = await ethers.getContractFactory('MintableERC20')
const mockDistributorFactory = await ethers.getContractFactory('MockLooksRareRewardsDistributor')
mockLooksRareToken = (await tokenFactory.connect(alice).deploy("LooksRare", "LR", expandTo18DecimalsBN(5))) as ERC20
mockLooksRareToken = (await tokenFactory.connect(alice).deploy('LooksRare', 'LR', expandTo18DecimalsBN(5))) as ERC20
mockLooksRareRewardsDistributor = (await mockDistributorFactory.deploy(
ROUTER_REWARDS_DISTRIBUTOR,
mockLooksRareToken.address
Expand Down
9 changes: 1 addition & 8 deletions test/integration-tests/gas-tests/Astra.gas.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@ import {
pool_SAMB_KOS,
} from '../shared/swapRouter02Helpers'
import { BigNumber, BigNumberish } from 'ethers'
import {
UniversalRouter,
Permit2,
ISAMB,
ERC20,
ISAMB__factory,
ERC20__factory,
} from '../../../typechain'
import { UniversalRouter, Permit2, ISAMB, ERC20, ISAMB__factory, ERC20__factory } from '../../../typechain'
import { approveAndExecuteSwapRouter02, resetFork, SAMB, BOND, USDC, KOS } from '../shared/testnetForkHelpers'
import {
ADDRESS_THIS,
Expand Down
4 changes: 2 additions & 2 deletions test/integration-tests/gas-tests/Payments.gas.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ describe('Payments Gas Tests', () => {
await MintableERC20__factory.connect(BOND.address, alice).transfer(bob.address, expandTo18DecimalsBN(100000000))
).wait()
await (await ISAMB__factory.connect(SAMB.address, alice).deposit({ value: expandTo18DecimalsBN(1000) })).wait()
await(await ISAMB__factory.connect(SAMB.address, bob).deposit({ value: expandTo18DecimalsBN(1000) })).wait()
await (await ISAMB__factory.connect(SAMB.address, bob).deposit({ value: expandTo18DecimalsBN(1000) })).wait()

bondContract = ERC20__factory.connect(BOND.address, bob)
sambContract = ISAMB__factory.connect(SAMB.address, bob)

Expand Down
15 changes: 6 additions & 9 deletions test/integration-tests/gas-tests/UniversalRouter.gas.test.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import { UniversalRouter, Permit2, ISAMB, ERC20, MintableERC20__factory, ISAMB__factory } from '../../../typechain'
import { expect } from '../shared/expect'
import {
ALICE_ADDRESS,
ADDRESS_THIS,
DEADLINE,
MAX_UINT,
MAX_UINT160,
SOURCE_MSG_SENDER,
} from '../shared/constants'
import { ALICE_ADDRESS, ADDRESS_THIS, DEADLINE, MAX_UINT, MAX_UINT160, SOURCE_MSG_SENDER } from '../shared/constants'
import { abi as TOKEN_ABI } from '../../../artifacts/solmate/src/tokens/ERC20.sol/ERC20.json'
import { abi as SAMB_ABI } from '../../../artifacts/contracts/interfaces/external/ISAMB.sol/ISAMB.json'
import snapshotGasCost from '@uniswap/snapshot-gas-cost'
Expand All @@ -31,7 +24,11 @@ describe('UniversalRouter Gas Tests', () => {
let sambContract: ISAMB

async function deployMintableToken(name: string, symbol: string, signer: SignerWithAddress): Promise<Token> {
const token = await new MintableERC20__factory(signer).deploy(name, symbol, BigNumber.from(10).pow(18).mul('1000000000000000000'))
const token = await new MintableERC20__factory(signer).deploy(
name,
symbol,
BigNumber.from(10).pow(18).mul('1000000000000000000')
)
return new Token(22040, token.address, 18, name, symbol)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe('Astra UX Tests gas:', () => {
let MAX_PERMIT: PermitSingle
let SIMPLE_SWAP_PERMIT: PermitSingle
let COMPLEX_SWAP_PERMIT: PermitSingle

beforeEach(async () => {
await resetFork()
await hre.network.provider.request({
Expand Down
2 changes: 1 addition & 1 deletion test/integration-tests/shared/deployUniversalRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
CLASSIC_INIT_CODE_HASH_TESTNET,
CL_INIT_CODE_HASH_TESTNET,
ROUTER_REWARDS_DISTRIBUTOR,
UNSUPPORTED_PROTOCOL
UNSUPPORTED_PROTOCOL,
} from './constants'

export async function deployRouter(
Expand Down
2 changes: 1 addition & 1 deletion test/integration-tests/shared/testnetForkHelpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,4 @@ export const resetFork = async (block: number = 2811484) => {
},
],
})
}
}

0 comments on commit 3c6fbc0

Please sign in to comment.