* Update to use KNP getExpectedRateAfterFee * hack: use overrides instead of forking in ganache * fix: added some tests using overrides * override sampler * Overrides in bridge_sampler_mainnet_test * use getContracts to fake out tests * chore: supply devUtils address * feat: specify the call override by default * CHANGELOGs * export SamplerOverrides * fix package.json * fix: after rebase
476 lines
27 KiB
JSON
Generated
476 lines
27 KiB
JSON
Generated
{
|
|
"schemaVersion": "2.0.0",
|
|
"contractName": "IERC20BridgeSampler",
|
|
"compilerOutput": {
|
|
"abi": [
|
|
{
|
|
"constant": true,
|
|
"inputs": [{ "internalType": "bytes[]", "name": "callDatas", "type": "bytes[]" }],
|
|
"name": "batchCall",
|
|
"outputs": [{ "internalType": "bytes[]", "name": "callResults", "type": "bytes[]" }],
|
|
"payable": false,
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"constant": true,
|
|
"inputs": [
|
|
{ "internalType": "address", "name": "registryAddress", "type": "address" },
|
|
{ "internalType": "address", "name": "takerToken", "type": "address" },
|
|
{ "internalType": "address", "name": "makerToken", "type": "address" }
|
|
],
|
|
"name": "getLiquidityProviderFromRegistry",
|
|
"outputs": [{ "internalType": "address", "name": "providerAddress", "type": "address" }],
|
|
"payable": false,
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"constant": true,
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{ "internalType": "address", "name": "makerAddress", "type": "address" },
|
|
{ "internalType": "address", "name": "takerAddress", "type": "address" },
|
|
{ "internalType": "address", "name": "feeRecipientAddress", "type": "address" },
|
|
{ "internalType": "address", "name": "senderAddress", "type": "address" },
|
|
{ "internalType": "uint256", "name": "makerAssetAmount", "type": "uint256" },
|
|
{ "internalType": "uint256", "name": "takerAssetAmount", "type": "uint256" },
|
|
{ "internalType": "uint256", "name": "makerFee", "type": "uint256" },
|
|
{ "internalType": "uint256", "name": "takerFee", "type": "uint256" },
|
|
{ "internalType": "uint256", "name": "expirationTimeSeconds", "type": "uint256" },
|
|
{ "internalType": "uint256", "name": "salt", "type": "uint256" },
|
|
{ "internalType": "bytes", "name": "makerAssetData", "type": "bytes" },
|
|
{ "internalType": "bytes", "name": "takerAssetData", "type": "bytes" },
|
|
{ "internalType": "bytes", "name": "makerFeeAssetData", "type": "bytes" },
|
|
{ "internalType": "bytes", "name": "takerFeeAssetData", "type": "bytes" }
|
|
],
|
|
"internalType": "struct LibOrder.Order[]",
|
|
"name": "orders",
|
|
"type": "tuple[]"
|
|
},
|
|
{ "internalType": "bytes[]", "name": "orderSignatures", "type": "bytes[]" },
|
|
{ "internalType": "address", "name": "devUtilsAddress", "type": "address" }
|
|
],
|
|
"name": "getOrderFillableMakerAssetAmounts",
|
|
"outputs": [
|
|
{ "internalType": "uint256[]", "name": "orderFillableMakerAssetAmounts", "type": "uint256[]" }
|
|
],
|
|
"payable": false,
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"constant": true,
|
|
"inputs": [
|
|
{
|
|
"components": [
|
|
{ "internalType": "address", "name": "makerAddress", "type": "address" },
|
|
{ "internalType": "address", "name": "takerAddress", "type": "address" },
|
|
{ "internalType": "address", "name": "feeRecipientAddress", "type": "address" },
|
|
{ "internalType": "address", "name": "senderAddress", "type": "address" },
|
|
{ "internalType": "uint256", "name": "makerAssetAmount", "type": "uint256" },
|
|
{ "internalType": "uint256", "name": "takerAssetAmount", "type": "uint256" },
|
|
{ "internalType": "uint256", "name": "makerFee", "type": "uint256" },
|
|
{ "internalType": "uint256", "name": "takerFee", "type": "uint256" },
|
|
{ "internalType": "uint256", "name": "expirationTimeSeconds", "type": "uint256" },
|
|
{ "internalType": "uint256", "name": "salt", "type": "uint256" },
|
|
{ "internalType": "bytes", "name": "makerAssetData", "type": "bytes" },
|
|
{ "internalType": "bytes", "name": "takerAssetData", "type": "bytes" },
|
|
{ "internalType": "bytes", "name": "makerFeeAssetData", "type": "bytes" },
|
|
{ "internalType": "bytes", "name": "takerFeeAssetData", "type": "bytes" }
|
|
],
|
|
"internalType": "struct LibOrder.Order[]",
|
|
"name": "orders",
|
|
"type": "tuple[]"
|
|
},
|
|
{ "internalType": "bytes[]", "name": "orderSignatures", "type": "bytes[]" },
|
|
{ "internalType": "address", "name": "devUtilsAddress", "type": "address" }
|
|
],
|
|
"name": "getOrderFillableTakerAssetAmounts",
|
|
"outputs": [
|
|
{ "internalType": "uint256[]", "name": "orderFillableTakerAssetAmounts", "type": "uint256[]" }
|
|
],
|
|
"payable": false,
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"constant": true,
|
|
"inputs": [
|
|
{ "internalType": "address", "name": "curveAddress", "type": "address" },
|
|
{ "internalType": "int128", "name": "fromTokenIdx", "type": "int128" },
|
|
{ "internalType": "int128", "name": "toTokenIdx", "type": "int128" },
|
|
{ "internalType": "uint256[]", "name": "makerTokenAmounts", "type": "uint256[]" }
|
|
],
|
|
"name": "sampleBuysFromCurve",
|
|
"outputs": [{ "internalType": "uint256[]", "name": "takerTokenAmounts", "type": "uint256[]" }],
|
|
"payable": false,
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"constant": true,
|
|
"inputs": [
|
|
{ "internalType": "address", "name": "takerToken", "type": "address" },
|
|
{ "internalType": "address", "name": "makerToken", "type": "address" },
|
|
{ "internalType": "uint256[]", "name": "makerTokenAmounts", "type": "uint256[]" }
|
|
],
|
|
"name": "sampleBuysFromEth2Dai",
|
|
"outputs": [{ "internalType": "uint256[]", "name": "takerTokenAmounts", "type": "uint256[]" }],
|
|
"payable": false,
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"constant": true,
|
|
"inputs": [
|
|
{ "internalType": "address", "name": "takerToken", "type": "address" },
|
|
{ "internalType": "address", "name": "makerToken", "type": "address" },
|
|
{ "internalType": "uint256[]", "name": "makerTokenAmounts", "type": "uint256[]" },
|
|
{
|
|
"components": [
|
|
{ "internalType": "uint256", "name": "targetSlippageBps", "type": "uint256" },
|
|
{ "internalType": "uint256", "name": "maxIterations", "type": "uint256" }
|
|
],
|
|
"internalType": "struct IERC20BridgeSampler.FakeBuyOptions",
|
|
"name": "opts",
|
|
"type": "tuple"
|
|
}
|
|
],
|
|
"name": "sampleBuysFromKyberNetwork",
|
|
"outputs": [{ "internalType": "uint256[]", "name": "takerTokenAmounts", "type": "uint256[]" }],
|
|
"payable": false,
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"constant": true,
|
|
"inputs": [
|
|
{ "internalType": "address", "name": "registryAddress", "type": "address" },
|
|
{ "internalType": "address", "name": "takerToken", "type": "address" },
|
|
{ "internalType": "address", "name": "makerToken", "type": "address" },
|
|
{ "internalType": "uint256[]", "name": "makerTokenAmounts", "type": "uint256[]" },
|
|
{
|
|
"components": [
|
|
{ "internalType": "uint256", "name": "targetSlippageBps", "type": "uint256" },
|
|
{ "internalType": "uint256", "name": "maxIterations", "type": "uint256" }
|
|
],
|
|
"internalType": "struct IERC20BridgeSampler.FakeBuyOptions",
|
|
"name": "opts",
|
|
"type": "tuple"
|
|
}
|
|
],
|
|
"name": "sampleBuysFromLiquidityProviderRegistry",
|
|
"outputs": [{ "internalType": "uint256[]", "name": "takerTokenAmounts", "type": "uint256[]" }],
|
|
"payable": false,
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"constant": true,
|
|
"inputs": [
|
|
{ "internalType": "address", "name": "takerToken", "type": "address" },
|
|
{ "internalType": "address", "name": "makerToken", "type": "address" },
|
|
{ "internalType": "uint256[]", "name": "makerTokenAmounts", "type": "uint256[]" }
|
|
],
|
|
"name": "sampleBuysFromUniswap",
|
|
"outputs": [{ "internalType": "uint256[]", "name": "takerTokenAmounts", "type": "uint256[]" }],
|
|
"payable": false,
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"constant": true,
|
|
"inputs": [
|
|
{ "internalType": "address[]", "name": "path", "type": "address[]" },
|
|
{ "internalType": "uint256[]", "name": "makerTokenAmounts", "type": "uint256[]" }
|
|
],
|
|
"name": "sampleBuysFromUniswapV2",
|
|
"outputs": [{ "internalType": "uint256[]", "name": "takerTokenAmounts", "type": "uint256[]" }],
|
|
"payable": false,
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"constant": true,
|
|
"inputs": [
|
|
{ "internalType": "address", "name": "curveAddress", "type": "address" },
|
|
{ "internalType": "int128", "name": "fromTokenIdx", "type": "int128" },
|
|
{ "internalType": "int128", "name": "toTokenIdx", "type": "int128" },
|
|
{ "internalType": "uint256[]", "name": "takerTokenAmounts", "type": "uint256[]" }
|
|
],
|
|
"name": "sampleSellsFromCurve",
|
|
"outputs": [{ "internalType": "uint256[]", "name": "makerTokenAmounts", "type": "uint256[]" }],
|
|
"payable": false,
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"constant": true,
|
|
"inputs": [
|
|
{ "internalType": "address", "name": "takerToken", "type": "address" },
|
|
{ "internalType": "address", "name": "makerToken", "type": "address" },
|
|
{ "internalType": "uint256[]", "name": "takerTokenAmounts", "type": "uint256[]" }
|
|
],
|
|
"name": "sampleSellsFromEth2Dai",
|
|
"outputs": [{ "internalType": "uint256[]", "name": "makerTokenAmounts", "type": "uint256[]" }],
|
|
"payable": false,
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"constant": true,
|
|
"inputs": [
|
|
{ "internalType": "address", "name": "takerToken", "type": "address" },
|
|
{ "internalType": "address", "name": "makerToken", "type": "address" },
|
|
{ "internalType": "uint256[]", "name": "takerTokenAmounts", "type": "uint256[]" }
|
|
],
|
|
"name": "sampleSellsFromKyberNetwork",
|
|
"outputs": [{ "internalType": "uint256[]", "name": "makerTokenAmounts", "type": "uint256[]" }],
|
|
"payable": false,
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"constant": true,
|
|
"inputs": [
|
|
{ "internalType": "address", "name": "registryAddress", "type": "address" },
|
|
{ "internalType": "address", "name": "takerToken", "type": "address" },
|
|
{ "internalType": "address", "name": "makerToken", "type": "address" },
|
|
{ "internalType": "uint256[]", "name": "takerTokenAmounts", "type": "uint256[]" }
|
|
],
|
|
"name": "sampleSellsFromLiquidityProviderRegistry",
|
|
"outputs": [{ "internalType": "uint256[]", "name": "makerTokenAmounts", "type": "uint256[]" }],
|
|
"payable": false,
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"constant": true,
|
|
"inputs": [
|
|
{ "internalType": "address", "name": "multibridge", "type": "address" },
|
|
{ "internalType": "address", "name": "takerToken", "type": "address" },
|
|
{ "internalType": "address", "name": "intermediateToken", "type": "address" },
|
|
{ "internalType": "address", "name": "makerToken", "type": "address" },
|
|
{ "internalType": "uint256[]", "name": "takerTokenAmounts", "type": "uint256[]" }
|
|
],
|
|
"name": "sampleSellsFromMultiBridge",
|
|
"outputs": [{ "internalType": "uint256[]", "name": "makerTokenAmounts", "type": "uint256[]" }],
|
|
"payable": false,
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"constant": true,
|
|
"inputs": [
|
|
{ "internalType": "address", "name": "takerToken", "type": "address" },
|
|
{ "internalType": "address", "name": "makerToken", "type": "address" },
|
|
{ "internalType": "uint256[]", "name": "takerTokenAmounts", "type": "uint256[]" }
|
|
],
|
|
"name": "sampleSellsFromUniswap",
|
|
"outputs": [{ "internalType": "uint256[]", "name": "makerTokenAmounts", "type": "uint256[]" }],
|
|
"payable": false,
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
},
|
|
{
|
|
"constant": true,
|
|
"inputs": [
|
|
{ "internalType": "address[]", "name": "path", "type": "address[]" },
|
|
{ "internalType": "uint256[]", "name": "takerTokenAmounts", "type": "uint256[]" }
|
|
],
|
|
"name": "sampleSellsFromUniswapV2",
|
|
"outputs": [{ "internalType": "uint256[]", "name": "makerTokenAmounts", "type": "uint256[]" }],
|
|
"payable": false,
|
|
"stateMutability": "view",
|
|
"type": "function"
|
|
}
|
|
],
|
|
"devdoc": {
|
|
"methods": {
|
|
"batchCall(bytes[])": {
|
|
"details": "Call multiple public functions on this contract in a single transaction.",
|
|
"params": { "callDatas": "ABI-encoded call data for each function call." },
|
|
"return": "callResults ABI-encoded results data for each call."
|
|
},
|
|
"getLiquidityProviderFromRegistry(address,address,address)": {
|
|
"details": "Returns the address of a liquidity provider for the given market (takerToken, makerToken), from a registry of liquidity providers. Returns address(0) if no such provider exists in the registry.",
|
|
"params": {
|
|
"makerToken": "Maker asset managed by liquidity provider.",
|
|
"takerToken": "Taker asset managed by liquidity provider."
|
|
},
|
|
"return": "providerAddress Address of the liquidity provider."
|
|
},
|
|
"getOrderFillableMakerAssetAmounts((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,bytes,bytes)[],bytes[],address)": {
|
|
"details": "Queries the fillable maker asset amounts of native orders.",
|
|
"params": {
|
|
"devUtilsAddress": "Address to the DevUtils contract.",
|
|
"orderSignatures": "Signatures for each respective order in `orders`.",
|
|
"orders": "Native orders to query."
|
|
},
|
|
"return": "orderFillableMakerAssetAmounts How much maker asset can be filled by each order in `orders`."
|
|
},
|
|
"getOrderFillableTakerAssetAmounts((address,address,address,address,uint256,uint256,uint256,uint256,uint256,uint256,bytes,bytes,bytes,bytes)[],bytes[],address)": {
|
|
"details": "Queries the fillable taker asset amounts of native orders.",
|
|
"params": {
|
|
"devUtilsAddress": "Address to the DevUtils contract.",
|
|
"orderSignatures": "Signatures for each respective order in `orders`.",
|
|
"orders": "Native orders to query."
|
|
},
|
|
"return": "orderFillableTakerAssetAmounts How much taker asset can be filled by each order in `orders`."
|
|
},
|
|
"sampleBuysFromCurve(address,int128,int128,uint256[])": {
|
|
"details": "Sample buy quotes from Curve.",
|
|
"params": {
|
|
"curveAddress": "Address of the Curve contract.",
|
|
"fromTokenIdx": "Index of the taker token (what to sell).",
|
|
"makerTokenAmounts": "Maker token buy amount for each sample.",
|
|
"toTokenIdx": "Index of the maker token (what to buy)."
|
|
},
|
|
"return": "takerTokenAmounts Taker amounts sold at each maker token amount."
|
|
},
|
|
"sampleBuysFromEth2Dai(address,address,uint256[])": {
|
|
"details": "Sample buy quotes from Eth2Dai/Oasis.",
|
|
"params": {
|
|
"makerToken": "Address of the maker token (what to buy).",
|
|
"makerTokenAmounts": "Maker token buy amount for each sample.",
|
|
"takerToken": "Address of the taker token (what to sell)."
|
|
},
|
|
"return": "takerTokenAmounts Taker amounts sold at each maker token amount."
|
|
},
|
|
"sampleBuysFromKyberNetwork(address,address,uint256[],(uint256,uint256))": {
|
|
"details": "Sample buy quotes from Kyber.",
|
|
"params": {
|
|
"makerToken": "Address of the maker token (what to buy).",
|
|
"makerTokenAmounts": "Maker token buy amount for each sample.",
|
|
"opts": "`FakeBuyOptions` specifying target slippage and max iterations.",
|
|
"takerToken": "Address of the taker token (what to sell)."
|
|
},
|
|
"return": "takerTokenAmounts Taker amounts sold at each maker token amount."
|
|
},
|
|
"sampleBuysFromLiquidityProviderRegistry(address,address,address,uint256[],(uint256,uint256))": {
|
|
"details": "Sample buy quotes from an arbitrary on-chain liquidity provider.",
|
|
"params": {
|
|
"makerToken": "Address of the maker token (what to buy).",
|
|
"makerTokenAmounts": "Maker token buy amount for each sample.",
|
|
"opts": "`FakeBuyOptions` specifying target slippage and max iterations.",
|
|
"registryAddress": "Address of the liquidity provider registry contract.",
|
|
"takerToken": "Address of the taker token (what to sell)."
|
|
},
|
|
"return": "takerTokenAmounts Taker amounts sold at each maker token amount."
|
|
},
|
|
"sampleBuysFromUniswap(address,address,uint256[])": {
|
|
"details": "Sample buy quotes from Uniswap.",
|
|
"params": {
|
|
"makerToken": "Address of the maker token (what to buy).",
|
|
"makerTokenAmounts": "Maker token buy amount for each sample.",
|
|
"takerToken": "Address of the taker token (what to sell)."
|
|
},
|
|
"return": "takerTokenAmounts Taker amounts sold at each maker token amount."
|
|
},
|
|
"sampleBuysFromUniswapV2(address[],uint256[])": {
|
|
"details": "Sample buy quotes from UniswapV2.",
|
|
"params": {
|
|
"makerTokenAmounts": "Maker token buy amount for each sample.",
|
|
"path": "Token route."
|
|
},
|
|
"return": "takerTokenAmounts Taker amounts sold at each maker token amount."
|
|
},
|
|
"sampleSellsFromCurve(address,int128,int128,uint256[])": {
|
|
"details": "Sample sell quotes from Curve.",
|
|
"params": {
|
|
"curveAddress": "Address of the Curve contract.",
|
|
"fromTokenIdx": "Index of the taker token (what to sell).",
|
|
"takerTokenAmounts": "Taker token sell amount for each sample.",
|
|
"toTokenIdx": "Index of the maker token (what to buy)."
|
|
},
|
|
"return": "makerTokenAmounts Maker amounts bought at each taker token amount."
|
|
},
|
|
"sampleSellsFromEth2Dai(address,address,uint256[])": {
|
|
"details": "Sample sell quotes from Eth2Dai/Oasis.",
|
|
"params": {
|
|
"makerToken": "Address of the maker token (what to buy).",
|
|
"takerToken": "Address of the taker token (what to sell).",
|
|
"takerTokenAmounts": "Taker token sell amount for each sample."
|
|
},
|
|
"return": "makerTokenAmounts Maker amounts bought at each taker token amount."
|
|
},
|
|
"sampleSellsFromKyberNetwork(address,address,uint256[])": {
|
|
"details": "Sample sell quotes from Kyber.",
|
|
"params": {
|
|
"makerToken": "Address of the maker token (what to buy).",
|
|
"takerToken": "Address of the taker token (what to sell).",
|
|
"takerTokenAmounts": "Taker token sell amount for each sample."
|
|
},
|
|
"return": "makerTokenAmounts Maker amounts bought at each taker token amount."
|
|
},
|
|
"sampleSellsFromLiquidityProviderRegistry(address,address,address,uint256[])": {
|
|
"details": "Sample sell quotes from an arbitrary on-chain liquidity provider.",
|
|
"params": {
|
|
"makerToken": "Address of the maker token (what to buy).",
|
|
"registryAddress": "Address of the liquidity provider registry contract.",
|
|
"takerToken": "Address of the taker token (what to sell).",
|
|
"takerTokenAmounts": "Taker token sell amount for each sample."
|
|
},
|
|
"return": "makerTokenAmounts Maker amounts bought at each taker token amount."
|
|
},
|
|
"sampleSellsFromMultiBridge(address,address,address,address,uint256[])": {
|
|
"details": "Sample sell quotes from MultiBridge.",
|
|
"params": {
|
|
"intermediateToken": "The address of the intermediate token to use in an indirect route.",
|
|
"makerToken": "Address of the maker token (what to buy).",
|
|
"multibridge": "Address of the MultiBridge contract.",
|
|
"takerToken": "Address of the taker token (what to sell).",
|
|
"takerTokenAmounts": "Taker token sell amount for each sample."
|
|
},
|
|
"return": "makerTokenAmounts Maker amounts bought at each taker token amount."
|
|
},
|
|
"sampleSellsFromUniswap(address,address,uint256[])": {
|
|
"details": "Sample sell quotes from Uniswap.",
|
|
"params": {
|
|
"makerToken": "Address of the maker token (what to buy).",
|
|
"takerToken": "Address of the taker token (what to sell).",
|
|
"takerTokenAmounts": "Taker token sell amount for each sample."
|
|
},
|
|
"return": "makerTokenAmounts Maker amounts bought at each taker token amount."
|
|
},
|
|
"sampleSellsFromUniswapV2(address[],uint256[])": {
|
|
"details": "Sample sell quotes from UniswapV2.",
|
|
"params": {
|
|
"path": "Token route.",
|
|
"takerTokenAmounts": "Taker token sell amount for each sample."
|
|
},
|
|
"return": "makerTokenAmounts Maker amounts bought at each taker token amount."
|
|
}
|
|
}
|
|
},
|
|
"evm": { "bytecode": { "object": "0x" }, "deployedBytecode": { "object": "0x" } }
|
|
},
|
|
"compiler": {
|
|
"name": "solc",
|
|
"version": "0.5.17+commit.d19bba13",
|
|
"settings": {
|
|
"optimizer": {
|
|
"enabled": true,
|
|
"runs": 1000000,
|
|
"details": { "yul": true, "deduplicate": true, "cse": true, "constantOptimizer": true }
|
|
},
|
|
"outputSelection": {
|
|
"*": {
|
|
"*": [
|
|
"abi",
|
|
"devdoc",
|
|
"evm.bytecode.object",
|
|
"evm.bytecode.sourceMap",
|
|
"evm.deployedBytecode.object",
|
|
"evm.deployedBytecode.sourceMap"
|
|
]
|
|
}
|
|
},
|
|
"evmVersion": "istanbul"
|
|
}
|
|
},
|
|
"chains": {}
|
|
}
|