Skip to content

Commit

Permalink
consolidate utils imports
Browse files Browse the repository at this point in the history
  • Loading branch information
dmosites committed Oct 1, 2024
1 parent e2e9f76 commit ed3b1ac
Show file tree
Hide file tree
Showing 17 changed files with 33 additions and 28 deletions.
8 changes: 6 additions & 2 deletions scripts/owners-update.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
const Confirm = require('prompt-confirm')
const { ethers } = require('hardhat')
const { chainNames, ChainIds, ownerAddresses } = require('@airswap/utils')
const { getReceiptUrl } = require('@airswap/utils')
const {
chainNames,
ChainIds,
ownerAddresses,
getReceiptUrl,
} = require('@airswap/utils')

const CONFIRMATIONS = 2
const TRANSFER_STARTED =
Expand Down
2 changes: 1 addition & 1 deletion scripts/receivers-report.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const {
chainNames,
apiUrls,
protocolFeeReceiverAddresses,
ADDRESS_ZERO,
} = require('@airswap/utils')
const poolDeploys = require('@airswap/pool/deploys.js')
const { ADDRESS_ZERO } = require('@airswap/utils')

const contracts = [
['swap', 'Swap'],
Expand Down
3 changes: 1 addition & 2 deletions source/batch-call/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
const fs = require('fs')
const prettier = require('prettier')
const { ethers, run } = require('hardhat')
const { ChainIds, chainLabels } = require('@airswap/utils')
const { getReceiptUrl } = require('@airswap/utils')
const { ChainIds, chainLabels, getReceiptUrl } = require('@airswap/utils')
const batchCallDeploys = require('../deploys.js')
const batchCallBlocks = require('../deploys-blocks.js')
const batchCallCommits = require('../deploys-commits.js')
Expand Down
2 changes: 1 addition & 1 deletion source/batch-call/test/BatchCall.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ const {
createOrderSignature,
createOrderERC20,
createOrderERC20Signature,
TokenKinds,
} = require('@airswap/utils')
const { TokenKinds } = require('@airswap/utils')

const CHAIN_ID = 31337
const PROTOCOL_FEE = '30'
Expand Down
3 changes: 1 addition & 2 deletions source/delegate/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ const prettier = require('prettier')

const { ethers, run } = require('hardhat')
const swapERC20Deploys = require('@airswap/swap-erc20/deploys.js')
const { ChainIds, chainLabels } = require('@airswap/utils')
const { getReceiptUrl } = require('@airswap/utils')
const { ChainIds, chainLabels, getReceiptUrl } = require('@airswap/utils')
const delegateDeploys = require('../deploys.js')
const delegateBlocks = require('../deploys-blocks.js')
const delegateCommits = require('../deploys-commits.js')
Expand Down
3 changes: 1 addition & 2 deletions source/pool/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
const fs = require('fs')
const prettier = require('prettier')
const { ethers, run } = require('hardhat')
const { chainLabels, ChainIds } = require('@airswap/utils')
const { getReceiptUrl } = require('@airswap/utils')
const { chainLabels, ChainIds, getReceiptUrl } = require('@airswap/utils')
const poolDeploys = require('../deploys.js')
const poolBlocks = require('../deploys-blocks.js')
const poolCommits = require('../deploys-commits.js')
Expand Down
3 changes: 1 addition & 2 deletions source/pool/test/Pool.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
const { expect } = require('chai')
const { toAtomicString } = require('@airswap/utils')
const { toAtomicString, ADDRESS_ZERO } = require('@airswap/utils')
const { generateTreeFromData, getRoot, getProof } = require('@airswap/merkle')
const { soliditySha3 } = require('web3-utils')

const { ethers, waffle } = require('hardhat')
const { deployMockContract } = waffle
const IERC20 = require('@openzeppelin/contracts/build/contracts/IERC20.json')
const STAKING = require('@airswap/staking/build/contracts/Staking.sol/Staking.json')
const { ADDRESS_ZERO } = require('@airswap/utils')

function toWei(value, places) {
return toAtomicString(value, places || 18)
Expand Down
3 changes: 1 addition & 2 deletions source/registry/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
const fs = require('fs')
const prettier = require('prettier')
const { ethers, run } = require('hardhat')
const { ChainIds, chainLabels } = require('@airswap/utils')
const { getReceiptUrl } = require('@airswap/utils')
const { ChainIds, chainLabels, getReceiptUrl } = require('@airswap/utils')
const registryDeploys = require('../deploys.js')
const registryBlocks = require('../deploys-blocks.js')
const registryCommits = require('../deploys-commits.js')
Expand Down
3 changes: 1 addition & 2 deletions source/staking/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
const fs = require('fs')
const prettier = require('prettier')
const { ethers, run } = require('hardhat')
const { chainLabels, ChainIds } = require('@airswap/utils')
const { getReceiptUrl } = require('@airswap/utils')
const { chainLabels, ChainIds, getReceiptUrl } = require('@airswap/utils')
const stakingDeploys = require('../deploys.js')
const stakingBlocks = require('../deploys-blocks.js')
const stakingCommits = require('../deploys-commits.js')
Expand Down
2 changes: 1 addition & 1 deletion source/swap-erc20/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const {
ChainIds,
chainLabels,
protocolFeeReceiverAddresses,
getReceiptUrl,
} = require('@airswap/utils')
const { getReceiptUrl } = require('@airswap/utils')
const swapERC20Deploys = require('../deploys.js')
const swapERC20Blocks = require('../deploys-blocks.js')
const swapERC20Commits = require('../deploys-commits.js')
Expand Down
3 changes: 2 additions & 1 deletion source/swap-erc20/test/SwapERC20.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
const { expect } = require('chai')
const { ADDRESS_ZERO, SECONDS_IN_DAY } = require('@airswap/utils')
const {
createOrderERC20,
orderERC20ToParams,
createOrderERC20Signature,
ADDRESS_ZERO,
SECONDS_IN_DAY,
} = require('@airswap/utils')
const { ethers, waffle } = require('hardhat')
const { deployMockContract } = waffle
Expand Down
3 changes: 1 addition & 2 deletions source/swap/scripts/deploy-adapters.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
const fs = require('fs')
const prettier = require('prettier')
const { ethers, run } = require('hardhat')
const { chainLabels, ChainIds } = require('@airswap/utils')
const { getReceiptUrl } = require('@airswap/utils')
const { chainLabels, ChainIds, getReceiptUrl } = require('@airswap/utils')
const adapterDeploys = require('../deploys-adapters.js')
const adapterBlocks = require('../deploys-adapters-blocks.js')
const adapterCommits = require('../deploys-adapters-commits.js')
Expand Down
2 changes: 1 addition & 1 deletion source/swap/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const {
ChainIds,
protocolFeeReceiverAddresses,
ADDRESS_ZERO,
getReceiptUrl,
} = require('@airswap/utils')
const { getReceiptUrl } = require('@airswap/utils')
const poolDeploys = require('@airswap/pool/deploys.js')
const swapDeploys = require('../deploys.js')
const swapBlocks = require('../deploys-blocks.js')
Expand Down
8 changes: 6 additions & 2 deletions source/swap/test/Swap.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ const { deployMockContract } = waffle
const IERC20 = require('@openzeppelin/contracts/build/contracts/IERC20.json')
const IERC721 = require('@openzeppelin/contracts/build/contracts/ERC721Royalty.json')
const IERC1155 = require('@openzeppelin/contracts/build/contracts/IERC1155.json')
const { createOrder, createOrderSignature } = require('@airswap/utils')
const { TokenKinds, ADDRESS_ZERO } = require('@airswap/utils')
const {
createOrder,
createOrderSignature,
TokenKinds,
ADDRESS_ZERO,
} = require('@airswap/utils')

const CHAIN_ID = 31337
const PROTOCOL_FEE = '30'
Expand Down
8 changes: 6 additions & 2 deletions source/swap/test/SwapIntegration.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
const { expect } = require('chai')
const { ethers } = require('hardhat')
const { createOrder, createOrderSignature } = require('@airswap/utils')
const { TokenKinds, ADDRESS_ZERO } = require('@airswap/utils')
const {
createOrder,
createOrderSignature,
TokenKinds,
ADDRESS_ZERO,
} = require('@airswap/utils')
const ERC20PresetMinterPauser = require('@openzeppelin/contracts/build/contracts/ERC20PresetMinterPauser.json')
const ERC1155PresetMinterPauser = require('@openzeppelin/contracts/build/contracts/ERC1155PresetMinterPauser.json')

Expand Down
3 changes: 1 addition & 2 deletions source/wrapper/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
const fs = require('fs')
const prettier = require('prettier')
const { ethers, run } = require('hardhat')
const { chainLabels, ChainIds } = require('@airswap/utils')
const { chainLabels, ChainIds, getReceiptUrl } = require('@airswap/utils')
const swapDeploys = require('@airswap/swap-erc20/deploys.js')
const wrapperDeploys = require('../deploys.js')
const wrapperBlocks = require('../deploys-blocks.js')
const wrapperCommits = require('../deploys-commits.js')
const wethDeploys = require('../deploys-weth.js')
const { getReceiptUrl } = require('@airswap/utils')
const { confirmDeployment } = require('../../../scripts/deployer-info')

async function main() {
Expand Down
2 changes: 1 addition & 1 deletion source/wrapper/test/Wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ const {
createOrderERC20,
orderERC20ToParams,
createOrderERC20Signature,
ADDRESS_ZERO,
} = require('@airswap/utils')
const { ethers, waffle } = require('hardhat')
const { deployMockContract } = waffle
const { ADDRESS_ZERO } = require('@airswap/utils')

const IERC20 = require('@openzeppelin/contracts/build/contracts/IERC20.json')
const IWETH = require('../build/contracts/interfaces/IWETH.sol/IWETH.json')
Expand Down

0 comments on commit ed3b1ac

Please sign in to comment.