-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from fei-protocol/tw/add-linting
Add linting to JavaScript code
- Loading branch information
Showing
36 changed files
with
8,066 additions
and
10,904 deletions.
There are no files selected for viewing
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,7 @@ | ||
artifacts/ | ||
build/ | ||
cache/ | ||
coverage/ | ||
dist/ | ||
lib/ | ||
node_modules/ |
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,33 +1,30 @@ | ||
const EthReserveStabilizer = artifacts.require("EthReserveStabilizer"); | ||
const EthPCVDripper = artifacts.require("EthPCVDripper"); | ||
const EthReserveStabilizer = artifacts.require('EthReserveStabilizer'); | ||
const EthPCVDripper = artifacts.require('EthPCVDripper'); | ||
const { web3 } = require('hardhat'); | ||
require('dotenv').config(); | ||
|
||
const { | ||
MAINNET_CORE, | ||
MAINNET_UNISWAP_ORACLE | ||
} = process.env | ||
} = process.env; | ||
|
||
async function main() { | ||
|
||
if (!MAINNET_CORE) { | ||
throw new Error('Failed to fetch core Set MAINNET_CORE') | ||
throw new Error('Failed to fetch core Set MAINNET_CORE'); | ||
} | ||
|
||
if (!MAINNET_UNISWAP_ORACLE) { | ||
throw new Error('Failed to fetch core Set MAINNET_UNISWAP_ORACLE') | ||
throw new Error('Failed to fetch core Set MAINNET_UNISWAP_ORACLE'); | ||
} | ||
|
||
const ethReserveStabiliser = new web3.eth.Contract(EthReserveStabilizer.abi); // factory contract | ||
await ethReserveStabiliser.deploy({data: EthReserveStabilizer.bytecode, arguments: [core, oracle, "9500"]}) // contract bytecode and constructor args | ||
await ethReserveStabiliser.deploy({data: EthReserveStabilizer.bytecode, arguments: [MAINNET_CORE, MAINNET_UNISWAP_ORACLE, '9500']}); // contract bytecode and constructor args | ||
|
||
const ethPCVDripper = new web3.eth.Contract(EthPCVDripper.abi); // factory contract | ||
await ethPCVDripper.deploy({data: EthPCVDripper.bytecode, arguments: [core, instance.address, "3600", "5000000000000000000000"]}) // 5000 ETH per hour | ||
await ethPCVDripper.deploy({data: EthPCVDripper.bytecode, arguments: [MAINNET_CORE, ethReserveStabiliser.address, '3600', '5000000000000000000000']}); // 5000 ETH per hour | ||
} | ||
|
||
|
||
|
||
main().catch(err => { | ||
main().catch((err) => { | ||
console.log(err); | ||
process.exit(1); | ||
}); |
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
const EthReserveStabilizer = artifacts.require("EthReserveStabilizer"); | ||
const EthPCVDripper = artifacts.require("EthPCVDripper"); | ||
const EthReserveStabilizer = artifacts.require('EthReserveStabilizer'); | ||
const EthPCVDripper = artifacts.require('EthPCVDripper'); | ||
require('dotenv').config(); | ||
|
||
module.exports = function(deployer) { | ||
require('dotenv').config(); | ||
const core = process.env.MAINNET_CORE; | ||
const oracle = process.env.MAINNET_UNISWAP_ORACLE; | ||
deployer.then(function() { | ||
return deployer.deploy(EthReserveStabilizer, core, oracle, "9500"); | ||
}).then(function(instance) { | ||
return deployer.deploy(EthPCVDripper, core, instance.address, "3600", "5000000000000000000000"); // 5000 ETH per hour | ||
}); | ||
} | ||
module.exports = function(deployer) { | ||
const core = process.env.MAINNET_CORE; | ||
const oracle = process.env.MAINNET_UNISWAP_ORACLE; | ||
deployer.then(function() { | ||
return deployer.deploy(EthReserveStabilizer, core, oracle, '9500'); | ||
}).then(function(instance) { | ||
return deployer.deploy(EthPCVDripper, core, instance.address, '3600', '5000000000000000000000'); // 5000 ETH per hour | ||
}); | ||
}; |
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,22 +1,22 @@ | ||
const EthUniswapPCVDeposit = artifacts.require("EthUniswapPCVDeposit"); | ||
const EthPCVDepositAdapter = artifacts.require("EthPCVDepositAdapter"); | ||
const RatioPCVController = artifacts.require("RatioPCVController"); | ||
const EthUniswapPCVDeposit = artifacts.require('EthUniswapPCVDeposit'); | ||
const EthPCVDepositAdapter = artifacts.require('EthPCVDepositAdapter'); | ||
const RatioPCVController = artifacts.require('RatioPCVController'); | ||
require('dotenv').config(); | ||
|
||
module.exports = function(deployer) { | ||
require('dotenv').config(); | ||
const coreAddress = process.env.MAINNET_CORE; | ||
const pair = process.env.MAINNET_FEI_ETH_PAIR; | ||
const router = process.env.MAINNET_UNISWAP_ROUTER; | ||
const oracle = process.env.MAINNET_UNISWAP_ORACLE; | ||
const dripperAddress = process.env.MAINNET_ETH_PCV_DRIPPER; | ||
module.exports = function(deployer) { | ||
const coreAddress = process.env.MAINNET_CORE; | ||
const pair = process.env.MAINNET_FEI_ETH_PAIR; | ||
const router = process.env.MAINNET_UNISWAP_ROUTER; | ||
const oracle = process.env.MAINNET_UNISWAP_ORACLE; | ||
const dripperAddress = process.env.MAINNET_ETH_PCV_DRIPPER; | ||
|
||
deployer.then(function() { | ||
return deployer.deploy(EthUniswapPCVDeposit, coreAddress, pair, router, oracle); | ||
}).then(function(instance) { | ||
return deployer.deploy(EthPCVDepositAdapter, instance.address); | ||
}).then(function() { | ||
return deployer.deploy(EthPCVDepositAdapter, dripperAddress); | ||
}).then(function() { | ||
return deployer.deploy(RatioPCVController, coreAddress); | ||
}); | ||
} | ||
deployer.then(function() { | ||
return deployer.deploy(EthUniswapPCVDeposit, coreAddress, pair, router, oracle); | ||
}).then(function(instance) { | ||
return deployer.deploy(EthPCVDepositAdapter, instance.address); | ||
}).then(function() { | ||
return deployer.deploy(EthPCVDepositAdapter, dripperAddress); | ||
}).then(function() { | ||
return deployer.deploy(RatioPCVController, coreAddress); | ||
}); | ||
}; |
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,30 +1,28 @@ | ||
const { BN, ether } = require('@openzeppelin/test-helpers'); | ||
|
||
|
||
const UniswapPCVDeposit = artifacts.require("UniswapPCVDeposit"); | ||
const UniswapPCVController = artifacts.require("UniswapPCVController"); | ||
const BondingCurve = artifacts.require("BondingCurve"); | ||
const UniswapPCVDeposit = artifacts.require('UniswapPCVDeposit'); | ||
const UniswapPCVController = artifacts.require('UniswapPCVController'); | ||
const BondingCurve = artifacts.require('BondingCurve'); | ||
require('dotenv').config(); | ||
|
||
module.exports = function(deployer) { | ||
require('dotenv').config(); | ||
const coreAddress = process.env.MAINNET_CORE; | ||
const pair = process.env.MAINNET_FEI_ETH_PAIR; | ||
const weth = process.env.MAINNET_WETH; | ||
const router = process.env.MAINNET_UNISWAP_ROUTER; | ||
const oracle = process.env.MAINNET_UNISWAP_ORACLE; | ||
|
||
var pcvDeposit; | ||
const coreAddress = process.env.MAINNET_CORE; | ||
const pair = process.env.MAINNET_FEI_ETH_PAIR; | ||
const weth = process.env.MAINNET_WETH; | ||
const router = process.env.MAINNET_UNISWAP_ROUTER; | ||
const oracle = process.env.MAINNET_UNISWAP_ORACLE; | ||
|
||
let tenPow18 = ether('1'); | ||
let pcvDeposit; | ||
const tenPow18 = ether('1'); | ||
|
||
deployer.then(function() { | ||
return deployer.deploy(UniswapPCVDeposit, coreAddress, pair, router, oracle, '100'); | ||
}).then(function(instance) { | ||
pcvDeposit = instance; | ||
return deployer.deploy(UniswapPCVController, coreAddress, instance.address, oracle, tenPow18.mul(new BN('500')), new BN('100'), pair, 14400); | ||
}).then(function() { | ||
return deployer.deploy(BondingCurve, tenPow18.mul(new BN('10000000')), coreAddress, [pcvDeposit.address], [10000], oracle, '100', tenPow18.mul(new BN('500'))); | ||
}).then(function(instance) { | ||
return instance.setToken(weth); | ||
}); | ||
} | ||
deployer.then(function() { | ||
return deployer.deploy(UniswapPCVDeposit, coreAddress, pair, router, oracle, '100'); | ||
}).then(function(instance) { | ||
pcvDeposit = instance; | ||
return deployer.deploy(UniswapPCVController, coreAddress, instance.address, oracle, tenPow18.mul(new BN('500')), new BN('100'), pair, 14400); | ||
}).then(function() { | ||
return deployer.deploy(BondingCurve, tenPow18.mul(new BN('10000000')), coreAddress, [pcvDeposit.address], [10000], oracle, '100', tenPow18.mul(new BN('500'))); | ||
}).then(function(instance) { | ||
return instance.setToken(weth); | ||
}); | ||
}; |
Oops, something went wrong.