Warning! Contract bytecode has been changed and doesn't match the verified one. Therefore, interaction with this smart contract may be risky.
This contract has been partially verified via Sourcify.
View contract in Sourcify repository
- Contract name:
- OKLGSpend
- Optimization enabled
- true
- Compiler version
- v0.8.4+commit.c7e474f2
- Optimization runs
- 200
- EVM Version
- istanbul
- Verified at
- 2026-04-22T16:38:37.931430Z
Constructor Arguments
0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419
Arg [0] (address) : 0x5f4ec3df9cbd43714fe2740f5e3616155c5b8419
contracts/OKLGSpend.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import '@chainlink/contracts/src/v0.8/interfaces/AggregatorV3Interface.sol';
import './interfaces/IOKLGSpend.sol';
import './OKLGWithdrawable.sol';
/**
* @title OKLGSpend
* @dev Logic for spending OKLG on products in the product ecosystem.
*/
contract OKLGSpend is IOKLGSpend, OKLGWithdrawable {
address payable private constant DEAD_WALLET =
payable(0x000000000000000000000000000000000000dEaD);
address payable public paymentWallet =
payable(0x000000000000000000000000000000000000dEaD);
AggregatorV3Interface internal priceFeed;
uint256 public totalSpentWei = 0;
mapping(uint8 => uint256) public defaultProductPriceUSD;
mapping(address => uint256) public overrideProductPriceUSD;
mapping(address => bool) public removeCost;
event Spend(address indexed user, address indexed product, uint256 value);
constructor(address _linkPriceFeedContract) {
// https://docs.chain.link/docs/reference-contracts/
// https://github.com/pcaversaccio/chainlink-price-feed/blob/main/README.md
priceFeed = AggregatorV3Interface(_linkPriceFeedContract);
}
function getProductCostWei(uint256 _productCostUSD)
public
view
returns (uint256)
{
// Creates a USD balance with 18 decimals
uint256 paymentUSD18 = 10**18 * _productCostUSD;
// adding back 18 decimals to get returned value in wei
return (10**18 * paymentUSD18) / getLatestETHPrice();
}
/**
* Returns the latest ETH/USD price with returned value at 18 decimals
* https://docs.chain.link/docs/get-the-latest-price/
*/
function getLatestETHPrice() public view returns (uint256) {
uint8 decimals = priceFeed.decimals();
(, int256 price, , , ) = priceFeed.latestRoundData();
return uint256(price) * (10**18 / 10**decimals);
}
function setPriceFeed(address _feedContract) external onlyOwner {
priceFeed = AggregatorV3Interface(_feedContract);
}
function setPaymentWallet(address _newPaymentWallet) external onlyOwner {
paymentWallet = payable(_newPaymentWallet);
}
function setDefaultProductUSDPrice(uint8 _product, uint256 _priceUSD)
external
onlyOwner
{
defaultProductPriceUSD[_product] = _priceUSD;
}
function setDefaultProductPricesUSDBulk(
uint8[] memory _productIds,
uint256[] memory _pricesUSD
) external onlyOwner {
require(
_productIds.length == _pricesUSD.length,
'arrays need to be the same length'
);
for (uint256 _i = 0; _i < _productIds.length; _i++) {
defaultProductPriceUSD[_productIds[_i]] = _pricesUSD[_i];
}
}
function setOverrideProductPriceUSD(address _productCont, uint256 _priceUSD)
external
onlyOwner
{
overrideProductPriceUSD[_productCont] = _priceUSD;
}
function setOverrideProductPricesUSDBulk(
address[] memory _contracts,
uint256[] memory _pricesUSD
) external onlyOwner {
require(
_contracts.length == _pricesUSD.length,
'arrays need to be the same length'
);
for (uint256 _i = 0; _i < _contracts.length; _i++) {
overrideProductPriceUSD[_contracts[_i]] = _pricesUSD[_i];
}
}
function setRemoveCost(address _productCont, bool _isRemoved)
external
onlyOwner
{
removeCost[_productCont] = _isRemoved;
}
/**
* spendOnProduct: used by an OKLG product for a user to spend native token on usage of a product
*/
function spendOnProduct(address _payor, uint8 _product)
external
payable
override
{
if (removeCost[msg.sender]) return;
uint256 _productCostUSD = overrideProductPriceUSD[msg.sender] > 0
? overrideProductPriceUSD[msg.sender]
: defaultProductPriceUSD[_product];
if (_productCostUSD == 0) return;
uint256 _productCostWei = getProductCostWei(_productCostUSD);
require(
msg.value >= _productCostWei,
'not enough ETH sent to pay for product'
);
address payable _paymentWallet = paymentWallet == DEAD_WALLET ||
paymentWallet == address(0)
? payable(owner())
: paymentWallet;
_paymentWallet.call{ value: _productCostWei }('');
totalSpentWei += _productCostWei;
emit Spend(msg.sender, _payor, _productCostWei);
}
}
/interfaces/AggregatorV3Interface.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
interface AggregatorV3Interface {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
// getRoundData and latestRoundData should both raise "No data present"
// if they do not have data to report, instead of returning unset values
// which could be misinterpreted as actual reported values.
function getRoundData(uint80 _roundId)
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
/IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address sender,
address recipient,
uint256 amount
) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)
pragma solidity ^0.8.0;
import "../token/ERC20/IERC20.sol";
/
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (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 Returns the address of the current owner.
*/
function owner() public view virtual returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
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: 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;
}
}
/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/**
* @title IOKLGSpend
* @dev Logic for spending OKLG on products in the product ecosystem.
*/
interface IOKLGSpend {
function spendOnProduct(address _payor, uint8 _product) external payable;
}
/
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import '@openzeppelin/contracts/access/Ownable.sol';
import '@openzeppelin/contracts/interfaces/IERC20.sol';
/**
* @title OKLGWithdrawable
* @dev Supports being able to get tokens or ETH out of a contract with ease
*/
contract OKLGWithdrawable is Ownable {
function withdrawTokens(address _tokenAddy, uint256 _amount)
external
onlyOwner
{
IERC20 _token = IERC20(_tokenAddy);
_amount = _amount > 0 ? _amount : _token.balanceOf(address(this));
require(_amount > 0, 'make sure there is a balance available to withdraw');
_token.transfer(owner(), _amount);
}
function withdrawETH() external onlyOwner {
payable(owner()).call{ value: address(this).balance }('');
}
}
Compiler Settings
{"remappings":[],"optimizer":{"runs":200,"enabled":true},"metadata":{"bytecodeHash":"none"},"libraries":{},"evmVersion":"istanbul","compilationTarget":{"contracts/OKLGSpend.sol":"OKLGSpend"}}
Contract ABI
[{"type":"constructor","stateMutability":"nonpayable","inputs":[{"type":"address","name":"_linkPriceFeedContract","internalType":"address"}]},{"type":"event","name":"OwnershipTransferred","inputs":[{"type":"address","name":"previousOwner","internalType":"address","indexed":true},{"type":"address","name":"newOwner","internalType":"address","indexed":true}],"anonymous":false},{"type":"event","name":"Spend","inputs":[{"type":"address","name":"user","internalType":"address","indexed":true},{"type":"address","name":"product","internalType":"address","indexed":true},{"type":"uint256","name":"value","internalType":"uint256","indexed":false}],"anonymous":false},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"defaultProductPriceUSD","inputs":[{"type":"uint8","name":"","internalType":"uint8"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getLatestETHPrice","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"getProductCostWei","inputs":[{"type":"uint256","name":"_productCostUSD","internalType":"uint256"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"overrideProductPriceUSD","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"owner","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address payable"}],"name":"paymentWallet","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"removeCost","inputs":[{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceOwnership","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDefaultProductPricesUSDBulk","inputs":[{"type":"uint8[]","name":"_productIds","internalType":"uint8[]"},{"type":"uint256[]","name":"_pricesUSD","internalType":"uint256[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setDefaultProductUSDPrice","inputs":[{"type":"uint8","name":"_product","internalType":"uint8"},{"type":"uint256","name":"_priceUSD","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setOverrideProductPriceUSD","inputs":[{"type":"address","name":"_productCont","internalType":"address"},{"type":"uint256","name":"_priceUSD","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setOverrideProductPricesUSDBulk","inputs":[{"type":"address[]","name":"_contracts","internalType":"address[]"},{"type":"uint256[]","name":"_pricesUSD","internalType":"uint256[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPaymentWallet","inputs":[{"type":"address","name":"_newPaymentWallet","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setPriceFeed","inputs":[{"type":"address","name":"_feedContract","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"setRemoveCost","inputs":[{"type":"address","name":"_productCont","internalType":"address"},{"type":"bool","name":"_isRemoved","internalType":"bool"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"spendOnProduct","inputs":[{"type":"address","name":"_payor","internalType":"address"},{"type":"uint8","name":"_product","internalType":"uint8"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"totalSpentWei","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferOwnership","inputs":[{"type":"address","name":"newOwner","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawETH","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"withdrawTokens","inputs":[{"type":"address","name":"_tokenAddy","internalType":"address"},{"type":"uint256","name":"_amount","internalType":"uint256"}]}]
Contract Creation Code
0x6080604052600180546001600160a01b03191661dead179055600060035534801561002957600080fd5b506040516114d73803806114d7833981016040819052610048916100c6565b61005133610076565b600280546001600160a01b0319166001600160a01b03929092169190911790556100f4565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000602082840312156100d7578081fd5b81516001600160a01b03811681146100ed578182fd5b9392505050565b6113d4806101036000396000f3fe60806040526004361061011f5760003560e01c8063777e0d86116100a0578063d9e30e5511610064578063d9e30e5514610345578063e086e5ec14610358578063e32204dd1461036d578063f2fde38b1461038d578063fd6cb613146103ad57600080fd5b8063777e0d861461027157806389fb844a146102865780638da5cb5b146102a65780639861087f146102d8578063a666a18e1461030557600080fd5b806352444d0a116100e757806352444d0a146101e6578063701462a514610206578063715018a614610226578063722c785b1461023b578063724e78da1461025157600080fd5b806304d4e9621461012457806306b091f9146101465780630a1bbb3f14610166578063324870fd146101a65780633769248f146101c6575b600080fd5b34801561013057600080fd5b5061014461013f366004610fcb565b6103cd565b005b34801561015257600080fd5b50610144610161366004610eb6565b6104b1565b34801561017257600080fd5b506101936101813660046110ad565b60046020526000908152604090205481565b6040519081526020015b60405180910390f35b3480156101b257600080fd5b506101936101c136600461107d565b610673565b3480156101d257600080fd5b506101446101e1366004611134565b6106b5565b3480156101f257600080fd5b50610144610201366004610e80565b6106f5565b34801561021257600080fd5b50610144610221366004610f0a565b61074a565b34801561023257600080fd5b5061014461082c565b34801561024757600080fd5b5061019360035481565b34801561025d57600080fd5b5061014461026c366004610e66565b610862565b34801561027d57600080fd5b506101936108ae565b34801561029257600080fd5b506101446102a1366004610eb6565b6109f7565b3480156102b257600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200161019d565b3480156102e457600080fd5b506101936102f3366004610e66565b60056020526000908152604090205481565b34801561031157600080fd5b50610335610320366004610e66565b60066020526000908152604090205460ff1681565b604051901515815260200161019d565b610144610353366004610edf565b610a3d565b34801561036457600080fd5b50610144610c0a565b34801561037957600080fd5b506001546102c0906001600160a01b031681565b34801561039957600080fd5b506101446103a8366004610e66565b610c8a565b3480156103b957600080fd5b506101446103c8366004610e66565b610d25565b6000546001600160a01b031633146104005760405162461bcd60e51b81526004016103f790611192565b60405180910390fd5b80518251146104215760405162461bcd60e51b81526004016103f790611151565b60005b82518110156104ac5781818151811061044d57634e487b7160e01b600052603260045260246000fd5b60200260200101516004600085848151811061047957634e487b7160e01b600052603260045260246000fd5b602002602001015160ff1660ff1681526020019081526020016000208190555080806104a490611363565b915050610424565b505050565b6000546001600160a01b031633146104db5760405162461bcd60e51b81526004016103f790611192565b818161055d576040516370a0823160e01b81523060048201526001600160a01b038216906370a082319060240160206040518083038186803b15801561052057600080fd5b505afa158015610534573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105589190611095565b61055f565b815b9150600082116105cc5760405162461bcd60e51b815260206004820152603260248201527f6d616b65207375726520746865726520697320612062616c616e636520617661604482015271696c61626c6520746f20776974686472617760701b60648201526084016103f7565b806001600160a01b031663a9059cbb6105ed6000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101859052604401602060405180830381600087803b15801561063557600080fd5b505af1158015610649573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066d9190611061565b50505050565b60008061068883670de0b6b3a7640000611344565b90506106926108ae565b6106a482670de0b6b3a7640000611344565b6106ae9190611234565b9392505050565b6000546001600160a01b031633146106df5760405162461bcd60e51b81526004016103f790611192565b60ff909116600090815260046020526040902055565b6000546001600160a01b0316331461071f5760405162461bcd60e51b81526004016103f790611192565b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146107745760405162461bcd60e51b81526004016103f790611192565b80518251146107955760405162461bcd60e51b81526004016103f790611151565b60005b82518110156104ac578181815181106107c157634e487b7160e01b600052603260045260246000fd5b6020026020010151600560008584815181106107ed57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550808061082490611363565b915050610798565b6000546001600160a01b031633146108565760405162461bcd60e51b81526004016103f790611192565b6108606000610d71565b565b6000546001600160a01b0316331461088c5760405162461bcd60e51b81526004016103f790611192565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b600080600260009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ff57600080fd5b505afa158015610913573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109379190611118565b90506000600260009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561098957600080fd5b505afa15801561099d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c191906110c9565b50505091505081600a6109d49190611297565b6109e690670de0b6b3a7640000611234565b6109f09082611344565b9250505090565b6000546001600160a01b03163314610a215760405162461bcd60e51b81526004016103f790611192565b6001600160a01b03909116600090815260056020526040902055565b3360009081526006602052604090205460ff1615610a59575050565b33600090815260056020526040812054610a855760ff8216600090815260046020526040902054610a96565b336000908152600560205260409020545b905080610aa257505050565b6000610aad82610673565b905080341015610b0e5760405162461bcd60e51b815260206004820152602660248201527f6e6f7420656e6f756768204554482073656e7420746f2070617920666f7220706044820152651c9bd91d58dd60d21b60648201526084016103f7565b6001546000906001600160a01b031661dead1480610b3557506001546001600160a01b0316155b610b4a576001546001600160a01b0316610b57565b6000546001600160a01b03165b9050806001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ba4576040519150601f19603f3d011682016040523d82523d6000602084013e610ba9565b606091505b5050508160036000828254610bbe919061121c565b90915550506040518281526001600160a01b0386169033907f7c2b9369bf4a6bd9745889c658ad00a4d57e280c4c80fa1c74db2a9e52c136359060200160405180910390a35050505050565b6000546001600160a01b03163314610c345760405162461bcd60e51b81526004016103f790611192565b6000546001600160a01b03166001600160a01b03164760405160006040518083038185875af1925050503d80600081146104ac576040519150601f19603f3d011682016040523d82523d6000602084013e505050565b6000546001600160a01b03163314610cb45760405162461bcd60e51b81526004016103f790611192565b6001600160a01b038116610d195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103f7565b610d2281610d71565b50565b6000546001600160a01b03163314610d4f5760405162461bcd60e51b81526004016103f790611192565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b0381168114610dd857600080fd5b919050565b600082601f830112610ded578081fd5b81356020610e02610dfd836111f8565b6111c7565b80838252828201915082860187848660051b8901011115610e21578586fd5b855b85811015610e3f57813584529284019290840190600101610e23565b5090979650505050505050565b805169ffffffffffffffffffff81168114610dd857600080fd5b600060208284031215610e77578081fd5b6106ae82610dc1565b60008060408385031215610e92578081fd5b610e9b83610dc1565b91506020830135610eab816113aa565b809150509250929050565b60008060408385031215610ec8578182fd5b610ed183610dc1565b946020939093013593505050565b60008060408385031215610ef1578182fd5b610efa83610dc1565b91506020830135610eab816113b8565b60008060408385031215610f1c578182fd5b823567ffffffffffffffff80821115610f33578384fd5b818501915085601f830112610f46578384fd5b81356020610f56610dfd836111f8565b8083825282820191508286018a848660051b8901011115610f75578889fd5b8896505b84871015610f9e57610f8a81610dc1565b835260019690960195918301918301610f79565b5096505086013592505080821115610fb4578283fd5b50610fc185828601610ddd565b9150509250929050565b60008060408385031215610fdd578182fd5b823567ffffffffffffffff80821115610ff4578384fd5b818501915085601f830112611007578384fd5b81356020611017610dfd836111f8565b8083825282820191508286018a848660051b8901011115611036578889fd5b8896505b84871015610f9e57803561104d816113b8565b83526001969096019591830191830161103a565b600060208284031215611072578081fd5b81516106ae816113aa565b60006020828403121561108e578081fd5b5035919050565b6000602082840312156110a6578081fd5b5051919050565b6000602082840312156110be578081fd5b81356106ae816113b8565b600080600080600060a086880312156110e0578081fd5b6110e986610e4c565b945060208601519350604086015192506060860151915061110c60808701610e4c565b90509295509295909350565b600060208284031215611129578081fd5b81516106ae816113b8565b60008060408385031215611146578182fd5b8235610ed1816113b8565b60208082526021908201527f617272617973206e65656420746f206265207468652073616d65206c656e67746040820152600d60fb1b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b604051601f8201601f1916810167ffffffffffffffff811182821017156111f0576111f0611394565b604052919050565b600067ffffffffffffffff82111561121257611212611394565b5060051b60200190565b6000821982111561122f5761122f61137e565b500190565b60008261124f57634e487b7160e01b81526012600452602481fd5b500490565b600181815b8085111561128f5781600019048211156112755761127561137e565b8085161561128257918102915b93841c9390800290611259565b509250929050565b60006106ae60ff8416836000826112b05750600161133e565b816112bd5750600061133e565b81600181146112d357600281146112dd576112f9565b600191505061133e565b60ff8411156112ee576112ee61137e565b50506001821b61133e565b5060208310610133831016604e8410600b841016171561131c575081810a61133e565b6113268383611254565b806000190482111561133a5761133a61137e565b0290505b92915050565b600081600019048311821515161561135e5761135e61137e565b500290565b60006000198214156113775761137761137e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114610d2257600080fd5b60ff81168114610d2257600080fdfea164736f6c6343000804000a0000000000000000000000005f4ec3df9cbd43714fe2740f5e3616155c5b8419
Deployed ByteCode
0x60806040526004361061011f5760003560e01c8063777e0d86116100a0578063d9e30e5511610064578063d9e30e5514610345578063e086e5ec14610358578063e32204dd1461036d578063f2fde38b1461038d578063fd6cb613146103ad57600080fd5b8063777e0d861461027157806389fb844a146102865780638da5cb5b146102a65780639861087f146102d8578063a666a18e1461030557600080fd5b806352444d0a116100e757806352444d0a146101e6578063701462a514610206578063715018a614610226578063722c785b1461023b578063724e78da1461025157600080fd5b806304d4e9621461012457806306b091f9146101465780630a1bbb3f14610166578063324870fd146101a65780633769248f146101c6575b600080fd5b34801561013057600080fd5b5061014461013f366004610fcb565b6103cd565b005b34801561015257600080fd5b50610144610161366004610eb6565b6104b1565b34801561017257600080fd5b506101936101813660046110ad565b60046020526000908152604090205481565b6040519081526020015b60405180910390f35b3480156101b257600080fd5b506101936101c136600461107d565b610673565b3480156101d257600080fd5b506101446101e1366004611134565b6106b5565b3480156101f257600080fd5b50610144610201366004610e80565b6106f5565b34801561021257600080fd5b50610144610221366004610f0a565b61074a565b34801561023257600080fd5b5061014461082c565b34801561024757600080fd5b5061019360035481565b34801561025d57600080fd5b5061014461026c366004610e66565b610862565b34801561027d57600080fd5b506101936108ae565b34801561029257600080fd5b506101446102a1366004610eb6565b6109f7565b3480156102b257600080fd5b506000546001600160a01b03165b6040516001600160a01b03909116815260200161019d565b3480156102e457600080fd5b506101936102f3366004610e66565b60056020526000908152604090205481565b34801561031157600080fd5b50610335610320366004610e66565b60066020526000908152604090205460ff1681565b604051901515815260200161019d565b610144610353366004610edf565b610a3d565b34801561036457600080fd5b50610144610c0a565b34801561037957600080fd5b506001546102c0906001600160a01b031681565b34801561039957600080fd5b506101446103a8366004610e66565b610c8a565b3480156103b957600080fd5b506101446103c8366004610e66565b610d25565b6000546001600160a01b031633146104005760405162461bcd60e51b81526004016103f790611192565b60405180910390fd5b80518251146104215760405162461bcd60e51b81526004016103f790611151565b60005b82518110156104ac5781818151811061044d57634e487b7160e01b600052603260045260246000fd5b60200260200101516004600085848151811061047957634e487b7160e01b600052603260045260246000fd5b602002602001015160ff1660ff1681526020019081526020016000208190555080806104a490611363565b915050610424565b505050565b6000546001600160a01b031633146104db5760405162461bcd60e51b81526004016103f790611192565b818161055d576040516370a0823160e01b81523060048201526001600160a01b038216906370a082319060240160206040518083038186803b15801561052057600080fd5b505afa158015610534573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105589190611095565b61055f565b815b9150600082116105cc5760405162461bcd60e51b815260206004820152603260248201527f6d616b65207375726520746865726520697320612062616c616e636520617661604482015271696c61626c6520746f20776974686472617760701b60648201526084016103f7565b806001600160a01b031663a9059cbb6105ed6000546001600160a01b031690565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260248101859052604401602060405180830381600087803b15801561063557600080fd5b505af1158015610649573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061066d9190611061565b50505050565b60008061068883670de0b6b3a7640000611344565b90506106926108ae565b6106a482670de0b6b3a7640000611344565b6106ae9190611234565b9392505050565b6000546001600160a01b031633146106df5760405162461bcd60e51b81526004016103f790611192565b60ff909116600090815260046020526040902055565b6000546001600160a01b0316331461071f5760405162461bcd60e51b81526004016103f790611192565b6001600160a01b03919091166000908152600660205260409020805460ff1916911515919091179055565b6000546001600160a01b031633146107745760405162461bcd60e51b81526004016103f790611192565b80518251146107955760405162461bcd60e51b81526004016103f790611151565b60005b82518110156104ac578181815181106107c157634e487b7160e01b600052603260045260246000fd5b6020026020010151600560008584815181106107ed57634e487b7160e01b600052603260045260246000fd5b60200260200101516001600160a01b03166001600160a01b0316815260200190815260200160002081905550808061082490611363565b915050610798565b6000546001600160a01b031633146108565760405162461bcd60e51b81526004016103f790611192565b6108606000610d71565b565b6000546001600160a01b0316331461088c5760405162461bcd60e51b81526004016103f790611192565b600280546001600160a01b0319166001600160a01b0392909216919091179055565b600080600260009054906101000a90046001600160a01b03166001600160a01b031663313ce5676040518163ffffffff1660e01b815260040160206040518083038186803b1580156108ff57600080fd5b505afa158015610913573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109379190611118565b90506000600260009054906101000a90046001600160a01b03166001600160a01b031663feaf968c6040518163ffffffff1660e01b815260040160a06040518083038186803b15801561098957600080fd5b505afa15801561099d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109c191906110c9565b50505091505081600a6109d49190611297565b6109e690670de0b6b3a7640000611234565b6109f09082611344565b9250505090565b6000546001600160a01b03163314610a215760405162461bcd60e51b81526004016103f790611192565b6001600160a01b03909116600090815260056020526040902055565b3360009081526006602052604090205460ff1615610a59575050565b33600090815260056020526040812054610a855760ff8216600090815260046020526040902054610a96565b336000908152600560205260409020545b905080610aa257505050565b6000610aad82610673565b905080341015610b0e5760405162461bcd60e51b815260206004820152602660248201527f6e6f7420656e6f756768204554482073656e7420746f2070617920666f7220706044820152651c9bd91d58dd60d21b60648201526084016103f7565b6001546000906001600160a01b031661dead1480610b3557506001546001600160a01b0316155b610b4a576001546001600160a01b0316610b57565b6000546001600160a01b03165b9050806001600160a01b03168260405160006040518083038185875af1925050503d8060008114610ba4576040519150601f19603f3d011682016040523d82523d6000602084013e610ba9565b606091505b5050508160036000828254610bbe919061121c565b90915550506040518281526001600160a01b0386169033907f7c2b9369bf4a6bd9745889c658ad00a4d57e280c4c80fa1c74db2a9e52c136359060200160405180910390a35050505050565b6000546001600160a01b03163314610c345760405162461bcd60e51b81526004016103f790611192565b6000546001600160a01b03166001600160a01b03164760405160006040518083038185875af1925050503d80600081146104ac576040519150601f19603f3d011682016040523d82523d6000602084013e505050565b6000546001600160a01b03163314610cb45760405162461bcd60e51b81526004016103f790611192565b6001600160a01b038116610d195760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103f7565b610d2281610d71565b50565b6000546001600160a01b03163314610d4f5760405162461bcd60e51b81526004016103f790611192565b600180546001600160a01b0319166001600160a01b0392909216919091179055565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80356001600160a01b0381168114610dd857600080fd5b919050565b600082601f830112610ded578081fd5b81356020610e02610dfd836111f8565b6111c7565b80838252828201915082860187848660051b8901011115610e21578586fd5b855b85811015610e3f57813584529284019290840190600101610e23565b5090979650505050505050565b805169ffffffffffffffffffff81168114610dd857600080fd5b600060208284031215610e77578081fd5b6106ae82610dc1565b60008060408385031215610e92578081fd5b610e9b83610dc1565b91506020830135610eab816113aa565b809150509250929050565b60008060408385031215610ec8578182fd5b610ed183610dc1565b946020939093013593505050565b60008060408385031215610ef1578182fd5b610efa83610dc1565b91506020830135610eab816113b8565b60008060408385031215610f1c578182fd5b823567ffffffffffffffff80821115610f33578384fd5b818501915085601f830112610f46578384fd5b81356020610f56610dfd836111f8565b8083825282820191508286018a848660051b8901011115610f75578889fd5b8896505b84871015610f9e57610f8a81610dc1565b835260019690960195918301918301610f79565b5096505086013592505080821115610fb4578283fd5b50610fc185828601610ddd565b9150509250929050565b60008060408385031215610fdd578182fd5b823567ffffffffffffffff80821115610ff4578384fd5b818501915085601f830112611007578384fd5b81356020611017610dfd836111f8565b8083825282820191508286018a848660051b8901011115611036578889fd5b8896505b84871015610f9e57803561104d816113b8565b83526001969096019591830191830161103a565b600060208284031215611072578081fd5b81516106ae816113aa565b60006020828403121561108e578081fd5b5035919050565b6000602082840312156110a6578081fd5b5051919050565b6000602082840312156110be578081fd5b81356106ae816113b8565b600080600080600060a086880312156110e0578081fd5b6110e986610e4c565b945060208601519350604086015192506060860151915061110c60808701610e4c565b90509295509295909350565b600060208284031215611129578081fd5b81516106ae816113b8565b60008060408385031215611146578182fd5b8235610ed1816113b8565b60208082526021908201527f617272617973206e65656420746f206265207468652073616d65206c656e67746040820152600d60fb1b606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b604051601f8201601f1916810167ffffffffffffffff811182821017156111f0576111f0611394565b604052919050565b600067ffffffffffffffff82111561121257611212611394565b5060051b60200190565b6000821982111561122f5761122f61137e565b500190565b60008261124f57634e487b7160e01b81526012600452602481fd5b500490565b600181815b8085111561128f5781600019048211156112755761127561137e565b8085161561128257918102915b93841c9390800290611259565b509250929050565b60006106ae60ff8416836000826112b05750600161133e565b816112bd5750600061133e565b81600181146112d357600281146112dd576112f9565b600191505061133e565b60ff8411156112ee576112ee61137e565b50506001821b61133e565b5060208310610133831016604e8410600b841016171561131c575081810a61133e565b6113268383611254565b806000190482111561133a5761133a61137e565b0290505b92915050565b600081600019048311821515161561135e5761135e61137e565b500290565b60006000198214156113775761137761137e565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b8015158114610d2257600080fd5b60ff81168114610d2257600080fdfea164736f6c6343000804000a