-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dd45cba
commit 9ae347f
Showing
15 changed files
with
175 additions
and
135 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
|
||
const func: DeployFunction = async function ({ deployments, getNamedAccounts, network }) { | ||
|
||
const { deploy, log } = deployments; | ||
const { deployer } = await getNamedAccounts(); | ||
const waitBlockConfirmations = network.name != "testnet" ? 1 : 6; | ||
|
||
log("----------------------------------------------------"); | ||
|
||
const token = await deploy("TestToken", { | ||
from: deployer, | ||
log: true, | ||
}); | ||
|
||
log(`Token deployed at address ${token.address}`); | ||
|
||
const deployArgs: string[] = [token.address]; | ||
const factory = await deploy("SimpleSwapFactory", { | ||
from: deployer, | ||
args: deployArgs, | ||
log: true, | ||
waitConfirmations: waitBlockConfirmations, | ||
}); | ||
|
||
log(`Factory deployed at address ${factory.address}`); | ||
}; | ||
|
||
export default func; | ||
func.tags = ["factory"]; |
15 changes: 8 additions & 7 deletions
15
deploy/local/001_deploy_oracle.js → deploy/local/001_deploy_oracle.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
const { network } = require("hardhat"); | ||
|
||
module.exports = async ({ getNamedAccounts, deployments }) => { | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
|
||
const func: DeployFunction = async function ({ deployments, getNamedAccounts }) { | ||
const { deploy, log } = deployments; | ||
const { deployer } = await getNamedAccounts(); | ||
const waitBlockConfirmations = 1; | ||
|
||
log("----------------------------------------------------"); | ||
const args = [100, 200]; | ||
const deployArgs: [number, number] = [100, 200]; | ||
|
||
// Deploy the PriceOracle contract | ||
const oracle = await deploy('PriceOracle', { | ||
from: deployer, | ||
args: args, | ||
args: deployArgs, | ||
log: true, | ||
waitConfirmations: waitBlockConfirmations, | ||
}); | ||
|
||
// Log the address at which the Oracle is deployed | ||
console.log('Oracle deployed at address ' + oracle.address); | ||
|
||
log(`Oracle deployed at address ${oracle.address}`); | ||
}; | ||
|
||
module.exports.tags = ["factory"]; | ||
export default func; | ||
func.tags = ["factory"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
const { getNamedAccounts, deployments, network, run } = require("hardhat"); | ||
const { verify } = require("../../utils/verify"); | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
|
||
const func: DeployFunction = async function ({ deployments, getNamedAccounts, network }) { | ||
|
||
module.exports = async ({ getNamedAccounts, deployments }) => { | ||
const { deploy, log } = deployments; | ||
const { deployer } = await getNamedAccounts(); | ||
|
||
// This code is just used for Sepolia testnet deployment | ||
const waitBlockConfirmations = network.name != "mainnet" ? 1 : 6; | ||
const waitBlockConfirmations = network.name !== "mainnet" ? 1 : 6; | ||
|
||
log("----------------------------------------------------"); | ||
// sBZZ token address | ||
// TODO this still needs to be done for the first time | ||
}; | ||
|
||
module.exports.tags = ["factory"]; | ||
func.tags = ["factory"]; | ||
export default func; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
import { verify } from "../../utils/verify"; | ||
import { DeployFunction } from 'hardhat-deploy/types'; | ||
|
||
const func: DeployFunction = async function ({ deployments, getNamedAccounts, network }) { | ||
const { deploy, log } = deployments; | ||
const { deployer } = await getNamedAccounts(); | ||
|
||
// This code is just used for Sepolia testnet deployment | ||
const waitBlockConfirmations = network.name !== "testnet" ? 1 : 6; | ||
|
||
log("----------------------------------------------------"); | ||
const deployArgs: string[] = ["0x543ddb01ba47acb11de34891cd86b675f04840db"]; | ||
const factory = await deploy("SimpleSwapFactory", { | ||
from: deployer, | ||
args: deployArgs, | ||
log: true, | ||
waitConfirmations: waitBlockConfirmations, | ||
}); | ||
|
||
log(`Factory deployed at address ${factory.address}`); | ||
|
||
// Verify the deployment | ||
if (network.name === "testnet" && process.env.TESTNET_ETHERSCAN_KEY) { | ||
log("Verifying..."); | ||
await verify(factory.address, arguments); | ||
} | ||
}; | ||
|
||
func.tags = ["factory"]; | ||
export default func; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
echo "----- USE THE COMMANDS BELOW TO SETUP YOUR TERMINALS -----" >&2 | ||
|
||
export BEE_SWAP_FACTORY_ADDRESS=0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 | ||
export BEE_SWAP_LEGACY_FACTORY_ADDRESSES=0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 | ||
export BEE_SWAP_PRICE_ORACLE_ADDRESS=0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0 | ||
export BEE_SWAP_ENDPOINT=http://localhost:8545 | ||
echo "----- USE THE COMMANDS BELOW TO SETUP YOUR TERMINALS -----" >&2 | ||
|
||
export BEE_SWAP_FACTORY_ADDRESS=0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 | ||
export BEE_SWAP_LEGACY_FACTORY_ADDRESSES=0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 | ||
export BEE_SWAP_PRICE_ORACLE_ADDRESS=0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0 | ||
export BEE_SWAP_ENDPOINT=http://localhost:8545 | ||
echo "----- USE THE COMMANDS BELOW TO SETUP YOUR TERMINALS -----" >&2 | ||
|
||
export BEE_SWAP_FACTORY_ADDRESS=0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 | ||
export BEE_SWAP_LEGACY_FACTORY_ADDRESSES=0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 | ||
export BEE_SWAP_PRICE_ORACLE_ADDRESS=0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0 | ||
export BEE_SWAP_ENDPOINT=http://localhost:8545 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2015", | ||
"module": "commonjs", | ||
"strict": true, | ||
"esModuleInterop": true, | ||
"moduleResolution": "node", | ||
"forceConsistentCasingInFileNames": true, | ||
"outDir": "dist", | ||
"resolveJsonModule": true | ||
}, | ||
"include": ["hardhat.config.ts", "./scripts", "./deploy", "./test", "./utils", "./tasks"], | ||
"exclude": ["node_modules", "**/*.spec.ts"] | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.