Compare commits

...

6 Commits

Author SHA1 Message Date
wonge97
b319a4dceb
[protocol] Add file for OP RPGF Round 4 Funding (#780) 2024-05-24 15:53:41 -04:00
github-actions[bot]
e66307ba31
Publish: CHANGELOG and Package Version Updates into development (#763)
* Updated CHANGELOGS & MD docs

* Publish

 - @0x/contracts-erc20@4.0.14
 - @0x/contracts-test-utils@5.4.60
 - @0x/contracts-treasury@1.4.54
 - @0x/contracts-utils@4.8.52
 - @0x/contracts-zero-ex@0.49.0
 - @0x/contract-addresses@8.13.0
 - @0x/contract-wrappers@13.23.8
 - @0x/protocol-utils@11.24.2

---------

Co-authored-by: Github Actions <github-actions@github.com>
2023-11-15 16:38:36 -08:00
Kyu
652d422622
Add Sepoia addresses (#761) 2023-11-15 15:24:11 -08:00
Kyu
5207565af8
Temporarily disable erc20 and governance in ci (#762) 2023-11-15 14:30:44 -08:00
wonge97
d982d75e2e
Update docs with missing chains that 0x protocol is deployed on (#760)
* Update docs with missing chains that 0x protocol is deployed on
2023-11-13 12:58:46 -06:00
David Walsh
c5650da703
[contract-addresses] Add ChainId type predicate (#756) 2023-11-02 16:30:05 -06:00
31 changed files with 223 additions and 67 deletions

View File

@ -83,28 +83,30 @@ 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
forge build --sizes --skip ZRXToken
- 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
@ -142,19 +144,20 @@ jobs:
forge --version
forge build --sizes
- name: Run Forge tests on governance contracts
working-directory: ./contracts/governance
run: |
forge test -vvv --gas-report
# 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 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,4 +1,13 @@
[
{
"timestamp": 1700094997,
"version": "4.0.14",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1693346928,
"version": "4.0.13",

View File

@ -5,6 +5,10 @@ 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.13",
"version": "4.0.14",
"engines": {
"node": ">=6.12"
},
@ -24,7 +24,7 @@
},
"homepage": "https://github.com/0xProject/protocol",
"devDependencies": {
"@0x/contracts-utils": "^4.8.51",
"@0x/contracts-utils": "^4.8.52",
"@0x/ts-doc-gen": "^0.0.28",
"typedoc": "~0.16.11"
},

View File

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

View File

@ -5,6 +5,10 @@ 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.59",
"version": "5.4.60",
"engines": {
"node": ">=6.12"
},
@ -41,7 +41,7 @@
"dependencies": {
"@0x/assert": "^3.0.36",
"@0x/base-contract": "^7.0.0",
"@0x/contract-addresses": "^8.12.0",
"@0x/contract-addresses": "^8.13.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": 1700094997,
"version": "1.4.54",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1693346928,
"version": "1.4.53",

View File

@ -5,6 +5,10 @@ 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.53",
"version": "1.4.54",
"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.12.0",
"@0x/contract-addresses": "^8.13.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.59",
"@0x/contracts-test-utils": "^5.4.60",
"@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.1",
"@0x/protocol-utils": "^11.24.2",
"@0x/subproviders": "^8.0.1",
"@0x/types": "^3.3.7",
"@0x/typescript-typings": "^5.3.1",

View File

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

View File

@ -5,6 +5,10 @@ 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.51",
"version": "4.8.52",
"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.59",
"@0x/contracts-test-utils": "^5.4.60",
"@0x/dev-utils": "^5.0.2",
"@0x/order-utils": "^10.4.28",
"@0x/sol-compiler": "^4.8.2",

View File

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

View File

@ -5,6 +5,10 @@ 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,12 +23,14 @@ abstract contract AbstractBridgeAdapter is IBridgeAdapter {
assembly {
chainId := chainid()
}
// Skip chain id validation on Ganache (1337), Anvil (31337), Goerli (5), Mumbai (80001), Base Goerli (84531)
// Skip chain id validation on Ganache (1337), Anvil (31337), Goerli (5), Mumbai (80001), Base Goerli (84531),
// Sepolia (11155111)
bool skipValidation = (chainId == 1337 ||
chainId == 31337 ||
chainId == 5 ||
chainId == 80001 ||
chainId == 84531);
chainId == 84531 ||
chainId == 11155111);
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.48.0",
"version": "0.49.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.12.0",
"@0x/contract-addresses": "^8.13.0",
"@0x/contracts-erc20": "^3.3.57",
"@0x/contracts-gen": "^2.0.50",
"@0x/contracts-test-utils": "^5.4.59",
"@0x/contracts-test-utils": "^5.4.60",
"@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.1",
"@0x/protocol-utils": "^11.24.2",
"@0x/subproviders": "^8.0.1",
"@0x/types": "^3.3.7",
"@0x/typescript-typings": "^5.3.1",

View File

@ -66,3 +66,8 @@ 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>`__

5
funding.json Normal file
View File

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

View File

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

View File

@ -6,6 +6,9 @@ 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,5 +274,28 @@
"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.12.0",
"version": "8.13.0",
"engines": {
"node": ">=6.12"
},

View File

@ -1,20 +1,16 @@
import addresses from '../addresses.json';
export interface ContractAddresses {
zrxToken: string;
etherToken: string;
zeroExGovernor: string;
zrxVault: string;
staking: string;
stakingProxy: string;
erc20BridgeProxy: string;
erc20BridgeSampler: string;
exchangeProxyGovernor: string;
etherToken: string;
exchangeProxy: string;
exchangeProxyTransformerDeployer: string;
exchangeProxyFlashWallet: string;
exchangeProxyGovernor: string;
exchangeProxyLiquidityProviderSandbox: string;
zrxTreasury: string;
exchangeProxyTransformerDeployer: string;
staking: string;
stakingProxy: string;
transformers: {
wethTransformer: string;
payTakerTransformer: string;
@ -22,21 +18,33 @@ export interface ContractAddresses {
affiliateFeeTransformer: string;
positiveSlippageFeeTransformer: string;
};
zeroExGovernor: string;
zrxToken: string;
zrxTreasury: string;
zrxVault: string;
}
export enum ChainId {
Mainnet = 1,
Goerli = 5,
Ganache = 1337,
Optimism = 10,
BSC = 56,
Polygon = 137,
PolygonMumbai = 80001,
Avalanche = 43114,
Fantom = 250,
Celo = 42220,
Optimism = 10,
Arbitrum = 42161,
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);
}
/**

View File

@ -2,7 +2,7 @@ import * as chai from 'chai';
import { bufferToHex, rlphash } from 'ethereumjs-util';
import 'mocha';
import { ChainId, getContractAddressesForChainOrThrow } from '../src';
import { ChainId, getContractAddressesForChainOrThrow, isChainId } from '../src';
const expect = chai.expect;
@ -68,3 +68,12 @@ 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,4 +1,13 @@
[
{
"timestamp": 1700094997,
"version": "13.23.8",
"changes": [
{
"note": "Dependencies updated"
}
]
},
{
"timestamp": 1693346928,
"version": "13.23.7",

View File

@ -6,6 +6,9 @@ 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.7",
"version": "13.23.8",
"engines": {
"node": ">=6.12"
},
@ -59,7 +59,7 @@
"dependencies": {
"@0x/assert": "^3.0.36",
"@0x/base-contract": "^7.0.0",
"@0x/contract-addresses": "^8.12.0",
"@0x/contract-addresses": "^8.13.0",
"@0x/json-schemas": "^6.4.4",
"@0x/types": "^3.3.7",
"@0x/utils": "^7.0.0",

View File

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

View File

@ -6,6 +6,9 @@ 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

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