Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0xF908625B...41aFdd917 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
LPCreator
Compiler Version
v0.8.26+commit.8a97fa7a
Optimization Enabled:
Yes with 1000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.24; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "../interfaces/IRouter.sol"; import "../interfaces/IPair.sol"; import "../interfaces/IBurnToken.sol"; import "../interfaces/IToken.sol"; import "../interfaces/IManager.sol"; contract LPCreator is ReentrancyGuard { IManager private Manager; IBurnToken private BurnToken; IToken private Token; IPair private Pair; IRouter private router; address private wS; uint256 public totalLPCreated; uint256 private accSRewardPerToken; uint256 private accTokenRewardPerToken; bool public redemptionOpen; struct UserInfos { uint256 lpQty; uint256 tokenDebt; uint256 SDebt; uint256 pendingTokenReward; uint256 pendingSReward; } mapping(address => UserInfos) public userInfos; constructor(address _manager) { Manager = IManager(_manager); router = IRouter(0x1D368773735ee1E678950B7A97bcA2CafB330CDc); wS = router.WETH(); IERC20(wS).approve(address(router), type(uint256).max); } modifier onlyOwner() { require(msg.sender == Manager.owner(), "Not authorized"); _; } function setManager(address _manager) external onlyOwner { Manager = IManager(_manager); } function setRouter(address _router) external onlyOwner { router = IRouter(_router); } function setPair(address _pair) external onlyOwner { Pair = IPair(_pair); } function setRedemptionOpen(bool _redemptionOpen) external onlyOwner { redemptionOpen = _redemptionOpen; } function addSRewards() external payable onlyOwner { accSRewardPerToken += (msg.value * 1e18) / totalLPCreated; } function addTokenRewards(uint256 amount) external onlyOwner { Token.transferFrom(msg.sender, address(this), amount); accTokenRewardPerToken += (amount * 1e18) / totalLPCreated; } function update() external onlyOwner { BurnToken = IBurnToken(_getContract("Burn")); Token = IToken(_getContract("Token")); Token.approve(address(router), type(uint256).max); } function addLp(uint256 wSAmount) external nonReentrant { (uint256 _tokenAmount, uint256 _wSAmount, ) = router.quoteAddLiquidity( address(Token), wS, false, 0, wSAmount ); require( BurnToken.getLpPower(msg.sender) >= _tokenAmount, "Insufficient LP Power" ); Token.transferFrom(msg.sender, address(this), _tokenAmount); IERC20(wS).transferFrom(msg.sender, address(this), _wSAmount); (uint256 realAmount, uint256 realwSAmount, uint256 lpReceived) = router .addLiquidity( address(Token), wS, false, _tokenAmount, _wSAmount, 0, 0, address(this), block.timestamp + 2 ); BurnToken.manageLPPower(msg.sender, realAmount); UserInfos storage _userInfo = userInfos[msg.sender]; (uint256 tokenRewards, uint256 SRewards) = _getPendingRewards( msg.sender ); if (tokenRewards > 0) { _userInfo.pendingTokenReward += tokenRewards; } if (SRewards > 0) { _userInfo.pendingSReward += SRewards; } _userInfo.lpQty += lpReceived; _updateDebt(msg.sender); totalLPCreated += lpReceived; uint256 excessToken = _tokenAmount - realAmount; if (excessToken > 1e9) { Token.transfer(msg.sender, excessToken); } uint256 excessWS = wSAmount - realwSAmount; if (excessWS > 1e9) { (bool tmpSuccess, ) = payable(msg.sender).call{ value: excessWS, gas: 30000 }(""); require(tmpSuccess, "Transfer failed"); } } function claim() external nonReentrant { _claim(msg.sender); } function redemption() external nonReentrant { require(redemptionOpen, "Redemption is closed"); _claim(msg.sender); totalLPCreated -= userInfos[msg.sender].lpQty; userInfos[msg.sender].lpQty = 0; _updateDebt(msg.sender); IERC20(address(Pair)).transfer(msg.sender, userInfos[msg.sender].lpQty); } function _claim(address sender) private { (uint256 tokenRewards, uint256 SRewards) = _getPendingRewards(sender); tokenRewards += userInfos[sender].pendingTokenReward; SRewards += userInfos[sender].pendingSReward; _updateDebt(sender); if (tokenRewards > 0) { userInfos[sender].pendingTokenReward = 0; Token.transfer(sender, tokenRewards); } if (SRewards > 0) { userInfos[sender].pendingSReward = 0; bool tmpSuccess1; (tmpSuccess1, ) = payable(sender).call{ value: SRewards, gas: 500000 }(""); require(tmpSuccess1, "Transfer failed"); } } function _updateDebt(address account) private { UserInfos storage _userInfo = userInfos[account]; _userInfo.tokenDebt = (_userInfo.lpQty * accTokenRewardPerToken) / 1e18; _userInfo.SDebt = (_userInfo.lpQty * accSRewardPerToken) / 1e18; } /** * @dev Get LP value in ETH of an account * @param account Account address */ function getLPValue(address account) external view returns (uint256) { (uint112 reserveETH, , ) = Pair.getReserves(); uint256 pairSupply = Pair.totalSupply(); return (userInfos[account].lpQty * reserveETH) / pairSupply; } function _getPendingRewards( address account ) private view returns (uint256, uint256) { UserInfos memory _userInfo = userInfos[account]; return ( ((_userInfo.lpQty * accTokenRewardPerToken) / 1e18) - _userInfo.tokenDebt, ((_userInfo.lpQty * accSRewardPerToken) / 1e18) - _userInfo.SDebt ); } function getPendingRewards( address account ) public view returns (uint256, uint256) { (uint256 tokenRewards, uint256 SRewards) = _getPendingRewards(account); return ( tokenRewards + userInfos[account].pendingTokenReward, SRewards + userInfos[account].pendingSReward ); } function getTokenRequired( uint256 wsAmount ) external view returns (uint256) { (uint256 _tokenAmount, , ) = router.quoteAddLiquidity( address(Token), wS, false, 0, wsAmount ); return _tokenAmount; } function _getContract(string memory name) internal view returns (address) { return Manager.getContract(name); } function withdrawERC20(address token, uint256 amount) external onlyOwner { IToken(token).transfer(msg.sender, amount); } function withdrawS(uint256 amount) external onlyOwner { bool tmpSuccess1; (tmpSuccess1, ) = payable(msg.sender).call{value: amount, gas: 5000000}( "" ); require(tmpSuccess1, "Transfer failed"); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.20; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @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); /** * @dev Returns the value of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the value of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool); /** * @dev Moves a `value` amount of tokens from `from` to `to` using the * allowance mechanism. `value` 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 value) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v5.0.0) (utils/ReentrancyGuard.sol) pragma solidity ^0.8.20; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant NOT_ENTERED = 1; uint256 private constant ENTERED = 2; uint256 private _status; /** * @dev Unauthorized reentrant call. */ error ReentrancyGuardReentrantCall(); constructor() { _status = NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and making it call a * `private` function that does the actual work. */ modifier nonReentrant() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be NOT_ENTERED if (_status == ENTERED) { revert ReentrancyGuardReentrantCall(); } // Any calls to nonReentrant after this point will fail _status = ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == ENTERED; } }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.20; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IBurnToken is IERC20 { function mint(address account, uint256 amount) external; function manageLPPower(address sender, uint256 amount) external; function getLpPower(address account) external view returns (uint256); }
// SPDX-License-Identifier: UNLICENSED pragma solidity ^0.8.20; interface IManager { function getContract(string memory name) external view returns (address); function owner() external view returns (address); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.26; interface IPair { function totalSupply() external view returns (uint); /// @notice calculate the current reserves of the pool and their last 'seen' timestamp /// @return _reserve0 amount of token0 in reserves /// @return _reserve1 amount of token1 in reserves /// @return _blockTimestampLast the timestamp when the pool was last updated function getReserves() external view returns ( uint112 _reserve0, uint112 _reserve1, uint32 _blockTimestampLast ); }
// SPDX-License-Identifier: GPL-2.0-or-later pragma solidity ^0.8.26; interface IRouter { error EXPIRED(); error IDENTICAL(); error ZERO_ADDRESS(); error INSUFFICIENT_AMOUNT(); error INSUFFICIENT_LIQUIDITY(); error INSUFFICIENT_OUTPUT_AMOUNT(); error INVALID_PATH(); error INSUFFICIENT_B_AMOUNT(); error INSUFFICIENT_A_AMOUNT(); error EXCESSIVE_INPUT_AMOUNT(); error ETH_TRANSFER_FAILED(); error INVALID_RESERVES(); struct route { /// @dev token from address from; /// @dev token to address to; /// @dev is stable route bool stable; } function factory() external pure returns (address); function WETH() external pure returns (address); /// @notice sorts the tokens to see what the expected LP output would be for token0 and token1 (A/B) /// @param tokenA the address of tokenA /// @param tokenB the address of tokenB /// @return token0 address of which becomes token0 /// @return token1 address of which becomes token1 function sortTokens( address tokenA, address tokenB ) external pure returns (address token0, address token1); /// @notice calculates the CREATE2 address for a pair without making any external calls /// @param tokenA the address of tokenA /// @param tokenB the address of tokenB /// @param stable if the pair is using the stable curve /// @return pair address of the pair function pairFor( address tokenA, address tokenB, bool stable ) external view returns (address pair); /// @notice fetches and sorts the reserves for a pair /// @param tokenA the address of tokenA /// @param tokenB the address of tokenB /// @param stable if the pair is using the stable curve /// @return reserveA get the reserves for tokenA /// @return reserveB get the reserves for tokenB function getReserves( address tokenA, address tokenB, bool stable ) external view returns (uint256 reserveA, uint256 reserveB); /// @notice performs chained getAmountOut calculations on any number of pairs /// @param amountIn the amount of tokens of routes[0] to swap /// @param routes the struct of the hops the swap should take /// @return amounts uint array of the amounts out function getAmountsOut( uint256 amountIn, route[] memory routes ) external view returns (uint256[] memory amounts); /// @notice performs chained getAmountOut calculations on any number of pairs /// @param amountIn amount of tokenIn /// @param tokenIn address of the token going in /// @param tokenOut address of the token coming out /// @return amount uint amount out /// @return stable if the curve used is stable or not function getAmountOut( uint256 amountIn, address tokenIn, address tokenOut ) external view returns (uint256 amount, bool stable); /// @notice performs calculations to determine the expected state when adding liquidity /// @param tokenA the address of tokenA /// @param tokenB the address of tokenB /// @param stable if the pair is using the stable curve /// @param amountADesired amount of tokenA desired to be added /// @param amountBDesired amount of tokenB desired to be added /// @return amountA amount of tokenA added /// @return amountB amount of tokenB added /// @return liquidity liquidity value added function quoteAddLiquidity( address tokenA, address tokenB, bool stable, uint256 amountADesired, uint256 amountBDesired ) external view returns (uint256 amountA, uint256 amountB, uint256 liquidity); /// @param tokenA the address of tokenA /// @param tokenB the address of tokenB /// @param stable if the pair is using the stable curve /// @param liquidity liquidity value to remove /// @return amountA amount of tokenA removed /// @return amountB amount of tokenB removed function quoteRemoveLiquidity( address tokenA, address tokenB, bool stable, uint256 liquidity ) external view returns (uint256 amountA, uint256 amountB); /// @param tokenA the address of tokenA /// @param tokenB the address of tokenB /// @param stable if the pair is using the stable curve /// @param amountADesired amount of tokenA desired to be added /// @param amountBDesired amount of tokenB desired to be added /// @param amountAMin slippage for tokenA calculated from this param /// @param amountBMin slippage for tokenB calculated from this param /// @param to the address the liquidity tokens should be minted to /// @param deadline timestamp deadline /// @return amountA amount of tokenA used /// @return amountB amount of tokenB used /// @return liquidity amount of liquidity minted function addLiquidity( address tokenA, address tokenB, bool stable, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns (uint256 amountA, uint256 amountB, uint256 liquidity); /// @param token the address of token /// @param stable if the pair is using the stable curve /// @param amountTokenDesired desired amount for token /// @param amountTokenMin slippage for token /// @param amountETHMin minimum amount of ETH added (slippage) /// @param to the address the liquidity tokens should be minted to /// @param deadline timestamp deadline /// @return amountToken amount of the token used /// @return amountETH amount of ETH used /// @return liquidity amount of liquidity minted function addLiquidityETH( address token, bool stable, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity); /// @param tokenA the address of tokenA /// @param tokenB the address of tokenB /// @param stable if the pair is using the stable curve /// @param amountADesired amount of tokenA desired to be added /// @param amountBDesired amount of tokenB desired to be added /// @param amountAMin slippage for tokenA calculated from this param /// @param amountBMin slippage for tokenB calculated from this param /// @param to the address the liquidity tokens should be minted to /// @param deadline timestamp deadline /// @return amountA amount of tokenA used /// @return amountB amount of tokenB used /// @return liquidity amount of liquidity minted function addLiquidityAndStake( address tokenA, address tokenB, bool stable, uint256 amountADesired, uint256 amountBDesired, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns (uint256 amountA, uint256 amountB, uint256 liquidity); /// @notice adds liquidity to a legacy pair using ETH, and stakes it into a gauge on "to's" behalf /// @param token the address of token /// @param stable if the pair is using the stable curve /// @param amountTokenDesired amount of token to be used /// @param amountTokenMin slippage of token /// @param amountETHMin slippage of ETH /// @param to the address the liquidity tokens should be minted to /// @param deadline timestamp deadline /// @return amountA amount of tokenA used /// @return amountB amount of tokenB used /// @return liquidity amount of liquidity minted function addLiquidityETHAndStake( address token, bool stable, uint256 amountTokenDesired, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external payable returns (uint256 amountA, uint256 amountB, uint256 liquidity); /// @param tokenA the address of tokenA /// @param tokenB the address of tokenB /// @param stable if the pair is using the stable curve /// @param liquidity amount of LP tokens to remove /// @param amountAMin slippage of tokenA /// @param amountBMin slippage of tokenB /// @param to the address the liquidity tokens should be minted to /// @param deadline timestamp deadline /// @return amountA amount of tokenA used /// @return amountB amount of tokenB used function removeLiquidity( address tokenA, address tokenB, bool stable, uint256 liquidity, uint256 amountAMin, uint256 amountBMin, address to, uint256 deadline ) external returns (uint256 amountA, uint256 amountB); /// @param token address of the token /// @param stable if the pair is using the stable curve /// @param liquidity liquidity tokens to remove /// @param amountTokenMin slippage of token /// @param amountETHMin slippage of ETH /// @param to the address the liquidity tokens should be minted to /// @param deadline timestamp deadline /// @return amountToken amount of token used /// @return amountETH amount of ETH used function removeLiquidityETH( address token, bool stable, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external returns (uint256 amountToken, uint256 amountETH); /// @param amountIn amount to send ideally /// @param amountOutMin slippage of amount out /// @param routes the hops the swap should take /// @param to the address the liquidity tokens should be minted to /// @param deadline timestamp deadline /// @return amounts amounts returned function swapExactTokensForTokens( uint256 amountIn, uint256 amountOutMin, route[] calldata routes, address to, uint256 deadline ) external returns (uint256[] memory amounts); /// @param routes the hops the swap should take /// @param to the address the liquidity tokens should be minted to /// @param deadline timestamp deadline /// @return amounts amounts returned function swapTokensForExactTokens( uint amountOut, uint amountInMax, route[] memory routes, address to, uint deadline ) external returns (uint256[] memory amounts); /// @param amountOutMin slippage of token /// @param routes the hops the swap should take /// @param to the address the liquidity tokens should be minted to /// @param deadline timestamp deadline /// @return amounts amounts returned function swapExactETHForTokens( uint256 amountOutMin, route[] calldata routes, address to, uint256 deadline ) external payable returns (uint256[] memory amounts); /// @param amountOut amount of tokens to get out /// @param amountInMax max amount of tokens to put in to achieve amountOut (slippage) /// @param routes the hops the swap should take /// @param to the address the liquidity tokens should be minted to /// @param deadline timestamp deadline /// @return amounts amounts returned function swapTokensForExactETH( uint amountOut, uint amountInMax, route[] calldata routes, address to, uint deadline ) external returns (uint256[] memory amounts); /// @param amountIn amount of tokens to swap /// @param amountOutMin slippage of token /// @param routes the hops the swap should take /// @param to the address the liquidity tokens should be minted to /// @param deadline timestamp deadline /// @return amounts amounts returned function swapExactTokensForETH( uint256 amountIn, uint256 amountOutMin, route[] calldata routes, address to, uint256 deadline ) external returns (uint256[] memory amounts); /// @param amountOut exact amount out or revert /// @param routes the hops the swap should take /// @param to the address the liquidity tokens should be minted to /// @param deadline timestamp deadline /// @return amounts amounts returned function swapETHForExactTokens( uint amountOut, route[] calldata routes, address to, uint deadline ) external payable returns (uint256[] memory amounts); /// @param amountIn token amount to swap /// @param amountOutMin slippage of token /// @param routes the hops the swap should take /// @param to the address the liquidity tokens should be minted to /// @param deadline timestamp deadline function swapExactTokensForTokensSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, route[] calldata routes, address to, uint256 deadline ) external; /// @param amountOutMin slippage of token /// @param routes the hops the swap should take /// @param to the address the liquidity tokens should be minted to /// @param deadline timestamp deadline function swapExactETHForTokensSupportingFeeOnTransferTokens( uint256 amountOutMin, route[] calldata routes, address to, uint256 deadline ) external payable; /// @param amountIn token amount to swap /// @param amountOutMin slippage of token /// @param routes the hops the swap should take /// @param to the address the liquidity tokens should be minted to /// @param deadline timestamp deadline function swapExactTokensForETHSupportingFeeOnTransferTokens( uint256 amountIn, uint256 amountOutMin, route[] calldata routes, address to, uint256 deadline ) external; /// @notice **** REMOVE LIQUIDITY (supporting fee-on-transfer tokens)**** /// @param token address of the token /// @param stable if the swap curve is stable /// @param liquidity liquidity value (lp tokens) /// @param amountTokenMin slippage of token /// @param amountETHMin slippage of ETH /// @param to address to send to /// @param deadline timestamp deadline /// @return amountToken amount of token received /// @return amountETH amount of ETH received function removeLiquidityETHSupportingFeeOnTransferTokens( address token, bool stable, uint256 liquidity, uint256 amountTokenMin, uint256 amountETHMin, address to, uint256 deadline ) external returns (uint256 amountToken, uint256 amountETH); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IToken is IERC20 { function mint(address to, uint256 value) external; function burnFrom(address account, uint256 value) external; }
{ "optimizer": { "enabled": true, "runs": 1000 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"_manager","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ReentrancyGuardReentrantCall","type":"error"},{"inputs":[{"internalType":"uint256","name":"wSAmount","type":"uint256"}],"name":"addLp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"addSRewards","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"addTokenRewards","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getLPValue","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"getPendingRewards","outputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"wsAmount","type":"uint256"}],"name":"getTokenRequired","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"redemption","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"redemptionOpen","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_manager","type":"address"}],"name":"setManager","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_pair","type":"address"}],"name":"setPair","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_redemptionOpen","type":"bool"}],"name":"setRedemptionOpen","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_router","type":"address"}],"name":"setRouter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"totalLPCreated","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"update","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfos","outputs":[{"internalType":"uint256","name":"lpQty","type":"uint256"},{"internalType":"uint256","name":"tokenDebt","type":"uint256"},{"internalType":"uint256","name":"SDebt","type":"uint256"},{"internalType":"uint256","name":"pendingTokenReward","type":"uint256"},{"internalType":"uint256","name":"pendingSReward","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawS","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Deployed Bytecode
0x6080604052600436106101295760003560e01c8063800b4344116100a5578063a2e6204511610074578063d0ebdbe711610059578063d0ebdbe71461033c578063d6a2a4bc1461035c578063f6ed20171461037c57600080fd5b8063a2e6204514610307578063c0d786551461031c57600080fd5b8063800b43441461027d5780638187f516146102a7578063a1db9782146102c7578063a27344b5146102e757600080fd5b806343b0215f116100fc5780635467e0a7116100e15780635467e0a71461024a57806379d127551461025f5780637b9c70fa1461027557600080fd5b806343b0215f146101c35780634e71d92d1461023557600080fd5b80631a2315b81461012e5780631cde7d531461015057806325266e9b146101835780632a977a40146101a3575b600080fd5b34801561013a57600080fd5b5061014e610149366004611ba2565b6103b1565b005b34801561015c57600080fd5b5061017061016b366004611ba2565b610514565b6040519081526020015b60405180910390f35b34801561018f57600080fd5b5061014e61019e366004611ba2565b6105b2565b3480156101af57600080fd5b5061014e6101be366004611ba2565b610b89565b3480156101cf57600080fd5b5061020d6101de366004611bd0565b600b60205260009081526040902080546001820154600283015460038401546004909401549293919290919085565b604080519586526020860194909452928401919091526060830152608082015260a00161017a565b34801561024157600080fd5b5061014e610d05565b34801561025657600080fd5b5061014e610d22565b34801561026b57600080fd5b5061017060075481565b61014e610e55565b34801561028957600080fd5b50600a546102979060ff1681565b604051901515815260200161017a565b3480156102b357600080fd5b5061014e6102c2366004611bd0565b610f54565b3480156102d357600080fd5b5061014e6102e2366004611bf4565b61103e565b3480156102f357600080fd5b50610170610302366004611bd0565b61117c565b34801561031357600080fd5b5061014e6112ca565b34801561032857600080fd5b5061014e610337366004611bd0565b6114d1565b34801561034857600080fd5b5061014e610357366004611bd0565b6115bb565b34801561036857600080fd5b5061014e610377366004611c2e565b6116a5565b34801561038857600080fd5b5061039c610397366004611bd0565b611780565b6040805192835260208301919091520161017a565b600160009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610404573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104289190611c4b565b6001600160a01b0316336001600160a01b03161461047e5760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b60448201526064015b60405180910390fd5b6040516000903390624c4b4090849084818181858888f193505050503d80600081146104c6576040519150601f19603f3d011682016040523d82523d6000602084013e6104cb565b606091505b505080915050806105105760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606401610475565b5050565b6005546003546006546040516326283ecf60e21b81526001600160a01b0392831660048201529082166024820152600060448201819052606482018190526084820185905292839216906398a0fb3c9060a401606060405180830381865afa158015610584573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105a89190611c68565b5090949350505050565b6105ba6117eb565b6005546003546006546040516326283ecf60e21b81526001600160a01b0392831660048201529082166024820152600060448201819052606482018190526084820185905292839216906398a0fb3c9060a401606060405180830381865afa15801561062a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061064e9190611c68565b506002546040517feb5a6d3a00000000000000000000000000000000000000000000000000000000815233600482015292945090925083916001600160a01b039091169063eb5a6d3a90602401602060405180830381865afa1580156106b8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106dc9190611c96565b101561072a5760405162461bcd60e51b815260206004820152601560248201527f496e73756666696369656e74204c5020506f77657200000000000000000000006044820152606401610475565b6003546040516323b872dd60e01b8152336004820152306024820152604481018490526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015610781573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107a59190611caf565b506006546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303816000875af11580156107fd573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108219190611caf565b50600554600354600654600092839283926001600160a01b0392831692635a47ddc39281169116848989828030610859426002611ce2565b60405160e08b901b7fffffffff000000000000000000000000000000000000000000000000000000001681526001600160a01b03998a166004820152978916602489015295151560448801526064870194909452608486019290925260a485015260c484015290921660e4820152610104810191909152610124016060604051808303816000875af11580156108f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109179190611c68565b6002546040517f59905fa80000000000000000000000000000000000000000000000000000000081523360048201526024810185905293965091945092506001600160a01b0316906359905fa890604401600060405180830381600087803b15801561098257600080fd5b505af1158015610996573d6000803e3d6000fd5b5050336000818152600b602052604081209350915081906109b69061182e565b909250905081156109db57818360030160008282546109d59190611ce2565b90915550505b80156109fb57808360040160008282546109f59190611ce2565b90915550505b83836000016000828254610a0f9190611ce2565b90915550610a1e9050336118eb565b8360076000828254610a309190611ce2565b9091555060009050610a42878a611cf5565b9050633b9aca00811115610ac75760035460405163a9059cbb60e01b8152336004820152602481018390526001600160a01b039091169063a9059cbb906044016020604051808303816000875af1158015610aa1573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ac59190611caf565b505b6000610ad3878c611cf5565b9050633b9aca00811115610b7257604051600090339061753090849084818181858888f193505050503d8060008114610b28576040519150601f19603f3d011682016040523d82523d6000602084013e610b2d565b606091505b5050905080610b705760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606401610475565b505b50505050505050505050610b866001600055565b50565b600160009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610bdc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c009190611c4b565b6001600160a01b0316336001600160a01b031614610c515760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b6044820152606401610475565b6003546040516323b872dd60e01b8152336004820152306024820152604481018390526001600160a01b03909116906323b872dd906064016020604051808303816000875af1158015610ca8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ccc9190611caf565b50600754610ce282670de0b6b3a7640000611d08565b610cec9190611d1f565b60096000828254610cfd9190611ce2565b909155505050565b610d0d6117eb565b610d1633611955565b610d206001600055565b565b610d2a6117eb565b600a5460ff16610d7c5760405162461bcd60e51b815260206004820152601460248201527f526564656d7074696f6e20697320636c6f7365640000000000000000000000006044820152606401610475565b610d8533611955565b336000908152600b60205260408120546007805491929091610da8908490611cf5565b9091555050336000818152600b6020526040812055610dc6906118eb565b60048054336000818152600b60205260409081902054905163a9059cbb60e01b81529384019190915260248301526001600160a01b03169063a9059cbb906044016020604051808303816000875af1158015610e26573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e4a9190611caf565b50610d206001600055565b600160009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ea8573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ecc9190611c4b565b6001600160a01b0316336001600160a01b031614610f1d5760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b6044820152606401610475565b600754610f3234670de0b6b3a7640000611d08565b610f3c9190611d1f565b60086000828254610f4d9190611ce2565b9091555050565b600160009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610fa7573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fcb9190611c4b565b6001600160a01b0316336001600160a01b03161461101c5760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b6044820152606401610475565b600480546001600160a01b0319166001600160a01b0392909216919091179055565b600160009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611091573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110b59190611c4b565b6001600160a01b0316336001600160a01b0316146111065760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b6044820152606401610475565b60405163a9059cbb60e01b8152336004820152602481018290526001600160a01b0383169063a9059cbb906044016020604051808303816000875af1158015611153573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111779190611caf565b505050565b60048054604080517f0902f1ac000000000000000000000000000000000000000000000000000000008152905160009384936001600160a01b031692630902f1ac92818301926060928290030181865afa1580156111de573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112029190611d64565b505090506000600460009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561125b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061127f9190611c96565b6001600160a01b0385166000908152600b602052604090205490915081906112b8906dffffffffffffffffffffffffffff851690611d08565b6112c29190611d1f565b949350505050565b600160009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561131d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113419190611c4b565b6001600160a01b0316336001600160a01b0316146113925760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b6044820152606401610475565b6113d06040518060400160405280600481526020017f4275726e00000000000000000000000000000000000000000000000000000000815250611b11565b600280546001600160a01b0319166001600160a01b039290921691909117905560408051808201909152600581527f546f6b656e000000000000000000000000000000000000000000000000000000602082015261142d90611b11565b600380546001600160a01b0319166001600160a01b039283169081179091556005546040517f095ea7b30000000000000000000000000000000000000000000000000000000081529216600483015260001960248301529063095ea7b3906044016020604051808303816000875af11580156114ad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b869190611caf565b600160009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611524573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115489190611c4b565b6001600160a01b0316336001600160a01b0316146115995760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b6044820152606401610475565b600580546001600160a01b0319166001600160a01b0392909216919091179055565b600160009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801561160e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116329190611c4b565b6001600160a01b0316336001600160a01b0316146116835760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b6044820152606401610475565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600160009054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156116f8573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061171c9190611c4b565b6001600160a01b0316336001600160a01b03161461176d5760405162461bcd60e51b815260206004820152600e60248201526d139bdd08185d5d1a1bdc9a5e995960921b6044820152606401610475565b600a805460ff1916911515919091179055565b60008060008061178f8561182e565b6001600160a01b0387166000908152600b602052604090206003015491935091506117ba9083611ce2565b6001600160a01b0386166000908152600b60205260409020600401546117e09083611ce2565b935093505050915091565b600260005403611827576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600055565b6001600160a01b0381166000908152600b60209081526040808320815160a0810183528154808252600183015494820185905260028301549382019390935260038201546060820152600490910154608082015260095484939192670de0b6b3a76400009161189c91611d08565b6118a69190611d1f565b6118b09190611cf5565b60408201516008548351670de0b6b3a7640000916118cd91611d08565b6118d79190611d1f565b6118e19190611cf5565b9250925050915091565b6001600160a01b0381166000908152600b602052604090206009548154670de0b6b3a76400009161191b91611d08565b6119259190611d1f565b60018201556008548154670de0b6b3a76400009161194291611d08565b61194c9190611d1f565b60029091015550565b6000806119618361182e565b6001600160a01b0385166000908152600b6020526040902060030154919350915061198c9083611ce2565b6001600160a01b0384166000908152600b60205260409020600401549092506119b59082611ce2565b90506119c0836118eb565b8115611a58576001600160a01b038381166000818152600b60205260408082206003908101929092559054905163a9059cbb60e01b81526004810192909252602482018590529091169063a9059cbb906044016020604051808303816000875af1158015611a32573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a569190611caf565b505b8015611177576001600160a01b0383166000818152600b6020526040808220600401829055519091906207a12090849084818181858888f193505050503d8060008114611ac1576040519150601f19603f3d011682016040523d82523d6000602084013e611ac6565b606091505b50508091505080611b0b5760405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606401610475565b50505050565b6001546040517f358177730000000000000000000000000000000000000000000000000000000081526000916001600160a01b031690633581777390611b5b908590600401611db4565b602060405180830381865afa158015611b78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b9c9190611c4b565b92915050565b600060208284031215611bb457600080fd5b5035919050565b6001600160a01b0381168114610b8657600080fd5b600060208284031215611be257600080fd5b8135611bed81611bbb565b9392505050565b60008060408385031215611c0757600080fd5b8235611c1281611bbb565b946020939093013593505050565b8015158114610b8657600080fd5b600060208284031215611c4057600080fd5b8135611bed81611c20565b600060208284031215611c5d57600080fd5b8151611bed81611bbb565b600080600060608486031215611c7d57600080fd5b5050815160208301516040909301519094929350919050565b600060208284031215611ca857600080fd5b5051919050565b600060208284031215611cc157600080fd5b8151611bed81611c20565b634e487b7160e01b600052601160045260246000fd5b80820180821115611b9c57611b9c611ccc565b81810381811115611b9c57611b9c611ccc565b8082028115828204841417611b9c57611b9c611ccc565b600082611d3c57634e487b7160e01b600052601260045260246000fd5b500490565b80516dffffffffffffffffffffffffffff81168114611d5f57600080fd5b919050565b600080600060608486031215611d7957600080fd5b611d8284611d41565b9250611d9060208501611d41565b9150604084015163ffffffff81168114611da957600080fd5b809150509250925092565b602081526000825180602084015260005b81811015611de25760208186018101516040868401015201611dc5565b506000604082850101526040601f19601f8301168401019150509291505056fea264697066735822122060fc4b3bff3c6d26cdbf4f53f25eb2587af463acb82b802c5fa16bb0c99ee3f864736f6c634300081a0033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 35 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.