Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.1 mainnet for pool, registry, swap-erc20, wrapper #1202

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion source/balances/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@openzeppelin/contracts": "^4.8.3"
},
"devDependencies": {
"@airswap/constants": "^4.0.10",
"@airswap/constants": "^4.1.0",
"@airswap/utils": "^4.0.8",
"prompt-confirm": "^2.0.4"
},
Expand Down
4 changes: 2 additions & 2 deletions source/balances/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const fs = require('fs')
const Confirm = require('prompt-confirm')
const { ethers, run } = require('hardhat')
const { ChainIds, chainNames } = require('@airswap/constants')
const { ChainIds, chainNames, chainLabels } = require('@airswap/constants')
const { getReceiptUrl } = require('@airswap/utils')
const balancesDeploys = require('../deploys.js')

Expand Down Expand Up @@ -40,7 +40,7 @@ async function main() {
console.log('Updated deploys.js')

console.log(
`\nVerify with "yarn verify --network ${chainNames[
`\nVerify with "yarn verify --network ${chainLabels[
chainId
].toLowerCase()}"\n`
)
Expand Down
1 change: 1 addition & 0 deletions source/pool/deploys-blocks.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
1: 18262813,
5: 9774330,
}
1 change: 1 addition & 0 deletions source/pool/deploys.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
1: '0xEEcD248D977Fd4D392915b4AdeF8154BA3aE9c02',
5: '0xa55CDCe4F6300D57831b2792c45E55a899D8e2a4',
}
6 changes: 3 additions & 3 deletions source/pool/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@airswap/pool",
"version": "4.1.0-beta.0",
"version": "4.1.0",
"description": "AirSwap: Withdrawable Token Pool",
"license": "MIT",
"repository": {
Expand Down Expand Up @@ -28,8 +28,8 @@
"@openzeppelin/contracts": "^4.8.3"
},
"devDependencies": {
"@airswap/constants": "^4.0.10",
"@airswap/types": "^4.0.0",
"@airswap/constants": "^4.1.0",
"@airswap/types": "^4.1.0",
"@airswap/utils": "^4.0.8",
"prompt-confirm": "^2.0.4"
},
Expand Down
4 changes: 2 additions & 2 deletions source/pool/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const fs = require('fs')
const prettier = require('prettier')
const Confirm = require('prompt-confirm')
const { ethers, run } = require('hardhat')
const { chainNames, ChainIds } = require('@airswap/constants')
const { chainLabels, chainNames, ChainIds } = require('@airswap/constants')
const { getReceiptUrl } = require('@airswap/utils')
const poolDeploys = require('../deploys.js')
const poolBlocks = require('../deploys-blocks.js')
Expand Down Expand Up @@ -57,7 +57,7 @@ async function main() {
console.log(`Deployed: ${poolDeploys[chainId]} @ ${poolBlocks[chainId]}`)

console.log(
`\nVerify with "yarn verify --network ${chainNames[
`\nVerify with "yarn verify --network ${chainLabels[
chainId
].toLowerCase()}"\n`
)
Expand Down
1 change: 1 addition & 0 deletions source/registry/deploys-blocks.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
1: 18262901,
5: 9774339,
}
1 change: 1 addition & 0 deletions source/registry/deploys.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
1: '0x339Eb75235CBf823C6352D529A258226ecF59cfF',
5: '0x33Cded9D1C082AA57439FB7a6784913321e17316',
}
4 changes: 2 additions & 2 deletions source/registry/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@airswap/registry",
"version": "4.1.0-beta.0",
"version": "4.1.0",
"description": "AirSwap: Server URL Registry",
"license": "MIT",
"repository": {
Expand Down Expand Up @@ -31,7 +31,7 @@
"access": "public"
},
"devDependencies": {
"@airswap/constants": "^4.0.10",
"@airswap/constants": "^4.1.0",
"@airswap/utils": "^4.0.8",
"prompt-confirm": "^2.0.4"
}
Expand Down
15 changes: 10 additions & 5 deletions source/registry/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ const fs = require('fs')
const prettier = require('prettier')
const Confirm = require('prompt-confirm')
const { ethers, run } = require('hardhat')
const { ChainIds, chainNames, ADDRESS_ZERO } = require('@airswap/constants')
const {
ChainIds,
chainLabels,
chainNames,
stakingTokenAddresses,
} = require('@airswap/constants')
const { getReceiptUrl } = require('@airswap/utils')
const registryDeploys = require('../deploys.js')
const registryBlocks = require('../deploys-blocks.js')
Expand All @@ -23,9 +28,9 @@ async function main() {
console.log(`Network: ${chainNames[chainId].toUpperCase()}`)
console.log(`Gas price: ${gasPrice / 10 ** 9} gwei\n`)

const stakingToken = ADDRESS_ZERO // stakingTokenAddresses[chainId]
const stakingCost = 0 // 1000000000
const supportCost = 0 // 1000000
const stakingToken = stakingTokenAddresses[chainId]
const stakingCost = 1000000000
const supportCost = 1000000

console.log(`\nstakingToken: ${stakingToken}`)
console.log(`stakingCost: ${stakingCost}`)
Expand Down Expand Up @@ -68,7 +73,7 @@ async function main() {
)

console.log(
`\nVerify with "yarn verify --network ${chainNames[
`\nVerify with "yarn verify --network ${chainLabels[
chainId
].toLowerCase()}"\n`
)
Expand Down
8 changes: 4 additions & 4 deletions source/registry/scripts/verify.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
/* eslint-disable no-console */
const { ethers, run } = require('hardhat')
const registryDeploys = require('../deploys.js')
const { chainNames, ADDRESS_ZERO } = require('@airswap/constants')
const { chainNames, stakingTokenAddresses } = require('@airswap/constants')

async function main() {
await run('compile')
const [deployer] = await ethers.getSigners()
console.log(`Deployer: ${deployer.address}`)

const chainId = await deployer.getChainId()
const stakingToken = ADDRESS_ZERO // stakingTokenAddresses[chainId]
const stakingCost = 0 // 1000000000
const supportCost = 0 // 1000000
const stakingToken = stakingTokenAddresses[chainId]
const stakingCost = 1000000000
const supportCost = 1000000

console.log(`Verifying on ${chainNames[chainId].toUpperCase()}`)
await run('verify:verify', {
Expand Down
8 changes: 6 additions & 2 deletions source/staking/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
const fs = require('fs')
const Confirm = require('prompt-confirm')
const { ethers, run } = require('hardhat')
const { chainNames, stakingTokenAddresses } = require('@airswap/constants')
const {
chainNames,
chainLabels,
stakingTokenAddresses,
} = require('@airswap/constants')
const { getReceiptUrl } = require('@airswap/utils')
const stakingDeploys = require('../deploys.js')

Expand Down Expand Up @@ -56,7 +60,7 @@ async function main() {
console.log('Updated deploys.js')

console.log(
`\nVerify with "yarn verify --network ${chainNames[
`\nVerify with "yarn verify --network ${chainLabels[
chainId
].toLowerCase()}"\n`
)
Expand Down
1 change: 1 addition & 0 deletions source/swap-erc20/deploys-blocks.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
1: 18262981,
5: 9775062,
}
1 change: 1 addition & 0 deletions source/swap-erc20/deploys.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
1: '0x0A655E762238Fee539338F433087A3B9dAdD798b',
5: '0x1E6EBD18B5Ee1C31DcB3fc6AD23f32a35a8FF8e4',
}
6 changes: 3 additions & 3 deletions source/swap-erc20/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@airswap/swap-erc20",
"version": "4.1.0-beta.1",
"version": "4.1.0",
"description": "AirSwap: Atomic ERC20 Token Swap",
"license": "MIT",
"repository": {
Expand Down Expand Up @@ -28,9 +28,9 @@
"@openzeppelin/contracts": "^4.8.3"
},
"devDependencies": {
"@airswap/constants": "^4.0.10",
"@airswap/constants": "^4.1.0",
"@airswap/staking": "4.0.3",
"@airswap/types": "^4.0.0",
"@airswap/types": "^4.1.0",
"@airswap/utils": "^4.0.8",
"prompt-confirm": "^2.0.4"
},
Expand Down
21 changes: 15 additions & 6 deletions source/swap-erc20/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ const Confirm = require('prompt-confirm')
const { ethers, run } = require('hardhat')
const poolDeploys = require('@airswap/pool/deploys.js')
const stakingDeploys = require('@airswap/staking/deploys.js')
const { ChainIds, chainNames } = require('@airswap/constants')
const {
ChainIds,
chainLabels,
chainNames,
protocolFeeReceiverAddresses,
} = require('@airswap/constants')
const { getReceiptUrl } = require('@airswap/utils')
const swapERC20Deploys = require('../deploys.js')
const swapERC20Blocks = require('../deploys-blocks.js')

async function main() {
await run('compile')
const config = await prettier.resolveConfig('../deploys.js')

const [deployer] = await ethers.getSigners()
const gasPrice = await deployer.getGasPrice()
const chainId = await deployer.getChainId()
Expand All @@ -23,24 +30,26 @@ async function main() {
console.log(`Network: ${chainNames[chainId].toUpperCase()}`)
console.log(`Gas price: ${gasPrice / 10 ** 9} gwei\n`)

const protocolFeeWallet = poolDeploys[chainId]
let protocolFeeReceiver = poolDeploys[chainId]
if (protocolFeeReceiverAddresses[chainId]) {
protocolFeeReceiver = protocolFeeReceiverAddresses[chainId]
}
const stakingContract = stakingDeploys[chainId]
const protocolFee = 7
const protocolFeeLight = 7
const discountScale = 10
const discountMax = 100

console.log(`Fee recipient: ${protocolFeeWallet}`)
console.log(`Fee receiver: ${protocolFeeReceiver}`)
console.log(`Staking contract: ${stakingContract}`)
console.log(`Gas price: ${gasPrice / 10 ** 9} gwei`)

const prompt = new Confirm('Proceed to deploy?')
if (await prompt.run()) {
const swapFactory = await ethers.getContractFactory('SwapERC20')
const swapContract = await swapFactory.deploy(
protocolFee,
protocolFeeLight,
protocolFeeWallet,
protocolFeeReceiver,
discountScale,
discountMax,
stakingContract
Expand Down Expand Up @@ -74,7 +83,7 @@ async function main() {
)

console.log(
`\nVerify with "yarn verify --network ${chainNames[
`\nVerify with "yarn verify --network ${chainLabels[
chainId
].toLowerCase()}"\n`
)
Expand Down
13 changes: 10 additions & 3 deletions source/swap-erc20/scripts/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
const { ethers, run } = require('hardhat')
const stakingDeploys = require('@airswap/staking/deploys.js')
const poolDeploys = require('@airswap/pool/deploys.js')
const { chainNames } = require('@airswap/constants')
const {
chainNames,
protocolFeeReceiverAddresses,
} = require('@airswap/constants')
const swapERC20Deploys = require('../deploys.js')

async function main() {
Expand All @@ -11,7 +14,11 @@ async function main() {
console.log(`Deployer: ${deployer.address}`)

const chainId = await deployer.getChainId()
const protocolFeeWallet = poolDeploys[chainId]

let protocolFeeReceiver = poolDeploys[chainId]
if (protocolFeeReceiverAddresses[chainId]) {
protocolFeeReceiver = protocolFeeReceiverAddresses[chainId]
}
const stakingContract = stakingDeploys[chainId]
const protocolFee = 7
const protocolFeeLight = 7
Expand All @@ -24,7 +31,7 @@ async function main() {
constructorArguments: [
protocolFee,
protocolFeeLight,
protocolFeeWallet,
protocolFeeReceiver,
discountScale,
discountMax,
stakingContract,
Expand Down
4 changes: 2 additions & 2 deletions source/swap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"@openzeppelin/contracts": "^4.8.3"
},
"devDependencies": {
"@airswap/constants": "^4.0.10",
"@airswap/types": "^4.0.0",
"@airswap/constants": "^4.1.0",
"@airswap/types": "^4.1.0",
"@airswap/utils": "^4.0.8",
"@nomicfoundation/hardhat-network-helpers": "^1.0.7"
},
Expand Down
4 changes: 2 additions & 2 deletions source/swap/scripts/deploy-adapters.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const fs = require('fs')
const Confirm = require('prompt-confirm')
const { ethers, run } = require('hardhat')
const { chainNames, ChainIds } = require('@airswap/constants')
const { chainNames, chainLabels, ChainIds } = require('@airswap/constants')
const { getReceiptUrl } = require('@airswap/utils')
const adapterDeploys = require('../deploys-adapters.js')

Expand Down Expand Up @@ -44,7 +44,7 @@ async function main() {
console.log('Updated deploys-adapters.js')

console.log(
`\nVerify with "yarn verify-adapters --network ${chainNames[
`\nVerify with "yarn verify-adapters --network ${chainLabels[
chainId
].toLowerCase()}"\n`
)
Expand Down
9 changes: 7 additions & 2 deletions source/swap/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ const fs = require('fs')
const Confirm = require('prompt-confirm')
const { ethers, run } = require('hardhat')
const poolDeploys = require('@airswap/pool/deploys.js')
const { chainNames, ChainIds, TokenKinds } = require('@airswap/constants')
const {
chainNames,
chainLabels,
ChainIds,
TokenKinds,
} = require('@airswap/constants')
const { getReceiptUrl } = require('@airswap/utils')
const swapDeploys = require('../deploys.js')
const adapterDeploys = require('../deploys-adapters.js')
Expand Down Expand Up @@ -54,7 +59,7 @@ async function main() {
console.log('Updated deploys.js')

console.log(
`\nVerify with "yarn verify --network ${chainNames[
`\nVerify with "yarn verify --network ${chainLabels[
chainId
].toLowerCase()}"\n`
)
Expand Down
2 changes: 1 addition & 1 deletion source/wrapper/deploys-blocks.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
1: 16776818,
1: 18263024,
5: 8613803,
30: 5113775,
31: 3642943,
Expand Down
2 changes: 1 addition & 1 deletion source/wrapper/deploys.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
1: '0x99568Ce6c9901097150403B7629CF426B859BC22',
1: '0x600ECFFE21cE7D047F3462c2A30E1cA3599dF1A5',
5: '0x99568Ce6c9901097150403B7629CF426B859BC22',
30: '0x66bb3d0909FCAEB4316D57981e7BBBB31F502858',
31: '0x99568Ce6c9901097150403B7629CF426B859BC22',
Expand Down
6 changes: 3 additions & 3 deletions source/wrapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@
"verify": "hardhat run ./scripts/verify.js"
},
"dependencies": {
"@airswap/swap-erc20": "4.1.0-beta.1",
"@airswap/swap-erc20": "4.1.0",
"@openzeppelin/contracts": "^4.8.3"
},
"devDependencies": {
"@airswap/constants": "^4.0.10",
"@airswap/constants": "^4.1.0",
"@airswap/utils": "^4.0.8",
"@airswap/types": "^4.0.0",
"@airswap/types": "^4.1.0",
"@uniswap/v2-periphery": "^1.1.0-beta.0",
"prompt-confirm": "^2.0.4"
},
Expand Down
Loading
Loading