Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2023-12-11 #126

Merged
merged 72 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
6150c15
Update LICENSE
yudilevi Aug 30, 2023
1b8ae36
carbon pol - contracts
ivanzhelyazkov Sep 4, 2023
657ce70
carbon pol - tests
ivanzhelyazkov Sep 5, 2023
7b730e7
carbon pol - deployment scripts
ivanzhelyazkov Sep 5, 2023
86dc05f
carbon pol - fix decay math
ivanzhelyazkov Sep 7, 2023
093885a
carbon pol - price calculation testing
ivanzhelyazkov Sep 7, 2023
3547b5a
carbon pol - add deployment script
ivanzhelyazkov Sep 7, 2023
b43e95d
carbon pol - minor fixes
ivanzhelyazkov Sep 8, 2023
fd9791f
carbon pol - minor fixes
ivanzhelyazkov Sep 8, 2023
3cc749c
carbon pol - minor fixes
ivanzhelyazkov Sep 11, 2023
7d83ec0
carbon pol - small fix
ivanzhelyazkov Sep 11, 2023
5c25ec6
carbon pol - minor changes
ivanzhelyazkov Sep 11, 2023
b820556
carbon pol - comment update
ivanzhelyazkov Sep 12, 2023
cc8b3be
carbon pol - add more tests
ivanzhelyazkov Sep 12, 2023
54bfd5f
Merge pull request #116 from bancorprotocol/carbon-pol
ivanzhelyazkov Sep 12, 2023
ab01c86
updated mainnet artifacts
yudilevi Sep 12, 2023
c3c550e
carbon pol - add enable trading script
ivanzhelyazkov Sep 12, 2023
4df5e2c
carbon pol - enable trading script small fix
ivanzhelyazkov Sep 12, 2023
1e35390
run lint
ivanzhelyazkov Sep 12, 2023
819905d
updated SPDX license identifier
yudilevi Sep 14, 2023
3a21c3c
changed enableTrading script input and added support for non standard…
yudilevi Sep 17, 2023
bd59f62
Merge remote-tracking branch 'origin/master' into carbon-pol
yudilevi Sep 17, 2023
295b6df
Merge remote-tracking branch 'origin/dev' into carbon-pol
yudilevi Sep 17, 2023
7b390f3
enableTrading - fixed allTokens references
yudilevi Sep 17, 2023
4176bf7
enableTrading - removed test address
yudilevi Sep 17, 2023
eeaa846
buffer
yudilevi Sep 18, 2023
55b4a54
enableTrading - increased decimals of prices for precision
yudilevi Sep 18, 2023
d239b27
Merge pull request #117 from bancorprotocol/carbon-pol
yudilevi Sep 18, 2023
98498db
enableTrading - fixed price direction
yudilevi Sep 21, 2023
8c43cfd
enableTrading - removed debug code
yudilevi Sep 21, 2023
a8885cb
enableTrading - fixed decimal input
yudilevi Sep 21, 2023
99e55f8
migrate to pnpm
ivanzhelyazkov Oct 3, 2023
8800feb
fix lint issues
ivanzhelyazkov Oct 3, 2023
4a1bbc1
Merge pull request #118 from bancorprotocol/migrate-to-pnpm
ivanzhelyazkov Oct 4, 2023
aea71f6
add reentrancy tests
ivanzhelyazkov Oct 11, 2023
792bc3e
fix license
ivanzhelyazkov Oct 11, 2023
88708de
reentrancy tests - minor fix
ivanzhelyazkov Oct 12, 2023
f741eac
Merge pull request #119 from bancorprotocol/reentrancy-tests
ivanzhelyazkov Oct 17, 2023
a719723
carbon pol eth conversion - contracts
ivanzhelyazkov Nov 15, 2023
3cd359e
carbon pol eth conversion - tests
ivanzhelyazkov Nov 15, 2023
f105c11
carbon pol eth conversion - deployment scripts
ivanzhelyazkov Nov 15, 2023
4a87dec
minor comment fix
ivanzhelyazkov Nov 15, 2023
c43e5e7
minor test fix
ivanzhelyazkov Nov 15, 2023
1ca572b
carbon pol eth conversion - review fixes
ivanzhelyazkov Nov 16, 2023
4c45d5a
carbon pol eth conversion - burn bnt directly
ivanzhelyazkov Nov 16, 2023
e9b3fde
carbon pol eth conversion - simplify logic
ivanzhelyazkov Nov 16, 2023
d5b249c
carbon pol eth conversion - minor fixes
ivanzhelyazkov Nov 17, 2023
9d22be9
carbon pol eth conversion - minor fixes
ivanzhelyazkov Nov 20, 2023
06d50bb
Merge pull request #120 from bancorprotocol/pol-eth-to-bnt
ivanzhelyazkov Nov 20, 2023
280cfb5
carbon pol eth conversion - minor fixes
ivanzhelyazkov Nov 21, 2023
ac9c93d
carbon pol eth conversion - min sale amount
ivanzhelyazkov Nov 21, 2023
369aa2f
carbon pol eth conversion - minor fix
ivanzhelyazkov Nov 21, 2023
24b1f40
update hardhat-deploy package
ivanzhelyazkov Nov 21, 2023
6894d27
lock hardhat-deploy version
ivanzhelyazkov Nov 21, 2023
084a255
Merge pull request #121 from bancorprotocol/pol-eth-to-bnt
ivanzhelyazkov Nov 22, 2023
de497a8
carbon pol eth conversion - deployment scripts
ivanzhelyazkov Nov 22, 2023
a2bc3a4
carbon pol eth conversion - price reset fix
ivanzhelyazkov Nov 23, 2023
7640d90
carbon pol eth conversion - minor fix
ivanzhelyazkov Nov 23, 2023
67bb9b5
carbon pol eth conversion - minor fix
ivanzhelyazkov Nov 23, 2023
e42c4a0
carbon pol eth conversion - minor fix
ivanzhelyazkov Nov 23, 2023
aa38cb1
carbon pol eth conversion - minor fix
ivanzhelyazkov Nov 23, 2023
cb56770
Merge pull request #122 from bancorprotocol/pol-eth-to-bnt
ivanzhelyazkov Nov 23, 2023
d70247c
carbon pol eth conversion - minor fix
ivanzhelyazkov Nov 28, 2023
1020bfd
carbon pol eth conversion - minor fix
ivanzhelyazkov Nov 28, 2023
49b1aa1
carbon pol - use event key value notation
ivanzhelyazkov Nov 28, 2023
c5cee7d
Merge pull request #123 from bancorprotocol/pol-eth-to-bnt
ivanzhelyazkov Nov 28, 2023
e2395e7
add tenderly testnet support
ivanzhelyazkov Nov 28, 2023
c937fba
tenderly testnet support - minor fix
ivanzhelyazkov Nov 28, 2023
af8dec5
carbon pol - interface naming convention
ivanzhelyazkov Nov 29, 2023
cd71a33
Merge pull request #125 from bancorprotocol/pol-eth-to-bnt
ivanzhelyazkov Nov 29, 2023
d130cb8
Merge pull request #124 from bancorprotocol/tenderly-testnet-support
ivanzhelyazkov Nov 29, 2023
8c54664
updated mainnet artifacts
yudilevi Dec 11, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 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
Loading