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

Testnet deploy #1250

Merged
merged 8 commits into from
Jan 11, 2024
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
5 changes: 4 additions & 1 deletion source/batch-call/deploys-blocks.js
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
module.exports = {}
module.exports = {
5: 10351183,
11155111: 5059276,
}
5 changes: 4 additions & 1 deletion source/batch-call/deploys.js
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
module.exports = {}
module.exports = {
5: '0x1104d8e1f4499acbabbcd55c9a6c957e1f881318',
11155111: '0x1104D8E1F4499ACbaBBcD55c9A6C957E1F881318',
}
8 changes: 4 additions & 4 deletions source/batch-call/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@airswap/batch-call",
"version": "4.1.0",
"version": "4.1.0-beta.0",
"description": "Batch balance, allowance, order validity checks",
"license": "MIT",
"repository": {
Expand All @@ -27,11 +27,11 @@
},
"dependencies": {
"@openzeppelin/contracts": "^4.8.3",
"@airswap/swap": "4.1.2",
"@airswap/swap-erc20": "4.1.6"
"@airswap/swap": "4.1.3-beta.0",
"@airswap/swap-erc20": "4.1.7-beta.0"
},
"devDependencies": {
"@airswap/constants": "4.1.8",
"@airswap/constants": "4.1.9-beta.0",
"@airswap/utils": "4.1.12",
"prompt-confirm": "^2.0.4"
},
Expand Down
23 changes: 20 additions & 3 deletions source/batch-call/scripts/deploy.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
/* eslint-disable no-console */
const fs = require('fs')
const prettier = require('prettier')
const Confirm = require('prompt-confirm')
const { ethers, run } = require('hardhat')
const { ChainIds, chainNames, chainLabels } = require('@airswap/constants')
const { getReceiptUrl } = require('@airswap/utils')
const batchCallDeploys = require('../deploys.js')
const batchCallBlocks = require('../deploys-blocks.js')

async function main() {
await run('compile')
Expand All @@ -21,21 +23,36 @@ async function main() {

const prompt = new Confirm('Proceed to deploy?')
if (await prompt.run()) {
const prettierConfig = await prettier.resolveConfig('../deploys.js')
const batchFactory = await ethers.getContractFactory('BatchCall')
const batchCallContract = await batchFactory.deploy()
console.log(
'Deploying...',
getReceiptUrl(chainId, batchCallContract.deployTransaction.hash)
)
await batchCallContract.deployed()
console.log(`Deployed: ${batchCallContract.address}`)

batchCallDeploys[chainId] = batchCallContract.address
fs.writeFileSync(
'./deploys.js',
`module.exports = ${JSON.stringify(batchCallDeploys, null, '\t')}`
prettier.format(
`module.exports = ${JSON.stringify(batchCallDeploys, null, '\t')}`,
{ ...prettierConfig, parser: 'babel' }
)
)
batchCallBlocks[chainId] = (
await batchCallContract.deployTransaction.wait()
).blockNumber
fs.writeFileSync(
'./deploys-blocks.js',
prettier.format(
`module.exports = ${JSON.stringify(batchCallBlocks, null, '\t')}`,
{ ...prettierConfig, parser: 'babel' }
)
)
console.log(
`Deployed: ${batchCallDeploys[chainId]} @ ${batchCallBlocks[chainId]}`
)
console.log('Updated deploys.js')

console.log(
`\nVerify with "yarn verify --network ${chainLabels[
Expand Down
2 changes: 1 addition & 1 deletion source/pool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@openzeppelin/contracts": "^4.8.3"
},
"devDependencies": {
"@airswap/constants": "4.1.8",
"@airswap/constants": "4.1.9-beta.0",
"@airswap/metadata": "4.1.15",
"@airswap/types": "4.1.3",
"@airswap/utils": "4.1.12",
Expand Down
6 changes: 3 additions & 3 deletions source/pool/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const poolBlocks = require('../deploys-blocks.js')

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

const [deployer] = await ethers.getSigners()
const gasPrice = await deployer.getGasPrice()
Expand Down Expand Up @@ -43,7 +43,7 @@ async function main() {
'./deploys.js',
prettier.format(
`module.exports = ${JSON.stringify(poolDeploys, null, '\t')}`,
{ ...config, parser: 'babel' }
{ ...prettierConfig, parser: 'babel' }
)
)
poolBlocks[chainId] = (
Expand All @@ -53,7 +53,7 @@ async function main() {
'./deploys-blocks.js',
prettier.format(
`module.exports = ${JSON.stringify(poolBlocks, null, '\t')}`,
{ ...config, parser: 'babel' }
{ ...prettierConfig, parser: 'babel' }
)
)
console.log(`Deployed: ${poolDeploys[chainId]} @ ${poolBlocks[chainId]}`)
Expand Down
2 changes: 1 addition & 1 deletion source/registry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"access": "public"
},
"devDependencies": {
"@airswap/constants": "4.1.8",
"@airswap/constants": "4.1.9-beta.0",
"@airswap/utils": "4.1.12",
"prompt-confirm": "^2.0.4"
}
Expand Down
6 changes: 3 additions & 3 deletions source/registry/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const registryBlocks = require('../deploys-blocks.js')

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

const [deployer] = await ethers.getSigners()
const gasPrice = await deployer.getGasPrice()
Expand Down Expand Up @@ -59,7 +59,7 @@ async function main() {
'./deploys.js',
prettier.format(
`module.exports = ${JSON.stringify(registryDeploys, null, '\t')}`,
{ ...config, parser: 'babel' }
{ ...prettierConfig, parser: 'babel' }
)
)
registryBlocks[chainId] = (
Expand All @@ -69,7 +69,7 @@ async function main() {
'./deploys-blocks.js',
prettier.format(
`module.exports = ${JSON.stringify(registryBlocks, null, '\t')}`,
{ ...config, parser: 'babel' }
{ ...prettierConfig, parser: 'babel' }
)
)
console.log(
Expand Down
2 changes: 1 addition & 1 deletion source/staking/contracts/Staking.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;
pragma solidity 0.8.23;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
Expand Down
2 changes: 1 addition & 1 deletion source/staking/contracts/interfaces/IStaking.sol
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.17;
pragma solidity 0.8.23;

interface IStaking {
struct Stake {
Expand Down
5 changes: 2 additions & 3 deletions source/staking/deploys-blocks.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module.exports = {
1: 17215773,
5: 9884607,
11155111: 4509512,
5: 10351547,
11155111: 5059353,
}
5 changes: 2 additions & 3 deletions source/staking/deploys.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module.exports = {
1: '0x9fc450F9AfE2833Eb44f9A1369Ab3678D3929860',
5: '0x3BeC6526366cb2C2A609eb2bCeC8A696C141a33e',
11155111: '0x3BeC6526366cb2C2A609eb2bCeC8A696C141a33e',
5: '0x147644781C1ccb078738ecced7B247AF0bD5Aa8b',
11155111: '0x147644781C1ccb078738ecced7B247AF0bD5Aa8b',
}
2 changes: 1 addition & 1 deletion source/staking/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@airswap/staking",
"version": "4.0.5",
"version": "4.1.0-beta.0",
"description": "AirSwap: Stake Tokens",
"license": "MIT",
"repository": {
Expand Down
24 changes: 24 additions & 0 deletions source/staking/scripts/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const { ChainIds, stakingTokenAddresses } = require('@airswap/constants')
module.exports = {
[ChainIds.MAINNET]: {
name: 'Staked AST',
symbol: 'sAST',
stakingToken: stakingTokenAddresses[ChainIds.MAINNET],
stakingDuration: 60 * 60 * 24 * 7 * 20, // 20 WEEKS
minDurationChangeDelay: 60 * 60 * 24 * 7, // 1 WEEK
},
[ChainIds.GOERLI]: {
name: 'Staked AST (Goerli)',
symbol: 'sAST (Goerli)',
stakingToken: stakingTokenAddresses[ChainIds.GOERLI],
stakingDuration: 60 * 60, // 1 HOUR
minDurationChangeDelay: 60, // 1 MINUTE
},
[ChainIds.SEPOLIA]: {
name: 'Staked AST (Sepolia)',
symbol: 'sAST (Sepolia)',
stakingToken: stakingTokenAddresses[ChainIds.SEPOLIA],
stakingDuration: 60 * 60, // 1 HOUR
minDurationChangeDelay: 60, // 1 MINUTE
},
}
27 changes: 12 additions & 15 deletions source/staking/scripts/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,15 @@ const fs = require('fs')
const prettier = require('prettier')
const Confirm = require('prompt-confirm')
const { ethers, run } = require('hardhat')
const {
chainNames,
chainLabels,
stakingTokenAddresses,
ChainIds,
} = require('@airswap/constants')
const { chainNames, chainLabels, ChainIds } = require('@airswap/constants')
const { getReceiptUrl } = require('@airswap/utils')
const stakingDeploys = require('../deploys.js')
const stakingBlocks = require('../deploys-blocks.js')
const config = require('./config.js')

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

const prettierConfig = await prettier.resolveConfig('../deploys.js')
const [deployer] = await ethers.getSigners()
const gasPrice = await deployer.getGasPrice()
const chainId = await deployer.getChainId()
Expand All @@ -28,11 +23,13 @@ async function main() {
console.log(`Network: ${chainNames[chainId].toUpperCase()}`)
console.log(`Gas price: ${gasPrice / 10 ** 9} gwei\n`)

const name = 'Staked AST'
const symbol = 'sAST'
const stakingToken = stakingTokenAddresses[chainId]
const stakingDuration = 60 * 60 * 24 * 7 * 20 // Twenty Weeks
const minDurationChangeDelay = 60 * 60 * 24 * 7 // One Week
const {
name,
symbol,
stakingToken,
stakingDuration,
minDurationChangeDelay,
} = config[chainId]

console.log(`\nname: ${name}`)
console.log(`symbol: ${symbol}`)
Expand Down Expand Up @@ -61,7 +58,7 @@ async function main() {
'./deploys.js',
prettier.format(
`module.exports = ${JSON.stringify(stakingDeploys, null, '\t')}`,
{ ...config, parser: 'babel' }
{ ...prettierConfig, parser: 'babel' }
)
)
stakingBlocks[chainId] = (
Expand All @@ -71,7 +68,7 @@ async function main() {
'./deploys-blocks.js',
prettier.format(
`module.exports = ${JSON.stringify(stakingBlocks, null, '\t')}`,
{ ...config, parser: 'babel' }
{ ...prettierConfig, parser: 'babel' }
)
)
console.log(
Expand Down
15 changes: 9 additions & 6 deletions source/staking/scripts/verify.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
/* eslint-disable no-console */
const { ethers, run } = require('hardhat')
const stakingDeploys = require('../deploys.js')
const { chainNames, stakingTokenAddresses } = require('@airswap/constants')
const { chainNames } = require('@airswap/constants')
const config = require('./config.js')

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

const chainId = await deployer.getChainId()
const name = 'Staked AST'
const symbol = 'sAST'
const stakingToken = stakingTokenAddresses[chainId]
const stakingDuration = 60 * 60 * 24 * 7 * 20 // Twenty Weeks
const minDurationChangeDelay = 60 * 60 * 24 * 7 // One Week
const {
name,
symbol,
stakingToken,
stakingDuration,
minDurationChangeDelay,
} = config[chainId]

console.log(`Contract: ${stakingDeploys[chainId]}`)
console.log(`Verifying on ${chainNames[chainId].toUpperCase()}`)
Expand Down
21 changes: 2 additions & 19 deletions source/swap-erc20/deploys-blocks.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
module.exports = {
1: 18319195,
5: 9841536,
30: 5711587,
31: 4370691,
40: 305712483,
41: 262212751,
56: 32477948,
97: 34077869,
137: 48547131,
8453: 5071323,
42161: 139313165,
43113: 26648854,
43114: 36269658,
59140: 1694102,
59144: 602164,
80001: 41044777,
84531: 10869146,
421613: 46764380,
11155111: 4508898,
5: 10357890,
11155111: 5067066,
}
21 changes: 2 additions & 19 deletions source/swap-erc20/deploys.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,4 @@
module.exports = {
1: '0x0C9b31Dc37718417608CE22bb1ba940f702BF90B',
5: '0x0C9b31Dc37718417608CE22bb1ba940f702BF90B',
30: '0x0C9b31Dc37718417608CE22bb1ba940f702BF90B',
31: '0x0C9b31Dc37718417608CE22bb1ba940f702BF90B',
40: '0x0C9b31Dc37718417608CE22bb1ba940f702BF90B',
41: '0x0C9b31Dc37718417608CE22bb1ba940f702BF90B',
56: '0x0C9b31Dc37718417608CE22bb1ba940f702BF90B',
97: '0x0C9b31Dc37718417608CE22bb1ba940f702BF90B',
137: '0x0C9b31Dc37718417608CE22bb1ba940f702BF90B',
8453: '0x0C9b31Dc37718417608CE22bb1ba940f702BF90B',
42161: '0x0C9b31Dc37718417608CE22bb1ba940f702BF90B',
43113: '0x0C9b31Dc37718417608CE22bb1ba940f702BF90B',
43114: '0x0C9b31Dc37718417608CE22bb1ba940f702BF90B',
59140: '0x0C9b31Dc37718417608CE22bb1ba940f702BF90B',
59144: '0x0C9b31Dc37718417608CE22bb1ba940f702BF90B',
80001: '0x0C9b31Dc37718417608CE22bb1ba940f702BF90B',
84531: '0x0C9b31Dc37718417608CE22bb1ba940f702BF90B',
421613: '0x0C9b31Dc37718417608CE22bb1ba940f702BF90B',
11155111: '0x0C9b31Dc37718417608CE22bb1ba940f702BF90B',
5: '0xb0B0Aae54B4336B359201EDfB45C4dB4879e55a5',
11155111: '0xb0B0Aae54B4336B359201EDfB45C4dB4879e55a5',
}
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.6",
"version": "4.1.7-beta.0",
"description": "AirSwap: Atomic ERC20 Token Swap",
"license": "MIT",
"repository": {
Expand Down Expand Up @@ -29,8 +29,8 @@
"@openzeppelin/contracts": "^4.8.3"
},
"devDependencies": {
"@airswap/constants": "4.1.8",
"@airswap/staking": "4.0.5",
"@airswap/constants": "4.1.9-beta.0",
"@airswap/staking": "4.1.0-beta.0",
"@airswap/types": "4.1.3",
"@airswap/utils": "4.1.12",
"prompt-confirm": "^2.0.4"
Expand Down
10 changes: 10 additions & 0 deletions source/swap-erc20/scripts/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const { ChainIds } = require('@airswap/constants')

module.exports = {
[ChainIds.MAINNET]: {
protocolFee: 7,
protocolFeeLight: 7,
bonusScale: 10,
bonusMax: 100,
},
}
Loading
Loading