Skip to content
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 hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const config: HardhatUserConfig = {
},
},
paths: {
tests: runE2ETests ? './end-to-end' : './test',
tests: runE2ETests ? './test/integration/' : './test/unit/',
},
mocha: {
timeout: 1000000,
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@
"lint": "eslint --config ./.eslintrc.json --ignore-path ./.eslintignore --ext .js .",
"lint:fix": "npm run lint --fix",
"size-contracts": "npx hardhat size-contracts",
"deploy:localhost": "npx hardhat run --network localhost deploy/migrations.js",
"deploy:main": "npx hardhat run --network mainnet deploy/migrations.js",
"deploy:ropsten": "npx hardhat run --network ropsten deploy/migrations.js",
"deploy:rinkeby": "npx hardhat run --network rinkeby deploy/migrations.js",
"deploy:localhost": "npx hardhat run --network localhost scripts/deploy/migrations.js",
"deploy:main": "npx hardhat run --network mainnet scripts/deploy/migrations.js",
"deploy:ropsten": "npx hardhat run --network ropsten scripts/deploy/migrations.js",
"deploy:rinkeby": "npx hardhat run --network rinkeby scripts/deploy/migrations.js",
"abis": "node scripts/abis.js",
"calldata": "npx hardhat run proposals/utils/getProposalCalldata.js",
"check-proposal": "npx hardhat run proposals/utils/checkProposal.js"
"calldata": "npx hardhat run scripts/utils/getProposalCalldata.js",
"check-proposal": "npx hardhat run scripts/utils/checkProposal.js"
},
"author": "joeysantoro",
"license": "AGPL-3.0-only",
Expand Down
2 changes: 1 addition & 1 deletion proposals/dao/fip_10b.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const hre = require('hardhat');
const { forceEth } = require('../../end-to-end/setup/utils.ts');
const { forceEth } = require('../../test/helpers');

const ERC20 = artifacts.require('ERC20');

Expand Down
2 changes: 1 addition & 1 deletion proposals/dao/indexOTC.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const { expect } = require('chai');
const hre = require('hardhat');
const { forceEth } = require('../../end-to-end/setup/utils.ts');
const { forceEth } = require('../../test/helpers');

const e18 = '000000000000000000';
const e15 = '000000000000000';
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion deploy/fip_15.js → scripts/deploy/fip_15.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable max-len */
const { web3 } = require('hardhat');
const { BN } = require('../test/helpers');
const { BN } = require('../../test/helpers');

const TribalChief = artifacts.require('TribalChief');
const TransparentUpgradeableProxy = artifacts.require('TransparentUpgradeableProxy');
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion deploy/migrations.js → scripts/deploy/migrations.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import mainnetAddressesV1 from '../contract-addresses/mainnetAddresses.json';
import mainnetAddressesV1 from '../../contract-addresses/mainnetAddresses.json';

const { web3 } = require('hardhat');

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getMainnetContracts, getContractAddresses } from '../../end-to-end/setup/loadContracts.ts';
import { getMainnetContracts, getContractAddresses } from '../../test/integration/setup/loadContracts.ts';

const hre = require('hardhat');
const { time } = require('@openzeppelin/test-helpers');
Expand Down Expand Up @@ -72,7 +72,7 @@ async function checkProposal() {
console.log('Success');

// Get the upgrade setup, run and teardown scripts
const { teardown, validate } = await import(`../dao/${proposalName}`);
const { teardown, validate } = await import(`../../proposals/dao/${proposalName}`);

const contractAddresses = await getContractAddresses(contracts);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getMainnetContracts, getEthersContract } from '../../end-to-end/setup/loadContracts.ts';
import { getMainnetContracts, getEthersContract } from '../../test/integration/setup/loadContracts.ts';

const fs = require('fs');

Expand All @@ -12,8 +12,8 @@ const { proposals } = require('hardhat');
* Uses the text in `proposals/description/${proposalName}.txt` for the description
*/
export default async function constructProposal(proposalName, logging = false) {
const proposalInfo = await import(`../description/${proposalName}`);
const proposalDescription = fs.readFileSync(`${__dirname}/../description/${proposalName}.txt`);
const proposalInfo = await import(`../../proposals/description/${proposalName}`);
const proposalDescription = fs.readFileSync(`${__dirname}/../../proposals/description/${proposalName}.txt`);

const contracts = await getMainnetContracts();
const proposalBuilder = proposals.builders.alpha();
Expand Down
4 changes: 3 additions & 1 deletion end-to-end/e2e.spec.ts → test/integration/e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { time } from '@openzeppelin/test-helpers';
import { TestEndtoEndCoordinator } from './setup';
import { MainnetContractAddresses, MainnetContracts } from './setup/types';
import { forceEth } from './setup/utils'
import { BN, expectApprox, expectEvent } from '../test/helpers'
import { BN, expectApprox, expectEvent } from '../../test/helpers'
import proposals from './proposals_config.json'

const uintMax = '115792089237316195423570985008687907853269984665640564039457584007913129639935';
Expand Down Expand Up @@ -171,6 +171,8 @@ describe('e2e', function () {
it('splits TRIBE 3 ways', async function () {
const { tribeSplitter, tribeReserveStabilizer, tribe, erc20Dripper, core } = contracts;

await tribeSplitter.allocate();

await core.allocateTribe(tribeSplitter.address, '1000000');

const beforeBalanceStabilizer = await tribe.balanceOf(tribeReserveStabilizer.address);
Expand Down
10 changes: 5 additions & 5 deletions end-to-end/setup/index.ts → test/integration/setup/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import permissions from '../../contract-addresses/permissions.json'
import permissions from '../../../contract-addresses/permissions.json'
import { getContracts, getContractAddresses, getMainnetContractAddresses } from './loadContracts'
import {
Config,
Expand All @@ -9,8 +9,8 @@ import {
Env,
ProposalConfig
} from './types'
import { sudo } from '../../scripts/utils/sudo'
import constructProposal from '../../proposals/utils/constructProposal';
import { sudo } from '../../../scripts/utils/sudo'
import constructProposal from '../../../scripts/utils/constructProposal';

/**
* Coordinate initialising an end-to-end testing environment
Expand Down Expand Up @@ -63,7 +63,7 @@ export class TestEndtoEndCoordinator implements TestCoordinator {
let deployedUpgradedContracts = {}

if (config["deploy"]) {
const { deploy } = await import('../../deploy/' + proposalName);
const { deploy } = await import('../../../scripts/deploy/' + proposalName);
deployedUpgradedContracts = await deploy(this.config.deployAddress, this.mainnetAddresses, this.config.logging)
}

Expand All @@ -80,7 +80,7 @@ export class TestEndtoEndCoordinator implements TestCoordinator {
}

// Get the upgrade setup, run and teardown scripts
const { setup, run, teardown, validate } = await import('../../proposals/dao/' + proposalName);
const { setup, run, teardown, validate } = await import('../../../proposals/dao/' + proposalName);

// setup the DAO proposal
await setup(contractAddresses, existingContracts, contracts, this.config.logging);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import mainnetAddresses from '../../contract-addresses/mainnetAddresses.json'
import mainnetAddresses from '../../../contract-addresses/mainnetAddresses.json'
import { artifacts, ethers } from 'hardhat'
import { MainnetContractAddresses, MainnetContracts } from './types';

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {
expect,
getCore,
getAddresses,
} = require('../helpers');
} = require('../../helpers');

const BondingCurve = artifacts.require('BondingCurve');
const Fei = artifacts.require('Fei');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const {
expect,
getAddresses,
getCore,
} = require('../helpers');
} = require('../../helpers');

const EthBondingCurve = artifacts.require('EthBondingCurve');
const Fei = artifacts.require('Fei');
Expand Down
2 changes: 1 addition & 1 deletion test/core/Core.test.js → test/unit/core/Core.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const {
expect,
getCore,
getAddresses,
} = require('../helpers');
} = require('../../helpers');

const Tribe = artifacts.require('Tribe');
const MockCoreRef = artifacts.require('MockCoreRef');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const {
getCore,
time,
expect,
} = require('../helpers');
} = require('../../helpers');

const OptimisticTimelock = artifacts.require('OptimisticTimelock');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {
getAddresses,
time,
expect,
} = require('../helpers');
} = require('../../helpers');

const TimelockedDelegator = artifacts.require('TimelockedDelegator');
const MockTribe = artifacts.require('MockTribe');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { expect, getCore } = require('../helpers');
const { expect, getCore } = require('../../helpers');

const ChainlinkOracleWrapper = artifacts.require('ChainlinkOracleWrapper');
const MockChainlinkOracle = artifacts.require('MockChainlinkOracle');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const {
getAddresses,
expectRevert,
expectEvent
} = require('../helpers');
} = require('../../helpers');

const CollateralizationOracle = artifacts.require('CollateralizationOracle');
const MockPCVDepositV2 = artifacts.require('MockPCVDepositV2');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {
getAddresses,
expectRevert,
expectEvent
} = require('../helpers');
} = require('../../helpers');

const CollateralizationOracleWrapper = artifacts.require('CollateralizationOracleWrapper');
const MockCollateralizationOracle = artifacts.require('MockCollateralizationOracle');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const {
expect,
getAddresses,
getCore
} = require('../helpers');
} = require('../../helpers');

const CompositeOracle = artifacts.require('CompositeOracle');
const MockOracle = artifacts.require('MockOracle');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { expect, getCore, getAddresses } = require('../helpers');
const { expect, getCore, getAddresses } = require('../../helpers');

const ConstantOracle = artifacts.require('ConstantOracle');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {
expect,
getAddresses,
getCore,
} = require('../helpers');
} = require('../../helpers');

const UniswapOracle = artifacts.require('UniswapOracle');
const MockPairTrade = artifacts.require('MockUniswapV2PairTrade');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {
expect,
getAddresses,
getCore,
} = require('../helpers');
} = require('../../helpers');

const AavePCVDeposit = artifacts.require('AavePCVDeposit');
const MockLendingPool = artifacts.require('MockLendingPool');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const {
expect,
getAddresses,
getCore,
} = require('../helpers');
} = require('../../helpers');

const ERC20CompoundPCVDeposit = artifacts.require('ERC20CompoundPCVDeposit');
const MockCToken = artifacts.require('MockCToken');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const {
expect,
getAddresses,
expectApprox,
} = require('../helpers');
} = require('../../helpers');

const Tribe = artifacts.require('MockTribe');
const MockCoreRef = artifacts.require('MockCoreRef');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const {
expect,
getAddresses,
getCore,
} = require('../helpers');
} = require('../../helpers');

const ERC20Splitter = artifacts.require('ERC20Splitter');
const Tribe = artifacts.require('Tribe');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {
expect,
getAddresses,
getCore,
} = require('../helpers');
} = require('../../helpers');

const EthCompoundPCVDeposit = artifacts.require('EthCompoundPCVDeposit');
const MockCToken = artifacts.require('MockCToken');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const {
getAddresses,
getCore,
forceEth
} = require('../helpers');
} = require('../../helpers');

const EthLidoPCVDeposit = artifacts.require('EthLidoPCVDeposit');
const Fei = artifacts.require('Fei');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const {
expect,
getCore,
} = require('../helpers');
} = require('../../helpers');

const PCVDepositWrapper = artifacts.require('PCVDepositWrapper');
const MockPCVDepositV2 = artifacts.require('MockPCVDepositV2');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const {
expect,
getAddresses,
getCore,
} = require('../helpers');
} = require('../../helpers');

const PCVDripController = artifacts.require('PCVDripController');
const MockPCVDeposit = artifacts.require('MockEthUniswapPCVDeposit');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const {
expect,
getAddresses,
getCore,
} = require('../helpers');
} = require('../../helpers');

const PCVSwapperUniswap = artifacts.require('PCVSwapperUniswap');
const ChainlinkOracleWrapper = artifacts.require('ChainlinkOracleWrapper');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {
getAddresses,
getCore,
web3,
} = require('../helpers');
} = require('../../helpers');

const RatioPCVController = artifacts.require('RatioPCVController');
const MockERC20 = artifacts.require('MockERC20');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const {
expect,
getAddresses,
getCore
} = require('../helpers');
} = require('../../helpers');

const StableSwapOperatorV1 = artifacts.require('StableSwapOperatorV1');
const MockCurve3pool = artifacts.require('MockCurve3pool');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const {
getCore,
getAddresses,
expectRevert,
} = require('../helpers');
} = require('../../helpers');

const StaticPCVDepositWrapper = artifacts.require('StaticPCVDepositWrapper');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const {
expect,
getAddresses,
getCore
} = require('../helpers');
} = require('../../helpers');

const UniswapPCVController = artifacts.require('UniswapPCVController');
const Fei = artifacts.require('Fei');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const {
expect,
getAddresses,
getCore,
} = require('../helpers');
} = require('../../helpers');

const UniswapPCVDeposit = artifacts.require('UniswapPCVDeposit');
const Fei = artifacts.require('Fei');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const {
BN,
getAddresses,
getCore,
} = require('../helpers');
} = require('../../helpers');

const ReserveStabilizer = artifacts.require('ReserveStabilizer');
const MockOracle = artifacts.require('MockOracle');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const {
expect,
getAddresses,
getCore,
} = require('../helpers');
} = require('../../helpers');

const EthReserveStabilizer = artifacts.require('EthReserveStabilizer');
const Fei = artifacts.require('Fei');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const {
expect,
getAddresses,
getCore,
} = require('../helpers');
} = require('../../helpers');

const ReserveStabilizer = artifacts.require('ReserveStabilizer');
const Fei = artifacts.require('Fei');
Expand Down
Loading