From 3d07a849a00832d4cad7ac6d56c9ab9d31b2e772 Mon Sep 17 00:00:00 2001 From: Luke Wickens <71776468+lbw33@users.noreply.github.com> Date: Thu, 29 Sep 2022 10:09:59 +0100 Subject: [PATCH] Merge from develop to master (#111) * Resolved merge conflicts * add diamond contract (#71) * add diamond contract * update compiler version in .solhint * typo * fix typo * Update package.json (#76) - Changed version to 1.8.0 * Fuse support to etherspot (#79) * PRO-295 setup constants and update package.json * PRO-295 Fuse Sparknet deployments * update version and add network details * update compiled code * FUSE mainnet deployments * Updated deployments Co-authored-by: zincoshine * Update package release (#80) * update release * change release number * Support for SuperTokens in BalancesHelperV2 contract (#68) (#81) * Mainnet deployments * 1.7.0 * Resolved merge conflicts Co-authored-by: Luke Wickens <71776468+lukewickens1989@users.noreply.github.com> Co-authored-by: Luke Wickens Co-authored-by: Parthasarathy Ramanujam Co-authored-by: Luke Wickens <71776468+lukewickens1989@users.noreply.github.com> Co-authored-by: Luke Wickens * integration of connext amarok (#74) * add diamond contract * add connext amarok integration * fix package-lock * Feature/pro 305 integrate layerzero stargate (#88) * WIP - Integration of Stargate - Smart contract being written, some issue with logic of swap fn call on IStargateRouter. - Added functionality into contract to be able to decide which router address to use on destination chain dynamically. - Reduced amount of accounts created in hardhat config as causing issues with forking newer blocks with alchemy (too many requests error). - Set up basic testing environment and added in some testing of functionality - 1 failing test due to issue with swap fn call failing to execute. - Added in x2 more utils, one to move forward blocks and another to move forward in time (secs). * Update StargateFacet.sol - Changed position of getStorage() in contract * WIP - Stargate integration - Smart contract written - Most functionality test except for the actual swap - some testing issues * Stargate bridging contract /w tests and deployment scripts - Stargate contract with preloaded existing pool information (for USDC, USDT and BUSD) - Complete test suite (tested swapping on two separate networks) - Deployment script * Added natspec comments to contract - Added natspec comments to StargateFacet.sol * Added sgRetrievePoolId fn to contract - sgRetrievePoolId replaces sgCheckPoolId functionality in sgBridgeTokens fn. Should now get the pool ids without having to be passed into fn - Added testing for new fn and ensured test suite still passing * Removed console.log contract import from facet * Removed console.log from smart contract * Modified ReentrancyGuard contract and moved - Changed the contract name to DiamondReentrancyGuard.sol - Moved the contract into common/helpers and updated the path in the facet - Amended the NAMESPACE constant to something that better reflects the code * Added ReentrancyGuard into Stargate facet to test typings issue * Typing issue resolved * Fixed issue with msg.value for swapping - Issue with msg.value and not using quoteLayerZeroFee for msg.value being passed in - FIXED * Removed payable from data struct to test backend issue * compiled and built * Some changes to facet contract and added tests - Changed sgCheckPoolId fn to external from public. - Added SPDX License to DiamondReentrancyGuard. - Added tests for StargateFacet to check for deducting from user balance correctly. - Ran slither on both StargateFacet and DiamondReentrancyGuard. - Documentation on facet added to README.md. Co-authored-by: Luke Wickens * update connext integration & make bridges contracts deployment separate (#90) * update connext integration & make bridges contracts deployment separate * feat: add hop protocol (#91) * Feature/pro 284 integration of cbridge (#78) * Structure setup Set up of contract and testing file and folder structure * cBridge smart contract and testing - Updated hardhat version to latest and added support for issue with EIP when testing. - Added hardhat-tracer plugin for extra visibility of events and transactions and EVM opcodes. - Added mainnet forking to hardhat.config to reduce testing deployments. - Added logic for cBridge integration in smart contract. - Added new test util for checking emitted event information. - Added new test util for checking last emitted event in a multicall function. - Tested smart contract. - Slither check performed. * Amended test suite to integrate diamond functionality - Integrated Diamond Proxy functionality into CBridgeFacet test suite. - Added in checks to ensure some contract functions can only be called by Diamond Proxy owner. - Created deployment script. - Removed 0.8.13 compiler version from hardhat.config as no longer used. - Turned off forking for deployment testing. - HH Addr: 0xD9a9Ee6B79fBa90dA738735C85bdAf43ae1E2B60 * Updated cBridgeFacet - Removed chainId from the contract and replaced with block.chainid and removed contract variable. - Amended test suite to reflect the changes. * Edited deployment script and tested CREATE2 deployment - Edited deployment script to reflect removal of chain id. - Tested deterministic deployment on Goerli, OptimismKovan & ArbitrumTest (0x3054F79f18AecC4aAe249fd9C8ca23D93d635504) * Fixed linting issue - Removed chainId variable from deployment script. * Smart contract and test suite changes - Added storage struct into smart contract. - Added namespace storage pointer. - Updated cBridge address updating function name to be more specific. - Updated test suite to reflect smart contract changes. * Replaced OpenZeppelin contracts - Removed imports from OpenZeppelin - Manually added contracts that were removed * Reinstated IERC20 OpenZeppelin import - Reinstated IERC20 OpenZeppelin import * Updated CBridgeFacet to include slippage - Added default slippage into facet - Added functionality to update slippage tolerance - Changed function and event names to relate more bridge type - Added SafeERC20 functionality for standard approvals and transfers - Removed need for LibAsset helper functions - Updated test suite to reflect changes and confirm all still passing - Added custom CBridge errors * Added further tests and amended deployment script to match contract changes - Added more revert requirements in cbBridgeTokens and added to test suite - Changed deployment script to match new initialise fn name - Added tests for cbWithdraw fn * Modified ReentrancyGuard contract and moved - Changed the contract name to DiamondReentrancyGuard.sol - Moved the contract into common/helpers and updated the path in the facet - Amended the NAMESPACE constant to something that better reflects the code * Updated typings - issue with pulling through Stargate typings * Fix for unneeded typings - Running 'npx hardhat coverage' seemed to remove unwanted typings * Update 204_deploy_cbridge_facet.ts - Changed tags on deployment script in line with new diamond deployments. * Removed receive fn from facet contract * Update StargateFacet.sol - Removed receive() from StargateFacet * Removal of withdraw from CBridge and Stargate facets - Removed withdraw fn from CBridge and Stargate facets - Updated test suite to remove testing for withdraw fn * Fix merge conflicts * Update hardhat.config.ts - Added new compiler version to hardhat.config to fix issue with @connext imported contracts * Update package-lock.json - Rerun of npm to install latest packages for connext libs * Updated connext lib * Removed 0.8.15 compiler version * Re-added 0.8.15 compiler version Co-authored-by: Luke Wickens * remove exceptions from deployments script (#99) * deploy diamond contracts to testnets (#101) deploy diamond contracts to testnets * Feature/pro 463 arbitrum nova support (#100) * Added Arbitrum Nova configs - Added config information for Arbitrum Nova * Added support for Arbitrum Nitro testnet (Goerli) * Deployed contracts to Arbitrum Nitro testnet - Deployed contracts to Arbitrum Nitro - Issues with Diamond deployment not following deterministic deployment * Amended deployment script for CBridge - Added in error handling if network is not supported * Reverted amendments to cbridge deployment script * Added deployment information for diamond contracts on Arbitrum Nitro * Added error handling for unsupported CBridge networks Co-authored-by: Luke Wickens * Deployed on Arbitrum Nova and removed deployments from .gitignore * Updated deployments * add diamond contracts deployments (#105) * Fix typo and bump version (#106) * recompile artifacts & bump version * Resolved merge conflict * Resolved merge conflicts * Changed package version number * Pipeline improvements (#109) * Pipeline improvements * Change mumbai RPC * Downgrade node Co-authored-by: zincoshine Co-authored-by: Utkir S Co-authored-by: Luke Wickens <71776468+lukewickens1989@users.noreply.github.com> Co-authored-by: riccardopillar <98806807+riccardopillar@users.noreply.github.com> Co-authored-by: Parthasarathy Ramanujam Co-authored-by: Luke Wickens Co-authored-by: Luke Wickens Co-authored-by: Ardian <34317628+arddluma@users.noreply.github.com> --- .circleci/config.yml | 6 +++-- .github/workflows/run-linter-and-tests.yml | 3 +++ extensions/constants.ts | 2 +- package.json | 2 +- pull_request_template.md | 26 ++++++++++++++++++++++ 5 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 pull_request_template.md diff --git a/.circleci/config.yml b/.circleci/config.yml index aaa1a0fd..d85d52fc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -7,7 +7,7 @@ jobs: install: working_directory: ~/etherspot-contracts docker: - - image: circleci/node:14.17.0 + - image: cimg/node:14.17.0 auth: username: $DOCKERHUB_USER password: $DOCKERHUB_PASSWORD @@ -33,7 +33,7 @@ jobs: publish: working_directory: ~/etherspot-contracts docker: - - image: circleci/node:14.17.0 + - image: cimg/node:14.17.0 auth: username: $DOCKERHUB_USER password: $DOCKERHUB_PASSWORD @@ -88,6 +88,8 @@ workflows: - master - publish-github-release: context: general-vars + requires: + - publish filters: branches: only: diff --git a/.github/workflows/run-linter-and-tests.yml b/.github/workflows/run-linter-and-tests.yml index 8d268b4f..ffd50be3 100644 --- a/.github/workflows/run-linter-and-tests.yml +++ b/.github/workflows/run-linter-and-tests.yml @@ -44,3 +44,6 @@ jobs: - name: Run tests run: npm run test -- --report-gas + + - name: Dry run build + run: npm run build \ No newline at end of file diff --git a/extensions/constants.ts b/extensions/constants.ts index 20060966..d5bfd28c 100644 --- a/extensions/constants.ts +++ b/extensions/constants.ts @@ -122,7 +122,7 @@ export const NETWORK_CONFIGS: { }, [NetworkNames.Mumbai]: { chainId: 80001, - defaultProviderUrl: "https://rpc-mumbai.maticvigil.com", + defaultProviderUrl: "https://matic-mumbai.chainstacklabs.com", defaultGasPrice: 5, explorer: "https://mumbai.polygonscan.com", }, diff --git a/package.json b/package.json index d581839c..9df544fc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@etherspot/contracts", - "version": "1.9.0", + "version": "1.9.1", "description": "Etherspot Solidity contracts", "keywords": [ "ether", diff --git a/pull_request_template.md b/pull_request_template.md new file mode 100644 index 00000000..2e058eba --- /dev/null +++ b/pull_request_template.md @@ -0,0 +1,26 @@ + + +## Description + +- + +## Motivation and Context + + +- + +## How Has This Been Tested? + + + +- +- +- + +## Screenshots (if appropriate): + +## Types of changes + +- [ ] Bug fix (non-breaking change which fixes an issue) +- [ ] New feature (non-breaking change which adds functionality) +- [ ] Breaking change (fix or feature that would cause existing functionality to change) \ No newline at end of file