diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.eslintignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js index cf0ed17..d00d2da 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -14,7 +14,7 @@ module.exports = { contract: true, expect: true, Promise: true, - web3: true, + hre: true, }, plugins: ['prettier', 'spellcheck', 'chai-friendly'], rules: { @@ -86,6 +86,7 @@ module.exports = { 'initializer', 'nomiclabs', 'upgradable', + 'upgradeability', 'ethersproject', 'hexlify', 'utf8', @@ -93,6 +94,7 @@ module.exports = { 'keccak256', 'Sighash', 'ecsign', + 'rollup', // shorthand 'args', @@ -109,6 +111,9 @@ module.exports = { 'perc', 'opcode', 'aprox', + 'impl', + 'param', + 'desc', // project-specific 'rebase', @@ -159,6 +164,12 @@ module.exports = { 'dev3', 'avax', 'arbitrum', + 'mumbai', + 'maticjs', + 'maticnetwork', + 'passphrase', + 'erc721', + 'batcher', // names 'nithin', diff --git a/contracts/_external/uFragments/MedianOracle.sol b/contracts/_external/ampleforth-contracts/MedianOracle.sol similarity index 100% rename from contracts/_external/uFragments/MedianOracle.sol rename to contracts/_external/ampleforth-contracts/MedianOracle.sol diff --git a/contracts/_external/uFragments/Orchestrator.sol b/contracts/_external/ampleforth-contracts/Orchestrator.sol similarity index 72% rename from contracts/_external/uFragments/Orchestrator.sol rename to contracts/_external/ampleforth-contracts/Orchestrator.sol index 28aae9d..a254358 100644 --- a/contracts/_external/uFragments/Orchestrator.sol +++ b/contracts/_external/ampleforth-contracts/Orchestrator.sol @@ -2,4 +2,4 @@ // Importing uFragments contract dependencies to be compiled for integration tests pragma solidity 0.7.6; -import "uFragments/contracts/Orchestrator.sol"; +import "ampleforth-contracts/contracts/Orchestrator.sol"; diff --git a/contracts/_external/uFragments/UFragments.sol b/contracts/_external/ampleforth-contracts/UFragments.sol similarity index 73% rename from contracts/_external/uFragments/UFragments.sol rename to contracts/_external/ampleforth-contracts/UFragments.sol index 8027b7a..f501a3d 100644 --- a/contracts/_external/uFragments/UFragments.sol +++ b/contracts/_external/ampleforth-contracts/UFragments.sol @@ -2,4 +2,4 @@ // Importing uFragments contract dependencies to be compiled for integration tests pragma solidity 0.7.6; -import "uFragments/contracts/UFragments.sol"; +import "ampleforth-contracts/contracts/UFragments.sol"; diff --git a/contracts/_external/uFragments/UFragmentsPolicy.sol b/contracts/_external/ampleforth-contracts/UFragmentsPolicy.sol similarity index 71% rename from contracts/_external/uFragments/UFragmentsPolicy.sol rename to contracts/_external/ampleforth-contracts/UFragmentsPolicy.sol index a63ebb7..8c792dd 100644 --- a/contracts/_external/uFragments/UFragmentsPolicy.sol +++ b/contracts/_external/ampleforth-contracts/UFragmentsPolicy.sol @@ -2,4 +2,4 @@ // Importing uFragments contract dependencies to be compiled for integration tests pragma solidity 0.7.6; -import "uFragments/contracts/UFragmentsPolicy.sol"; +import "ampleforth-contracts/contracts/UFragmentsPolicy.sol"; diff --git a/contracts/_interfaces/IXCAmple.sol b/contracts/_interfaces/IXCAmple.sol index 860c493..8f28983 100644 --- a/contracts/_interfaces/IXCAmple.sol +++ b/contracts/_interfaces/IXCAmple.sol @@ -1,5 +1,5 @@ // SPDX-License-Identifier: GPL-3.0-or-later -import "uFragments/contracts/interfaces/IAMPL.sol"; +import "ampleforth-contracts/contracts/interfaces/IAMPL.sol"; interface IXCAmple is IAMPL { function globalAMPLSupply() external view returns (uint256); diff --git a/contracts/_mocks/MockERC20.sol b/contracts/_mocks/MockERC20.sol index 45b4136..d8d506d 100644 --- a/contracts/_mocks/MockERC20.sol +++ b/contracts/_mocks/MockERC20.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.7.3; -import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; +import "openzeppelin-contracts-3.4.1/contracts/token/ERC20/ERC20.sol"; contract MockERC20 is ERC20 { constructor(string memory name, string memory symbol) public ERC20(name, symbol) { diff --git a/contracts/_test/UFragmentsTestnet.sol b/contracts/_test/UFragmentsTestnet.sol index 8bf1a18..d26e667 100644 --- a/contracts/_test/UFragmentsTestnet.sol +++ b/contracts/_test/UFragmentsTestnet.sol @@ -2,7 +2,7 @@ // Importing uFragments contract dependencies to be compiled for integration tests pragma solidity 0.7.6; -import {UFragments} from "uFragments/contracts/UFragments.sol"; +import {UFragments} from "ampleforth-contracts/contracts/UFragments.sol"; contract UFragmentsTestnet is UFragments { event Result(bool result, bytes reason); diff --git a/contracts/_utilities/BatchTxExecutor.sol b/contracts/_utilities/BatchTxExecutor.sol index 347dc86..ebd2c09 100644 --- a/contracts/_utilities/BatchTxExecutor.sol +++ b/contracts/_utilities/BatchTxExecutor.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.7.3; -import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; -import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; +import {SafeMath} from "openzeppelin-contracts-3.4.1/contracts/math/SafeMath.sol"; +import {Ownable} from "openzeppelin-contracts-3.4.1/contracts/access/Ownable.sol"; /** * @title BatchTxExecutor diff --git a/contracts/base-chain/TokenVault.sol b/contracts/base-chain/TokenVault.sol index 0988af3..85f374c 100644 --- a/contracts/base-chain/TokenVault.sol +++ b/contracts/base-chain/TokenVault.sol @@ -1,10 +1,10 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.7.3; -import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; -import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; -import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; +import {Ownable} from "openzeppelin-contracts-3.4.1/contracts/access/Ownable.sol"; +import {SafeMath} from "openzeppelin-contracts-3.4.1/contracts/math/SafeMath.sol"; +import {IERC20} from "openzeppelin-contracts-3.4.1/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "openzeppelin-contracts-3.4.1/contracts/token/ERC20/SafeERC20.sol"; /** * @title TokenVault diff --git a/contracts/base-chain/bridge-gateways/AMPLArbitrumGateway.sol b/contracts/base-chain/bridge-gateways/AMPLArbitrumGateway.sol index 762cda4..f73c1ca 100644 --- a/contracts/base-chain/bridge-gateways/AMPLArbitrumGateway.sol +++ b/contracts/base-chain/bridge-gateways/AMPLArbitrumGateway.sol @@ -2,17 +2,17 @@ pragma solidity 0.6.11; pragma experimental ABIEncoderV2; -import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; -import {Initializable} from "@openzeppelin/contracts/proxy/Initializable.sol"; +import {SafeMath} from "openzeppelin-contracts-3.4.1/contracts/math/SafeMath.sol"; +import {Initializable} from "openzeppelin-contracts-3.4.1/contracts/proxy/Initializable.sol"; // solhint-disable-next-line max-line-length import {GatewayMessageHandler} from "arb-bridge-peripherals/contracts/tokenbridge/libraries/gateway/GatewayMessageHandler.sol"; import {L1ArbitrumMessenger} from "arb-bridge-peripherals/contracts/tokenbridge/ethereum/L1ArbitrumMessenger.sol"; // solhint-disable-next-line max-line-length import {IArbitrumBCRebaseGateway, IArbitrumBCTransferGateway, IArbitrumSCRebaseGateway, IArbitrumSCTransferGateway} from "../../_interfaces/bridge-gateways/IArbitrumGateway.sol"; -import {IAmpleforth} from "uFragments/contracts/interfaces/IAmpleforth.sol"; -import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; +import {IAmpleforth} from "ampleforth-contracts/contracts/interfaces/IAmpleforth.sol"; +import {IERC20} from "openzeppelin-contracts-3.4.1/contracts/token/ERC20/IERC20.sol"; +import {SafeERC20} from "openzeppelin-contracts-3.4.1/contracts/token/ERC20/SafeERC20.sol"; import {ITokenVault} from "../../_interfaces/ITokenVault.sol"; /// @dev Abstract l2 gateway contarct implementation to define function selectors diff --git a/contracts/base-chain/bridge-gateways/AMPLChainBridgeGateway.sol b/contracts/base-chain/bridge-gateways/AMPLChainBridgeGateway.sol index 17ea5b1..16508ca 100644 --- a/contracts/base-chain/bridge-gateways/AMPLChainBridgeGateway.sol +++ b/contracts/base-chain/bridge-gateways/AMPLChainBridgeGateway.sol @@ -1,13 +1,13 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.7.3; -import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; -import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; +import {Ownable} from "openzeppelin-contracts-3.4.1/contracts/access/Ownable.sol"; +import {SafeMath} from "openzeppelin-contracts-3.4.1/contracts/math/SafeMath.sol"; // solhint-disable-next-line max-line-length import {IChainBridgeBCRebaseGateway, IChainBridgeBCTransferGateway} from "../../_interfaces/bridge-gateways/IChainBridgeGateway.sol"; -import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; -import {IAmpleforth} from "uFragments/contracts/interfaces/IAmpleforth.sol"; +import {IERC20} from "openzeppelin-contracts-3.4.1/contracts/token/ERC20/IERC20.sol"; +import {IAmpleforth} from "ampleforth-contracts/contracts/interfaces/IAmpleforth.sol"; import {ITokenVault} from "../../_interfaces/ITokenVault.sol"; /** diff --git a/contracts/base-chain/bridge-gateways/AMPLMaticRebaseGateway.sol b/contracts/base-chain/bridge-gateways/AMPLMaticRebaseGateway.sol index 859704c..899cfb4 100644 --- a/contracts/base-chain/bridge-gateways/AMPLMaticRebaseGateway.sol +++ b/contracts/base-chain/bridge-gateways/AMPLMaticRebaseGateway.sol @@ -4,8 +4,8 @@ pragma solidity 0.7.3; import {FxBaseRootTunnel} from "fx-portal/contracts/tunnel/FxBaseRootTunnel.sol"; import {IMaticBCRebaseGateway} from "../../_interfaces/bridge-gateways/IMaticGateway.sol"; -import {IAmpleforth} from "uFragments/contracts/interfaces/IAmpleforth.sol"; -import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import {IAmpleforth} from "ampleforth-contracts/contracts/interfaces/IAmpleforth.sol"; +import {IERC20} from "openzeppelin-contracts-3.4.1/contracts/token/ERC20/IERC20.sol"; /** * @title AMPLMaticRebaseGateway: AMPL-Matic Rebase Gateway Contract diff --git a/contracts/base-chain/bridge-gateways/AMPLMaticTransferGateway.sol b/contracts/base-chain/bridge-gateways/AMPLMaticTransferGateway.sol index 53d88b1..13e999f 100644 --- a/contracts/base-chain/bridge-gateways/AMPLMaticTransferGateway.sol +++ b/contracts/base-chain/bridge-gateways/AMPLMaticTransferGateway.sol @@ -1,13 +1,13 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.7.3; -import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; +import {SafeMath} from "openzeppelin-contracts-3.4.1/contracts/math/SafeMath.sol"; import {FxBaseRootTunnel} from "fx-portal/contracts/tunnel/FxBaseRootTunnel.sol"; import {IMaticTransferGateway} from "../../_interfaces/bridge-gateways/IMaticGateway.sol"; import {ITokenVault} from "../../_interfaces/ITokenVault.sol"; -import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; +import {IERC20} from "openzeppelin-contracts-3.4.1/contracts/token/ERC20/IERC20.sol"; /** * @title AMPLMaticTransferGateway: AMPL-Matic Transfer Gateway Contract diff --git a/contracts/satellite-chain/bridge-gateways/ArbitrumXCAmpleGateway.sol b/contracts/satellite-chain/bridge-gateways/ArbitrumXCAmpleGateway.sol index a4732b6..e2d089e 100644 --- a/contracts/satellite-chain/bridge-gateways/ArbitrumXCAmpleGateway.sol +++ b/contracts/satellite-chain/bridge-gateways/ArbitrumXCAmpleGateway.sol @@ -2,8 +2,8 @@ pragma solidity 0.6.11; pragma experimental ABIEncoderV2; -import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; -import {Initializable} from "@openzeppelin/contracts/proxy/Initializable.sol"; +import {SafeMath} from "openzeppelin-contracts-3.4.1/contracts/math/SafeMath.sol"; +import {Initializable} from "openzeppelin-contracts-3.4.1/contracts/proxy/Initializable.sol"; // solhint-disable-next-line max-line-length import {GatewayMessageHandler} from "arb-bridge-peripherals/contracts/tokenbridge/libraries/gateway/GatewayMessageHandler.sol"; diff --git a/contracts/satellite-chain/bridge-gateways/ChainBridgeXCAmpleGateway.sol b/contracts/satellite-chain/bridge-gateways/ChainBridgeXCAmpleGateway.sol index c3ec1b3..17d6a20 100644 --- a/contracts/satellite-chain/bridge-gateways/ChainBridgeXCAmpleGateway.sol +++ b/contracts/satellite-chain/bridge-gateways/ChainBridgeXCAmpleGateway.sol @@ -1,8 +1,8 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.7.3; -import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; -import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; +import {Ownable} from "openzeppelin-contracts-3.4.1/contracts/access/Ownable.sol"; +import {SafeMath} from "openzeppelin-contracts-3.4.1/contracts/math/SafeMath.sol"; // solhint-disable-next-line max-line-length import {IChainBridgeSCRebaseGateway, IChainBridgeSCTransferGateway} from "../../_interfaces/bridge-gateways/IChainBridgeGateway.sol"; diff --git a/contracts/satellite-chain/bridge-gateways/MaticXCAmpleTransferGateway.sol b/contracts/satellite-chain/bridge-gateways/MaticXCAmpleTransferGateway.sol index 0aef430..dbb2d95 100644 --- a/contracts/satellite-chain/bridge-gateways/MaticXCAmpleTransferGateway.sol +++ b/contracts/satellite-chain/bridge-gateways/MaticXCAmpleTransferGateway.sol @@ -1,7 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.7.3; -import {SafeMath} from "@openzeppelin/contracts/math/SafeMath.sol"; +import {SafeMath} from "openzeppelin-contracts-3.4.1/contracts/math/SafeMath.sol"; import {FxBaseChildTunnel} from "fx-portal/contracts/tunnel/FxBaseChildTunnel.sol"; diff --git a/contracts/satellite-chain/xc-ampleforth/XCAmple.sol b/contracts/satellite-chain/xc-ampleforth/XCAmple.sol index 2c67c9c..017b613 100644 --- a/contracts/satellite-chain/xc-ampleforth/XCAmple.sol +++ b/contracts/satellite-chain/xc-ampleforth/XCAmple.sol @@ -1,9 +1,9 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.7.3; -import {SafeMathUpgradeable} from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; -import {IERC20Upgradeable} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import {SafeMathUpgradeable} from "openzeppelin-contracts-upgradeable-3.3.0/contracts/math/SafeMathUpgradeable.sol"; +import {IERC20Upgradeable} from "openzeppelin-contracts-upgradeable-3.3.0/contracts/token/ERC20/IERC20Upgradeable.sol"; +import {OwnableUpgradeable} from "openzeppelin-contracts-upgradeable-3.3.0/contracts/access/OwnableUpgradeable.sol"; /** * @title XC(cross-chain)Ample ERC20 token diff --git a/contracts/satellite-chain/xc-ampleforth/XCAmpleController.sol b/contracts/satellite-chain/xc-ampleforth/XCAmpleController.sol index 4302e8e..fe1643b 100644 --- a/contracts/satellite-chain/xc-ampleforth/XCAmpleController.sol +++ b/contracts/satellite-chain/xc-ampleforth/XCAmpleController.sol @@ -1,9 +1,10 @@ // SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.7.3; -import {SafeMathUpgradeable} from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; -import {SignedSafeMathUpgradeable} from "@openzeppelin/contracts-upgradeable/math/SignedSafeMathUpgradeable.sol"; -import {OwnableUpgradeable} from "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol"; +import {SafeMathUpgradeable} from "openzeppelin-contracts-upgradeable-3.3.0/contracts/math/SafeMathUpgradeable.sol"; +// solhint-disable-next-line max-line-length +import {SignedSafeMathUpgradeable} from "openzeppelin-contracts-upgradeable-3.3.0/contracts/math/SignedSafeMathUpgradeable.sol"; +import {OwnableUpgradeable} from "openzeppelin-contracts-upgradeable-3.3.0/contracts/access/OwnableUpgradeable.sol"; import {UInt256Lib} from "./UInt256Lib.sol"; import {IXCAmple} from "../../_interfaces/IXCAmple.sol"; diff --git a/helpers/contracts.js b/helpers/contracts.js index 4cb6934..f760b55 100644 --- a/helpers/contracts.js +++ b/helpers/contracts.js @@ -1,19 +1,20 @@ const fs = require('fs'); +const path = require('path'); const { getAdminAddress } = require('@openzeppelin/upgrades-core'); -const DEPLOYMENT_CONFIG_PATH = __dirname + '/../sdk/deployments'; +const DEPLOYMENT_CONFIG_PATH = path.join(__dirname, '/../sdk/deployments'); const { getEthersProvider } = require('./utils'); const BLOCKS_PER_SEC = 1 / 15; const ContractABIPaths = { - // Openzepppelin + // Openzeppelin ProxyAdmin: '@openzeppelin/upgrades/contracts/upgradeability', // Ampleforth - UFragments: 'uFragments/contracts', - UFragmentsPolicy: 'uFragments/contracts', - Orchestrator: 'uFragments/contracts', + UFragments: 'ampleforth-contracts/contracts', + UFragmentsPolicy: 'ampleforth-contracts/contracts', + Orchestrator: 'ampleforth-contracts/contracts', MedianOracle: 'market-oracle/contracts', UFragmentsTestnet: 'contracts/_test', @@ -31,8 +32,6 @@ const ContractABIPaths = { TokenVault: 'contracts/base-chain', - AMPLChainBridgeGateway: 'contracts/base-chain/bridge-gateways', - ChainBridgeXCAmpleGateway: 'contracts/satellite-chain/bridge-gateways', AMPLChainBridgeGateway: 'contracts/base-chain/bridge-gateways', ChainBridgeXCAmpleGateway: 'contracts/satellite-chain/bridge-gateways', @@ -42,11 +41,11 @@ const ContractABIPaths = { MaticXCAmpleTransferGateway: 'contracts/satellite-chain/bridge-gateways', // utilities - ChainBridgeBatchRebaseReport: 'contracts/_utilities', + ChainBridgeBatchRebaseReport: 'contracts/_utilities' }; -const sleep = (sec) => { - return new Promise((resolve) => setTimeout(resolve, sec * 1000)); +const sleep = sec => { + return new Promise(resolve => setTimeout(resolve, sec * 1000)); }; const getCompiledContractFactory = (ethers, contract) => { @@ -92,7 +91,7 @@ const deployProxyContract = async ( 'ProxyAdmin', ); const Factory = await getCompiledContractFactory(ethers, contractName); - const contract = await upgrades.deployProxy( + const contract = await hre.upgrades.deployProxy( Factory.connect(signer), args, initializerDef, @@ -151,13 +150,13 @@ const upgradeProxyContract = async ( let newImplAddress; if (!force) { const Factory = await getCompiledContractFactory(ethers, contractName); - newImplAddress = await upgrades.prepareUpgrade( + newImplAddress = await hre.upgrades.prepareUpgrade( proxy.address, Factory.connect(signer), ); await sleep(30); } else { - console.log(`CAUTION: Skpping storage layout verification!`); + console.log('CAUTION: Skipping storage layout verification!'); const newImpl = await deployContract( ethers, contractName, @@ -169,16 +168,16 @@ const upgradeProxyContract = async ( } console.log(`New implementation for ${contractName} is at`, newImplAddress); - if ((await proxyAdmin.owner()) == (await signer.getAddress())) { - console.log(`CAUTION: Executing live upgrade!`); - console.log(`CANCEL NOW to stop, this action is not reversable`); + if ((await proxyAdmin.owner()) === (await signer.getAddress())) { + console.log('CAUTION: Executing live upgrade!'); + console.log('CANCEL NOW to stop, this action is not reversible'); await sleep(15); await proxyAdmin .connect(signer) .upgrade(proxy.address, newImplAddress, txParams); } else { - console.log('Signer not proxy onwer, cant upgrade'); + console.log('Signer not proxy owner, cant upgrade'); console.log( `Execute proxyAdmin.upgrade(${proxy.address}, ${newImplAddress})`, ); @@ -199,10 +198,15 @@ const upgradeProxyContract = async ( const getDeployedContractInstance = async (network, contractName, provider) => { const contractData = await readContractDeploymentData(network, contractName); - return new ethers.Contract(contractData.address, contractData.abi, provider); + // TODO: pass ethers down + return new hre.ethers.Contract( + contractData.address, + contractData.abi, + provider, + ); }; -const readDeploymentData = (network) => { +const readDeploymentData = network => { const addressFile = `${DEPLOYMENT_CONFIG_PATH}/${network}.json`; return JSON.parse(fs.readFileSync(addressFile)); }; @@ -236,12 +240,12 @@ const writeDeploymentData = async (network, contractRef, contract) => { address: contract.address, abi: contract.interface.format(), hash: tx.hash, - blockNumber: txR.blockNumber, + blockNumber: txR.blockNumber }; } else { chainAddresses[contractRef] = { address: contract.address, - abi: contract.interface.format(), + abi: contract.interface.format() }; } @@ -265,7 +269,7 @@ const writeProxyDeploymentData = async (network, contractRef, contract) => { proxyAdmin: await getAdminAddress( getEthersProvider(network), contract.address, - ), + ) }; fs.writeFileSync(addressFile, JSON.stringify(chainAddresses, null, 2)); @@ -291,8 +295,8 @@ const filterContractEvents = async ( for (let i = startBlock; i <= endBlock; i += freq) { console.log(startBlock, endBlock, i, logs.length); const getLogs = async (tries = 25) => { - if (tries == 0) { - throw 'Max tries reached'; + if (tries === 0) { + throw new Error('Max tries reached'); } try { const r = await provider.getLogs({ @@ -300,7 +304,7 @@ const filterContractEvents = async ( fromBlock: ethers.utils.hexlify(i), toBlock: ethers.utils.hexlify( i + freq > endBlock ? endBlock : i + freq, - ), + ) }); return r; } catch (e) { @@ -319,9 +323,11 @@ const filterContractEvents = async ( try { log.parsed = contractInterface.parseLog(log); if (!log.parsed) { - throw 'Parse error'; + throw new Error('Parse error'); + } + if (log.parsed.name === event) { + m.push(log); } - log.parsed.name == event ? m.push(log) : m; return m; } catch (e) { console.log(e, log); @@ -336,6 +342,7 @@ module.exports = { readContractDeploymentData, writeBulkDeploymentData, writeDeploymentData, + writeProxyDeploymentData, getCompiledContractFactory, getDeployedContractInstance, @@ -345,5 +352,5 @@ module.exports = { deployProxyContract, upgradeProxyContract, - filterContractEvents, + filterContractEvents }; diff --git a/helpers/deploy/ampl.js b/helpers/deploy/ampl.js index 7538604..ca86ff4 100644 --- a/helpers/deploy/ampl.js +++ b/helpers/deploy/ampl.js @@ -3,10 +3,10 @@ const { AMPL_BASE_RATE, AMPL_BASE_CPI } = require('../../sdk/ampleforth'); const { deployContract, deployProxyAdminContract, - deployProxyContract, + deployProxyContract } = require('../contracts'); -async function deployAMPLTestnetContracts( +async function deployAMPLTestnetContracts ( ethers, deployer, txParams = {}, @@ -64,7 +64,7 @@ async function deployAMPLTestnetContracts( deployer, [deployerAddress, ampl.address, AMPL_BASE_CPI.toString()], { - initializer: 'initialize(address,address,uint256)', + initializer: 'initialize(address,address,uint256)' }, txParams, waitBlocks, @@ -107,11 +107,11 @@ async function deployAMPLTestnetContracts( policy, orchestrator, rateOracle, - cpiOracle, + cpiOracle }; } -async function deployXCAmpleContracts( +async function deployXCAmpleContracts ( { tokenSymbol, tokenName, globalAmpleforthEpoch, globalAMPLSupply }, ethers, deployer, @@ -138,7 +138,7 @@ async function deployXCAmpleContracts( deployer, [xcAmple.address, globalAmpleforthEpoch], { - initializer: 'initialize(address,uint256)', + initializer: 'initialize(address,uint256)' }, txParams, waitBlocks, @@ -165,5 +165,5 @@ async function deployXCAmpleContracts( module.exports = { deployAMPLTestnetContracts, - deployXCAmpleContracts, + deployXCAmpleContracts }; diff --git a/helpers/deploy/arbitrum.js b/helpers/deploy/arbitrum.js index eda95b3..dcca650 100644 --- a/helpers/deploy/arbitrum.js +++ b/helpers/deploy/arbitrum.js @@ -1,6 +1,6 @@ const { deployContract } = require('../contracts'); -async function deployArbitrumBaseChainGatewayContracts( +async function deployArbitrumBaseChainGatewayContracts ( { ampl, policy, tokenVault }, ethers, deployer, @@ -17,7 +17,7 @@ async function deployArbitrumBaseChainGatewayContracts( ); const deployerAddress = await deployer.getAddress(); - if ((await tokenVault.owner()) == deployerAddress) { + if ((await tokenVault.owner()) === deployerAddress) { await ( await tokenVault.connect(deployer).addBridgeGateway(gateway.address) ).wait(waitBlocks); @@ -32,7 +32,7 @@ async function deployArbitrumBaseChainGatewayContracts( return { gateway }; } -async function deployArbitrumSatelliteChainGatewayContracts( +async function deployArbitrumSatelliteChainGatewayContracts ( { xcAmple, xcAmpleController }, ethers, deployer, @@ -49,7 +49,7 @@ async function deployArbitrumSatelliteChainGatewayContracts( ); const deployerAddress = await deployer.getAddress(); - if ((await xcAmpleController.owner()) == deployerAddress) { + if ((await xcAmpleController.owner()) === deployerAddress) { await ( await xcAmpleController .connect(deployer) @@ -68,5 +68,5 @@ async function deployArbitrumSatelliteChainGatewayContracts( module.exports = { deployArbitrumBaseChainGatewayContracts, - deployArbitrumSatelliteChainGatewayContracts, + deployArbitrumSatelliteChainGatewayContracts }; diff --git a/helpers/deploy/chain_bridge.js b/helpers/deploy/chain_bridge.js index fdd01d5..702b9c3 100644 --- a/helpers/deploy/chain_bridge.js +++ b/helpers/deploy/chain_bridge.js @@ -1,15 +1,15 @@ const { XC_REBASE_RESOURCE_ID, XC_TRANSFER_RESOURCE_ID, - CB_FUNCTION_SIG_baseChainReportRebase, - CB_FUNCTION_SIG_satelliteChainReportRebase, - CB_FUNCTION_SIG_baseChainTransfer, - CB_FUNCTION_SIG_satelliteChainTransfer, + CB_FUNCTION_SIG_BC_REPORT_REBASE, + CB_FUNCTION_SIG_SC_REPORT_REBASE, + CB_FUNCTION_SIG_BC_TRANSFER, + CB_FUNCTION_SIG_SC_TRANSFER } = require('../../sdk/chain_bridge'); const { deployContract } = require('../contracts'); -async function deployChainBridgeHelpers( +async function deployChainBridgeHelpers ( bridge, { chainId, relayers, relayerThreshold, fee, expiry }, ethers, @@ -27,11 +27,11 @@ async function deployChainBridgeHelpers( ); return { - batchRebaseReporter, + batchRebaseReporter }; } -async function deployChainBridgeContracts( +async function deployChainBridgeContracts ( { chainId, relayers, relayerThreshold, fee, expiry }, ethers, deployer, @@ -68,11 +68,11 @@ async function deployChainBridgeContracts( return { bridge, genericHandler, - ...helpers, + ...helpers }; } -async function deployChainBridgeBaseChainGatewayContracts( +async function deployChainBridgeBaseChainGatewayContracts ( { ampl, policy, bridge, genericHandler, tokenVault }, ethers, deployer, @@ -100,8 +100,7 @@ async function deployChainBridgeBaseChainGatewayContracts( const adminRole = await bridge.DEFAULT_ADMIN_ROLE(); const isAdmin = await bridge.hasRole(adminRole, deployerAddress); - const reportRebaseFnSig = - CB_FUNCTION_SIG_baseChainReportRebase(rebaseGateway); + const reportRebaseFnSig = CB_FUNCTION_SIG_BC_REPORT_REBASE(rebaseGateway); if (isAdmin) { await ( @@ -124,11 +123,11 @@ async function deployChainBridgeBaseChainGatewayContracts( genericHandler.address, XC_REBASE_RESOURCE_ID, rebaseGateway.address, - ...reportRebaseFnSig, + ...reportRebaseFnSig ]); } - const transferFnSig = CB_FUNCTION_SIG_baseChainTransfer(transferGateway); + const transferFnSig = CB_FUNCTION_SIG_BC_TRANSFER(transferGateway); if (isAdmin) { await ( await bridge @@ -150,11 +149,11 @@ async function deployChainBridgeBaseChainGatewayContracts( genericHandler.address, XC_TRANSFER_RESOURCE_ID, transferGateway.address, - ...transferFnSig, + ...transferFnSig ]); } - if ((await tokenVault.owner()) == deployerAddress) { + if ((await tokenVault.owner()) === deployerAddress) { await ( await tokenVault .connect(deployer) @@ -171,7 +170,7 @@ async function deployChainBridgeBaseChainGatewayContracts( return { rebaseGateway, transferGateway }; } -async function deployChainBridgeSatelliteChainGatewayContracts( +async function deployChainBridgeSatelliteChainGatewayContracts ( { xcAmple, xcAmpleController, bridge, genericHandler }, ethers, deployer, @@ -210,8 +209,7 @@ async function deployChainBridgeSatelliteChainGatewayContracts( const adminRole = await bridge.DEFAULT_ADMIN_ROLE(); const isAdmin = await bridge.hasRole(adminRole, await deployer.getAddress()); - const reportRebaseFnSig = - CB_FUNCTION_SIG_satelliteChainReportRebase(rebaseGateway); + const reportRebaseFnSig = CB_FUNCTION_SIG_SC_REPORT_REBASE(rebaseGateway); if (isAdmin) { await ( await bridge.adminSetGenericResource( @@ -231,11 +229,11 @@ async function deployChainBridgeSatelliteChainGatewayContracts( genericHandler.address, XC_REBASE_RESOURCE_ID, rebaseGateway.address, - ...reportRebaseFnSig, + ...reportRebaseFnSig ]); } - const transferFnSig = CB_FUNCTION_SIG_satelliteChainTransfer(transferGateway); + const transferFnSig = CB_FUNCTION_SIG_SC_TRANSFER(transferGateway); if (isAdmin) { await ( await bridge.adminSetGenericResource( @@ -255,7 +253,7 @@ async function deployChainBridgeSatelliteChainGatewayContracts( genericHandler.address, XC_TRANSFER_RESOURCE_ID, transferGateway.address, - ...transferFnSig, + ...transferFnSig ]); } @@ -266,5 +264,5 @@ module.exports = { deployChainBridgeContracts, deployChainBridgeHelpers, deployChainBridgeBaseChainGatewayContracts, - deployChainBridgeSatelliteChainGatewayContracts, + deployChainBridgeSatelliteChainGatewayContracts }; diff --git a/helpers/deploy/index.js b/helpers/deploy/index.js index 7b94ec1..c228915 100644 --- a/helpers/deploy/index.js +++ b/helpers/deploy/index.js @@ -9,5 +9,5 @@ module.exports = { ...vault, ...chainBridge, ...matic, - ...arbitrum, + ...arbitrum }; diff --git a/helpers/deploy/matic.js b/helpers/deploy/matic.js index 28e3598..c35c487 100644 --- a/helpers/deploy/matic.js +++ b/helpers/deploy/matic.js @@ -1,6 +1,6 @@ const { deployContract } = require('../contracts'); -async function deployMaticBaseChainGatewayContracts( +async function deployMaticBaseChainGatewayContracts ( { ampl, policy, tokenVault, checkpointManagerAddress, fxRootAddress }, ethers, deployer, @@ -25,7 +25,7 @@ async function deployMaticBaseChainGatewayContracts( ); const deployerAddress = await deployer.getAddress(); - if ((await tokenVault.owner()) == deployerAddress) { + if ((await tokenVault.owner()) === deployerAddress) { await ( await tokenVault.connect(deployer).addBridgeGateway(rebaseGateway.address) ).wait(waitBlocks); @@ -46,7 +46,7 @@ async function deployMaticBaseChainGatewayContracts( return { rebaseGateway, transferGateway }; } -async function deployMaticSatelliteChainGatewayContracts( +async function deployMaticSatelliteChainGatewayContracts ( { xcAmple, xcAmpleController, fxChildAddress }, ethers, deployer, @@ -71,7 +71,7 @@ async function deployMaticSatelliteChainGatewayContracts( ); const deployerAddress = await deployer.getAddress(); - if ((await xcAmpleController.owner()) == deployerAddress) { + if ((await xcAmpleController.owner()) === deployerAddress) { await ( await xcAmpleController .connect(deployer) @@ -96,5 +96,5 @@ async function deployMaticSatelliteChainGatewayContracts( module.exports = { deployMaticBaseChainGatewayContracts, - deployMaticSatelliteChainGatewayContracts, + deployMaticSatelliteChainGatewayContracts }; diff --git a/helpers/deploy/vault.js b/helpers/deploy/vault.js index 0de056e..196eb7f 100644 --- a/helpers/deploy/vault.js +++ b/helpers/deploy/vault.js @@ -1,6 +1,6 @@ const { deployContract } = require('../contracts'); -async function deployTokenVault( +async function deployTokenVault ( ethers, deployer, txParams = {}, @@ -19,5 +19,5 @@ async function deployTokenVault( } module.exports = { - deployTokenVault, + deployTokenVault }; diff --git a/helpers/tasks.js b/helpers/tasks.js index ec4dd16..65cc2f0 100644 --- a/helpers/tasks.js +++ b/helpers/tasks.js @@ -2,7 +2,7 @@ const fs = require('fs'); const { types } = require('hardhat/config'); const { task } = require('hardhat/config'); -function txTask(name, desc) { +function txTask (name, desc) { return task(name, desc) .addParam('gasPrice', 'Gas price for the transaction', 0, types.int) .addParam('gasLimit', 'Gas limit for the transaction', 7000000, types.int) @@ -11,7 +11,7 @@ function txTask(name, desc) { .addParam('passphrase', 'The passphrase to unlock keyfile'); } -function cbDeployTask(name, desc) { +function cbDeployTask (name, desc) { return txTask(name, desc) .addOptionalParam('chainId', 'Chain ID for the instance', 100, types.int) .addOptionalParam( @@ -40,14 +40,14 @@ function cbDeployTask(name, desc) { ); } -function loadSignerSync(args, provider) { - return ethers.Wallet.fromEncryptedJsonSync( +function loadSignerSync (args, provider) { + return hre.ethers.Wallet.fromEncryptedJsonSync( fs.readFileSync(args.keyfile), args.passphrase, ).connect(provider); } -async function etherscanVerify(hre, address, constructorArguments = []) { +async function etherscanVerify (hre, address, constructorArguments = []) { try { await hre.run('verify:verify', { address, constructorArguments }); } catch (e) { @@ -61,5 +61,5 @@ module.exports = { txTask, cbDeployTask, loadSignerSync, - etherscanVerify, + etherscanVerify }; diff --git a/helpers/utils.js b/helpers/utils.js index bb38673..58c1dee 100644 --- a/helpers/utils.js +++ b/helpers/utils.js @@ -1,20 +1,21 @@ +const path = require('path'); const fetch = require('node-fetch'); const yaml = require('js-yaml'); const ethers = require('ethers'); -const HARDHAT_CONFIG_PATH = __dirname + '/../hardhat.config.js'; +const HARDHAT_CONFIG_PATH = path.join(__dirname, '/../hardhat.config.js'); -const sleep = (timeSec) => { +const sleep = timeSec => { console.log('Sleeping', timeSec); - return new Promise((r) => setTimeout(r, timeSec * 1000)); + return new Promise(resolve => setTimeout(resolve, timeSec * 1000)); }; -const fetchAndParseYAML = async (url) => { +const fetchAndParseYAML = async url => { const r = await fetch(url); return yaml.load(await r.text()); }; -const getEthersProvider = (network) => { +const getEthersProvider = network => { const hhConfig = require(HARDHAT_CONFIG_PATH); return new ethers.providers.JsonRpcProvider(hhConfig.networks[network].url); }; @@ -22,5 +23,5 @@ const getEthersProvider = (network) => { module.exports = { sleep, fetchAndParseYAML, - getEthersProvider, + getEthersProvider }; diff --git a/package.json b/package.json index fc3d59f..4fd9dc4 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "compile": "yarn hardhat compile", "coverage": "yarn hardhat coverage --testfiles 'test/unit/**/*.js'", "format": "yarn prettier --config .prettierrc --write '**/*.js' 'contracts/**/*.sol'", - "lint": "yarn solhint 'contracts/**/*.sol' && yarn eslint ./test *.js --cache --fix", + "lint": "yarn solhint 'contracts/**/*.sol' && yarn eslint '**/*.js' --cache --fix", "profile": "REPORT_GAS=true yarn hardhat test", "test": "yarn hardhat test", "test-ganache": "yarn hardhat test --network ganache" @@ -19,8 +19,6 @@ ], "dependencies": { "@maticnetwork/maticjs": "https://github.com/maticnetwork/matic.js.git#2.0.43", - "@openzeppelin/contracts": "^3.4.0", - "@openzeppelin/contracts-upgradeable": "^3.3.0", "@openzeppelin/upgrades": "^2.8.0", "arb-bridge-eth": "https://gitpkg.now.sh/OffchainLabs/arbitrum/packages/arb-bridge-eth", "arb-bridge-peripherals": "https://gitpkg.now.sh/OffchainLabs/arbitrum/packages/arb-bridge-peripherals", @@ -29,7 +27,9 @@ "chainbridge-solidity": "https://github.com/meterio/chainbridge-solidity-v1.0.0-eth#6b02b0a52ce7e3967feeffbe6a6440a5b1006aec", "fx-portal": "fx-portal/contracts#v1.0.1", "market-oracle": "https://github.com/ampleforth/market-oracle#v1.0.1", - "uFragments": "https://github.com/ampleforth/ampleforth-contracts#v1.2.0" + "openzeppelin-contracts-3.4.1": "https://github.com/OpenZeppelin/openzeppelin-contracts.git#3.4.1", + "openzeppelin-contracts-upgradeable-3.3.0": "https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable.git#3.3.0", + "ampleforth-contracts": "https://github.com/ampleforth/ampleforth-contracts#v1.2.0" }, "devDependencies": { "@nomiclabs/hardhat-ethers": "^2.0.1", diff --git a/sdk/ampleforth.js b/sdk/ampleforth.js index 22b72df..42988b1 100644 --- a/sdk/ampleforth.js +++ b/sdk/ampleforth.js @@ -3,13 +3,13 @@ const BigNumber = require('bignumber.js'); const AMPL_DECIMALS = 9; -const toAmplFloatingPt = (ample) => +const toAmplFloatingPt = ample => ethers.utils.formatUnits( `${ample.toFixed ? ample.toFixed(AMPL_DECIMALS) : ample}`, AMPL_DECIMALS, ); -const toAmplFixedPt = (ample) => +const toAmplFixedPt = ample => ethers.utils.parseUnits( `${ample.toFixed ? ample.toFixed(AMPL_DECIMALS) : ample}`, AMPL_DECIMALS, @@ -57,5 +57,5 @@ module.exports = { AMPL_BASE_CPI, printRebaseInfo, - execRebase, + execRebase }; diff --git a/sdk/chain_bridge.js b/sdk/chain_bridge.js index ab1356f..b4ac95b 100644 --- a/sdk/chain_bridge.js +++ b/sdk/chain_bridge.js @@ -4,7 +4,7 @@ const AbiCoder = ethers.utils.defaultAbiCoder; const getFunctionSignature = (contract, functionName) => { const functions = contract.interface.functions; const selected = Object.keys(functions).filter( - (f) => functions[f].name === functionName, + f => functions[f].name === functionName, )[0]; return contract.interface.getSighash(functions[selected]); }; @@ -13,7 +13,7 @@ const toHex = (covertThis, padding) => { return ethers.utils.hexZeroPad(ethers.utils.hexlify(covertThis), padding); }; -const createResourceID = (d) => { +const createResourceID = d => { const hash = ethers.utils.keccak256( ethers.utils.solidityPack(['string'], [d]), ); @@ -30,40 +30,40 @@ const XC_TRANSFER_RESOURCE_ID = createResourceID( const CB_BLANK_FUNCTION_SIG = '0x00000000'; -const CB_FUNCTION_SIG_baseChainReportRebase = (gatewayContract) => { +const CB_FUNCTION_SIG_BC_REPORT_REBASE = gatewayContract => { return [ getFunctionSignature(gatewayContract, 'validateRebaseReport'), 0, - CB_BLANK_FUNCTION_SIG, + CB_BLANK_FUNCTION_SIG ]; }; -const CB_FUNCTION_SIG_satelliteChainReportRebase = (gatewayContract) => { +const CB_FUNCTION_SIG_SC_REPORT_REBASE = gatewayContract => { return [ CB_BLANK_FUNCTION_SIG, 0, - getFunctionSignature(gatewayContract, 'reportRebase'), + getFunctionSignature(gatewayContract, 'reportRebase') ]; }; -const CB_FUNCTION_SIG_baseChainTransfer = (gatewayContract) => { +const CB_FUNCTION_SIG_BC_TRANSFER = gatewayContract => { return [ getFunctionSignature(gatewayContract, 'validateAndLock'), 12, - getFunctionSignature(gatewayContract, 'unlock'), + getFunctionSignature(gatewayContract, 'unlock') ]; }; -const CB_FUNCTION_SIG_satelliteChainTransfer = (gatewayContract) => { +const CB_FUNCTION_SIG_SC_TRANSFER = gatewayContract => { return [ getFunctionSignature(gatewayContract, 'validateAndBurn'), // https://github.com/ChainSafe/chainbridge-solidity/blob/master/contracts/handlers/GenericHandler.sol#L170 12, // Padding for the depositor address validation - getFunctionSignature(gatewayContract, 'mint'), + getFunctionSignature(gatewayContract, 'mint') ]; }; -const createGenericDepositData = (hexMetaData) => { +const createGenericDepositData = hexMetaData => { if (hexMetaData === null) { return '0x' + toHex(0, 32).substr(2); } @@ -111,7 +111,7 @@ const executeXCRebase = async ( ); const txR = await tx.wait(); - const depositEvent = txR.events.filter((e) => e.event == 'Deposit')[0]; + const depositEvent = txR.events.filter(e => e.event === 'Deposit')[0]; const depositNonce = depositEvent.args.depositNonce; const resourceID = depositEvent.args.resourceID; @@ -151,7 +151,7 @@ const executeXCTransfer = async ( ); const txR = await tx.wait(); - const depositEvent = txR.events.filter((e) => e.event == 'Deposit')[0]; + const depositEvent = txR.events.filter(e => e.event === 'Deposit')[0]; const depositNonce = depositEvent.args.depositNonce; const resourceID = depositEvent.args.resourceID; @@ -165,11 +165,11 @@ module.exports = { XC_REBASE_RESOURCE_ID, XC_TRANSFER_RESOURCE_ID, - CB_FUNCTION_SIG_baseChainReportRebase, - CB_FUNCTION_SIG_satelliteChainReportRebase, - CB_FUNCTION_SIG_baseChainTransfer, - CB_FUNCTION_SIG_satelliteChainTransfer, + CB_FUNCTION_SIG_BC_REPORT_REBASE, + CB_FUNCTION_SIG_SC_REPORT_REBASE, + CB_FUNCTION_SIG_BC_TRANSFER, + CB_FUNCTION_SIG_SC_TRANSFER, executeXCRebase, - executeXCTransfer, + executeXCTransfer }; diff --git a/tasks/deploy/ampleforth.js b/tasks/deploy/ampleforth.js index 2ad5fc7..5588bfc 100644 --- a/tasks/deploy/ampleforth.js +++ b/tasks/deploy/ampleforth.js @@ -1,34 +1,30 @@ +const { types } = require('hardhat/config'); const { task, txTask, loadSignerSync, - etherscanVerify, + etherscanVerify } = require('../../helpers/tasks'); const { fetchAndParseYAML, getEthersProvider } = require('../../helpers/utils'); const { getCompiledContractFactory, getDeployedContractInstance, writeBulkDeploymentData, - writeDeploymentData, - deployContract, - deployProxyAdminContract, - deployProxyContract, + writeDeploymentData } = require('../../helpers/contracts'); const { deployAMPLTestnetContracts, deployXCAmpleContracts, - deployTokenVault, + deployTokenVault } = require('../../helpers/deploy'); const { - AMPL_BASE_RATE, - AMPL_BASE_CPI, execRebase, printRebaseInfo, - toAmplFixedPt, + toAmplFixedPt } = require('../../sdk/ampleforth'); -//https://raw.githubusercontent.com/ampleforth/uFragments-eth-integration/master/migrations/deployments/mainnet-prod.yaml?token=ABPZMDSUSVNH45HUWCMM3R3AJDVOW +// https://raw.githubusercontent.com/ampleforth/uFragments-eth-integration/master/migrations/deployments/mainnet-prod.yaml?token=ABPZMDSUSVNH45HUWCMM3R3AJDVOW task( 'deploy:use_deployed', 'Generates deployment files for a deployed instance of Ampleforth', @@ -60,24 +56,24 @@ task( isBaseChain: true, ampl: { address: addresses.UFragments, - abi: UFragments.interface.format(), + abi: UFragments.interface.format() }, policy: { address: addresses.UFragmentsPolicy, - abi: UFragmentsPolicy.interface.format(), + abi: UFragmentsPolicy.interface.format() }, orchestrator: { address: addresses.Orchestrator, - abi: Orchestrator.interface.format(), + abi: Orchestrator.interface.format() }, rateOracle: { address: addresses.RateOracle, - abi: MedianOracle.interface.format(), + abi: MedianOracle.interface.format() }, cpiOracle: { address: addresses.CpiOracle, - abi: MedianOracle.interface.format(), - }, + abi: MedianOracle.interface.format() + } }); }); @@ -91,7 +87,7 @@ txTask('testnet:deploy:ampleforth', 'Deploy ampleforth contract suite') .addParam('amount', 'Amount of ampl to transfer', 0, types.float) .setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } @@ -146,7 +142,7 @@ txTask('deploy:ampleforth_xc', 'Deploy cross chain ampleforth contract suite') .addParam('tokenName', 'The symbol of the cross-chain ample ERC-20 token') .setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } // const txParams = {} @@ -192,7 +188,7 @@ txTask('deploy:ampleforth_xc', 'Deploy cross chain ampleforth contract suite') ); await writeDeploymentData(hre.network.name, 'rebaseRelayer', rebaseRelayer); await writeBulkDeploymentData(hre.network.name, { - isBaseChain: false, + isBaseChain: false }); console.log('------------------------------------------------------------'); @@ -213,7 +209,7 @@ txTask('deploy:token_vault', 'Deploy the token vault contract on base chain') .addParam('bridge', 'The bridge which secures the vault') .setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } diff --git a/tasks/deploy/arbitrum.js b/tasks/deploy/arbitrum.js index bccbcc5..bd92497 100644 --- a/tasks/deploy/arbitrum.js +++ b/tasks/deploy/arbitrum.js @@ -3,20 +3,17 @@ const { hexDataLength } = require('@ethersproject/bytes'); const { txTask, loadSignerSync, - etherscanVerify, + etherscanVerify } = require('../../helpers/tasks'); const { getEthersProvider } = require('../../helpers/utils'); const { getDeployedContractInstance, - readDeploymentData, - writeDeploymentData, - writeBulkDeploymentData, - getCompiledContractFactory, + writeDeploymentData } = require('../../helpers/contracts'); const { deployArbitrumBaseChainGatewayContracts, - deployArbitrumSatelliteChainGatewayContracts, + deployArbitrumSatelliteChainGatewayContracts } = require('../../helpers/deploy'); txTask( @@ -24,13 +21,12 @@ txTask( 'Deploys the chain gateway on the base chain', ).setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } const deployer = loadSignerSync(args, hre.ethers.provider); const deployerAddress = await deployer.getAddress(); - const chainAddresses = await readDeploymentData(hre.network.name); console.log('------------------------------------------------------------'); console.log('Deploying contracts on base-chain'); @@ -59,7 +55,7 @@ txTask( { ampl, policy, - tokenVault, + tokenVault }, hre.ethers, deployer, @@ -85,7 +81,7 @@ txTask( await etherscanVerify(hre, gateway.address, [ ampl.address, policy.address, - tokenVault.address, + tokenVault.address ]); }); @@ -95,13 +91,12 @@ txTask( ).setAction(async (args, hre) => { // NOTE: gas estimation is off on arbitrum // const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - // if (txParams.gasPrice == 0) { + // if (txParams.gasPrice === 0) { // txParams.gasPrice = await hre.ethers.provider.getGasPrice(); // } const txParams = {}; const deployer = loadSignerSync(args, hre.ethers.provider); const deployerAddress = await deployer.getAddress(); - const chainAddresses = await readDeploymentData(hre.network.name); console.log('------------------------------------------------------------'); console.log('Deploying contracts on satellite-chain'); @@ -145,7 +140,7 @@ txTask( console.log('Verify on etherscan'); await etherscanVerify(hre, gateway.address, [ xcAmple.address, - xcAmpleController.address, + xcAmpleController.address ]); }); @@ -166,7 +161,7 @@ txTask('deploy:arbitrum_connection', 'Connects the two gateway contracts') ) .setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } @@ -230,7 +225,7 @@ txTask('deploy:arbitrum_register_testnet', 'Registers the token to the router') ) .setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } @@ -249,16 +244,16 @@ txTask('deploy:arbitrum_register_testnet', 'Registers the token to the router') { internalType: 'uint256', name: '_maxSubmissionCost', - type: 'uint256', - }, + type: 'uint256' + } ], name: 'setGateway', outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }], stateMutability: 'payable', - type: 'function', - }, + type: 'function' + } ]; - const router = new ethers.Contract( + const router = new hre.ethers.Contract( args.baseRouter, routerABI, hre.ethers.provider, @@ -277,13 +272,14 @@ txTask('deploy:arbitrum_register_testnet', 'Registers the token to the router') ); const arb = await Bridge.init(baseChainSigner, satChainSigner); - const fnDataBytes = ethers.utils.defaultAbiCoder.encode( + const fnDataBytes = hre.ethers.utils.defaultAbiCoder.encode( ['address', 'uint256', 'uint256', 'uint256'], [baseGateway.address, '0', '0', '0'], ); const fnBytesLength = hexDataLength(fnDataBytes) + 4; - const [_submissionPriceWei, nextUpdateTimestamp] = - await arb.l2Bridge.getTxnSubmissionPrice(fnBytesLength); + const [_submissionPriceWei] = await arb.l2Bridge.getTxnSubmissionPrice( + fnBytesLength, + ); const submissionPriceWei = _submissionPriceWei.mul(5); // buffer can be reduced const maxGas = 500000; const gasPriceBid = await satChainProvider.getGasPrice(); @@ -300,7 +296,7 @@ txTask('deploy:arbitrum_register_testnet', 'Registers the token to the router') .connect(baseChainSigner) .externalCall(ptx.to, ptx.data, callValue, { ...txParams, - value: callValue, + value: callValue }); console.log(tx.hash); diff --git a/tasks/deploy/chain_bridge.js b/tasks/deploy/chain_bridge.js index c802383..46e0fc4 100644 --- a/tasks/deploy/chain_bridge.js +++ b/tasks/deploy/chain_bridge.js @@ -4,31 +4,30 @@ const { txTask, cbDeployTask, loadSignerSync, - etherscanVerify, + etherscanVerify } = require('../../helpers/tasks'); const { getEthersProvider } = require('../../helpers/utils'); const { getDeployedContractInstance, - readDeploymentData, writeDeploymentData, writeBulkDeploymentData, - getCompiledContractFactory, + getCompiledContractFactory } = require('../../helpers/contracts'); const { deployChainBridgeContracts, deployChainBridgeHelpers, deployChainBridgeBaseChainGatewayContracts, - deployChainBridgeSatelliteChainGatewayContracts, + deployChainBridgeSatelliteChainGatewayContracts } = require('../../helpers/deploy'); const { XC_REBASE_RESOURCE_ID, XC_TRANSFER_RESOURCE_ID, - CB_FUNCTION_SIG_baseChainReportRebase, - CB_FUNCTION_SIG_satelliteChainReportRebase, - CB_FUNCTION_SIG_baseChainTransfer, - CB_FUNCTION_SIG_satelliteChainTransfer, + CB_FUNCTION_SIG_BC_REPORT_REBASE, + CB_FUNCTION_SIG_SC_REPORT_REBASE, + CB_FUNCTION_SIG_BC_TRANSFER, + CB_FUNCTION_SIG_SC_TRANSFER } = require('../../sdk/chain_bridge'); task( @@ -49,14 +48,14 @@ task( await writeBulkDeploymentData(hre.network.name, { 'chainBridge/bridge': { address: args.bridgeAddress, - abi: Bridge.interface.format(), - }, + abi: Bridge.interface.format() + } }); await writeBulkDeploymentData(hre.network.name, { 'chainBridge/genericHandler': { address: args.genericHandlerAddress, - abi: GenericHandler.interface.format(), - }, + abi: GenericHandler.interface.format() + } }); }); @@ -67,19 +66,18 @@ cbDeployTask( .addParam('useDeployed', 'Use deployed bridge', false, types.boolean) .setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } const deployer = loadSignerSync(args, hre.ethers.provider); const deployerAddress = await deployer.getAddress(); - const chainAddresses = await readDeploymentData(hre.network.name); console.log('------------------------------------------------------------'); console.log('Deploying contracts on base-chain'); console.log('Deployer:', deployerAddress); console.log(txParams); - let bridge, genericHandler, erc20Handler, erc721Handler; + let bridge, genericHandler; if (args.useDeployed) { console.log('Using deployed bridge'); @@ -139,7 +137,7 @@ cbDeployTask( genericHandler, ampl, policy, - tokenVault, + tokenVault }, hre.ethers, deployer, @@ -178,7 +176,7 @@ cbDeployTask( [], await bridge._relayerThreshold(), await bridge._fee(), - await bridge._expiry(), + await bridge._expiry() ]); await etherscanVerify(hre, genericHandler.address, [ bridge.address, @@ -186,19 +184,19 @@ cbDeployTask( [], [], [], - [], + [] ]); await etherscanVerify(hre, transferGateway.address, [ genericHandler.address, ampl.address, policy.address, - tokenVault.address, + tokenVault.address ]); await etherscanVerify(hre, rebaseGateway.address, [ genericHandler.address, ampl.address, policy.address, - tokenVault.address, + tokenVault.address ]); await etherscanVerify(hre, batchRebaseReporter.address); }); @@ -210,19 +208,18 @@ cbDeployTask( .addParam('useDeployed', 'Use deployed bridge', false, types.boolean) .setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } const deployer = loadSignerSync(args, hre.ethers.provider); const deployerAddress = await deployer.getAddress(); - const chainAddresses = await readDeploymentData(hre.network.name); console.log('------------------------------------------------------------'); console.log('Deploying contracts on satellite-chain'); console.log('Deployer:', deployerAddress); console.log(txParams); - let bridge, genericHandler, erc20Handler, erc721Handler; + let bridge, genericHandler; if (args.useDeployed) { console.log('Using deployed bridge'); @@ -294,7 +291,7 @@ cbDeployTask( [], await bridge._relayerThreshold(), await bridge._fee(), - await bridge._expiry(), + await bridge._expiry() ]); await etherscanVerify(hre, genericHandler.address, [ bridge.address, @@ -302,17 +299,17 @@ cbDeployTask( [], [], [], - [], + [] ]); await etherscanVerify(hre, transferGateway.address, [ genericHandler.address, xcAmple.address, - xcAmpleController.address, + xcAmpleController.address ]); await etherscanVerify(hre, rebaseGateway.address, [ genericHandler.address, xcAmple.address, - xcAmpleController.address, + xcAmpleController.address ]); }); @@ -333,7 +330,7 @@ txTask( const network = hre.network.name; const provider = hre.ethers.provider; const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await provider.getGasPrice(); } @@ -361,9 +358,8 @@ txTask( // Base chain const adminRole = await bridge.DEFAULT_ADMIN_ROLE(); const isAdmin = await bridge.hasRole(adminRole, deployerAddress); - const reportRebaseFnSig = - CB_FUNCTION_SIG_baseChainReportRebase(rebaseGateway); - const transferFnSig = CB_FUNCTION_SIG_baseChainTransfer(transferGateway); + const reportRebaseFnSig = CB_FUNCTION_SIG_BC_REPORT_REBASE(rebaseGateway); + const transferFnSig = CB_FUNCTION_SIG_BC_TRANSFER(transferGateway); if (isAdmin) { await ( @@ -395,23 +391,23 @@ txTask( genericHandler.address, XC_REBASE_RESOURCE_ID, rebaseGateway.address, - ...reportRebaseFnSig, + ...reportRebaseFnSig ]); console.log('adminSetGenericResource', [ genericHandler.address, XC_TRANSFER_RESOURCE_ID, transferGateway.address, - ...transferFnSig, + ...transferFnSig ]); } // sat chains - for (let n in args.satelliteChainNetworks) { + for (const n in args.satelliteChainNetworks) { const network = args.satelliteChainNetworks[n]; const provider = await getEthersProvider(network); const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await provider.getGasPrice(); } @@ -437,10 +433,8 @@ txTask( ); const adminRole = await bridge.DEFAULT_ADMIN_ROLE(); const isAdmin = await bridge.hasRole(adminRole, deployerAddress); - const reportRebaseFnSig = - CB_FUNCTION_SIG_satelliteChainReportRebase(rebaseGateway); - const transferFnSig = - CB_FUNCTION_SIG_satelliteChainTransfer(transferGateway); + const reportRebaseFnSig = CB_FUNCTION_SIG_SC_REPORT_REBASE(rebaseGateway); + const transferFnSig = CB_FUNCTION_SIG_SC_TRANSFER(transferGateway); if (isAdmin) { await ( @@ -471,13 +465,13 @@ txTask( genericHandler.address, XC_REBASE_RESOURCE_ID, rebaseGateway.address, - ...reportRebaseFnSig, + ...reportRebaseFnSig ]); console.log('adminSetGenericResource', [ genericHandler.address, XC_TRANSFER_RESOURCE_ID, transferGateway.address, - ...transferFnSig, + ...transferFnSig ]); } } diff --git a/tasks/deploy/matic.js b/tasks/deploy/matic.js index ba3930b..edb9885 100644 --- a/tasks/deploy/matic.js +++ b/tasks/deploy/matic.js @@ -1,21 +1,17 @@ const { txTask, loadSignerSync, - etherscanVerify, + etherscanVerify } = require('../../helpers/tasks'); const { getEthersProvider } = require('../../helpers/utils'); const { - deployContract, getDeployedContractInstance, - readDeploymentData, - writeDeploymentData, - writeBulkDeploymentData, - getCompiledContractFactory, + writeDeploymentData } = require('../../helpers/contracts'); const { deployMaticBaseChainGatewayContracts, - deployMaticSatelliteChainGatewayContracts, + deployMaticSatelliteChainGatewayContracts } = require('../../helpers/deploy'); txTask( @@ -26,12 +22,11 @@ txTask( .addParam('fxRoot', 'The address of the matic fx root') .setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } const deployer = loadSignerSync(args, hre.ethers.provider); const deployerAddress = await deployer.getAddress(); - const chainAddresses = await readDeploymentData(hre.network.name); console.log('------------------------------------------------------------'); console.log('Deploying contracts on base-chain'); @@ -63,7 +58,7 @@ txTask( policy, tokenVault, checkpointManagerAddress: args.checkpointManager, - fxRootAddress: args.fxRoot, + fxRootAddress: args.fxRoot }, hre.ethers, deployer, @@ -90,13 +85,13 @@ txTask( args.checkpointManager, args.fxRoot, ampl.address, - tokenVault.address, + tokenVault.address ]); await etherscanVerify(hre, rebaseGateway.address, [ args.checkpointManager, args.fxRoot, ampl.address, - policy.address, + policy.address ]); }); @@ -107,12 +102,11 @@ txTask( .addParam('fxChild', 'The address of the matic fx child') .setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } const deployer = loadSignerSync(args, hre.ethers.provider); const deployerAddress = await deployer.getAddress(); - const chainAddresses = await readDeploymentData(hre.network.name); console.log('------------------------------------------------------------'); console.log('Deploying contracts on satellite-chain'); @@ -158,12 +152,12 @@ txTask( await etherscanVerify(hre, transferGateway.address, [ args.fxChild, xcAmple.address, - xcAmpleController.address, + xcAmpleController.address ]); await etherscanVerify(hre, rebaseGateway.address, [ args.fxChild, xcAmple.address, - xcAmpleController.address, + xcAmpleController.address ]); }); @@ -175,7 +169,7 @@ txTask('deploy:matic_connection', 'Connects the two gateway contracts') ) .setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } diff --git a/tasks/deploy/rebase_reporter.js b/tasks/deploy/rebase_reporter.js index 46cce43..541a1a2 100644 --- a/tasks/deploy/rebase_reporter.js +++ b/tasks/deploy/rebase_reporter.js @@ -1,14 +1,13 @@ +const { types } = require('hardhat/config'); const { - task, txTask, loadSignerSync, - etherscanVerify, + etherscanVerify } = require('../../helpers/tasks'); const { - getCompiledContractFactory, getDeployedContractInstance, writeDeploymentData, - deployContract, + deployContract } = require('../../helpers/contracts'); const { getEthersProvider } = require('../../helpers/utils'); const { XC_REBASE_RESOURCE_ID } = require('../../sdk/chain_bridge'); @@ -18,7 +17,7 @@ txTask( 'Deploy batch rebase reporter utility', ).setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } @@ -32,7 +31,7 @@ txTask( console.log('------------------------------------------------------------'); console.log('Deploying batchRebaseReporter on base chain'); const batchRebaseReporter = await deployContract( - ethers, + hre.ethers, 'BatchTxCaller', deployer, [], @@ -72,16 +71,15 @@ txTask( ) .setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } const deployer = await loadSignerSync(args, hre.ethers.provider); const deployerAddress = await deployer.getAddress(); - - let txDestination; - let txValue; - let txData; + console.log('------------------------------------------------------------'); + console.log('Deployer:', deployerAddress); + console.log(txParams); const baseChainNetwork = hre.network.name; const baseChainProvider = hre.ethers.provider; @@ -92,31 +90,26 @@ txTask( ); // group sat networks by bridge - const bridgeNetowrks = {}; + const bridgeNetworks = {}; for (const n in args.satelliteChainNetworks) { const network = args.satelliteChainNetworks[n]; const bridge = args.bridges[n]; - if (!bridgeNetowrks[bridge]) { - bridgeNetowrks[bridge] = []; + if (!bridgeNetworks[bridge]) { + bridgeNetworks[bridge] = []; } - bridgeNetowrks[bridge].push(network); + bridgeNetworks[bridge].push(network); } // Iterate through sat chains // group by bridge type and build tx const transactions = []; - for (const b in bridgeNetowrks) { - if (b == 'chainBridge') { + for (const b in bridgeNetworks) { + if (b === 'chainBridge') { const baseChainBridge = await getDeployedContractInstance( baseChainNetwork, 'chainBridge/bridge', baseChainProvider, ); - const baseChainGenericHandler = await getDeployedContractInstance( - baseChainNetwork, - 'chainBridge/genericHandler', - baseChainProvider, - ); const cbBatchRebaseReporter = await getDeployedContractInstance( baseChainNetwork, 'chainBridge/batchRebaseReporter', @@ -125,8 +118,8 @@ txTask( const satelliteChainIDs = []; let totalFee = hre.ethers.BigNumber.from('0'); - for (const n in bridgeNetowrks[b]) { - const network = bridgeNetowrks[b][n]; + for (const n in bridgeNetworks[b]) { + const network = bridgeNetworks[b][n]; const provider = await getEthersProvider(network); const satelliteChainBridge = await getDeployedContractInstance( network, @@ -149,9 +142,9 @@ txTask( transactions.push({ destination: cbBatchRebaseReporter.address, data: tx.data, - value: totalFee.toString(), + value: totalFee.toString() }); - } else if (b == 'matic') { + } else if (b === 'matic') { const rebaseGateway = await getDeployedContractInstance( baseChainNetwork, `${b}/rebaseGateway`, @@ -162,7 +155,7 @@ txTask( transactions.push({ destination: rebaseGateway.address, data: tx.data, - value: '0', + value: '0' }); } else { console.error('Invalid bridge reference'); diff --git a/tasks/info/ampl.js b/tasks/info/ampl.js index 2844b51..691b2dd 100644 --- a/tasks/info/ampl.js +++ b/tasks/info/ampl.js @@ -1,14 +1,14 @@ -const ethers = require('ethers'); +const { types } = require('hardhat/config'); const { getAdminAddress, - getImplementationAddress, + getImplementationAddress } = require('@openzeppelin/upgrades-core'); const { task } = require('../../helpers/tasks'); const { getEthersProvider } = require('../../helpers/utils'); const { readDeploymentData, - getDeployedContractInstance, + getDeployedContractInstance } = require('../../helpers/contracts'); const { toAmplFloatingPt } = require('../../sdk/ampleforth'); @@ -17,7 +17,7 @@ task('info:ampl', 'Prints AMPL token data from given networks') .addParam('networks', 'List of hardhat networks', [], types.json) .addParam('bridge', 'Name of the bridge') .setAction(async (args, hre) => { - for (let n in args.networks) { + for (const n in args.networks) { const network = args.networks[n]; const chainAddresses = await readDeploymentData(network); const provider = getEthersProvider(network); @@ -85,7 +85,7 @@ task('info:ampl:balance', 'Prints AMPL token balance from given networks') .addParam('networks', 'List of hardhat networks', [], types.json) .addParam('wallet', 'The wallet to check') .setAction(async (args, hre) => { - for (let n in args.networks) { + for (const n in args.networks) { const network = args.networks[n]; const chainAddresses = await readDeploymentData(network); const provider = getEthersProvider(network); @@ -110,6 +110,7 @@ task('info:ampl:balance', 'Prints AMPL token balance from given networks') const [globalAmpleforthEpoch, globalAMPLSupply] = await policy.globalAmpleforthEpochAndAMPLSupply(); const balance = await ampl.balanceOf(args.wallet); + console.log('Global epoch:', globalAmpleforthEpoch.toString()); console.log('Global supply:', toAmplFloatingPt(globalAMPLSupply)); console.log(`Balance(${args.wallet}):`, toAmplFloatingPt(balance)); } else { @@ -126,6 +127,7 @@ task('info:ampl:balance', 'Prints AMPL token balance from given networks') const [globalAmpleforthEpoch, globalAMPLSupply] = await xcAmpleController.globalAmpleforthEpochAndAMPLSupply(); const balance = await xcAmple.balanceOf(args.wallet); + console.log('Global epoch:', globalAmpleforthEpoch.toString()); console.log('Global supply:', toAmplFloatingPt(globalAMPLSupply)); console.log(`Balance(${args.wallet}):`, toAmplFloatingPt(balance)); } @@ -139,7 +141,7 @@ task( ) .addParam('networks', 'List of hardhat networks', [], types.json) .setAction(async (args, hre) => { - for (let n in args.networks) { + for (const n in args.networks) { const network = args.networks[n]; const chainAddresses = await readDeploymentData(network); const provider = getEthersProvider(network); @@ -212,7 +214,7 @@ task( } console.log('ProxyAdmin:', proxyAdmin.address); - console.log('ProxyAdmin:onwer', await proxyAdmin.owner()); + console.log('ProxyAdmin:owner', await proxyAdmin.owner()); console.log('XCAmple:', xcAmple.address); console.log( 'XCAmple:proxyAdmin', diff --git a/tasks/info/cb_ampl_tx.js b/tasks/info/cb_ampl_tx.js index 8eb9484..c6adc5a 100644 --- a/tasks/info/cb_ampl_tx.js +++ b/tasks/info/cb_ampl_tx.js @@ -1,4 +1,5 @@ const ethers = require('ethers'); +const { types } = require('hardhat/config'); const _ = require('underscore'); const { task } = require('../../helpers/tasks'); @@ -6,7 +7,7 @@ const { getEthersProvider } = require('../../helpers/utils'); const { readDeploymentData, getDeployedContractInstance, - filterContractEvents, + filterContractEvents } = require('../../helpers/contracts'); const { XC_TRANSFER_RESOURCE_ID } = require('../../sdk/chain_bridge'); @@ -23,7 +24,7 @@ task( let allTransferIns = []; let allTransferProposals = []; - for (let n in args.networks) { + for (const n in args.networks) { const network = args.networks[n]; const chainAddresses = await readDeploymentData(network); const provider = getEthersProvider(network); @@ -49,12 +50,6 @@ task( const chainID = await bridge._chainID(); - const handler = await getDeployedContractInstance( - network, - 'chainBridge/genericHandler', - provider, - ); - const gateway = await getDeployedContractInstance( network, 'chainBridge/transferGateway', @@ -95,7 +90,7 @@ task( endBlock, queryTimeFrame, ); - deposits = _.map(deposits, (d) => { + deposits = _.map(deposits, d => { d.originChainID = chainID; return d; }); @@ -111,7 +106,7 @@ task( endBlock, queryTimeFrame, ); - proposals = _.map(proposals, (d) => { + proposals = _.map(proposals, d => { d.destinationChainID = chainID; return d; }); @@ -124,11 +119,11 @@ task( } // Filter - allTransferDeposits = allTransferDeposits.filter((d) => { - return d.parsed.args.resourceID == XC_TRANSFER_RESOURCE_ID; + allTransferDeposits = allTransferDeposits.filter(d => { + return d.parsed.args.resourceID === XC_TRANSFER_RESOURCE_ID; }); - allTransferProposals = allTransferProposals.filter((d) => { - return d.parsed.args.resourceID == XC_TRANSFER_RESOURCE_ID; + allTransferProposals = allTransferProposals.filter(d => { + return d.parsed.args.resourceID === XC_TRANSFER_RESOURCE_ID; }); const fs = require('fs'); @@ -160,7 +155,7 @@ task( const transferPhase1 = _.chain(allTransferOuts) .concat(allTransferDeposits) - .groupBy((d) => d.transactionHash) + .groupBy(d => d.transactionHash) .pick((v, k) => xcDepositTxHashesLookup[k]) .map((v, k) => { return { @@ -177,7 +172,7 @@ task( 'resourceID', 'depositNonce', ), - originChainID: v[1].originChainID, + originChainID: v[1].originChainID }; }) .reduce((m, v) => { @@ -197,7 +192,7 @@ task( const transferPhase2 = _.chain(allTransferIns) .concat(allTransferProposals) - .groupBy((d) => d.transactionHash) + .groupBy(d => d.transactionHash) .pick((v, k) => xcProposalTxHashesLookup[k]) .map((v, k) => { return { @@ -215,7 +210,7 @@ task( 'resourceID', 'depositNonce', ), - destinationChainID: v[v.length - 1].destinationChainID, + destinationChainID: v[v.length - 1].destinationChainID }; }) .reduce((m, v) => { @@ -236,13 +231,13 @@ task( recipient: p.recipient, proposalTransactionHash: p.transactionHash, - recievedAmount: p.amount ? p.amount.toString() : '0', + receivedAmount: p.amount ? p.amount.toString() : '0', totalSupplyOnSource: p.recordedGlobalAMPLSupply ? p.recordedGlobalAMPLSupply.toString() : '0', totalSupplyOnTarget: p.globalAMPLSupply ? p.globalAMPLSupply.toString() - : '0', + : '0' }; }) .values() @@ -259,10 +254,10 @@ task( { id: 'totalSupplyAtDeposit', title: 'totalSupplyAtDeposit' }, { id: 'recipient', title: 'recipient' }, { id: 'proposalTransactionHash', title: 'proposalTransactionHash' }, - { id: 'recievedAmount', title: 'recievedAmount' }, + { id: 'receivedAmount', title: 'receivedAmount' }, { id: 'totalSupplyOnSource', title: 'totalSupplyOnSource' }, - { id: 'totalSupplyOnTarget', title: 'totalSupplyOnTarget' }, - ], + { id: 'totalSupplyOnTarget', title: 'totalSupplyOnTarget' } + ] }); await csvWriter.writeRecords(dt); console.log('Output written to :', args.outputCsvPath); diff --git a/tasks/info/chain_bridge.js b/tasks/info/chain_bridge.js index 7258ca9..bca7e2b 100644 --- a/tasks/info/chain_bridge.js +++ b/tasks/info/chain_bridge.js @@ -1,57 +1,58 @@ const ethers = require('ethers'); +const { types } = require('hardhat/config'); const { task } = require('../../helpers/tasks'); const { getEthersProvider } = require('../../helpers/utils'); const { readDeploymentData, - getDeployedContractInstance, + getDeployedContractInstance } = require('../../helpers/contracts'); class BridgeData { - constructor() { + constructor () { this.depositData = {}; this.deposits = {}; this.proposals = {}; this.votes = {}; } - load(chainID, deposits, proposals, votes) { + load (chainID, deposits, proposals, votes) { this.deposits[chainID] = deposits; this.proposals[chainID] = proposals; this.votes[chainID] = votes; } - rollupData() { + rollupData () { const chains = Object.keys(this.deposits); for (const c in chains) { const chainID = chains[c]; - this.deposits[chainID].map((d) => this.recordDeposit(chainID, d)); + this.deposits[chainID].map(d => this.recordDeposit(chainID, d)); } for (const c in chains) { const chainID = chains[c]; - this.proposals[chainID].map((d) => this.recordProposal(d)); + this.proposals[chainID].map(d => this.recordProposal(d)); } for (const c in chains) { const chainID = chains[c]; - this.votes[chainID].map((d) => this.recordVote(d)); + this.votes[chainID].map(d => this.recordVote(d)); } } - depositKey(sourceChainID, e) { + depositKey (sourceChainID, e) { return `${sourceChainID}-${e.depositNonce.toNumber()}`; } - recordDeposit(sourceChainID, e) { + recordDeposit (sourceChainID, e) { this.depositData[this.depositKey(sourceChainID, e)] = { sourceChainID, destinationChainID: e.destinationChainID.toString(), depositNonce: e.depositNonce.toString(), executionStatus: 0, - votes: 0, + votes: 0 }; } - recordProposal(e) { + recordProposal (e) { const k = this.depositKey(e.originChainID, e); let d = this.depositData[k]; if (!d) { @@ -59,13 +60,13 @@ class BridgeData { sourceChainID: e.originChainID, depositNonce: e.depositNonce.toString(), executionStatus: 0, - votes: 0, + votes: 0 }; } d.executionStatus = e.status; } - recordVote(e) { + recordVote (e) { const k = this.depositKey(e.originChainID, e); const d = this.depositData[k]; d.votes++; @@ -75,10 +76,9 @@ class BridgeData { task('info:chain_bridge', 'Prints AMPL token data from given networks') .addParam('networks', 'List of hardhat networks', [], types.json) .setAction(async (args, hre) => { - const bridgeData = {}; const bd = new BridgeData(); - for (let n in args.networks) { + for (const n in args.networks) { const network = args.networks[n]; const chainAddresses = await readDeploymentData(network); const provider = getEthersProvider(network); @@ -120,14 +120,14 @@ task('info:chain_bridge', 'Prints AMPL token data from given networks') chainAddresses['chainBridge/bridge'].blockNumber, ); const depositLogs = await bridge.queryFilter('Deposit', startBlock); - const deposits = depositLogs.map((d) => d.args); + const deposits = depositLogs.map(d => d.args); const proposalLogs = await bridge.queryFilter( 'ProposalEvent', startBlock, ); - const proposals = proposalLogs.map((d) => d.args); + const proposals = proposalLogs.map(d => d.args); const voteLogs = await bridge.queryFilter('ProposalVote', startBlock); - const votes = voteLogs.map((d) => d.args); + const votes = voteLogs.map(d => d.args); bd.load(chainID, deposits, proposals, votes); } diff --git a/tasks/info/config.js b/tasks/info/config.js index 15e0c82..52babf2 100644 --- a/tasks/info/config.js +++ b/tasks/info/config.js @@ -1,24 +1,16 @@ -const { - types, - task, - txTask, - cbDeployTask, - loadSignerSync, -} = require('../../helpers/tasks'); +const { types, task } = require('../../helpers/tasks'); const { getEthersProvider } = require('../../helpers/utils'); const { - deployContract, getDeployedContractInstance, - readDeploymentData, - writeDeploymentData, + readDeploymentData } = require('../../helpers/contracts'); -task('config:chain_bridge', 'Generates chian_bridge config file') +task('config:chain_bridge', 'Generates chain_bridge config file') .addParam('networks', 'List of hardhat networks', [], types.json) .addParam('relayerAddress', 'Address of the relayer') .setAction(async (args, hre) => { const chains = []; - for (let n in args.networks) { + for (const n in args.networks) { const network = args.networks[n]; const chainAddresses = await readDeploymentData(network); const provider = getEthersProvider(network); @@ -40,8 +32,8 @@ task('config:chain_bridge', 'Generates chian_bridge config file') startBlock: `${( chainAddresses['chainBridge/bridge'].blockNumber || 0 ).toString()}`, - http: 'true', - }, + http: 'true' + } }); } const chainBridgeConfig = { chains }; diff --git a/tasks/ops/rebase.js b/tasks/ops/rebase.js index c38d865..8911ceb 100644 --- a/tasks/ops/rebase.js +++ b/tasks/ops/rebase.js @@ -3,21 +3,15 @@ const { getEthersProvider } = require('../../helpers/utils'); const { Bridge } = require('arb-ts'); const { hexDataLength } = require('@ethersproject/bytes'); -const { - readDeploymentData, - getDeployedContractInstance, -} = require('../../helpers/contracts'); -const { - executeXCRebase, - XC_REBASE_RESOURCE_ID, -} = require('../../sdk/chain_bridge'); +const { getDeployedContractInstance } = require('../../helpers/contracts'); +const { XC_REBASE_RESOURCE_ID } = require('../../sdk/chain_bridge'); const { printRebaseInfo, execRebase } = require('../../sdk/ampleforth'); txTask('testnet:rebase:base_chain', 'Executes rebase on the base chain') .addParam('rebasePerc', 'The rebase percentage to be applied', '0') .setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } const sender = await loadSignerSync(args, hre.ethers.provider); @@ -65,7 +59,7 @@ txTask( ) .setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } const sender = await loadSignerSync(args, hre.ethers.provider); @@ -87,11 +81,6 @@ txTask( 'chainBridge/bridge', baseChainProvider, ); - const baseChainGenericHandler = await getDeployedContractInstance( - baseChainNetwork, - 'chainBridge/genericHandler', - baseChainProvider, - ); const batchRebaseReporter = await getDeployedContractInstance( baseChainNetwork, 'chainBridge/batchRebaseReporter', @@ -99,8 +88,8 @@ txTask( ); const satelliteChainIDs = []; - let totalFee = BigNumber.from('0'); - for (let n in args.satelliteChainNetworks) { + let totalFee = hre.ethers.BigNumber.from('0'); + for (const n in args.satelliteChainNetworks) { const network = args.satelliteChainNetworks[n]; const provider = await getEthersProvider(network); const satelliteChainBridge = await getDeployedContractInstance( @@ -134,7 +123,7 @@ txTask( 'Reports most recent rebase to bridge on base chain to the matic satellite chain', ).setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } const sender = await loadSignerSync(args, hre.ethers.provider); @@ -165,7 +154,7 @@ txTask( ) .setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } const sender = await loadSignerSync(args, hre.ethers.provider); @@ -193,13 +182,14 @@ txTask( ); const arb = await Bridge.init(baseChainSigner, satChainSigner); - const fnDataBytes = ethers.utils.defaultAbiCoder.encode( + const fnDataBytes = hre.ethers.utils.defaultAbiCoder.encode( ['uint256', 'uint256'], await policy.globalAmpleforthEpochAndAMPLSupply(), ); const fnBytesLength = hexDataLength(fnDataBytes) + 4; - const [_submissionPriceWei, nextUpdateTimestamp] = - await arb.l2Bridge.getTxnSubmissionPrice(fnBytesLength); + const [_submissionPriceWei] = await arb.l2Bridge.getTxnSubmissionPrice( + fnBytesLength, + ); const submissionPriceWei = _submissionPriceWei.mul(5); // buffer can be reduced const maxGas = 200000; const gasPriceBid = await satChainProvider.getGasPrice(); @@ -226,13 +216,12 @@ txTask( ) .setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } - for (let n in args.networks) { + for (const n in args.networks) { const network = args.networks[n]; - const chainAddresses = await readDeploymentData(network); const provider = await getEthersProvider(network); const sender = await loadSignerSync(args, provider); diff --git a/tasks/ops/xc_transfer.js b/tasks/ops/xc_transfer.js index 2fee3ec..22684fc 100644 --- a/tasks/ops/xc_transfer.js +++ b/tasks/ops/xc_transfer.js @@ -3,7 +3,7 @@ const { getEthersProvider } = require('../../helpers/utils'); const { readDeploymentData, - getDeployedContractInstance, + getDeployedContractInstance } = require('../../helpers/contracts'); const { executeXCTransfer } = require('../../sdk/chain_bridge'); const { toAmplFixedPt, printRebaseInfo } = require('../../sdk/ampleforth'); @@ -20,7 +20,7 @@ txTask( .addParam('targetChainNetwork', 'The hre network of target chain') .setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } const sender = await loadSignerSync(args, hre.ethers.provider); @@ -113,7 +113,7 @@ txTask('matic:xc_transfer', 'Executes cross chain transfer through matic') .addParam('amount', 'The amount of AMPL to transfer', 0, types.float) .setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } const sender = await loadSignerSync(args, hre.ethers.provider); @@ -176,7 +176,7 @@ txTask( const satChainProvider = getEthersProvider(args.satChainNetwork); const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await baseChainProvider.getGasPrice(); } const sender = await loadSignerSync(args, baseChainProvider); @@ -189,11 +189,12 @@ txTask( baseChainProvider, ); - const maticPOSClient = new require('@maticnetwork/maticjs').MaticPOSClient({ + const maticjs = require('@maticnetwork/maticjs'); + const maticPOSClient = new maticjs.MaticPOSClient({ network: baseChainProvider.includes('prod') ? 'mainnet' : 'testnet', version: baseChainProvider.includes('prod') ? 'v1' : 'mumbai', maticProvider: satChainProvider.connection.url, - parentProvider: baseChainProvider.connection.url, + parentProvider: baseChainProvider.connection.url }); const proof = await maticPOSClient.posRootChainManager.customPayload( diff --git a/tasks/upgrade.js b/tasks/upgrade.js index 019ce9a..c739dfa 100644 --- a/tasks/upgrade.js +++ b/tasks/upgrade.js @@ -1,9 +1,6 @@ const { types } = require('hardhat/config'); const { txTask, loadSignerSync, etherscanVerify } = require('../helpers/tasks'); -const { - getDeployedContractInstance, - upgradeProxyContract, -} = require('../helpers/contracts'); +const { upgradeProxyContract } = require('../helpers/contracts'); txTask( 'upgrade:xc_ample', @@ -12,7 +9,7 @@ txTask( .addParam('force', 'Skip storage layout verification', false, types.boolean) .setAction(async (args, hre) => { const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit }; - if (txParams.gasPrice == 0) { + if (txParams.gasPrice === 0) { txParams.gasPrice = await hre.ethers.provider.getGasPrice(); } diff --git a/test/unit/base-chain/bridge-gateways/ampl_arbitrum_gateway.js b/test/unit/base-chain/bridge-gateways/ampl_arbitrum_gateway.js index e29a976..f42f718 100644 --- a/test/unit/base-chain/bridge-gateways/ampl_arbitrum_gateway.js +++ b/test/unit/base-chain/bridge-gateways/ampl_arbitrum_gateway.js @@ -44,7 +44,7 @@ async function setupContracts () { .deploy(); const uFragmentsFactory = await ethers.getContractFactory( - 'uFragments/contracts/UFragments.sol:UFragments', + 'ampleforth-contracts/contracts/UFragments.sol:UFragments', ); ampl = await upgrades.deployProxy( uFragmentsFactory.connect(deployer), diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..c0b1e42 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "es5", + "module": "commonjs", + "strict": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "downlevelIteration": true, + "outDir": "dist" + }, + "include": ["./helpers","./sdk", "./tasks", "./test"], + "files": [ + "hardhat.config.ts", + "./node_modules/@nomiclabs/hardhat-ethers/src/type-extensions.ts", + "./node_modules/@nomiclabs/hardhat-waffle/src/type-extensions.ts", + "./node_modules/@openzeppelin/hardhat-upgrades/src/type-extensions.ts" + ] +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index df7142d..b2d818c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -935,12 +935,12 @@ resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.4.1.tgz#3382db2cd83ab565ed9626765e7da92944b45de8" integrity sha512-o+pHCf/yMLSlV5MkDQEzEQL402i6SoRnktru+0rdSxVEFZcTzzGhZCAtZjUFyKGazMSv1TilzMg+RbED1N8XHQ== -"@openzeppelin/contracts-upgradeable@3.4.2", "@openzeppelin/contracts-upgradeable@^3.3.0": +"@openzeppelin/contracts-upgradeable@3.4.2": version "3.4.2" resolved "https://registry.yarnpkg.com/@openzeppelin/contracts-upgradeable/-/contracts-upgradeable-3.4.2.tgz#2c2a1b0fa748235a1f495b6489349776365c51b3" integrity sha512-mDlBS17ymb2wpaLcrqRYdnBAmP1EwqhOXMvqWk2c5Q1N1pm5TkiCtXM9Xzznh4bYsQBq0aIWEkFFE2+iLSN1Tw== -"@openzeppelin/contracts@3.4.2", "@openzeppelin/contracts@^3.4.0": +"@openzeppelin/contracts@3.4.2": version "3.4.2" resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-3.4.2.tgz#d81f786fda2871d1eb8a8c5a73e455753ba53527" integrity sha512-z0zMCjyhhp4y7XKAcDAi3Vgms4T2PstwBdahiO0+9NaGICQKjynK3wduSRplTgk4LXmoO1yfDGO5RbjKYxtuxA== @@ -1304,9 +1304,9 @@ form-data "^3.0.0" "@types/node@*": - version "17.0.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.0.tgz#62797cee3b8b497f6547503b2312254d4fe3c2bb" - integrity sha512-eMhwJXc931Ihh4tkU+Y7GiLzT/y/DBNpNtr4yU9O2w3SYBsr9NaOPhQlLKRmoWtI54uNwuo0IOUFQjVOTZYRvw== + version "17.0.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.1.tgz#88d501e84b6185f6489ecee4ba9e8fcec7f29bb2" + integrity sha512-NXKvBVUzIbs6ylBwmOwHFkZS2EXCcjnqr8ZCRNaXBkHAf+3mn/rPcJxwrzuc6movh8fxQAsUUfYklJ/EG+hZqQ== "@types/node@^10.0.3", "@types/node@^10.12.18", "@types/node@^10.3.2": version "10.17.60" @@ -1319,9 +1319,9 @@ integrity sha512-i1KGxqcvJaLQali+WuypQnXwcplhtNtjs66eNsZpp2P2FL/trJJxx/VWsM0YCL2iMoIJrbXje48lvIQAQ4p2ZA== "@types/node@^14.0.13", "@types/node@^14.6.1": - version "14.18.0" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.0.tgz#98df2397f6936bfbff4f089e40e06fa5dd88d32a" - integrity sha512-0GeIl2kmVMXEnx8tg1SlG6Gg8vkqirrW752KqolYo1PHevhhZN3bhJ67qHj+bQaINhX0Ra3TlWwRvMCd9iEfNQ== + version "14.18.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.1.tgz#459886b51f52aa923dc06b9ea81cb8b1d733e9d3" + integrity sha512-fTFWOFrgAkj737w1o0HLTIgisgYHnsZfeiqhG1Ltrf/iJjudEbUwetQAsfrtVE49JGwvpEzQR+EbMkIqG4227g== "@types/node@^8.0.0": version "8.10.66" @@ -1551,6 +1551,12 @@ amdefine@>=0.0.4: resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" integrity sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU= +"ampleforth-contracts@https://github.com/ampleforth/ampleforth-contracts#v1.2.0": + version "0.0.1" + resolved "https://github.com/ampleforth/ampleforth-contracts#cd85ba13a3550ab8fba980ef0349483b32b2c3a9" + dependencies: + "@openzeppelin/contracts" "^4.3.0" + ansi-colors@3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-3.2.3.tgz#57d35b8686e851e2cc04c403f1c00203976a1813" @@ -2526,23 +2532,7 @@ bn.js@^5.0.0, bn.js@^5.1.1, bn.js@^5.1.2, bn.js@^5.1.3, bn.js@^5.2.0: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.0.tgz#358860674396c6997771a9d051fcc1b57d4ae002" integrity sha512-D7iWRBvnZE8ecXiLj/9wbxH7Tk79fAh8IHaTNq1RWRixsS02W+5qS+iE9yq6RYl0asXx5tw0bLhmT5pIfbSquw== -body-parser@1.19.0: - version "1.19.0" - resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" - integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== - dependencies: - bytes "3.1.0" - content-type "~1.0.4" - debug "2.6.9" - depd "~1.1.2" - http-errors "1.7.2" - iconv-lite "0.4.24" - on-finished "~2.3.0" - qs "6.7.0" - raw-body "2.4.0" - type-is "~1.6.17" - -body-parser@^1.16.0: +body-parser@1.19.1, body-parser@^1.16.0: version "1.19.1" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.1.tgz#1499abbaa9274af3ecc9f6f10396c995943e31d4" integrity sha512-8ljfQi5eBk8EJfECMrgqNGWPEY5jWP+1IzkzkGdFFEwFQZZyaZ21UqdaHktgiMlH0xLHqIFtE/u2OYE5dOtViA== @@ -2747,11 +2737,6 @@ builtin-modules@^1.1.1: resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= -bytes@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" - integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== - bytes@3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.1.tgz#3f018291cb4cbad9accb6e6970bca9c8889e879a" @@ -2863,9 +2848,9 @@ camelcase@^5.0.0: integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== caniuse-lite@^1.0.30000844: - version "1.0.30001287" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001287.tgz#5fab6a46ab9e47146d5dd35abfe47beaf8073c71" - integrity sha512-4udbs9bc0hfNrcje++AxBuc6PfLNHwh3PO9kbwnfCQWyqtlzg3py0YgFu8jyRTTo85VAz4U+VLxSlID09vNtWA== + version "1.0.30001291" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001291.tgz#08a8d2cfea0b2cf2e1d94dd795942d0daef6108c" + integrity sha512-roMV5V0HNGgJ88s42eE70sstqGW/gwFndosYrikHthw98N5tLnOTxFqMLQjZVRxTWFlJ4rn+MsgXrR7MDPY4jA== caseless@^0.12.0, caseless@~0.12.0: version "0.12.0" @@ -3229,12 +3214,12 @@ contains-path@^0.1.0: resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a" integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo= -content-disposition@0.5.3: - version "0.5.3" - resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" - integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== +content-disposition@0.5.4: + version "0.5.4" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.4.tgz#8b82b4efac82512a02bb0b1dcec9d2c5e8eb5bfe" + integrity sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ== dependencies: - safe-buffer "5.1.2" + safe-buffer "5.2.1" content-hash@^2.5.2: version "2.5.2" @@ -3262,12 +3247,7 @@ cookie-signature@1.0.6: resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= -cookie@0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" - integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== - -cookie@^0.4.1: +cookie@0.4.1, cookie@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.1.tgz#afd713fe26ebd21ba95ceb61f9a8116e50a537d1" integrity sha512-ZwrFkGJxUR3EIoXtO+yVE69Eb7KlixbaeAWfBQB9vVsNn/o+Yw69gBWSSDK825hQNdN+wF8zELf3dFNl/kxkUA== @@ -3771,9 +3751,9 @@ ee-first@1.1.1: integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= electron-to-chromium@^1.3.47: - version "1.4.20" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.20.tgz#8fbf9677ccac19b4249c0a6204e0943d9d66ce30" - integrity sha512-N7ZVNrdzX8NE90OXEFBMsBf3fp8P/vVDUER3WCUZjzC7OkNTXHVoF6W9qVhq8+dA8tGnbDajzUpj2ISNVVyj+Q== + version "1.4.24" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.24.tgz#9cf8a92d5729c480ee47ff0aa5555f57467ae2fa" + integrity sha512-erwx5r69B/WFfFuF2jcNN0817BfDBdC4765kQ6WltOMuwsimlQo3JTEq0Cle+wpHralwdeX3OfAtw/mHxPK0Wg== elliptic@6.3.3: version "6.3.3" @@ -4919,16 +4899,16 @@ expand-brackets@^2.1.4: to-regex "^3.0.1" express@^4.14.0: - version "4.17.1" - resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" - integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== + version "4.17.2" + resolved "https://registry.yarnpkg.com/express/-/express-4.17.2.tgz#c18369f265297319beed4e5558753cc8c1364cb3" + integrity sha512-oxlxJxcQlYwqPWKVJJtvQiwHgosH/LrLSPA+H4UxpyvSS6jC5aH+5MoHFM+KABgTOt0APue4w66Ha8jCUo9QGg== dependencies: accepts "~1.3.7" array-flatten "1.1.1" - body-parser "1.19.0" - content-disposition "0.5.3" + body-parser "1.19.1" + content-disposition "0.5.4" content-type "~1.0.4" - cookie "0.4.0" + cookie "0.4.1" cookie-signature "1.0.6" debug "2.6.9" depd "~1.1.2" @@ -4942,13 +4922,13 @@ express@^4.14.0: on-finished "~2.3.0" parseurl "~1.3.3" path-to-regexp "0.1.7" - proxy-addr "~2.0.5" - qs "6.7.0" + proxy-addr "~2.0.7" + qs "6.9.6" range-parser "~1.2.1" - safe-buffer "5.1.2" - send "0.17.1" - serve-static "1.14.1" - setprototypeof "1.1.1" + safe-buffer "5.2.1" + send "0.17.2" + serve-static "1.14.2" + setprototypeof "1.2.0" statuses "~1.5.0" type-is "~1.6.18" utils-merge "1.0.1" @@ -6032,17 +6012,6 @@ http-cache-semantics@^4.0.0: resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390" integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ== -http-errors@1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" - integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== - dependencies: - depd "~1.1.2" - inherits "2.0.3" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - http-errors@1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.8.1.tgz#7c3f28577cbc8a207388455dbd62295ed07bd68c" @@ -6054,17 +6023,6 @@ http-errors@1.8.1: statuses ">= 1.5.0 < 2" toidentifier "1.0.1" -http-errors@~1.7.2: - version "1.7.3" - resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" - integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== - dependencies: - depd "~1.1.2" - inherits "2.0.4" - setprototypeof "1.1.1" - statuses ">= 1.5.0 < 2" - toidentifier "1.0.0" - http-https@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/http-https/-/http-https-1.0.0.tgz#2f908dd5f1db4068c058cd6e6d4ce392c913389b" @@ -6136,9 +6094,9 @@ ignore@^4.0.6: integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== ignore@^5.1.1: - version "5.1.9" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.9.tgz#9ec1a5cbe8e1446ec60d4420060d43aa6e7382fb" - integrity sha512-2zeMQpbKz5dhZ9IwL0gbxSW5w0NK/MSAMtNuhgIHEPmaU3vPdKPL0UdvUCXs5SS4JAwsBxysK5sFMW8ocFiVjQ== + version "5.2.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" + integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== immediate@^3.2.3: version "3.3.0" @@ -6194,11 +6152,6 @@ inherits@2, inherits@2.0.4, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, i resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== -inherits@2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= - ini@^1.3.5: version "1.3.8" resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" @@ -7673,7 +7626,7 @@ ms@2.1.2: resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== -ms@^2.1.1: +ms@2.1.3, ms@^2.1.1: version "2.1.3" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2" integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA== @@ -7905,7 +7858,12 @@ object-copy@^0.1.0: define-property "^0.2.5" kind-of "^3.0.3" -object-inspect@^1.11.0, object-inspect@^1.9.0, object-inspect@~1.11.0: +object-inspect@^1.11.0, object-inspect@^1.9.0: + version "1.12.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.0.tgz#6e2c120e868fd1fd18cb4f18c31741d0d6e776f0" + integrity sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g== + +object-inspect@~1.11.0: version "1.11.1" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.11.1.tgz#d4bd7d7de54b9a75599f59a00bd698c1f1c6549b" integrity sha512-If7BjFlpkzzBeV1cqgT3OSWT3azyoxDGajR+iGnFBfVV2EWyDyWaZZW2ERDjUaY2QM8i5jI3Sj7mhsM4DDAqWA== @@ -8026,6 +7984,14 @@ open@^7.4.2: is-docker "^2.0.0" is-wsl "^2.1.1" +"openzeppelin-contracts-3.4.1@https://github.com/OpenZeppelin/openzeppelin-contracts.git#3.4.1": + version "3.4.1" + resolved "https://github.com/OpenZeppelin/openzeppelin-contracts.git#cec0800c541c809f883a37f2dfb91ec4c90263c5" + +"openzeppelin-contracts-upgradeable-3.3.0@https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable.git#3.3.0": + version "3.3.0" + resolved "https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable.git#c0b9fd6e81c00000dc0749aa116a7735f0d35fe3" + openzeppelin-solidity@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/openzeppelin-solidity/-/openzeppelin-solidity-2.0.1.tgz#c58ab35e2aa6268308a9a9a7d19475e2ce7a7b22" @@ -8489,7 +8455,7 @@ proper-lockfile@^4.1.1: retry "^0.12.0" signal-exit "^3.0.2" -proxy-addr@~2.0.5: +proxy-addr@~2.0.7: version "2.0.7" resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.7.tgz#f19fe69ceab311eeb94b42e70e8c2070f9ba1025" integrity sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg== @@ -8595,11 +8561,6 @@ punycode@^2.1.0, punycode@^2.1.1: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== -qs@6.7.0: - version "6.7.0" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" - integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== - qs@6.9.6: version "6.9.6" resolved "https://registry.yarnpkg.com/qs/-/qs-6.9.6.tgz#26ed3c8243a431b2924aca84cc90471f35d5a0ee" @@ -8665,16 +8626,6 @@ range-parser@~1.2.1: resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== -raw-body@2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" - integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== - dependencies: - bytes "3.1.0" - http-errors "1.7.2" - iconv-lite "0.4.24" - unpipe "1.0.0" - raw-body@2.4.2, raw-body@^2.4.1: version "2.4.2" resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.2.tgz#baf3e9c21eebced59dd6533ac872b71f7b61cb32" @@ -9094,16 +9045,16 @@ rxjs@^6.4.0: dependencies: tslib "^1.9.0" -safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: - version "5.1.2" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" - integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== - -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: +safe-buffer@5.2.1, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.1, safe-buffer@^5.1.2, safe-buffer@^5.2.0, safe-buffer@^5.2.1, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== +safe-buffer@~5.1.0, safe-buffer@~5.1.1: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + safe-event-emitter@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/safe-event-emitter/-/safe-event-emitter-1.0.1.tgz#5b692ef22329ed8f69fdce607e50ca734f6f20af" @@ -9244,10 +9195,10 @@ semver@~5.4.1: resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e" integrity sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg== -send@0.17.1: - version "0.17.1" - resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" - integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== +send@0.17.2: + version "0.17.2" + resolved "https://registry.yarnpkg.com/send/-/send-0.17.2.tgz#926622f76601c41808012c8bf1688fe3906f7820" + integrity sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww== dependencies: debug "2.6.9" depd "~1.1.2" @@ -9256,22 +9207,22 @@ send@0.17.1: escape-html "~1.0.3" etag "~1.8.1" fresh "0.5.2" - http-errors "~1.7.2" + http-errors "1.8.1" mime "1.6.0" - ms "2.1.1" + ms "2.1.3" on-finished "~2.3.0" range-parser "~1.2.1" statuses "~1.5.0" -serve-static@1.14.1: - version "1.14.1" - resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" - integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== +serve-static@1.14.2: + version "1.14.2" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.2.tgz#722d6294b1d62626d41b43a013ece4598d292bfa" + integrity sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ== dependencies: encodeurl "~1.0.2" escape-html "~1.0.3" parseurl "~1.3.3" - send "0.17.1" + send "0.17.2" servify@^0.1.12: version "0.1.12" @@ -9314,11 +9265,6 @@ setimmediate@^1.0.5: resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285" integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU= -setprototypeof@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" - integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== - setprototypeof@1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.2.0.tgz#66c9a24a73f9fc28cbe66b09fed3d33dcaf1b424" @@ -10190,11 +10136,6 @@ to-regex@^3.0.1, to-regex@^3.0.2: regex-not "^1.0.2" safe-regex "^1.1.0" -toidentifier@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" - integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== - toidentifier@1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.1.tgz#3be34321a88a820ed1bd80dfaa33e479fbb8dd35" @@ -10344,7 +10285,7 @@ type-fest@^0.7.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.7.1.tgz#8dda65feaf03ed78f0a3f9678f1869147f7c5c48" integrity sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg== -type-is@~1.6.17, type-is@~1.6.18: +type-is@~1.6.18: version "1.6.18" resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== @@ -10427,12 +10368,6 @@ typical@^2.6.0, typical@^2.6.1: resolved "https://registry.yarnpkg.com/typical/-/typical-2.6.1.tgz#5c080e5d661cbbe38259d2e70a3c7253e873881d" integrity sha1-XAgOXWYcu+OCWdLnCjxyU+hziB0= -"uFragments@https://github.com/ampleforth/ampleforth-contracts#v1.2.0": - version "0.0.1" - resolved "https://github.com/ampleforth/ampleforth-contracts#cd85ba13a3550ab8fba980ef0349483b32b2c3a9" - dependencies: - "@openzeppelin/contracts" "^4.3.0" - uglify-js@^3.1.4: version "3.14.5" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-3.14.5.tgz#cdabb7d4954231d80cb4a927654c4655e51f4859"