UNPKG

@zarclays/zswap-trident

Version:
808 lines 140 kB
{ "address": "0xaB235da7f52d35fb4551AfBa11BFB56e18774A65", "abi": [ { "inputs": [ { "internalType": "contract IBentoBoxMinimal", "name": "_bento", "type": "address" }, { "internalType": "contract IMasterDeployer", "name": "_masterDeployer", "type": "address" }, { "internalType": "address", "name": "_wETH", "type": "address" } ], "stateMutability": "nonpayable", "type": "constructor" }, { "inputs": [], "name": "IncorrectSlippageParams", "type": "error" }, { "inputs": [], "name": "NotEnoughLiquidityMinted", "type": "error" }, { "inputs": [], "name": "NotWethSender", "type": "error" }, { "inputs": [], "name": "TooLittleReceived", "type": "error" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "bool", "name": "native", "type": "bool" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "internalType": "struct ITridentRouter.TokenInput[]", "name": "tokenInput", "type": "tuple[]" }, { "internalType": "address", "name": "pool", "type": "address" }, { "internalType": "uint256", "name": "minLiquidity", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "name": "addLiquidity", "outputs": [ { "internalType": "uint256", "name": "liquidity", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "approveMasterContract", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "bento", "outputs": [ { "internalType": "contract IBentoBoxMinimal", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "pool", "type": "address" }, { "internalType": "uint256", "name": "liquidity", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" }, { "components": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" } ], "internalType": "struct IPool.TokenAmount[]", "name": "minWithdrawals", "type": "tuple[]" } ], "name": "burnLiquidity", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "pool", "type": "address" }, { "internalType": "uint256", "name": "liquidity", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" }, { "internalType": "uint256", "name": "minWithdrawal", "type": "uint256" } ], "name": "burnLiquiditySingle", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "components": [ { "internalType": "address", "name": "tokenIn", "type": "address" }, { "internalType": "address", "name": "pool", "type": "address" }, { "internalType": "bool", "name": "native", "type": "bool" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "internalType": "struct ITridentRouter.InitialPath[]", "name": "initialPath", "type": "tuple[]" }, { "components": [ { "internalType": "address", "name": "tokenIn", "type": "address" }, { "internalType": "address", "name": "pool", "type": "address" }, { "internalType": "uint64", "name": "balancePercentage", "type": "uint64" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "internalType": "struct ITridentRouter.PercentagePath[]", "name": "percentagePath", "type": "tuple[]" }, { "components": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "address", "name": "to", "type": "address" }, { "internalType": "bool", "name": "unwrapBento", "type": "bool" }, { "internalType": "uint256", "name": "minAmount", "type": "uint256" } ], "internalType": "struct ITridentRouter.Output[]", "name": "output", "type": "tuple[]" } ], "internalType": "struct ITridentRouter.ComplexPathParams", "name": "params", "type": "tuple" } ], "name": "complexPath", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "factory", "type": "address" }, { "internalType": "bytes", "name": "deployData", "type": "bytes" } ], "name": "deployPool", "outputs": [ { "internalType": "address", "name": "", "type": "address" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "tokenIn", "type": "address" }, { "internalType": "uint256", "name": "amountIn", "type": "uint256" }, { "internalType": "uint256", "name": "amountOutMinimum", "type": "uint256" }, { "components": [ { "internalType": "address", "name": "pool", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "internalType": "struct ITridentRouter.Path[]", "name": "path", "type": "tuple[]" } ], "internalType": "struct ITridentRouter.ExactInputParams", "name": "params", "type": "tuple" } ], "name": "exactInput", "outputs": [ { "internalType": "uint256", "name": "amountOut", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "amountIn", "type": "uint256" }, { "internalType": "uint256", "name": "amountOutMinimum", "type": "uint256" }, { "internalType": "address", "name": "pool", "type": "address" }, { "internalType": "address", "name": "tokenIn", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "internalType": "struct ITridentRouter.ExactInputSingleParams", "name": "params", "type": "tuple" } ], "name": "exactInputSingle", "outputs": [ { "internalType": "uint256", "name": "amountOut", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "uint256", "name": "amountIn", "type": "uint256" }, { "internalType": "uint256", "name": "amountOutMinimum", "type": "uint256" }, { "internalType": "address", "name": "pool", "type": "address" }, { "internalType": "address", "name": "tokenIn", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "internalType": "struct ITridentRouter.ExactInputSingleParams", "name": "params", "type": "tuple" } ], "name": "exactInputSingleWithNativeToken", "outputs": [ { "internalType": "uint256", "name": "amountOut", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "components": [ { "internalType": "address", "name": "tokenIn", "type": "address" }, { "internalType": "uint256", "name": "amountIn", "type": "uint256" }, { "internalType": "uint256", "name": "amountOutMinimum", "type": "uint256" }, { "components": [ { "internalType": "address", "name": "pool", "type": "address" }, { "internalType": "bytes", "name": "data", "type": "bytes" } ], "internalType": "struct ITridentRouter.Path[]", "name": "path", "type": "tuple[]" } ], "internalType": "struct ITridentRouter.ExactInputParams", "name": "params", "type": "tuple" } ], "name": "exactInputWithNativeToken", "outputs": [ { "internalType": "uint256", "name": "amountOut", "type": "uint256" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "maxChangeAmount", "type": "uint256" } ], "name": "harvest", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [], "name": "masterDeployer", "outputs": [ { "internalType": "contract IMasterDeployer", "name": "", "type": "address" } ], "stateMutability": "view", "type": "function" }, { "inputs": [ { "internalType": "bytes[]", "name": "data", "type": "bytes[]" } ], "name": "multicall", "outputs": [ { "internalType": "bytes[]", "name": "results", "type": "bytes[]" } ], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermit", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowed", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "nonce", "type": "uint256" }, { "internalType": "uint256", "name": "expiry", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitAllowedIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "value", "type": "uint256" }, { "internalType": "uint256", "name": "deadline", "type": "uint256" }, { "internalType": "uint8", "name": "v", "type": "uint8" }, { "internalType": "bytes32", "name": "r", "type": "bytes32" }, { "internalType": "bytes32", "name": "s", "type": "bytes32" } ], "name": "selfPermitIfNecessary", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "token", "type": "address" }, { "internalType": "uint256", "name": "amount", "type": "uint256" }, { "internalType": "address", "name": "recipient", "type": "address" }, { "internalType": "bool", "name": "fromBento", "type": "bool" } ], "name": "sweep", "outputs": [], "stateMutability": "payable", "type": "function" }, { "inputs": [ { "internalType": "address", "name": "recipient", "type": "address" } ], "name": "unwrapWETH", "outputs": [], "stateMutability": "payable", "type": "function" }, { "stateMutability": "payable", "type": "receive" } ], "transactionHash": "0x1be7df4b91e7f8c536fcefa1353b30f406bb4a404296a9aac9a1fc89f8685123", "receipt": { "to": null, "from": "0xf87BC5535602077d340806D71f805EA9907a843D", "contractAddress": "0xaB235da7f52d35fb4551AfBa11BFB56e18774A65", "transactionIndex": 1, "gasUsed": "3106327", "logsBloom": "0x00000000000000000000000000040000000000000000000000000000000000000000000000000000000000020200000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000400000000000000001000000000000000000000000000000000000000002000000000000000000000000000", "blockHash": "0x7bff834bdd914dba6d731d0dcdc52de714614a7ebae88b9e6170d511fe6737a0", "transactionHash": "0x1be7df4b91e7f8c536fcefa1353b30f406bb4a404296a9aac9a1fc89f8685123", "logs": [ { "transactionIndex": 1, "blockNumber": 6981259, "transactionHash": "0x1be7df4b91e7f8c536fcefa1353b30f406bb4a404296a9aac9a1fc89f8685123", "address": "0xF5BCE5077908a1b7370B9ae04AdC565EBd643966", "topics": [ "0xdfb44ffabf0d3a8f650d3ce43eff98f6d050e7ea1a396d5794f014e7dadabacb", "0x000000000000000000000000ab235da7f52d35fb4551afba11bfb56e18774a65" ], "data": "0x", "logIndex": 4, "blockHash": "0x7bff834bdd914dba6d731d0dcdc52de714614a7ebae88b9e6170d511fe6737a0" } ], "blockNumber": 6981259, "cumulativeGasUsed": "3256760", "status": 1, "byzantium": true }, "args": [ "0xF5BCE5077908a1b7370B9ae04AdC565EBd643966", "0x93395129bd3fcf49d95730d3c2737c17990ff328", "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6" ], "numDeployments": 1, "solcInputHash": "76e6dc96ea94c96e1c2463853d56dcaa", "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IBentoBoxMinimal\",\"name\":\"_bento\",\"type\":\"address\"},{\"internalType\":\"contract IMasterDeployer\",\"name\":\"_masterDeployer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_wETH\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"IncorrectSlippageParams\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotEnoughLiquidityMinted\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"NotWethSender\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"TooLittleReceived\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"native\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"struct ITridentRouter.TokenInput[]\",\"name\":\"tokenInput\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"minLiquidity\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"addLiquidity\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"approveMasterContract\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bento\",\"outputs\":[{\"internalType\":\"contract IBentoBoxMinimal\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"internalType\":\"struct IPool.TokenAmount[]\",\"name\":\"minWithdrawals\",\"type\":\"tuple[]\"}],\"name\":\"burnLiquidity\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"liquidity\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"minWithdrawal\",\"type\":\"uint256\"}],\"name\":\"burnLiquiditySingle\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"native\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"internalType\":\"struct ITridentRouter.InitialPath[]\",\"name\":\"initialPath\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"balancePercentage\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"internalType\":\"struct ITridentRouter.PercentagePath[]\",\"name\":\"percentagePath\",\"type\":\"tuple[]\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"unwrapBento\",\"type\":\"bool\"},{\"internalType\":\"uint256\",\"name\":\"minAmount\",\"type\":\"uint256\"}],\"internalType\":\"struct ITridentRouter.Output[]\",\"name\":\"output\",\"type\":\"tuple[]\"}],\"internalType\":\"struct ITridentRouter.ComplexPathParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"complexPath\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"factory\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"deployData\",\"type\":\"bytes\"}],\"name\":\"deployPool\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinimum\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"internalType\":\"struct ITridentRouter.Path[]\",\"name\":\"path\",\"type\":\"tuple[]\"}],\"internalType\":\"struct ITridentRouter.ExactInputParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"exactInput\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"internalType\":\"struct ITridentRouter.ExactInputSingleParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"exactInputSingle\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinimum\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"internalType\":\"struct ITridentRouter.ExactInputSingleParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"exactInputSingleWithNativeToken\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"tokenIn\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountIn\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountOutMinimum\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"address\",\"name\":\"pool\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"internalType\":\"struct ITridentRouter.Path[]\",\"name\":\"path\",\"type\":\"tuple[]\"}],\"internalType\":\"struct ITridentRouter.ExactInputParams\",\"name\":\"params\",\"type\":\"tuple\"}],\"name\":\"exactInputWithNativeToken\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"amountOut\",\"type\":\"uint256\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"maxChangeAmount\",\"type\":\"uint256\"}],\"name\":\"harvest\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"masterDeployer\",\"outputs\":[{\"internalType\":\"contract IMasterDeployer\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"data\",\"type\":\"bytes[]\"}],\"name\":\"multicall\",\"outputs\":[{\"internalType\":\"bytes[]\",\"name\":\"results\",\"type\":\"bytes[]\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowed\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitAllowedIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"selfPermitIfNecessary\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"fromBento\",\"type\":\"bool\"}],\"name\":\"sweep\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"}],\"name\":\"unwrapWETH\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"errors\":{\"NotWethSender()\":[{\"details\":\"Custom Errors\"}]},\"kind\":\"dev\",\"methods\":{\"addLiquidity((address,bool,uint256)[],address,uint256,bytes)\":{\"params\":{\"data\":\"Data required by the pool to add liquidity.\",\"minLiquidity\":\"Minimum output liquidity - caps slippage.\",\"pool\":\"Pool address to add liquidity to.\",\"tokenInput\":\"Token address and amount to add as liquidity.\"}},\"burnLiquidity(address,uint256,bytes,(address,uint256)[])\":{\"params\":{\"data\":\"Data required by the pool to burn liquidity.\",\"liquidity\":\"Amount of liquidity tokens to burn.\",\"minWithdrawals\":\"Minimum amount of `bento` tokens to be returned.\",\"pool\":\"Pool address.\"}},\"burnLiquiditySingle(address,uint256,bytes,uint256)\":{\"details\":\"The tokens are swapped automatically and the output is in a single token.\",\"params\":{\"data\":\"Data required by the pool to burn liquidity.\",\"liquidity\":\"Amount of liquidity tokens to burn.\",\"minWithdrawal\":\"Minimum amount of tokens to be returned.\",\"pool\":\"Pool address.\"}},\"complexPath(((address,address,bool,uint256,bytes)[],(address,address,uint64,bytes)[],(address,address,bool,uint256)[]))\":{\"details\":\"This function is not optimized for single swaps and should only be used in complex cases where the amounts are large enough that minimizing slippage by using multiple paths is worth the extra gas.\",\"params\":{\"params\":\"This includes everything needed for the swap. Look at the `ComplexPathParams` struct for more details.\"}},\"exactInput((address,uint256,uint256,(address,bytes)[]))\":{\"details\":\"Ensure that the pools are trusted before calling this function. The pools can steal users' tokens.\",\"params\":{\"params\":\"This includes the addresses of the tokens, pools, amount of token A to swap, minimum amount of token B after the swap and data required by the pools for the swaps.\"}},\"exactInputSingle((uint256,uint256,address,address,bytes))\":{\"details\":\"Ensure that the pool is trusted before calling this function. The pool can steal users' tokens.\",\"params\":{\"params\":\"This includes the address of token A, pool, amount of token A to swap, minimum amount of token B after the swap and data required by the pool for the swap.\"}},\"exactInputSingleWithNativeToken((uint256,uint256,address,address,bytes))\":{\"details\":\"Ensure that the pool is trusted before calling this function. The pool can steal users' tokens.\",\"params\":{\"params\":\"This includes the address of token A, pool, amount of token A to swap, minimum amount of token B after the swap and data required by the pool for the swap.\"}},\"exactInputWithNativeToken((address,uint256,uint256,(address,bytes)[]))\":{\"details\":\"Ensure that the pools are trusted before calling this function. The pools can steal users' tokens.\",\"params\":{\"params\":\"This includes the addresses of the tokens, pools, amount of token A to swap, minimum amount of token B after the swap and data required by the pools for the swaps.\"}},\"harvest(address,uint256)\":{\"details\":\"Should be batched in before a swap.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"addLiquidity((address,bool,uint256)[],address,uint256,bytes)\":{\"notice\":\"Add liquidity to a pool.\"},\"approveMasterContract(uint8,bytes32,bytes32)\":{\"notice\":\"Wrapper function to allow bento set master contract approval to be batched, so the first trade can happen in one transaction.\"},\"bento()\":{\"notice\":\"BentoBox token vault.\"},\"burnLiquidity(address,uint256,bytes,(address,uint256)[])\":{\"notice\":\"Burn liquidity tokens to get back `bento` tokens.\"},\"burnLiquiditySingle(address,uint256,bytes,uint256)\":{\"notice\":\"Burn liquidity tokens to get back `bento` tokens.\"},\"complexPath(((address,address,bool,uint256,bytes)[],(address,address,uint64,bytes)[],(address,address,bool,uint256)[]))\":{\"notice\":\"Swaps multiple input tokens to multiple output tokens using multiple paths, in different percentages. For example, you can swap 50 DAI + 100 USDC into 60% ETH and 40% BTC.\"},\"deployPool(address,bytes)\":{\"notice\":\"Wrapper function to allow pool deployment to be batched.\"},\"exactInput((address,uint256,uint256,(address,bytes)[]))\":{\"notice\":\"Swaps token A to token B indirectly by using multiple hops.\"},\"exactInputSingle((uint256,uint256,address,address,bytes))\":{\"notice\":\"Swaps token A to token B directly. Swaps are done on `bento` tokens.\"},\"exactInputSingleWithNativeToken((uint256,uint256,address,address,bytes))\":{\"notice\":\"Swaps token A to token B directly. It's the same as `exactInputSingle` except it takes raw ERC-20 tokens from the users and deposits them into `bento`.\"},\"exactInputWithNativeToken((address,uint256,uint256,(address,bytes)[]))\":{\"notice\":\"Swaps token A to token B indirectly by using multiple hops. It's the same as `exactInput` except it takes raw ERC-20 tokens from the users and deposits them into `bento`.\"},\"harvest(address,uint256)\":{\"notice\":\"Call BentoBox harvest function to rebalance a BentoBox token strategy and ensure there are enough tokens available to withdraw a swap output.\"},\"masterDeployer()\":{\"notice\":\"Master deployer.\"},\"sweep(address,uint256,address,bool)\":{\"notice\":\"Recover mistakenly sent tokens.\"},\"unwrapWETH(address)\":{\"notice\":\"Unwrap this contract's wETH into ETH.\"}},\"notice\":\"Router contract that helps in swapping across Trident pools.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/TridentRouter.sol\":\"TridentRouter\"},\"evmVersion\":\"london\",\"libraries\":{\":__CACHE_BREAKER__\":\"0x00000000d41867734bbee4c6863d9255b2b06ac1\"},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":999999},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/token/ERC20/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `to`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address to, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `from` to `to` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(\\n address from,\\n address to,\\n uint256 amount\\n ) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0xbbc8ac883ac3c0078ce5ad3e288fbb3ffcc8a30c3a98c0fda0114d64fc44fca2\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20Permit {\\n /**\\n * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,\\n * given ``owner``'s signed approval.\\n *\\n * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n * ordering also apply here.\\n *\\n * Emits an {Approval} event.\\n *\\n * Requirements:\\n *\\n * - `spender` cannot be the zero address.\\n * - `deadline` must be a timestamp in the future.\\n * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n * over the EIP712-formatted function arguments.\\n * - the signature must use ``owner``'s current nonce (see {nonces}).\\n *\\n * For more information on the signature format, see the\\n * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n * section].\\n */\\n function permit(\\n address owner,\\n address spender,\\n uint256 value,\\n uint256 deadline,\\n uint8 v,\\n bytes32 r,\\n bytes32 s\\n ) external;\\n\\n /**\\n * @dev Returns the current nonce for `owner`. This value must be\\n * included whenever a signature is generated for {permit}.\\n *\\n * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n * prevents a signature from being used multiple times.\\n */\\n function nonces(address owner) external view returns (uint256);\\n\\n /**\\n * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.\\n */\\n // solhint-disable-next-line func-name-mixedcase\\n function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0xf41ca991f30855bf80ffd11e9347856a517b977f0a6c2d52e6421a99b7840329\",\"license\":\"MIT\"},\"contracts/TridentRouter.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-or-later\\n\\npragma solidity >=0.8.0;\\n\\nimport {Multicall} from \\\"./abstract/Multicall.sol\\\";\\nimport {SelfPermit} from \\\"./abstract/SelfPermit.sol\\\";\\nimport {Transfer} from \\\"./libraries/Transfer.sol\\\";\\nimport {IBentoBoxMinimal} from \\\"./interfaces/IBentoBoxMinimal.sol\\\";\\nimport {IMasterDeployer} from \\\"./interfaces/IMasterDeployer.sol\\\";\\nimport {IPool} from \\\"./interfaces/IPool.sol\\\";\\nimport {ITridentRouter} from \\\"./interfaces/ITridentRouter.sol\\\";\\nimport {IWETH9} from \\\"./interfaces/IWETH9.sol\\\";\\n\\n/// @dev Custom Errors\\nerror NotWethSender();\\nerror TooLittleReceived();\\nerror NotEnoughLiquidityMinted();\\nerror IncorrectTokenWithdrawn();\\nerror IncorrectSlippageParams();\\nerror InsufficientWETH();\\nerror InvalidPool();\\n\\n/// @notice Router contract that helps in swapping across Trident pools.\\ncontract TridentRouter is ITridentRouter, SelfPermit, Multicall {\\n using Transfer for address;\\n\\n /// @notice BentoBox token vault.\\n IBentoBoxMinimal public immutable bento;\\n\\n /// @notice Master deployer.\\n IMasterDeployer public immutable masterDeployer;\\n\\n /// @notice ERC-20 token for wrapped ETH (v9).\\n address internal immutable wETH;\\n\\n /// @notice The user should use 0x0 if they want to use native currency, e.g., ETH.\\n address constant USE_NATIVE = address(0);\\n\\n constructor(\\n IBentoBoxMinimal _bento,\\n IMasterDeployer _masterDeployer,\\n address _wETH\\n ) {\\n bento = _bento;\\n masterDeployer = _masterDeployer;\\n wETH = _wETH;\\n _bento.registerProtocol();\\n }\\n\\n receive() external payable {\\n if (msg.sender != wETH) revert NotWethSender();\\n }\\n\\n /// @notice Swaps token A to token B directly. Swaps are done on `bento` tokens.\\n /// @param params This includes the address of token A, pool, amount of token A to swap,\\n /// minimum amount of token B after the swap and data required by the pool for the swap.\\n /// @dev Ensure that the pool is trusted before calling this function. The pool can steal users' tokens.\\n function exactInputSingle(ExactInputSingleParams calldata params) public payable returns (uint256 amountOut) {\\n // Prefund the pool with token A.\\n bento.transfer(params.tokenIn, msg.sender, params.pool, params.amountIn);\\n // Trigger the swap in the pool.\\n amountOut = IPool(params.pool).swap(params.data);\\n // Ensure that the slippage wasn't too much. This assumes that the pool is honest.\\n if (amountOut < params.amountOutMinimum) revert TooLittleReceived();\\n }\\n\\n /// @notice Swaps token A to token B indirectly by using multiple hops.\\n /// @param params This includes the addresses of the tokens, pools, amount of token A to swap,\\n /// minimum amount of token B after the swap and data required by the pools for the swaps.\\n /// @dev Ensure that the pools are trusted before calling this function. The pools can steal users' tokens.\\n function exactInput(ExactInputParams calldata params) public payable returns (uint256 amountOut) {\\n // Pay the first pool directly.\\n bento.transfer(params.tokenIn, msg.sender, params.path[0].pool, params.amountIn);\\n // Call every pool in the path.\\n // Pool `N` should transfer its output tokens to pool `N+1` directly.\\n // The last pool should transfer its output tokens to the user.\\n // If the user wants to unwrap `wETH`, the final destination should be this contract and\\n // a batch call should be made to `unwrapWETH`.\\n uint256 n = params.path.length;\\n for (uint256 i = 0; i < n; i = _increment(i)) {\\n amountOut = IPool(params.path[i].pool).swap(params.path[i].data);\\n }\\n // Ensure that the slippage wasn't too much. This assumes that the pool is honest.\\n if (amountOut < params.amountOutMinimum) revert TooLittleReceived();\\n }\\n\\n /// @notice Swaps token A to token B directly. It's the same as `exactInputSingle` except\\n /// it takes raw ERC-20 tokens from the users and deposits them into `bento`.\\n /// @param params This includes the address of token A, pool, amount of token A to swap,\\n /// minimum amount of token B after the swap and data required by the pool for the swap.\\n /// @dev Ensure that the pool is trusted before calling this function. The pool can steal users' tokens.\\n function exactInputSingleWithNativeToken(ExactInputSingleParams calldata params) public payable returns (uint256 amountOut) {\\n // Deposits the native ERC-20 token from the user into the pool's `bento`.\\n _depositToBentoBox(params.tokenIn, params.pool, params.amountIn);\\n // Trigger the swap in the pool.\\n amountOut = IPool(params.pool).swap(params.data);\\n // Ensure that the slippage wasn't too much. This assumes that the pool is honest.\\n if (amountOut < params.amountOutMinimum) revert TooLittleReceived();\\n }\\n\\n /// @notice Swaps token A to token B indirectly by using multiple hops. It's the same as `exactInput` except\\n /// it takes raw ERC-20 tokens from the users and deposits them into `bento`.\\n /// @param params This includes the addresses of the tokens, pools, amount of token A to swap,\\n /// minimum amount of token B after the swap and data required by the pools for the swaps.\\n /// @dev Ensure that the pools are trusted before calling this function. The pools can steal users' tokens.\\n function exactInputWithNativeToken(ExactInputParams calldata params) public payable returns (uint256 amountOut) {\\n // Deposits the native ERC-20 token from the user into the pool's `bento`.\\n _depositToBentoBox(params.tokenIn, params.path[0].pool, params.amountIn);\\n // Call every pool in the path.\\n // Pool `N` should transfer its output tokens to pool `N+1` directly.\\n // The last pool should transfer its output tokens to the user.\\n uint256 n = params.path.length;\\n for (uint256 i = 0; i < n; i = _increment(i)) {\\n amountOut = IPool(params.path[i].pool).swap(params.path[i].data);\\n }\\n // Ensure