Contract Overview
My Name Tag:
Not Available, login to update
[ Download CSV Export ]
Latest 25 internal transaction
[ Download CSV Export ]
Contract Name:
TridentRouter
Compiler Version
v0.8.10+commit.fc410830
Optimization Enabled:
Yes with 999999 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0; import {Multicall} from "./abstract/Multicall.sol"; import {SelfPermit} from "./abstract/SelfPermit.sol"; import {Transfer} from "./libraries/Transfer.sol"; import {IBentoBoxMinimal} from "./interfaces/IBentoBoxMinimal.sol"; import {IMasterDeployer} from "./interfaces/IMasterDeployer.sol"; import {IPool} from "./interfaces/IPool.sol"; import {ITridentRouter} from "./interfaces/ITridentRouter.sol"; import {IWETH9} from "./interfaces/IWETH9.sol"; /// @dev Custom Errors error NotWethSender(); error TooLittleReceived(); error NotEnoughLiquidityMinted(); error IncorrectTokenWithdrawn(); error InsufficientWETH(); error InvalidPool(); /// @notice Router contract that helps in swapping across Trident pools. contract TridentRouter is ITridentRouter, SelfPermit, Multicall { using Transfer for address; /// @dev Cached whitelisted pools. mapping(address => bool) internal whitelistedPools; /// @notice BentoBox token vault. IBentoBoxMinimal public immutable bento; /// @notice Master deployer. IMasterDeployer public immutable masterDeployer; /// @notice ERC-20 token for wrapped ETH (v9). address internal immutable wETH; /// @notice The user should use 0x0 if they want to use native currency, e.g., ETH. address constant USE_NATIVE = address(0); constructor( IBentoBoxMinimal _bento, IMasterDeployer _masterDeployer, address _wETH ) { bento = _bento; masterDeployer = _masterDeployer; wETH = _wETH; _bento.registerProtocol(); } receive() external payable { if (msg.sender != wETH) revert NotWethSender(); } /// @notice Swaps token A to token B directly. Swaps are done on `bento` tokens. /// @param 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. /// @dev Ensure that the pool is trusted before calling this function. The pool can steal users' tokens. function exactInputSingle(ExactInputSingleParams calldata params) public payable returns (uint256 amountOut) { // Prefund the pool with token A. bento.transfer(params.tokenIn, msg.sender, params.pool, params.amountIn); // Trigger the swap in the pool. amountOut = IPool(params.pool).swap(params.data); // Ensure that the slippage wasn't too much. This assumes that the pool is honest. if (amountOut < params.amountOutMinimum) revert TooLittleReceived(); } /// @notice Swaps token A to token B indirectly by using multiple hops. /// @param 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. /// @dev Ensure that the pools are trusted before calling this function. The pools can steal users' tokens. function exactInput(ExactInputParams calldata params) public payable returns (uint256 amountOut) { // Pay the first pool directly. bento.transfer(params.tokenIn, msg.sender, params.path[0].pool, params.amountIn); // Call every pool in the path. // Pool `N` should transfer its output tokens to pool `N+1` directly. // The last pool should transfer its output tokens to the user. // If the user wants to unwrap `wETH`, the final destination should be this contract and // a batch call should be made to `unwrapWETH`. for (uint256 i; i < params.path.length; ) { // We don't necessarily need this check but saving users from themselves. isWhiteListed(params.path[i].pool); amountOut = IPool(params.path[i].pool).swap(params.path[i].data); unchecked { ++i; } } // Ensure that the slippage wasn't too much. This assumes that the pool is honest. if (amountOut < params.amountOutMinimum) revert TooLittleReceived(); } /// @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`. /// @param 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. /// @dev Ensure that the pool is trusted before calling this function. The pool can steal users' tokens. function exactInputSingleWithNativeToken(ExactInputSingleParams calldata params) public payable returns (uint256 amountOut) { // Deposits the native ERC-20 token from the user into the pool's `bento`. _depositToBentoBox(params.tokenIn, params.pool, params.amountIn); // Trigger the swap in the pool. amountOut = IPool(params.pool).swap(params.data); // Ensure that the slippage wasn't too much. This assumes that the pool is honest. if (amountOut < params.amountOutMinimum) revert TooLittleReceived(); } /// @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`. /// @param 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. /// @dev Ensure that the pools are trusted before calling this function. The pools can steal users' tokens. function exactInputWithNativeToken(ExactInputParams calldata params) public payable returns (uint256 amountOut) { // Deposits the native ERC-20 token from the user into the pool's `bento`. _depositToBentoBox(params.tokenIn, params.path[0].pool, params.amountIn); // Call every pool in the path. // Pool `N` should transfer its output tokens to pool `N+1` directly. // The last pool should transfer its output tokens to the user. for (uint256 i; i < params.path.length; ) { isWhiteListed(params.path[i].pool); amountOut = IPool(params.path[i].pool).swap(params.path[i].data); unchecked { ++i; } } // Ensure that the slippage wasn't too much. This assumes that the pool is honest. if (amountOut < params.amountOutMinimum) revert TooLittleReceived(); } /// @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. /// @param params This includes everything needed for the swap. Look at the `ComplexPathParams` struct for more details. /// @dev 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. function complexPath(ComplexPathParams calldata params) public payable { // Deposit all initial tokens to respective pools and initiate the swaps. // Input tokens come from the user - output goes to following pools. for (uint256 i; i < params.initialPath.length; ) { if (params.initialPath[i].native) { _depositToBentoBox(params.initialPath[i].tokenIn, params.initialPath[i].pool, params.initialPath[i].amount); } else { bento.transfer(params.initialPath[i].tokenIn, msg.sender, params.initialPath[i].pool, params.initialPath[i].amount); } isWhiteListed(params.initialPath[i].pool); IPool(params.initialPath[i].pool).swap(params.initialPath[i].data); unchecked { ++i; } } // Do all the middle swaps. Input comes from previous pools - output goes to following pools. for (uint256 i; i < params.percentagePath.length; ) { uint256 balanceShares = bento.balanceOf(params.percentagePath[i].tokenIn, address(this)); uint256 transferShares = (balanceShares * params.percentagePath[i].balancePercentage) / uint256(10)**8; bento.transfer(params.percentagePath[i].tokenIn, address(this), params.percentagePath[i].pool, transferShares); isWhiteListed(params.percentagePath[i].pool); IPool(params.percentagePath[i].pool).swap(params.percentagePath[i].data); unchecked { ++i; } } // Do all the final swaps. Input comes from previous pools - output goes to the user. for (uint256 i; i < params.output.length; ) { uint256 balanceShares = bento.balanceOf(params.output[i].token, address(this)); if (balanceShares < params.output[i].minAmount) revert TooLittleReceived(); if (params.output[i].unwrapBento) { bento.withdraw(params.output[i].token, address(this), params.output[i].to, 0, balanceShares); } else { bento.transfer(params.output[i].token, address(this), params.output[i].to, balanceShares); } unchecked { ++i; } } } /// @notice Add liquidity to a pool. /// @param tokenInput Token address and amount to add as liquidity. /// @param pool Pool address to add liquidity to. /// @param minLiquidity Minimum output liquidity - caps slippage. /// @param data Data required by the pool to add liquidity. function addLiquidity( TokenInput[] calldata tokenInput, address pool, uint256 minLiquidity, bytes calldata data ) public payable returns (uint256 liquidity) { isWhiteListed(pool); // Send all input tokens to the pool. for (uint256 i; i < tokenInput.length; ) { if (tokenInput[i].native) { _depositToBentoBox(tokenInput[i].token, pool, tokenInput[i].amount); } else { bento.transfer(tokenInput[i].token, msg.sender, pool, tokenInput[i].amount); } unchecked { ++i; } } liquidity = IPool(pool).mint(data); if (liquidity < minLiquidity) revert NotEnoughLiquidityMinted(); } /// @notice Burn liquidity tokens to get back `bento` tokens. /// @param pool Pool address. /// @param liquidity Amount of liquidity tokens to burn. /// @param data Data required by the pool to burn liquidity. /// @param minWithdrawals Minimum amount of `bento` tokens to be returned. function burnLiquidity( address pool, uint256 liquidity, bytes calldata data, IPool.TokenAmount[] calldata minWithdrawals ) public { isWhiteListed(pool); pool.safeTransferFrom(msg.sender, pool, liquidity); IPool.TokenAmount[] memory withdrawnLiquidity = IPool(pool).burn(data); for (uint256 i; i < minWithdrawals.length; ++i) { uint256 j; for (; j < withdrawnLiquidity.length; ++j) { if (withdrawnLiquidity[j].token == minWithdrawals[i].token) { if (withdrawnLiquidity[j].amount < minWithdrawals[i].amount) revert TooLittleReceived(); break; } } // A token that is present in `minWithdrawals` is missing from `withdrawnLiquidity`. if (j >= withdrawnLiquidity.length) revert IncorrectTokenWithdrawn(); } } /// @notice Burn liquidity tokens to get back `bento` tokens. /// @dev The tokens are swapped automatically and the output is in a single token. /// @param pool Pool address. /// @param liquidity Amount of liquidity tokens to burn. /// @param data Data required by the pool to burn liquidity. /// @param minWithdrawal Minimum amount of tokens to be returned. function burnLiquiditySingle( address pool, uint256 liquidity, bytes calldata data, uint256 minWithdrawal ) public { isWhiteListed(pool); // Use 'liquidity = 0' for prefunding. pool.safeTransferFrom(msg.sender, pool, liquidity); uint256 withdrawn = IPool(pool).burnSingle(data); if (withdrawn < minWithdrawal) revert TooLittleReceived(); } /// @notice Recover mistakenly sent tokens. function sweep( address token, uint256 amount, address recipient, bool onBento ) external payable { if (onBento) { bento.transfer(token, address(this), recipient, amount); } else { token == USE_NATIVE ? recipient.safeTransferETH(address(this).balance) : token.safeTransfer(recipient, amount); } } /// @notice Unwrap this contract's `wETH` into ETH. function unwrapWETH(uint256 amountMinimum, address recipient) external payable { uint256 balance = IWETH9(wETH).balanceOf(address(this)); if (balance < amountMinimum) revert InsufficientWETH(); if (balance != 0) { IWETH9(wETH).withdraw(balance); recipient.safeTransferETH(balance); } } /// @notice Wrapper function to allow pool deployment to be batched. function deployPool(address factory, bytes calldata deployData) external payable returns (address) { return masterDeployer.deployPool(factory, deployData); } /// @notice Wrapper function to allow bento set master contract approval to be batched, so the first trade can happen in one transaction. function approveMasterContract( uint8 v, bytes32 r, bytes32 s ) external payable { bento.setMasterContractApproval(msg.sender, address(this), true, v, r, s); } /// @notice Deposit from the user's wallet into BentoBox. /// @dev Amount is the native token amount. We let BentoBox do the conversion into shares. function _depositToBentoBox( address token, address recipient, uint256 amount ) internal { bento.deposit{value: token == USE_NATIVE ? amount : 0}(token, msg.sender, recipient, amount, 0); } /// @notice Check pool whitelisting status. function isWhiteListed(address pool) internal { if (!whitelistedPools[pool]) { if (!masterDeployer.pools(pool)) revert InvalidPool(); whitelistedPools[pool] = true; } } }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0; /// @notice Helper utility that enables calling multiple local methods in a single call. /// @author Modified from Uniswap (https://github.com/Uniswap/v3-periphery/blob/main/contracts/base/Multicall.sol) /// License-Identifier: GPL-2.0-or-later abstract contract Multicall { function multicall(bytes[] calldata data) public payable returns (bytes[] memory results) { results = new bytes[](data.length); for (uint256 i; i < data.length;) { (bool success, bytes memory result) = address(this).delegatecall(data[i]); if (!success) { // Next 5 lines from https://ethereum.stackexchange.com/a/83577 if (result.length < 68) revert(); assembly { result := add(result, 0x04) } revert(abi.decode(result, (string))); } results[i] = result; // cannot realistically overflow on human timescales unchecked { ++i; } } } }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol"; import "../interfaces/IERC20PermitAllowed.sol"; abstract contract SelfPermit { function selfPermit( address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public payable { IERC20Permit(token).permit(msg.sender, address(this), value, deadline, v, r, s); } function selfPermitIfNecessary( address token, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external payable { if (IERC20(token).allowance(msg.sender, address(this)) < value) selfPermit(token, value, deadline, v, r, s); } function selfPermitAllowed( address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) public payable { IERC20PermitAllowed(token).permit(msg.sender, address(this), nonce, expiry, true, v, r, s); } function selfPermitAllowedIfNecessary( address token, uint256 nonce, uint256 expiry, uint8 v, bytes32 r, bytes32 s ) external payable { if (IERC20(token).allowance(msg.sender, address(this)) < type(uint256).max) selfPermitAllowed(token, nonce, expiry, v, r, s); } }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; library Transfer { /// @notice Transfers tokens from the targeted address to the given destination /// @notice Errors with 'STF' if transfer fails /// @param token The contract address of the token to be transferred /// @param from The originating address from which the tokens will be transferred /// @param to The destination address of the transfer /// @param value The amount to be transferred function safeTransferFrom( address token, address from, address to, uint256 value ) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transferFrom.selector, from, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), "STF"); } /// @notice Transfers tokens from msg.sender to a recipient /// @dev Errors with ST if transfer fails /// @param token The contract address of the token which will be transferred /// @param to The recipient of the transfer /// @param value The value of the transfer function safeTransfer( address token, address to, uint256 value ) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.transfer.selector, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), "ST"); } /// @notice Approves the stipulated contract to spend the given allowance in the given token /// @dev Errors with 'SA' if transfer fails /// @param token The contract address of the token to be approved /// @param to The target of the approval /// @param value The amount of the given token the target will be allowed to spend function safeApprove( address token, address to, uint256 value ) internal { (bool success, bytes memory data) = token.call(abi.encodeWithSelector(IERC20.approve.selector, to, value)); require(success && (data.length == 0 || abi.decode(data, (bool))), "SA"); } /// @notice Transfers ETH to the recipient address /// @dev Fails with `STE` /// @param to The destination of the transfer /// @param value The value to be transferred function safeTransferETH(address to, uint256 value) internal { (bool success, ) = to.call{value: value}(new bytes(0)); require(success, "STE"); } }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0; import "../libraries/RebaseLibrary.sol"; /// @notice Minimal BentoBox vault interface. /// @dev `token` is aliased as `address` from `IERC20` for simplicity. interface IBentoBoxMinimal { /// @notice Balance per ERC-20 token per account in shares. function balanceOf(address, address) external view returns (uint256); /// @dev Helper function to represent an `amount` of `token` in shares. /// @param token The ERC-20 token. /// @param amount The `token` amount. /// @param roundUp If the result `share` should be rounded up. /// @return share The token amount represented in shares. function toShare( address token, uint256 amount, bool roundUp ) external view returns (uint256 share); /// @dev Helper function to represent shares back into the `token` amount. /// @param token The ERC-20 token. /// @param share The amount of shares. /// @param roundUp If the result should be rounded up. /// @return amount The share amount back into native representation. function toAmount( address token, uint256 share, bool roundUp ) external view returns (uint256 amount); /// @notice Registers this contract so that users can approve it for BentoBox. function registerProtocol() external; /// @notice Deposit an amount of `token` represented in either `amount` or `share`. /// @param token The ERC-20 token to deposit. /// @param from which account to pull the tokens. /// @param to which account to push the tokens. /// @param amount Token amount in native representation to deposit. /// @param share Token amount represented in shares to deposit. Takes precedence over `amount`. /// @return amountOut The amount deposited. /// @return shareOut The deposited amount represented in shares. function deposit( address token, address from, address to, uint256 amount, uint256 share ) external payable returns (uint256 amountOut, uint256 shareOut); /// @notice Withdraws an amount of `token` from a user account. /// @param token_ The ERC-20 token to withdraw. /// @param from which user to pull the tokens. /// @param to which user to push the tokens. /// @param amount of tokens. Either one of `amount` or `share` needs to be supplied. /// @param share Like above, but `share` takes precedence over `amount`. function withdraw( address token_, address from, address to, uint256 amount, uint256 share ) external returns (uint256 amountOut, uint256 shareOut); /// @notice Transfer shares from a user account to another one. /// @param token The ERC-20 token to transfer. /// @param from which user to pull the tokens. /// @param to which user to push the tokens. /// @param share The amount of `token` in shares. function transfer( address token, address from, address to, uint256 share ) external; /// @dev Reads the Rebase `totals`from storage for a given token function totals(address token) external view returns (Rebase memory total); /// @dev Approves users' BentoBox assets to a "master" contract. function setMasterContractApproval( address user, address masterContract, bool approved, uint8 v, bytes32 r, bytes32 s ) external; }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0; /// @notice Trident pool deployer interface. interface IMasterDeployer { function barFee() external view returns (uint256); function barFeeTo() external view returns (address); function bento() external view returns (address); function migrator() external view returns (address); function pools(address pool) external view returns (bool); function deployPool(address factory, bytes calldata deployData) external returns (address); }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.5.0; pragma experimental ABIEncoderV2; /// @notice Trident pool interface. interface IPool { /// @notice Executes a swap from one token to another. /// @dev The input tokens must've already been sent to the pool. /// @param data ABI-encoded params that the pool requires. /// @return finalAmountOut The amount of output tokens that were sent to the user. function swap(bytes calldata data) external returns (uint256 finalAmountOut); /// @notice Executes a swap from one token to another with a callback. /// @dev This function allows borrowing the output tokens and sending the input tokens in the callback. /// @param data ABI-encoded params that the pool requires. /// @return finalAmountOut The amount of output tokens that were sent to the user. function flashSwap(bytes calldata data) external returns (uint256 finalAmountOut); /// @notice Mints liquidity tokens. /// @param data ABI-encoded params that the pool requires. /// @return liquidity The amount of liquidity tokens that were minted for the user. function mint(bytes calldata data) external returns (uint256 liquidity); /// @notice Burns liquidity tokens. /// @dev The input LP tokens must've already been sent to the pool. /// @param data ABI-encoded params that the pool requires. /// @return withdrawnAmounts The amount of various output tokens that were sent to the user. function burn(bytes calldata data) external returns (TokenAmount[] memory withdrawnAmounts); /// @notice Burns liquidity tokens for a single output token. /// @dev The input LP tokens must've already been sent to the pool. /// @param data ABI-encoded params that the pool requires. /// @return amountOut The amount of output tokens that were sent to the user. function burnSingle(bytes calldata data) external returns (uint256 amountOut); /// @return A unique identifier for the pool type. function poolIdentifier() external pure returns (bytes32); /// @return An array of tokens supported by the pool. function getAssets() external view returns (address[] memory); /// @notice Simulates a trade and returns the expected output. /// @dev The pool does not need to include a trade simulator directly in itself - it can use a library. /// @param data ABI-encoded params that the pool requires. /// @return finalAmountOut The amount of output tokens that will be sent to the user if the trade is executed. function getAmountOut(bytes calldata data) external view returns (uint256 finalAmountOut); /// @notice Simulates a trade and returns the expected output. /// @dev The pool does not need to include a trade simulator directly in itself - it can use a library. /// @param data ABI-encoded params that the pool requires. /// @return finalAmountIn The amount of input tokens that are required from the user if the trade is executed. function getAmountIn(bytes calldata data) external view returns (uint256 finalAmountIn); /// @dev This event must be emitted on all swaps. event Swap(address indexed recipient, address indexed tokenIn, address indexed tokenOut, uint256 amountIn, uint256 amountOut); /// @dev This struct frames output tokens for burns. struct TokenAmount { address token; uint256 amount; } }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0; /// @notice Trident pool router interface. interface ITridentRouter { struct Path { address pool; bytes data; } struct ExactInputSingleParams { uint256 amountIn; uint256 amountOutMinimum; address pool; address tokenIn; bytes data; } struct ExactInputParams { address tokenIn; uint256 amountIn; uint256 amountOutMinimum; Path[] path; } struct TokenInput { address token; bool native; uint256 amount; } struct InitialPath { address tokenIn; address pool; bool native; uint256 amount; bytes data; } struct PercentagePath { address tokenIn; address pool; uint64 balancePercentage; // Multiplied by 10^6. 100% = 100_000_000 bytes data; } struct Output { address token; address to; bool unwrapBento; uint256 minAmount; } struct ComplexPathParams { InitialPath[] initialPath; PercentagePath[] percentagePath; Output[] output; } }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IWETH9 is IERC20 { function deposit() external payable; function withdraw(uint256) external; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612]. * * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. */ interface IERC20Permit { /** * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens, * given ``owner``'s signed approval. * * IMPORTANT: The same issues {IERC20-approve} has related to transaction * ordering also apply here. * * Emits an {Approval} event. * * Requirements: * * - `spender` cannot be the zero address. * - `deadline` must be a timestamp in the future. * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner` * over the EIP712-formatted function arguments. * - the signature must use ``owner``'s current nonce (see {nonces}). * * For more information on the signature format, see the * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP * section]. */ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; /** * @dev Returns the current nonce for `owner`. This value must be * included whenever a signature is generated for {permit}. * * Every successful call to {permit} increases ``owner``'s nonce by one. This * prevents a signature from being used multiple times. */ function nonces(address owner) external view returns (uint256); /** * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}. */ // solhint-disable-next-line func-name-mixedcase function DOMAIN_SEPARATOR() external view returns (bytes32); }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity >=0.8.0; interface IERC20PermitAllowed { function permit( address holder, address spender, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s ) external; }
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity ^0.8; struct Rebase { uint128 elastic; uint128 base; } /// @notice A rebasing library library RebaseLibrary { /// @notice Calculates the base value in relationship to `elastic` and `total`. function toBase(Rebase memory total, uint256 elastic) internal pure returns (uint256 base) { if (total.elastic == 0) { base = elastic; } else { base = (elastic * total.base) / total.elastic; } } /// @notice Calculates the elastic value in relationship to `base` and `total`. function toElastic(Rebase memory total, uint256 base) internal pure returns (uint256 elastic) { if (total.base == 0) { elastic = base; } else { elastic = (base * total.elastic) / total.base; } } }
{ "optimizer": { "enabled": true, "runs": 999999 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"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":"IncorrectTokenWithdrawn","type":"error"},{"inputs":[],"name":"InsufficientWETH","type":"error"},{"inputs":[],"name":"InvalidPool","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":"nonpayable","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":"nonpayable","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":[],"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":"onBento","type":"bool"}],"name":"sweep","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amountMinimum","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"name":"unwrapWETH","outputs":[],"stateMutability":"payable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60e06040523480156200001157600080fd5b5060405162003aca38038062003aca8339810160408190526200003491620000c3565b6001600160a01b03808416608081905283821660a05290821660c0526040805163577268d960e11b8152905163aee4d1b29160048082019260009290919082900301818387803b1580156200008857600080fd5b505af11580156200009d573d6000803e3d6000fd5b5050505050505062000117565b6001600160a01b0381168114620000c057600080fd5b50565b600080600060608486031215620000d957600080fd5b8351620000e681620000aa565b6020850151909350620000f981620000aa565b60408501519092506200010c81620000aa565b809150509250925092565b60805160a05160c051613913620001b760003960008181610165015281816122cf01526123c0015260008181610385015281816108de01526126450152600081816102b2015281816105e10152818161097b01528181610c4501528181610e95015281816115b301528181611883015281816119ff01528181611ca401528181611e4201528181611f9a0152818161212b01526124eb01526139136000f3fe6080604052600436106101485760003560e01c8063783312d9116100c0578063bc10869311610074578063cf58879a11610059578063cf58879a14610373578063e16d9ce5146103a7578063f3995c67146103ba57600080fd5b8063bc1086931461034d578063c2e3140a1461036057600080fd5b8063a4a78f0c116100a5578063a4a78f0c14610307578063ac9650d81461031a578063b96c5c0e1461033a57600080fd5b8063783312d9146102d45780639fa74491146102f457600080fd5b80632c0d9a0111610117578063403335a8116100fc578063403335a81461027a5780634659a4941461028d5780634da31827146102a057600080fd5b80632c0d9a01146102545780632cfcb94f1461026757600080fd5b80630b0d1b1e146101c35780630f93d439146101e95780631aa349a8146101fc578063250558dc1461021c57600080fd5b366101be573373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146101bc576040517fe7218bb300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b005b600080fd5b6101d66101d1366004612af6565b6103cd565b6040519081526020015b60405180910390f35b6101d66101f7366004612b38565b6105c8565b34801561020857600080fd5b506101bc610217366004612be9565b610795565b61022f61022a366004612c4d565b61089e565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016101e0565b6101d6610262366004612af6565b610962565b6101d6610275366004612ca2565b610bac565b6101bc610288366004612d6e565b610e43565b6101bc61029b366004612da1565b610f0b565b3480156102ac57600080fd5b5061022f7f000000000000000000000000000000000000000000000000000000000000000081565b3480156102e057600080fd5b506101bc6102ef366004612dfb565b610fc6565b6101d6610302366004612b38565b61121a565b6101bc610315366004612da1565b611256565b61032d610328366004612eb6565b611320565b6040516101e09190612fa1565b6101bc610348366004613021565b611490565b6101bc61035b36600461306a565b6120cb565b6101bc61036e366004612da1565b6121f4565b34801561037f57600080fd5b5061022f7f000000000000000000000000000000000000000000000000000000000000000081565b6101bc6103b53660046130bd565b61229e565b6101bc6103c8366004612da1565b612457565b60006104276103df60208401846130ed565b6103ec606085018561310a565b60008181106103fd576103fd613172565b905060200281019061040f91906131a1565b61041d9060208101906130ed565b84602001356124d4565b60005b610437606084018461310a565b905081101561058457610485610450606085018561310a565b8381811061046057610460613172565b905060200281019061047291906131a1565b6104809060208101906130ed565b6125d3565b610492606084018461310a565b828181106104a2576104a2613172565b90506020028101906104b491906131a1565b6104c29060208101906130ed565b73ffffffffffffffffffffffffffffffffffffffff1663627dd56a6104ea606086018661310a565b848181106104fa576104fa613172565b905060200281019061050c91906131a1565b61051a9060208101906131df565b6040518363ffffffff1660e01b815260040161053792919061328d565b6020604051808303816000875af1158015610556573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061057a91906132a1565b915060010161042a565b5081604001358110156105c3576040517fc9f52c7100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b919050565b600073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001663f18d03cc61061660808501606086016130ed565b3361062760608701604088016130ed565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff93841660048201529183166024830152909116604482015284356064820152608401600060405180830381600087803b1580156106a457600080fd5b505af11580156106b8573d6000803e3d6000fd5b506106cd9250505060608301604084016130ed565b73ffffffffffffffffffffffffffffffffffffffff1663627dd56a6106f560808501856131df565b6040518363ffffffff1660e01b815260040161071292919061328d565b6020604051808303816000875af1158015610731573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061075591906132a1565b905081602001358110156105c3576040517fc9f52c7100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b61079e856125d3565b6107c073ffffffffffffffffffffffffffffffffffffffff8616338787612738565b6040517faf8c09bf00000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff87169063af8c09bf90610817908790879060040161328d565b6020604051808303816000875af1158015610836573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061085a91906132a1565b905081811015610896576040517fc9f52c7100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050505050565b6040517f250558dc00000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063250558dc90610917908790879087906004016132ba565b6020604051808303816000875af1158015610936573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061095a91906132f3565b949350505050565b600073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001663f18d03cc6109ad60208501856130ed565b336109bb606087018761310a565b60008181106109cc576109cc613172565b90506020028101906109de91906131a1565b6109ec9060208101906130ed565b60405160e085901b7fffffffff0000000000000000000000000000000000000000000000000000000016815273ffffffffffffffffffffffffffffffffffffffff93841660048201529183166024830152909116604482015260208501356064820152608401600060405180830381600087803b158015610a6c57600080fd5b505af1158015610a80573d6000803e3d6000fd5b5050505060005b610a94606084018461310a565b905081101561058457610aad610450606085018561310a565b610aba606084018461310a565b82818110610aca57610aca613172565b9050602002810190610adc91906131a1565b610aea9060208101906130ed565b73ffffffffffffffffffffffffffffffffffffffff1663627dd56a610b12606086018661310a565b84818110610b2257610b22613172565b9050602002810190610b3491906131a1565b610b429060208101906131df565b6040518363ffffffff1660e01b8152600401610b5f92919061328d565b6020604051808303816000875af1158015610b7e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba291906132a1565b9150600101610a87565b6000610bb7856125d3565b60005b86811015610d6557878782818110610bd457610bd4613172565b9050606002016020016020810190610bec9190613310565b15610c4357610c3e888883818110610c0657610c06613172565b610c1c92602060609092020190810191506130ed565b878a8a85818110610c2f57610c2f613172565b905060600201604001356124d4565b610d5d565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663f18d03cc898984818110610c9157610c91613172565b610ca792602060609092020190810191506130ed565b33898c8c87818110610cbb57610cbb613172565b604080517fffffffff0000000000000000000000000000000000000000000000000000000060e08a901b16815273ffffffffffffffffffffffffffffffffffffffff978816600482015295871660248701529590931660448501525060609091020191909101356064820152608401600060405180830381600087803b158015610d4457600080fd5b505af1158015610d58573d6000803e3d6000fd5b505050505b600101610bba565b506040517f7ba0e2e700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff861690637ba0e2e790610dba908690869060040161328d565b6020604051808303816000875af1158015610dd9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dfd91906132a1565b905083811015610e39576040517f249942be00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b9695505050505050565b6040517fc0a47c930000000000000000000000000000000000000000000000000000000081523360048201523060248201526001604482015260ff841660648201526084810183905260a481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063c0a47c939060c401600060405180830381600087803b158015610eee57600080fd5b505af1158015610f02573d6000803e3d6000fd5b50505050505050565b6040517f8fcbaf0c00000000000000000000000000000000000000000000000000000000815233600482015230602482015260448101869052606481018590526001608482015260ff841660a482015260c4810183905260e4810182905273ffffffffffffffffffffffffffffffffffffffff871690638fcbaf0c90610104015b600060405180830381600087803b158015610fa657600080fd5b505af1158015610fba573d6000803e3d6000fd5b50505050505050505050565b610fcf866125d3565b610ff173ffffffffffffffffffffffffffffffffffffffff8716338888612738565b6040517f2a07b6c700000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff881690632a07b6c790611048908890889060040161328d565b6000604051808303816000875af1158015611067573d6000803e3d6000fd5b505050506040513d6000823e601f3d9081017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01682016040526110ad91908101906133d4565b905060005b828110156112105760005b82518110156111c5578484838181106110d8576110d8613172565b6110ee92602060409092020190810191506130ed565b73ffffffffffffffffffffffffffffffffffffffff1683828151811061111657611116613172565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1614156111b55784848381811061115057611150613172565b9050604002016020013583828151811061116c5761116c613172565b60200260200101516020015110156111b0576040517fc9f52c7100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6111c5565b6111be816134d9565b90506110bd565b825181106111ff576040517f85b6199600000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50611209816134d9565b90506110b2565b5050505050505050565b600061124661122f60808401606085016130ed565b61123f60608501604086016130ed565b84356124d4565b6106cd60608301604084016130ed565b6040517fdd62ed3e0000000000000000000000000000000000000000000000000000000081523360048201523060248201527fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff9073ffffffffffffffffffffffffffffffffffffffff88169063dd62ed3e90604401602060405180830381865afa1580156112e8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061130c91906132a1565b101561089657610896868686868686610f0b565b60608167ffffffffffffffff81111561133b5761133b61332d565b60405190808252806020026020018201604052801561136e57816020015b60608152602001906001900390816113595790505b50905060005b82811015611489576000803086868581811061139257611392613172565b90506020028101906113a491906131df565b6040516113b2929190613512565b600060405180830381855af49150503d80600081146113ed576040519150601f19603f3d011682016040523d82523d6000602084013e6113f2565b606091505b5091509150816114615760448151101561140b57600080fd5b600481019050808060200190518101906114259190613522565b6040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161145891906135d4565b60405180910390fd5b8084848151811061147457611474613172565b60209081029190910101525050600101611374565b5092915050565b60005b61149d828061310a565b9050811015611850576114b0828061310a565b828181106114c0576114c0613172565b90506020028101906114d291906135e7565b6114e3906060810190604001613310565b1561159c576115976114f5838061310a565b8381811061150557611505613172565b905060200281019061151791906135e7565b6115259060208101906130ed565b61152f848061310a565b8481811061153f5761153f613172565b905060200281019061155191906135e7565b6115629060408101906020016130ed565b61156c858061310a565b8581811061157c5761157c613172565b905060200281019061158e91906135e7565b606001356124d4565b611715565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001663f18d03cc6115e2848061310a565b848181106115f2576115f2613172565b905060200281019061160491906135e7565b6116129060208101906130ed565b3361161d868061310a565b8681811061162d5761162d613172565b905060200281019061163f91906135e7565b6116509060408101906020016130ed565b61165a878061310a565b8781811061166a5761166a613172565b905060200281019061167c91906135e7565b60405160e086901b7fffffffff0000000000000000000000000000000000000000000000000000000016815273ffffffffffffffffffffffffffffffffffffffff94851660048201529284166024840152921660448201526060909101356064820152608401600060405180830381600087803b1580156116fc57600080fd5b505af1158015611710573d6000803e3d6000fd5b505050505b611755611722838061310a565b8381811061173257611732613172565b905060200281019061174491906135e7565b6104809060408101906020016130ed565b61175f828061310a565b8281811061176f5761176f613172565b905060200281019061178191906135e7565b6117929060408101906020016130ed565b73ffffffffffffffffffffffffffffffffffffffff1663627dd56a6117b7848061310a565b848181106117c7576117c7613172565b90506020028101906117d991906135e7565b6117e79060808101906131df565b6040518363ffffffff1660e01b815260040161180492919061328d565b6020604051808303816000875af1158015611823573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061184791906132a1565b50600101611493565b5060005b611861602083018361310a565b9050811015611c7157600073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001663f7888aec6118b5602086018661310a565b858181106118c5576118c5613172565b90506020028101906118d7919061361b565b6118e59060208101906130ed565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152306024820152604401602060405180830381865afa158015611954573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061197891906132a1565b905060006119886008600a613771565b611995602086018661310a565b858181106119a5576119a5613172565b90506020028101906119b7919061361b565b6119c8906060810190604001613780565b6119dc9067ffffffffffffffff16846137aa565b6119e691906137e7565b905073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001663f18d03cc611a31602087018761310a565b86818110611a4157611a41613172565b9050602002810190611a53919061361b565b611a619060208101906130ed565b30611a6f602089018961310a565b88818110611a7f57611a7f613172565b9050602002810190611a91919061361b565b611aa29060408101906020016130ed565b60405160e085901b7fffffffff0000000000000000000000000000000000000000000000000000000016815273ffffffffffffffffffffffffffffffffffffffff93841660048201529183166024830152909116604482015260648101849052608401600060405180830381600087803b158015611b1f57600080fd5b505af1158015611b33573d6000803e3d6000fd5b50611b6b9250611b49915050602086018661310a565b85818110611b5957611b59613172565b9050602002810190611744919061361b565b611b78602085018561310a565b84818110611b8857611b88613172565b9050602002810190611b9a919061361b565b611bab9060408101906020016130ed565b73ffffffffffffffffffffffffffffffffffffffff1663627dd56a611bd3602087018761310a565b86818110611be357611be3613172565b9050602002810190611bf5919061361b565b611c039060608101906131df565b6040518363ffffffff1660e01b8152600401611c2092919061328d565b6020604051808303816000875af1158015611c3f573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611c6391906132a1565b508260010192505050611854565b5060005b611c826040830183613822565b90508110156120c757600073ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001663f7888aec611cd66040860186613822565b85818110611ce657611ce6613172565b611cfc92602060809092020190810191506130ed565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff9091166004820152306024820152604401602060405180830381865afa158015611d6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d8f91906132a1565b9050611d9e6040840184613822565b83818110611dae57611dae613172565b90506080020160600135811015611df1576040517fc9f52c7100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611dfe6040840184613822565b83818110611e0e57611e0e613172565b9050608002016040016020810190611e269190613310565b15611f835773ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000166397da6d30611e746040860186613822565b85818110611e8457611e84613172565b611e9a92602060809092020190810191506130ed565b30611ea86040880188613822565b87818110611eb857611eb8613172565b9050608002016020016020810190611ed091906130ed565b60405160e085901b7fffffffff0000000000000000000000000000000000000000000000000000000016815273ffffffffffffffffffffffffffffffffffffffff938416600482015291831660248301529091166044820152600060648201526084810184905260a40160408051808303816000875af1158015611f58573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f7c919061388a565b50506120be565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001663f18d03cc611fcc6040860186613822565b85818110611fdc57611fdc613172565b611ff292602060809092020190810191506130ed565b306120006040880188613822565b8781811061201057612010613172565b905060800201602001602081019061202891906130ed565b60405160e085901b7fffffffff0000000000000000000000000000000000000000000000000000000016815273ffffffffffffffffffffffffffffffffffffffff93841660048201529183166024830152909116604482015260648101849052608401600060405180830381600087803b1580156120a557600080fd5b505af11580156120b9573d6000803e3d6000fd5b505050505b50600101611c75565b5050565b801561218c576040517ff18d03cc00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301523060248301528381166044830152606482018590527f0000000000000000000000000000000000000000000000000000000000000000169063f18d03cc90608401600060405180830381600087803b15801561216f57600080fd5b505af1158015612183573d6000803e3d6000fd5b505050506121ee565b73ffffffffffffffffffffffffffffffffffffffff8416156121ce576121c973ffffffffffffffffffffffffffffffffffffffff851683856128a9565b6121ee565b6121ee73ffffffffffffffffffffffffffffffffffffffff831647612a12565b50505050565b6040517fdd62ed3e000000000000000000000000000000000000000000000000000000008152336004820152306024820152859073ffffffffffffffffffffffffffffffffffffffff88169063dd62ed3e90604401602060405180830381865afa158015612266573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061228a91906132a1565b101561089657610896868686868686612457565b6040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa15801561232b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061234f91906132a1565b90508281101561238b576040517f6f2750f500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b8015612452576040517f2e1a7d4d000000000000000000000000000000000000000000000000000000008152600481018290527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632e1a7d4d90602401600060405180830381600087803b15801561241957600080fd5b505af115801561242d573d6000803e3d6000fd5b506124529250505073ffffffffffffffffffffffffffffffffffffffff831682612a12565b505050565b6040517fd505accf000000000000000000000000000000000000000000000000000000008152336004820152306024820152604481018690526064810185905260ff8416608482015260a4810183905260c4810182905273ffffffffffffffffffffffffffffffffffffffff87169063d505accf9060e401610f8c565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000008116906302b9446c90851615612521576000612523565b825b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e084901b16815273ffffffffffffffffffffffffffffffffffffffff808816600483015233602483015286166044820152606481018590526000608482015260a401604080518083038185885af11580156125a7573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906125cc919061388a565b5050505050565b73ffffffffffffffffffffffffffffffffffffffff811660009081526020819052604090205460ff16612735576040517fa4063dbc00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063a4063dbc90602401602060405180830381865afa15801561268c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906126b091906138ae565b6126e6576040517f2083cd4000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600090815260208190526040902080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001660011790555b50565b6040805173ffffffffffffffffffffffffffffffffffffffff85811660248301528481166044830152606480830185905283518084039091018152608490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167f23b872dd0000000000000000000000000000000000000000000000000000000017905291516000928392908816916127d791906138cb565b6000604051808303816000865af19150503d8060008114612814576040519150601f19603f3d011682016040523d82523d6000602084013e612819565b606091505b509150915081801561284357508051158061284357508080602001905181019061284391906138ae565b610896576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600360248201527f53544600000000000000000000000000000000000000000000000000000000006044820152606401611458565b6040805173ffffffffffffffffffffffffffffffffffffffff8481166024830152604480830185905283518084039091018152606490920183526020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052915160009283929087169161294091906138cb565b6000604051808303816000865af19150503d806000811461297d576040519150601f19603f3d011682016040523d82523d6000602084013e612982565b606091505b50915091508180156129ac5750805115806129ac5750808060200190518101906129ac91906138ae565b6125cc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600260248201527f53540000000000000000000000000000000000000000000000000000000000006044820152606401611458565b6040805160008082526020820190925273ffffffffffffffffffffffffffffffffffffffff8416908390604051612a4991906138cb565b60006040518083038185875af1925050503d8060008114612a86576040519150601f19603f3d011682016040523d82523d6000602084013e612a8b565b606091505b5050905080612452576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600360248201527f53544500000000000000000000000000000000000000000000000000000000006044820152606401611458565b600060208284031215612b0857600080fd5b813567ffffffffffffffff811115612b1f57600080fd5b820160808185031215612b3157600080fd5b9392505050565b600060208284031215612b4a57600080fd5b813567ffffffffffffffff811115612b6157600080fd5b820160a08185031215612b3157600080fd5b73ffffffffffffffffffffffffffffffffffffffff8116811461273557600080fd5b80356105c381612b73565b60008083601f840112612bb257600080fd5b50813567ffffffffffffffff811115612bca57600080fd5b602083019150836020828501011115612be257600080fd5b9250929050565b600080600080600060808688031215612c0157600080fd5b8535612c0c81612b73565b945060208601359350604086013567ffffffffffffffff811115612c2f57600080fd5b612c3b88828901612ba0565b96999598509660600135949350505050565b600080600060408486031215612c6257600080fd5b8335612c6d81612b73565b9250602084013567ffffffffffffffff811115612c8957600080fd5b612c9586828701612ba0565b9497909650939450505050565b60008060008060008060808789031215612cbb57600080fd5b863567ffffffffffffffff80821115612cd357600080fd5b818901915089601f830112612ce757600080fd5b813581811115612cf657600080fd5b8a6020606083028501011115612d0b57600080fd5b60208301985080975050612d2160208a01612b95565b9550604089013594506060890135915080821115612d3e57600080fd5b50612d4b89828a01612ba0565b979a9699509497509295939492505050565b803560ff811681146105c357600080fd5b600080600060608486031215612d8357600080fd5b612d8c84612d5d565b95602085013595506040909401359392505050565b60008060008060008060c08789031215612dba57600080fd5b8635612dc581612b73565b95506020870135945060408701359350612de160608801612d5d565b92506080870135915060a087013590509295509295509295565b60008060008060008060808789031215612e1457600080fd5b8635612e1f81612b73565b955060208701359450604087013567ffffffffffffffff80821115612e4357600080fd5b612e4f8a838b01612ba0565b90965094506060890135915080821115612e6857600080fd5b818901915089601f830112612e7c57600080fd5b813581811115612e8b57600080fd5b8a60208260061b8501011115612ea057600080fd5b6020830194508093505050509295509295509295565b60008060208385031215612ec957600080fd5b823567ffffffffffffffff80821115612ee157600080fd5b818501915085601f830112612ef557600080fd5b813581811115612f0457600080fd5b8660208260051b8501011115612f1957600080fd5b60209290920196919550909350505050565b60005b83811015612f46578181015183820152602001612f2e565b838111156121ee5750506000910152565b60008151808452612f6f816020860160208601612f2b565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015613014577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0888603018452613002858351612f57565b94509285019290850190600101612fc8565b5092979650505050505050565b60006020828403121561303357600080fd5b813567ffffffffffffffff81111561304a57600080fd5b820160608185031215612b3157600080fd5b801515811461273557600080fd5b6000806000806080858703121561308057600080fd5b843561308b81612b73565b93506020850135925060408501356130a281612b73565b915060608501356130b28161305c565b939692955090935050565b600080604083850312156130d057600080fd5b8235915060208301356130e281612b73565b809150509250929050565b6000602082840312156130ff57600080fd5b8135612b3181612b73565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261313f57600080fd5b83018035915067ffffffffffffffff82111561315a57600080fd5b6020019150600581901b3603821315612be257600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc18336030181126131d557600080fd5b9190910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261321457600080fd5b83018035915067ffffffffffffffff82111561322f57600080fd5b602001915036819003821315612be257600080fd5b8183528181602085013750600060208284010152600060207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116840101905092915050565b60208152600061095a602083018486613244565b6000602082840312156132b357600080fd5b5051919050565b73ffffffffffffffffffffffffffffffffffffffff841681526040602082015260006132ea604083018486613244565b95945050505050565b60006020828403121561330557600080fd5b8151612b3181612b73565b60006020828403121561332257600080fd5b8135612b318161305c565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff8111828210171561337f5761337f61332d565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156133cc576133cc61332d565b604052919050565b600060208083850312156133e757600080fd5b825167ffffffffffffffff808211156133ff57600080fd5b818501915085601f83011261341357600080fd5b8151818111156134255761342561332d565b613433848260051b01613385565b818152848101925060069190911b83018401908782111561345357600080fd5b928401925b8184101561349f57604084890312156134715760008081fd5b61347961335c565b845161348481612b73565b81528486015186820152835260409093019291840191613458565b979650505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561350b5761350b6134aa565b5060010190565b8183823760009101908152919050565b60006020828403121561353457600080fd5b815167ffffffffffffffff8082111561354c57600080fd5b818401915084601f83011261356057600080fd5b8151818111156135725761357261332d565b6135a360207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601613385565b91508082528560208285010111156135ba57600080fd5b6135cb816020840160208601612f2b565b50949350505050565b602081526000612b316020830184612f57565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff618336030181126131d557600080fd5b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff818336030181126131d557600080fd5b600181815b808511156136a857817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0482111561368e5761368e6134aa565b8085161561369b57918102915b93841c9390800290613654565b509250929050565b6000826136bf5750600161376b565b816136cc5750600061376b565b81600181146136e257600281146136ec57613708565b600191505061376b565b60ff8411156136fd576136fd6134aa565b50506001821b61376b565b5060208310610133831016604e8410600b841016171561372b575081810a61376b565b613735838361364f565b807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04821115613767576137676134aa565b0290505b92915050565b6000612b3160ff8416836136b0565b60006020828403121561379257600080fd5b813567ffffffffffffffff81168114612b3157600080fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156137e2576137e26134aa565b500290565b60008261381d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261385757600080fd5b83018035915067ffffffffffffffff82111561387257600080fd5b6020019150600781901b3603821315612be257600080fd5b6000806040838503121561389d57600080fd5b505080516020909101519092909150565b6000602082840312156138c057600080fd5b8151612b318161305c565b600082516131d5818460208701612f2b56fea2646970667358221220610e85b9c8ea9fbde73bf314b4e7830fb0c85d6a97c75fb29573f6a05fddd67664736f6c634300080a00330000000000000000000000000319000133d3ada02600f0875d2cf03d442c3367000000000000000000000000351447fc9bd20a917783e159e61e86edda0b01870000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000000319000133d3ada02600f0875d2cf03d442c3367000000000000000000000000351447fc9bd20a917783e159e61e86edda0b01870000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270
-----Decoded View---------------
Arg [0] : _bento (address): 0x0319000133d3ada02600f0875d2cf03d442c3367
Arg [1] : _masterDeployer (address): 0x351447fc9bd20a917783e159e61e86edda0b0187
Arg [2] : _wETH (address): 0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 0000000000000000000000000319000133d3ada02600f0875d2cf03d442c3367
Arg [1] : 000000000000000000000000351447fc9bd20a917783e159e61e86edda0b0187
Arg [2] : 0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270
Age | Block | Fee Address | BC Fee Address | Voting Power | Jailed | Incoming |
---|
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.