Jacob Evans 99f5be8378
chore: [asset swapper] sampler Solidity 0.6 + Bridge addresses in AS (#4)
* Refactor excess interfaces

* Compiles on 0.6

* Refactored into try/catch

* Rebase and Refactored to v06

* Handle invalid registry in LP

* Update packages/asset-swapper/contracts/src/LiquidityProviderSampler.sol

Co-authored-by: Lawrence Forman <lawrence@0xproject.com>

* chore: [asset-swapper] Move Bridge Addresses and Gas schedule

* curve->pool

* lint

* Refactor to fix module load order

* Move FEE Schedule

* rollup: Swerve/Sushi/SnowSwap/DODO (#7)

* rollup: Swerve/Sushi

* DODO Rollup + Snowswap Swerve

* hardcode addresses temporarily

* rebase

* rename to SUSHISWAP_ROUTER

* CHANGELOGs

* CHANGELOGs

Co-authored-by: Lawrence Forman <lawrence@0xproject.com>
2020-10-27 15:16:09 +10:00

68 lines
2.0 KiB
TypeScript

import addresses from '../addresses.json';
export interface ContractAddresses {
erc20Proxy: string;
erc721Proxy: string;
zrxToken: string;
etherToken: string;
exchangeV2: string;
exchange: string;
assetProxyOwner: string;
zeroExGovernor: string;
forwarder: string;
coordinatorRegistry: string;
coordinator: string;
multiAssetProxy: string;
staticCallProxy: string;
erc1155Proxy: string;
devUtils: string;
zrxVault: string;
staking: string;
stakingProxy: string;
erc20BridgeProxy: string;
erc20BridgeSampler: string;
chaiBridge: string;
dydxBridge: string;
godsUnchainedValidator: string;
broker: string;
chainlinkStopLimit: string;
maximumGasPrice: string;
dexForwarderBridge: string;
exchangeProxyGovernor: string;
exchangeProxy: string;
exchangeProxyAllowanceTarget: string;
exchangeProxyTransformerDeployer: string;
exchangeProxyFlashWallet: string;
transformers: {
wethTransformer: string;
payTakerTransformer: string;
fillQuoteTransformer: string;
affiliateFeeTransformer: string;
};
}
export enum ChainId {
Mainnet = 1,
Ropsten = 3,
Rinkeby = 4,
Kovan = 42,
Ganache = 1337,
}
/**
* Used to get addresses of contracts that have been deployed to either the
* Ethereum mainnet or a supported testnet. Throws if there are no known
* contracts deployed on the corresponding chain.
* @param chainId The desired chainId.
* @returns The set of addresses for contracts which have been deployed on the
* given chainId.
*/
export function getContractAddressesForChainOrThrow(chainId: ChainId): ContractAddresses {
const chainToAddresses: { [chainId: number]: ContractAddresses } = addresses;
if (chainToAddresses[chainId] === undefined) {
throw new Error(`Unknown chain id (${chainId}). No known 0x contracts have been deployed on this chain.`);
}
return chainToAddresses[chainId];
}