Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
Latest 1 internal transaction
Advanced mode:
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
16708787 | 620 days ago | Contract Creation | 0 ETH |
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
ScheduledTransfers
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: AGPL-3.0 pragma solidity ^0.8.17; import {ERC20} from "solmate/tokens/ERC20.sol"; import {ERC721} from "solmate/tokens/ERC721.sol"; import {SafeTransferLib} from "solmate/utils/SafeTransferLib.sol"; import "openzeppelin-contracts/contracts/utils/Strings.sol"; import "./forks/BoringBatchable.sol"; interface ScheduledTransfersFactory { function owner() external view returns (address); function oracle() external view returns (address); function token() external view returns (address); function maxPrice() external view returns (uint256); } error NOT_OWNER(); error NOT_ORACLE(); error NOT_OWNER_OR_WHITELISTED(); error INVALID_TIMESTAMP(); error FUTURE_TIMESTAMP(); error MAX_PRICE(); error STREAM_DOES_NOT_EXIST(); error INVALID_TOKEN(); error STREAM_ACTIVE(); contract ScheduledTransfers is ERC721, BoringBatchable { using SafeTransferLib for ERC20; struct Payment { uint32 lastPaid; uint32 ends; uint32 frequency; uint160 usdAmount; } string public constant baseURI = "https://nft.llamapay.io/scheduled/"; address public oracle; address public owner; address public token; uint256 public nextTokenId; uint256 public maxPrice; mapping(uint256 => Payment) public payments; mapping(address => mapping(uint256 => address)) public redirects; event ScheduleTransfer( uint256 id, address to, uint160 usdAmount, uint32 starts, uint32 ends, uint32 frequency ); event CancelTransfer(uint256 id); event BurnStream(uint256 id); event WithdrawPayer(address token, uint256 amount); event Withdraw( uint256 id, address to, uint256 owed, uint160 usdAmount, uint256 price, uint256 timestamp, uint256 lastPaid ); event SetRedirect(address caller, uint256 id, address redirectTo); event ChangeOracle(address newOracle); event SetMaxPrice(uint256 newMaxprice); constructor() ERC721("LlamaPay V2 Scheduled Transfer", "LLAMAPAY") { oracle = ScheduledTransfersFactory(msg.sender).oracle(); owner = ScheduledTransfersFactory(msg.sender).owner(); token = ScheduledTransfersFactory(msg.sender).token(); maxPrice = ScheduledTransfersFactory(msg.sender).maxPrice(); } modifier onlyOwner() { if (msg.sender != owner) revert NOT_OWNER(); _; } function tokenURI(uint256 _id) public view virtual override returns (string memory) { if (ownerOf(_id) == address(0)) revert STREAM_DOES_NOT_EXIST(); return string( abi.encodePacked( baseURI, Strings.toString(block.chainid), "/", Strings.toHexString(uint160(address(this)), 20), "/", Strings.toString(_id) ) ); } function scheduleTransfer( address _to, uint160 _usdAmount, uint32 _starts, uint32 _ends, uint32 _frequency ) external onlyOwner { uint256 id = nextTokenId; _safeMint(_to, id); payments[id] = Payment({ lastPaid: _starts, ends: _ends, frequency: _frequency, usdAmount: _usdAmount }); unchecked { nextTokenId++; } emit ScheduleTransfer(id, _to, _usdAmount, _starts, _ends, _frequency); } function cancelTransfer(uint256 _id) external onlyOwner { if (ownerOf(_id) == address(0)) revert STREAM_DOES_NOT_EXIST(); payments[_id].ends = uint32(block.timestamp); emit CancelTransfer(_id); } /// STILL EXERCISE CAUTION WHEN USING THIS FUNCTION function burnStream(uint256 _id) external { if (ownerOf(_id) != msg.sender) revert NOT_OWNER(); if ( payments[_id].ends >= block.timestamp || payments[_id].ends != payments[_id].lastPaid ) revert STREAM_ACTIVE(); _burn(_id); emit BurnStream(_id); } function withdrawPayer(address _token, uint256 _amount) external onlyOwner { ERC20(_token).safeTransfer(owner, _amount); emit WithdrawPayer(_token, _amount); } function withdraw( uint256[] calldata ids, address _token, uint256 _price, uint256 _timestamp ) external { if (_timestamp > block.timestamp) revert FUTURE_TIMESTAMP(); if (msg.sender != oracle) revert NOT_ORACLE(); if (_price > maxPrice) revert MAX_PRICE(); if (token != _token) revert INVALID_TOKEN(); uint256 i = 0; uint256 length = ids.length; while (i < length) { _withdraw(ids[i], _price, _timestamp); unchecked { i++; } } } function _withdraw( uint256 _id, uint256 _price, uint256 _timestamp ) private { Payment storage payment = payments[_id]; if (ownerOf(_id) == address(0)) revert STREAM_DOES_NOT_EXIST(); if (_timestamp > payment.ends) revert INVALID_TIMESTAMP(); uint256 updatedTimestamp; unchecked { // cant overflow because these two are uint32 updatedTimestamp = uint256(payment.lastPaid) + uint256(payment.frequency); } if (_timestamp > updatedTimestamp) revert INVALID_TIMESTAMP(); uint256 owed = (_timestamp - uint256(payment.lastPaid)) * uint256(payment.usdAmount) * _price; unchecked { owed = owed / (uint256(payment.frequency) * 1e18); } payments[_id].lastPaid = uint32(_timestamp); // _timestamp < block.timestamp, so it will fit into uint32 until 2106 address to; address nftOwner = ownerOf(_id); address redirect = redirects[nftOwner][_id]; if (redirect == address(0)) { to = nftOwner; } else { to = redirect; } ERC20(token).safeTransfer(to, owed); emit Withdraw( _id, to, owed, payment.usdAmount, _price, _timestamp, _timestamp ); } function setRedirect(uint256 _id, address _redirectTo) external { if (msg.sender != ownerOf(_id)) revert NOT_OWNER(); redirects[msg.sender][_id] = _redirectTo; emit SetRedirect(msg.sender, _id, _redirectTo); } function changeOracle(address newOracle) external onlyOwner { oracle = newOracle; emit ChangeOracle(newOracle); } function setMaxPrice(uint256 newMaxPrice) external onlyOwner { maxPrice = newMaxPrice; emit SetMaxPrice(newMaxPrice); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol) pragma solidity ^0.8.0; import "./math/Math.sol"; /** * @dev String operations. */ library Strings { bytes16 private constant _SYMBOLS = "0123456789abcdef"; uint8 private constant _ADDRESS_LENGTH = 20; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { unchecked { uint256 length = Math.log10(value) + 1; string memory buffer = new string(length); uint256 ptr; /// @solidity memory-safe-assembly assembly { ptr := add(buffer, add(32, length)) } while (true) { ptr--; /// @solidity memory-safe-assembly assembly { mstore8(ptr, byte(mod(value, 10), _SYMBOLS)) } value /= 10; if (value == 0) break; } return buffer; } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { unchecked { return toHexString(value, Math.log256(value) + 1); } } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } /** * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation. */ function toHexString(address addr) internal pure returns (string memory) { return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol) pragma solidity ^0.8.0; /** * @dev Standard math utilities missing in the Solidity language. */ library Math { enum Rounding { Down, // Toward negative infinity Up, // Toward infinity Zero // Toward zero } /** * @dev Returns the largest of two numbers. */ function max(uint256 a, uint256 b) internal pure returns (uint256) { return a > b ? a : b; } /** * @dev Returns the smallest of two numbers. */ function min(uint256 a, uint256 b) internal pure returns (uint256) { return a < b ? a : b; } /** * @dev Returns the average of two numbers. The result is rounded towards * zero. */ function average(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b) / 2 can overflow. return (a & b) + (a ^ b) / 2; } /** * @dev Returns the ceiling of the division of two numbers. * * This differs from standard division with `/` in that it rounds up instead * of rounding down. */ function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) { // (a + b - 1) / b can overflow on addition, so we distribute. return a == 0 ? 0 : (a - 1) / b + 1; } /** * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0 * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv) * with further edits by Uniswap Labs also under MIT license. */ function mulDiv( uint256 x, uint256 y, uint256 denominator ) internal pure returns (uint256 result) { unchecked { // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256 // variables such that product = prod1 * 2^256 + prod0. uint256 prod0; // Least significant 256 bits of the product uint256 prod1; // Most significant 256 bits of the product assembly { let mm := mulmod(x, y, not(0)) prod0 := mul(x, y) prod1 := sub(sub(mm, prod0), lt(mm, prod0)) } // Handle non-overflow cases, 256 by 256 division. if (prod1 == 0) { return prod0 / denominator; } // Make sure the result is less than 2^256. Also prevents denominator == 0. require(denominator > prod1); /////////////////////////////////////////////// // 512 by 256 division. /////////////////////////////////////////////// // Make division exact by subtracting the remainder from [prod1 prod0]. uint256 remainder; assembly { // Compute remainder using mulmod. remainder := mulmod(x, y, denominator) // Subtract 256 bit number from 512 bit number. prod1 := sub(prod1, gt(remainder, prod0)) prod0 := sub(prod0, remainder) } // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1. // See https://cs.stackexchange.com/q/138556/92363. // Does not overflow because the denominator cannot be zero at this stage in the function. uint256 twos = denominator & (~denominator + 1); assembly { // Divide denominator by twos. denominator := div(denominator, twos) // Divide [prod1 prod0] by twos. prod0 := div(prod0, twos) // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one. twos := add(div(sub(0, twos), twos), 1) } // Shift in bits from prod1 into prod0. prod0 |= prod1 * twos; // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for // four bits. That is, denominator * inv = 1 mod 2^4. uint256 inverse = (3 * denominator) ^ 2; // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works // in modular arithmetic, doubling the correct bits in each step. inverse *= 2 - denominator * inverse; // inverse mod 2^8 inverse *= 2 - denominator * inverse; // inverse mod 2^16 inverse *= 2 - denominator * inverse; // inverse mod 2^32 inverse *= 2 - denominator * inverse; // inverse mod 2^64 inverse *= 2 - denominator * inverse; // inverse mod 2^128 inverse *= 2 - denominator * inverse; // inverse mod 2^256 // Because the division is now exact we can divide by multiplying with the modular inverse of denominator. // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1 // is no longer required. result = prod0 * inverse; return result; } } /** * @notice Calculates x * y / denominator with full precision, following the selected rounding direction. */ function mulDiv( uint256 x, uint256 y, uint256 denominator, Rounding rounding ) internal pure returns (uint256) { uint256 result = mulDiv(x, y, denominator); if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) { result += 1; } return result; } /** * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down. * * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11). */ function sqrt(uint256 a) internal pure returns (uint256) { if (a == 0) { return 0; } // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target. // // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`. // // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)` // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))` // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)` // // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit. uint256 result = 1 << (log2(a) >> 1); // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128, // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision // into the expected uint128 result. unchecked { result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; result = (result + a / result) >> 1; return min(result, a / result); } } /** * @notice Calculates sqrt(a), following the selected rounding direction. */ function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = sqrt(a); return result + (rounding == Rounding.Up && result * result < a ? 1 : 0); } } /** * @dev Return the log in base 2, rounded down, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 128; } if (value >> 64 > 0) { value >>= 64; result += 64; } if (value >> 32 > 0) { value >>= 32; result += 32; } if (value >> 16 > 0) { value >>= 16; result += 16; } if (value >> 8 > 0) { value >>= 8; result += 8; } if (value >> 4 > 0) { value >>= 4; result += 4; } if (value >> 2 > 0) { value >>= 2; result += 2; } if (value >> 1 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 2, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log2(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log2(value); return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0); } } /** * @dev Return the log in base 10, rounded down, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >= 10**64) { value /= 10**64; result += 64; } if (value >= 10**32) { value /= 10**32; result += 32; } if (value >= 10**16) { value /= 10**16; result += 16; } if (value >= 10**8) { value /= 10**8; result += 8; } if (value >= 10**4) { value /= 10**4; result += 4; } if (value >= 10**2) { value /= 10**2; result += 2; } if (value >= 10**1) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log10(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log10(value); return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0); } } /** * @dev Return the log in base 256, rounded down, of a positive value. * Returns 0 if given 0. * * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string. */ function log256(uint256 value) internal pure returns (uint256) { uint256 result = 0; unchecked { if (value >> 128 > 0) { value >>= 128; result += 16; } if (value >> 64 > 0) { value >>= 64; result += 8; } if (value >> 32 > 0) { value >>= 32; result += 4; } if (value >> 16 > 0) { value >>= 16; result += 2; } if (value >> 8 > 0) { result += 1; } } return result; } /** * @dev Return the log in base 10, following the selected rounding direction, of a positive value. * Returns 0 if given 0. */ function log256(uint256 value, Rounding rounding) internal pure returns (uint256) { unchecked { uint256 result = log256(value); return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0); } } }
// 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 Modern, minimalist, and gas efficient ERC-721 implementation. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC721.sol) abstract contract ERC721 { /*////////////////////////////////////////////////////////////// EVENTS //////////////////////////////////////////////////////////////*/ event Transfer(address indexed from, address indexed to, uint256 indexed id); event Approval(address indexed owner, address indexed spender, uint256 indexed id); event ApprovalForAll(address indexed owner, address indexed operator, bool approved); /*////////////////////////////////////////////////////////////// METADATA STORAGE/LOGIC //////////////////////////////////////////////////////////////*/ string public name; string public symbol; function tokenURI(uint256 id) public view virtual returns (string memory); /*////////////////////////////////////////////////////////////// ERC721 BALANCE/OWNER STORAGE //////////////////////////////////////////////////////////////*/ mapping(uint256 => address) internal _ownerOf; mapping(address => uint256) internal _balanceOf; function ownerOf(uint256 id) public view virtual returns (address owner) { require((owner = _ownerOf[id]) != address(0), "NOT_MINTED"); } function balanceOf(address owner) public view virtual returns (uint256) { require(owner != address(0), "ZERO_ADDRESS"); return _balanceOf[owner]; } /*////////////////////////////////////////////////////////////// ERC721 APPROVAL STORAGE //////////////////////////////////////////////////////////////*/ mapping(uint256 => address) public getApproved; mapping(address => mapping(address => bool)) public isApprovedForAll; /*////////////////////////////////////////////////////////////// CONSTRUCTOR //////////////////////////////////////////////////////////////*/ constructor(string memory _name, string memory _symbol) { name = _name; symbol = _symbol; } /*////////////////////////////////////////////////////////////// ERC721 LOGIC //////////////////////////////////////////////////////////////*/ function approve(address spender, uint256 id) public virtual { address owner = _ownerOf[id]; require(msg.sender == owner || isApprovedForAll[owner][msg.sender], "NOT_AUTHORIZED"); getApproved[id] = spender; emit Approval(owner, spender, id); } function setApprovalForAll(address operator, bool approved) public virtual { isApprovedForAll[msg.sender][operator] = approved; emit ApprovalForAll(msg.sender, operator, approved); } function transferFrom( address from, address to, uint256 id ) public virtual { require(from == _ownerOf[id], "WRONG_FROM"); require(to != address(0), "INVALID_RECIPIENT"); require( msg.sender == from || isApprovedForAll[from][msg.sender] || msg.sender == getApproved[id], "NOT_AUTHORIZED" ); // Underflow of the sender's balance is impossible because we check for // ownership above and the recipient's balance can't realistically overflow. unchecked { _balanceOf[from]--; _balanceOf[to]++; } _ownerOf[id] = to; delete getApproved[id]; emit Transfer(from, to, id); } function safeTransferFrom( address from, address to, uint256 id ) public virtual { transferFrom(from, to, id); require( to.code.length == 0 || ERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, "") == ERC721TokenReceiver.onERC721Received.selector, "UNSAFE_RECIPIENT" ); } function safeTransferFrom( address from, address to, uint256 id, bytes calldata data ) public virtual { transferFrom(from, to, id); require( to.code.length == 0 || ERC721TokenReceiver(to).onERC721Received(msg.sender, from, id, data) == ERC721TokenReceiver.onERC721Received.selector, "UNSAFE_RECIPIENT" ); } /*////////////////////////////////////////////////////////////// ERC165 LOGIC //////////////////////////////////////////////////////////////*/ function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165 interfaceId == 0x80ac58cd || // ERC165 Interface ID for ERC721 interfaceId == 0x5b5e139f; // ERC165 Interface ID for ERC721Metadata } /*////////////////////////////////////////////////////////////// INTERNAL MINT/BURN LOGIC //////////////////////////////////////////////////////////////*/ function _mint(address to, uint256 id) internal virtual { require(to != address(0), "INVALID_RECIPIENT"); require(_ownerOf[id] == address(0), "ALREADY_MINTED"); // Counter overflow is incredibly unrealistic. unchecked { _balanceOf[to]++; } _ownerOf[id] = to; emit Transfer(address(0), to, id); } function _burn(uint256 id) internal virtual { address owner = _ownerOf[id]; require(owner != address(0), "NOT_MINTED"); // Ownership check above ensures no underflow. unchecked { _balanceOf[owner]--; } delete _ownerOf[id]; delete getApproved[id]; emit Transfer(owner, address(0), id); } /*////////////////////////////////////////////////////////////// INTERNAL SAFE MINT LOGIC //////////////////////////////////////////////////////////////*/ function _safeMint(address to, uint256 id) internal virtual { _mint(to, id); require( to.code.length == 0 || ERC721TokenReceiver(to).onERC721Received(msg.sender, address(0), id, "") == ERC721TokenReceiver.onERC721Received.selector, "UNSAFE_RECIPIENT" ); } function _safeMint( address to, uint256 id, bytes memory data ) internal virtual { _mint(to, id); require( to.code.length == 0 || ERC721TokenReceiver(to).onERC721Received(msg.sender, address(0), id, data) == ERC721TokenReceiver.onERC721Received.selector, "UNSAFE_RECIPIENT" ); } } /// @notice A generic interface for a contract which properly accepts ERC721 tokens. /// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC721.sol) abstract contract ERC721TokenReceiver { function onERC721Received( address, address, uint256, bytes calldata ) external virtual returns (bytes4) { return ERC721TokenReceiver.onERC721Received.selector; } }
// 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.0; pragma experimental ABIEncoderV2; // solhint-disable avoid-low-level-calls // solhint-disable no-inline-assembly // WARNING!!! // Combining BoringBatchable with msg.value can cause double spending issues // https://www.paradigm.xyz/2021/08/two-rights-might-make-a-wrong/ import "./interfaces/IERC20.sol"; contract BaseBoringBatchable { error BatchError(bytes innerError); /// @dev Helper function to extract a useful revert message from a failed call. /// If the returned data is malformed or not correctly abi encoded then this call can fail itself. function _getRevertMsg(bytes memory _returnData) internal pure{ // If the _res length is less than 68, then // the transaction failed with custom error or silently (without a revert message) if (_returnData.length < 68) revert BatchError(_returnData); assembly { // Slice the sighash. _returnData := add(_returnData, 0x04) } revert(abi.decode(_returnData, (string))); // All that remains is the revert string } /// @notice Allows batched call to self (this contract). /// @param calls An array of inputs for each call. /// @param revertOnFail If True then reverts after a failed call and stops doing further calls. // F1: External is ok here because this is the batch function, adding it to a batch makes no sense // F2: Calls in the batch may be payable, delegatecall operates in the same context, so each call in the batch has access to msg.value // C3: The length of the loop is fully under user control, so can't be exploited // C7: Delegatecall is only used on the same contract, so it's safe function batch(bytes[] calldata calls, bool revertOnFail) external payable { for (uint256 i = 0; i < calls.length; i++) { (bool success, bytes memory result) = address(this).delegatecall(calls[i]); if (!success && revertOnFail) { _getRevertMsg(result); } } } } contract BoringBatchable is BaseBoringBatchable { /// @notice Call wrapper that performs `ERC20.permit` on `token`. /// Lookup `IERC20.permit`. // F6: Parameters can be used front-run the permit and the user's permit will fail (due to nonce or other revert) // if part of a batch this could be used to grief once as the second call would not need the permit function permitToken( IERC20 token, address from, address to, uint256 amount, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) public { token.permit(from, to, amount, deadline, v, r, s); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; interface IERC20 { // transfer and tranferFrom have been removed, because they don't work on all tokens (some aren't ERC20 complaint). // By removing them you can't accidentally use them. // name, symbol and decimals have been removed, because they are optional and sometimes wrongly implemented (MKR). // Use BoringERC20 with `using BoringERC20 for IERC20` and call `safeTransfer`, `safeTransferFrom`, etc instead. function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); /// @notice EIP 2612 function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; } interface IStrictERC20 { // This is the strict ERC20 interface. Don't use this, certainly not if you don't control the ERC20 token you're calling. function name() external view returns (string memory); function symbol() external view returns (string memory); function decimals() external view returns (uint8); function totalSupply() external view returns (uint256); function balanceOf(address _owner) external view returns (uint256 balance); function transfer(address _to, uint256 _value) external returns (bool success); function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); function approve(address _spender, uint256 _value) external returns (bool success); function allowance(address _owner, address _spender) external view returns (uint256 remaining); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); /// @notice EIP 2612 function permit( address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s ) external; }
{ "remappings": [ "ds-test/=lib/solmate/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":[],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"bytes","name":"innerError","type":"bytes"}],"name":"BatchError","type":"error"},{"inputs":[],"name":"FUTURE_TIMESTAMP","type":"error"},{"inputs":[],"name":"INVALID_TIMESTAMP","type":"error"},{"inputs":[],"name":"INVALID_TOKEN","type":"error"},{"inputs":[],"name":"MAX_PRICE","type":"error"},{"inputs":[],"name":"NOT_ORACLE","type":"error"},{"inputs":[],"name":"NOT_OWNER","type":"error"},{"inputs":[],"name":"STREAM_ACTIVE","type":"error"},{"inputs":[],"name":"STREAM_DOES_NOT_EXIST","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"BurnStream","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"}],"name":"CancelTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newOracle","type":"address"}],"name":"ChangeOracle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint160","name":"usdAmount","type":"uint160"},{"indexed":false,"internalType":"uint32","name":"starts","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"ends","type":"uint32"},{"indexed":false,"internalType":"uint32","name":"frequency","type":"uint32"}],"name":"ScheduleTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"newMaxprice","type":"uint256"}],"name":"SetMaxPrice","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"caller","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"address","name":"redirectTo","type":"address"}],"name":"SetRedirect","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"owed","type":"uint256"},{"indexed":false,"internalType":"uint160","name":"usdAmount","type":"uint160"},{"indexed":false,"internalType":"uint256","name":"price","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"timestamp","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"lastPaid","type":"uint256"}],"name":"Withdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WithdrawPayer","type":"event"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"approve","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes[]","name":"calls","type":"bytes[]"},{"internalType":"bool","name":"revertOnFail","type":"bool"}],"name":"batch","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"burnStream","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"cancelTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOracle","type":"address"}],"name":"changeOracle","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getApproved","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"maxPrice","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"nextTokenId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"oracle","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"id","type":"uint256"}],"name":"ownerOf","outputs":[{"internalType":"address","name":"owner","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"payments","outputs":[{"internalType":"uint32","name":"lastPaid","type":"uint32"},{"internalType":"uint32","name":"ends","type":"uint32"},{"internalType":"uint32","name":"frequency","type":"uint32"},{"internalType":"uint160","name":"usdAmount","type":"uint160"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","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":"permitToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"redirects","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_to","type":"address"},{"internalType":"uint160","name":"_usdAmount","type":"uint160"},{"internalType":"uint32","name":"_starts","type":"uint32"},{"internalType":"uint32","name":"_ends","type":"uint32"},{"internalType":"uint32","name":"_frequency","type":"uint32"}],"name":"scheduleTransfer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"newMaxPrice","type":"uint256"}],"name":"setMaxPrice","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"},{"internalType":"address","name":"_redirectTo","type":"address"}],"name":"setRedirect","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"token","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_id","type":"uint256"}],"name":"tokenURI","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"transferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_price","type":"uint256"},{"internalType":"uint256","name":"_timestamp","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"},{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdrawPayer","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
60806040523480156200001157600080fd5b506040518060400160405280601e81526020017f4c6c616d61506179205632205363686564756c6564205472616e736665720000815250604051806040016040528060088152602001674c4c414d4150415960c01b81525081600090816200007a919062000340565b50600162000089828262000340565b505050336001600160a01b0316637dc0d1d06040518163ffffffff1660e01b8152600401602060405180830381865afa158015620000cb573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000f191906200040c565b600660006101000a8154816001600160a01b0302191690836001600160a01b03160217905550336001600160a01b0316638da5cb5b6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000156573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200017c91906200040c565b600760006101000a8154816001600160a01b0302191690836001600160a01b03160217905550336001600160a01b031663fc0c546a6040518163ffffffff1660e01b8152600401602060405180830381865afa158015620001e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020791906200040c565b600860006101000a8154816001600160a01b0302191690836001600160a01b03160217905550336001600160a01b031663e38d6b5c6040518163ffffffff1660e01b8152600401602060405180830381865afa1580156200026c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029291906200043e565b600a5562000458565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620002c657607f821691505b602082108103620002e757634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200033b57600081815260208120601f850160051c81016020861015620003165750805b601f850160051c820191505b81811015620003375782815560010162000322565b5050505b505050565b81516001600160401b038111156200035c576200035c6200029b565b62000374816200036d8454620002b1565b84620002ed565b602080601f831160018114620003ac5760008415620003935750858301515b600019600386901b1c1916600185901b17855562000337565b600085815260208120601f198616915b82811015620003dd57888601518255948401946001909101908401620003bc565b5085821015620003fc5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602082840312156200041f57600080fd5b81516001600160a01b03811681146200043757600080fd5b9392505050565b6000602082840312156200045157600080fd5b5051919050565b61253880620004686000396000f3fe6080604052600436106101d85760003560e01c806387d8178911610102578063d90839dc11610095578063f0d495b511610064578063f0d495b5146105e6578063f43952e314610606578063f663b90214610626578063fc0c546a1461066757600080fd5b8063d90839dc14610555578063e3147f6414610575578063e38d6b5c14610595578063e985e9c5146105ab57600080fd5b8063b8404caf116100d1578063b8404caf146104e2578063b88d4fde14610502578063c87b56dd14610522578063d2423b511461054257600080fd5b806387d81789146103fd5780638da5cb5b1461048d57806395d89b41146104ad578063a22cb465146104c257600080fd5b806359caecb51161017a57806375794a3c1161014957806375794a3c146103875780637878ef501461039d5780637c516e94146103bd5780637dc0d1d0146103dd57600080fd5b806359caecb5146103045780636352211e146103245780636c0360eb1461034457806370a082311461035957600080fd5b8063095ea7b3116101b6578063095ea7b31461028257806323b872dd146102a457806342842e0e146102c457806347c421b5146102e457600080fd5b806301ffc9a7146101dd57806306fdde0314610212578063081812fc14610234575b600080fd5b3480156101e957600080fd5b506101fd6101f8366004611d4c565b610687565b60405190151581526020015b60405180910390f35b34801561021e57600080fd5b506102276106d9565b6040516102099190611db9565b34801561024057600080fd5b5061026a61024f366004611dcc565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610209565b34801561028e57600080fd5b506102a261029d366004611dfa565b610767565b005b3480156102b057600080fd5b506102a26102bf366004611e26565b61084e565b3480156102d057600080fd5b506102a26102df366004611e26565b610a15565b3480156102f057600080fd5b506102a26102ff366004611e67565b610aea565b34801561031057600080fd5b506102a261031f366004611dcc565b610b6a565b34801561033057600080fd5b5061026a61033f366004611dcc565b610c24565b34801561035057600080fd5b50610227610c7b565b34801561036557600080fd5b50610379610374366004611e67565b610c97565b604051908152602001610209565b34801561039357600080fd5b5061037960095481565b3480156103a957600080fd5b506102a26103b8366004611ed0565b610cfa565b3480156103c957600080fd5b506102a26103d8366004611f37565b610dd9565b3480156103e957600080fd5b5060065461026a906001600160a01b031681565b34801561040957600080fd5b50610457610418366004611dcc565b600b6020526000908152604090205463ffffffff808216916401000000008104821691600160401b82041690600160601b90046001600160a01b031684565b6040805163ffffffff9586168152938516602085015291909316908201526001600160a01b039091166060820152608001610209565b34801561049957600080fd5b5060075461026a906001600160a01b031681565b3480156104b957600080fd5b50610227610e6b565b3480156104ce57600080fd5b506102a26104dd366004611fd0565b610e78565b3480156104ee57600080fd5b506102a26104fd366004611dfa565b610ee4565b34801561050e57600080fd5b506102a261051d366004612005565b610f70565b34801561052e57600080fd5b5061022761053d366004611dcc565b611035565b6102a26105503660046120a4565b6110c8565b34801561056157600080fd5b506102a261057036600461210c565b611182565b34801561058157600080fd5b506102a2610590366004612175565b6112cb565b3480156105a157600080fd5b50610379600a5481565b3480156105b757600080fd5b506101fd6105c63660046121a5565b600560209081526000928352604080842090915290825290205460ff1681565b3480156105f257600080fd5b506102a2610601366004611dcc565b611375565b34801561061257600080fd5b506102a2610621366004611dcc565b611448565b34801561063257600080fd5b5061026a610641366004611dfa565b600c6020908152600092835260408084209091529082529020546001600160a01b031681565b34801561067357600080fd5b5060085461026a906001600160a01b031681565b60006301ffc9a760e01b6001600160e01b0319831614806106b857506380ac58cd60e01b6001600160e01b03198316145b806106d35750635b5e139f60e01b6001600160e01b03198316145b92915050565b600080546106e6906121d3565b80601f0160208091040260200160405190810160405280929190818152602001828054610712906121d3565b801561075f5780601f106107345761010080835404028352916020019161075f565b820191906000526020600020905b81548152906001019060200180831161074257829003601f168201915b505050505081565b6000818152600260205260409020546001600160a01b0316338114806107b057506001600160a01b038116600090815260056020908152604080832033845290915290205460ff165b6107f25760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b60448201526064015b60405180910390fd5b60008281526004602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000818152600260205260409020546001600160a01b038481169116146108a45760405162461bcd60e51b815260206004820152600a60248201526957524f4e475f46524f4d60b01b60448201526064016107e9565b6001600160a01b0382166108ee5760405162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b60448201526064016107e9565b336001600160a01b038416148061092857506001600160a01b038316600090815260056020908152604080832033845290915290205460ff165b8061094957506000818152600460205260409020546001600160a01b031633145b6109865760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b60448201526064016107e9565b6001600160a01b0380841660008181526003602090815260408083208054600019019055938616808352848320805460010190558583526002825284832080546001600160a01b03199081168317909155600490925284832080549092169091559251849392917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b610a2083838361084e565b6001600160a01b0382163b1580610ac95750604051630a85bd0160e11b8082523360048301526001600160a01b03858116602484015260448301849052608060648401526000608484015290919084169063150b7a029060a4016020604051808303816000875af1158015610a99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abd919061220d565b6001600160e01b031916145b610ae55760405162461bcd60e51b81526004016107e99061222a565b505050565b6007546001600160a01b03163314610b15576040516338ebc58960e11b815260040160405180910390fd5b600680546001600160a01b0319166001600160a01b0383169081179091556040519081527fc3977c9522c218453912bcab15964a7788968fbf3fe4d4e2965252c9f07055de906020015b60405180910390a150565b6007546001600160a01b03163314610b95576040516338ebc58960e11b815260040160405180910390fd5b6000610ba082610c24565b6001600160a01b031603610bc75760405163f87acb5d60e01b815260040160405180910390fd5b6000818152600b6020908152604091829020805467ffffffff0000000019166401000000004263ffffffff160217905590518281527fa271de2571fbdff17aad713a13ffc0fcc3fbb53d9f66ba75dba4747350c2ac559101610b5f565b6000818152600260205260409020546001600160a01b031680610c765760405162461bcd60e51b815260206004820152600a6024820152691393d517d3525395115160b21b60448201526064016107e9565b919050565b6040518060600160405280602281526020016124e16022913981565b60006001600160a01b038216610cde5760405162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b60448201526064016107e9565b506001600160a01b031660009081526003602052604090205490565b42811115610d1b5760405163a1c9e64760e01b815260040160405180910390fd5b6006546001600160a01b03163314610d46576040516323e519cd60e11b815260040160405180910390fd5b600a54821115610d685760405162e08ecb60e11b815260040160405180910390fd5b6008546001600160a01b03848116911614610d965760405163684cae7960e11b815260040160405180910390fd5b6000845b80821015610dd057610dc5878784818110610db757610db7612254565b9050602002013585856114a8565b600190910190610d9a565b50505050505050565b60405163d505accf60e01b81526001600160a01b0388811660048301528781166024830152604482018790526064820186905260ff8516608483015260a4820184905260c4820183905289169063d505accf9060e401600060405180830381600087803b158015610e4957600080fd5b505af1158015610e5d573d6000803e3d6000fd5b505050505050505050505050565b600180546106e6906121d3565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6007546001600160a01b03163314610f0f576040516338ebc58960e11b815260040160405180910390fd5b600754610f29906001600160a01b038481169116836116ad565b604080516001600160a01b0384168152602081018390527fbf8c30a383c759c6c979903ba89ffb82c5de9410c2c97eba5d6875e190f70c6a91015b60405180910390a15050565b610f7b85858561084e565b6001600160a01b0384163b15806110125750604051630a85bd0160e11b808252906001600160a01b0386169063150b7a0290610fc39033908a9089908990899060040161226a565b6020604051808303816000875af1158015610fe2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611006919061220d565b6001600160e01b031916145b61102e5760405162461bcd60e51b81526004016107e99061222a565b5050505050565b6060600061104283610c24565b6001600160a01b0316036110695760405163f87acb5d60e01b815260040160405180910390fd5b6040518060600160405280602281526020016124e16022913961108b46611725565b6110963060146117b8565b61109f85611725565b6040516020016110b294939291906122be565b6040516020818303038152906040529050919050565b60005b8281101561117c57600080308686858181106110e9576110e9612254565b90506020028101906110fb919061232d565b604051611109929190612374565b600060405180830381855af49150503d8060008114611144576040519150601f19603f3d011682016040523d82523d6000602084013e611149565b606091505b5091509150811580156111595750835b15611167576111678161195b565b505080806111749061239a565b9150506110cb565b50505050565b6007546001600160a01b031633146111ad576040516338ebc58960e11b815260040160405180910390fd5b6009546111ba86826119b3565b604080516080808201835263ffffffff87811680845287821660208086018281528985168789018181526001600160a01b038f81166060808c0182815260008f8152600b89528e90209c518d549751955191518516600160601b026bffffffffffffffffffffffff928d16600160401b029290921667ffffffffffffffff968d166401000000000267ffffffffffffffff1990991691909c16179690961793909316989098179390931790985560098054600101905588518a8152918f169282019290925296870193909352938501529083019190915260a08201527f17abb8b30249e64cf15af372d4045b5ad5821be333df9e492a4d9adbe8bf88899060c00160405180910390a1505050505050565b6112d482610c24565b6001600160a01b0316336001600160a01b031614611305576040516338ebc58960e11b815260040160405180910390fd5b336000818152600c6020908152604080832086845282529182902080546001600160a01b0319166001600160a01b0386169081179091558251938452908301859052908201527ffe27b7e202af320a770c4d3df23f548786e72af3da301589dcb5feae0304a87790606001610f64565b3361137f82610c24565b6001600160a01b0316146113a6576040516338ebc58960e11b815260040160405180910390fd5b6000818152600b60205260409020544264010000000090910463ffffffff161015806113f157506000818152600b6020526040902054640100000000810463ffffffff908116911614155b1561140f576040516339b176f760e01b815260040160405180910390fd5b61141881611a83565b6040518181527f275b31cf07b5c0996c4fbe3391320471dc5e91290c0127584109b7c3b53f5eb890602001610b5f565b6007546001600160a01b03163314611473576040516338ebc58960e11b815260040160405180910390fd5b600a8190556040518181527fbf11d87622a7ec8391bc962ac60d31b9e0031fad0ea0480d37015703b0f9ad0390602001610b5f565b6000838152600b60205260408120906114c085610c24565b6001600160a01b0316036114e75760405163f87acb5d60e01b815260040160405180910390fd5b8054640100000000900463ffffffff168211156115175760405163118818d160e01b815260040160405180910390fd5b805463ffffffff808216600160401b90920416018083111561154c5760405163118818d160e01b815260040160405180910390fd5b815460009085906001600160a01b03600160601b820416906115749063ffffffff16876123b3565b61157e91906123c6565b61158891906123c6565b8354909150600160401b900463ffffffff16670de0b6b3a76400000281816115b2576115b26123dd565b6000888152600b60205260408120805463ffffffff191663ffffffff89161790559190049150806115e288610c24565b6001600160a01b038082166000908152600c602090815260408083208d845290915290205491925016806116185781925061161c565b8092505b600854611633906001600160a01b031684866116ad565b8554604080518b81526001600160a01b038087166020830152918101879052600160601b9092041660608201526080810189905260a0810188905260c081018890527ff0b35aad7f9e51c31de895fb89bed098dd12c5f3e25b6582d8c9ed598cb813079060e00160405180910390a1505050505050505050565b600060405163a9059cbb60e01b8152836004820152826024820152602060006044836000895af13d15601f3d116001600051141617169150508061117c5760405162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b60448201526064016107e9565b6060600061173283611b50565b600101905060008167ffffffffffffffff811115611752576117526123f3565b6040519080825280601f01601f19166020018201604052801561177c576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461178657509392505050565b606060006117c78360026123c6565b6117d2906002612409565b67ffffffffffffffff8111156117ea576117ea6123f3565b6040519080825280601f01601f191660200182016040528015611814576020820181803683370190505b509050600360fc1b8160008151811061182f5761182f612254565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061185e5761185e612254565b60200101906001600160f81b031916908160001a90535060006118828460026123c6565b61188d906001612409565b90505b6001811115611905576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106118c1576118c1612254565b1a60f81b8282815181106118d7576118d7612254565b60200101906001600160f81b031916908160001a90535060049490941c936118fe8161241c565b9050611890565b5083156119545760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016107e9565b9392505050565b604481511015611980578060405163d935448560e01b81526004016107e99190611db9565b6004810190508080602001905181019061199a9190612433565b60405162461bcd60e51b81526004016107e99190611db9565b6119bd8282611c28565b6001600160a01b0382163b1580611a635750604051630a85bd0160e11b80825233600483015260006024830181905260448301849052608060648401526084830152906001600160a01b0384169063150b7a029060a4016020604051808303816000875af1158015611a33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a57919061220d565b6001600160e01b031916145b611a7f5760405162461bcd60e51b81526004016107e99061222a565b5050565b6000818152600260205260409020546001600160a01b031680611ad55760405162461bcd60e51b815260206004820152600a6024820152691393d517d3525395115160b21b60448201526064016107e9565b6001600160a01b038116600081815260036020908152604080832080546000190190558583526002825280832080546001600160a01b031990811690915560049092528083208054909216909155518492907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310611b8f5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611bbb576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611bd957662386f26fc10000830492506010015b6305f5e1008310611bf1576305f5e100830492506008015b6127108310611c0557612710830492506004015b60648310611c17576064830492506002015b600a83106106d35760010192915050565b6001600160a01b038216611c725760405162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b60448201526064016107e9565b6000818152600260205260409020546001600160a01b031615611cc85760405162461bcd60e51b815260206004820152600e60248201526d1053149150511657d3525395115160921b60448201526064016107e9565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160e01b031981168114611d4957600080fd5b50565b600060208284031215611d5e57600080fd5b813561195481611d33565b60005b83811015611d84578181015183820152602001611d6c565b50506000910152565b60008151808452611da5816020860160208601611d69565b601f01601f19169290920160200192915050565b6020815260006119546020830184611d8d565b600060208284031215611dde57600080fd5b5035919050565b6001600160a01b0381168114611d4957600080fd5b60008060408385031215611e0d57600080fd5b8235611e1881611de5565b946020939093013593505050565b600080600060608486031215611e3b57600080fd5b8335611e4681611de5565b92506020840135611e5681611de5565b929592945050506040919091013590565b600060208284031215611e7957600080fd5b813561195481611de5565b60008083601f840112611e9657600080fd5b50813567ffffffffffffffff811115611eae57600080fd5b6020830191508360208260051b8501011115611ec957600080fd5b9250929050565b600080600080600060808688031215611ee857600080fd5b853567ffffffffffffffff811115611eff57600080fd5b611f0b88828901611e84565b9096509450506020860135611f1f81611de5565b94979396509394604081013594506060013592915050565b600080600080600080600080610100898b031215611f5457600080fd5b8835611f5f81611de5565b97506020890135611f6f81611de5565b96506040890135611f7f81611de5565b9550606089013594506080890135935060a089013560ff81168114611fa357600080fd5b979a969950949793969295929450505060c08201359160e0013590565b80358015158114610c7657600080fd5b60008060408385031215611fe357600080fd5b8235611fee81611de5565b9150611ffc60208401611fc0565b90509250929050565b60008060008060006080868803121561201d57600080fd5b853561202881611de5565b9450602086013561203881611de5565b935060408601359250606086013567ffffffffffffffff8082111561205c57600080fd5b818801915088601f83011261207057600080fd5b81358181111561207f57600080fd5b89602082850101111561209157600080fd5b9699959850939650602001949392505050565b6000806000604084860312156120b957600080fd5b833567ffffffffffffffff8111156120d057600080fd5b6120dc86828701611e84565b90945092506120ef905060208501611fc0565b90509250925092565b803563ffffffff81168114610c7657600080fd5b600080600080600060a0868803121561212457600080fd5b853561212f81611de5565b9450602086013561213f81611de5565b935061214d604087016120f8565b925061215b606087016120f8565b9150612169608087016120f8565b90509295509295909350565b6000806040838503121561218857600080fd5b82359150602083013561219a81611de5565b809150509250929050565b600080604083850312156121b857600080fd5b82356121c381611de5565b9150602083013561219a81611de5565b600181811c908216806121e757607f821691505b60208210810361220757634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561221f57600080fd5b815161195481611d33565b60208082526010908201526f155394d0519157d49150d2541251539560821b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038681168252851660208201526040810184905260806060820181905281018290526000828460a0840137600060a0848401015260a0601f19601f85011683010190509695505050505050565b600085516122d0818460208a01611d69565b8551908301906122e4818360208a01611d69565b602f60f81b91018181528551909190612304816001850160208a01611d69565b6001920191820152835161231f816002840160208801611d69565b016002019695505050505050565b6000808335601e1984360301811261234457600080fd5b83018035915067ffffffffffffffff82111561235f57600080fd5b602001915036819003821315611ec957600080fd5b8183823760009101908152919050565b634e487b7160e01b600052601160045260246000fd5b6000600182016123ac576123ac612384565b5060010190565b818103818111156106d3576106d3612384565b80820281158282048414176106d3576106d3612384565b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b808201808211156106d3576106d3612384565b60008161242b5761242b612384565b506000190190565b60006020828403121561244557600080fd5b815167ffffffffffffffff8082111561245d57600080fd5b818401915084601f83011261247157600080fd5b815181811115612483576124836123f3565b604051601f8201601f19908116603f011681019083821181831017156124ab576124ab6123f3565b816040528281528760208487010111156124c457600080fd5b6124d5836020830160208801611d69565b97965050505050505056fe68747470733a2f2f6e66742e6c6c616d617061792e696f2f7363686564756c65642fa264697066735822122050a9e7826098b4f9296310bc668dcc06b891908032fabe1214ee9f3362ead3ef64736f6c63430008110033
Deployed Bytecode
0x6080604052600436106101d85760003560e01c806387d8178911610102578063d90839dc11610095578063f0d495b511610064578063f0d495b5146105e6578063f43952e314610606578063f663b90214610626578063fc0c546a1461066757600080fd5b8063d90839dc14610555578063e3147f6414610575578063e38d6b5c14610595578063e985e9c5146105ab57600080fd5b8063b8404caf116100d1578063b8404caf146104e2578063b88d4fde14610502578063c87b56dd14610522578063d2423b511461054257600080fd5b806387d81789146103fd5780638da5cb5b1461048d57806395d89b41146104ad578063a22cb465146104c257600080fd5b806359caecb51161017a57806375794a3c1161014957806375794a3c146103875780637878ef501461039d5780637c516e94146103bd5780637dc0d1d0146103dd57600080fd5b806359caecb5146103045780636352211e146103245780636c0360eb1461034457806370a082311461035957600080fd5b8063095ea7b3116101b6578063095ea7b31461028257806323b872dd146102a457806342842e0e146102c457806347c421b5146102e457600080fd5b806301ffc9a7146101dd57806306fdde0314610212578063081812fc14610234575b600080fd5b3480156101e957600080fd5b506101fd6101f8366004611d4c565b610687565b60405190151581526020015b60405180910390f35b34801561021e57600080fd5b506102276106d9565b6040516102099190611db9565b34801561024057600080fd5b5061026a61024f366004611dcc565b6004602052600090815260409020546001600160a01b031681565b6040516001600160a01b039091168152602001610209565b34801561028e57600080fd5b506102a261029d366004611dfa565b610767565b005b3480156102b057600080fd5b506102a26102bf366004611e26565b61084e565b3480156102d057600080fd5b506102a26102df366004611e26565b610a15565b3480156102f057600080fd5b506102a26102ff366004611e67565b610aea565b34801561031057600080fd5b506102a261031f366004611dcc565b610b6a565b34801561033057600080fd5b5061026a61033f366004611dcc565b610c24565b34801561035057600080fd5b50610227610c7b565b34801561036557600080fd5b50610379610374366004611e67565b610c97565b604051908152602001610209565b34801561039357600080fd5b5061037960095481565b3480156103a957600080fd5b506102a26103b8366004611ed0565b610cfa565b3480156103c957600080fd5b506102a26103d8366004611f37565b610dd9565b3480156103e957600080fd5b5060065461026a906001600160a01b031681565b34801561040957600080fd5b50610457610418366004611dcc565b600b6020526000908152604090205463ffffffff808216916401000000008104821691600160401b82041690600160601b90046001600160a01b031684565b6040805163ffffffff9586168152938516602085015291909316908201526001600160a01b039091166060820152608001610209565b34801561049957600080fd5b5060075461026a906001600160a01b031681565b3480156104b957600080fd5b50610227610e6b565b3480156104ce57600080fd5b506102a26104dd366004611fd0565b610e78565b3480156104ee57600080fd5b506102a26104fd366004611dfa565b610ee4565b34801561050e57600080fd5b506102a261051d366004612005565b610f70565b34801561052e57600080fd5b5061022761053d366004611dcc565b611035565b6102a26105503660046120a4565b6110c8565b34801561056157600080fd5b506102a261057036600461210c565b611182565b34801561058157600080fd5b506102a2610590366004612175565b6112cb565b3480156105a157600080fd5b50610379600a5481565b3480156105b757600080fd5b506101fd6105c63660046121a5565b600560209081526000928352604080842090915290825290205460ff1681565b3480156105f257600080fd5b506102a2610601366004611dcc565b611375565b34801561061257600080fd5b506102a2610621366004611dcc565b611448565b34801561063257600080fd5b5061026a610641366004611dfa565b600c6020908152600092835260408084209091529082529020546001600160a01b031681565b34801561067357600080fd5b5060085461026a906001600160a01b031681565b60006301ffc9a760e01b6001600160e01b0319831614806106b857506380ac58cd60e01b6001600160e01b03198316145b806106d35750635b5e139f60e01b6001600160e01b03198316145b92915050565b600080546106e6906121d3565b80601f0160208091040260200160405190810160405280929190818152602001828054610712906121d3565b801561075f5780601f106107345761010080835404028352916020019161075f565b820191906000526020600020905b81548152906001019060200180831161074257829003601f168201915b505050505081565b6000818152600260205260409020546001600160a01b0316338114806107b057506001600160a01b038116600090815260056020908152604080832033845290915290205460ff165b6107f25760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b60448201526064015b60405180910390fd5b60008281526004602052604080822080546001600160a01b0319166001600160a01b0387811691821790925591518593918516917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92591a4505050565b6000818152600260205260409020546001600160a01b038481169116146108a45760405162461bcd60e51b815260206004820152600a60248201526957524f4e475f46524f4d60b01b60448201526064016107e9565b6001600160a01b0382166108ee5760405162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b60448201526064016107e9565b336001600160a01b038416148061092857506001600160a01b038316600090815260056020908152604080832033845290915290205460ff165b8061094957506000818152600460205260409020546001600160a01b031633145b6109865760405162461bcd60e51b815260206004820152600e60248201526d1393d517d055551213d49256915160921b60448201526064016107e9565b6001600160a01b0380841660008181526003602090815260408083208054600019019055938616808352848320805460010190558583526002825284832080546001600160a01b03199081168317909155600490925284832080549092169091559251849392917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b610a2083838361084e565b6001600160a01b0382163b1580610ac95750604051630a85bd0160e11b8082523360048301526001600160a01b03858116602484015260448301849052608060648401526000608484015290919084169063150b7a029060a4016020604051808303816000875af1158015610a99573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610abd919061220d565b6001600160e01b031916145b610ae55760405162461bcd60e51b81526004016107e99061222a565b505050565b6007546001600160a01b03163314610b15576040516338ebc58960e11b815260040160405180910390fd5b600680546001600160a01b0319166001600160a01b0383169081179091556040519081527fc3977c9522c218453912bcab15964a7788968fbf3fe4d4e2965252c9f07055de906020015b60405180910390a150565b6007546001600160a01b03163314610b95576040516338ebc58960e11b815260040160405180910390fd5b6000610ba082610c24565b6001600160a01b031603610bc75760405163f87acb5d60e01b815260040160405180910390fd5b6000818152600b6020908152604091829020805467ffffffff0000000019166401000000004263ffffffff160217905590518281527fa271de2571fbdff17aad713a13ffc0fcc3fbb53d9f66ba75dba4747350c2ac559101610b5f565b6000818152600260205260409020546001600160a01b031680610c765760405162461bcd60e51b815260206004820152600a6024820152691393d517d3525395115160b21b60448201526064016107e9565b919050565b6040518060600160405280602281526020016124e16022913981565b60006001600160a01b038216610cde5760405162461bcd60e51b815260206004820152600c60248201526b5a45524f5f4144445245535360a01b60448201526064016107e9565b506001600160a01b031660009081526003602052604090205490565b42811115610d1b5760405163a1c9e64760e01b815260040160405180910390fd5b6006546001600160a01b03163314610d46576040516323e519cd60e11b815260040160405180910390fd5b600a54821115610d685760405162e08ecb60e11b815260040160405180910390fd5b6008546001600160a01b03848116911614610d965760405163684cae7960e11b815260040160405180910390fd5b6000845b80821015610dd057610dc5878784818110610db757610db7612254565b9050602002013585856114a8565b600190910190610d9a565b50505050505050565b60405163d505accf60e01b81526001600160a01b0388811660048301528781166024830152604482018790526064820186905260ff8516608483015260a4820184905260c4820183905289169063d505accf9060e401600060405180830381600087803b158015610e4957600080fd5b505af1158015610e5d573d6000803e3d6000fd5b505050505050505050505050565b600180546106e6906121d3565b3360008181526005602090815260408083206001600160a01b03871680855290835292819020805460ff191686151590811790915590519081529192917f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a35050565b6007546001600160a01b03163314610f0f576040516338ebc58960e11b815260040160405180910390fd5b600754610f29906001600160a01b038481169116836116ad565b604080516001600160a01b0384168152602081018390527fbf8c30a383c759c6c979903ba89ffb82c5de9410c2c97eba5d6875e190f70c6a91015b60405180910390a15050565b610f7b85858561084e565b6001600160a01b0384163b15806110125750604051630a85bd0160e11b808252906001600160a01b0386169063150b7a0290610fc39033908a9089908990899060040161226a565b6020604051808303816000875af1158015610fe2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611006919061220d565b6001600160e01b031916145b61102e5760405162461bcd60e51b81526004016107e99061222a565b5050505050565b6060600061104283610c24565b6001600160a01b0316036110695760405163f87acb5d60e01b815260040160405180910390fd5b6040518060600160405280602281526020016124e16022913961108b46611725565b6110963060146117b8565b61109f85611725565b6040516020016110b294939291906122be565b6040516020818303038152906040529050919050565b60005b8281101561117c57600080308686858181106110e9576110e9612254565b90506020028101906110fb919061232d565b604051611109929190612374565b600060405180830381855af49150503d8060008114611144576040519150601f19603f3d011682016040523d82523d6000602084013e611149565b606091505b5091509150811580156111595750835b15611167576111678161195b565b505080806111749061239a565b9150506110cb565b50505050565b6007546001600160a01b031633146111ad576040516338ebc58960e11b815260040160405180910390fd5b6009546111ba86826119b3565b604080516080808201835263ffffffff87811680845287821660208086018281528985168789018181526001600160a01b038f81166060808c0182815260008f8152600b89528e90209c518d549751955191518516600160601b026bffffffffffffffffffffffff928d16600160401b029290921667ffffffffffffffff968d166401000000000267ffffffffffffffff1990991691909c16179690961793909316989098179390931790985560098054600101905588518a8152918f169282019290925296870193909352938501529083019190915260a08201527f17abb8b30249e64cf15af372d4045b5ad5821be333df9e492a4d9adbe8bf88899060c00160405180910390a1505050505050565b6112d482610c24565b6001600160a01b0316336001600160a01b031614611305576040516338ebc58960e11b815260040160405180910390fd5b336000818152600c6020908152604080832086845282529182902080546001600160a01b0319166001600160a01b0386169081179091558251938452908301859052908201527ffe27b7e202af320a770c4d3df23f548786e72af3da301589dcb5feae0304a87790606001610f64565b3361137f82610c24565b6001600160a01b0316146113a6576040516338ebc58960e11b815260040160405180910390fd5b6000818152600b60205260409020544264010000000090910463ffffffff161015806113f157506000818152600b6020526040902054640100000000810463ffffffff908116911614155b1561140f576040516339b176f760e01b815260040160405180910390fd5b61141881611a83565b6040518181527f275b31cf07b5c0996c4fbe3391320471dc5e91290c0127584109b7c3b53f5eb890602001610b5f565b6007546001600160a01b03163314611473576040516338ebc58960e11b815260040160405180910390fd5b600a8190556040518181527fbf11d87622a7ec8391bc962ac60d31b9e0031fad0ea0480d37015703b0f9ad0390602001610b5f565b6000838152600b60205260408120906114c085610c24565b6001600160a01b0316036114e75760405163f87acb5d60e01b815260040160405180910390fd5b8054640100000000900463ffffffff168211156115175760405163118818d160e01b815260040160405180910390fd5b805463ffffffff808216600160401b90920416018083111561154c5760405163118818d160e01b815260040160405180910390fd5b815460009085906001600160a01b03600160601b820416906115749063ffffffff16876123b3565b61157e91906123c6565b61158891906123c6565b8354909150600160401b900463ffffffff16670de0b6b3a76400000281816115b2576115b26123dd565b6000888152600b60205260408120805463ffffffff191663ffffffff89161790559190049150806115e288610c24565b6001600160a01b038082166000908152600c602090815260408083208d845290915290205491925016806116185781925061161c565b8092505b600854611633906001600160a01b031684866116ad565b8554604080518b81526001600160a01b038087166020830152918101879052600160601b9092041660608201526080810189905260a0810188905260c081018890527ff0b35aad7f9e51c31de895fb89bed098dd12c5f3e25b6582d8c9ed598cb813079060e00160405180910390a1505050505050505050565b600060405163a9059cbb60e01b8152836004820152826024820152602060006044836000895af13d15601f3d116001600051141617169150508061117c5760405162461bcd60e51b815260206004820152600f60248201526e1514905394d1915497d19052531151608a1b60448201526064016107e9565b6060600061173283611b50565b600101905060008167ffffffffffffffff811115611752576117526123f3565b6040519080825280601f01601f19166020018201604052801561177c576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461178657509392505050565b606060006117c78360026123c6565b6117d2906002612409565b67ffffffffffffffff8111156117ea576117ea6123f3565b6040519080825280601f01601f191660200182016040528015611814576020820181803683370190505b509050600360fc1b8160008151811061182f5761182f612254565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061185e5761185e612254565b60200101906001600160f81b031916908160001a90535060006118828460026123c6565b61188d906001612409565b90505b6001811115611905576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106118c1576118c1612254565b1a60f81b8282815181106118d7576118d7612254565b60200101906001600160f81b031916908160001a90535060049490941c936118fe8161241c565b9050611890565b5083156119545760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016107e9565b9392505050565b604481511015611980578060405163d935448560e01b81526004016107e99190611db9565b6004810190508080602001905181019061199a9190612433565b60405162461bcd60e51b81526004016107e99190611db9565b6119bd8282611c28565b6001600160a01b0382163b1580611a635750604051630a85bd0160e11b80825233600483015260006024830181905260448301849052608060648401526084830152906001600160a01b0384169063150b7a029060a4016020604051808303816000875af1158015611a33573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a57919061220d565b6001600160e01b031916145b611a7f5760405162461bcd60e51b81526004016107e99061222a565b5050565b6000818152600260205260409020546001600160a01b031680611ad55760405162461bcd60e51b815260206004820152600a6024820152691393d517d3525395115160b21b60448201526064016107e9565b6001600160a01b038116600081815260036020908152604080832080546000190190558583526002825280832080546001600160a01b031990811690915560049092528083208054909216909155518492907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310611b8f5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310611bbb576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310611bd957662386f26fc10000830492506010015b6305f5e1008310611bf1576305f5e100830492506008015b6127108310611c0557612710830492506004015b60648310611c17576064830492506002015b600a83106106d35760010192915050565b6001600160a01b038216611c725760405162461bcd60e51b81526020600482015260116024820152701253959053125117d49150d25412515395607a1b60448201526064016107e9565b6000818152600260205260409020546001600160a01b031615611cc85760405162461bcd60e51b815260206004820152600e60248201526d1053149150511657d3525395115160921b60448201526064016107e9565b6001600160a01b038216600081815260036020908152604080832080546001019055848352600290915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b6001600160e01b031981168114611d4957600080fd5b50565b600060208284031215611d5e57600080fd5b813561195481611d33565b60005b83811015611d84578181015183820152602001611d6c565b50506000910152565b60008151808452611da5816020860160208601611d69565b601f01601f19169290920160200192915050565b6020815260006119546020830184611d8d565b600060208284031215611dde57600080fd5b5035919050565b6001600160a01b0381168114611d4957600080fd5b60008060408385031215611e0d57600080fd5b8235611e1881611de5565b946020939093013593505050565b600080600060608486031215611e3b57600080fd5b8335611e4681611de5565b92506020840135611e5681611de5565b929592945050506040919091013590565b600060208284031215611e7957600080fd5b813561195481611de5565b60008083601f840112611e9657600080fd5b50813567ffffffffffffffff811115611eae57600080fd5b6020830191508360208260051b8501011115611ec957600080fd5b9250929050565b600080600080600060808688031215611ee857600080fd5b853567ffffffffffffffff811115611eff57600080fd5b611f0b88828901611e84565b9096509450506020860135611f1f81611de5565b94979396509394604081013594506060013592915050565b600080600080600080600080610100898b031215611f5457600080fd5b8835611f5f81611de5565b97506020890135611f6f81611de5565b96506040890135611f7f81611de5565b9550606089013594506080890135935060a089013560ff81168114611fa357600080fd5b979a969950949793969295929450505060c08201359160e0013590565b80358015158114610c7657600080fd5b60008060408385031215611fe357600080fd5b8235611fee81611de5565b9150611ffc60208401611fc0565b90509250929050565b60008060008060006080868803121561201d57600080fd5b853561202881611de5565b9450602086013561203881611de5565b935060408601359250606086013567ffffffffffffffff8082111561205c57600080fd5b818801915088601f83011261207057600080fd5b81358181111561207f57600080fd5b89602082850101111561209157600080fd5b9699959850939650602001949392505050565b6000806000604084860312156120b957600080fd5b833567ffffffffffffffff8111156120d057600080fd5b6120dc86828701611e84565b90945092506120ef905060208501611fc0565b90509250925092565b803563ffffffff81168114610c7657600080fd5b600080600080600060a0868803121561212457600080fd5b853561212f81611de5565b9450602086013561213f81611de5565b935061214d604087016120f8565b925061215b606087016120f8565b9150612169608087016120f8565b90509295509295909350565b6000806040838503121561218857600080fd5b82359150602083013561219a81611de5565b809150509250929050565b600080604083850312156121b857600080fd5b82356121c381611de5565b9150602083013561219a81611de5565b600181811c908216806121e757607f821691505b60208210810361220757634e487b7160e01b600052602260045260246000fd5b50919050565b60006020828403121561221f57600080fd5b815161195481611d33565b60208082526010908201526f155394d0519157d49150d2541251539560821b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b6001600160a01b038681168252851660208201526040810184905260806060820181905281018290526000828460a0840137600060a0848401015260a0601f19601f85011683010190509695505050505050565b600085516122d0818460208a01611d69565b8551908301906122e4818360208a01611d69565b602f60f81b91018181528551909190612304816001850160208a01611d69565b6001920191820152835161231f816002840160208801611d69565b016002019695505050505050565b6000808335601e1984360301811261234457600080fd5b83018035915067ffffffffffffffff82111561235f57600080fd5b602001915036819003821315611ec957600080fd5b8183823760009101908152919050565b634e487b7160e01b600052601160045260246000fd5b6000600182016123ac576123ac612384565b5060010190565b818103818111156106d3576106d3612384565b80820281158282048414176106d3576106d3612384565b634e487b7160e01b600052601260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b808201808211156106d3576106d3612384565b60008161242b5761242b612384565b506000190190565b60006020828403121561244557600080fd5b815167ffffffffffffffff8082111561245d57600080fd5b818401915084601f83011261247157600080fd5b815181811115612483576124836123f3565b604051601f8201601f19908116603f011681019083821181831017156124ab576124ab6123f3565b816040528281528760208487010111156124c457600080fd5b6124d5836020830160208801611d69565b97965050505050505056fe68747470733a2f2f6e66742e6c6c616d617061792e696f2f7363686564756c65642fa264697066735822122050a9e7826098b4f9296310bc668dcc06b891908032fabe1214ee9f3362ead3ef64736f6c63430008110033
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
Loading...
Loading
[ 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.