Compare commits

...

16 Commits

Author SHA1 Message Date
Github Actions
ad2d41fd90 Publish
- @0x/contracts-erc20@4.0.5
 - @0x/governance@1.0.4
 - @0x/contracts-test-utils@5.4.51
 - @0x/contracts-treasury@1.4.44
 - @0x/contracts-utils@4.8.43
 - @0x/contracts-zero-ex@0.41.0
 - @0x/contract-addresses@8.4.0
 - @0x/contract-wrappers@13.22.20
 - @0x/protocol-utils@11.20.0
2023-04-17 18:29:25 +00:00
Github Actions
721b984bbc Updated CHANGELOGS & MD docs 2023-04-17 18:29:22 +00:00
Kyu
72433ea5b7 fix: Revert changelog commits from previous failed publish (#710)
* Revert "Publish"

This reverts commit f919e8ef02.

* Revert "Updated CHANGELOGS & MD docs"

This reverts commit dbcc7dd6f4.

* Bump contracts-erc20 and contracts-utils versions
2023-04-17 10:59:00 -07:00
Github Actions
f919e8ef02 Publish
- @0x/contracts-erc20@4.0.4
 - @0x/contracts-test-utils@5.4.51
 - @0x/contracts-treasury@1.4.44
 - @0x/contracts-utils@4.8.42
 - @0x/contracts-zero-ex@0.41.0
 - @0x/contract-addresses@8.4.0
 - @0x/contract-wrappers@13.22.20
 - @0x/protocol-utils@11.20.0
2023-04-17 03:09:17 +00:00
Github Actions
dbcc7dd6f4 Updated CHANGELOGS & MD docs 2023-04-17 03:09:13 +00:00
Kyu
33b7515734 Bump package versions for lerna (#709) 2023-04-16 19:42:57 -07:00
Github Actions
f96b944cce Updated CHANGELOGS & MD docs 2023-04-17 02:08:53 +00:00
Kyu
0fbdc1dccd fix: Revert changelog commits from previous failed publish (#708)
* Revert "Publish"

This reverts commit 2b13dcfc14.

* Revert "Updated CHANGELOGS & MD docs"

This reverts commit d2bea4aa46.
2023-04-16 18:47:48 -07:00
Github Actions
484d9cafc4 Publish
- @0x/governance@1.0.3
2023-04-17 01:24:55 +00:00
Github Actions
e73885c9a0 Updated CHANGELOGS & MD docs 2023-04-17 01:24:52 +00:00
Kyu
948b17e2ed Add publishConfig in governance/package.json (#707)
* publishConfig is needed for lerna to publish governance as a public
  package
2023-04-16 18:03:23 -07:00
Github Actions
2b13dcfc14 Publish
- @0x/contracts-erc20@4.0.4
 - @0x/governance@1.0.2
 - @0x/contracts-test-utils@5.4.51
 - @0x/contracts-treasury@1.4.44
 - @0x/contracts-utils@4.8.42
 - @0x/contracts-zero-ex@0.40.0
 - @0x/contract-addresses@8.3.0
 - @0x/contract-wrappers@13.22.20
 - @0x/protocol-utils@11.19.0
2023-04-16 23:30:53 +00:00
Github Actions
d2bea4aa46 Updated CHANGELOGS & MD docs 2023-04-16 23:30:50 +00:00
Kyu
dc926a05b3 Update Ethereum FillQuoteTransformer address (#706) 2023-04-14 15:47:20 -07:00
Kyu
5cc53597de feat: Add Barter support to EthereumBridgeAdapter [LIT-981] (#703) 2023-04-12 20:42:55 -07:00
wonge97
57ca2c07bb Correct final audit document (#702) 2023-04-11 15:08:22 -04:00
34 changed files with 279 additions and 22 deletions

1
.gitignore vendored
View File

@@ -99,6 +99,7 @@ foundry-artifacts/
# foundry cache
cache/
foundry-cache/
#foundry output artifacts
out/

View File

@@ -1,4 +1,22 @@
[
{
"version": "4.0.5",
"changes": [
{
"note": "Dependencies updated"
}
],
"timestamp": 1681756154
},
{
"timestamp": 1681697326,
"version": "4.0.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1681157139,
"version": "4.0.3",

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v4.0.5 - _April 17, 2023_
* Dependencies updated
## v4.0.4 - _April 17, 2023_
* Dependencies updated
## v4.0.3 - _April 10, 2023_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-erc20",
"version": "4.0.3",
"version": "4.0.5",
"engines": {
"node": ">=6.12"
},
@@ -24,7 +24,7 @@
},
"homepage": "https://github.com/0xProject/protocol",
"devDependencies": {
"@0x/contracts-utils": "^4.8.41",
"@0x/contracts-utils": "^4.8.43",
"@0x/ts-doc-gen": "^0.0.28",
"typedoc": "~0.16.11"
},

View File

@@ -1,4 +1,31 @@
[
{
"timestamp": 1681756154,
"version": "1.0.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1681694690,
"version": "1.0.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1681687842,
"version": "1.0.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1681157139,
"version": "1.0.1",

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.0.4 - _April 17, 2023_
* Dependencies updated
## v1.0.3 - _April 17, 2023_
* Dependencies updated
## v1.0.2 - _April 16, 2023_
* Dependencies updated
## v1.0.1 - _April 10, 2023_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/governance",
"version": "1.0.1",
"version": "1.0.4",
"description": "Governance implementation for the 0x protocol and treasury",
"main": "index.js",
"directories": {
@@ -20,5 +20,8 @@
"type": "git",
"url": "https://github.com/0xProject/protocol.git"
},
"publishConfig": {
"access": "public"
},
"license": "Apache-2.0"
}

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1681697326,
"version": "5.4.51",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "5.4.50",
"changes": [

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v5.4.51 - _April 17, 2023_
* Dependencies updated
## v5.4.50 - _April 10, 2023_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-test-utils",
"version": "5.4.50",
"version": "5.4.51",
"engines": {
"node": ">=6.12"
},
@@ -41,7 +41,7 @@
"dependencies": {
"@0x/assert": "^3.0.36",
"@0x/base-contract": "^7.0.0",
"@0x/contract-addresses": "^8.2.0",
"@0x/contract-addresses": "^8.4.0",
"@0x/dev-utils": "^5.0.2",
"@0x/json-schemas": "^6.4.4",
"@0x/order-utils": "^10.4.28",

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1681697326,
"version": "1.4.44",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "1.4.43",
"changes": [

View File

@@ -5,6 +5,10 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.4.44 - _April 17, 2023_
* Dependencies updated
## v1.4.43 - _April 10, 2023_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-treasury",
"version": "1.4.43",
"version": "1.4.44",
"engines": {
"node": ">=6.12"
},
@@ -46,12 +46,12 @@
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/treasury",
"devDependencies": {
"@0x/abi-gen": "^5.8.5",
"@0x/contract-addresses": "^8.2.0",
"@0x/contract-addresses": "^8.4.0",
"@0x/contracts-asset-proxy": "^3.7.19",
"@0x/contracts-erc20": "3.3.57",
"@0x/contracts-gen": "^2.0.50",
"@0x/contracts-staking": "^2.0.45",
"@0x/contracts-test-utils": "^5.4.50",
"@0x/contracts-test-utils": "^5.4.51",
"@0x/sol-compiler": "^4.8.2",
"@0x/ts-doc-gen": "^0.0.28",
"@types/isomorphic-fetch": "^0.0.35",
@@ -73,7 +73,7 @@
},
"dependencies": {
"@0x/base-contract": "^7.0.0",
"@0x/protocol-utils": "^11.18.2",
"@0x/protocol-utils": "^11.20.0",
"@0x/subproviders": "^8.0.1",
"@0x/types": "^3.3.7",
"@0x/typescript-typings": "^5.3.1",

View File

@@ -1,4 +1,22 @@
[
{
"version": "4.8.43",
"changes": [
{
"note": "Dependencies updated"
}
],
"timestamp": 1681756154
},
{
"timestamp": 1681697326,
"version": "4.8.42",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "4.8.41",
"changes": [

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v4.8.43 - _April 17, 2023_
* Dependencies updated
## v4.8.42 - _April 17, 2023_
* Dependencies updated
## v4.8.41 - _April 10, 2023_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-utils",
"version": "4.8.41",
"version": "4.8.43",
"engines": {
"node": ">=6.12"
},
@@ -45,7 +45,7 @@
"devDependencies": {
"@0x/abi-gen": "^5.8.5",
"@0x/contracts-gen": "^2.0.50",
"@0x/contracts-test-utils": "^5.4.50",
"@0x/contracts-test-utils": "^5.4.51",
"@0x/dev-utils": "^5.0.2",
"@0x/order-utils": "^10.4.28",
"@0x/sol-compiler": "^4.8.2",

View File

@@ -1,4 +1,22 @@
[
{
"version": "0.41.0",
"changes": [
{
"note": "Add Barter support on Ethereum"
}
],
"timestamp": 1681756154
},
{
"version": "0.40.0",
"changes": [
{
"note": "Add Barter support on Ethereum"
}
],
"timestamp": 1681697326
},
{
"version": "0.39.2",
"changes": [

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.41.0 - _April 17, 2023_
* Add Barter support on Ethereum
## v0.40.0 - _April 17, 2023_
* Add Barter support on Ethereum
## v0.39.2 - _April 10, 2023_
* Uprgade dependencies

View File

@@ -55,4 +55,5 @@ library BridgeProtocols {
uint128 internal constant WOOFI = 31;
uint128 internal constant AAVEV3 = 32;
uint128 internal constant KYBERELASTIC = 33;
uint128 internal constant BARTER = 34;
}

View File

@@ -22,6 +22,7 @@ import "./mixins/MixinBalancer.sol";
import "./mixins/MixinBalancerV2Batch.sol";
import "./mixins/MixinBancor.sol";
import "./mixins/MixinBancorV3.sol";
import "./mixins/MixinBarter.sol";
import "./mixins/MixinCompound.sol";
import "./mixins/MixinCurve.sol";
import "./mixins/MixinCurveV2.sol";
@@ -48,6 +49,7 @@ contract EthereumBridgeAdapter is
MixinBalancerV2Batch,
MixinBancor,
MixinBancorV3,
MixinBarter,
MixinCompound,
MixinCurve,
MixinCurveV2,
@@ -197,6 +199,11 @@ contract EthereumBridgeAdapter is
return (0, true);
}
boughtAmount = _tradeSynthetix(sellAmount, order.bridgeData);
} else if (protocolId == BridgeProtocols.BARTER) {
if (dryRun) {
return (0, true);
}
boughtAmount = _tradeBarter(sellToken, sellAmount, order.bridgeData);
} else if (protocolId == BridgeProtocols.UNKNOWN) {
if (dryRun) {
return (0, true);

View File

@@ -0,0 +1,41 @@
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2023 ZeroEx Intl.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
pragma solidity ^0.6.5;
pragma experimental ABIEncoderV2;
import "@0x/contracts-erc20/src/v06/LibERC20TokenV06.sol";
import "@0x/contracts-erc20/src/IERC20Token.sol";
import "@0x/contracts-utils/contracts/src/v06/errors/LibRichErrorsV06.sol";
contract MixinBarter {
using LibERC20TokenV06 for IERC20Token;
using LibRichErrorsV06 for bytes;
function _tradeBarter(
IERC20Token sellToken,
uint256 sellAmount,
bytes memory bridgeData
) internal returns (uint256 boughtAmount) {
(address barterRouter, bytes memory data) = abi.decode(bridgeData, (address, bytes));
sellToken.approveIfBelow(barterRouter, sellAmount);
(bool success, bytes memory resultData) = barterRouter.call(data);
if (!success) {
resultData.rrevert();
}
return abi.decode(resultData, (uint256));
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-zero-ex",
"version": "0.39.2",
"version": "0.41.0",
"engines": {
"node": ">=6.12"
},
@@ -51,10 +51,10 @@
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/zero-ex",
"devDependencies": {
"@0x/abi-gen": "^5.8.5",
"@0x/contract-addresses": "^8.2.0",
"@0x/contract-addresses": "^8.4.0",
"@0x/contracts-erc20": "^3.3.57",
"@0x/contracts-gen": "^2.0.50",
"@0x/contracts-test-utils": "^5.4.50",
"@0x/contracts-test-utils": "^5.4.51",
"@0x/dev-utils": "^5.0.2",
"@0x/order-utils": "^10.4.28",
"@0x/sol-compiler": "^4.8.2",
@@ -80,7 +80,7 @@
},
"dependencies": {
"@0x/base-contract": "^7.0.0",
"@0x/protocol-utils": "^11.18.2",
"@0x/protocol-utils": "^11.20.0",
"@0x/subproviders": "^8.0.1",
"@0x/types": "^3.3.7",
"@0x/typescript-typings": "^5.3.1",

View File

@@ -1,4 +1,22 @@
[
{
"version": "8.4.0",
"changes": [
{
"note": "Add Barter support in Ethereum FillQuoteTransformer"
}
],
"timestamp": 1681756154
},
{
"version": "8.3.0",
"changes": [
{
"note": "Add Barter support in Ethereum FillQuoteTransformer"
}
],
"timestamp": 1681697326
},
{
"version": "8.2.0",
"changes": [

View File

@@ -6,6 +6,12 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v8.4.0 - _April 17, 2023_
* Add Barter support in Ethereum FillQuoteTransformer
## v8.3.0 - _April 17, 2023_
* Add Barter support in Ethereum FillQuoteTransformer
## v8.2.0 - _March 10, 2023_
* Upgrade Polygon, Avalanche, Arbitrum, and Optimism FillQuoteTransformers to remove Aave V3 L2 Encoding and support KyberElastic (#678)

View File

@@ -18,7 +18,7 @@
"wethTransformer": "0xb2bc06a4efb20fc6553a69dbfa49b7be938034a7",
"payTakerTransformer": "0xea500d073652336a58846ada15c25f2c6d2d241f",
"affiliateFeeTransformer": "0x8146cbbe327364b13d0699f2ced39c637f92501a",
"fillQuoteTransformer": "0xd7a6ced9e0eaa8e5ad6e7335d25d46b6f456d4fd",
"fillQuoteTransformer": "0x21c3bee93fad436dedd29f971dc4fdf82f3e3a3a",
"positiveSlippageFeeTransformer": "0x818a4a855bfeb16c305cb65e8d4fb239a308bc48"
}
},

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contract-addresses",
"version": "8.2.0",
"version": "8.4.0",
"engines": {
"node": ">=6.12"
},

View File

@@ -1,4 +1,13 @@
[
{
"timestamp": 1681697326,
"version": "13.22.20",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "13.22.19",
"changes": [

View File

@@ -6,6 +6,9 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v13.22.20 - _April 17, 2023_
* Dependencies updated
## v13.22.19 - _April 10, 2023_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contract-wrappers",
"version": "13.22.19",
"version": "13.22.20",
"engines": {
"node": ">=6.12"
},
@@ -59,7 +59,7 @@
"dependencies": {
"@0x/assert": "^3.0.36",
"@0x/base-contract": "^7.0.0",
"@0x/contract-addresses": "^8.2.0",
"@0x/contract-addresses": "^8.4.0",
"@0x/json-schemas": "^6.4.4",
"@0x/types": "^3.3.7",
"@0x/utils": "^7.0.0",

View File

@@ -1,4 +1,22 @@
[
{
"version": "11.20.0",
"changes": [
{
"note": "Add Barter support"
}
],
"timestamp": 1681756154
},
{
"version": "11.19.0",
"changes": [
{
"note": "Add Barter support"
}
],
"timestamp": 1681697326
},
{
"version": "11.18.2",
"changes": [

View File

@@ -6,6 +6,12 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v11.20.0 - _April 17, 2023_
* Add Barter support
## v11.19.0 - _April 17, 2023_
* Add Barter support
## v11.18.2 - _April 10, 2023_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/protocol-utils",
"version": "11.18.2",
"version": "11.20.0",
"engines": {
"node": ">=6.12"
},
@@ -62,8 +62,8 @@
},
"dependencies": {
"@0x/assert": "^3.0.36",
"@0x/contract-addresses": "^8.2.0",
"@0x/contract-wrappers": "^13.22.19",
"@0x/contract-addresses": "^8.4.0",
"@0x/contract-wrappers": "^13.22.20",
"@0x/json-schemas": "^6.4.4",
"@0x/subproviders": "^8.0.1",
"@0x/utils": "^7.0.0",

View File

@@ -164,6 +164,7 @@ export enum BridgeProtocol {
WOOFi,
AaveV3,
KyberElastic,
Barter,
}
/**