Overview
CELO Balance
0 CELO
CELO Value
$0.00More Info
Private Name Tags
ContractCreator:
Multichain Info
N/A
Loading...
Loading
Contract Name:
GoodGhosting
Compiler Version
v0.6.11+commit.5ef660b1
Optimization Enabled:
Yes with 1500 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.11; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Pausable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "./aave/ILendingPoolAddressesProvider.sol"; import "./aave/ILendingPool.sol"; import "./aave/AToken.sol"; /// @title GoodGhosting Game Contract /// @notice Used for games deployed on Ethereum Mainnet using Aave (v2) as the underlying pool, or for games deployed on Celo using Moola (v2) as the underlying pool /// @author Francis Odisi & Viraz Malhotra contract GoodGhosting is Ownable, Pausable { using SafeMath for uint256; /// @notice Controls if tokens were redeemed or not from the pool bool public redeemed; /// @notice Stores the total amount of net interest received in the game. uint256 public totalGameInterest; /// @notice total principal amount uint256 public totalGamePrincipal; /// @notice performance fee amount allocated to the admin uint256 public adminFeeAmount; /// @notice controls if admin withdrew or not the performance fee. bool public adminWithdraw; /// @notice total amount of incentive tokens to be distributed among winners uint256 public totalIncentiveAmount = 0; /// @notice Controls the amount of active players in the game (ignores players that early withdraw) uint256 public activePlayersCount = 0; /// @notice Address of the token used for depositing into the game by players (DAI) IERC20 public immutable daiToken; /// @notice Address of the interest bearing token received when funds are transferred to the external pool AToken public immutable adaiToken; /// @notice Which Aave instance we use to swap DAI to interest bearing aDAI ILendingPoolAddressesProvider public immutable lendingPoolAddressProvider; /// @notice Lending pool address ILendingPool public lendingPool; /// @notice The amount to be paid on each segment uint256 public immutable segmentPayment; /// @notice The number of segments in the game (segment count) uint256 public immutable lastSegment; /// @notice When the game started (deployed timestamp) uint256 public immutable firstSegmentStart; /// @notice The time duration (in seconds) of each segment uint256 public immutable segmentLength; /// @notice The early withdrawal fee (percentage) uint256 public immutable earlyWithdrawalFee; /// @notice The performance admin fee (percentage) uint256 public immutable customFee; /// @notice Defines the max quantity of players allowed in the game uint256 public immutable maxPlayersCount; /// @notice Defines an optional token address used to provide additional incentives to users. Accepts "0x0" adresses when no incentive token exists. IERC20 public immutable incentiveToken; struct Player { address addr; bool withdrawn; bool canRejoin; uint256 mostRecentSegmentPaid; uint256 amountPaid; } /// @notice Stores info about the players in the game mapping(address => Player) public players; /// @notice controls the amount deposited in each segment that was not yet transferred to the external underlying pool /// @notice list of players address[] public iterablePlayers; /// @notice list of winners address[] public winners; event JoinedGame(address indexed player, uint256 amount); event Deposit( address indexed player, uint256 indexed segment, uint256 amount ); event Withdrawal( address indexed player, uint256 amount, uint256 playerReward, uint256 playerIncentive ); event FundsRedeemedFromExternalPool( uint256 totalAmount, uint256 totalGamePrincipal, uint256 totalGameInterest, uint256 rewards, uint256 totalIncentiveAmount ); event WinnersAnnouncement(address[] winners); event EarlyWithdrawal( address indexed player, uint256 amount, uint256 totalGamePrincipal ); event AdminWithdrawal( address indexed admin, uint256 totalGameInterest, uint256 adminFeeAmount, uint256 adminIncentiveAmount ); modifier whenGameIsCompleted() { require(isGameCompleted(), "Game is not completed"); _; } modifier whenGameIsNotCompleted() { require(!isGameCompleted(), "Game is already completed"); _; } /** Creates a new instance of GoodGhosting game @param _inboundCurrency Smart contract address of inbound currency used for the game. @param _lendingPoolAddressProvider Smart contract address of the lending pool adddress provider. @param _segmentCount Number of segments in the game. @param _segmentLength Lenght of each segment, in seconds (i.e., 180 (sec) => 3 minutes). @param _segmentPayment Amount of tokens each player needs to contribute per segment (i.e. 10*10**18 equals to 10 DAI - note that DAI uses 18 decimal places). @param _earlyWithdrawalFee Fee paid by users on early withdrawals (before the game completes). Used as an integer percentage (i.e., 10 represents 10%). @param _customFee performance fee charged by admin. Used as an integer percentage (i.e., 10 represents 10%). Does not accept "decimal" fees like "0.5". @param _dataProvider id for getting the data provider contract address 0x1 to be passed. @param _maxPlayersCount max quantity of players allowed to join the game @param _incentiveToken optional token address used to provide additional incentives to users. Accepts "0x0" adresses when no incentive token exists. */ constructor( IERC20 _inboundCurrency, ILendingPoolAddressesProvider _lendingPoolAddressProvider, uint256 _segmentCount, uint256 _segmentLength, uint256 _segmentPayment, uint256 _earlyWithdrawalFee, uint256 _customFee, address _dataProvider, uint256 _maxPlayersCount, IERC20 _incentiveToken ) public { require(_customFee <= 20, "_customFee must be less than or equal to 20%"); require(_earlyWithdrawalFee <= 10, "_earlyWithdrawalFee must be less than or equal to 10%"); require(_earlyWithdrawalFee > 0, "_earlyWithdrawalFee must be greater than zero"); require(_maxPlayersCount > 0, "_maxPlayersCount must be greater than zero"); require(address(_inboundCurrency) != address(0), "invalid _inboundCurrency address"); require(address(_lendingPoolAddressProvider) != address(0), "invalid _lendingPoolAddressProvider address"); require(_segmentCount > 0, "_segmentCount must be greater than zero"); require(_segmentLength > 0, "_segmentLength must be greater than zero"); require(_segmentPayment > 0, "_segmentPayment must be greater than zero"); require(_dataProvider != address(0), "invalid _dataProvider address"); // Initializes default variables firstSegmentStart = block.timestamp; //gets current time lastSegment = _segmentCount; segmentLength = _segmentLength; segmentPayment = _segmentPayment; earlyWithdrawalFee = _earlyWithdrawalFee; customFee = _customFee; daiToken = _inboundCurrency; lendingPoolAddressProvider = _lendingPoolAddressProvider; AaveProtocolDataProvider dataProvider = AaveProtocolDataProvider(_dataProvider); // lending pool needs to be approved in v2 since it is the core contract in v2 and not lending pool core lendingPool = ILendingPool( _lendingPoolAddressProvider.getLendingPool() ); // atoken address in v2 is fetched from data provider contract (address adaiTokenAddress, , ) = dataProvider.getReserveTokensAddresses(address(_inboundCurrency)); adaiToken = AToken(adaiTokenAddress); maxPlayersCount = _maxPlayersCount; incentiveToken = _incentiveToken; } /// @notice pauses the game. This function can be called only by the contract's admin. function pause() external onlyOwner whenNotPaused { _pause(); } /// @notice unpauses the game. This function can be called only by the contract's admin. function unpause() external onlyOwner whenPaused { _unpause(); } /// @notice Allows the admin to withdraw the performance fee, if applicable. This function can be called only by the contract's admin. /// @dev Cannot be called before the game ends. function adminFeeWithdraw() external virtual onlyOwner whenGameIsCompleted { require(redeemed, "Funds not redeemed from external pool"); require(!adminWithdraw, "Admin has already withdrawn"); adminWithdraw = true; // when there are no winners, admin will be able to withdraw the // additional incentives sent to the pool, avoiding locking the funds. uint256 adminIncentiveAmount = 0; if (winners.length == 0 && totalIncentiveAmount > 0) { adminIncentiveAmount = totalIncentiveAmount; } emit AdminWithdrawal(owner(), totalGameInterest, adminFeeAmount, adminIncentiveAmount); if (adminFeeAmount > 0) { require( IERC20(daiToken).transfer(owner(), adminFeeAmount), "Fail to transfer ER20 tokens to admin" ); } if (adminIncentiveAmount > 0) { require( IERC20(incentiveToken).transfer(owner(), adminIncentiveAmount), "Fail to transfer ER20 incentive tokens to admin" ); } } /// @notice Allows a player to join the game function joinGame() external virtual whenNotPaused { _joinGame(); } /// @notice Allows a player to withdraws funds before the game ends. An early withdrawl fee is charged. /// @dev Cannot be called after the game is completed. function earlyWithdraw() external whenNotPaused whenGameIsNotCompleted { Player storage player = players[msg.sender]; require(player.amountPaid > 0, "Player does not exist"); require(!player.withdrawn, "Player has already withdrawn"); player.withdrawn = true; activePlayersCount = activePlayersCount.sub(1); // In an early withdraw, users get their principal minus the earlyWithdrawalFee % defined in the constructor. uint256 withdrawAmount = player.amountPaid.sub( player.amountPaid.mul(earlyWithdrawalFee).div(100) ); // Decreases the totalGamePrincipal on earlyWithdraw totalGamePrincipal = totalGamePrincipal.sub(player.amountPaid); uint256 currentSegment = getCurrentSegment(); // Users that early withdraw during the first segment, are allowed to rejoin. if (currentSegment == 0) { player.canRejoin = true; } emit EarlyWithdrawal(msg.sender, withdrawAmount, totalGamePrincipal); lendingPool.withdraw(address(daiToken), withdrawAmount, address(this)); require( IERC20(daiToken).transfer(msg.sender, withdrawAmount), "Fail to transfer ERC20 tokens on early withdraw" ); } /// @notice Allows player to withdraw their funds after the game ends with no loss (fee). Winners get a share of the interest earned. function withdraw() external virtual { Player storage player = players[msg.sender]; require(player.amountPaid > 0, "Player does not exist"); require(!player.withdrawn, "Player has already withdrawn"); player.withdrawn = true; // First player to withdraw redeems everyone's funds if (!redeemed) { redeemFromExternalPool(); } uint256 payout = player.amountPaid; uint256 playerIncentive = 0; if (player.mostRecentSegmentPaid == lastSegment.sub(1)) { // Player is a winner and gets a bonus! payout = payout.add(totalGameInterest.div(winners.length)); // If there's additional incentives, distributes them to winners if (totalIncentiveAmount > 0) { playerIncentive = totalIncentiveAmount.div(winners.length); } } emit Withdrawal(msg.sender, payout, 0, playerIncentive); require( IERC20(daiToken).transfer(msg.sender, payout), "Fail to transfer ERC20 tokens on withdraw" ); if (playerIncentive > 0) { require( IERC20(incentiveToken).transfer(msg.sender, playerIncentive), "Fail to transfer ERC20 incentive tokens on withdraw" ); } } /// @notice Allows players to make deposits for the game segments, after joining the game. function makeDeposit() external whenNotPaused { require( !players[msg.sender].withdrawn, "Player already withdraw from game" ); // only registered players can deposit require( players[msg.sender].addr == msg.sender, "Sender is not a player" ); uint256 currentSegment = getCurrentSegment(); // User can only deposit between segment 1 and segment n-1 (where n is the number of segments for the game). // Details: // Segment 0 is paid when user joins the game (the first deposit window). // Last segment doesn't accept payments, because the payment window for the last // segment happens on segment n-1 (penultimate segment). // Any segment greater than the last segment means the game is completed, and cannot // receive payments require( currentSegment > 0 && currentSegment < lastSegment, "Deposit available only between segment 1 and segment n-1 (penultimate)" ); //check if current segment is currently unpaid require( players[msg.sender].mostRecentSegmentPaid != currentSegment, "Player already paid current segment" ); // check if player has made payments up to the previous segment require( players[msg.sender].mostRecentSegmentPaid == currentSegment.sub(1), "Player didn't pay the previous segment - game over!" ); // check if this is deposit for the last segment. If yes, the player is a winner. if (currentSegment == lastSegment.sub(1)) { winners.push(msg.sender); } emit Deposit(msg.sender, currentSegment, segmentPayment); _transferDaiToContract(); } /// @notice gets the number of players in the game /// @return number of players function getNumberOfPlayers() external view returns (uint256) { return iterablePlayers.length; } /// @notice Redeems funds from the external pool and updates the internal accounting controls related to the game stats. /// @dev Can only be called after the game is completed. function redeemFromExternalPool() public virtual whenGameIsCompleted { require(!redeemed, "Redeem operation already happened for the game"); redeemed = true; // Withdraws funds (principal + interest + rewards) from external pool if (adaiToken.balanceOf(address(this)) > 0) { lendingPool.withdraw( address(daiToken), type(uint256).max, address(this) ); } uint256 totalBalance = IERC20(daiToken).balanceOf(address(this)); // If there's an incentive token address defined, sets the total incentive amount to be distributed among winners. if (address(incentiveToken) != address(0)) { totalIncentiveAmount = IERC20(incentiveToken).balanceOf(address(this)); } // calculates gross interest uint256 grossInterest = 0; // Sanity check to avoid reverting due to overflow in the "subtraction" below. // This could only happen in case Aave changes the 1:1 ratio between // aToken vs. Token in the future (i.e., 1 aDAI is worth less than 1 DAI) if (totalBalance > totalGamePrincipal) { grossInterest = totalBalance.sub(totalGamePrincipal); } // calculates the performance/admin fee (takes a cut - the admin percentage fee - from the pool's interest). // calculates the "gameInterest" (net interest) that will be split among winners in the game uint256 _adminFeeAmount; if (customFee > 0) { _adminFeeAmount = (grossInterest.mul(customFee)).div(100); totalGameInterest = grossInterest.sub(_adminFeeAmount); } else { _adminFeeAmount = 0; totalGameInterest = grossInterest; } // when there's no winners, admin takes all the interest + rewards if (winners.length == 0) { adminFeeAmount = grossInterest; } else { adminFeeAmount = _adminFeeAmount; } emit FundsRedeemedFromExternalPool( totalBalance, totalGamePrincipal, totalGameInterest, 0, totalIncentiveAmount ); emit WinnersAnnouncement(winners); } /// @notice Calculates the current segment of the game. /// @return current game segment function getCurrentSegment() public view returns (uint256) { return block.timestamp.sub(firstSegmentStart).div(segmentLength); } /// @notice Checks if the game is completed or not. /// @return "true" if completeted; otherwise, "false". function isGameCompleted() public view returns (bool) { // Game is completed when the current segment is greater than "lastSegment" of the game. return getCurrentSegment() > lastSegment; } /** @dev Manages the transfer of funds from the player to the contract, recording the required accounting operations to control the user's position in the pool. */ function _transferDaiToContract() internal { require( daiToken.allowance(msg.sender, address(this)) >= segmentPayment, "You need to have allowance to do transfer DAI on the smart contract" ); uint256 currentSegment = getCurrentSegment(); players[msg.sender].mostRecentSegmentPaid = currentSegment; players[msg.sender].amountPaid = players[msg.sender].amountPaid.add( segmentPayment ); totalGamePrincipal = totalGamePrincipal.add(segmentPayment); require( daiToken.transferFrom(msg.sender, address(this), segmentPayment), "Transfer failed" ); // Allows the lending pool to convert DAI deposited on this contract to aDAI on lending pool uint256 contractBalance = daiToken.balanceOf(address(this)); require( daiToken.approve(address(lendingPool), contractBalance), "Fail to approve allowance to lending pool" ); lendingPool.deposit(address(daiToken), contractBalance, address(this), 155); } /// @notice Allows a player to join the game and controls function _joinGame() internal { require(getCurrentSegment() == 0, "Game has already started"); require( players[msg.sender].addr != msg.sender || players[msg.sender].canRejoin, "Cannot join the game more than once" ); activePlayersCount = activePlayersCount.add(1); require(activePlayersCount <= maxPlayersCount, "Reached max quantity of players allowed"); bool canRejoin = players[msg.sender].canRejoin; Player memory newPlayer = Player({ addr: msg.sender, mostRecentSegmentPaid: 0, amountPaid: 0, withdrawn: false, canRejoin: false }); players[msg.sender] = newPlayer; if (!canRejoin) { iterablePlayers.push(msg.sender); } emit JoinedGame(msg.sender, segmentPayment); _transferDaiToContract(); } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <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 () internal { address msgSender = _msgSender(); _owner = msgSender; emit OwnershipTransferred(address(0), 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 { emit OwnershipTransferred(_owner, address(0)); _owner = 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"); emit OwnershipTransferred(_owner, newOwner); _owner = newOwner; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b > a) return (false, 0); return (true, a - b); } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a / b); } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { if (b == 0) return (false, 0); return (true, a % b); } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { uint256 c = a + b; require(c >= a, "SafeMath: addition overflow"); return c; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { require(b <= a, "SafeMath: subtraction overflow"); return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { if (a == 0) return 0; uint256 c = a * b; require(c / a == b, "SafeMath: multiplication overflow"); return c; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: division by zero"); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { require(b > 0, "SafeMath: modulo by zero"); return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b <= a, errorMessage); return a - b; } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryDiv}. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { require(b > 0, errorMessage); return a % b; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <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 pragma solidity >=0.6.0 <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 GSN 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 payable) { return msg.sender; } function _msgData() internal view virtual returns (bytes memory) { this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity >=0.6.0 <0.8.0; import "./Context.sol"; /** * @dev Contract module which allows children to implement an emergency stop * mechanism that can be triggered by an authorized account. * * This module is used through inheritance. It will make available the * modifiers `whenNotPaused` and `whenPaused`, which can be applied to * the functions of your contract. Note that they will not be pausable by * simply including this module, only once the modifiers are put in place. */ abstract contract Pausable is Context { /** * @dev Emitted when the pause is triggered by `account`. */ event Paused(address account); /** * @dev Emitted when the pause is lifted by `account`. */ event Unpaused(address account); bool private _paused; /** * @dev Initializes the contract in unpaused state. */ constructor () internal { _paused = false; } /** * @dev Returns true if the contract is paused, and false otherwise. */ function paused() public view virtual returns (bool) { return _paused; } /** * @dev Modifier to make a function callable only when the contract is not paused. * * Requirements: * * - The contract must not be paused. */ modifier whenNotPaused() { require(!paused(), "Pausable: paused"); _; } /** * @dev Modifier to make a function callable only when the contract is paused. * * Requirements: * * - The contract must be paused. */ modifier whenPaused() { require(paused(), "Pausable: not paused"); _; } /** * @dev Triggers stopped state. * * Requirements: * * - The contract must not be paused. */ function _pause() internal virtual whenNotPaused { _paused = true; emit Paused(_msgSender()); } /** * @dev Returns to normal state. * * Requirements: * * - The contract must be paused. */ function _unpause() internal virtual whenPaused { _paused = false; emit Unpaused(_msgSender()); } }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.11; interface AToken { /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.11; interface ILendingPool { function deposit(address _reserve, uint256 _amount, address onBehalfOf, uint16 _referralCode) external; //see: https://github.com/aave/aave-protocol/blob/1ff8418eb5c73ce233ac44bfb7541d07828b273f/contracts/tokenization/AToken.sol#L218 function withdraw(address asset, uint amount, address to) external; } interface AaveProtocolDataProvider { function getReserveTokensAddresses(address asset) external view returns(address, address, address); }
// SPDX-License-Identifier: UNLICENSED pragma solidity 0.6.11; /** @title ILendingPoolAddressesProvider interface @notice provides the interface to fetch the LendingPoolCore address */ abstract contract ILendingPoolAddressesProvider { function getLendingPool() public virtual view returns (address); function setLendingPoolImpl(address _pool) public virtual; function getAddress(bytes32 id) public virtual view returns (address); function getLendingPoolCore() public virtual view returns (address payable); function setLendingPoolCoreImpl(address _lendingPoolCore) public virtual; function getLendingPoolConfigurator() public virtual view returns (address); function setLendingPoolConfiguratorImpl(address _configurator) public virtual; function getLendingPoolDataProvider() public virtual view returns (address); function setLendingPoolDataProviderImpl(address _provider) public virtual; function getLendingPoolParametersProvider() public virtual view returns (address); function setLendingPoolParametersProviderImpl(address _parametersProvider) public virtual; function getTokenDistributor() public virtual view returns (address); function setTokenDistributor(address _tokenDistributor) public virtual; function getFeeProvider() public virtual view returns (address); function setFeeProviderImpl(address _feeProvider) public virtual; function getLendingPoolLiquidationManager() public virtual view returns (address); function setLendingPoolLiquidationManager(address _manager) public virtual; function getLendingPoolManager() public virtual view returns (address); function setLendingPoolManager(address _lendingPoolManager) public virtual; function getPriceOracle() public virtual view returns (address); function setPriceOracle(address _priceOracle) public virtual; function getLendingRateOracle() public virtual view returns (address); function setLendingRateOracle(address _lendingRateOracle) public virtual; }
{ "evmVersion": "istanbul", "libraries": {}, "metadata": { "bytecodeHash": "ipfs" }, "optimizer": { "enabled": true, "runs": 1500 }, "remappings": [], "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } } }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"contract IERC20","name":"_inboundCurrency","type":"address"},{"internalType":"contract ILendingPoolAddressesProvider","name":"_lendingPoolAddressProvider","type":"address"},{"internalType":"uint256","name":"_segmentCount","type":"uint256"},{"internalType":"uint256","name":"_segmentLength","type":"uint256"},{"internalType":"uint256","name":"_segmentPayment","type":"uint256"},{"internalType":"uint256","name":"_earlyWithdrawalFee","type":"uint256"},{"internalType":"uint256","name":"_customFee","type":"uint256"},{"internalType":"address","name":"_dataProvider","type":"address"},{"internalType":"uint256","name":"_maxPlayersCount","type":"uint256"},{"internalType":"contract IERC20","name":"_incentiveToken","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"admin","type":"address"},{"indexed":false,"internalType":"uint256","name":"totalGameInterest","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"adminFeeAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"adminIncentiveAmount","type":"uint256"}],"name":"AdminWithdrawal","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"player","type":"address"},{"indexed":true,"internalType":"uint256","name":"segment","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalGamePrincipal","type":"uint256"}],"name":"EarlyWithdrawal","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"totalAmount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalGamePrincipal","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalGameInterest","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"rewards","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"totalIncentiveAmount","type":"uint256"}],"name":"FundsRedeemedFromExternalPool","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"JoinedGame","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"winners","type":"address[]"}],"name":"WinnersAnnouncement","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"player","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"playerReward","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"playerIncentive","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[],"name":"activePlayersCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adaiToken","outputs":[{"internalType":"contract AToken","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adminFeeAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"adminFeeWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"adminWithdraw","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"customFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"daiToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"earlyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"earlyWithdrawalFee","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"firstSegmentStart","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCurrentSegment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getNumberOfPlayers","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"incentiveToken","outputs":[{"internalType":"contract IERC20","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"isGameCompleted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"iterablePlayers","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"joinGame","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lastSegment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lendingPool","outputs":[{"internalType":"contract ILendingPool","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lendingPoolAddressProvider","outputs":[{"internalType":"contract ILendingPoolAddressesProvider","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"makeDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"maxPlayersCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"players","outputs":[{"internalType":"address","name":"addr","type":"address"},{"internalType":"bool","name":"withdrawn","type":"bool"},{"internalType":"bool","name":"canRejoin","type":"bool"},{"internalType":"uint256","name":"mostRecentSegmentPaid","type":"uint256"},{"internalType":"uint256","name":"amountPaid","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"redeemFromExternalPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"redeemed","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"segmentLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"segmentPayment","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalGameInterest","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalGamePrincipal","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalIncentiveAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"winners","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Contract Creation Code
6101e0604052600060055560006006553480156200001c57600080fd5b50604051620034283803806200342883398181016040526101408110156200004357600080fd5b508051602082015160408301516060840151608085015160a086015160c087015160e0880151610100890151610120909901519798969795969495939492939192909160006200009b6001600160e01b036200052c16565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3506000805460ff60a01b191690556014841115620001345760405162461bcd60e51b815260040180806020018281038252602c815260200180620032cd602c913960400191505060405180910390fd5b600a851115620001765760405162461bcd60e51b8152600401808060200182810382526035815260200180620033c86035913960400191505060405180910390fd5b60008511620001b75760405162461bcd60e51b815260040180806020018281038252602d8152602001806200334b602d913960400191505060405180910390fd5b60008211620001f85760405162461bcd60e51b815260040180806020018281038252602a815260200180620032f9602a913960400191505060405180910390fd5b6001600160a01b038a1662000254576040805162461bcd60e51b815260206004820181905260248201527f696e76616c6964205f696e626f756e6443757272656e63792061646472657373604482015290519081900360640190fd5b6001600160a01b0389166200029b5760405162461bcd60e51b815260040180806020018281038252602b815260200180620033fd602b913960400191505060405180910390fd5b60008811620002dc5760405162461bcd60e51b8152600401808060200182810382526027815260200180620033786027913960400191505060405180910390fd5b600087116200031d5760405162461bcd60e51b8152600401808060200182810382526028815260200180620033236028913960400191505060405180910390fd5b600086116200035e5760405162461bcd60e51b81526004018080602001828103825260298152602001806200339f6029913960400191505060405180910390fd5b6001600160a01b038316620003ba576040805162461bcd60e51b815260206004820152601d60248201527f696e76616c6964205f6461746150726f76696465722061646472657373000000604482015290519081900360640190fd5b426101205261010088905261014087905260e08690526101608590526101808490526001600160601b031960608b811b82166080528a901b1660c05260408051630261bf8b60e01b8152905184916001600160a01b038c1691630261bf8b91600480820192602092909190829003018186803b1580156200043a57600080fd5b505afa1580156200044f573d6000803e3d6000fd5b505050506040513d60208110156200046657600080fd5b5051600780546001600160a01b0319166001600160a01b03928316179055604080516334924edb60e21b81528d83166004820152905160009284169163d2493b6c916024808301926060929190829003018186803b158015620004c857600080fd5b505afa158015620004dd573d6000803e3d6000fd5b505050506040513d6060811015620004f457600080fd5b50516001600160601b0319606091821b811660a0526101a0959095529290921b9092166101c052506200053098505050505050505050565b3390565b60805160601c60a05160601c60c05160601c60e05161010051610120516101405161016051610180516101a0516101c05160601c612c756200065860003980610b9552806110be52806116e35280611c1e5280611c6b5250806111b9528061274a5250806110705280611d095280611d3852508061067652806108ad525080611377528061194e525080610c4652806119735250806104a952806109ce5280610e665280610f795280611348525080610485528061100252806120e752806121ee5280612237528061229952806128c952508061109a5250806112f15280611a7752508061075852806107f55280610ab9528061132252806115ed5280611b0a5280611ba7528061211152806122c952806123b1528061246c52806125525250612c756000f3fe608060405234801561001057600080fd5b50600436106102775760003560e01c80638456cb5911610160578063d013666e116100d8578063f18d20be1161008c578063f5c9786711610071578063f5c978671461046b578063f8dd5ad314610473578063fd6673f51461047b57610277565b8063f18d20be1461043d578063f2fde38b1461044557610277565b8063e0236a18116100bd578063e0236a18146103d2578063e231bff0146103da578063e2eb41ff146103e257610277565b8063d013666e146103c2578063d4f77b1c146103ca57610277565b8063a59a99731161012f578063aad739f511610114578063aad739f514610395578063be22f546146103b2578063c39b583c146103ba57610277565b8063a59a997314610385578063a98a5c941461038d57610277565b80638456cb59146103505780638da5cb5b1461035857806395224b3314610360578063a2fb11751461036857610277565b80635c975abb116101f3578063638126f8116101c2578063715018a6116101a7578063715018a6146103385780637a23032c146103405780637c80e6da1461034857610277565b8063638126f8146103285780636a79328a1461033057610277565b80635c975abb146102d85780635edafd5a146102f45780635faeea37146102fc578063633803001461030457610277565b8063250a2b0d1161024a5780633e7433eb1161022f5780633e7433eb146102c05780633f4ba83a146102c857806340732c89146102d057610277565b8063250a2b0d146102b05780633ccfd60b146102b857610277565b80630c8ac6451461027c57806311b2e2d91461029657806315d74bb31461029e57806316330d40146102a8575b600080fd5b610284610483565b60408051918252519081900360200190f35b6102846104a7565b6102a66104cb565b005b6102846108ab565b6102846108cf565b6102a66108d5565b610284610c44565b6102a6610c68565b6102a6610d3f565b6102e061105e565b604080519115158252519081900360200190f35b61028461106e565b610284611092565b61030c611098565b604080516001600160a01b039092168252519081900360200190f35b61030c6110bc565b6102846110e0565b6102a66110e6565b6102846111b1565b6102846111b7565b6102a66111db565b61030c6112a4565b6102846112b3565b61030c6004803603602081101561037e57600080fd5b50356112b9565b61030c6112e0565b61030c6112ef565b61030c600480360360208110156103ab57600080fd5b5035611313565b61030c611320565b6102e0611344565b610284611375565b6102a6611399565b6102a66113ee565b6102e06117cf565b610408600480360360208110156103f857600080fd5b50356001600160a01b03166117df565b604080516001600160a01b03909616865293151560208601529115158484015260608401526080830152519081900360a00190f35b6102e061181d565b6102a66004803603602081101561045b57600080fd5b50356001600160a01b0316611826565b610284611947565b6102a66119a2565b610284611e77565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b6104d361105e565b15610518576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b610520611344565b15610572576040805162461bcd60e51b815260206004820152601960248201527f47616d6520697320616c726561647920636f6d706c6574656400000000000000604482015290519081900360640190fd5b33600090815260086020526040902060028101546105d7576040805162461bcd60e51b815260206004820152601560248201527f506c6179657220646f6573206e6f742065786973740000000000000000000000604482015290519081900360640190fd5b8054600160a01b900460ff1615610635576040805162461bcd60e51b815260206004820152601c60248201527f506c617965722068617320616c72656164792077697468647261776e00000000604482015290519081900360640190fd5b805460ff60a01b1916600160a01b17815560065461065a90600163ffffffff611e7d16565b60065560028101546000906106bd906106ac906064906106a0907f000000000000000000000000000000000000000000000000000000000000000063ffffffff611edf16565b9063ffffffff611f3f16565b60028401549063ffffffff611e7d16565b90506106d88260020154600254611e7d90919063ffffffff16565b60025560006106e5611947565b9050806106fe57825460ff60a81b1916600160a81b1783555b600254604080518481526020810192909252805133927f1670585e36568ede58d159518ce92cad99f75ad41c7d8281df3dd4eaa0c855d092908290030190a260075460408051631a4ca37b60e21b81526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015260248201869052306044830152915191909216916369328dec91606480830192600092919082900301818387803b1580156107b857600080fd5b505af11580156107cc573d6000803e3d6000fd5b50506040805163a9059cbb60e01b81523360048201526024810186905290516001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016935063a9059cbb925060448083019260209291908290030181600087803b15801561083f57600080fd5b505af1158015610853573d6000803e3d6000fd5b505050506040513d602081101561086957600080fd5b50516108a65760405162461bcd60e51b815260040180806020018281038252602f81526020018061297b602f913960400191505060405180910390fd5b505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b60065481565b336000908152600860205260409020600281015461093a576040805162461bcd60e51b815260206004820152601560248201527f506c6179657220646f6573206e6f742065786973740000000000000000000000604482015290519081900360640190fd5b8054600160a01b900460ff1615610998576040805162461bcd60e51b815260206004820152601c60248201527f506c617965722068617320616c72656164792077697468647261776e00000000604482015290519081900360640190fd5b805460ff60a01b1916600160a01b178155600054600160a81b900460ff166109c2576109c26119a2565b600281015460006109fa7f0000000000000000000000000000000000000000000000000000000000000000600163ffffffff611e7d16565b83600101541415610a4f57600a54600154610a2c91610a1f919063ffffffff611f3f16565b839063ffffffff611fa616565b60055490925015610a4f57600a54600554610a4c9163ffffffff611f3f16565b90505b6040805183815260006020820152808201839052905133917f650fdf669e93aa6c8ff3defe2da9c12b64f1548e5e1e54e803f4c1beb6466c8e919081900360600190a26040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163a9059cbb9160448083019260209291908290030181600087803b158015610b0157600080fd5b505af1158015610b15573d6000803e3d6000fd5b505050506040513d6020811015610b2b57600080fd5b5051610b685760405162461bcd60e51b8152600401808060200182810382526029815260200180612ab76029913960400191505060405180910390fd5b80156108a6576040805163a9059cbb60e01b81523360048201526024810183905290516001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163a9059cbb9160448083019260209291908290030181600087803b158015610bdd57600080fd5b505af1158015610bf1573d6000803e3d6000fd5b505050506040513d6020811015610c0757600080fd5b50516108a65760405162461bcd60e51b8152600401808060200182810382526033815260200180612bda6033913960400191505060405180910390fd5b7f000000000000000000000000000000000000000000000000000000000000000081565b610c70612000565b6001600160a01b0316610c816112a4565b6001600160a01b031614610cdc576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b610ce461105e565b610d35576040805162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b610d3d612004565b565b610d4761105e565b15610d8c576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b33600090815260086020526040902054600160a01b900460ff1615610de25760405162461bcd60e51b8152600401808060200182810382526021815260200180612b736021913960400191505060405180910390fd5b336000818152600860205260409020546001600160a01b031614610e4d576040805162461bcd60e51b815260206004820152601660248201527f53656e646572206973206e6f74206120706c6179657200000000000000000000604482015290519081900360640190fd5b6000610e57611947565b9050600081118015610e8857507f000000000000000000000000000000000000000000000000000000000000000081105b610ec35760405162461bcd60e51b8152600401808060200182810382526046815260200180612a236046913960600191505060405180910390fd5b33600090815260086020526040902060010154811415610f145760405162461bcd60e51b8152600401808060200182810382526023815260200180612bb76023913960400191505060405180910390fd5b610f2581600163ffffffff611e7d16565b3360009081526008602052604090206001015414610f745760405162461bcd60e51b8152600401808060200182810382526033815260200180612c0d6033913960400191505060405180910390fd5b610fa57f0000000000000000000000000000000000000000000000000000000000000000600163ffffffff611e7d16565b811415610ffc57600a80546001810182556000919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a801805473ffffffffffffffffffffffffffffffffffffffff1916331790555b604080517f000000000000000000000000000000000000000000000000000000000000000081529051829133917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a361105b6120b0565b50565b600054600160a01b900460ff1690565b7f000000000000000000000000000000000000000000000000000000000000000081565b60025481565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000081565b60055481565b6110ee612000565b6001600160a01b03166110ff6112a4565b6001600160a01b03161461115a576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60035481565b7f000000000000000000000000000000000000000000000000000000000000000081565b6111e3612000565b6001600160a01b03166111f46112a4565b6001600160a01b03161461124f576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61125761105e565b1561129c576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b610d3d6125d5565b6000546001600160a01b031690565b60015481565b600a81815481106112c657fe5b6000918252602090912001546001600160a01b0316905081565b6007546001600160a01b031681565b7f000000000000000000000000000000000000000000000000000000000000000081565b600981815481106112c657fe5b7f000000000000000000000000000000000000000000000000000000000000000081565b60007f000000000000000000000000000000000000000000000000000000000000000061136f611947565b11905090565b7f000000000000000000000000000000000000000000000000000000000000000081565b6113a161105e565b156113e6576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b610d3d61265e565b6113f6612000565b6001600160a01b03166114076112a4565b6001600160a01b031614611462576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61146a611344565b6114bb576040805162461bcd60e51b815260206004820152601560248201527f47616d65206973206e6f7420636f6d706c657465640000000000000000000000604482015290519081900360640190fd5b600054600160a81b900460ff166115035760405162461bcd60e51b8152600401808060200182810382526025815260200180612a696025913960400191505060405180910390fd5b60045460ff161561155b576040805162461bcd60e51b815260206004820152601b60248201527f41646d696e2068617320616c72656164792077697468647261776e0000000000604482015290519081900360640190fd5b6004805460ff19166001179055600a5460009015801561157d57506000600554115b1561158757506005545b61158f6112a4565b6001600160a01b03167f80ebcacc706983394bb8fcc88ea7b9241338fb4617fffbea411b68b40ed5627e6001546003548460405180848152602001838152602001828152602001935050505060405180910390a2600354156116db577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb6116226112a4565b6003546040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561167457600080fd5b505af1158015611688573d6000803e3d6000fd5b505050506040513d602081101561169e57600080fd5b50516116db5760405162461bcd60e51b81526004018080602001828103825260258152602001806129fe6025913960400191505060405180910390fd5b801561105b577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663a9059cbb6117186112a4565b836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561176857600080fd5b505af115801561177c573d6000803e3d6000fd5b505050506040513d602081101561179257600080fd5b505161105b5760405162461bcd60e51b815260040180806020018281038252602f815260200180612b01602f913960400191505060405180910390fd5b600054600160a81b900460ff1681565b6008602052600090815260409020805460018201546002909201546001600160a01b0382169260ff600160a01b8404811693600160a81b9004169185565b60045460ff1681565b61182e612000565b6001600160a01b031661183f6112a4565b6001600160a01b03161461189a576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166118df5760405162461bcd60e51b81526004018080602001828103825260268152602001806129d86026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b600061199d7f00000000000000000000000000000000000000000000000000000000000000006106a0427f000000000000000000000000000000000000000000000000000000000000000063ffffffff611e7d16565b905090565b6119aa611344565b6119fb576040805162461bcd60e51b815260206004820152601560248201527f47616d65206973206e6f7420636f6d706c657465640000000000000000000000604482015290519081900360640190fd5b600054600160a81b900460ff1615611a445760405162461bcd60e51b815260040180806020018281038252602e8152602001806129aa602e913960400191505060405180910390fd5b6000805460ff60a81b1916600160a81b178155604080516370a0823160e01b815230600482015290516001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916370a08231916024808301926020929190829003018186803b158015611abd57600080fd5b505afa158015611ad1573d6000803e3d6000fd5b505050506040513d6020811015611ae757600080fd5b50511115611b845760075460408051631a4ca37b60e21b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000811660048301526000196024830152306044830152915191909216916369328dec91606480830192600092919082900301818387803b158015611b6b57600080fd5b505af1158015611b7f573d6000803e3d6000fd5b505050505b604080516370a0823160e01b815230600482015290516000916001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916370a0823191602480820192602092909190829003018186803b158015611bee57600080fd5b505afa158015611c02573d6000803e3d6000fd5b505050506040513d6020811015611c1857600080fd5b505190507f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031615611ce157604080516370a0823160e01b815230600482015290516001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916370a08231916024808301926020929190829003018186803b158015611cb157600080fd5b505afa158015611cc5573d6000803e3d6000fd5b505050506040513d6020811015611cdb57600080fd5b50516005555b600254600090821115611d0557600254611d0290839063ffffffff611e7d16565b90505b60007f000000000000000000000000000000000000000000000000000000000000000015611d7c57611d6260646106a0847f000000000000000000000000000000000000000000000000000000000000000063ffffffff611edf16565b9050611d74828263ffffffff611e7d16565b600155611d85565b50600181905560005b600a54611d96576003829055611d9c565b60038190555b60025460015460055460408051878152602081019490945283810192909252600060608401526080830152517f28d72925fdcea205b246c820015bd35812a740d1ec1a5cdc84f7784b50940fbb9181900360a00190a17fdbb9607e18553d40c255226e09883b48f92a108f6f895b0f37db6ae0d7fd56e6600a60405180806020018281038252838181548152602001915080548015611e6457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611e46575b50509250505060405180910390a1505050565b60095490565b600082821115611ed4576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b508082035b92915050565b600082611eee57506000611ed9565b82820282848281611efb57fe5b0414611f385760405162461bcd60e51b8152600401808060200182810382526021815260200180612ae06021913960400191505060405180910390fd5b9392505050565b6000808211611f95576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381611f9e57fe5b049392505050565b600082820183811015611f38576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b3390565b61200c61105e565b61205d576040805162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612093612000565b604080516001600160a01b039092168252519081900360200190a1565b604080517fdd62ed3e00000000000000000000000000000000000000000000000000000000815233600482015230602482015290517f0000000000000000000000000000000000000000000000000000000000000000916001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169163dd62ed3e91604480820192602092909190829003018186803b15801561215857600080fd5b505afa15801561216c573d6000803e3d6000fd5b505050506040513d602081101561218257600080fd5b505110156121c15760405162461bcd60e51b8152600401808060200182810382526043815260200180612b306043913960600191505060405180910390fd5b60006121cb611947565b3360009081526008602052604090206001810182905560020154909150612218907f000000000000000000000000000000000000000000000000000000000000000063ffffffff611fa616565b33600090815260086020526040902060029081019190915554612261907f000000000000000000000000000000000000000000000000000000000000000063ffffffff611fa616565b600255604080517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201523060248201527f0000000000000000000000000000000000000000000000000000000000000000604482015290516001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916323b872dd9160648083019260209291908290030181600087803b15801561231157600080fd5b505af1158015612325573d6000803e3d6000fd5b505050506040513d602081101561233b57600080fd5b505161238e576040805162461bcd60e51b815260206004820152600f60248201527f5472616e73666572206661696c65640000000000000000000000000000000000604482015290519081900360640190fd5b604080516370a0823160e01b815230600482015290516000916001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916370a0823191602480820192602092909190829003018186803b1580156123f857600080fd5b505afa15801561240c573d6000803e3d6000fd5b505050506040513d602081101561242257600080fd5b5051600754604080517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b0392831660048201526024810184905290519293507f00000000000000000000000000000000000000000000000000000000000000009091169163095ea7b3916044808201926020929091908290030181600087803b1580156124b757600080fd5b505af11580156124cb573d6000803e3d6000fd5b505050506040513d60208110156124e157600080fd5b505161251e5760405162461bcd60e51b8152600401808060200182810382526029815260200180612a8e6029913960400191505060405180910390fd5b600754604080517fe8eda9df0000000000000000000000000000000000000000000000000000000081526001600160a01b037f00000000000000000000000000000000000000000000000000000000000000008116600483015260248201859052306044830152609b60648301529151919092169163e8eda9df91608480830192600092919082900301818387803b1580156125b957600080fd5b505af11580156125cd573d6000803e3d6000fd5b505050505050565b6125dd61105e565b15612622576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612093612000565b612666611947565b156126b8576040805162461bcd60e51b815260206004820152601860248201527f47616d652068617320616c726561647920737461727465640000000000000000604482015290519081900360640190fd5b336000818152600860205260409020546001600160a01b03161415806126f4575033600090815260086020526040902054600160a81b900460ff165b61272f5760405162461bcd60e51b8152600401808060200182810382526023815260200180612b946023913960400191505060405180910390fd5b60065461274390600163ffffffff611fa616565b60068190557f000000000000000000000000000000000000000000000000000000000000000010156127a65760405162461bcd60e51b81526004018080602001828103825260278152602001806129546027913960400191505060405180910390fd5b33600090815260086020526040902054600160a81b900460ff166127c8612925565b506040805160a08101825233808252600060208084018281528486018381526060860184815260808701858152958552600890935295909220845181549351965173ffffffffffffffffffffffffffffffffffffffff199094166001600160a01b039091161760ff60a01b1916600160a01b961515969096029590951760ff60a81b1916600160a81b9215159290920291909117845551600184015551600290920191909155816128c357600980546001810182556000919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805473ffffffffffffffffffffffffffffffffffffffff1916331790555b604080517f00000000000000000000000000000000000000000000000000000000000000008152905133917f485fd86c2a7d2d9ca3bf02e2ba776ea24271bc62274265b0bd5f478b3b7a1ca4919081900360200190a26129216120b0565b5050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091529056fe52656163686564206d6178207175616e74697479206f6620706c617965727320616c6c6f7765644661696c20746f207472616e7366657220455243323020746f6b656e73206f6e206561726c7920776974686472617752656465656d206f7065726174696f6e20616c72656164792068617070656e656420666f72207468652067616d654f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734661696c20746f207472616e73666572204552323020746f6b656e7320746f2061646d696e4465706f73697420617661696c61626c65206f6e6c79206265747765656e207365676d656e74203120616e64207365676d656e74206e2d31202870656e756c74696d6174652946756e6473206e6f742072656465656d65642066726f6d2065787465726e616c20706f6f6c4661696c20746f20617070726f766520616c6c6f77616e636520746f206c656e64696e6720706f6f6c4661696c20746f207472616e7366657220455243323020746f6b656e73206f6e207769746864726177536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774661696c20746f207472616e73666572204552323020696e63656e7469766520746f6b656e7320746f2061646d696e596f75206e65656420746f206861766520616c6c6f77616e636520746f20646f207472616e7366657220444149206f6e2074686520736d61727420636f6e7472616374506c6179657220616c72656164792077697468647261772066726f6d2067616d6543616e6e6f74206a6f696e207468652067616d65206d6f7265207468616e206f6e6365506c6179657220616c726561647920706169642063757272656e74207365676d656e744661696c20746f207472616e7366657220455243323020696e63656e7469766520746f6b656e73206f6e207769746864726177506c61796572206469646e277420706179207468652070726576696f7573207365676d656e74202d2067616d65206f76657221a2646970667358221220db570268f5699101f5cf9620863898a163eab3c5755e5ec495c88f3a2717afde64736f6c634300060b00335f637573746f6d466565206d757374206265206c657373207468616e206f7220657175616c20746f203230255f6d6178506c6179657273436f756e74206d7573742062652067726561746572207468616e207a65726f5f7365676d656e744c656e677468206d7573742062652067726561746572207468616e207a65726f5f6561726c795769746864726177616c466565206d7573742062652067726561746572207468616e207a65726f5f7365676d656e74436f756e74206d7573742062652067726561746572207468616e207a65726f5f7365676d656e745061796d656e74206d7573742062652067726561746572207468616e207a65726f5f6561726c795769746864726177616c466565206d757374206265206c657373207468616e206f7220657175616c20746f20313025696e76616c6964205f6c656e64696e67506f6f6c4164647265737350726f76696465722061646472657373000000000000000000000000765de816845861e75a25fca122bb6898b8b1282a000000000000000000000000d1088091a174d33412a968fa34cb67131188b3320000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000012c0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000043d067ed784d9dd2ffeda73775e2cc4c560103a100000000000000000000000000000000000000000000000000000000000000c8000000000000000000000000471ece3750da237f93b8e339c536989b8978a438
Deployed Bytecode
0x608060405234801561001057600080fd5b50600436106102775760003560e01c80638456cb5911610160578063d013666e116100d8578063f18d20be1161008c578063f5c9786711610071578063f5c978671461046b578063f8dd5ad314610473578063fd6673f51461047b57610277565b8063f18d20be1461043d578063f2fde38b1461044557610277565b8063e0236a18116100bd578063e0236a18146103d2578063e231bff0146103da578063e2eb41ff146103e257610277565b8063d013666e146103c2578063d4f77b1c146103ca57610277565b8063a59a99731161012f578063aad739f511610114578063aad739f514610395578063be22f546146103b2578063c39b583c146103ba57610277565b8063a59a997314610385578063a98a5c941461038d57610277565b80638456cb59146103505780638da5cb5b1461035857806395224b3314610360578063a2fb11751461036857610277565b80635c975abb116101f3578063638126f8116101c2578063715018a6116101a7578063715018a6146103385780637a23032c146103405780637c80e6da1461034857610277565b8063638126f8146103285780636a79328a1461033057610277565b80635c975abb146102d85780635edafd5a146102f45780635faeea37146102fc578063633803001461030457610277565b8063250a2b0d1161024a5780633e7433eb1161022f5780633e7433eb146102c05780633f4ba83a146102c857806340732c89146102d057610277565b8063250a2b0d146102b05780633ccfd60b146102b857610277565b80630c8ac6451461027c57806311b2e2d91461029657806315d74bb31461029e57806316330d40146102a8575b600080fd5b610284610483565b60408051918252519081900360200190f35b6102846104a7565b6102a66104cb565b005b6102846108ab565b6102846108cf565b6102a66108d5565b610284610c44565b6102a6610c68565b6102a6610d3f565b6102e061105e565b604080519115158252519081900360200190f35b61028461106e565b610284611092565b61030c611098565b604080516001600160a01b039092168252519081900360200190f35b61030c6110bc565b6102846110e0565b6102a66110e6565b6102846111b1565b6102846111b7565b6102a66111db565b61030c6112a4565b6102846112b3565b61030c6004803603602081101561037e57600080fd5b50356112b9565b61030c6112e0565b61030c6112ef565b61030c600480360360208110156103ab57600080fd5b5035611313565b61030c611320565b6102e0611344565b610284611375565b6102a6611399565b6102a66113ee565b6102e06117cf565b610408600480360360208110156103f857600080fd5b50356001600160a01b03166117df565b604080516001600160a01b03909616865293151560208601529115158484015260608401526080830152519081900360a00190f35b6102e061181d565b6102a66004803603602081101561045b57600080fd5b50356001600160a01b0316611826565b610284611947565b6102a66119a2565b610284611e77565b7f0000000000000000000000000000000000000000000000000de0b6b3a764000081565b7f000000000000000000000000000000000000000000000000000000000000000281565b6104d361105e565b15610518576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b610520611344565b15610572576040805162461bcd60e51b815260206004820152601960248201527f47616d6520697320616c726561647920636f6d706c6574656400000000000000604482015290519081900360640190fd5b33600090815260086020526040902060028101546105d7576040805162461bcd60e51b815260206004820152601560248201527f506c6179657220646f6573206e6f742065786973740000000000000000000000604482015290519081900360640190fd5b8054600160a01b900460ff1615610635576040805162461bcd60e51b815260206004820152601c60248201527f506c617965722068617320616c72656164792077697468647261776e00000000604482015290519081900360640190fd5b805460ff60a01b1916600160a01b17815560065461065a90600163ffffffff611e7d16565b60065560028101546000906106bd906106ac906064906106a0907f000000000000000000000000000000000000000000000000000000000000000163ffffffff611edf16565b9063ffffffff611f3f16565b60028401549063ffffffff611e7d16565b90506106d88260020154600254611e7d90919063ffffffff16565b60025560006106e5611947565b9050806106fe57825460ff60a81b1916600160a81b1783555b600254604080518481526020810192909252805133927f1670585e36568ede58d159518ce92cad99f75ad41c7d8281df3dd4eaa0c855d092908290030190a260075460408051631a4ca37b60e21b81526001600160a01b037f000000000000000000000000765de816845861e75a25fca122bb6898b8b1282a8116600483015260248201869052306044830152915191909216916369328dec91606480830192600092919082900301818387803b1580156107b857600080fd5b505af11580156107cc573d6000803e3d6000fd5b50506040805163a9059cbb60e01b81523360048201526024810186905290516001600160a01b037f000000000000000000000000765de816845861e75a25fca122bb6898b8b1282a16935063a9059cbb925060448083019260209291908290030181600087803b15801561083f57600080fd5b505af1158015610853573d6000803e3d6000fd5b505050506040513d602081101561086957600080fd5b50516108a65760405162461bcd60e51b815260040180806020018281038252602f81526020018061297b602f913960400191505060405180910390fd5b505050565b7f000000000000000000000000000000000000000000000000000000000000000181565b60065481565b336000908152600860205260409020600281015461093a576040805162461bcd60e51b815260206004820152601560248201527f506c6179657220646f6573206e6f742065786973740000000000000000000000604482015290519081900360640190fd5b8054600160a01b900460ff1615610998576040805162461bcd60e51b815260206004820152601c60248201527f506c617965722068617320616c72656164792077697468647261776e00000000604482015290519081900360640190fd5b805460ff60a01b1916600160a01b178155600054600160a81b900460ff166109c2576109c26119a2565b600281015460006109fa7f0000000000000000000000000000000000000000000000000000000000000002600163ffffffff611e7d16565b83600101541415610a4f57600a54600154610a2c91610a1f919063ffffffff611f3f16565b839063ffffffff611fa616565b60055490925015610a4f57600a54600554610a4c9163ffffffff611f3f16565b90505b6040805183815260006020820152808201839052905133917f650fdf669e93aa6c8ff3defe2da9c12b64f1548e5e1e54e803f4c1beb6466c8e919081900360600190a26040805163a9059cbb60e01b81523360048201526024810184905290516001600160a01b037f000000000000000000000000765de816845861e75a25fca122bb6898b8b1282a169163a9059cbb9160448083019260209291908290030181600087803b158015610b0157600080fd5b505af1158015610b15573d6000803e3d6000fd5b505050506040513d6020811015610b2b57600080fd5b5051610b685760405162461bcd60e51b8152600401808060200182810382526029815260200180612ab76029913960400191505060405180910390fd5b80156108a6576040805163a9059cbb60e01b81523360048201526024810183905290516001600160a01b037f000000000000000000000000471ece3750da237f93b8e339c536989b8978a438169163a9059cbb9160448083019260209291908290030181600087803b158015610bdd57600080fd5b505af1158015610bf1573d6000803e3d6000fd5b505050506040513d6020811015610c0757600080fd5b50516108a65760405162461bcd60e51b8152600401808060200182810382526033815260200180612bda6033913960400191505060405180910390fd5b7f000000000000000000000000000000000000000000000000000000006154daf581565b610c70612000565b6001600160a01b0316610c816112a4565b6001600160a01b031614610cdc576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b610ce461105e565b610d35576040805162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b610d3d612004565b565b610d4761105e565b15610d8c576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b33600090815260086020526040902054600160a01b900460ff1615610de25760405162461bcd60e51b8152600401808060200182810382526021815260200180612b736021913960400191505060405180910390fd5b336000818152600860205260409020546001600160a01b031614610e4d576040805162461bcd60e51b815260206004820152601660248201527f53656e646572206973206e6f74206120706c6179657200000000000000000000604482015290519081900360640190fd5b6000610e57611947565b9050600081118015610e8857507f000000000000000000000000000000000000000000000000000000000000000281105b610ec35760405162461bcd60e51b8152600401808060200182810382526046815260200180612a236046913960600191505060405180910390fd5b33600090815260086020526040902060010154811415610f145760405162461bcd60e51b8152600401808060200182810382526023815260200180612bb76023913960400191505060405180910390fd5b610f2581600163ffffffff611e7d16565b3360009081526008602052604090206001015414610f745760405162461bcd60e51b8152600401808060200182810382526033815260200180612c0d6033913960400191505060405180910390fd5b610fa57f0000000000000000000000000000000000000000000000000000000000000002600163ffffffff611e7d16565b811415610ffc57600a80546001810182556000919091527fc65a7bb8d6351c1cf70c95a316cc6a92839c986682d98bc35f958f4883f9d2a801805473ffffffffffffffffffffffffffffffffffffffff1916331790555b604080517f0000000000000000000000000000000000000000000000000de0b6b3a764000081529051829133917f90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a159181900360200190a361105b6120b0565b50565b600054600160a01b900460ff1690565b7f000000000000000000000000000000000000000000000000000000000000000081565b60025481565b7f000000000000000000000000d1088091a174d33412a968fa34cb67131188b33281565b7f000000000000000000000000471ece3750da237f93b8e339c536989b8978a43881565b60055481565b6110ee612000565b6001600160a01b03166110ff6112a4565b6001600160a01b03161461115a576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a36000805473ffffffffffffffffffffffffffffffffffffffff19169055565b60035481565b7f00000000000000000000000000000000000000000000000000000000000000c881565b6111e3612000565b6001600160a01b03166111f46112a4565b6001600160a01b03161461124f576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61125761105e565b1561129c576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b610d3d6125d5565b6000546001600160a01b031690565b60015481565b600a81815481106112c657fe5b6000918252602090912001546001600160a01b0316905081565b6007546001600160a01b031681565b7f000000000000000000000000918146359264c492bd6934071c6bd31c854edbc381565b600981815481106112c657fe5b7f000000000000000000000000765de816845861e75a25fca122bb6898b8b1282a81565b60007f000000000000000000000000000000000000000000000000000000000000000261136f611947565b11905090565b7f000000000000000000000000000000000000000000000000000000000000012c81565b6113a161105e565b156113e6576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b610d3d61265e565b6113f6612000565b6001600160a01b03166114076112a4565b6001600160a01b031614611462576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b61146a611344565b6114bb576040805162461bcd60e51b815260206004820152601560248201527f47616d65206973206e6f7420636f6d706c657465640000000000000000000000604482015290519081900360640190fd5b600054600160a81b900460ff166115035760405162461bcd60e51b8152600401808060200182810382526025815260200180612a696025913960400191505060405180910390fd5b60045460ff161561155b576040805162461bcd60e51b815260206004820152601b60248201527f41646d696e2068617320616c72656164792077697468647261776e0000000000604482015290519081900360640190fd5b6004805460ff19166001179055600a5460009015801561157d57506000600554115b1561158757506005545b61158f6112a4565b6001600160a01b03167f80ebcacc706983394bb8fcc88ea7b9241338fb4617fffbea411b68b40ed5627e6001546003548460405180848152602001838152602001828152602001935050505060405180910390a2600354156116db577f000000000000000000000000765de816845861e75a25fca122bb6898b8b1282a6001600160a01b031663a9059cbb6116226112a4565b6003546040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561167457600080fd5b505af1158015611688573d6000803e3d6000fd5b505050506040513d602081101561169e57600080fd5b50516116db5760405162461bcd60e51b81526004018080602001828103825260258152602001806129fe6025913960400191505060405180910390fd5b801561105b577f000000000000000000000000471ece3750da237f93b8e339c536989b8978a4386001600160a01b031663a9059cbb6117186112a4565b836040518363ffffffff1660e01b815260040180836001600160a01b03166001600160a01b0316815260200182815260200192505050602060405180830381600087803b15801561176857600080fd5b505af115801561177c573d6000803e3d6000fd5b505050506040513d602081101561179257600080fd5b505161105b5760405162461bcd60e51b815260040180806020018281038252602f815260200180612b01602f913960400191505060405180910390fd5b600054600160a81b900460ff1681565b6008602052600090815260409020805460018201546002909201546001600160a01b0382169260ff600160a01b8404811693600160a81b9004169185565b60045460ff1681565b61182e612000565b6001600160a01b031661183f6112a4565b6001600160a01b03161461189a576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b6001600160a01b0381166118df5760405162461bcd60e51b81526004018080602001828103825260268152602001806129d86026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a36000805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b600061199d7f000000000000000000000000000000000000000000000000000000000000012c6106a0427f000000000000000000000000000000000000000000000000000000006154daf563ffffffff611e7d16565b905090565b6119aa611344565b6119fb576040805162461bcd60e51b815260206004820152601560248201527f47616d65206973206e6f7420636f6d706c657465640000000000000000000000604482015290519081900360640190fd5b600054600160a81b900460ff1615611a445760405162461bcd60e51b815260040180806020018281038252602e8152602001806129aa602e913960400191505060405180910390fd5b6000805460ff60a81b1916600160a81b178155604080516370a0823160e01b815230600482015290516001600160a01b037f000000000000000000000000918146359264c492bd6934071c6bd31c854edbc316916370a08231916024808301926020929190829003018186803b158015611abd57600080fd5b505afa158015611ad1573d6000803e3d6000fd5b505050506040513d6020811015611ae757600080fd5b50511115611b845760075460408051631a4ca37b60e21b81526001600160a01b037f000000000000000000000000765de816845861e75a25fca122bb6898b8b1282a811660048301526000196024830152306044830152915191909216916369328dec91606480830192600092919082900301818387803b158015611b6b57600080fd5b505af1158015611b7f573d6000803e3d6000fd5b505050505b604080516370a0823160e01b815230600482015290516000916001600160a01b037f000000000000000000000000765de816845861e75a25fca122bb6898b8b1282a16916370a0823191602480820192602092909190829003018186803b158015611bee57600080fd5b505afa158015611c02573d6000803e3d6000fd5b505050506040513d6020811015611c1857600080fd5b505190507f000000000000000000000000471ece3750da237f93b8e339c536989b8978a4386001600160a01b031615611ce157604080516370a0823160e01b815230600482015290516001600160a01b037f000000000000000000000000471ece3750da237f93b8e339c536989b8978a43816916370a08231916024808301926020929190829003018186803b158015611cb157600080fd5b505afa158015611cc5573d6000803e3d6000fd5b505050506040513d6020811015611cdb57600080fd5b50516005555b600254600090821115611d0557600254611d0290839063ffffffff611e7d16565b90505b60007f000000000000000000000000000000000000000000000000000000000000000015611d7c57611d6260646106a0847f000000000000000000000000000000000000000000000000000000000000000063ffffffff611edf16565b9050611d74828263ffffffff611e7d16565b600155611d85565b50600181905560005b600a54611d96576003829055611d9c565b60038190555b60025460015460055460408051878152602081019490945283810192909252600060608401526080830152517f28d72925fdcea205b246c820015bd35812a740d1ec1a5cdc84f7784b50940fbb9181900360a00190a17fdbb9607e18553d40c255226e09883b48f92a108f6f895b0f37db6ae0d7fd56e6600a60405180806020018281038252838181548152602001915080548015611e6457602002820191906000526020600020905b81546001600160a01b03168152600190910190602001808311611e46575b50509250505060405180910390a1505050565b60095490565b600082821115611ed4576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b508082035b92915050565b600082611eee57506000611ed9565b82820282848281611efb57fe5b0414611f385760405162461bcd60e51b8152600401808060200182810382526021815260200180612ae06021913960400191505060405180910390fd5b9392505050565b6000808211611f95576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b818381611f9e57fe5b049392505050565b600082820183811015611f38576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b3390565b61200c61105e565b61205d576040805162461bcd60e51b815260206004820152601460248201527f5061757361626c653a206e6f7420706175736564000000000000000000000000604482015290519081900360640190fd5b6000805460ff60a01b191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa612093612000565b604080516001600160a01b039092168252519081900360200190a1565b604080517fdd62ed3e00000000000000000000000000000000000000000000000000000000815233600482015230602482015290517f0000000000000000000000000000000000000000000000000de0b6b3a7640000916001600160a01b037f000000000000000000000000765de816845861e75a25fca122bb6898b8b1282a169163dd62ed3e91604480820192602092909190829003018186803b15801561215857600080fd5b505afa15801561216c573d6000803e3d6000fd5b505050506040513d602081101561218257600080fd5b505110156121c15760405162461bcd60e51b8152600401808060200182810382526043815260200180612b306043913960600191505060405180910390fd5b60006121cb611947565b3360009081526008602052604090206001810182905560020154909150612218907f0000000000000000000000000000000000000000000000000de0b6b3a764000063ffffffff611fa616565b33600090815260086020526040902060029081019190915554612261907f0000000000000000000000000000000000000000000000000de0b6b3a764000063ffffffff611fa616565b600255604080517f23b872dd0000000000000000000000000000000000000000000000000000000081523360048201523060248201527f0000000000000000000000000000000000000000000000000de0b6b3a7640000604482015290516001600160a01b037f000000000000000000000000765de816845861e75a25fca122bb6898b8b1282a16916323b872dd9160648083019260209291908290030181600087803b15801561231157600080fd5b505af1158015612325573d6000803e3d6000fd5b505050506040513d602081101561233b57600080fd5b505161238e576040805162461bcd60e51b815260206004820152600f60248201527f5472616e73666572206661696c65640000000000000000000000000000000000604482015290519081900360640190fd5b604080516370a0823160e01b815230600482015290516000916001600160a01b037f000000000000000000000000765de816845861e75a25fca122bb6898b8b1282a16916370a0823191602480820192602092909190829003018186803b1580156123f857600080fd5b505afa15801561240c573d6000803e3d6000fd5b505050506040513d602081101561242257600080fd5b5051600754604080517f095ea7b30000000000000000000000000000000000000000000000000000000081526001600160a01b0392831660048201526024810184905290519293507f000000000000000000000000765de816845861e75a25fca122bb6898b8b1282a9091169163095ea7b3916044808201926020929091908290030181600087803b1580156124b757600080fd5b505af11580156124cb573d6000803e3d6000fd5b505050506040513d60208110156124e157600080fd5b505161251e5760405162461bcd60e51b8152600401808060200182810382526029815260200180612a8e6029913960400191505060405180910390fd5b600754604080517fe8eda9df0000000000000000000000000000000000000000000000000000000081526001600160a01b037f000000000000000000000000765de816845861e75a25fca122bb6898b8b1282a8116600483015260248201859052306044830152609b60648301529151919092169163e8eda9df91608480830192600092919082900301818387803b1580156125b957600080fd5b505af11580156125cd573d6000803e3d6000fd5b505050505050565b6125dd61105e565b15612622576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6000805460ff60a01b1916600160a01b1790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258612093612000565b612666611947565b156126b8576040805162461bcd60e51b815260206004820152601860248201527f47616d652068617320616c726561647920737461727465640000000000000000604482015290519081900360640190fd5b336000818152600860205260409020546001600160a01b03161415806126f4575033600090815260086020526040902054600160a81b900460ff165b61272f5760405162461bcd60e51b8152600401808060200182810382526023815260200180612b946023913960400191505060405180910390fd5b60065461274390600163ffffffff611fa616565b60068190557f00000000000000000000000000000000000000000000000000000000000000c810156127a65760405162461bcd60e51b81526004018080602001828103825260278152602001806129546027913960400191505060405180910390fd5b33600090815260086020526040902054600160a81b900460ff166127c8612925565b506040805160a08101825233808252600060208084018281528486018381526060860184815260808701858152958552600890935295909220845181549351965173ffffffffffffffffffffffffffffffffffffffff199094166001600160a01b039091161760ff60a01b1916600160a01b961515969096029590951760ff60a81b1916600160a81b9215159290920291909117845551600184015551600290920191909155816128c357600980546001810182556000919091527f6e1540171b6c0c960b71a7020d9f60077f6af931a8bbf590da0223dacf75c7af01805473ffffffffffffffffffffffffffffffffffffffff1916331790555b604080517f0000000000000000000000000000000000000000000000000de0b6b3a76400008152905133917f485fd86c2a7d2d9ca3bf02e2ba776ea24271bc62274265b0bd5f478b3b7a1ca4919081900360200190a26129216120b0565b5050565b6040805160a0810182526000808252602082018190529181018290526060810182905260808101919091529056fe52656163686564206d6178207175616e74697479206f6620706c617965727320616c6c6f7765644661696c20746f207472616e7366657220455243323020746f6b656e73206f6e206561726c7920776974686472617752656465656d206f7065726174696f6e20616c72656164792068617070656e656420666f72207468652067616d654f776e61626c653a206e6577206f776e657220697320746865207a65726f20616464726573734661696c20746f207472616e73666572204552323020746f6b656e7320746f2061646d696e4465706f73697420617661696c61626c65206f6e6c79206265747765656e207365676d656e74203120616e64207365676d656e74206e2d31202870656e756c74696d6174652946756e6473206e6f742072656465656d65642066726f6d2065787465726e616c20706f6f6c4661696c20746f20617070726f766520616c6c6f77616e636520746f206c656e64696e6720706f6f6c4661696c20746f207472616e7366657220455243323020746f6b656e73206f6e207769746864726177536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774661696c20746f207472616e73666572204552323020696e63656e7469766520746f6b656e7320746f2061646d696e596f75206e65656420746f206861766520616c6c6f77616e636520746f20646f207472616e7366657220444149206f6e2074686520736d61727420636f6e7472616374506c6179657220616c72656164792077697468647261772066726f6d2067616d6543616e6e6f74206a6f696e207468652067616d65206d6f7265207468616e206f6e6365506c6179657220616c726561647920706169642063757272656e74207365676d656e744661696c20746f207472616e7366657220455243323020696e63656e7469766520746f6b656e73206f6e207769746864726177506c61796572206469646e277420706179207468652070726576696f7573207365676d656e74202d2067616d65206f76657221a2646970667358221220db570268f5699101f5cf9620863898a163eab3c5755e5ec495c88f3a2717afde64736f6c634300060b0033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000765de816845861e75a25fca122bb6898b8b1282a000000000000000000000000d1088091a174d33412a968fa34cb67131188b3320000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000012c0000000000000000000000000000000000000000000000000de0b6b3a76400000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000043d067ed784d9dd2ffeda73775e2cc4c560103a100000000000000000000000000000000000000000000000000000000000000c8000000000000000000000000471ece3750da237f93b8e339c536989b8978a438
-----Decoded View---------------
Arg [0] : _inboundCurrency (address): 0x765DE816845861e75A25fCA122bb6898B8B1282a
Arg [1] : _lendingPoolAddressProvider (address): 0xD1088091A174d33412a968Fa34Cb67131188B332
Arg [2] : _segmentCount (uint256): 2
Arg [3] : _segmentLength (uint256): 300
Arg [4] : _segmentPayment (uint256): 1000000000000000000
Arg [5] : _earlyWithdrawalFee (uint256): 1
Arg [6] : _customFee (uint256): 0
Arg [7] : _dataProvider (address): 0x43d067ed784D9DD2ffEda73775e2CC4c560103A1
Arg [8] : _maxPlayersCount (uint256): 200
Arg [9] : _incentiveToken (address): 0x471EcE3750Da237f93B8E339c536989b8978a438
-----Encoded View---------------
10 Constructor Arguments found :
Arg [0] : 000000000000000000000000765de816845861e75a25fca122bb6898b8b1282a
Arg [1] : 000000000000000000000000d1088091a174d33412a968fa34cb67131188b332
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [3] : 000000000000000000000000000000000000000000000000000000000000012c
Arg [4] : 0000000000000000000000000000000000000000000000000de0b6b3a7640000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [7] : 00000000000000000000000043d067ed784d9dd2ffeda73775e2cc4c560103a1
Arg [8] : 00000000000000000000000000000000000000000000000000000000000000c8
Arg [9] : 000000000000000000000000471ece3750da237f93b8e339c536989b8978a438
Loading...
Loading
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.