ERC-20
Overview
Max Total Supply
924.291617441231032116 apxBTRFLY
Holders
79
Market
Onchain Market Cap
$0.00
Circulating Supply Market Cap
-
Other Info
Token Contract (WITH 18 Decimals)
Balance
15.321234933981086572 apxBTRFLYValue
$0.00Loading...
Loading
Loading...
Loading
Loading...
Loading
# | Exchange | Pair | Price | 24H Volume | % Volume |
---|
Contract Name:
UnionPirexVault
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {Ownable} from "openzeppelin-contracts/contracts/access/Ownable.sol"; import {ERC4626} from "solmate/mixins/ERC4626.sol"; import {ERC20} from "solmate/tokens/ERC20.sol"; import {FixedPointMathLib} from "solmate/utils/FixedPointMathLib.sol"; import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol"; import {UnionPirexStaking} from "src/vault/UnionPirexStaking.sol"; contract UnionPirexVault is Ownable, ERC4626 { using SafeTransferLib for ERC20; using FixedPointMathLib for uint256; UnionPirexStaking public strategy; uint256 public constant MAX_WITHDRAWAL_PENALTY = 500; uint256 public constant MAX_PLATFORM_FEE = 2000; uint256 public constant FEE_DENOMINATOR = 10000; uint256 public withdrawalPenalty = 300; uint256 public platformFee = 1000; address public platform; event Harvest(address indexed caller, uint256 value); event WithdrawalPenaltyUpdated(uint256 penalty); event PlatformFeeUpdated(uint256 fee); event PlatformUpdated(address _platform); event StrategySet(address _strategy); error ZeroAddress(); error ExceedsMax(); error AlreadySet(); constructor(address pxBtrfly) ERC4626(ERC20(pxBtrfly), "Autocompounding pxBTRFLY", "apxBTRFLY") {} /** @notice Set the withdrawal penalty @param penalty uint256 Withdrawal penalty */ function setWithdrawalPenalty(uint256 penalty) external onlyOwner { if (penalty > MAX_WITHDRAWAL_PENALTY) revert ExceedsMax(); withdrawalPenalty = penalty; emit WithdrawalPenaltyUpdated(penalty); } /** @notice Set the platform fee @param fee uint256 Platform fee */ function setPlatformFee(uint256 fee) external onlyOwner { if (fee > MAX_PLATFORM_FEE) revert ExceedsMax(); platformFee = fee; emit PlatformFeeUpdated(fee); } /** @notice Set the platform @param _platform address Platform */ function setPlatform(address _platform) external onlyOwner { if (_platform == address(0)) revert ZeroAddress(); platform = _platform; emit PlatformUpdated(_platform); } /** @notice Set the strategy @param _strategy address Strategy */ function setStrategy(address _strategy) external onlyOwner { if (_strategy == address(0)) revert ZeroAddress(); if (address(strategy) != address(0)) revert AlreadySet(); // Set new strategy contract and approve max allowance strategy = UnionPirexStaking(_strategy); asset.safeApprove(_strategy, type(uint256).max); emit StrategySet(_strategy); } /** @notice Get the pxBTRFLY custodied by the UnionPirex contracts @return uint256 Assets */ function totalAssets() public view override returns (uint256) { // Vault assets + rewards should always be stored in strategy until withdrawal-time (uint256 _totalSupply, uint256 rewards) = strategy .totalSupplyWithRewards(); // Deduct the exact reward amount staked (after fees are deducted when calling `harvest`) return _totalSupply + ( rewards == 0 ? 0 : (rewards - ((rewards * platformFee) / FEE_DENOMINATOR)) ); } /** @notice Withdraw assets from the staking contract to prepare for transfer to user @param assets uint256 Assets */ function beforeWithdraw(uint256 assets, uint256) internal override { // Harvest rewards in the event where there is not enough staked assets to cover the withdrawal if (assets > strategy.totalSupply()) harvest(); strategy.withdraw(assets); } /** @notice Stake assets so that rewards can be properly distributed @param assets uint256 Assets */ function afterDeposit(uint256 assets, uint256) internal override { strategy.stake(assets); } /** @notice Preview the amount of assets a user would receive from redeeming shares @param shares uint256 Shares @return uint256 Assets */ function previewRedeem(uint256 shares) public view override returns (uint256) { // Calculate assets based on a user's % ownership of vault shares uint256 assets = convertToAssets(shares); uint256 _totalSupply = totalSupply; // Calculate a penalty - zero if user is the last to withdraw uint256 penalty = (_totalSupply == 0 || _totalSupply - shares == 0) ? 0 : assets.mulDivDown(withdrawalPenalty, FEE_DENOMINATOR); // Redeemable amount is the post-penalty amount return assets - penalty; } /** @notice Preview the amount of shares a user would need to redeem the specified asset amount @notice This modified version takes into consideration the withdrawal fee @param assets uint256 Assets @return uint256 Shares */ function previewWithdraw(uint256 assets) public view override returns (uint256) { // Calculate shares based on the specified assets' proportion of the pool uint256 shares = convertToShares(assets); // Save 1 SLOAD uint256 _totalSupply = totalSupply; // Factor in additional shares to fulfill withdrawal if user is not the last to withdraw return (_totalSupply == 0 || _totalSupply - shares == 0) ? shares : (shares * FEE_DENOMINATOR) / (FEE_DENOMINATOR - withdrawalPenalty); } /** @notice Harvest rewards */ function harvest() public { // Claim rewards strategy.getReward(); // Since we don't normally store pxBTRFLY within the vault, a non-zero balance equals rewards uint256 rewards = asset.balanceOf(address(this)); emit Harvest(msg.sender, rewards); if (rewards != 0) { // Fee for platform uint256 feeAmount = (rewards * platformFee) / FEE_DENOMINATOR; // Deduct fee from reward balance rewards -= feeAmount; // Claimed rewards should be in pxBTRFLY asset.safeTransfer(platform, feeAmount); // Stake rewards sans fee strategy.stake(rewards); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { _checkOwner(); _; } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if the sender is not the owner. */ function _checkOwner() internal view virtual { require(owner() == _msgSender(), "Ownable: caller is not the owner"); } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; import {ERC20} from "../tokens/ERC20.sol"; import {SafeTransferLib} from "../utils/SafeTransferLib.sol"; import {FixedPointMathLib} from "../utils/FixedPointMathLib.sol"; /// @notice Minimal ERC4626 tokenized Vault implementation. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/mixins/ERC4626.sol) abstract contract ERC4626 is ERC20 { using SafeTransferLib for ERC20; using FixedPointMathLib for uint256; /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event Deposit(address indexed caller, address indexed owner, uint256 assets, uint256 shares); event Withdraw( address indexed caller, address indexed receiver, address indexed owner, uint256 assets, uint256 shares ); /*////////////////////////////////////////////////////////////// IMMUTABLES //////////////////////////////////////////////////////////////*/ ERC20 public immutable asset; constructor( ERC20 _asset, string memory _name, string memory _symbol ) ERC20(_name, _symbol, _asset.decimals()) { asset = _asset; } /*////////////////////////////////////////////////////////////// DEPOSIT/WITHDRAWAL LOGIC //////////////////////////////////////////////////////////////*/ function deposit(uint256 assets, address receiver) public virtual returns (uint256 shares) { // Check for rounding error since we round down in previewDeposit. require((shares = previewDeposit(assets)) != 0, "ZERO_SHARES"); // Need to transfer before minting or ERC777s could reenter. asset.safeTransferFrom(msg.sender, address(this), assets); _mint(receiver, shares); emit Deposit(msg.sender, receiver, assets, shares); afterDeposit(assets, shares); } function mint(uint256 shares, address receiver) public virtual returns (uint256 assets) { assets = previewMint(shares); // No need to check for rounding error, previewMint rounds up. // Need to transfer before minting or ERC777s could reenter. asset.safeTransferFrom(msg.sender, address(this), assets); _mint(receiver, shares); emit Deposit(msg.sender, receiver, assets, shares); afterDeposit(assets, shares); } function withdraw( uint256 assets, address receiver, address owner ) public virtual returns (uint256 shares) { shares = previewWithdraw(assets); // No need to check for rounding error, previewWithdraw rounds up. if (msg.sender != owner) { uint256 allowed = allowance[owner][msg.sender]; // Saves gas for limited approvals. if (allowed != type(uint256).max) allowance[owner][msg.sender] = allowed - shares; } beforeWithdraw(assets, shares); _burn(owner, shares); emit Withdraw(msg.sender, receiver, owner, assets, shares); asset.safeTransfer(receiver, assets); } function redeem( uint256 shares, address receiver, address owner ) public virtual returns (uint256 assets) { if (msg.sender != owner) { uint256 allowed = allowance[owner][msg.sender]; // Saves gas for limited approvals. if (allowed != type(uint256).max) allowance[owner][msg.sender] = allowed - shares; } // Check for rounding error since we round down in previewRedeem. require((assets = previewRedeem(shares)) != 0, "ZERO_ASSETS"); beforeWithdraw(assets, shares); _burn(owner, shares); emit Withdraw(msg.sender, receiver, owner, assets, shares); asset.safeTransfer(receiver, assets); } /*////////////////////////////////////////////////////////////// ACCOUNTING LOGIC //////////////////////////////////////////////////////////////*/ function totalAssets() public view virtual returns (uint256); function convertToShares(uint256 assets) public view virtual returns (uint256) { uint256 supply = totalSupply; // Saves an extra SLOAD if totalSupply is non-zero. return supply == 0 ? assets : assets.mulDivDown(supply, totalAssets()); } function convertToAssets(uint256 shares) public view virtual returns (uint256) { uint256 supply = totalSupply; // Saves an extra SLOAD if totalSupply is non-zero. return supply == 0 ? shares : shares.mulDivDown(totalAssets(), supply); } function previewDeposit(uint256 assets) public view virtual returns (uint256) { return convertToShares(assets); } function previewMint(uint256 shares) public view virtual returns (uint256) { uint256 supply = totalSupply; // Saves an extra SLOAD if totalSupply is non-zero. return supply == 0 ? shares : shares.mulDivUp(totalAssets(), supply); } function previewWithdraw(uint256 assets) public view virtual returns (uint256) { uint256 supply = totalSupply; // Saves an extra SLOAD if totalSupply is non-zero. return supply == 0 ? assets : assets.mulDivUp(supply, totalAssets()); } function previewRedeem(uint256 shares) public view virtual returns (uint256) { return convertToAssets(shares); } /*////////////////////////////////////////////////////////////// DEPOSIT/WITHDRAWAL LIMIT LOGIC //////////////////////////////////////////////////////////////*/ function maxDeposit(address) public view virtual returns (uint256) { return type(uint256).max; } function maxMint(address) public view virtual returns (uint256) { return type(uint256).max; } function maxWithdraw(address owner) public view virtual returns (uint256) { return convertToAssets(balanceOf[owner]); } function maxRedeem(address owner) public view virtual returns (uint256) { return balanceOf[owner]; } /*////////////////////////////////////////////////////////////// INTERNAL HOOKS LOGIC //////////////////////////////////////////////////////////////*/ function beforeWithdraw(uint256 assets, uint256 shares) internal virtual {} function afterDeposit(uint256 assets, uint256 shares) internal virtual {} }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Modern and gas efficient ERC20 + EIP-2612 implementation. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol) /// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol) /// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it. abstract contract ERC20 { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event Transfer(address indexed from, address indexed to, uint256 amount); event Approval(address indexed owner, address indexed spender, uint256 amount); /*////////////////////////////////////////////////////////////// METADATA STORAGE //////////////////////////////////////////////////////////////*/ string public name; string public symbol; uint8 public immutable decimals; /*////////////////////////////////////////////////////////////// ERC20 STORAGE //////////////////////////////////////////////////////////////*/ uint256 public totalSupply; mapping(address => uint256) public balanceOf; mapping(address => mapping(address => uint256)) public allowance; /*////////////////////////////////////////////////////////////// EIP-2612 STORAGE //////////////////////////////////////////////////////////////*/ uint256 internal immutable INITIAL_CHAIN_ID; bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR; mapping(address => uint256) public nonces; /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ constructor( string memory _name, string memory _symbol, uint8 _decimals ) { name = _name; symbol = _symbol; decimals = _decimals; INITIAL_CHAIN_ID = block.chainid; INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator(); } /*////////////////////////////////////////////////////////////// ERC20 LOGIC //////////////////////////////////////////////////////////////*/ function approve(address spender, uint256 amount) public virtual returns (bool) { allowance[msg.sender][spender] = amount; emit Approval(msg.sender, spender, amount); return true; } function transfer(address to, uint256 amount) public virtual returns (bool) { balanceOf[msg.sender] -= amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(msg.sender, to, amount); return true; } function transferFrom( address from, address to, uint256 amount ) public virtual returns (bool) { uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals. if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount; balanceOf[from] -= amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(from, to, amount); return true; } /*////////////////////////////////////////////////////////////// EIP-2612 LOGIC //////////////////////////////////////////////////////////////*/ function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public virtual { require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED"); // Unchecked because the only math done is incrementing // the owner's nonce which cannot realistically overflow. unchecked { address recoveredAddress = ecrecover( keccak256( abi.encodePacked( "\x19\x01", DOMAIN_SEPARATOR(), keccak256( abi.encode( keccak256( "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)" ), owner, spender, value, nonces[owner]++, deadline ) ) ) ), v, r, s ); require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER"); allowance[recoveredAddress][spender] = value; } emit Approval(owner, spender, value); } function DOMAIN_SEPARATOR() public view virtual returns (bytes32) { return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator(); } function computeDomainSeparator() internal view virtual returns (bytes32) { return keccak256( abi.encode( keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"), keccak256(bytes(name)), keccak256("1"), block.chainid, address(this) ) ); } /*////////////////////////////////////////////////////////////// INTERNAL MINT/BURN LOGIC //////////////////////////////////////////////////////////////*/ function _mint(address to, uint256 amount) internal virtual { totalSupply += amount; // Cannot overflow because the sum of all user // balances can't exceed the max uint256 value. unchecked { balanceOf[to] += amount; } emit Transfer(address(0), to, amount); } function _burn(address from, uint256 amount) internal virtual { balanceOf[from] -= amount; // Cannot underflow because a user's balance // will never be larger than the total supply. unchecked { totalSupply -= amount; } emit Transfer(from, address(0), amount); } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; /// @notice Arithmetic library with operations for fixed-point numbers. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/FixedPointMathLib.sol) /// @author Inspired by USM (https://github.com/usmfum/USM/blob/master/contracts/WadMath.sol) library FixedPointMathLib { /*////////////////////////////////////////////////////////////// SIMPLIFIED FIXED POINT OPERATIONS //////////////////////////////////////////////////////////////*/ uint256 internal constant MAX_UINT256 = 2**256 - 1; uint256 internal constant WAD = 1e18; // The scalar of ETH and most ERC20s. function mulWadDown(uint256 x, uint256 y) internal pure returns (uint256) { return mulDivDown(x, y, WAD); // Equivalent to (x * y) / WAD rounded down. } function mulWadUp(uint256 x, uint256 y) internal pure returns (uint256) { return mulDivUp(x, y, WAD); // Equivalent to (x * y) / WAD rounded up. } function divWadDown(uint256 x, uint256 y) internal pure returns (uint256) { return mulDivDown(x, WAD, y); // Equivalent to (x * WAD) / y rounded down. } function divWadUp(uint256 x, uint256 y) internal pure returns (uint256) { return mulDivUp(x, WAD, y); // Equivalent to (x * WAD) / y rounded up. } /*////////////////////////////////////////////////////////////// LOW LEVEL FIXED POINT OPERATIONS //////////////////////////////////////////////////////////////*/ function mulDivDown( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 z) { assembly { // Equivalent to require(denominator != 0 && (y == 0 || x <= type(uint256).max / y)) if iszero(mul(denominator, iszero(mul(y, gt(x, div(MAX_UINT256, y)))))) { revert(0, 0) } // Divide x * y by the denominator. z := div(mul(x, y), denominator) } } function mulDivUp( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 z) { assembly { // Equivalent to require(denominator != 0 && (y == 0 || x <= type(uint256).max / y)) if iszero(mul(denominator, iszero(mul(y, gt(x, div(MAX_UINT256, y)))))) { revert(0, 0) } // If x * y modulo the denominator is strictly greater than 0, // 1 is added to round up the division of x * y by the denominator. z := add(gt(mod(mul(x, y), denominator), 0), div(mul(x, y), denominator)) } } function rpow( uint256 x, uint256 n, uint256 scalar ) internal pure returns (uint256 z) { assembly { switch x case 0 { switch n case 0 { // 0 ** 0 = 1 z := scalar } default { // 0 ** n = 0 z := 0 } } default { switch mod(n, 2) case 0 { // If n is even, store scalar in z for now. z := scalar } default { // If n is odd, store x in z for now. z := x } // Shifting right by 1 is like dividing by 2. let half := shr(1, scalar) for { // Shift n right by 1 before looping to halve it. n := shr(1, n) } n { // Shift n right by 1 each iteration to halve it. n := shr(1, n) } { // Revert immediately if x ** 2 would overflow. // Equivalent to iszero(eq(div(xx, x), x)) here. if shr(128, x) { revert(0, 0) } // Store x squared. let xx := mul(x, x) // Round to the nearest number. let xxRound := add(xx, half) // Revert if xx + half overflowed. if lt(xxRound, xx) { revert(0, 0) } // Set x to scaled xxRound. x := div(xxRound, scalar) // If n is even: if mod(n, 2) { // Compute z * x. let zx := mul(z, x) // If z * x overflowed: if iszero(eq(div(zx, x), z)) { // Revert if x is non-zero. if iszero(iszero(x)) { revert(0, 0) } } // Round to the nearest number. let zxRound := add(zx, half) // Revert if zx + half overflowed. if lt(zxRound, zx) { revert(0, 0) } // Return properly scaled zxRound. z := div(zxRound, scalar) } } } } } /*////////////////////////////////////////////////////////////// GENERAL NUMBER UTILITIES //////////////////////////////////////////////////////////////*/ function sqrt(uint256 x) internal pure returns (uint256 z) { assembly { let y := x // We start y at x, which will help us make our initial estimate. z := 181 // The "correct" value is 1, but this saves a multiplication later. // This segment is to get a reasonable initial estimate for the Babylonian method. With a bad // start, the correct # of bits increases ~linearly each iteration instead of ~quadratically. // We check y >= 2^(k + 8) but shift right by k bits // each branch to ensure that if x >= 256, then y >= 256. if iszero(lt(y, 0x10000000000000000000000000000000000)) { y := shr(128, y) z := shl(64, z) } if iszero(lt(y, 0x1000000000000000000)) { y := shr(64, y) z := shl(32, z) } if iszero(lt(y, 0x10000000000)) { y := shr(32, y) z := shl(16, z) } if iszero(lt(y, 0x1000000)) { y := shr(16, y) z := shl(8, z) } // Goal was to get z*z*y within a small factor of x. More iterations could // get y in a tighter range. Currently, we will have y in [256, 256*2^16). // We ensured y >= 256 so that the relative difference between y and y+1 is small. // That's not possible if x < 256 but we can just verify those cases exhaustively. // Now, z*z*y <= x < z*z*(y+1), and y <= 2^(16+8), and either y >= 256, or x < 256. // Correctness can be checked exhaustively for x < 256, so we assume y >= 256. // Then z*sqrt(y) is within sqrt(257)/sqrt(256) of sqrt(x), or about 20bps. // For s in the range [1/256, 256], the estimate f(s) = (181/1024) * (s+1) is in the range // (1/2.84 * sqrt(s), 2.84 * sqrt(s)), with largest error when s = 1 and when s = 256 or 1/256. // Since y is in [256, 256*2^16), let a = y/65536, so that a is in [1/256, 256). Then we can estimate // sqrt(y) using sqrt(65536) * 181/1024 * (a + 1) = 181/4 * (y + 65536)/65536 = 181 * (y + 65536)/2^18. // There is no overflow risk here since y < 2^136 after the first branch above. z := shr(18, mul(z, add(y, 65536))) // A mul() is saved from starting z at 181. // Given the worst case multiplicative error of 2.84 above, 7 iterations should be enough. z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) z := shr(1, add(z, div(x, z))) // If x+1 is a perfect square, the Babylonian method cycles between // floor(sqrt(x)) and ceil(sqrt(x)). This statement ensures we return floor. // See: https://en.wikipedia.org/wiki/Integer_square_root#Using_only_integer_division // Since the ceil is rare, we save gas on the assignment and repeat division in the rare case. // If you don't care whether the floor or ceil square root is returned, you can remove this statement. z := sub(z, lt(div(x, z), z)) } } function unsafeMod(uint256 x, uint256 y) internal pure returns (uint256 z) { assembly { // Mod x by y. Note this will return // 0 instead of reverting if y is zero. z := mod(x, y) } } function unsafeDiv(uint256 x, uint256 y) internal pure returns (uint256 r) { assembly { // Divide x by y. Note this will return // 0 instead of reverting if y is zero. r := div(x, y) } } function unsafeDivUp(uint256 x, uint256 y) internal pure returns (uint256 z) { assembly { // Add 1 to x * y if x % y > 0. Note this will // return 0 instead of reverting if y is zero. z := add(gt(mod(x, y), 0), div(x, y)) } } }
// SPDX-License-Identifier: AGPL-3.0-only pragma solidity >=0.8.0; import {ERC20} from "../tokens/ERC20.sol"; /// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol) /// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer. /// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller. library SafeTransferLib { /*////////////////////////////////////////////////////////////// ETH OPERATIONS //////////////////////////////////////////////////////////////*/ function safeTransferETH(address to, uint256 amount) internal { bool success; assembly { // Transfer the ETH and store if it succeeded or not. success := call(gas(), to, amount, 0, 0, 0, 0) } require(success, "ETH_TRANSFER_FAILED"); } /*////////////////////////////////////////////////////////////// ERC20 OPERATIONS //////////////////////////////////////////////////////////////*/ function safeTransferFrom( ERC20 token, address from, address to, uint256 amount ) internal { bool success; assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), from) // Append the "from" argument. mstore(add(freeMemoryPointer, 36), to) // Append the "to" argument. mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 100, 0, 32) ) } require(success, "TRANSFER_FROM_FAILED"); } function safeTransfer( ERC20 token, address to, uint256 amount ) internal { bool success; assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument. mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 68, 0, 32) ) } require(success, "TRANSFER_FAILED"); } function safeApprove( ERC20 token, address to, uint256 amount ) internal { bool success; assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), to) // Append the "to" argument. mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. success := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token, 0, freeMemoryPointer, 68, 0, 32) ) } require(success, "APPROVE_FAILED"); } }
// SPDX-License-Identifier: MIT pragma solidity 0.8.17; import {ERC20} from "solmate/tokens/ERC20.sol"; import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol"; import "openzeppelin-contracts/contracts/access/Ownable.sol"; // https://docs.synthetix.io/contracts/source/contracts/StakingRewards/ // https://github.com/Synthetixio/synthetix/blob/v2.66.0/contracts/StakingRewards.sol /** Modifications - Pin pragma to 0.8.17 - Remove IStakingRewards, RewardsDistributionRecipient, and Pausable - Add and inherit from Ownable - Add `RewardsDistributionRecipient` logic to contract - Add `vault` state variable and `onlyVault` modifier - Add `onlyVault` modifier to `stake` method - Change `rewardsDuration` to 14 days - Update contract to support only the vault as a user - Remove SafeMath since pragma 0.8.0 has those checks built-in - Replace OpenZeppelin ERC20, ReentrancyGuard, and SafeERC20 with Solmate v6 (audited) - Consolidate `rewardsToken` and `stakingToken` since they're the same - Remove ReentrancyGuard as it is no longer needed - Add `totalSupplyWithRewards` method to save gas as _totalSupply + rewards are accessed by vault - Updated `notifyRewardsAmount` - Remove the method parameter and compute the reward amount inside the function - Remove the conditional logic since we will always distribute the rewards balance - Remove overflow check since the caller cannot pass in the reward amount */ contract UnionPirexStaking is Ownable { using SafeTransferLib for ERC20; /* ========== STATE VARIABLES ========== */ address public immutable vault; ERC20 public immutable token; uint256 public constant rewardsDuration = 14 days; address public distributor; uint256 public periodFinish; uint256 public rewardRate; uint256 public lastUpdateTime; uint256 public rewardPerTokenStored; uint256 public userRewardPerTokenPaid; uint256 public rewards; uint256 internal _totalSupply; /* ========== CONSTRUCTOR ========== */ constructor( address _token, address _distributor, address _vault ) { token = ERC20(_token); distributor = _distributor; vault = _vault; } /* ========== VIEWS ========== */ function totalSupply() external view returns (uint256) { return _totalSupply; } function totalSupplyWithRewards() external view returns (uint256, uint256) { uint256 t = _totalSupply; return ( t, ((t * (rewardPerToken() - userRewardPerTokenPaid)) / 1e18) + rewards ); } function lastTimeRewardApplicable() public view returns (uint256) { return block.timestamp < periodFinish ? block.timestamp : periodFinish; } function rewardPerToken() public view returns (uint256) { if (_totalSupply == 0) { return rewardPerTokenStored; } return rewardPerTokenStored + ((((lastTimeRewardApplicable() - lastUpdateTime) * rewardRate) * 1e18) / _totalSupply); } function earned() public view returns (uint256) { return ((_totalSupply * (rewardPerToken() - userRewardPerTokenPaid)) / 1e18) + rewards; } function getRewardForDuration() external view returns (uint256) { return rewardRate * rewardsDuration; } /* ========== MUTATIVE FUNCTIONS ========== */ function stake(uint256 amount) external onlyVault updateReward(vault) { require(amount > 0, "Cannot stake 0"); _totalSupply += amount; token.safeTransferFrom(vault, address(this), amount); emit Staked(amount); } function withdraw(uint256 amount) external onlyVault updateReward(vault) { require(amount > 0, "Cannot withdraw 0"); _totalSupply -= amount; token.safeTransfer(vault, amount); emit Withdrawn(amount); } function getReward() external onlyVault updateReward(vault) { uint256 reward = rewards; if (reward > 0) { rewards = 0; token.safeTransfer(vault, reward); emit RewardPaid(reward); } } /* ========== RESTRICTED FUNCTIONS ========== */ function notifyRewardAmount() external onlyDistributor updateReward(address(0)) { // Rewards transferred directly to this contract are not added to _totalSupply // To get the rewards w/o relying on a potentially incorrect passed in arg, // we can use the difference between the token balance and _totalSupply. // Additionally, to avoid re-distributing rewards, deduct the output of `earned` uint256 rewardBalance = token.balanceOf(address(this)) - _totalSupply - earned(); rewardRate = rewardBalance / rewardsDuration; require(rewardRate != 0, "No rewards"); lastUpdateTime = block.timestamp; periodFinish = block.timestamp + rewardsDuration; emit RewardAdded(rewardBalance); } // Added to support recovering LP Rewards from other systems such as BAL to be distributed to holders function recoverERC20(address tokenAddress, uint256 tokenAmount) external onlyOwner { require( tokenAddress != address(token), "Cannot withdraw the staking token" ); ERC20(tokenAddress).safeTransfer(owner(), tokenAmount); emit Recovered(tokenAddress, tokenAmount); } function setDistributor(address _distributor) external onlyOwner { require(_distributor != address(0)); distributor = _distributor; } /* ========== MODIFIERS ========== */ modifier updateReward(address account) { rewardPerTokenStored = rewardPerToken(); lastUpdateTime = lastTimeRewardApplicable(); if (account != address(0)) { rewards = earned(); userRewardPerTokenPaid = rewardPerTokenStored; } _; } /* ========== EVENTS ========== */ event RewardAdded(uint256 reward); event Staked(uint256 amount); event Withdrawn(uint256 amount); event RewardPaid(uint256 reward); event Recovered(address token, uint256 amount); modifier onlyDistributor() { require((msg.sender == distributor), "Distributor only"); _; } modifier onlyVault() { require((msg.sender == vault), "Vault only"); _; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
{ "remappings": [ "ds-test/=lib/forge-std/lib/ds-test/src/", "forge-std/=lib/forge-std/src/", "openzeppelin-contracts/=lib/openzeppelin-contracts/", "solmate/=lib/solmate/src/" ], "optimizer": { "enabled": true, "runs": 200 }, "metadata": { "bytecodeHash": "ipfs" }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "evmVersion": "london", "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"pxBtrfly","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AlreadySet","type":"error"},{"inputs":[],"name":"ExceedsMax","type":"error"},{"inputs":[],"name":"ZeroAddress","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Harvest","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"fee","type":"uint256"}],"name":"PlatformFeeUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_platform","type":"address"}],"name":"PlatformUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"_strategy","type":"address"}],"name":"StrategySet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"caller","type":"address"},{"indexed":true,"internalType":"address","name":"receiver","type":"address"},{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":false,"internalType":"uint256","name":"assets","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"shares","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"penalty","type":"uint256"}],"name":"WithdrawalPenaltyUpdated","type":"event"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FEE_DENOMINATOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_PLATFORM_FEE","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MAX_WITHDRAWAL_PENALTY","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"asset","outputs":[{"internalType":"contract ERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"convertToAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"convertToShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"deposit","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"harvest","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"maxMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"maxWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"}],"name":"mint","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","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":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"platform","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"platformFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewDeposit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewMint","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"name":"previewRedeem","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"name":"previewWithdraw","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"shares","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"redeem","outputs":[{"internalType":"uint256","name":"assets","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_platform","type":"address"}],"name":"setPlatform","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"fee","type":"uint256"}],"name":"setPlatformFee","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_strategy","type":"address"}],"name":"setStrategy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"penalty","type":"uint256"}],"name":"setWithdrawalPenalty","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"strategy","outputs":[{"internalType":"contract UnionPirexStaking","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalAssets","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"assets","type":"uint256"},{"internalType":"address","name":"receiver","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"shares","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawalPenalty","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"}]
Contract Creation Code
61010060405261012c6008556103e86009553480156200001e57600080fd5b50604051620022ba380380620022ba833981016040819052620000419162000249565b806040518060400160405280601881526020017f4175746f636f6d706f756e64696e67207078425452464c59000000000000000081525060405180604001604052806009815260200168617078425452464c5960b81b8152508181846001600160a01b031663313ce5676040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200010191906200027b565b6200010c336200015d565b60016200011a848262000345565b50600262000129838262000345565b5060ff81166080524660a0526200013f620001ad565b60c0525050506001600160a01b0390921660e052506200048f915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6001604051620001e1919062000411565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b6000602082840312156200025c57600080fd5b81516001600160a01b03811681146200027457600080fd5b9392505050565b6000602082840312156200028e57600080fd5b815160ff811681146200027457600080fd5b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620002cb57607f821691505b602082108103620002ec57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200034057600081815260208120601f850160051c810160208610156200031b5750805b601f850160051c820191505b818110156200033c5782815560010162000327565b5050505b505050565b81516001600160401b03811115620003615762000361620002a0565b6200037981620003728454620002b6565b84620002f2565b602080601f831160018114620003b15760008415620003985750858301515b600019600386901b1c1916600185901b1785556200033c565b600085815260208120601f198616915b82811015620003e257888601518255948401946001909101908401620003c1565b5085821015620004015787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b60008083546200042181620002b6565b600182811680156200043c5760018114620004525762000483565b60ff198416875282151583028701945062000483565b8760005260208060002060005b858110156200047a5781548a8201529084019082016200045f565b50505082870194505b50929695505050505050565b60805160a05160c05160e051611dc0620004fa60003960008181610383015281816109eb01528181610b2701528181610c1601528181610dd701528181610ee7015281816110e2015261122e01526000610a8601526000610a510152600061032f0152611dc06000f3fe608060405234801561001057600080fd5b50600436106102695760003560e01c806370a0823111610151578063b460af94116100c3578063d505accf11610087578063d505accf14610544578063d73792a914610557578063d905777e14610560578063dd62ed3e14610589578063ef8b30f7146105b4578063f2fde38b146105c757600080fd5b8063b460af94146104f8578063ba0876521461050b578063c63d75b6146103c6578063c6e6f5921461051e578063ce96cb771461053157600080fd5b806394bf804d1161011557806394bf804d1461049b57806395d89b41146104ae578063a2468c19146104b6578063a8c62e76146104bf578063a9059cbb146104d2578063b3d7f6b9146104e557600080fd5b806370a082311461042f578063715018a61461044f5780637ecebe00146104575780637faaa6c1146104775780638da5cb5b1461048a57600080fd5b8063313ce567116101ea578063402d267d116101ae578063402d267d146103c65780634641257d146103db5780634bde38c8146103e35780634cdad506146103f65780636945c5ea146104095780636e553f651461041c57600080fd5b8063313ce5671461032a57806333a100ca146103635780633644e5151461037657806338d52e0f1461037e5780633998a681146103bd57600080fd5b806312e8e2c31161023157806312e8e2c3146102e757806318160ddd146102fc5780632060176b1461030557806323b872dd1461030e57806326232a2e1461032157600080fd5b806301e1d1141461026e57806306fdde031461028957806307a2d13a1461029e578063095ea7b3146102b15780630a28a477146102d4575b600080fd5b6102766105da565b6040519081526020015b60405180910390f35b61029161069f565b60405161028091906119d6565b6102766102ac366004611a24565b61072d565b6102c46102bf366004611a59565b61075a565b6040519015158152602001610280565b6102766102e2366004611a24565b6107c7565b6102fa6102f5366004611a24565b610825565b005b61027660035481565b6102766101f481565b6102c461031c366004611a83565b61088c565b61027660095481565b6103517f000000000000000000000000000000000000000000000000000000000000000081565b60405160ff9091168152602001610280565b6102fa610371366004611abf565b61096c565b610276610a4d565b6103a57f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b039091168152602001610280565b6102766107d081565b6102766103d4366004611abf565b5060001990565b6102fa610aa8565b600a546103a5906001600160a01b031681565b610276610404366004611a24565b610ca3565b6102fa610417366004611abf565b610cfd565b61027661042a366004611ada565b610d7a565b61027661043d366004611abf565b60046020526000908152604090205481565b6102fa610e59565b610276610465366004611abf565b60066020526000908152604090205481565b6102fa610485366004611a24565b610e6d565b6000546001600160a01b03166103a5565b6102766104a9366004611ada565b610ecd565b610291610f69565b61027660085481565b6007546103a5906001600160a01b031681565b6102c46104e0366004611a59565b610f76565b6102766104f3366004611a24565b610fdc565b610276610506366004611b06565b610ffb565b610276610519366004611b06565b611109565b61027661052c366004611a24565b611255565b61027661053f366004611abf565b611275565b6102fa610552366004611b42565b611297565b61027661271081565b61027661056e366004611abf565b6001600160a01b031660009081526004602052604090205490565b610276610597366004611bb5565b600560209081526000928352604080842090915290825290205481565b6102766105c2366004611a24565b6114db565b6102fa6105d5366004611abf565b6114e6565b6000806000600760009054906101000a90046001600160a01b03166001600160a01b031663b31dcbcf6040518163ffffffff1660e01b81526004016040805180830381865afa158015610631573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106559190611bdf565b915091508060001461068b57612710600954826106729190611c19565b61067c9190611c30565b6106869082611c52565b61068e565b60005b6106989083611c65565b9250505090565b600180546106ac90611c78565b80601f01602080910402602001604051908101604052809291908181526020018280546106d890611c78565b80156107255780601f106106fa57610100808354040283529160200191610725565b820191906000526020600020905b81548152906001019060200180831161070857829003601f168201915b505050505081565b60035460009080156107515761074c6107446105da565b84908361155c565b610753565b825b9392505050565b3360008181526005602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906107b59086815260200190565b60405180910390a35060015b92915050565b6000806107d383611255565b6003549091508015806107ed57506107eb8282611c52565b155b61081b5760085461080090612710611c52565b61080c61271084611c19565b6108169190611c30565b61081d565b815b949350505050565b61082d61157a565b6107d0811115610850576040516395e28b8560e01b815260040160405180910390fd5b60098190556040518181527f45610d581145924dd7090a5017e5f2b1d6f42213bb2e95707ff86846bbfcb1ca906020015b60405180910390a150565b6001600160a01b038316600090815260056020908152604080832033845290915281205460001981146108e8576108c38382611c52565b6001600160a01b03861660009081526005602090815260408083203384529091529020555b6001600160a01b03851660009081526004602052604081208054859290610910908490611c52565b90915550506001600160a01b0380851660008181526004602052604090819020805487019055519091871690600080516020611d6b833981519152906109599087815260200190565b60405180910390a3506001949350505050565b61097461157a565b6001600160a01b03811661099b5760405163d92e233d60e01b815260040160405180910390fd5b6007546001600160a01b0316156109c55760405163a741a04560e01b815260040160405180910390fd5b600780546001600160a01b0319166001600160a01b0383811691909117909155610a14907f000000000000000000000000000000000000000000000000000000000000000016826000196115d4565b6040516001600160a01b03821681527fe70d79dad95c835bdd87e9cf4665651c9e5abb3b756e4fd2bf45f29c95c3aa4090602001610881565b60007f00000000000000000000000000000000000000000000000000000000000000004614610a8357610a7e611651565b905090565b507f000000000000000000000000000000000000000000000000000000000000000090565b600760009054906101000a90046001600160a01b03166001600160a01b0316633d18b9126040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610af857600080fd5b505af1158015610b0c573d6000803e3d6000fd5b50506040516370a0823160e01b8152306004820152600092507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031691506370a0823190602401602060405180830381865afa158015610b77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9b9190611cb2565b60405181815290915033907fc9695243a805adb74c91f28311176c65b417e842d5699893cef56d18bfa48cba9060200160405180910390a28015610ca057600061271060095483610bec9190611c19565b610bf69190611c30565b9050610c028183611c52565b600a54909250610c3f906001600160a01b037f000000000000000000000000000000000000000000000000000000000000000081169116836116eb565b60075460405163534a7e1d60e11b8152600481018490526001600160a01b039091169063a694fc3a906024015b600060405180830381600087803b158015610c8657600080fd5b505af1158015610c9a573d6000803e3d6000fd5b50505050505b50565b600080610caf8361072d565b6003549091506000811580610ccb5750610cc98583611c52565b155b610ce557600854610ce090849061271061155c565b610ce8565b60005b9050610cf48184611c52565b95945050505050565b610d0561157a565b6001600160a01b038116610d2c5760405163d92e233d60e01b815260040160405180910390fd5b600a80546001600160a01b0319166001600160a01b0383169081179091556040519081527f38703bc9e5fbfe6a4ab89353328531fd2a9b9b0a4953c587bd38e559da9c29cf90602001610881565b6000610d85836114db565b905080600003610dca5760405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f53484152455360a81b60448201526064015b60405180910390fd5b610dff6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333086611763565b610e0982826117ed565b60408051848152602081018390526001600160a01b0384169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a36107c18382610c3f565b610e6161157a565b610e6b6000611847565b565b610e7561157a565b6101f4811115610e98576040516395e28b8560e01b815260040160405180910390fd5b60088190556040518181527f9d5ddc6fdb90a6647fe4981fdf08b45a5f9ef6d8ea960de27bef48fb4813259290602001610881565b6000610ed883610fdc565b9050610f0f6001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016333084611763565b610f1982846117ed565b60408051828152602081018590526001600160a01b0384169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a36107c18184610c3f565b600280546106ac90611c78565b33600090815260046020526040812080548391908390610f97908490611c52565b90915550506001600160a01b03831660008181526004602052604090819020805485019055513390600080516020611d6b833981519152906107b59086815260200190565b60035460009080156107515761074c610ff36105da565b849083611897565b6000611006846107c7565b9050336001600160a01b03831614611076576001600160a01b038216600090815260056020908152604080832033845290915290205460001981146110745761104f8282611c52565b6001600160a01b03841660009081526005602090815260408083203384529091529020555b505b61108084826118bd565b61108a8282611974565b60408051858152602081018390526001600160a01b03808516929086169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910160405180910390a46107536001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001684866116eb565b6000336001600160a01b03831614611179576001600160a01b03821660009081526005602090815260408083203384529091529020546000198114611177576111528582611c52565b6001600160a01b03841660009081526005602090815260408083203384529091529020555b505b61118284610ca3565b9050806000036111c25760405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f41535345545360a81b6044820152606401610dc1565b6111cc81856118bd565b6111d68285611974565b60408051828152602081018690526001600160a01b03808516929086169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910160405180910390a46107536001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001684836116eb565b60035460009080156107515761074c8161126d6105da565b85919061155c565b6001600160a01b0381166000908152600460205260408120546107c19061072d565b428410156112e75760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f455850495245440000000000000000006044820152606401610dc1565b600060016112f3610a4d565b6001600160a01b038a811660008181526006602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa1580156113ff573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906114355750876001600160a01b0316816001600160a01b0316145b6114725760405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a4a3a722a960911b6044820152606401610dc1565b6001600160a01b0390811660009081526005602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b60006107c182611255565b6114ee61157a565b6001600160a01b0381166115535760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610dc1565b610ca081611847565b600082600019048411830215820261157357600080fd5b5091020490565b6000546001600160a01b03163314610e6b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610dc1565b600060405163095ea7b360e01b8152836004820152826024820152602060006044836000895af13d15601f3d116001600051141617169150508061164b5760405162461bcd60e51b815260206004820152600e60248201526d1054141493d59157d1905253115160921b6044820152606401610dc1565b50505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60016040516116839190611ccb565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b600060405163a9059cbb60e01b8152836004820152826024820152602060006044836000895af13d15601f3d116001600051141617169150508061164b5760405162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b6044820152606401610dc1565b60006040516323b872dd60e01b81528460048201528360248201528260448201526020600060648360008a5af13d15601f3d11600160005114161716915050806117e65760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b6044820152606401610dc1565b5050505050565b80600360008282546117ff9190611c65565b90915550506001600160a01b038216600081815260046020908152604080832080548601905551848152600080516020611d6b83398151915291015b60405180910390a35050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008260001904841183021582026118ae57600080fd5b50910281810615159190040190565b600760009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611910573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119349190611cb2565b82111561194357611943610aa8565b600754604051632e1a7d4d60e01b8152600481018490526001600160a01b0390911690632e1a7d4d90602401610c6c565b6001600160a01b0382166000908152600460205260408120805483929061199c908490611c52565b90915550506003805482900390556040518181526000906001600160a01b03841690600080516020611d6b8339815191529060200161183b565b600060208083528351808285015260005b81811015611a03578581018301518582016040015282016119e7565b506000604082860101526040601f19601f8301168501019250505092915050565b600060208284031215611a3657600080fd5b5035919050565b80356001600160a01b0381168114611a5457600080fd5b919050565b60008060408385031215611a6c57600080fd5b611a7583611a3d565b946020939093013593505050565b600080600060608486031215611a9857600080fd5b611aa184611a3d565b9250611aaf60208501611a3d565b9150604084013590509250925092565b600060208284031215611ad157600080fd5b61075382611a3d565b60008060408385031215611aed57600080fd5b82359150611afd60208401611a3d565b90509250929050565b600080600060608486031215611b1b57600080fd5b83359250611b2b60208501611a3d565b9150611b3960408501611a3d565b90509250925092565b600080600080600080600060e0888a031215611b5d57600080fd5b611b6688611a3d565b9650611b7460208901611a3d565b95506040880135945060608801359350608088013560ff81168114611b9857600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215611bc857600080fd5b611bd183611a3d565b9150611afd60208401611a3d565b60008060408385031215611bf257600080fd5b505080516020909101519092909150565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176107c1576107c1611c03565b600082611c4d57634e487b7160e01b600052601260045260246000fd5b500490565b818103818111156107c1576107c1611c03565b808201808211156107c1576107c1611c03565b600181811c90821680611c8c57607f821691505b602082108103611cac57634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215611cc457600080fd5b5051919050565b600080835481600182811c915080831680611ce757607f831692505b60208084108203611d0657634e487b7160e01b86526022600452602486fd5b818015611d1a5760018114611d2f57611d5c565b60ff1986168952841515850289019650611d5c565b60008a81526020902060005b86811015611d545781548b820152908501908301611d3b565b505084890196505b50949897505050505050505056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212203fe886de8d4636138fc1cee2a8a5662f03f932eb5e01424a60ecdf62638ca28c64736f6c6343000811003300000000000000000000000010978db3885ba79bf1bc823e108085fb88e6f02f
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102695760003560e01c806370a0823111610151578063b460af94116100c3578063d505accf11610087578063d505accf14610544578063d73792a914610557578063d905777e14610560578063dd62ed3e14610589578063ef8b30f7146105b4578063f2fde38b146105c757600080fd5b8063b460af94146104f8578063ba0876521461050b578063c63d75b6146103c6578063c6e6f5921461051e578063ce96cb771461053157600080fd5b806394bf804d1161011557806394bf804d1461049b57806395d89b41146104ae578063a2468c19146104b6578063a8c62e76146104bf578063a9059cbb146104d2578063b3d7f6b9146104e557600080fd5b806370a082311461042f578063715018a61461044f5780637ecebe00146104575780637faaa6c1146104775780638da5cb5b1461048a57600080fd5b8063313ce567116101ea578063402d267d116101ae578063402d267d146103c65780634641257d146103db5780634bde38c8146103e35780634cdad506146103f65780636945c5ea146104095780636e553f651461041c57600080fd5b8063313ce5671461032a57806333a100ca146103635780633644e5151461037657806338d52e0f1461037e5780633998a681146103bd57600080fd5b806312e8e2c31161023157806312e8e2c3146102e757806318160ddd146102fc5780632060176b1461030557806323b872dd1461030e57806326232a2e1461032157600080fd5b806301e1d1141461026e57806306fdde031461028957806307a2d13a1461029e578063095ea7b3146102b15780630a28a477146102d4575b600080fd5b6102766105da565b6040519081526020015b60405180910390f35b61029161069f565b60405161028091906119d6565b6102766102ac366004611a24565b61072d565b6102c46102bf366004611a59565b61075a565b6040519015158152602001610280565b6102766102e2366004611a24565b6107c7565b6102fa6102f5366004611a24565b610825565b005b61027660035481565b6102766101f481565b6102c461031c366004611a83565b61088c565b61027660095481565b6103517f000000000000000000000000000000000000000000000000000000000000001281565b60405160ff9091168152602001610280565b6102fa610371366004611abf565b61096c565b610276610a4d565b6103a57f00000000000000000000000010978db3885ba79bf1bc823e108085fb88e6f02f81565b6040516001600160a01b039091168152602001610280565b6102766107d081565b6102766103d4366004611abf565b5060001990565b6102fa610aa8565b600a546103a5906001600160a01b031681565b610276610404366004611a24565b610ca3565b6102fa610417366004611abf565b610cfd565b61027661042a366004611ada565b610d7a565b61027661043d366004611abf565b60046020526000908152604090205481565b6102fa610e59565b610276610465366004611abf565b60066020526000908152604090205481565b6102fa610485366004611a24565b610e6d565b6000546001600160a01b03166103a5565b6102766104a9366004611ada565b610ecd565b610291610f69565b61027660085481565b6007546103a5906001600160a01b031681565b6102c46104e0366004611a59565b610f76565b6102766104f3366004611a24565b610fdc565b610276610506366004611b06565b610ffb565b610276610519366004611b06565b611109565b61027661052c366004611a24565b611255565b61027661053f366004611abf565b611275565b6102fa610552366004611b42565b611297565b61027661271081565b61027661056e366004611abf565b6001600160a01b031660009081526004602052604090205490565b610276610597366004611bb5565b600560209081526000928352604080842090915290825290205481565b6102766105c2366004611a24565b6114db565b6102fa6105d5366004611abf565b6114e6565b6000806000600760009054906101000a90046001600160a01b03166001600160a01b031663b31dcbcf6040518163ffffffff1660e01b81526004016040805180830381865afa158015610631573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106559190611bdf565b915091508060001461068b57612710600954826106729190611c19565b61067c9190611c30565b6106869082611c52565b61068e565b60005b6106989083611c65565b9250505090565b600180546106ac90611c78565b80601f01602080910402602001604051908101604052809291908181526020018280546106d890611c78565b80156107255780601f106106fa57610100808354040283529160200191610725565b820191906000526020600020905b81548152906001019060200180831161070857829003601f168201915b505050505081565b60035460009080156107515761074c6107446105da565b84908361155c565b610753565b825b9392505050565b3360008181526005602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925906107b59086815260200190565b60405180910390a35060015b92915050565b6000806107d383611255565b6003549091508015806107ed57506107eb8282611c52565b155b61081b5760085461080090612710611c52565b61080c61271084611c19565b6108169190611c30565b61081d565b815b949350505050565b61082d61157a565b6107d0811115610850576040516395e28b8560e01b815260040160405180910390fd5b60098190556040518181527f45610d581145924dd7090a5017e5f2b1d6f42213bb2e95707ff86846bbfcb1ca906020015b60405180910390a150565b6001600160a01b038316600090815260056020908152604080832033845290915281205460001981146108e8576108c38382611c52565b6001600160a01b03861660009081526005602090815260408083203384529091529020555b6001600160a01b03851660009081526004602052604081208054859290610910908490611c52565b90915550506001600160a01b0380851660008181526004602052604090819020805487019055519091871690600080516020611d6b833981519152906109599087815260200190565b60405180910390a3506001949350505050565b61097461157a565b6001600160a01b03811661099b5760405163d92e233d60e01b815260040160405180910390fd5b6007546001600160a01b0316156109c55760405163a741a04560e01b815260040160405180910390fd5b600780546001600160a01b0319166001600160a01b0383811691909117909155610a14907f00000000000000000000000010978db3885ba79bf1bc823e108085fb88e6f02f16826000196115d4565b6040516001600160a01b03821681527fe70d79dad95c835bdd87e9cf4665651c9e5abb3b756e4fd2bf45f29c95c3aa4090602001610881565b60007f00000000000000000000000000000000000000000000000000000000000000014614610a8357610a7e611651565b905090565b507f3e97e6bbfa6ee6eff02793401ab0fffa971ffef15a37e5d8b3ab2502e1fcaec690565b600760009054906101000a90046001600160a01b03166001600160a01b0316633d18b9126040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610af857600080fd5b505af1158015610b0c573d6000803e3d6000fd5b50506040516370a0823160e01b8152306004820152600092507f00000000000000000000000010978db3885ba79bf1bc823e108085fb88e6f02f6001600160a01b031691506370a0823190602401602060405180830381865afa158015610b77573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b9b9190611cb2565b60405181815290915033907fc9695243a805adb74c91f28311176c65b417e842d5699893cef56d18bfa48cba9060200160405180910390a28015610ca057600061271060095483610bec9190611c19565b610bf69190611c30565b9050610c028183611c52565b600a54909250610c3f906001600160a01b037f00000000000000000000000010978db3885ba79bf1bc823e108085fb88e6f02f81169116836116eb565b60075460405163534a7e1d60e11b8152600481018490526001600160a01b039091169063a694fc3a906024015b600060405180830381600087803b158015610c8657600080fd5b505af1158015610c9a573d6000803e3d6000fd5b50505050505b50565b600080610caf8361072d565b6003549091506000811580610ccb5750610cc98583611c52565b155b610ce557600854610ce090849061271061155c565b610ce8565b60005b9050610cf48184611c52565b95945050505050565b610d0561157a565b6001600160a01b038116610d2c5760405163d92e233d60e01b815260040160405180910390fd5b600a80546001600160a01b0319166001600160a01b0383169081179091556040519081527f38703bc9e5fbfe6a4ab89353328531fd2a9b9b0a4953c587bd38e559da9c29cf90602001610881565b6000610d85836114db565b905080600003610dca5760405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f53484152455360a81b60448201526064015b60405180910390fd5b610dff6001600160a01b037f00000000000000000000000010978db3885ba79bf1bc823e108085fb88e6f02f16333086611763565b610e0982826117ed565b60408051848152602081018390526001600160a01b0384169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a36107c18382610c3f565b610e6161157a565b610e6b6000611847565b565b610e7561157a565b6101f4811115610e98576040516395e28b8560e01b815260040160405180910390fd5b60088190556040518181527f9d5ddc6fdb90a6647fe4981fdf08b45a5f9ef6d8ea960de27bef48fb4813259290602001610881565b6000610ed883610fdc565b9050610f0f6001600160a01b037f00000000000000000000000010978db3885ba79bf1bc823e108085fb88e6f02f16333084611763565b610f1982846117ed565b60408051828152602081018590526001600160a01b0384169133917fdcbc1c05240f31ff3ad067ef1ee35ce4997762752e3a095284754544f4c709d7910160405180910390a36107c18184610c3f565b600280546106ac90611c78565b33600090815260046020526040812080548391908390610f97908490611c52565b90915550506001600160a01b03831660008181526004602052604090819020805485019055513390600080516020611d6b833981519152906107b59086815260200190565b60035460009080156107515761074c610ff36105da565b849083611897565b6000611006846107c7565b9050336001600160a01b03831614611076576001600160a01b038216600090815260056020908152604080832033845290915290205460001981146110745761104f8282611c52565b6001600160a01b03841660009081526005602090815260408083203384529091529020555b505b61108084826118bd565b61108a8282611974565b60408051858152602081018390526001600160a01b03808516929086169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910160405180910390a46107536001600160a01b037f00000000000000000000000010978db3885ba79bf1bc823e108085fb88e6f02f1684866116eb565b6000336001600160a01b03831614611179576001600160a01b03821660009081526005602090815260408083203384529091529020546000198114611177576111528582611c52565b6001600160a01b03841660009081526005602090815260408083203384529091529020555b505b61118284610ca3565b9050806000036111c25760405162461bcd60e51b815260206004820152600b60248201526a5a45524f5f41535345545360a81b6044820152606401610dc1565b6111cc81856118bd565b6111d68285611974565b60408051828152602081018690526001600160a01b03808516929086169133917ffbde797d201c681b91056529119e0b02407c7bb96a4a2c75c01fc9667232c8db910160405180910390a46107536001600160a01b037f00000000000000000000000010978db3885ba79bf1bc823e108085fb88e6f02f1684836116eb565b60035460009080156107515761074c8161126d6105da565b85919061155c565b6001600160a01b0381166000908152600460205260408120546107c19061072d565b428410156112e75760405162461bcd60e51b815260206004820152601760248201527f5045524d49545f444541444c494e455f455850495245440000000000000000006044820152606401610dc1565b600060016112f3610a4d565b6001600160a01b038a811660008181526006602090815260409182902080546001810190915582517f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98184015280840194909452938d166060840152608083018c905260a083019390935260c08083018b90528151808403909101815260e08301909152805192019190912061190160f01b6101008301526101028201929092526101228101919091526101420160408051601f198184030181528282528051602091820120600084529083018083525260ff871690820152606081018590526080810184905260a0016020604051602081039080840390855afa1580156113ff573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116158015906114355750876001600160a01b0316816001600160a01b0316145b6114725760405162461bcd60e51b815260206004820152600e60248201526d24a72b20a624a22fa9a4a3a722a960911b6044820152606401610dc1565b6001600160a01b0390811660009081526005602090815260408083208a8516808552908352928190208990555188815291928a16917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a350505050505050565b60006107c182611255565b6114ee61157a565b6001600160a01b0381166115535760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610dc1565b610ca081611847565b600082600019048411830215820261157357600080fd5b5091020490565b6000546001600160a01b03163314610e6b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610dc1565b600060405163095ea7b360e01b8152836004820152826024820152602060006044836000895af13d15601f3d116001600051141617169150508061164b5760405162461bcd60e51b815260206004820152600e60248201526d1054141493d59157d1905253115160921b6044820152606401610dc1565b50505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60016040516116839190611ccb565b6040805191829003822060208301939093528101919091527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc660608201524660808201523060a082015260c00160405160208183030381529060405280519060200120905090565b600060405163a9059cbb60e01b8152836004820152826024820152602060006044836000895af13d15601f3d116001600051141617169150508061164b5760405162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b6044820152606401610dc1565b60006040516323b872dd60e01b81528460048201528360248201528260448201526020600060648360008a5af13d15601f3d11600160005114161716915050806117e65760405162461bcd60e51b81526020600482015260146024820152731514905394d1915497d19493d357d1905253115160621b6044820152606401610dc1565b5050505050565b80600360008282546117ff9190611c65565b90915550506001600160a01b038216600081815260046020908152604080832080548601905551848152600080516020611d6b83398151915291015b60405180910390a35050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b60008260001904841183021582026118ae57600080fd5b50910281810615159190040190565b600760009054906101000a90046001600160a01b03166001600160a01b03166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611910573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119349190611cb2565b82111561194357611943610aa8565b600754604051632e1a7d4d60e01b8152600481018490526001600160a01b0390911690632e1a7d4d90602401610c6c565b6001600160a01b0382166000908152600460205260408120805483929061199c908490611c52565b90915550506003805482900390556040518181526000906001600160a01b03841690600080516020611d6b8339815191529060200161183b565b600060208083528351808285015260005b81811015611a03578581018301518582016040015282016119e7565b506000604082860101526040601f19601f8301168501019250505092915050565b600060208284031215611a3657600080fd5b5035919050565b80356001600160a01b0381168114611a5457600080fd5b919050565b60008060408385031215611a6c57600080fd5b611a7583611a3d565b946020939093013593505050565b600080600060608486031215611a9857600080fd5b611aa184611a3d565b9250611aaf60208501611a3d565b9150604084013590509250925092565b600060208284031215611ad157600080fd5b61075382611a3d565b60008060408385031215611aed57600080fd5b82359150611afd60208401611a3d565b90509250929050565b600080600060608486031215611b1b57600080fd5b83359250611b2b60208501611a3d565b9150611b3960408501611a3d565b90509250925092565b600080600080600080600060e0888a031215611b5d57600080fd5b611b6688611a3d565b9650611b7460208901611a3d565b95506040880135945060608801359350608088013560ff81168114611b9857600080fd5b9699959850939692959460a0840135945060c09093013592915050565b60008060408385031215611bc857600080fd5b611bd183611a3d565b9150611afd60208401611a3d565b60008060408385031215611bf257600080fd5b505080516020909101519092909150565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176107c1576107c1611c03565b600082611c4d57634e487b7160e01b600052601260045260246000fd5b500490565b818103818111156107c1576107c1611c03565b808201808211156107c1576107c1611c03565b600181811c90821680611c8c57607f821691505b602082108103611cac57634e487b7160e01b600052602260045260246000fd5b50919050565b600060208284031215611cc457600080fd5b5051919050565b600080835481600182811c915080831680611ce757607f831692505b60208084108203611d0657634e487b7160e01b86526022600452602486fd5b818015611d1a5760018114611d2f57611d5c565b60ff1986168952841515850289019650611d5c565b60008a81526020902060005b86811015611d545781548b820152908501908301611d3b565b505084890196505b50949897505050505050505056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3efa26469706673582212203fe886de8d4636138fc1cee2a8a5662f03f932eb5e01424a60ecdf62638ca28c64736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
00000000000000000000000010978db3885ba79bf1bc823e108085fb88e6f02f
-----Decoded View---------------
Arg [0] : pxBtrfly (address): 0x10978Db3885bA79Bf1Bc823E108085FB88e6F02f
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 00000000000000000000000010978db3885ba79bf1bc823e108085fb88e6f02f
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A token is a representation of an on-chain or off-chain asset. The token page shows information such as price, total supply, holders, transfers and social links. Learn more about this page in our Knowledge Base.