Compare commits

..

1 Commits

Author SHA1 Message Date
Jessica Lin
631a4ca00e
Update link to 0x Protocol docs
Previous docs link pointed to deprecated docs page. Updated the link to the latest 0x Protocol orders page
2023-10-24 11:02:11 -07:00
32 changed files with 71 additions and 227 deletions

View File

@ -83,30 +83,28 @@ jobs:
-p @0x/order-utils \
-m --serial -c test:ci
# NOTE: disabled as ZRXToken.sol did not compile with the latest forge.
# TODO: re-enable once the issue is resolved.
- name: Run Forge build for erc20
working-directory: contracts/erc20
run: |
forge --version
forge build --sizes --skip ZRXToken
forge build --sizes
# - name: Run Forge tests for erc20
# working-directory: contracts/erc20
# run: |
# forge test -vvv --gas-report
- name: Run Forge tests for erc20
working-directory: contracts/erc20
run: |
forge test -vvv --gas-report
# - name: Run Forge coverage for erc20
# working-directory: contracts/erc20
# run: |
# forge coverage --report summary --report lcov
- name: Run Forge coverage for erc20
working-directory: contracts/erc20
run: |
forge coverage --report summary --report lcov
# - name: Upload the coverage report to Coveralls
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# base-path: ./contracts/erc20/
# path-to-lcov: ./contracts/erc20/lcov.info
- name: Upload the coverage report to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
base-path: ./contracts/erc20/
path-to-lcov: ./contracts/erc20/lcov.info
- name: Run Forge build for zero-ex
working-directory: contracts/zero-ex
@ -144,20 +142,19 @@ jobs:
forge --version
forge build --sizes
# TODO: re-enable once the issue is resolved.
# - name: Run Forge tests on governance contracts
# working-directory: ./contracts/governance
# run: |
# forge test -vvv --gas-report
- name: Run Forge tests on governance contracts
working-directory: ./contracts/governance
run: |
forge test -vvv --gas-report
# - name: Run Forge coverage on governance contracts
# working-directory: ./contracts/governance
# run: |
# forge coverage --report lcov
- name: Run Forge coverage on governance contracts
working-directory: ./contracts/governance
run: |
forge coverage --report lcov
# - name: Upload the coverage report to Coveralls
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# base-path: ./contracts/governance/
# path-to-lcov: ./contracts/governance/lcov.info
- name: Upload the coverage report to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
base-path: ./contracts/governance/
path-to-lcov: ./contracts/governance/lcov.info

View File

@ -1,13 +1,4 @@
[
{
"timestamp": 1700094997,
"version": "4.0.14",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1693346928,
"version": "4.0.13",

View File

@ -5,10 +5,6 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v4.0.14 - _November 16, 2023_
* Dependencies updated
## v4.0.13 - _August 29, 2023_
* Dependencies updated

View File

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

View File

@ -1,13 +1,4 @@
[
{
"timestamp": 1700094997,
"version": "5.4.60",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1693346928,
"version": "5.4.59",

View File

@ -5,10 +5,6 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v5.4.60 - _November 16, 2023_
* Dependencies updated
## v5.4.59 - _August 29, 2023_
* Dependencies updated

View File

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

View File

@ -1,13 +1,4 @@
[
{
"timestamp": 1700094997,
"version": "1.4.54",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1693346928,
"version": "1.4.53",

View File

@ -5,10 +5,6 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v1.4.54 - _November 16, 2023_
* Dependencies updated
## v1.4.53 - _August 29, 2023_
* Dependencies updated

View File

@ -1,6 +1,6 @@
{
"name": "@0x/contracts-treasury",
"version": "1.4.54",
"version": "1.4.53",
"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.13.0",
"@0x/contract-addresses": "^8.12.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.60",
"@0x/contracts-test-utils": "^5.4.59",
"@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.24.2",
"@0x/protocol-utils": "^11.24.1",
"@0x/subproviders": "^8.0.1",
"@0x/types": "^3.3.7",
"@0x/typescript-typings": "^5.3.1",

View File

@ -1,13 +1,4 @@
[
{
"timestamp": 1700094997,
"version": "4.8.52",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1693346928,
"version": "4.8.51",

View File

@ -5,10 +5,6 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v4.8.52 - _November 16, 2023_
* Dependencies updated
## v4.8.51 - _August 29, 2023_
* Dependencies updated

View File

@ -1,6 +1,6 @@
{
"name": "@0x/contracts-utils",
"version": "4.8.52",
"version": "4.8.51",
"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.60",
"@0x/contracts-test-utils": "^5.4.59",
"@0x/dev-utils": "^5.0.2",
"@0x/order-utils": "^10.4.28",
"@0x/sol-compiler": "^4.8.2",

View File

@ -1,13 +1,4 @@
[
{
"version": "0.49.0",
"changes": [
{
"note": "Allowlist Sepolia in AbstractBridgeAdapter"
}
],
"timestamp": 1700094997
},
{
"version": "0.48.0",
"changes": [

View File

@ -5,10 +5,6 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v0.49.0 - _November 16, 2023_
* Allowlist Sepolia in AbstractBridgeAdapter
## v0.48.0 - _August 29, 2023_
* Add VelodromeV2 support on Base

View File

@ -23,14 +23,12 @@ abstract contract AbstractBridgeAdapter is IBridgeAdapter {
assembly {
chainId := chainid()
}
// Skip chain id validation on Ganache (1337), Anvil (31337), Goerli (5), Mumbai (80001), Base Goerli (84531),
// Sepolia (11155111)
// Skip chain id validation on Ganache (1337), Anvil (31337), Goerli (5), Mumbai (80001), Base Goerli (84531)
bool skipValidation = (chainId == 1337 ||
chainId == 31337 ||
chainId == 5 ||
chainId == 80001 ||
chainId == 84531 ||
chainId == 11155111);
chainId == 84531);
if (chainId != expectedChainId && !skipValidation) {
revert(string(abi.encodePacked(expectedChainName, "BridgeAdapter.constructor: wrong chain ID")));

View File

@ -1,6 +1,6 @@
{
"name": "@0x/contracts-zero-ex",
"version": "0.49.0",
"version": "0.48.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.13.0",
"@0x/contract-addresses": "^8.12.0",
"@0x/contracts-erc20": "^3.3.57",
"@0x/contracts-gen": "^2.0.50",
"@0x/contracts-test-utils": "^5.4.60",
"@0x/contracts-test-utils": "^5.4.59",
"@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.24.2",
"@0x/protocol-utils": "^11.24.1",
"@0x/subproviders": "^8.0.1",
"@0x/types": "^3.3.7",
"@0x/typescript-typings": "^5.3.1",

View File

@ -66,8 +66,3 @@ Note: Some addresses have changed across various networks
Avalanche, `0xdef1c0ded9bec7f1a1670819833240f027b25eff <https://snowtrace.io/address/0xdef1c0ded9bec7f1a1670819833240f027b25eff>`__
Fantom, `0xdef189deaef76e379df891899eb5a00a94cbc250 <https://ftmscan.com/address/0xdef189deaef76e379df891899eb5a00a94cbc250>`__
Celo, `0xdef1c0ded9bec7f1a1670819833240f027b25eff <https://explorer.celo.org/address/0xdef1c0ded9bec7f1a1670819833240f027b25eff>`__
Arbitrum, `0xdef1c0ded9bec7f1a1670819833240f027b25eff <https://arbiscan.io/address/0xdef1c0ded9bec7f1a1670819833240f027b25eff>`__
Base, `0xdef1c0ded9bec7f1a1670819833240f027b25eff <https://basescan.org/address/0xdef1c0ded9bec7f1a1670819833240f027b25eff>`__
zkEVM, `0xdef1c0ded9bec7f1a1670819833240f027b25eff <https://zkevm.polygonscan.com/address/0xdef1c0ded9bec7f1a1670819833240f027b25eff>`__
Sepolia, `0xdef1c0ded9bec7f1a1670819833240f027b25eff <https://sepolia.etherscan.io/address/0xdef1c0ded9bec7f1a1670819833240f027b25eff>`__
Mumbai, `0xf471d32cb40837bf24529fcf17418fc1a4807626 <https://mumbai.polygonscan.com/address/0xf471d32cb40837bf24529fcf17418fc1a4807626>`__

View File

@ -1,5 +0,0 @@
{
"opRetro": {
"projectId": "0x0fad18f37ecec4f4f4ca18e60c353eb11462363e8aa14562b5d96af54108d106"
}
}

View File

@ -1,13 +1,4 @@
[
{
"version": "8.13.0",
"changes": [
{
"note": "Add Sepolia addresses"
}
],
"timestamp": 1700094997
},
{
"version": "8.12.0",
"changes": [

View File

@ -6,9 +6,6 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v8.13.0 - _November 16, 2023_
* Add Sepolia addresses
## v8.12.0 - _August 29, 2023_
* Add VelodromeV2 support on Base

View File

@ -274,28 +274,5 @@
"fillQuoteTransformer": "0x2c46d57bb5af87a13a51dd5b62ba7d3bc7e12e9c",
"positiveSlippageFeeTransformer": "0xf98a130d3b4029c70e6d93098cb82a003421341e"
}
},
"11155111": {
"zrxToken": "0x0000000000000000000000000000000000000000",
"etherToken": "0xfff9976782d46cc05630d1f6ebab18b2324d6b14",
"zeroExGovernor": "0x5c1f7772ce24d942b85e9b6576f7b5ef70686f5a",
"zrxVault": "0x0000000000000000000000000000000000000000",
"staking": "0x0000000000000000000000000000000000000000",
"stakingProxy": "0x0000000000000000000000000000000000000000",
"erc20BridgeProxy": "0x0000000000000000000000000000000000000000",
"erc20BridgeSampler": "0x0000000000000000000000000000000000000000",
"exchangeProxyGovernor": "0x5c1f7772ce24d942b85e9b6576f7b5ef70686f5a",
"exchangeProxy": "0xdef1c0ded9bec7f1a1670819833240f027b25eff",
"exchangeProxyTransformerDeployer": "0x58bca53ebba1aaf25f0edcd8dad6421872fe20b2",
"exchangeProxyFlashWallet": "0xdb6f1920a889355780af7570773609bd8cb1f498",
"exchangeProxyLiquidityProviderSandbox": "0x0000000000000000000000000000000000000000",
"zrxTreasury": "0x0000000000000000000000000000000000000000",
"transformers": {
"wethTransformer": "0xf98a130d3b4029c70e6d93098cb82a003421341e",
"payTakerTransformer": "0x44e0f3975e95387f3866dd7cab1f51050394a3d1",
"affiliateFeeTransformer": "0x5cc22a0e06ea11097c612a962e63674b90e96099",
"fillQuoteTransformer": "0x63186ea36e78ecbf0128e448362f1b81e9bf7412",
"positiveSlippageFeeTransformer": "0x9e52d8b32d835206d09810c310593bcc77264066"
}
}
}

View File

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

View File

@ -1,16 +1,20 @@
import addresses from '../addresses.json';
export interface ContractAddresses {
erc20BridgeProxy: string;
erc20BridgeSampler: string;
zrxToken: string;
etherToken: string;
exchangeProxy: string;
exchangeProxyFlashWallet: string;
exchangeProxyGovernor: string;
exchangeProxyLiquidityProviderSandbox: string;
exchangeProxyTransformerDeployer: string;
zeroExGovernor: string;
zrxVault: string;
staking: string;
stakingProxy: string;
erc20BridgeProxy: string;
erc20BridgeSampler: string;
exchangeProxyGovernor: string;
exchangeProxy: string;
exchangeProxyTransformerDeployer: string;
exchangeProxyFlashWallet: string;
exchangeProxyLiquidityProviderSandbox: string;
zrxTreasury: string;
transformers: {
wethTransformer: string;
payTakerTransformer: string;
@ -18,33 +22,21 @@ export interface ContractAddresses {
affiliateFeeTransformer: string;
positiveSlippageFeeTransformer: string;
};
zeroExGovernor: string;
zrxToken: string;
zrxTreasury: string;
zrxVault: string;
}
export enum ChainId {
Mainnet = 1,
Goerli = 5,
Optimism = 10,
Ganache = 1337,
BSC = 56,
Polygon = 137,
Fantom = 250,
Ganache = 1337,
Base = 8453,
Arbitrum = 42161,
Avalanche = 43114,
Celo = 42220,
PolygonMumbai = 80001,
Sepolia = 11155111
}
/**
* Narrow a JavaScript number to a Chain ID.
*/
export function isChainId(chainId: number): chainId is ChainId {
return Object.values(ChainId).includes(chainId);
Avalanche = 43114,
Fantom = 250,
Celo = 42220,
Optimism = 10,
Arbitrum = 42161,
Base = 8453,
}
/**

View File

@ -2,7 +2,7 @@ import * as chai from 'chai';
import { bufferToHex, rlphash } from 'ethereumjs-util';
import 'mocha';
import { ChainId, getContractAddressesForChainOrThrow, isChainId } from '../src';
import { ChainId, getContractAddressesForChainOrThrow } from '../src';
const expect = chai.expect;
@ -68,12 +68,3 @@ describe('addresses.json sanity test', () => {
});
});
});
describe("isChainId", () => {
it("should return true for existing chain ids", () => {
expect(isChainId(1)).to.be.true;
});
it("should return false for non-existing chain ids", () => {
expect(isChainId(666)).to.be.false;
});
});

View File

@ -1,13 +1,4 @@
[
{
"timestamp": 1700094997,
"version": "13.23.8",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1693346928,
"version": "13.23.7",

View File

@ -6,9 +6,6 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v13.23.8 - _November 16, 2023_
* Dependencies updated
## v13.23.7 - _August 29, 2023_
* Dependencies updated

View File

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

View File

@ -1,13 +1,4 @@
[
{
"timestamp": 1700094997,
"version": "11.24.2",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1693346928,
"version": "11.24.1",

View File

@ -6,9 +6,6 @@ Edit the package's CHANGELOG.json file only.
CHANGELOG
## v11.24.2 - _November 16, 2023_
* Dependencies updated
## v11.24.1 - _August 29, 2023_
* Dependencies updated

View File

@ -8,7 +8,7 @@
- Signatures
- EIP712 hashing
### Read the [Documentation](https://0x.org/docs/protocol/protocol-utils).
### Read the [Documentation](https://docs.0xprotocol.org/en/latest/basics/orders.html).
## Installation

View File

@ -1,6 +1,6 @@
{
"name": "@0x/protocol-utils",
"version": "11.24.2",
"version": "11.24.1",
"engines": {
"node": ">=6.12"
},
@ -62,8 +62,8 @@
},
"dependencies": {
"@0x/assert": "^3.0.36",
"@0x/contract-addresses": "^8.13.0",
"@0x/contract-wrappers": "^13.23.8",
"@0x/contract-addresses": "^8.12.0",
"@0x/contract-wrappers": "^13.23.7",
"@0x/json-schemas": "^6.4.4",
"@0x/subproviders": "^8.0.1",
"@0x/utils": "^7.0.0",