Compare commits

..

10 Commits

Author SHA1 Message Date
Github Actions
43512fd07a Publish
- @0x/contracts-erc20@3.3.22
 - @0x/contracts-test-utils@5.4.13
 - @0x/contracts-treasury@1.4.5
 - @0x/contracts-utils@4.8.3
 - @0x/contracts-zero-ex@0.29.3
 - @0x/asset-swapper@16.30.1
 - @0x/contract-addresses@6.8.1
 - @0x/contract-wrappers@13.18.2
 - @0x/migrations@8.1.10
 - @0x/protocol-utils@1.9.4
2021-11-03 01:40:34 +00:00
Github Actions
c090608d99 Updated CHANGELOGS & MD docs 2021-11-03 01:40:30 +00:00
phil-ociraptor
89817428ed chore: add OtcOrder feature to fullMigrateAsync (#350) 2021-11-02 20:19:27 -05:00
Lawrence Forman
fce3664258 @0x/contracts-zero-ex: Register transformERC20() and remove transformERC20Staging() (#355)
Co-authored-by: Lawrence Forman <me@merklejerk.com>
2021-10-25 20:08:58 -04:00
Github Actions
aa522fe49b Publish
- @0x/contracts-erc20@3.3.21
 - @0x/contracts-test-utils@5.4.12
 - @0x/contracts-treasury@1.4.4
 - @0x/contracts-utils@4.8.2
 - @0x/contracts-zero-ex@0.29.2
 - @0x/asset-swapper@16.30.0
 - @0x/contract-addresses@6.8.0
 - @0x/contract-wrappers@13.18.1
 - @0x/migrations@8.1.9
 - @0x/protocol-utils@1.9.3
2021-10-19 18:27:29 +00:00
Github Actions
c03653ebd7 Updated CHANGELOGS & MD docs 2021-10-19 18:27:25 +00:00
Shawn
ae08f77381 Feat/ftm (#347)
* ftm deployment

* add Fantom Curve

* add support for ftm

* add more Fantom liquidity sources

* clean up codes

* lint

* prettier codes

* modify CHANGLOG

* undo some changes

* use lowercase addresses

* Update EP FlashWallet

* Update addresses and remove timestamps

Co-authored-by: Jacob Evans <jacob@dekz.net>

* Cleanup

* cleanup json

Co-authored-by: Romain Butteaud <romain.butteaud@gmail.com>
Co-authored-by: Jacob Evans <jacob@dekz.net>
2021-10-19 09:51:07 -07:00
Github Actions
73a07e512d Publish
- @0x/asset-swapper@16.29.3
2021-10-18 10:36:39 +00:00
Github Actions
7cff09f40a Updated CHANGELOGS & MD docs 2021-10-18 10:36:36 +00:00
Kim Persson
a6d690f10a chore: update to new router version and address breaking changes (#344)
* chore: update to new router version and address breaking changes

* chore: add changelog entry
2021-10-18 11:15:31 +01:00
42 changed files with 542 additions and 90 deletions

View File

@@ -1,4 +1,22 @@
[
{
"timestamp": 1635903615,
"version": "3.3.22",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1634668033,
"version": "3.3.21",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1631710679,
"version": "3.3.20",

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v3.3.22 - _November 3, 2021_
* Dependencies updated
## v3.3.21 - _October 19, 2021_
* Dependencies updated
## v3.3.20 - _September 15, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-erc20",
"version": "3.3.20",
"version": "3.3.22",
"engines": {
"node": ">=6.12"
},
@@ -53,8 +53,8 @@
"devDependencies": {
"@0x/abi-gen": "^5.6.2",
"@0x/contracts-gen": "^2.0.40",
"@0x/contracts-test-utils": "^5.4.11",
"@0x/contracts-utils": "^4.8.1",
"@0x/contracts-test-utils": "^5.4.13",
"@0x/contracts-utils": "^4.8.3",
"@0x/dev-utils": "^4.2.9",
"@0x/sol-compiler": "^4.7.5",
"@0x/ts-doc-gen": "^0.0.28",

View File

@@ -1,4 +1,22 @@
[
{
"timestamp": 1635903615,
"version": "5.4.13",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1634668033,
"version": "5.4.12",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1631710679,
"version": "5.4.11",

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v5.4.13 - _November 3, 2021_
* Dependencies updated
## v5.4.12 - _October 19, 2021_
* Dependencies updated
## v5.4.11 - _September 15, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-test-utils",
"version": "5.4.11",
"version": "5.4.13",
"engines": {
"node": ">=6.12"
},
@@ -44,7 +44,7 @@
"dependencies": {
"@0x/assert": "^3.0.29",
"@0x/base-contract": "^6.4.2",
"@0x/contract-addresses": "^6.7.0",
"@0x/contract-addresses": "^6.8.1",
"@0x/dev-utils": "^4.2.9",
"@0x/json-schemas": "^6.3.0",
"@0x/order-utils": "^10.4.28",

View File

@@ -1,4 +1,22 @@
[
{
"timestamp": 1635903615,
"version": "1.4.5",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1634668033,
"version": "1.4.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1634147078,
"version": "1.4.3",

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.4.5 - _November 3, 2021_
* Dependencies updated
## v1.4.4 - _October 19, 2021_
* Dependencies updated
## v1.4.3 - _October 13, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-treasury",
"version": "1.4.3",
"version": "1.4.5",
"engines": {
"node": ">=6.12"
},
@@ -47,12 +47,12 @@
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/treasury",
"devDependencies": {
"@0x/abi-gen": "^5.6.2",
"@0x/contract-addresses": "^6.7.0",
"@0x/contract-addresses": "^6.8.1",
"@0x/contracts-asset-proxy": "^3.7.19",
"@0x/contracts-erc20": "^3.3.20",
"@0x/contracts-erc20": "^3.3.22",
"@0x/contracts-gen": "^2.0.40",
"@0x/contracts-staking": "^2.0.45",
"@0x/contracts-test-utils": "^5.4.11",
"@0x/contracts-test-utils": "^5.4.13",
"@0x/sol-compiler": "^4.7.5",
"@0x/ts-doc-gen": "^0.0.28",
"@0x/tslint-config": "^4.1.4",
@@ -73,7 +73,7 @@
},
"dependencies": {
"@0x/base-contract": "^6.4.2",
"@0x/protocol-utils": "^1.9.2",
"@0x/protocol-utils": "^1.9.4",
"@0x/subproviders": "^6.6.0",
"@0x/types": "^3.3.4",
"@0x/typescript-typings": "^5.2.1",

View File

@@ -1,4 +1,22 @@
[
{
"timestamp": 1635903615,
"version": "4.8.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1634668033,
"version": "4.8.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1631710679,
"version": "4.8.1",

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v4.8.3 - _November 3, 2021_
* Dependencies updated
## v4.8.2 - _October 19, 2021_
* Dependencies updated
## v4.8.1 - _September 15, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-utils",
"version": "4.8.1",
"version": "4.8.3",
"engines": {
"node": ">=6.12"
},
@@ -52,7 +52,7 @@
"devDependencies": {
"@0x/abi-gen": "^5.6.2",
"@0x/contracts-gen": "^2.0.40",
"@0x/contracts-test-utils": "^5.4.11",
"@0x/contracts-test-utils": "^5.4.13",
"@0x/dev-utils": "^4.2.9",
"@0x/order-utils": "^10.4.28",
"@0x/sol-compiler": "^4.7.5",

View File

@@ -1,4 +1,27 @@
[
{
"version": "0.29.3",
"changes": [
{
"note": "Register transformERC20() and remove transformERC20Staging()",
"pr": 355
},
{
"note": "Add OtcOrders to FullMigration",
"pr": 350
}
],
"timestamp": 1635903615
},
{
"timestamp": 1634668033,
"version": "0.29.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1633374058,
"version": "0.29.1",

View File

@@ -5,6 +5,15 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.29.3 - _November 3, 2021_
* Register transformERC20() and remove transformERC20Staging() (#355)
* Add OtcOrders to FullMigration (#350)
## v0.29.2 - _October 19, 2021_
* Dependencies updated
## v0.29.1 - _October 4, 2021_
* Dependencies updated

View File

@@ -75,7 +75,7 @@ contract TransformERC20Feature is
_registerFeatureFunction(this.setTransformerDeployer.selector);
_registerFeatureFunction(this.setQuoteSigner.selector);
_registerFeatureFunction(this.getQuoteSigner.selector);
_registerFeatureFunction(this.transformERC20Staging.selector);
_registerFeatureFunction(this.transformERC20.selector);
_registerFeatureFunction(this._transformERC20.selector);
if (this.getTransformWallet() == IFlashWallet(address(0))) {
// Create the transform wallet if it doesn't exist.
@@ -145,44 +145,6 @@ contract TransformERC20Feature is
LibTransformERC20Storage.getStorage().wallet = wallet;
}
/// @dev Wrapper for `transformERC20`. This selector will be temporarily
/// registered to the Exchange Proxy so that we can migrate 0x API
/// with no downtime. Once 0x API has been updated to point to this
/// function, we can safely re-register `transformERC20`, point
/// 0x API back to `transformERC20`, and deregister this function.
/// @param inputToken The token being provided by the sender.
/// If `0xeee...`, ETH is implied and should be provided with the call.`
/// @param outputToken The token to be acquired by the sender.
/// `0xeee...` implies ETH.
/// @param inputTokenAmount The amount of `inputToken` to take from the sender.
/// If set to `uint256(-1)`, the entire spendable balance of the taker
/// will be solt.
/// @param minOutputTokenAmount The minimum amount of `outputToken` the sender
/// must receive for the entire transformation to succeed. If set to zero,
/// the minimum output token transfer will not be asserted.
/// @param transformations The transformations to execute on the token balance(s)
/// in sequence.
/// @return outputTokenAmount The amount of `outputToken` received by the sender.
function transformERC20Staging(
IERC20TokenV06 inputToken,
IERC20TokenV06 outputToken,
uint256 inputTokenAmount,
uint256 minOutputTokenAmount,
Transformation[] memory transformations
)
public
payable
returns (uint256 outputTokenAmount)
{
return transformERC20(
inputToken,
outputToken,
inputTokenAmount,
minOutputTokenAmount,
transformations
);
}
/// @dev Executes a series of transformations to convert an ERC20 `inputToken`
/// to an ERC20 `outputToken`.
/// @param inputToken The token being provided by the sender.
@@ -283,8 +245,8 @@ contract TransformERC20Feature is
}
// Transfer output tokens from wallet to recipient
outputTokenAmount = _executeOutputTokenTransfer(
args.outputToken,
state.wallet,
args.outputToken,
state.wallet,
args.recipient
);
}

View File

@@ -25,6 +25,7 @@ import "../features/interfaces/IOwnableFeature.sol";
import "../features/TransformERC20Feature.sol";
import "../features/MetaTransactionsFeature.sol";
import "../features/NativeOrdersFeature.sol";
import "../features/OtcOrdersFeature.sol";
import "./InitialMigration.sol";
@@ -40,6 +41,7 @@ contract FullMigration {
TransformERC20Feature transformERC20;
MetaTransactionsFeature metaTransactions;
NativeOrdersFeature nativeOrders;
OtcOrdersFeature otcOrders;
}
/// @dev Parameters needed to initialize features.
@@ -173,5 +175,16 @@ contract FullMigration {
address(this)
);
}
// OtcOrdersFeature
{
// Register the feature.
ownable.migrate(
address(features.otcOrders),
abi.encodeWithSelector(
OtcOrdersFeature.migrate.selector
),
address(this)
);
}
}
}

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contracts-zero-ex",
"version": "0.29.1",
"version": "0.29.3",
"engines": {
"node": ">=6.12"
},
@@ -56,10 +56,10 @@
"homepage": "https://github.com/0xProject/protocol/tree/main/contracts/zero-ex",
"devDependencies": {
"@0x/abi-gen": "^5.6.2",
"@0x/contract-addresses": "^6.7.0",
"@0x/contracts-erc20": "^3.3.20",
"@0x/contract-addresses": "^6.8.1",
"@0x/contracts-erc20": "^3.3.22",
"@0x/contracts-gen": "^2.0.40",
"@0x/contracts-test-utils": "^5.4.11",
"@0x/contracts-test-utils": "^5.4.13",
"@0x/dev-utils": "^4.2.9",
"@0x/order-utils": "^10.4.28",
"@0x/sol-compiler": "^4.7.5",
@@ -83,7 +83,7 @@
},
"dependencies": {
"@0x/base-contract": "^6.4.2",
"@0x/protocol-utils": "^1.9.2",
"@0x/protocol-utils": "^1.9.4",
"@0x/subproviders": "^6.6.0",
"@0x/types": "^3.3.4",
"@0x/typescript-typings": "^5.2.1",

View File

@@ -12,6 +12,7 @@ import {
IZeroExContract,
MetaTransactionsFeatureContract,
NativeOrdersFeatureContract,
OtcOrdersFeatureContract,
OwnableFeatureContract,
SimpleFunctionRegistryFeatureContract,
TransformERC20FeatureContract,
@@ -113,6 +114,7 @@ export interface FullFeatures extends BootstrapFeatures {
transformERC20: string;
metaTransactions: string;
nativeOrders: string;
otcOrders: string;
}
/**
@@ -123,6 +125,7 @@ export interface FullFeatureArtifacts extends BootstrapFeatureArtifacts {
metaTransactions: SimpleContractArtifact;
nativeOrders: SimpleContractArtifact;
feeCollectorController: SimpleContractArtifact;
otcOrders: SimpleContractArtifact;
}
/**
@@ -155,6 +158,7 @@ const DEFAULT_FULL_FEATURES_ARTIFACTS = {
metaTransactions: artifacts.MetaTransactionsFeature,
nativeOrders: artifacts.NativeOrdersFeature,
feeCollectorController: artifacts.FeeCollectorController,
otcOrders: artifacts.OtcOrdersFeature,
};
/**
@@ -222,6 +226,18 @@ export async function deployFullFeaturesAsync(
_config.protocolFeeMultiplier,
)
).address,
otcOrders:
features.otcOrders ||
(
await OtcOrdersFeatureContract.deployFrom0xArtifactAsync(
_featureArtifacts.otcOrders,
provider,
txDefaults,
artifacts,
_config.zeroExAddress,
_config.wethAddress,
)
).address,
};
}

View File

@@ -1,4 +1,33 @@
[
{
"timestamp": 1635903615,
"version": "16.30.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "16.30.0",
"changes": [
{
"note": "Fantom deployment",
"pr": 347
}
],
"timestamp": 1634668033
},
{
"version": "16.29.3",
"changes": [
{
"note": "Update neon-router version and address breaking changes",
"pr": 344
}
],
"timestamp": 1634553393
},
{
"version": "16.29.2",
"changes": [

View File

@@ -5,6 +5,18 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v16.30.1 - _November 3, 2021_
* Dependencies updated
## v16.30.0 - _October 19, 2021_
* Fantom deployment (#347)
## v16.29.3 - _October 18, 2021_
* Update neon-router version and address breaking changes (#344)
## v16.29.2 - _October 13, 2021_
* Check MAX_IN_RATIO in sampleBuysFromBalancer (#338)

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/asset-swapper",
"version": "16.29.2",
"version": "16.30.1",
"engines": {
"node": ">=6.12"
},
@@ -60,14 +60,14 @@
"dependencies": {
"@0x/assert": "^3.0.29",
"@0x/base-contract": "^6.4.2",
"@0x/contract-addresses": "^6.7.0",
"@0x/contract-wrappers": "^13.18.0",
"@0x/contracts-erc20": "^3.3.20",
"@0x/contracts-zero-ex": "^0.29.1",
"@0x/contract-addresses": "^6.8.1",
"@0x/contract-wrappers": "^13.18.2",
"@0x/contracts-erc20": "^3.3.22",
"@0x/contracts-zero-ex": "^0.29.3",
"@0x/dev-utils": "^4.2.9",
"@0x/json-schemas": "^6.3.0",
"@0x/neon-router": "^0.1.3",
"@0x/protocol-utils": "^1.9.2",
"@0x/neon-router": "^0.2.1",
"@0x/protocol-utils": "^1.9.4",
"@0x/quote-server": "^6.0.6",
"@0x/types": "^3.3.4",
"@0x/typescript-typings": "^5.2.1",
@@ -98,10 +98,10 @@
"@0x/contracts-exchange": "^3.2.38",
"@0x/contracts-exchange-libs": "^4.3.37",
"@0x/contracts-gen": "^2.0.40",
"@0x/contracts-test-utils": "^5.4.11",
"@0x/contracts-utils": "^4.8.1",
"@0x/contracts-test-utils": "^5.4.13",
"@0x/contracts-utils": "^4.8.3",
"@0x/mesh-rpc-client": "^9.4.2",
"@0x/migrations": "^8.1.8",
"@0x/migrations": "^8.1.10",
"@0x/sol-compiler": "^4.7.5",
"@0x/subproviders": "^6.6.0",
"@0x/ts-doc-gen": "^0.0.28",

View File

@@ -11,8 +11,10 @@ import {
COMETHSWAP_ROUTER_BY_CHAIN_ID,
COMPONENT_POOLS_BY_CHAIN_ID,
CRYPTO_COM_ROUTER_BY_CHAIN_ID,
CURVE_FANTOM_INFOS,
CURVE_MAINNET_INFOS,
CURVE_POLYGON_INFOS,
CURVE_V2_FANTOM_INFOS,
CURVE_V2_MAINNET_INFOS,
CURVE_V2_POLYGON_INFOS,
DFYN_ROUTER_BY_CHAIN_ID,
@@ -40,6 +42,8 @@ import {
SMOOTHY_BSC_INFOS,
SMOOTHY_MAINNET_INFOS,
SNOWSWAP_MAINNET_INFOS,
SPIRITSWAP_ROUTER_BY_CHAIN_ID,
SPOOKYSWAP_ROUTER_BY_CHAIN_ID,
SUSHISWAP_ROUTER_BY_CHAIN_ID,
SWERVE_MAINNET_INFOS,
TRADER_JOE_ROUTER_BY_CHAIN_ID,
@@ -133,6 +137,15 @@ export function getCurveInfosForPair(chainId: ChainId, takerToken: string, maker
[makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
case ChainId.Fantom:
return Object.values(CURVE_FANTOM_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) &&
[makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
default:
return [];
}
@@ -159,6 +172,15 @@ export function getCurveV2InfosForPair(chainId: ChainId, takerToken: string, mak
[makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
case ChainId.Fantom:
return Object.values(CURVE_V2_FANTOM_INFOS).filter(c =>
[makerToken, takerToken].every(
t =>
(c.tokens.includes(t) && c.metaTokens === undefined) ||
(c.tokens.includes(t) &&
[makerToken, takerToken].filter(v => c.metaTokens?.includes(v)).length > 0),
),
);
default:
return [];
}
@@ -443,7 +465,9 @@ export function uniswapV2LikeRouterAddress(
| ERC20BridgeSource.ShibaSwap
| ERC20BridgeSource.JetSwap
| ERC20BridgeSource.TraderJoe
| ERC20BridgeSource.Pangolin,
| ERC20BridgeSource.Pangolin
| ERC20BridgeSource.SpookySwap
| ERC20BridgeSource.SpiritSwap,
): string {
switch (source) {
case ERC20BridgeSource.UniswapV2:
@@ -484,6 +508,10 @@ export function uniswapV2LikeRouterAddress(
return PANGOLIN_ROUTER_BY_CHAIN_ID[chainId];
case ERC20BridgeSource.TraderJoe:
return TRADER_JOE_ROUTER_BY_CHAIN_ID[chainId];
case ERC20BridgeSource.SpookySwap:
return SPOOKYSWAP_ROUTER_BY_CHAIN_ID[chainId];
case ERC20BridgeSource.SpiritSwap:
return SPIRITSWAP_ROUTER_BY_CHAIN_ID[chainId];
default:
throw new Error(`Unknown UniswapV2 like source ${source}`);
}

View File

@@ -57,6 +57,7 @@ function valueByChainId<T>(rest: Partial<{ [key in ChainId]: T }>, defaultValue:
[ChainId.Polygon]: defaultValue,
[ChainId.PolygonMumbai]: defaultValue,
[ChainId.Avalanche]: defaultValue,
[ChainId.Fantom]: defaultValue,
...(rest || {}),
};
}
@@ -163,6 +164,14 @@ export const SELL_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
ERC20BridgeSource.TraderJoe,
ERC20BridgeSource.SushiSwap,
]),
[ChainId.Fantom]: new SourceFilters([
ERC20BridgeSource.MultiHop,
ERC20BridgeSource.Curve,
ERC20BridgeSource.CurveV2,
ERC20BridgeSource.SpiritSwap,
ERC20BridgeSource.SpookySwap,
ERC20BridgeSource.SushiSwap,
]),
},
new SourceFilters([]),
);
@@ -269,6 +278,14 @@ export const BUY_SOURCE_FILTER_BY_CHAIN_ID = valueByChainId<SourceFilters>(
ERC20BridgeSource.TraderJoe,
ERC20BridgeSource.SushiSwap,
]),
[ChainId.Fantom]: new SourceFilters([
ERC20BridgeSource.MultiHop,
ERC20BridgeSource.Curve,
ERC20BridgeSource.CurveV2,
ERC20BridgeSource.SpiritSwap,
ERC20BridgeSource.SpookySwap,
ERC20BridgeSource.SushiSwap,
]),
},
new SourceFilters([]),
);
@@ -288,6 +305,7 @@ export const FEE_QUOTE_SOURCES_BY_CHAIN_ID = valueByChainId<ERC20BridgeSource[]>
[ChainId.Ropsten]: [ERC20BridgeSource.UniswapV2, ERC20BridgeSource.SushiSwap],
[ChainId.Polygon]: [ERC20BridgeSource.QuickSwap, ERC20BridgeSource.SushiSwap],
[ChainId.Avalanche]: [ERC20BridgeSource.Pangolin, ERC20BridgeSource.TraderJoe, ERC20BridgeSource.SushiSwap],
[ChainId.Fantom]: [ERC20BridgeSource.SpiritSwap, ERC20BridgeSource.SpookySwap, ERC20BridgeSource.SushiSwap],
},
[],
);
@@ -435,6 +453,16 @@ export const AVALANCHE_TOKENS = {
DAI: '0xd586e7f844cea2f87f50152665bcbc2c279d8d70',
};
export const FANTOM_TOKENS = {
WFTM: '0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83',
WETH: '0x74b23882a30290451a17c44f4f05243b6b58c76d',
USDC: '0x04068da6c83afcfa0e13ba15a6696662335d5b75',
DAI: '0x8d11ec38a3eb5e956b052f67da8bdc9bef8abf3e',
fUSDT: '0x049d68029688eabf473097a2fc38ef61633a3c7a',
WBTC: '0x321162cd933e2be498cd2267a90534a804051b11',
renBTC: '0xdbf31df14b66535af65aac99c32e9ea844e14501',
};
export const CURVE_POOLS = {
compound: '0xa2b47e3d5c44877cca798226b7b8118f9bfb7a56', // 0.Compound
// 1.USDT is dead
@@ -496,6 +524,16 @@ export const CURVE_V2_POLYGON_POOLS = {
atricrypto3: '0x1d8b86e3d88cdb2d34688e87e72f388cb541b7c8',
};
export const CURVE_FANTOM_POOLS = {
fUSDT: '0x92d5ebf3593a92888c25c0abef126583d4b5312e',
twoPool: '0x27e611fd27b276acbd5ffd632e5eaebec9761e40',
ren: '0x3ef6a01a0f81d6046290f3e2a8c5b843e738e604',
};
export const CURVE_V2_FANTOM_POOLS = {
tricrypto: '0x3a1659ddcf2339be3aea159ca010979fb49155ff',
};
export const SWERVE_POOLS = {
y: '0x329239599afb305da0a2ec69c58f8a6697f9f88d',
};
@@ -594,6 +632,7 @@ export const DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID = valueByChainId<string[]>(
AVALANCHE_TOKENS.DAI,
AVALANCHE_TOKENS.USDT,
],
[ChainId.Fantom]: [FANTOM_TOKENS.WFTM, FANTOM_TOKENS.WETH, FANTOM_TOKENS.DAI, FANTOM_TOKENS.USDC],
},
[],
);
@@ -622,6 +661,9 @@ export const DEFAULT_TOKEN_ADJACENCY_GRAPH_BY_CHAIN_ID = valueByChainId<TokenAdj
[ChainId.Avalanche]: new TokenAdjacencyGraphBuilder({
default: DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Avalanche],
}).build(),
[ChainId.Fantom]: new TokenAdjacencyGraphBuilder({
default: DEFAULT_INTERMEDIATE_TOKENS_BY_CHAIN_ID[ChainId.Fantom],
}).build(),
},
new TokenAdjacencyGraphBuilder({ default: [] }).build(),
);
@@ -636,6 +678,7 @@ export const NATIVE_FEE_TOKEN_BY_CHAIN_ID = valueByChainId<string>(
[ChainId.Kovan]: getContractAddressesForChainOrThrow(ChainId.Kovan).etherToken,
[ChainId.Polygon]: getContractAddressesForChainOrThrow(ChainId.Polygon).etherToken,
[ChainId.Avalanche]: getContractAddressesForChainOrThrow(ChainId.Avalanche).etherToken,
[ChainId.Fantom]: getContractAddressesForChainOrThrow(ChainId.Fantom).etherToken,
},
NULL_ADDRESS,
);
@@ -956,6 +999,33 @@ export const CURVE_V2_POLYGON_INFOS: { [name: string]: CurveInfo } = {
}),
};
// TODO: modify gasSchedule
export const CURVE_FANTOM_INFOS: { [name: string]: CurveInfo } = {
[CURVE_FANTOM_POOLS.ren]: createCurveExchangePool({
tokens: [FANTOM_TOKENS.WBTC, FANTOM_TOKENS.renBTC],
pool: CURVE_FANTOM_POOLS.ren,
gasSchedule: 171e3,
}),
[CURVE_FANTOM_POOLS.twoPool]: createCurveExchangePool({
tokens: [FANTOM_TOKENS.DAI, FANTOM_TOKENS.USDC],
pool: CURVE_FANTOM_POOLS.twoPool,
gasSchedule: 176e3,
}),
[CURVE_FANTOM_POOLS.fUSDT]: createCurveExchangeUnderlyingPool({
tokens: [FANTOM_TOKENS.fUSDT, FANTOM_TOKENS.DAI, FANTOM_TOKENS.USDC],
pool: CURVE_FANTOM_POOLS.fUSDT,
gasSchedule: 587e3,
}),
};
export const CURVE_V2_FANTOM_INFOS: { [name: string]: CurveInfo } = {
[CURVE_V2_FANTOM_POOLS.tricrypto]: createCurveExchangeV2Pool({
tokens: [FANTOM_TOKENS.fUSDT, FANTOM_TOKENS.WBTC, FANTOM_TOKENS.WETH],
pool: CURVE_V2_FANTOM_POOLS.tricrypto,
gasSchedule: 300e3,
}),
};
export const SWERVE_MAINNET_INFOS: { [name: string]: CurveInfo } = {
[SWERVE_POOLS.y]: createCurveExchangePool({
tokens: [MAINNET_TOKENS.DAI, MAINNET_TOKENS.USDC, MAINNET_TOKENS.USDT, MAINNET_TOKENS.TUSD],
@@ -1249,6 +1319,7 @@ export const SUSHISWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
[ChainId.Ropsten]: '0x1b02da8cb0d097eb8d57a175b88c7d8b47997506',
[ChainId.Polygon]: '0x1b02da8cb0d097eb8d57a175b88c7d8b47997506',
[ChainId.Avalanche]: '0x1b02da8cb0d097eb8d57a175b88c7d8b47997506',
[ChainId.Fantom]: '0x1b02da8cb0d097eb8d57a175b88c7d8b47997506',
},
NULL_ADDRESS,
);
@@ -1619,6 +1690,20 @@ export const TRADER_JOE_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
NULL_ADDRESS,
);
export const SPIRITSWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
{
[ChainId.Fantom]: '0x16327e3fbdaca3bcf7e38f5af2599d2ddc33ae52',
},
NULL_ADDRESS,
);
export const SPOOKYSWAP_ROUTER_BY_CHAIN_ID = valueByChainId<string>(
{
[ChainId.Fantom]: '0xf491e7b69e4244ad4002bc14e878a34207e38c29',
},
NULL_ADDRESS,
);
export const VIP_ERC20_BRIDGE_SOURCES_BY_CHAIN_ID = valueByChainId<ERC20BridgeSource[]>(
{
[ChainId.Mainnet]: [ERC20BridgeSource.UniswapV2, ERC20BridgeSource.SushiSwap, ERC20BridgeSource.UniswapV3],
@@ -1769,6 +1854,12 @@ export const DEFAULT_GAS_SCHEDULE: Required<FeeSchedule> = {
//
[ERC20BridgeSource.Pangolin]: uniswapV2CloneGasSchedule,
[ERC20BridgeSource.TraderJoe]: uniswapV2CloneGasSchedule,
//
// Fantom
//
[ERC20BridgeSource.SpiritSwap]: uniswapV2CloneGasSchedule,
[ERC20BridgeSource.SpookySwap]: uniswapV2CloneGasSchedule,
};
export const DEFAULT_FEE_SCHEDULE: Required<FeeSchedule> = { ...DEFAULT_GAS_SCHEDULE };

View File

@@ -184,6 +184,10 @@ export function getErc20BridgeSourceToBridgeSource(source: ERC20BridgeSource): s
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'Pangolin');
case ERC20BridgeSource.TraderJoe:
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'TraderJoe');
case ERC20BridgeSource.SpiritSwap:
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'SpiritSwap');
case ERC20BridgeSource.SpookySwap:
return encodeBridgeSourceId(BridgeProtocol.UniswapV2, 'SpookySwap');
default:
throw new Error(AggregationError.NoBridgeForSource);
}
@@ -260,6 +264,8 @@ export function createBridgeDataForBridgeOrder(order: OptimizedMarketBridgeOrder
case ERC20BridgeSource.JetSwap:
case ERC20BridgeSource.Pangolin:
case ERC20BridgeSource.TraderJoe:
case ERC20BridgeSource.SpiritSwap:
case ERC20BridgeSource.SpookySwap:
const uniswapV2FillData = (order as OptimizedMarketBridgeOrder<UniswapV2FillData>).fillData;
bridgeData = encoder.encode([uniswapV2FillData.router, uniswapV2FillData.tokenAddressPath]);
break;
@@ -450,6 +456,8 @@ export const BRIDGE_ENCODERS: {
[ERC20BridgeSource.ShibaSwap]: routerAddressPathEncoder,
[ERC20BridgeSource.Pangolin]: routerAddressPathEncoder,
[ERC20BridgeSource.TraderJoe]: routerAddressPathEncoder,
[ERC20BridgeSource.SpiritSwap]: routerAddressPathEncoder,
[ERC20BridgeSource.SpookySwap]: routerAddressPathEncoder,
// BSC
[ERC20BridgeSource.PancakeSwap]: routerAddressPathEncoder,
[ERC20BridgeSource.PancakeSwapV2]: routerAddressPathEncoder,

View File

@@ -213,7 +213,8 @@ function findRoutesAndCreateOptimalPath(
};
const before = performance.now();
const allSourcesRustRoute = route(rustArgs, RUST_ROUTER_NUM_SAMPLES);
const allSourcesRustRoute = new Float64Array(rustArgs.pathsIn.length);
route(rustArgs, allSourcesRustRoute, RUST_ROUTER_NUM_SAMPLES);
DEFAULT_INFO_LOGGER(
{ router: 'neon-router', performanceMs: performance.now() - before, type: 'real' },
'Rust router real routing performance',

View File

@@ -1197,6 +1197,8 @@ export class SamplerOperations {
case ERC20BridgeSource.JetSwap:
case ERC20BridgeSource.Pangolin:
case ERC20BridgeSource.TraderJoe:
case ERC20BridgeSource.SpiritSwap:
case ERC20BridgeSource.SpookySwap:
const uniLikeRouter = uniswapV2LikeRouterAddress(this.chainId, source);
if (!isValidAddress(uniLikeRouter)) {
return [];
@@ -1466,6 +1468,8 @@ export class SamplerOperations {
case ERC20BridgeSource.JetSwap:
case ERC20BridgeSource.Pangolin:
case ERC20BridgeSource.TraderJoe:
case ERC20BridgeSource.SpiritSwap:
case ERC20BridgeSource.SpookySwap:
const uniLikeRouter = uniswapV2LikeRouterAddress(this.chainId, source);
if (!isValidAddress(uniLikeRouter)) {
return [];

View File

@@ -93,6 +93,9 @@ export enum ERC20BridgeSource {
// Avalanche
Pangolin = 'Pangolin',
TraderJoe = 'TraderJoe',
// Fantom
SpiritSwap = 'SpiritSwap',
SpookySwap = 'SpookySwap',
}
export type SourcesWithPoolsCache = ERC20BridgeSource.Balancer | ERC20BridgeSource.BalancerV2 | ERC20BridgeSource.Cream;

View File

@@ -1,4 +1,23 @@
[
{
"timestamp": 1635903615,
"version": "6.8.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "6.8.0",
"changes": [
{
"note": "Fantom deployment",
"pr": 347
}
],
"timestamp": 1634668033
},
{
"version": "6.7.0",
"changes": [

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v6.8.1 - _November 3, 2021_
* Dependencies updated
## v6.8.0 - _October 19, 2021_
* Fantom deployment (#347)
## v6.7.0 - _September 1, 2021_
* Avalanche deployment (#312)

View File

@@ -244,11 +244,11 @@
"exchangeProxyLiquidityProviderSandbox": "0x0000000000000000000000000000000000000000",
"zrxTreasury": "0x0000000000000000000000000000000000000000",
"transformers": {
"wethTransformer": "0xc6b0d3c45a6b5092808196cb00df5c357d55e1d5",
"payTakerTransformer": "0x7209185959d7227fb77274e1e88151d7c4c368d3",
"affiliateFeeTransformer": "0x3f16ca81691dab9184cb4606c361d73c4fd2510a",
"fillQuoteTransformer": "0x99356167edba8fbdc36959e3f5d0c43d1ba9c6db",
"positiveSlippageFeeTransformer": "0x45b3a72221e571017c0f0ec42189e11d149d0ace"
"wethTransformer": "0x7209185959d7227fb77274e1e88151d7c4c368d3",
"payTakerTransformer": "0x3f16ca81691dab9184cb4606c361d73c4fd2510a",
"affiliateFeeTransformer": "0x99356167edba8fbdc36959e3f5d0c43d1ba9c6db",
"fillQuoteTransformer": "0x45b3a72221e571017c0f0ec42189e11d149d0ace",
"positiveSlippageFeeTransformer": "0xdd66c23e07b4d6925b6089b5fe6fc9e62941afe8"
}
},
"137": {
@@ -376,5 +376,47 @@
"fillQuoteTransformer": "0x8a5417dd7ffde61ec61e11b45797e16686e1d6b9",
"positiveSlippageFeeTransformer": "0x470ba89da18a6db6e8a0567b3c9214b960861857"
}
},
"250": {
"erc20Proxy": "0x0000000000000000000000000000000000000000",
"erc721Proxy": "0x0000000000000000000000000000000000000000",
"zrxToken": "0x0000000000000000000000000000000000000000",
"etherToken": "0x21be370d5312f44cb42ce377bc9b8a0cef1a4c83",
"exchangeV2": "0x0000000000000000000000000000000000000000",
"exchange": "0x0000000000000000000000000000000000000000",
"assetProxyOwner": "0x0000000000000000000000000000000000000000",
"zeroExGovernor": "0x0000000000000000000000000000000000000000",
"forwarder": "0x0000000000000000000000000000000000000000",
"coordinatorRegistry": "0x0000000000000000000000000000000000000000",
"coordinator": "0x0000000000000000000000000000000000000000",
"multiAssetProxy": "0x0000000000000000000000000000000000000000",
"staticCallProxy": "0x0000000000000000000000000000000000000000",
"erc1155Proxy": "0x0000000000000000000000000000000000000000",
"devUtils": "0x0000000000000000000000000000000000000000",
"zrxVault": "0x0000000000000000000000000000000000000000",
"staking": "0x0000000000000000000000000000000000000000",
"stakingProxy": "0x0000000000000000000000000000000000000000",
"erc20BridgeProxy": "0x0000000000000000000000000000000000000000",
"erc20BridgeSampler": "0x0000000000000000000000000000000000000000",
"chaiBridge": "0x0000000000000000000000000000000000000000",
"dydxBridge": "0x0000000000000000000000000000000000000000",
"godsUnchainedValidator": "0x0000000000000000000000000000000000000000",
"broker": "0x0000000000000000000000000000000000000000",
"chainlinkStopLimit": "0x0000000000000000000000000000000000000000",
"maximumGasPrice": "0x0000000000000000000000000000000000000000",
"dexForwarderBridge": "0x0000000000000000000000000000000000000000",
"exchangeProxyGovernor": "0xf760c5b88d970d6f97e64e264dac5a3767dafd74",
"exchangeProxy": "0xdef189deaef76e379df891899eb5a00a94cbc250",
"exchangeProxyTransformerDeployer": "0x47f01db18a38261e4cb153bae6db7d3743acb33c",
"exchangeProxyFlashWallet": "0xb4d961671cadfed687e040b076eee29840c142e5",
"exchangeProxyLiquidityProviderSandbox": "0xca64d4225804f2ae069760cb5ff2f1d8bac1c2f9",
"zrxTreasury": "0x0000000000000000000000000000000000000000",
"transformers": {
"wethTransformer": "0x9b6aa8f26a92108e7d1f66373d757bb955112703",
"payTakerTransformer": "0x32df54951d33d7460e15fa59b1fcc262183ce4c2",
"affiliateFeeTransformer": "0x67efa679a4b56c38713d478e649c88247f4f8e88",
"fillQuoteTransformer": "0x71de60a1b160094a3f6c7e1b883ff9337d639131",
"positiveSlippageFeeTransformer": "0xe87d69b285005cc82b53b844322652c49ed64600"
}
}
}

View File

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

View File

@@ -53,6 +53,7 @@ export enum ChainId {
Polygon = 137,
PolygonMumbai = 80001,
Avalanche = 43114,
Fantom = 250,
}
/**

View File

@@ -1,4 +1,22 @@
[
{
"timestamp": 1635903615,
"version": "13.18.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1634668033,
"version": "13.18.1",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"version": "13.18.0",
"changes": [

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v13.18.2 - _November 3, 2021_
* Dependencies updated
## v13.18.1 - _October 19, 2021_
* Dependencies updated
## v13.18.0 - _September 29, 2021_
* Update IZeroEx and ITransformERC20 wrappers (#282)

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/contract-wrappers",
"version": "13.18.0",
"version": "13.18.2",
"engines": {
"node": ">=6.12"
},
@@ -57,7 +57,7 @@
"dependencies": {
"@0x/assert": "^3.0.29",
"@0x/base-contract": "^6.4.2",
"@0x/contract-addresses": "^6.7.0",
"@0x/contract-addresses": "^6.8.1",
"@0x/json-schemas": "^6.3.0",
"@0x/types": "^3.3.4",
"@0x/utils": "^6.4.4",

View File

@@ -1,4 +1,23 @@
[
{
"version": "8.1.10",
"changes": [
{
"note": "Add OtcOrders to fullMigrateAsync",
"pr": 350
}
],
"timestamp": 1635903615
},
{
"timestamp": 1634668033,
"version": "8.1.9",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1633374058,
"version": "8.1.8",

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v8.1.10 - _November 3, 2021_
* Add OtcOrders to fullMigrateAsync (#350)
## v8.1.9 - _October 19, 2021_
* Dependencies updated
## v8.1.8 - _October 4, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/migrations",
"version": "8.1.8",
"version": "8.1.10",
"engines": {
"node": ">=6.12"
},
@@ -68,20 +68,20 @@
},
"dependencies": {
"@0x/base-contract": "^6.4.2",
"@0x/contract-addresses": "^6.7.0",
"@0x/contract-addresses": "^6.8.1",
"@0x/contracts-asset-proxy": "^3.7.19",
"@0x/contracts-coordinator": "^3.1.38",
"@0x/contracts-dev-utils": "^1.3.36",
"@0x/contracts-erc1155": "^2.1.37",
"@0x/contracts-erc20": "^3.3.20",
"@0x/contracts-erc20": "^3.3.22",
"@0x/contracts-erc721": "^3.1.37",
"@0x/contracts-exchange": "^3.2.38",
"@0x/contracts-exchange-forwarder": "^4.2.38",
"@0x/contracts-extensions": "^6.2.32",
"@0x/contracts-multisig": "^4.1.38",
"@0x/contracts-staking": "^2.0.45",
"@0x/contracts-utils": "^4.8.1",
"@0x/contracts-zero-ex": "^0.29.1",
"@0x/contracts-utils": "^4.8.3",
"@0x/contracts-zero-ex": "^0.29.3",
"@0x/sol-compiler": "^4.7.5",
"@0x/subproviders": "^6.6.0",
"@0x/typescript-typings": "^5.2.1",

View File

@@ -1,4 +1,22 @@
[
{
"timestamp": 1635903615,
"version": "1.9.4",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1634668033,
"version": "1.9.3",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1633374058,
"version": "1.9.2",

View File

@@ -5,6 +5,14 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.9.4 - _November 3, 2021_
* Dependencies updated
## v1.9.3 - _October 19, 2021_
* Dependencies updated
## v1.9.2 - _October 4, 2021_
* Dependencies updated

View File

@@ -1,6 +1,6 @@
{
"name": "@0x/protocol-utils",
"version": "1.9.2",
"version": "1.9.4",
"engines": {
"node": ">=6.12"
},
@@ -63,8 +63,8 @@
},
"dependencies": {
"@0x/assert": "^3.0.29",
"@0x/contract-addresses": "^6.7.0",
"@0x/contract-wrappers": "^13.18.0",
"@0x/contract-addresses": "^6.8.1",
"@0x/contract-wrappers": "^13.18.2",
"@0x/json-schemas": "^6.3.0",
"@0x/subproviders": "^6.6.0",
"@0x/utils": "^6.4.4",

View File

@@ -959,10 +959,10 @@
typedoc "~0.16.11"
yargs "^10.0.3"
"@0x/neon-router@^0.1.3":
version "0.1.3"
resolved "https://registry.yarnpkg.com/@0x/neon-router/-/neon-router-0.1.3.tgz#70da4c17ca4b59dfe8b5e539673e364a70e62ebd"
integrity sha512-EfdrG829NalYjAK5/nMTD6YyJQgUzgssL2Hvyphu1ugWxWlZ3QMM9qpZsKt82hUiyZT/64I4JJ3hkerMhTaHeg==
"@0x/neon-router@^0.2.1":
version "0.2.1"
resolved "https://registry.yarnpkg.com/@0x/neon-router/-/neon-router-0.2.1.tgz#23bb3cedc0eafd55a8ba6b6ea8a59ee4c538064b"
integrity sha512-feCCKuox4staZl8lxLY4nf5U256NcDHrgvSFra5cU/TUhoblLHb8F7eWAC9ygpukZUCVFLy13mExkFQHXlEOYw==
dependencies:
"@mapbox/node-pre-gyp" "^1.0.5"