{"abi":[{"type":"function","name":"getCapabilities","inputs":[{"name":"poolId","type":"bytes32","internalType":"bytes32"},{"name":"sellToken","type":"address","internalType":"address"},{"name":"buyToken","type":"address","internalType":"address"}],"outputs":[{"name":"capabilities","type":"uint8[]","internalType":"enum ISwapAdapterTypes.Capability[]"}],"stateMutability":"nonpayable"},{"type":"function","name":"getLimits","inputs":[{"name":"poolId","type":"bytes32","internalType":"bytes32"},{"name":"sellToken","type":"address","internalType":"address"},{"name":"buyToken","type":"address","internalType":"address"}],"outputs":[{"name":"limits","type":"uint256[]","internalType":"uint256[]"}],"stateMutability":"nonpayable"},{"type":"function","name":"getPoolIds","inputs":[{"name":"offset","type":"uint256","internalType":"uint256"},{"name":"limit","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"ids","type":"bytes32[]","internalType":"bytes32[]"}],"stateMutability":"nonpayable"},{"type":"function","name":"getTokens","inputs":[{"name":"poolId","type":"bytes32","internalType":"bytes32"}],"outputs":[{"name":"tokens","type":"address[]","internalType":"address[]"}],"stateMutability":"nonpayable"},{"type":"function","name":"price","inputs":[{"name":"_poolId","type":"bytes32","internalType":"bytes32"},{"name":"_sellToken","type":"address","internalType":"address"},{"name":"_buyToken","type":"address","internalType":"address"},{"name":"_specifiedAmounts","type":"uint256[]","internalType":"uint256[]"}],"outputs":[{"name":"_prices","type":"tuple[]","internalType":"struct ISwapAdapterTypes.Fraction[]","components":[{"name":"numerator","type":"uint256","internalType":"uint256"},{"name":"denominator","type":"uint256","internalType":"uint256"}]}],"stateMutability":"view"},{"type":"function","name":"swap","inputs":[{"name":"poolId","type":"bytes32","internalType":"bytes32"},{"name":"sellToken","type":"address","internalType":"address"},{"name":"buyToken","type":"address","internalType":"address"},{"name":"side","type":"uint8","internalType":"enum ISwapAdapterTypes.OrderSide"},{"name":"specifiedAmount","type":"uint256","internalType":"uint256"}],"outputs":[{"name":"trade","type":"tuple","internalType":"struct ISwapAdapterTypes.Trade","components":[{"name":"calculatedAmount","type":"uint256","internalType":"uint256"},{"name":"gasUsed","type":"uint256","internalType":"uint256"},{"name":"price","type":"tuple","internalType":"struct ISwapAdapterTypes.Fraction","components":[{"name":"numerator","type":"uint256","internalType":"uint256"},{"name":"denominator","type":"uint256","internalType":"uint256"}]}]}],"stateMutability":"nonpayable"},{"type":"error","name":"LimitExceeded","inputs":[{"name":"limit","type":"uint256","internalType":"uint256"}]},{"type":"error","name":"NotImplemented","inputs":[{"name":"reason","type":"string","internalType":"string"}]},{"type":"error","name":"Unavailable","inputs":[{"name":"reason","type":"string","internalType":"string"}]}],"bytecode":{"object":"0x60808060405234601557610431908161001a8239f35b5f80fdfe6080806040526004361015610012575f80fd5b5f3560e01c90816323eeca01146103415750806348bd7dfd146102de5780638307c65514610219578063a9270fbe146101c2578063aad6e488146100b95763ecbbc0331461005e575f80fd5b346100b55760203660031901126100b557604051631d04569d60e21b815260206004820152601d60248201527f54656d706c61746553776170416461707465722e676574546f6b656e730000006044820152606490fd5b5f80fd5b346100b55760803660031901126100b5576100d2610395565b506100db6103ab565b5060643567ffffffffffffffff81116100b557366023820112156100b55780600401359067ffffffffffffffff82116101ae578160051b91604051601f19603f85011681019080821067ffffffffffffffff8311176101ae5760249260209260405281520192820101903682116100b557602401915b81831061019e57604051631d04569d60e21b815260206004820152601960248201527f54656d706c61746553776170416461707465722e7072696365000000000000006044820152606490fd5b8235815260209283019201610151565b634e487b7160e01b5f52604160045260245ffd5b346100b5576101d0366103c1565b5050604051631d04569d60e21b815260206004820152601d60248201527f54656d706c61746553776170416461707465722e6765744c696d697473000000604482015260649150fd5b346100b55760a03660031901126100b557610232610395565b5061023b6103ab565b50600260643510156100b5576040516060810181811067ffffffffffffffff8211176101ae576040525f81525f602082015260405190604082019082821067ffffffffffffffff8311176101ae5760409182525f83525f602084015201526064604051631d04569d60e21b815260206004820152601860248201527f54656d706c61746553776170416461707465722e7377617000000000000000006044820152fd5b346100b5576102ec366103c1565b5050604051631d04569d60e21b815260206004820152602360248201527f54656d706c61746553776170416461707465722e6765744361706162696c697460448201526269657360e81b606482015260849150fd5b346100b55760403660031901126100b557631d04569d60e21b815260206004820152601e60248201527f54656d706c61746553776170416461707465722e676574506f6f6c49647300006044820152606490fd5b602435906001600160a01b03821682036100b557565b604435906001600160a01b03821682036100b557565b60609060031901126100b557600435906024356001600160a01b03811681036100b557906044356001600160a01b03811681036100b5579056fea26469706673582212206492349fa976084ab1406cd4e54307415f37767e6ab8298dd7f59cbce6fd7c3c64736f6c634300081b0033","sourceMap":"309:1407:63:-:0;;;;;;;;;;;;;;;;;","linkReferences":{}},"deployedBytecode":{"object":"0x6080806040526004361015610012575f80fd5b5f3560e01c90816323eeca01146103415750806348bd7dfd146102de5780638307c65514610219578063a9270fbe146101c2578063aad6e488146100b95763ecbbc0331461005e575f80fd5b346100b55760203660031901126100b557604051631d04569d60e21b815260206004820152601d60248201527f54656d706c61746553776170416461707465722e676574546f6b656e730000006044820152606490fd5b5f80fd5b346100b55760803660031901126100b5576100d2610395565b506100db6103ab565b5060643567ffffffffffffffff81116100b557366023820112156100b55780600401359067ffffffffffffffff82116101ae578160051b91604051601f19603f85011681019080821067ffffffffffffffff8311176101ae5760249260209260405281520192820101903682116100b557602401915b81831061019e57604051631d04569d60e21b815260206004820152601960248201527f54656d706c61746553776170416461707465722e7072696365000000000000006044820152606490fd5b8235815260209283019201610151565b634e487b7160e01b5f52604160045260245ffd5b346100b5576101d0366103c1565b5050604051631d04569d60e21b815260206004820152601d60248201527f54656d706c61746553776170416461707465722e6765744c696d697473000000604482015260649150fd5b346100b55760a03660031901126100b557610232610395565b5061023b6103ab565b50600260643510156100b5576040516060810181811067ffffffffffffffff8211176101ae576040525f81525f602082015260405190604082019082821067ffffffffffffffff8311176101ae5760409182525f83525f602084015201526064604051631d04569d60e21b815260206004820152601860248201527f54656d706c61746553776170416461707465722e7377617000000000000000006044820152fd5b346100b5576102ec366103c1565b5050604051631d04569d60e21b815260206004820152602360248201527f54656d706c61746553776170416461707465722e6765744361706162696c697460448201526269657360e81b606482015260849150fd5b346100b55760403660031901126100b557631d04569d60e21b815260206004820152601e60248201527f54656d706c61746553776170416461707465722e676574506f6f6c49647300006044820152606490fd5b602435906001600160a01b03821682036100b557565b604435906001600160a01b03821682036100b557565b60609060031901126100b557600435906024356001600160a01b03811681036100b557906044356001600160a01b03811681036100b5579056fea26469706673582212206492349fa976084ab1406cd4e54307415f37767e6ab8298dd7f59cbce6fd7c3c64736f6c634300081b0033","sourceMap":"309:1407:63:-:0;;;;;;;;;;;;;;;;;;;;;;;;1659:48;;309:1407;1659:48;;;1290:53;309:1407;1290:53;;;309:1407;;;;;1053:47;309:1407;1053:47;;;309:1407;;;;;;;;;;;;;-1:-1:-1;;309:1407:63;;;;;;-1:-1:-1;;;1471:47:63;;309:1407;;1471:47;;309:1407;;;;;;;;;;;1471:47;;;309:1407;;;;;;;;;;-1:-1:-1;;309:1407:63;;;;;;:::i;:::-;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;581:43:63;;309:1407;;581:43;;309:1407;;;;;;;;;;;;;581:43;309:1407;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;309:1407:63;;-1:-1:-1;;;1053:47:63;;309:1407;;1053:47;;309:1407;;;;;;;;;;;1053:47;;-1:-1:-1;1053:47:63;309:1407;;;;;;-1:-1:-1;;309:1407:63;;;;;;:::i;:::-;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1659:48;;;846:42;;309:1407;;846:42;;309:1407;;;;;;;;;;;846:42;309:1407;;;;;;;:::i;:::-;-1:-1:-1;;309:1407:63;;-1:-1:-1;;;1290:53:63;;309:1407;;1290:53;;309:1407;;;;;;;;;;;-1:-1:-1;;;309:1407:63;;;;1290:53;;-1:-1:-1;1290:53:63;309:1407;;;;;;-1:-1:-1;;309:1407:63;;;;-1:-1:-1;;;1659:48:63;;309:1407;;1659:48;;309:1407;;;;;;;;;;;1659:48;;;309:1407;;;;-1:-1:-1;;;;;309:1407:63;;;;;;:::o;:::-;;;;-1:-1:-1;;;;;309:1407:63;;;;;;:::o;:::-;;;;;;;;;;;;;;-1:-1:-1;;;;;309:1407:63;;;;;;;;;-1:-1:-1;;;;;309:1407:63;;;;;;;:::o","linkReferences":{}},"methodIdentifiers":{"getCapabilities(bytes32,address,address)":"48bd7dfd","getLimits(bytes32,address,address)":"a9270fbe","getPoolIds(uint256,uint256)":"23eeca01","getTokens(bytes32)":"ecbbc033","price(bytes32,address,address,uint256[])":"aad6e488","swap(bytes32,address,address,uint8,uint256)":"8307c655"},"rawMetadata":"{\"compiler\":{\"version\":\"0.8.27+commit.40a35a09\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"limit\",\"type\":\"uint256\"}],\"name\":\"LimitExceeded\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"NotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"Unavailable\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"sellToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"buyToken\",\"type\":\"address\"}],\"name\":\"getCapabilities\",\"outputs\":[{\"internalType\":\"enum ISwapAdapterTypes.Capability[]\",\"name\":\"capabilities\",\"type\":\"uint8[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"sellToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"buyToken\",\"type\":\"address\"}],\"name\":\"getLimits\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"limits\",\"type\":\"uint256[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"offset\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"limit\",\"type\":\"uint256\"}],\"name\":\"getPoolIds\",\"outputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"ids\",\"type\":\"bytes32[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"}],\"name\":\"getTokens\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"tokens\",\"type\":\"address[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"_poolId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_sellToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_buyToken\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"_specifiedAmounts\",\"type\":\"uint256[]\"}],\"name\":\"price\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"}],\"internalType\":\"struct ISwapAdapterTypes.Fraction[]\",\"name\":\"_prices\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"poolId\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"sellToken\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"buyToken\",\"type\":\"address\"},{\"internalType\":\"enum ISwapAdapterTypes.OrderSide\",\"name\":\"side\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"specifiedAmount\",\"type\":\"uint256\"}],\"name\":\"swap\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"calculatedAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasUsed\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"numerator\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"denominator\",\"type\":\"uint256\"}],\"internalType\":\"struct ISwapAdapterTypes.Fraction\",\"name\":\"price\",\"type\":\"tuple\"}],\"internalType\":\"struct ISwapAdapterTypes.Trade\",\"name\":\"trade\",\"type\":\"tuple\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This is a template for a swap adapter. Rename it to your own protocol's name and implement it according to the specification.\",\"errors\":{\"LimitExceeded(uint256)\":[{\"details\":\"The LimitExceeded error is thrown when a limit has been exceeded. E.g. the specified amount can't be traded safely.\"}],\"NotImplemented(string)\":[{\"details\":\"The NotImplemented error is thrown when a function is not implemented.\"}],\"Unavailable(string)\":[{\"details\":\"The Unavailable error is thrown when a pool or swap is not available for unexpected reason. E.g. it was paused due to a bug.\"}]},\"kind\":\"dev\",\"methods\":{\"getCapabilities(bytes32,address,address)\":{\"params\":{\"poolId\":\"The ID of the trading pool.\"},\"returns\":{\"capabilities\":\"An array of Capability.\"}},\"getLimits(bytes32,address,address)\":{\"details\":\"Retrieve the maximum limits of a token that can be traded. The limit is reached when the change in the received amounts is zero or close to zero or when the swap fails because of the pools restrictions. Overestimate if in doubt rather than underestimate. The swap function should not error with `LimitExceeded` if called with amounts below the limit.\",\"params\":{\"buyToken\":\"The token being bought.\",\"poolId\":\"The ID of the trading pool.\",\"sellToken\":\"The token being sold.\"},\"returns\":{\"limits\":\"An array of size two indicating the limit amount for the sell token (maximum the pool is willing to buy in sell token) as well as the limit amount of the buy token (maximum the pool is willing to sell in buy token).\"}},\"getPoolIds(uint256,uint256)\":{\"details\":\"Mainly used for testing. It is alright to not return all available pools here. Nevertheless, this is useful to test against the substreams implementation. If implemented, it saves time writing custom tests.\",\"params\":{\"limit\":\"The maximum number of pool IDs to retrieve.\",\"offset\":\"The starting index from which to retrieve pool IDs.\"},\"returns\":{\"ids\":\"An array of pool IDs.\"}},\"getTokens(bytes32)\":{\"details\":\"Mainly used for testing as this is redundant with the required substreams implementation.\",\"params\":{\"poolId\":\"The ID of the trading pool.\"},\"returns\":{\"tokens\":\"An array of address contracts.\"}},\"swap(bytes32,address,address,uint8,uint256)\":{\"details\":\"This function should be state modifying, meaning it should actually execute the swap and change the state of the EVM accordingly. Please include a gas usage estimate for each amount. This can be achieved e.g. by using the `gasleft()` function. The return type `Trade` has an attribute called price which should contain the value of `price(specifiedAmount)`. As this is optional, defined via `Capability.PriceFunction`, it is valid to return a Fraction(0, 0) value for this price. In that case the price will be estimated numerically.\",\"params\":{\"buyToken\":\"The token being bought.\",\"poolId\":\"The ID of the trading pool.\",\"sellToken\":\"The token being sold.\",\"side\":\"The side of the trade (Sell or Buy).\",\"specifiedAmount\":\"The amount to be traded.\"},\"returns\":{\"trade\":\"Trade struct representing the executed trade.\"}}},\"title\":\"TemplateSwapAdapter\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getCapabilities(bytes32,address,address)\":{\"notice\":\"Retrieves the capabilities of the selected pool.\"},\"getLimits(bytes32,address,address)\":{\"notice\":\"Retrieves the limits for each token.\"},\"getPoolIds(uint256,uint256)\":{\"notice\":\"Retrieves a range of pool IDs.\"},\"getTokens(bytes32)\":{\"notice\":\"Retrieves the tokens in the selected pool.\"},\"swap(bytes32,address,address,uint8,uint256)\":{\"notice\":\"Simulates swapping tokens on a given pool.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/template/TemplateSwapAdapter.sol\":\"TemplateSwapAdapter\"},\"evmVersion\":\"cancun\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\"},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[\":@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/\",\":balancer-v2/interfaces/=lib/balancer-v2-monorepo/pkg/interfaces/contracts/\",\":ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/\",\":erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/\",\":forge-std/=lib/forge-std/src/\",\":openzeppelin-contracts/=lib/openzeppelin-contracts/\"],\"viaIR\":true},\"sources\":{\"src/interfaces/ISwapAdapter.sol\":{\"keccak256\":\"0xb7af70bac27e53573dfb145ec715203ca28ab8795f512b8ec84c33b5d812d702\",\"license\":\"AGPL-3.0-or-later\",\"urls\":[\"bzz-raw://ad7d3672672ef08abd6c7c04d3426d6f0bed4ebb34c5e4d70926da145cdfbd87\",\"dweb:/ipfs/QmS99C7MRYB9Lkph2f3XLJfjFmX4u2aC6Tm5n886pMSk1C\"]},\"src/interfaces/ISwapAdapterTypes.sol\":{\"keccak256\":\"0xf5637c8fca78253bd88d94d8173d8de4487146f82e462df42f428142ee951778\",\"license\":\"AGPL-3.0-or-later\",\"urls\":[\"bzz-raw://f2c3ab44f87f9c945f52052196537e057292e45d4011830c73a9495e60cdbf4c\",\"dweb:/ipfs/QmePvUFDNHpH2b5Y4kRBXgSrA55RrZgjdUXwV5GLNX5o5h\"]},\"src/template/TemplateSwapAdapter.sol\":{\"keccak256\":\"0x5699a22a67f35bad1c6a5267c7f0a356581777003e4032c77e313e8f9c668cf8\",\"license\":\"AGPL-3.0-or-later\",\"urls\":[\"bzz-raw://0342fe5c738b51e8516b2286eebbea352cfee22f63bbabdbaad1ee04364c8a42\",\"dweb:/ipfs/QmcT9LDyeuf1XxP5g6ebZCQzqMYCdhhquoGzKxMvKFyeFz\"]}},\"version\":1}","metadata":{"compiler":{"version":"0.8.27+commit.40a35a09"},"language":"Solidity","output":{"abi":[{"inputs":[{"internalType":"uint256","name":"limit","type":"uint256"}],"type":"error","name":"LimitExceeded"},{"inputs":[{"internalType":"string","name":"reason","type":"string"}],"type":"error","name":"NotImplemented"},{"inputs":[{"internalType":"string","name":"reason","type":"string"}],"type":"error","name":"Unavailable"},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sellToken","type":"address"},{"internalType":"address","name":"buyToken","type":"address"}],"stateMutability":"nonpayable","type":"function","name":"getCapabilities","outputs":[{"internalType":"enum ISwapAdapterTypes.Capability[]","name":"capabilities","type":"uint8[]"}]},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sellToken","type":"address"},{"internalType":"address","name":"buyToken","type":"address"}],"stateMutability":"nonpayable","type":"function","name":"getLimits","outputs":[{"internalType":"uint256[]","name":"limits","type":"uint256[]"}]},{"inputs":[{"internalType":"uint256","name":"offset","type":"uint256"},{"internalType":"uint256","name":"limit","type":"uint256"}],"stateMutability":"nonpayable","type":"function","name":"getPoolIds","outputs":[{"internalType":"bytes32[]","name":"ids","type":"bytes32[]"}]},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"}],"stateMutability":"nonpayable","type":"function","name":"getTokens","outputs":[{"internalType":"address[]","name":"tokens","type":"address[]"}]},{"inputs":[{"internalType":"bytes32","name":"_poolId","type":"bytes32"},{"internalType":"address","name":"_sellToken","type":"address"},{"internalType":"address","name":"_buyToken","type":"address"},{"internalType":"uint256[]","name":"_specifiedAmounts","type":"uint256[]"}],"stateMutability":"view","type":"function","name":"price","outputs":[{"internalType":"struct ISwapAdapterTypes.Fraction[]","name":"_prices","type":"tuple[]","components":[{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}]}]},{"inputs":[{"internalType":"bytes32","name":"poolId","type":"bytes32"},{"internalType":"address","name":"sellToken","type":"address"},{"internalType":"address","name":"buyToken","type":"address"},{"internalType":"enum ISwapAdapterTypes.OrderSide","name":"side","type":"uint8"},{"internalType":"uint256","name":"specifiedAmount","type":"uint256"}],"stateMutability":"nonpayable","type":"function","name":"swap","outputs":[{"internalType":"struct ISwapAdapterTypes.Trade","name":"trade","type":"tuple","components":[{"internalType":"uint256","name":"calculatedAmount","type":"uint256"},{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"internalType":"struct ISwapAdapterTypes.Fraction","name":"price","type":"tuple","components":[{"internalType":"uint256","name":"numerator","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}]}]}]}],"devdoc":{"kind":"dev","methods":{"getCapabilities(bytes32,address,address)":{"params":{"poolId":"The ID of the trading pool."},"returns":{"capabilities":"An array of Capability."}},"getLimits(bytes32,address,address)":{"details":"Retrieve the maximum limits of a token that can be traded. The limit is reached when the change in the received amounts is zero or close to zero or when the swap fails because of the pools restrictions. Overestimate if in doubt rather than underestimate. The swap function should not error with `LimitExceeded` if called with amounts below the limit.","params":{"buyToken":"The token being bought.","poolId":"The ID of the trading pool.","sellToken":"The token being sold."},"returns":{"limits":"An array of size two indicating the limit amount for the sell token (maximum the pool is willing to buy in sell token) as well as the limit amount of the buy token (maximum the pool is willing to sell in buy token)."}},"getPoolIds(uint256,uint256)":{"details":"Mainly used for testing. It is alright to not return all available pools here. Nevertheless, this is useful to test against the substreams implementation. If implemented, it saves time writing custom tests.","params":{"limit":"The maximum number of pool IDs to retrieve.","offset":"The starting index from which to retrieve pool IDs."},"returns":{"ids":"An array of pool IDs."}},"getTokens(bytes32)":{"details":"Mainly used for testing as this is redundant with the required substreams implementation.","params":{"poolId":"The ID of the trading pool."},"returns":{"tokens":"An array of address contracts."}},"swap(bytes32,address,address,uint8,uint256)":{"details":"This function should be state modifying, meaning it should actually execute the swap and change the state of the EVM accordingly. Please include a gas usage estimate for each amount. This can be achieved e.g. by using the `gasleft()` function. The return type `Trade` has an attribute called price which should contain the value of `price(specifiedAmount)`. As this is optional, defined via `Capability.PriceFunction`, it is valid to return a Fraction(0, 0) value for this price. In that case the price will be estimated numerically.","params":{"buyToken":"The token being bought.","poolId":"The ID of the trading pool.","sellToken":"The token being sold.","side":"The side of the trade (Sell or Buy).","specifiedAmount":"The amount to be traded."},"returns":{"trade":"Trade struct representing the executed trade."}}},"version":1},"userdoc":{"kind":"user","methods":{"getCapabilities(bytes32,address,address)":{"notice":"Retrieves the capabilities of the selected pool."},"getLimits(bytes32,address,address)":{"notice":"Retrieves the limits for each token."},"getPoolIds(uint256,uint256)":{"notice":"Retrieves a range of pool IDs."},"getTokens(bytes32)":{"notice":"Retrieves the tokens in the selected pool."},"swap(bytes32,address,address,uint8,uint256)":{"notice":"Simulates swapping tokens on a given pool."}},"version":1}},"settings":{"remappings":["@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/","balancer-v2/interfaces/=lib/balancer-v2-monorepo/pkg/interfaces/contracts/","ds-test/=lib/openzeppelin-contracts/lib/forge-std/lib/ds-test/src/","erc4626-tests/=lib/openzeppelin-contracts/lib/erc4626-tests/","forge-std/=lib/forge-std/src/","openzeppelin-contracts/=lib/openzeppelin-contracts/"],"optimizer":{"enabled":true,"runs":200},"metadata":{"bytecodeHash":"ipfs"},"compilationTarget":{"src/template/TemplateSwapAdapter.sol":"TemplateSwapAdapter"},"evmVersion":"cancun","libraries":{},"viaIR":true},"sources":{"src/interfaces/ISwapAdapter.sol":{"keccak256":"0xb7af70bac27e53573dfb145ec715203ca28ab8795f512b8ec84c33b5d812d702","urls":["bzz-raw://ad7d3672672ef08abd6c7c04d3426d6f0bed4ebb34c5e4d70926da145cdfbd87","dweb:/ipfs/QmS99C7MRYB9Lkph2f3XLJfjFmX4u2aC6Tm5n886pMSk1C"],"license":"AGPL-3.0-or-later"},"src/interfaces/ISwapAdapterTypes.sol":{"keccak256":"0xf5637c8fca78253bd88d94d8173d8de4487146f82e462df42f428142ee951778","urls":["bzz-raw://f2c3ab44f87f9c945f52052196537e057292e45d4011830c73a9495e60cdbf4c","dweb:/ipfs/QmePvUFDNHpH2b5Y4kRBXgSrA55RrZgjdUXwV5GLNX5o5h"],"license":"AGPL-3.0-or-later"},"src/template/TemplateSwapAdapter.sol":{"keccak256":"0x5699a22a67f35bad1c6a5267c7f0a356581777003e4032c77e313e8f9c668cf8","urls":["bzz-raw://0342fe5c738b51e8516b2286eebbea352cfee22f63bbabdbaad1ee04364c8a42","dweb:/ipfs/QmcT9LDyeuf1XxP5g6ebZCQzqMYCdhhquoGzKxMvKFyeFz"],"license":"AGPL-3.0-or-later"}},"version":1},"id":63}