Skip to content

Commit

Permalink
Merge pull request #126 from bancorprotocol/dev
Browse files Browse the repository at this point in the history
Release 2023-12-11
  • Loading branch information
yudilevi authored Dec 11, 2023
2 parents 29d0653 + 8c54664 commit 9613d90
Show file tree
Hide file tree
Showing 80 changed files with 23,008 additions and 11,513 deletions.
2 changes: 2 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
ETHEREUM_PROVIDER_URL=
ETHEREUM_RINKEBY_PROVIDER_URL=
TENDERLY_TESTNET_PROVIDER_URL=
TENDERLY_TESTNET_ID=
TENDERLY_FORK_ID=
TENDERLY_PROJECT=
TENDERLY_USERNAME=
Expand Down
32 changes: 12 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,30 @@ jobs:

- name: Check out the repository
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'

cache: 'pnpm'

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
id: yarn-cache
with:
path: |
**/node_modules
${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
run: pnpm install

- name: Lint
run: yarn lint
run: pnpm lint

- name: Test
run: yarn test
run: pnpm test
33 changes: 15 additions & 18 deletions .github/workflows/health.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,36 +14,33 @@ jobs:
steps:
- name: Check out the repository
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
cache: 'pnpm'

- name: Tune GitHub-hosted runner network
uses: smorimoto/tune-github-hosted-runner-network@v1

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
id: yarn-cache

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
path: |
**/node_modules
${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
version: nightly

- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
run: pnpm install

- name: Build
run: yarn build
run: pnpm build

- name: Setup tenderly
run: |
Expand All @@ -54,7 +51,7 @@ jobs:
TENDERLY_ACCESS_KEY: ${{ secrets.TENDERLY_ACCESS_KEY }}

- name: Test deployment and network health
run: yarn test:health
run: pnpm test:health
env:
TENDERLY_PROJECT: carbon-temp-forks
TENDERLY_TEST_PROJECT: carbon-temp-forks
Expand Down
32 changes: 12 additions & 20 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,38 +42,30 @@ jobs:

- name: Check out the repository
uses: actions/checkout@v3
with:
submodules: recursive

- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'

cache: 'pnpm'

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT

- name: Cache dependencies
uses: actions/cache@v3
id: yarn-cache
with:
path: |
**/node_modules
${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
run: pnpm install

- name: Lint
run: yarn lint
run: pnpm lint

- name: Test
run: yarn test
run: pnpm test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ contracts/hardhat-dependency-compiler
deployments/mainnet/solcInputs/*
deployments/hardhat/*
deployments/tenderly/*
deployments/tenderly-testnet/*

fork-*.zip
testnet-*.zip

.coverage_artifacts
.coverage_contracts
Expand Down
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
}
}
],
"plugins": ["prettier-plugin-solidity"],
"printWidth": 120,
"tabWidth": 4,
"useTabs": false,
Expand Down
2 changes: 2 additions & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"not-rely-on-time": "off",
"no-empty-blocks": "off",
"mark-callable-contracts": "off",
"immutable-vars-naming": "off",
"one-contract-per-file": "off",
"func-visibility": ["error", { "ignoreConstructors": true }],
"compiler-version": ["error", "0.8.19"]
}
Expand Down
120 changes: 23 additions & 97 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,97 +1,23 @@
Business Source License 1.1

License text copyright (c) 2017 MariaDB Corporation Ab, All Rights Reserved.
"Business Source License" is a trademark of MariaDB Corporation Ab.

---

Parameters

Licensor: Bprotocol Foundation

Licensed Work: Carbon v1.0
The Licensed Work is (c) 2023 Bprotocol Foundation

Additional Use Grant: None

Change Date: 2026-01-01

Change License: MIT

---

Terms

The Licensor hereby grants you the right to copy, modify, create derivative
works, redistribute, and make non-production use of the Licensed Work. The
Licensor may make an Additional Use Grant, above, permitting limited
production use.

Effective on the Change Date, or the fourth anniversary of the first publicly
available distribution of a specific version of the Licensed Work under this
License, whichever comes first, the Licensor hereby grants you rights under
the terms of the Change License, and the rights granted in the paragraph
above terminate.

If your use of the Licensed Work does not comply with the requirements
currently in effect as described in this License, you must purchase a
commercial license from the Licensor, its affiliated entities, or authorized
resellers, or you must refrain from using the Licensed Work.

All copies of the original and modified Licensed Work, and derivative works
of the Licensed Work, are subject to this License. This License applies
separately for each version of the Licensed Work and the Change Date may vary
for each version of the Licensed Work released by Licensor.

You must conspicuously display this License on each original or modified copy
of the Licensed Work. If you receive the Licensed Work in original or
modified form from a third party, the terms and conditions set forth in this
License apply to your use of that work.

Any use of the Licensed Work in violation of this License will automatically
terminate your rights under this License for the current and all other
versions of the Licensed Work.

This License does not grant you any right in any trademark or logo of
Licensor or its affiliates (provided that you may use a trademark or logo of
Licensor as expressly required by this License).

TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON
AN "AS IS" BASIS. LICENSOR HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS,
EXPRESS OR IMPLIED, INCLUDING (WITHOUT LIMITATION) WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT, AND
TITLE.

MariaDB hereby grants you permission to use this License’s text to license
your works, and to refer to it using the trademark "Business Source License",
as long as you comply with the Covenants of Licensor below.

---

Covenants of Licensor

In consideration of the right to use this License’s text and the "Business
Source License" name and trademark, Licensor covenants to MariaDB, and to all
other recipients of the licensed work to be provided by Licensor:

1. To specify as the Change License MIT, or a license that is compatible with
MIT license, where "compatible" means that software provided under the
Change License can be included in a program with software provided under
MIT license or a later version. Licensor may specify additional Change
Licenses without limitation.

2. To either: (a) specify an additional grant of rights to use that does not
impose any additional restriction on the right granted in this License, as
the Additional Use Grant; or (b) insert the text "None".

3. To specify a Change Date.

4. Not to modify this License in any other way.

---

Notice

The Business Source License (this document, or the "License") is not an Open
Source license. However, the Licensed Work will eventually be made available
under an Open Source License, as stated in this License.
(c) Bprotocol Foundation, 2023

Except as otherwise provided in the header of a specific source code
file in this repository: (a) all intellectual property (including all
source code, designs and protocols) contained in this repository has been
published for informational purposes only; (b) no license, right of
reproduction or distribution or other right with respect thereto is
granted or implied; and (c) all moral, intellectual property and other
rights are hereby reserved by the copyright holder.

THE SOFTWARE AND INTELLECTUAL PROPERTY INCLUDED IN THIS REPOSITORY
IS PROVIDED BY THE COPYRIGHT HOLDERS "AS IS," AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE OR
INTELLECTUAL PROPERTY (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
BUSINESS INTERRUPTION), HOWEVER CAUSED OR CLAIMED (WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)), EVEN IF
SUCH DAMAGES WERE REASONABLY FORESEEABLE OR THE COPYRIGHT HOLDERS WERE
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4 changes: 4 additions & 0 deletions components/Contracts.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {
CarbonController__factory,
CarbonPOL__factory,
CarbonVortex__factory,
ERC20__factory,
MockBancorNetworkV3__factory,
Expand All @@ -10,6 +11,7 @@ import {
TestERC20Burnable__factory,
TestERC20FeeOnTransfer__factory,
TestERC20Token__factory,
TestExpDecayMath__factory,
TestLogic__factory,
TestMathEx__factory,
TestOnlyProxyDelegate__factory,
Expand All @@ -31,12 +33,14 @@ const getContracts = (signer?: Signer) => ({
ERC20: deployOrAttach('ERC20', ERC20__factory, signer),
CarbonController: deployOrAttach('CarbonController', CarbonController__factory, signer),
CarbonVortex: deployOrAttach('CarbonVortex', CarbonVortex__factory, signer),
CarbonPOL: deployOrAttach('CarbonPOL', CarbonPOL__factory, signer),
MockBancorNetworkV3: deployOrAttach('MockBancorNetworkV3', MockBancorNetworkV3__factory, signer),
ProxyAdmin: deployOrAttach('ProxyAdmin', ProxyAdmin__factory, signer),
Voucher: deployOrAttach('Voucher', Voucher__factory, signer),
TestERC20FeeOnTransfer: deployOrAttach('TestERC20FeeOnTransfer', TestERC20FeeOnTransfer__factory, signer),
TestERC20Burnable: deployOrAttach('TestERC20Burnable', TestERC20Burnable__factory, signer),
TestERC20Token: deployOrAttach('TestERC20Token', TestERC20Token__factory, signer),
TestExpDecayMath: deployOrAttach('TestExpDecayMath', TestExpDecayMath__factory, signer),
TestBNT: deployOrAttach('TestBNT', TestBNT__factory, signer),
TestLogic: deployOrAttach('TestLogic', TestLogic__factory, signer),
TestMathEx: deployOrAttach('TestMathEx', TestMathEx__factory, signer),
Expand Down
2 changes: 1 addition & 1 deletion contracts/carbon/CarbonController.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: BUSL-1.1
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.8.19;
import { ReentrancyGuardUpgradeable } from "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol";
import { PausableUpgradeable } from "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/carbon/Pairs.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: BUSL-1.1
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.8.19;
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import { Token } from "../token/Token.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/carbon/Strategies.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: BUSL-1.1
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity 0.8.19;
import { Initializable } from "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
import { EnumerableSetUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/structs/EnumerableSetUpgradeable.sol";
Expand Down
2 changes: 1 addition & 1 deletion contracts/carbon/interfaces/ICarbonController.sol
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-License-Identifier: BUSL-1.1
// SPDX-License-Identifier: SEE LICENSE IN LICENSE
pragma solidity ^0.8.0;

import { IUpgradeable } from "../../utility/interfaces/IUpgradeable.sol";
Expand Down
Loading

0 comments on commit 9613d90

Please sign in to comment.