Created
January 26, 2022 19:05
-
-
Save Feliphegomez/e71eb3567821b86e81dab3c23180ce46 to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.6.12+commit.27d51765.js&optimize=false&runs=200&gist=
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: GPL-3.0-or-later | |
| pragma solidity >=0.4.0; | |
| import '../GSN/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. | |
| */ | |
| 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 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 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 onlyOwner { | |
| _transferOwnership(newOwner); | |
| } | |
| /** | |
| * @dev Transfers ownership of the contract to a new account (`newOwner`). | |
| */ | |
| function _transferOwnership(address newOwner) internal { | |
| require(newOwner != address(0), 'Ownable: new owner is the zero address'); | |
| emit OwnershipTransferred(_owner, newOwner); | |
| _owner = newOwner; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: GPL-3.0-or-later | |
| pragma solidity >=0.4.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. | |
| */ | |
| contract Context { | |
| // Empty internal constructor, to prevent people from mistakenly deploying | |
| // an instance of this contract, which should be used via inheritance. | |
| constructor() internal {} | |
| function _msgSender() internal view returns (address payable) { | |
| return msg.sender; | |
| } | |
| function _msgData() internal view returns (bytes memory) { | |
| this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691 | |
| return msg.data; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity >=0.4.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, 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) { | |
| return sub(a, b, 'SafeMath: subtraction overflow'); | |
| } | |
| /** | |
| * @dev Returns the subtraction of two unsigned integers, reverting with custom message on | |
| * overflow (when the result is negative). | |
| * | |
| * 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); | |
| uint256 c = a - b; | |
| return c; | |
| } | |
| /** | |
| * @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) { | |
| // 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 0; | |
| } | |
| uint256 c = a * b; | |
| require(c / a == b, 'SafeMath: multiplication overflow'); | |
| return c; | |
| } | |
| /** | |
| * @dev Returns the integer division of two unsigned integers. Reverts 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) { | |
| return div(a, b, 'SafeMath: division by zero'); | |
| } | |
| /** | |
| * @dev Returns the integer division of two unsigned integers. Reverts with custom message 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, | |
| string memory errorMessage | |
| ) internal pure returns (uint256) { | |
| require(b > 0, errorMessage); | |
| uint256 c = a / b; | |
| // assert(a == b * c + a % b); // There is no case in which this doesn't hold | |
| return c; | |
| } | |
| /** | |
| * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), | |
| * Reverts 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) { | |
| return mod(a, b, 'SafeMath: modulo by zero'); | |
| } | |
| /** | |
| * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), | |
| * Reverts with custom message 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, | |
| string memory errorMessage | |
| ) internal pure returns (uint256) { | |
| require(b != 0, errorMessage); | |
| return a % b; | |
| } | |
| function min(uint256 x, uint256 y) internal pure returns (uint256 z) { | |
| z = x < y ? x : y; | |
| } | |
| // babylonian method (https://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Babylonian_method) | |
| function sqrt(uint256 y) internal pure returns (uint256 z) { | |
| if (y > 3) { | |
| z = y; | |
| uint256 x = y / 2 + 1; | |
| while (x < z) { | |
| z = x; | |
| x = (y / x + x) / 2; | |
| } | |
| } else if (y != 0) { | |
| z = 1; | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: GPL-3.0-or-later | |
| pragma solidity >=0.4.0; | |
| interface IBEP20 { | |
| /** | |
| * @dev Returns the amount of tokens in existence. | |
| */ | |
| function totalSupply() external view returns (uint256); | |
| /** | |
| * @dev Returns the token decimals. | |
| */ | |
| function decimals() external view returns (uint8); | |
| /** | |
| * @dev Returns the token symbol. | |
| */ | |
| function symbol() external view returns (string memory); | |
| /** | |
| * @dev Returns the token name. | |
| */ | |
| function name() external view returns (string memory); | |
| /** | |
| * @dev Returns the bep token owner. | |
| */ | |
| function getOwner() external view returns (address); | |
| /** | |
| * @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); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.6.0; | |
| import './IBEP20.sol'; | |
| import '../../math/SafeMath.sol'; | |
| import '../../utils/Address.sol'; | |
| /** | |
| * @title SafeBEP20 | |
| * @dev Wrappers around BEP20 operations that throw on failure (when the token | |
| * contract returns false). Tokens that return no value (and instead revert or | |
| * throw on failure) are also supported, non-reverting calls are assumed to be | |
| * successful. | |
| * To use this library you can add a `using SafeBEP20 for IBEP20;` statement to your contract, | |
| * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. | |
| */ | |
| library SafeBEP20 { | |
| using SafeMath for uint256; | |
| using Address for address; | |
| function safeTransfer( | |
| IBEP20 token, | |
| address to, | |
| uint256 value | |
| ) internal { | |
| _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); | |
| } | |
| function safeTransferFrom( | |
| IBEP20 token, | |
| address from, | |
| address to, | |
| uint256 value | |
| ) internal { | |
| _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value)); | |
| } | |
| /** | |
| * @dev Deprecated. This function has issues similar to the ones found in | |
| * {IBEP20-approve}, and its usage is discouraged. | |
| * | |
| * Whenever possible, use {safeIncreaseAllowance} and | |
| * {safeDecreaseAllowance} instead. | |
| */ | |
| function safeApprove( | |
| IBEP20 token, | |
| address spender, | |
| uint256 value | |
| ) internal { | |
| // safeApprove should only be called when setting an initial allowance, | |
| // or when resetting it to zero. To increase and decrease it, use | |
| // 'safeIncreaseAllowance' and 'safeDecreaseAllowance' | |
| // solhint-disable-next-line max-line-length | |
| require( | |
| (value == 0) || (token.allowance(address(this), spender) == 0), | |
| 'SafeBEP20: approve from non-zero to non-zero allowance' | |
| ); | |
| _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); | |
| } | |
| function safeIncreaseAllowance( | |
| IBEP20 token, | |
| address spender, | |
| uint256 value | |
| ) internal { | |
| uint256 newAllowance = token.allowance(address(this), spender).add(value); | |
| _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); | |
| } | |
| function safeDecreaseAllowance( | |
| IBEP20 token, | |
| address spender, | |
| uint256 value | |
| ) internal { | |
| uint256 newAllowance = token.allowance(address(this), spender).sub( | |
| value, | |
| 'SafeBEP20: decreased allowance below zero' | |
| ); | |
| _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); | |
| } | |
| /** | |
| * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement | |
| * on the return value: the return value is optional (but if data is returned, it must not be false). | |
| * @param token The token targeted by the call. | |
| * @param data The call data (encoded using abi.encode or one of its variants). | |
| */ | |
| function _callOptionalReturn(IBEP20 token, bytes memory data) private { | |
| // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since | |
| // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that | |
| // the target address contains contract code and also asserts for success in the low-level call. | |
| bytes memory returndata = address(token).functionCall(data, 'SafeBEP20: low-level call failed'); | |
| if (returndata.length > 0) { | |
| // Return data is optional | |
| // solhint-disable-next-line max-line-length | |
| require(abi.decode(returndata, (bool)), 'SafeBEP20: BEP20 operation did not succeed'); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.6.2; | |
| /** | |
| * @dev Collection of functions related to the address type | |
| */ | |
| library Address { | |
| /** | |
| * @dev Returns true if `account` is a contract. | |
| * | |
| * [IMPORTANT] | |
| * ==== | |
| * It is unsafe to assume that an address for which this function returns | |
| * false is an externally-owned account (EOA) and not a contract. | |
| * | |
| * Among others, `isContract` will return false for the following | |
| * types of addresses: | |
| * | |
| * - an externally-owned account | |
| * - a contract in construction | |
| * - an address where a contract will be created | |
| * - an address where a contract lived, but was destroyed | |
| * ==== | |
| */ | |
| function isContract(address account) internal view returns (bool) { | |
| // According to EIP-1052, 0x0 is the value returned for not-yet created accounts | |
| // and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned | |
| // for accounts without code, i.e. `keccak256('')` | |
| bytes32 codehash; | |
| bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470; | |
| // solhint-disable-next-line no-inline-assembly | |
| assembly { | |
| codehash := extcodehash(account) | |
| } | |
| return (codehash != accountHash && codehash != 0x0); | |
| } | |
| /** | |
| * @dev Replacement for Solidity's `transfer`: sends `amount` wei to | |
| * `recipient`, forwarding all available gas and reverting on errors. | |
| * | |
| * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost | |
| * of certain opcodes, possibly making contracts go over the 2300 gas limit | |
| * imposed by `transfer`, making them unable to receive funds via | |
| * `transfer`. {sendValue} removes this limitation. | |
| * | |
| * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. | |
| * | |
| * IMPORTANT: because control is transferred to `recipient`, care must be | |
| * taken to not create reentrancy vulnerabilities. Consider using | |
| * {ReentrancyGuard} or the | |
| * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. | |
| */ | |
| function sendValue(address payable recipient, uint256 amount) internal { | |
| require(address(this).balance >= amount, 'Address: insufficient balance'); | |
| // solhint-disable-next-line avoid-low-level-calls, avoid-call-value | |
| (bool success, ) = recipient.call{value: amount}(''); | |
| require(success, 'Address: unable to send value, recipient may have reverted'); | |
| } | |
| /** | |
| * @dev Performs a Solidity function call using a low level `call`. A | |
| * plain`call` is an unsafe replacement for a function call: use this | |
| * function instead. | |
| * | |
| * If `target` reverts with a revert reason, it is bubbled up by this | |
| * function (like regular Solidity function calls). | |
| * | |
| * Returns the raw returned data. To convert to the expected return value, | |
| * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. | |
| * | |
| * Requirements: | |
| * | |
| * - `target` must be a contract. | |
| * - calling `target` with `data` must not revert. | |
| * | |
| * _Available since v3.1._ | |
| */ | |
| function functionCall(address target, bytes memory data) internal returns (bytes memory) { | |
| return functionCall(target, data, 'Address: low-level call failed'); | |
| } | |
| /** | |
| * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with | |
| * `errorMessage` as a fallback revert reason when `target` reverts. | |
| * | |
| * _Available since v3.1._ | |
| */ | |
| function functionCall( | |
| address target, | |
| bytes memory data, | |
| string memory errorMessage | |
| ) internal returns (bytes memory) { | |
| return _functionCallWithValue(target, data, 0, errorMessage); | |
| } | |
| /** | |
| * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], | |
| * but also transferring `value` wei to `target`. | |
| * | |
| * Requirements: | |
| * | |
| * - the calling contract must have an ETH balance of at least `value`. | |
| * - the called Solidity function must be `payable`. | |
| * | |
| * _Available since v3.1._ | |
| */ | |
| function functionCallWithValue( | |
| address target, | |
| bytes memory data, | |
| uint256 value | |
| ) internal returns (bytes memory) { | |
| return functionCallWithValue(target, data, value, 'Address: low-level call with value failed'); | |
| } | |
| /** | |
| * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but | |
| * with `errorMessage` as a fallback revert reason when `target` reverts. | |
| * | |
| * _Available since v3.1._ | |
| */ | |
| function functionCallWithValue( | |
| address target, | |
| bytes memory data, | |
| uint256 value, | |
| string memory errorMessage | |
| ) internal returns (bytes memory) { | |
| require(address(this).balance >= value, 'Address: insufficient balance for call'); | |
| return _functionCallWithValue(target, data, value, errorMessage); | |
| } | |
| function _functionCallWithValue( | |
| address target, | |
| bytes memory data, | |
| uint256 weiValue, | |
| string memory errorMessage | |
| ) private returns (bytes memory) { | |
| require(isContract(target), 'Address: call to non-contract'); | |
| // solhint-disable-next-line avoid-low-level-calls | |
| (bool success, bytes memory returndata) = target.call{value: weiValue}(data); | |
| if (success) { | |
| return returndata; | |
| } else { | |
| // Look for revert reason and bubble it up if present | |
| if (returndata.length > 0) { | |
| // The easiest way to bubble the revert reason is using memory via assembly | |
| // solhint-disable-next-line no-inline-assembly | |
| assembly { | |
| let returndata_size := mload(returndata) | |
| revert(add(32, returndata), returndata_size) | |
| } | |
| } else { | |
| revert(errorMessage); | |
| } | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| REMIX EXAMPLE PROJECT | |
| Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer. | |
| It contains 3 directories: | |
| 1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name. | |
| 2. 'scripts': Holds two scripts to deploy a contract. It is explained below. | |
| 3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity. | |
| SCRIPTS | |
| The 'scripts' folder contains example async/await scripts for deploying the 'Storage' contract. | |
| For the deployment of any other contract, 'contractName' and 'constructorArgs' should be updated (along with other code if required). | |
| Scripts have full access to the web3.js and ethers.js libraries. | |
| To run a script, right click on file name in the file explorer and click 'Run'. Remember, Solidity file must already be compiled. | |
| Output from script will appear in remix terminal. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "deploy": { | |
| "VM:-": { | |
| "linkReferences": {}, | |
| "autoDeployLib": true | |
| }, | |
| "main:1": { | |
| "linkReferences": {}, | |
| "autoDeployLib": true | |
| }, | |
| "ropsten:3": { | |
| "linkReferences": {}, | |
| "autoDeployLib": true | |
| }, | |
| "rinkeby:4": { | |
| "linkReferences": {}, | |
| "autoDeployLib": true | |
| }, | |
| "kovan:42": { | |
| "linkReferences": {}, | |
| "autoDeployLib": true | |
| }, | |
| "görli:5": { | |
| "linkReferences": {}, | |
| "autoDeployLib": true | |
| }, | |
| "Custom": { | |
| "linkReferences": {}, | |
| "autoDeployLib": true | |
| } | |
| }, | |
| "data": { | |
| "bytecode": { | |
| "linkReferences": {}, | |
| "object": "608060405234801561001057600080fd5b5060405161211b38038061211b8339818101604052604081101561003357600080fd5b8101908080519060200190929190805190602001909291905050506154608110156100a9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260378152602001806120e46037913960400191505060405180910390fd5b62278d00811115610105576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b8152602001806120a9603b913960400191505060405180910390fd5b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550806002819055506000600360006101000a81548160ff0219169083151502179055505050611f31806101786000396000f3fe6080604052600436106100e15760003560e01c80636fc1f57e1161007f578063c1a287e211610059578063c1a287e21461077d578063e177246e146107a8578063f2b06537146107e3578063f851a44014610834576100e8565b80636fc1f57e146106fa5780637d645fab14610727578063b1b43ae514610752576100e8565b80633a66f901116100bb5780633a66f901146103445780634dd18bf5146104eb578063591fcdfe1461053c5780636a42b8f8146106cf576100e8565b80630825f38f146100ed5780630e18b681146102ec5780632678224714610303576100e8565b366100e857005b600080fd5b610271600480360360a081101561010357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561014a57600080fd5b82018360208201111561015c57600080fd5b8035906020019184600183028401116401000000008311171561017e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156101e157600080fd5b8201836020820111156101f357600080fd5b8035906020019184600183028401116401000000008311171561021557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050610875565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102b1578082015181840152602081019050610296565b50505050905090810190601f1680156102de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102f857600080fd5b50610301610ec0565b005b34801561030f57600080fd5b5061031861104d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561035057600080fd5b506104d5600480360360a081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156103ae57600080fd5b8201836020820111156103c057600080fd5b803590602001918460018302840111640100000000831117156103e257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561044557600080fd5b82018360208201111561045757600080fd5b8035906020019184600183028401116401000000008311171561047957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050611073565b6040518082815260200191505060405180910390f35b3480156104f757600080fd5b5061053a6004803603602081101561050e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611423565b005b34801561054857600080fd5b506106cd600480360360a081101561055f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156105a657600080fd5b8201836020820111156105b857600080fd5b803590602001918460018302840111640100000000831117156105da57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561063d57600080fd5b82018360208201111561064f57600080fd5b8035906020019184600183028401116401000000008311171561067157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019092919050505061162a565b005b3480156106db57600080fd5b506106e461195e565b6040518082815260200191505060405180910390f35b34801561070657600080fd5b5061070f611964565b60405180821515815260200191505060405180910390f35b34801561073357600080fd5b5061073c611977565b6040518082815260200191505060405180910390f35b34801561075e57600080fd5b5061076761197e565b6040518082815260200191505060405180910390f35b34801561078957600080fd5b50610792611984565b6040518082815260200191505060405180910390f35b3480156107b457600080fd5b506107e1600480360360208110156107cb57600080fd5b810190808035906020019092919050505061198b565b005b3480156107ef57600080fd5b5061081c6004803603602081101561080657600080fd5b8101908080359060200190929190505050611aff565b60405180821515815260200191505060405180910390f35b34801561084057600080fd5b50610849611b1f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461091b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611bd46038913960400191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610991578082015181840152602081019050610976565b50505050905090810190601f1680156109be5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156109f75780820151818401526020810190506109dc565b50505050905090810190601f168015610a245780820380516001836020036101000a031916815260200191505b509750505050505050506040516020818303038152906040528051906020012090506004600082815260200190815260200160002060009054906101000a900460ff16610abc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d815260200180611d62603d913960400191505060405180910390fd5b82610ac5611b43565b1015610b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526045815260200180611c766045913960600191505060405180910390fd5b610b326212750084611b4b90919063ffffffff16565b610b3a611b43565b1115610b91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526033815260200180611c436033913960400191505060405180910390fd5b60006004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055506060600086511415610bd157849050610c6d565b85805190602001208560405160200180837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260040182805190602001908083835b60208310610c355780518252602082019150602081019050602083039250610c12565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b600060608973ffffffffffffffffffffffffffffffffffffffff1689846040518082805190602001908083835b60208310610cbd5780518252602082019150602081019050602083039250610c9a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610d1f576040519150601f19603f3d011682016040523d82523d6000602084013e610d24565b606091505b509150915081610d7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d815260200180611e45603d913960400191505060405180910390fd5b8973ffffffffffffffffffffffffffffffffffffffff16847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610e0c578082015181840152602081019050610df1565b50505050905090810190601f168015610e395780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015610e72578082015181840152602081019050610e57565b50505050905090810190601f168015610e9f5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a38094505050505095945050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611d9f6038913960400191505060405180910390fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c60405160405180910390a2565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461111a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180611e0f6036913960400191505060405180910390fd5b611136600254611128611b43565b611b4b90919063ffffffff16565b82101561118e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526049815260200180611e826049913960600191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156112045780820151818401526020810190506111e9565b50505050905090810190601f1680156112315780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b8381101561126a57808201518184015260208101905061124f565b50505050905090810190601f1680156112975780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508673ffffffffffffffffffffffffffffffffffffffff16817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015611372578082015181840152602081019050611357565b50505050905090810190601f16801561139f5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156113d85780820151818401526020810190506113bd565b50505050905090810190601f1680156114055780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a38091505095945050505050565b600360009054906101000a900460ff16156114c1573073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114bc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611dd76038913960400191505060405180910390fd5b611581565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611565576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b815260200180611cef603b913960400191505060405180910390fd5b6001600360006101000a81548160ff0219169083151502179055505b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75660405160405180910390a250565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116ce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526037815260200180611c0c6037913960400191505060405180910390fd5b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015611744578082015181840152602081019050611729565b50505050905090810190601f1680156117715780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156117aa57808201518184015260208101905061178f565b50505050905090810190601f1680156117d75780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508573ffffffffffffffffffffffffffffffffffffffff16817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156118b2578082015181840152602081019050611897565b50505050905090810190601f1680156118df5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156119185780820151818401526020810190506118fd565b50505050905090810190601f1680156119455780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b600360009054906101000a900460ff1681565b62278d0081565b61546081565b6212750081565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526031815260200180611ecb6031913960400191505060405180910390fd5b615460811015611a6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180611cbb6034913960400191505060405180910390fd5b62278d00811115611ac6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611d2a6038913960400191505060405180910390fd5b806002819055506002547f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c60405160405180910390a250565b60046020528060005260406000206000915054906101000a900460ff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600042905090565b600080828401905083811015611bc9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2046697273742063616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea2646970667358221220666c99309c01077b067da97fcda33f0eff1644b1bbdcd8415700f66bde784cc564736f6c634300060c003354696d656c6f636b3a3a636f6e7374727563746f723a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a636f6e7374727563746f723a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e", | |
| "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x40 MLOAD PUSH2 0x211B CODESIZE SUB DUP1 PUSH2 0x211B DUP4 CODECOPY DUP2 DUP2 ADD PUSH1 0x40 MSTORE PUSH1 0x40 DUP2 LT ISZERO PUSH2 0x33 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x5460 DUP2 LT ISZERO PUSH2 0xA9 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x37 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x20E4 PUSH1 0x37 SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH3 0x278D00 DUP2 GT ISZERO PUSH2 0x105 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x3B DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x20A9 PUSH1 0x3B SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP2 PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP DUP1 PUSH1 0x2 DUP2 SWAP1 SSTORE POP PUSH1 0x0 PUSH1 0x3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP POP POP PUSH2 0x1F31 DUP1 PUSH2 0x178 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xE1 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x6FC1F57E GT PUSH2 0x7F JUMPI DUP1 PUSH4 0xC1A287E2 GT PUSH2 0x59 JUMPI DUP1 PUSH4 0xC1A287E2 EQ PUSH2 0x77D JUMPI DUP1 PUSH4 0xE177246E EQ PUSH2 0x7A8 JUMPI DUP1 PUSH4 0xF2B06537 EQ PUSH2 0x7E3 JUMPI DUP1 PUSH4 0xF851A440 EQ PUSH2 0x834 JUMPI PUSH2 0xE8 JUMP JUMPDEST DUP1 PUSH4 0x6FC1F57E EQ PUSH2 0x6FA JUMPI DUP1 PUSH4 0x7D645FAB EQ PUSH2 0x727 JUMPI DUP1 PUSH4 0xB1B43AE5 EQ PUSH2 0x752 JUMPI PUSH2 0xE8 JUMP JUMPDEST DUP1 PUSH4 0x3A66F901 GT PUSH2 0xBB JUMPI DUP1 PUSH4 0x3A66F901 EQ PUSH2 0x344 JUMPI DUP1 PUSH4 0x4DD18BF5 EQ PUSH2 0x4EB JUMPI DUP1 PUSH4 0x591FCDFE EQ PUSH2 0x53C JUMPI DUP1 PUSH4 0x6A42B8F8 EQ PUSH2 0x6CF JUMPI PUSH2 0xE8 JUMP JUMPDEST DUP1 PUSH4 0x825F38F EQ PUSH2 0xED JUMPI DUP1 PUSH4 0xE18B681 EQ PUSH2 0x2EC JUMPI DUP1 PUSH4 0x26782247 EQ PUSH2 0x303 JUMPI PUSH2 0xE8 JUMP JUMPDEST CALLDATASIZE PUSH2 0xE8 JUMPI STOP JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x271 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0xA0 DUP2 LT ISZERO PUSH2 0x103 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH5 0x100000000 DUP2 GT ISZERO PUSH2 0x14A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 ADD DUP4 PUSH1 0x20 DUP3 ADD GT ISZERO PUSH2 0x15C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP2 DUP5 PUSH1 0x1 DUP4 MUL DUP5 ADD GT PUSH5 0x100000000 DUP4 GT OR ISZERO PUSH2 0x17E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP2 SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 DUP2 DUP5 ADD MSTORE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND SWAP1 POP DUP1 DUP4 ADD SWAP3 POP POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH5 0x100000000 DUP2 GT ISZERO PUSH2 0x1E1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 ADD DUP4 PUSH1 0x20 DUP3 ADD GT ISZERO PUSH2 0x1F3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP2 DUP5 PUSH1 0x1 DUP4 MUL DUP5 ADD GT PUSH5 0x100000000 DUP4 GT OR ISZERO PUSH2 0x215 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP2 SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 DUP2 DUP5 ADD MSTORE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND SWAP1 POP DUP1 DUP4 ADD SWAP3 POP POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x875 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x2B1 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x296 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x2DE JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2F8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x301 PUSH2 0xEC0 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x30F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x318 PUSH2 0x104D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x350 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4D5 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0xA0 DUP2 LT ISZERO PUSH2 0x367 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH5 0x100000000 DUP2 GT ISZERO PUSH2 0x3AE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 ADD DUP4 PUSH1 0x20 DUP3 ADD GT ISZERO PUSH2 0x3C0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP2 DUP5 PUSH1 0x1 DUP4 MUL DUP5 ADD GT PUSH5 0x100000000 DUP4 GT OR ISZERO PUSH2 0x3E2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP2 SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 DUP2 DUP5 ADD MSTORE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND SWAP1 POP DUP1 DUP4 ADD SWAP3 POP POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH5 0x100000000 DUP2 GT ISZERO PUSH2 0x445 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 ADD DUP4 PUSH1 0x20 DUP3 ADD GT ISZERO PUSH2 0x457 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP2 DUP5 PUSH1 0x1 DUP4 MUL DUP5 ADD GT PUSH5 0x100000000 DUP4 GT OR ISZERO PUSH2 0x479 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP2 SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 DUP2 DUP5 ADD MSTORE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND SWAP1 POP DUP1 DUP4 ADD SWAP3 POP POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1073 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4F7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x53A PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x50E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1423 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x548 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x6CD PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0xA0 DUP2 LT ISZERO PUSH2 0x55F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH5 0x100000000 DUP2 GT ISZERO PUSH2 0x5A6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 ADD DUP4 PUSH1 0x20 DUP3 ADD GT ISZERO PUSH2 0x5B8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP2 DUP5 PUSH1 0x1 DUP4 MUL DUP5 ADD GT PUSH5 0x100000000 DUP4 GT OR ISZERO PUSH2 0x5DA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP2 SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 DUP2 DUP5 ADD MSTORE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND SWAP1 POP DUP1 DUP4 ADD SWAP3 POP POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH5 0x100000000 DUP2 GT ISZERO PUSH2 0x63D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 ADD DUP4 PUSH1 0x20 DUP3 ADD GT ISZERO PUSH2 0x64F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP2 DUP5 PUSH1 0x1 DUP4 MUL DUP5 ADD GT PUSH5 0x100000000 DUP4 GT OR ISZERO PUSH2 0x671 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP2 SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 DUP2 DUP5 ADD MSTORE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND SWAP1 POP DUP1 DUP4 ADD SWAP3 POP POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x162A JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x6DB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x6E4 PUSH2 0x195E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x706 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x70F PUSH2 0x1964 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x733 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x73C PUSH2 0x1977 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x75E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x767 PUSH2 0x197E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x789 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x792 PUSH2 0x1984 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x7B4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x7E1 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x7CB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x198B JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x7EF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x81C PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x806 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1AFF JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x840 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x849 PUSH2 0x1B1F JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x91B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x38 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1BD4 PUSH1 0x38 SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP7 DUP7 DUP7 DUP7 DUP7 PUSH1 0x40 MLOAD PUSH1 0x20 ADD DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x991 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x976 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x9BE JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP4 DUP2 SUB DUP3 MSTORE DUP6 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x9F7 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x9DC JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xA24 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP8 POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 SWAP1 POP PUSH1 0x4 PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND PUSH2 0xABC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x3D DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1D62 PUSH1 0x3D SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP3 PUSH2 0xAC5 PUSH2 0x1B43 JUMP JUMPDEST LT ISZERO PUSH2 0xB1C JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x45 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1C76 PUSH1 0x45 SWAP2 CODECOPY PUSH1 0x60 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xB32 PUSH3 0x127500 DUP5 PUSH2 0x1B4B SWAP1 SWAP2 SWAP1 PUSH4 0xFFFFFFFF AND JUMP JUMPDEST PUSH2 0xB3A PUSH2 0x1B43 JUMP JUMPDEST GT ISZERO PUSH2 0xB91 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x33 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1C43 PUSH1 0x33 SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x4 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x60 PUSH1 0x0 DUP7 MLOAD EQ ISZERO PUSH2 0xBD1 JUMPI DUP5 SWAP1 POP PUSH2 0xC6D JUMP JUMPDEST DUP6 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 DUP6 PUSH1 0x40 MLOAD PUSH1 0x20 ADD DUP1 DUP4 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND DUP2 MSTORE PUSH1 0x4 ADD DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0xC35 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0xC12 JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 POP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP10 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP10 DUP5 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0xCBD JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0xC9A JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP8 GAS CALL SWAP3 POP POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0xD1F JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0xD24 JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0xD7F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x3D DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1E45 PUSH1 0x3D SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP10 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 PUSH32 0xA560E3198060A2F10670C1EC5B403077EA6AE93CA8DE1C32B451DC1A943CD6E7 DUP12 DUP12 DUP12 DUP12 PUSH1 0x40 MLOAD DUP1 DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xE0C JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xDF1 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xE39 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP4 DUP2 SUB DUP3 MSTORE DUP6 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xE72 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xE57 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xE9F JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP7 POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 DUP1 SWAP5 POP POP POP POP POP SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0xF66 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x38 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1D9F PUSH1 0x38 SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST CALLER PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x71614071B88DEE5E0B2AE578A9DD7B2EBBE9AE832BA419DC0242CD065A290B6C PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x111A JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x36 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1E0F PUSH1 0x36 SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x1136 PUSH1 0x2 SLOAD PUSH2 0x1128 PUSH2 0x1B43 JUMP JUMPDEST PUSH2 0x1B4B SWAP1 SWAP2 SWAP1 PUSH4 0xFFFFFFFF AND JUMP JUMPDEST DUP3 LT ISZERO PUSH2 0x118E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x49 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1E82 PUSH1 0x49 SWAP2 CODECOPY PUSH1 0x60 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP7 DUP7 DUP7 DUP7 DUP7 PUSH1 0x40 MLOAD PUSH1 0x20 ADD DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1204 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x11E9 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x1231 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP4 DUP2 SUB DUP3 MSTORE DUP6 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x126A JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x124F JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x1297 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP8 POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 SWAP1 POP PUSH1 0x1 PUSH1 0x4 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH32 0x76E2796DC3A81D57B0E8504B647FEBCBEEB5F4AF818E164F11EEF8131A6A763F DUP9 DUP9 DUP9 DUP9 PUSH1 0x40 MLOAD DUP1 DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1372 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x1357 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x139F JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP4 DUP2 SUB DUP3 MSTORE DUP6 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x13D8 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x13BD JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x1405 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP7 POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 DUP1 SWAP2 POP POP SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x14C1 JUMPI ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x14BC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x38 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1DD7 PUSH1 0x38 SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x1581 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x1565 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x3B DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1CEF PUSH1 0x3B SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP JUMPDEST DUP1 PUSH1 0x1 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x69D78E38A01985FBB1462961809B4B2D65531BC93B2B94037F3334B82CA4A756 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x16CE JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x37 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1C0C PUSH1 0x37 SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP6 DUP6 DUP6 DUP6 DUP6 PUSH1 0x40 MLOAD PUSH1 0x20 ADD DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1744 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x1729 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x1771 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP4 DUP2 SUB DUP3 MSTORE DUP6 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x17AA JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x178F JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x17D7 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP8 POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 SWAP1 POP PUSH1 0x0 PUSH1 0x4 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH32 0x2FFFC091A501FD91BFBFF27141450D3ACB40FB8E6D8382B243EC7A812A3AAF87 DUP8 DUP8 DUP8 DUP8 PUSH1 0x40 MLOAD DUP1 DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x18B2 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x1897 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x18DF JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP4 DUP2 SUB DUP3 MSTORE DUP6 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1918 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x18FD JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x1945 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP7 POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x2 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH3 0x278D00 DUP2 JUMP JUMPDEST PUSH2 0x5460 DUP2 JUMP JUMPDEST PUSH3 0x127500 DUP2 JUMP JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x1A0F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x31 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1ECB PUSH1 0x31 SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x5460 DUP2 LT ISZERO PUSH2 0x1A6A JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x34 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1CBB PUSH1 0x34 SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH3 0x278D00 DUP2 GT ISZERO PUSH2 0x1AC6 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x38 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1D2A PUSH1 0x38 SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP1 PUSH1 0x2 DUP2 SWAP1 SSTORE POP PUSH1 0x2 SLOAD PUSH32 0x948B1F6A42EE138B7E34058BA85A37F716D55FF25FF05A763F15BED6A04C8D2C PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP JUMP JUMPDEST PUSH1 0x4 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 TIMESTAMP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 ADD SWAP1 POP DUP4 DUP2 LT ISZERO PUSH2 0x1BC9 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x1B DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH32 0x536166654D6174683A206164646974696F6E206F766572666C6F770000000000 DUP2 MSTORE POP PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP INVALID SLOAD PUSH10 0x6D656C6F636B3A3A6578 PUSH6 0x637574655472 PUSH2 0x6E73 PUSH2 0x6374 PUSH10 0x6F6E3A2043616C6C206D PUSH22 0x737420636F6D652066726F6D2061646D696E2E54696D PUSH6 0x6C6F636B3A3A PUSH4 0x616E6365 PUSH13 0x5472616E73616374696F6E3A20 NUMBER PUSH2 0x6C6C KECCAK256 PUSH14 0x75737420636F6D652066726F6D20 PUSH2 0x646D PUSH10 0x6E2E54696D656C6F636B GASPRICE GASPRICE PUSH6 0x786563757465 SLOAD PUSH19 0x616E73616374696F6E3A205472616E73616374 PUSH10 0x6F6E206973207374616C PUSH6 0x2E54696D656C PUSH16 0x636B3A3A657865637574655472616E73 PUSH2 0x6374 PUSH10 0x6F6E3A205472616E7361 PUSH4 0x74696F6E KECCAK256 PUSH9 0x61736E277420737572 PUSH17 0x61737365642074696D65206C6F636B2E54 PUSH10 0x6D656C6F636B3A3A7365 PUSH21 0x44656C61793A2044656C6179206D75737420657863 PUSH6 0x6564206D696E PUSH10 0x6D756D2064656C61792E SLOAD PUSH10 0x6D656C6F636B3A3A7365 PUSH21 0x50656E64696E6741646D696E3A2046697273742063 PUSH2 0x6C6C KECCAK256 PUSH14 0x75737420636F6D652066726F6D20 PUSH2 0x646D PUSH10 0x6E2E54696D656C6F636B GASPRICE GASPRICE PUSH20 0x657444656C61793A2044656C6179206D75737420 PUSH15 0x6F7420657863656564206D6178696D PUSH22 0x6D2064656C61792E54696D656C6F636B3A3A65786563 PUSH22 0x74655472616E73616374696F6E3A205472616E736163 PUSH21 0x696F6E206861736E2774206265656E207175657565 PUSH5 0x2E54696D65 PUSH13 0x6F636B3A3A6163636570744164 PUSH14 0x696E3A2043616C6C206D75737420 PUSH4 0x6F6D6520 PUSH7 0x726F6D2070656E PUSH5 0x696E674164 PUSH14 0x696E2E54696D656C6F636B3A3A73 PUSH6 0x7450656E6469 PUSH15 0x6741646D696E3A2043616C6C206D75 PUSH20 0x7420636F6D652066726F6D2054696D656C6F636B 0x2E SLOAD PUSH10 0x6D656C6F636B3A3A7175 PUSH6 0x75655472616E PUSH20 0x616374696F6E3A2043616C6C206D75737420636F PUSH14 0x652066726F6D2061646D696E2E54 PUSH10 0x6D656C6F636B3A3A6578 PUSH6 0x637574655472 PUSH2 0x6E73 PUSH2 0x6374 PUSH10 0x6F6E3A205472616E7361 PUSH4 0x74696F6E KECCAK256 PUSH6 0x786563757469 PUSH16 0x6E2072657665727465642E54696D656C PUSH16 0x636B3A3A71756575655472616E736163 PUSH21 0x696F6E3A20457374696D6174656420657865637574 PUSH10 0x6F6E20626C6F636B206D PUSH22 0x737420736174697366792064656C61792E54696D656C PUSH16 0x636B3A3A73657444656C61793A204361 PUSH13 0x6C206D75737420636F6D652066 PUSH19 0x6F6D2054696D656C6F636B2EA2646970667358 0x22 SLT KECCAK256 PUSH7 0x6C99309C01077B MOD PUSH30 0xA97FCDA33F0EFF1644B1BBDCD8415700F66BDE784CC564736F6C63430006 0xC STOP CALLER SLOAD PUSH10 0x6D656C6F636B3A3A636F PUSH15 0x7374727563746F723A2044656C6179 KECCAK256 PUSH14 0x757374206E6F7420657863656564 KECCAK256 PUSH14 0x6178696D756D2064656C61792E54 PUSH10 0x6D656C6F636B3A3A636F PUSH15 0x7374727563746F723A2044656C6179 KECCAK256 PUSH14 0x75737420657863656564206D696E PUSH10 0x6D756D2064656C61792E ", | |
| "sourceMap": "1825:5141:1:-:0;;;2767:352;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2515:7;2834:6;:23;;2826:91;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2566:7;2936:6;:23;;2928:95;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3044:6;3036:5;;:14;;;;;;;;;;;;;;;;;;3069:6;3061:5;:14;;;;3106:5;3086:17;;:25;;;;;;;;;;;;;;;;;;2767:352;;1825:5141;;;;;;" | |
| }, | |
| "deployedBytecode": { | |
| "immutableReferences": {}, | |
| "linkReferences": {}, | |
| "object": "6080604052600436106100e15760003560e01c80636fc1f57e1161007f578063c1a287e211610059578063c1a287e21461077d578063e177246e146107a8578063f2b06537146107e3578063f851a44014610834576100e8565b80636fc1f57e146106fa5780637d645fab14610727578063b1b43ae514610752576100e8565b80633a66f901116100bb5780633a66f901146103445780634dd18bf5146104eb578063591fcdfe1461053c5780636a42b8f8146106cf576100e8565b80630825f38f146100ed5780630e18b681146102ec5780632678224714610303576100e8565b366100e857005b600080fd5b610271600480360360a081101561010357600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190803590602001909291908035906020019064010000000081111561014a57600080fd5b82018360208201111561015c57600080fd5b8035906020019184600183028401116401000000008311171561017e57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050509192919290803590602001906401000000008111156101e157600080fd5b8201836020820111156101f357600080fd5b8035906020019184600183028401116401000000008311171561021557600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050610875565b6040518080602001828103825283818151815260200191508051906020019080838360005b838110156102b1578082015181840152602081019050610296565b50505050905090810190601f1680156102de5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b3480156102f857600080fd5b50610301610ec0565b005b34801561030f57600080fd5b5061031861104d565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b34801561035057600080fd5b506104d5600480360360a081101561036757600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156103ae57600080fd5b8201836020820111156103c057600080fd5b803590602001918460018302840111640100000000831117156103e257600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561044557600080fd5b82018360208201111561045757600080fd5b8035906020019184600183028401116401000000008311171561047957600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929080359060200190929190505050611073565b6040518082815260200191505060405180910390f35b3480156104f757600080fd5b5061053a6004803603602081101561050e57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff169060200190929190505050611423565b005b34801561054857600080fd5b506106cd600480360360a081101561055f57600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190803590602001906401000000008111156105a657600080fd5b8201836020820111156105b857600080fd5b803590602001918460018302840111640100000000831117156105da57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019064010000000081111561063d57600080fd5b82018360208201111561064f57600080fd5b8035906020019184600183028401116401000000008311171561067157600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192908035906020019092919050505061162a565b005b3480156106db57600080fd5b506106e461195e565b6040518082815260200191505060405180910390f35b34801561070657600080fd5b5061070f611964565b60405180821515815260200191505060405180910390f35b34801561073357600080fd5b5061073c611977565b6040518082815260200191505060405180910390f35b34801561075e57600080fd5b5061076761197e565b6040518082815260200191505060405180910390f35b34801561078957600080fd5b50610792611984565b6040518082815260200191505060405180910390f35b3480156107b457600080fd5b506107e1600480360360208110156107cb57600080fd5b810190808035906020019092919050505061198b565b005b3480156107ef57600080fd5b5061081c6004803603602081101561080657600080fd5b8101908080359060200190929190505050611aff565b60405180821515815260200191505060405180910390f35b34801561084057600080fd5b50610849611b1f565b604051808273ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b606060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461091b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611bd46038913960400191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610991578082015181840152602081019050610976565b50505050905090810190601f1680156109be5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156109f75780820151818401526020810190506109dc565b50505050905090810190601f168015610a245780820380516001836020036101000a031916815260200191505b509750505050505050506040516020818303038152906040528051906020012090506004600082815260200190815260200160002060009054906101000a900460ff16610abc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d815260200180611d62603d913960400191505060405180910390fd5b82610ac5611b43565b1015610b1c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526045815260200180611c766045913960600191505060405180910390fd5b610b326212750084611b4b90919063ffffffff16565b610b3a611b43565b1115610b91576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526033815260200180611c436033913960400191505060405180910390fd5b60006004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055506060600086511415610bd157849050610c6d565b85805190602001208560405160200180837bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916815260040182805190602001908083835b60208310610c355780518252602082019150602081019050602083039250610c12565b6001836020036101000a0380198251168184511680821785525050505050509050019250505060405160208183030381529060405290505b600060608973ffffffffffffffffffffffffffffffffffffffff1689846040518082805190602001908083835b60208310610cbd5780518252602082019150602081019050602083039250610c9a565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d8060008114610d1f576040519150601f19603f3d011682016040523d82523d6000602084013e610d24565b606091505b509150915081610d7f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603d815260200180611e45603d913960400191505060405180910390fd5b8973ffffffffffffffffffffffffffffffffffffffff16847fa560e3198060a2f10670c1ec5b403077ea6ae93ca8de1c32b451dc1a943cd6e78b8b8b8b604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015610e0c578082015181840152602081019050610df1565b50505050905090810190601f168015610e395780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b83811015610e72578082015181840152602081019050610e57565b50505050905090810190601f168015610e9f5780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a38094505050505095945050505050565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614610f66576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611d9f6038913960400191505060405180910390fd5b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506000600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f71614071b88dee5e0b2ae578a9dd7b2ebbe9ae832ba419dc0242cd065a290b6c60405160405180910390a2565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461111a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526036815260200180611e0f6036913960400191505060405180910390fd5b611136600254611128611b43565b611b4b90919063ffffffff16565b82101561118e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526049815260200180611e826049913960600191505060405180910390fd5b60008686868686604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156112045780820151818401526020810190506111e9565b50505050905090810190601f1680156112315780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b8381101561126a57808201518184015260208101905061124f565b50505050905090810190601f1680156112975780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060016004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508673ffffffffffffffffffffffffffffffffffffffff16817f76e2796dc3a81d57b0e8504b647febcbeeb5f4af818e164f11eef8131a6a763f88888888604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015611372578082015181840152602081019050611357565b50505050905090810190601f16801561139f5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156113d85780820151818401526020810190506113bd565b50505050905090810190601f1680156114055780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a38091505095945050505050565b600360009054906101000a900460ff16156114c1573073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146114bc576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611dd76038913960400191505060405180910390fd5b611581565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611565576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252603b815260200180611cef603b913960400191505060405180910390fd5b6001600360006101000a81548160ff0219169083151502179055505b80600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff167f69d78e38a01985fbb1462961809b4b2d65531bc93b2b94037f3334b82ca4a75660405160405180910390a250565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146116ce576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526037815260200180611c0c6037913960400191505060405180910390fd5b60008585858585604051602001808673ffffffffffffffffffffffffffffffffffffffff1681526020018581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b83811015611744578082015181840152602081019050611729565b50505050905090810190601f1680156117715780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156117aa57808201518184015260208101905061178f565b50505050905090810190601f1680156117d75780820380516001836020036101000a031916815260200191505b5097505050505050505060405160208183030381529060405280519060200120905060006004600083815260200190815260200160002060006101000a81548160ff0219169083151502179055508573ffffffffffffffffffffffffffffffffffffffff16817f2fffc091a501fd91bfbff27141450d3acb40fb8e6d8382b243ec7a812a3aaf8787878787604051808581526020018060200180602001848152602001838103835286818151815260200191508051906020019080838360005b838110156118b2578082015181840152602081019050611897565b50505050905090810190601f1680156118df5780820380516001836020036101000a031916815260200191505b50838103825285818151815260200191508051906020019080838360005b838110156119185780820151818401526020810190506118fd565b50505050905090810190601f1680156119455780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a3505050505050565b60025481565b600360009054906101000a900460ff1681565b62278d0081565b61546081565b6212750081565b3073ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611a0f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526031815260200180611ecb6031913960400191505060405180910390fd5b615460811015611a6a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526034815260200180611cbb6034913960400191505060405180910390fd5b62278d00811115611ac6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401808060200182810382526038815260200180611d2a6038913960400191505060405180910390fd5b806002819055506002547f948b1f6a42ee138b7e34058ba85a37f716d55ff25ff05a763f15bed6a04c8d2c60405160405180910390a250565b60046020528060005260406000206000915054906101000a900460ff1681565b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600042905090565b600080828401905083811015611bc9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f536166654d6174683a206164646974696f6e206f766572666c6f77000000000081525060200191505060405180910390fd5b809150509291505056fe54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a63616e63656c5472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206973207374616c652e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774207375727061737365642074696d65206c6f636b2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d75737420657863656564206d696e696d756d2064656c61792e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2046697273742063616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a73657444656c61793a2044656c6179206d757374206e6f7420657863656564206d6178696d756d2064656c61792e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e206861736e2774206265656e207175657565642e54696d656c6f636b3a3a61636365707441646d696e3a2043616c6c206d75737420636f6d652066726f6d2070656e64696e6741646d696e2e54696d656c6f636b3a3a73657450656e64696e6741646d696e3a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a2043616c6c206d75737420636f6d652066726f6d2061646d696e2e54696d656c6f636b3a3a657865637574655472616e73616374696f6e3a205472616e73616374696f6e20657865637574696f6e2072657665727465642e54696d656c6f636b3a3a71756575655472616e73616374696f6e3a20457374696d6174656420657865637574696f6e20626c6f636b206d75737420736174697366792064656c61792e54696d656c6f636b3a3a73657444656c61793a2043616c6c206d75737420636f6d652066726f6d2054696d656c6f636b2ea2646970667358221220666c99309c01077b067da97fcda33f0eff1644b1bbdcd8415700f66bde784cc564736f6c634300060c0033", | |
| "opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH2 0xE1 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x6FC1F57E GT PUSH2 0x7F JUMPI DUP1 PUSH4 0xC1A287E2 GT PUSH2 0x59 JUMPI DUP1 PUSH4 0xC1A287E2 EQ PUSH2 0x77D JUMPI DUP1 PUSH4 0xE177246E EQ PUSH2 0x7A8 JUMPI DUP1 PUSH4 0xF2B06537 EQ PUSH2 0x7E3 JUMPI DUP1 PUSH4 0xF851A440 EQ PUSH2 0x834 JUMPI PUSH2 0xE8 JUMP JUMPDEST DUP1 PUSH4 0x6FC1F57E EQ PUSH2 0x6FA JUMPI DUP1 PUSH4 0x7D645FAB EQ PUSH2 0x727 JUMPI DUP1 PUSH4 0xB1B43AE5 EQ PUSH2 0x752 JUMPI PUSH2 0xE8 JUMP JUMPDEST DUP1 PUSH4 0x3A66F901 GT PUSH2 0xBB JUMPI DUP1 PUSH4 0x3A66F901 EQ PUSH2 0x344 JUMPI DUP1 PUSH4 0x4DD18BF5 EQ PUSH2 0x4EB JUMPI DUP1 PUSH4 0x591FCDFE EQ PUSH2 0x53C JUMPI DUP1 PUSH4 0x6A42B8F8 EQ PUSH2 0x6CF JUMPI PUSH2 0xE8 JUMP JUMPDEST DUP1 PUSH4 0x825F38F EQ PUSH2 0xED JUMPI DUP1 PUSH4 0xE18B681 EQ PUSH2 0x2EC JUMPI DUP1 PUSH4 0x26782247 EQ PUSH2 0x303 JUMPI PUSH2 0xE8 JUMP JUMPDEST CALLDATASIZE PUSH2 0xE8 JUMPI STOP JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x271 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0xA0 DUP2 LT ISZERO PUSH2 0x103 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH5 0x100000000 DUP2 GT ISZERO PUSH2 0x14A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 ADD DUP4 PUSH1 0x20 DUP3 ADD GT ISZERO PUSH2 0x15C JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP2 DUP5 PUSH1 0x1 DUP4 MUL DUP5 ADD GT PUSH5 0x100000000 DUP4 GT OR ISZERO PUSH2 0x17E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP2 SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 DUP2 DUP5 ADD MSTORE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND SWAP1 POP DUP1 DUP4 ADD SWAP3 POP POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH5 0x100000000 DUP2 GT ISZERO PUSH2 0x1E1 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 ADD DUP4 PUSH1 0x20 DUP3 ADD GT ISZERO PUSH2 0x1F3 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP2 DUP5 PUSH1 0x1 DUP4 MUL DUP5 ADD GT PUSH5 0x100000000 DUP4 GT OR ISZERO PUSH2 0x215 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP2 SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 DUP2 DUP5 ADD MSTORE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND SWAP1 POP DUP1 DUP4 ADD SWAP3 POP POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x875 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE DUP4 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x2B1 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x296 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x2DE JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP3 POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x2F8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x301 PUSH2 0xEC0 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x30F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x318 PUSH2 0x104D JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x350 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x4D5 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0xA0 DUP2 LT ISZERO PUSH2 0x367 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH5 0x100000000 DUP2 GT ISZERO PUSH2 0x3AE JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 ADD DUP4 PUSH1 0x20 DUP3 ADD GT ISZERO PUSH2 0x3C0 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP2 DUP5 PUSH1 0x1 DUP4 MUL DUP5 ADD GT PUSH5 0x100000000 DUP4 GT OR ISZERO PUSH2 0x3E2 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP2 SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 DUP2 DUP5 ADD MSTORE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND SWAP1 POP DUP1 DUP4 ADD SWAP3 POP POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH5 0x100000000 DUP2 GT ISZERO PUSH2 0x445 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 ADD DUP4 PUSH1 0x20 DUP3 ADD GT ISZERO PUSH2 0x457 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP2 DUP5 PUSH1 0x1 DUP4 MUL DUP5 ADD GT PUSH5 0x100000000 DUP4 GT OR ISZERO PUSH2 0x479 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP2 SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 DUP2 DUP5 ADD MSTORE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND SWAP1 POP DUP1 DUP4 ADD SWAP3 POP POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1073 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x4F7 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x53A PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x50E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1423 JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x548 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x6CD PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0xA0 DUP2 LT ISZERO PUSH2 0x55F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH5 0x100000000 DUP2 GT ISZERO PUSH2 0x5A6 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 ADD DUP4 PUSH1 0x20 DUP3 ADD GT ISZERO PUSH2 0x5B8 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP2 DUP5 PUSH1 0x1 DUP4 MUL DUP5 ADD GT PUSH5 0x100000000 DUP4 GT OR ISZERO PUSH2 0x5DA JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP2 SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 DUP2 DUP5 ADD MSTORE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND SWAP1 POP DUP1 DUP4 ADD SWAP3 POP POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 PUSH5 0x100000000 DUP2 GT ISZERO PUSH2 0x63D JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 ADD DUP4 PUSH1 0x20 DUP3 ADD GT ISZERO PUSH2 0x64F JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP2 DUP5 PUSH1 0x1 DUP4 MUL DUP5 ADD GT PUSH5 0x100000000 DUP4 GT OR ISZERO PUSH2 0x671 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST SWAP2 SWAP1 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 DUP2 DUP5 ADD MSTORE PUSH1 0x1F NOT PUSH1 0x1F DUP3 ADD AND SWAP1 POP DUP1 DUP4 ADD SWAP3 POP POP POP POP POP POP POP SWAP2 SWAP3 SWAP2 SWAP3 SWAP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x162A JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x6DB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x6E4 PUSH2 0x195E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x706 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x70F PUSH2 0x1964 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x733 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x73C PUSH2 0x1977 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x75E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x767 PUSH2 0x197E JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x789 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x792 PUSH2 0x1984 JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x7B4 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x7E1 PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x7CB JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x198B JUMP JUMPDEST STOP JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x7EF JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x81C PUSH1 0x4 DUP1 CALLDATASIZE SUB PUSH1 0x20 DUP2 LT ISZERO PUSH2 0x806 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 ADD SWAP1 DUP1 DUP1 CALLDATALOAD SWAP1 PUSH1 0x20 ADD SWAP1 SWAP3 SWAP2 SWAP1 POP POP POP PUSH2 0x1AFF JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST CALLVALUE DUP1 ISZERO PUSH2 0x840 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x849 PUSH2 0x1B1F JUMP JUMPDEST PUSH1 0x40 MLOAD DUP1 DUP3 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x60 PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x91B JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x38 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1BD4 PUSH1 0x38 SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP7 DUP7 DUP7 DUP7 DUP7 PUSH1 0x40 MLOAD PUSH1 0x20 ADD DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x991 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x976 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x9BE JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP4 DUP2 SUB DUP3 MSTORE DUP6 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x9F7 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x9DC JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xA24 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP8 POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 SWAP1 POP PUSH1 0x4 PUSH1 0x0 DUP3 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND PUSH2 0xABC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x3D DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1D62 PUSH1 0x3D SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP3 PUSH2 0xAC5 PUSH2 0x1B43 JUMP JUMPDEST LT ISZERO PUSH2 0xB1C JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x45 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1C76 PUSH1 0x45 SWAP2 CODECOPY PUSH1 0x60 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0xB32 PUSH3 0x127500 DUP5 PUSH2 0x1B4B SWAP1 SWAP2 SWAP1 PUSH4 0xFFFFFFFF AND JUMP JUMPDEST PUSH2 0xB3A PUSH2 0x1B43 JUMP JUMPDEST GT ISZERO PUSH2 0xB91 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x33 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1C43 PUSH1 0x33 SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 PUSH1 0x4 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP PUSH1 0x60 PUSH1 0x0 DUP7 MLOAD EQ ISZERO PUSH2 0xBD1 JUMPI DUP5 SWAP1 POP PUSH2 0xC6D JUMP JUMPDEST DUP6 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 DUP6 PUSH1 0x40 MLOAD PUSH1 0x20 ADD DUP1 DUP4 PUSH28 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF NOT AND DUP2 MSTORE PUSH1 0x4 ADD DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0xC35 JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0xC12 JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP3 POP POP POP PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE SWAP1 POP JUMPDEST PUSH1 0x0 PUSH1 0x60 DUP10 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP10 DUP5 PUSH1 0x40 MLOAD DUP1 DUP3 DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 JUMPDEST PUSH1 0x20 DUP4 LT PUSH2 0xCBD JUMPI DUP1 MLOAD DUP3 MSTORE PUSH1 0x20 DUP3 ADD SWAP2 POP PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH1 0x20 DUP4 SUB SWAP3 POP PUSH2 0xC9A JUMP JUMPDEST PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB DUP1 NOT DUP3 MLOAD AND DUP2 DUP5 MLOAD AND DUP1 DUP3 OR DUP6 MSTORE POP POP POP POP POP POP SWAP1 POP ADD SWAP2 POP POP PUSH1 0x0 PUSH1 0x40 MLOAD DUP1 DUP4 SUB DUP2 DUP6 DUP8 GAS CALL SWAP3 POP POP POP RETURNDATASIZE DUP1 PUSH1 0x0 DUP2 EQ PUSH2 0xD1F JUMPI PUSH1 0x40 MLOAD SWAP2 POP PUSH1 0x1F NOT PUSH1 0x3F RETURNDATASIZE ADD AND DUP3 ADD PUSH1 0x40 MSTORE RETURNDATASIZE DUP3 MSTORE RETURNDATASIZE PUSH1 0x0 PUSH1 0x20 DUP5 ADD RETURNDATACOPY PUSH2 0xD24 JUMP JUMPDEST PUSH1 0x60 SWAP2 POP JUMPDEST POP SWAP2 POP SWAP2 POP DUP2 PUSH2 0xD7F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x3D DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1E45 PUSH1 0x3D SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP10 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP5 PUSH32 0xA560E3198060A2F10670C1EC5B403077EA6AE93CA8DE1C32B451DC1A943CD6E7 DUP12 DUP12 DUP12 DUP12 PUSH1 0x40 MLOAD DUP1 DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xE0C JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xDF1 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xE39 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP4 DUP2 SUB DUP3 MSTORE DUP6 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0xE72 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0xE57 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0xE9F JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP7 POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 DUP1 SWAP5 POP POP POP POP POP SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0xF66 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x38 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1D9F PUSH1 0x38 SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST CALLER PUSH1 0x0 DUP1 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x0 PUSH1 0x1 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x71614071B88DEE5E0B2AE578A9DD7B2EBBE9AE832BA419DC0242CD065A290B6C PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 JUMP JUMPDEST PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x111A JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x36 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1E0F PUSH1 0x36 SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x1136 PUSH1 0x2 SLOAD PUSH2 0x1128 PUSH2 0x1B43 JUMP JUMPDEST PUSH2 0x1B4B SWAP1 SWAP2 SWAP1 PUSH4 0xFFFFFFFF AND JUMP JUMPDEST DUP3 LT ISZERO PUSH2 0x118E JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x49 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1E82 PUSH1 0x49 SWAP2 CODECOPY PUSH1 0x60 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP7 DUP7 DUP7 DUP7 DUP7 PUSH1 0x40 MLOAD PUSH1 0x20 ADD DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1204 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x11E9 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x1231 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP4 DUP2 SUB DUP3 MSTORE DUP6 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x126A JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x124F JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x1297 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP8 POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 SWAP1 POP PUSH1 0x1 PUSH1 0x4 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH32 0x76E2796DC3A81D57B0E8504B647FEBCBEEB5F4AF818E164F11EEF8131A6A763F DUP9 DUP9 DUP9 DUP9 PUSH1 0x40 MLOAD DUP1 DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1372 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x1357 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x139F JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP4 DUP2 SUB DUP3 MSTORE DUP6 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x13D8 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x13BD JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x1405 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP7 POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 DUP1 SWAP2 POP POP SWAP6 SWAP5 POP POP POP POP POP JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND ISZERO PUSH2 0x14C1 JUMPI ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x14BC JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x38 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1DD7 PUSH1 0x38 SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x1581 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x1565 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x3B DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1CEF PUSH1 0x3B SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x1 PUSH1 0x3 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP JUMPDEST DUP1 PUSH1 0x1 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF MUL NOT AND SWAP1 DUP4 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND MUL OR SWAP1 SSTORE POP PUSH1 0x1 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH32 0x69D78E38A01985FBB1462961809B4B2D65531BC93B2B94037F3334B82CA4A756 PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x16CE JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x37 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1C0C PUSH1 0x37 SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH1 0x0 DUP6 DUP6 DUP6 DUP6 DUP6 PUSH1 0x40 MLOAD PUSH1 0x20 ADD DUP1 DUP7 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 MSTORE PUSH1 0x20 ADD DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1744 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x1729 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x1771 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP4 DUP2 SUB DUP3 MSTORE DUP6 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x17AA JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x178F JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x17D7 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP8 POP POP POP POP POP POP POP POP PUSH1 0x40 MLOAD PUSH1 0x20 DUP2 DUP4 SUB SUB DUP2 MSTORE SWAP1 PUSH1 0x40 MSTORE DUP1 MLOAD SWAP1 PUSH1 0x20 ADD KECCAK256 SWAP1 POP PUSH1 0x0 PUSH1 0x4 PUSH1 0x0 DUP4 DUP2 MSTORE PUSH1 0x20 ADD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x0 KECCAK256 PUSH1 0x0 PUSH2 0x100 EXP DUP2 SLOAD DUP2 PUSH1 0xFF MUL NOT AND SWAP1 DUP4 ISZERO ISZERO MUL OR SWAP1 SSTORE POP DUP6 PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 PUSH32 0x2FFFC091A501FD91BFBFF27141450D3ACB40FB8E6D8382B243EC7A812A3AAF87 DUP8 DUP8 DUP8 DUP8 PUSH1 0x40 MLOAD DUP1 DUP6 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP1 PUSH1 0x20 ADD DUP5 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP2 SUB DUP4 MSTORE DUP7 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x18B2 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x1897 JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x18DF JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP DUP4 DUP2 SUB DUP3 MSTORE DUP6 DUP2 DUP2 MLOAD DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP DUP1 MLOAD SWAP1 PUSH1 0x20 ADD SWAP1 DUP1 DUP4 DUP4 PUSH1 0x0 JUMPDEST DUP4 DUP2 LT ISZERO PUSH2 0x1918 JUMPI DUP1 DUP3 ADD MLOAD DUP2 DUP5 ADD MSTORE PUSH1 0x20 DUP2 ADD SWAP1 POP PUSH2 0x18FD JUMP JUMPDEST POP POP POP POP SWAP1 POP SWAP1 DUP2 ADD SWAP1 PUSH1 0x1F AND DUP1 ISZERO PUSH2 0x1945 JUMPI DUP1 DUP3 SUB DUP1 MLOAD PUSH1 0x1 DUP4 PUSH1 0x20 SUB PUSH2 0x100 EXP SUB NOT AND DUP2 MSTORE PUSH1 0x20 ADD SWAP2 POP JUMPDEST POP SWAP7 POP POP POP POP POP POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG3 POP POP POP POP POP POP JUMP JUMPDEST PUSH1 0x2 SLOAD DUP2 JUMP JUMPDEST PUSH1 0x3 PUSH1 0x0 SWAP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH3 0x278D00 DUP2 JUMP JUMPDEST PUSH2 0x5460 DUP2 JUMP JUMPDEST PUSH3 0x127500 DUP2 JUMP JUMPDEST ADDRESS PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND CALLER PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND EQ PUSH2 0x1A0F JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x31 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1ECB PUSH1 0x31 SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH2 0x5460 DUP2 LT ISZERO PUSH2 0x1A6A JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x34 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1CBB PUSH1 0x34 SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST PUSH3 0x278D00 DUP2 GT ISZERO PUSH2 0x1AC6 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x38 DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH2 0x1D2A PUSH1 0x38 SWAP2 CODECOPY PUSH1 0x40 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP1 PUSH1 0x2 DUP2 SWAP1 SSTORE POP PUSH1 0x2 SLOAD PUSH32 0x948B1F6A42EE138B7E34058BA85A37F716D55FF25FF05A763F15BED6A04C8D2C PUSH1 0x40 MLOAD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 LOG2 POP JUMP JUMPDEST PUSH1 0x4 PUSH1 0x20 MSTORE DUP1 PUSH1 0x0 MSTORE PUSH1 0x40 PUSH1 0x0 KECCAK256 PUSH1 0x0 SWAP2 POP SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH1 0xFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 DUP1 SLOAD SWAP1 PUSH2 0x100 EXP SWAP1 DIV PUSH20 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF AND DUP2 JUMP JUMPDEST PUSH1 0x0 TIMESTAMP SWAP1 POP SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 DUP3 DUP5 ADD SWAP1 POP DUP4 DUP2 LT ISZERO PUSH2 0x1BC9 JUMPI PUSH1 0x40 MLOAD PUSH32 0x8C379A000000000000000000000000000000000000000000000000000000000 DUP2 MSTORE PUSH1 0x4 ADD DUP1 DUP1 PUSH1 0x20 ADD DUP3 DUP2 SUB DUP3 MSTORE PUSH1 0x1B DUP2 MSTORE PUSH1 0x20 ADD DUP1 PUSH32 0x536166654D6174683A206164646974696F6E206F766572666C6F770000000000 DUP2 MSTORE POP PUSH1 0x20 ADD SWAP2 POP POP PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 REVERT JUMPDEST DUP1 SWAP2 POP POP SWAP3 SWAP2 POP POP JUMP INVALID SLOAD PUSH10 0x6D656C6F636B3A3A6578 PUSH6 0x637574655472 PUSH2 0x6E73 PUSH2 0x6374 PUSH10 0x6F6E3A2043616C6C206D PUSH22 0x737420636F6D652066726F6D2061646D696E2E54696D PUSH6 0x6C6F636B3A3A PUSH4 0x616E6365 PUSH13 0x5472616E73616374696F6E3A20 NUMBER PUSH2 0x6C6C KECCAK256 PUSH14 0x75737420636F6D652066726F6D20 PUSH2 0x646D PUSH10 0x6E2E54696D656C6F636B GASPRICE GASPRICE PUSH6 0x786563757465 SLOAD PUSH19 0x616E73616374696F6E3A205472616E73616374 PUSH10 0x6F6E206973207374616C PUSH6 0x2E54696D656C PUSH16 0x636B3A3A657865637574655472616E73 PUSH2 0x6374 PUSH10 0x6F6E3A205472616E7361 PUSH4 0x74696F6E KECCAK256 PUSH9 0x61736E277420737572 PUSH17 0x61737365642074696D65206C6F636B2E54 PUSH10 0x6D656C6F636B3A3A7365 PUSH21 0x44656C61793A2044656C6179206D75737420657863 PUSH6 0x6564206D696E PUSH10 0x6D756D2064656C61792E SLOAD PUSH10 0x6D656C6F636B3A3A7365 PUSH21 0x50656E64696E6741646D696E3A2046697273742063 PUSH2 0x6C6C KECCAK256 PUSH14 0x75737420636F6D652066726F6D20 PUSH2 0x646D PUSH10 0x6E2E54696D656C6F636B GASPRICE GASPRICE PUSH20 0x657444656C61793A2044656C6179206D75737420 PUSH15 0x6F7420657863656564206D6178696D PUSH22 0x6D2064656C61792E54696D656C6F636B3A3A65786563 PUSH22 0x74655472616E73616374696F6E3A205472616E736163 PUSH21 0x696F6E206861736E2774206265656E207175657565 PUSH5 0x2E54696D65 PUSH13 0x6F636B3A3A6163636570744164 PUSH14 0x696E3A2043616C6C206D75737420 PUSH4 0x6F6D6520 PUSH7 0x726F6D2070656E PUSH5 0x696E674164 PUSH14 0x696E2E54696D656C6F636B3A3A73 PUSH6 0x7450656E6469 PUSH15 0x6741646D696E3A2043616C6C206D75 PUSH20 0x7420636F6D652066726F6D2054696D656C6F636B 0x2E SLOAD PUSH10 0x6D656C6F636B3A3A7175 PUSH6 0x75655472616E PUSH20 0x616374696F6E3A2043616C6C206D75737420636F PUSH14 0x652066726F6D2061646D696E2E54 PUSH10 0x6D656C6F636B3A3A6578 PUSH6 0x637574655472 PUSH2 0x6E73 PUSH2 0x6374 PUSH10 0x6F6E3A205472616E7361 PUSH4 0x74696F6E KECCAK256 PUSH6 0x786563757469 PUSH16 0x6E2072657665727465642E54696D656C PUSH16 0x636B3A3A71756575655472616E736163 PUSH21 0x696F6E3A20457374696D6174656420657865637574 PUSH10 0x6F6E20626C6F636B206D PUSH22 0x737420736174697366792064656C61792E54696D656C PUSH16 0x636B3A3A73657444656C61793A204361 PUSH13 0x6C206D75737420636F6D652066 PUSH19 0x6F6D2054696D656C6F636B2EA2646970667358 0x22 SLT KECCAK256 PUSH7 0x6C99309C01077B MOD PUSH30 0xA97FCDA33F0EFF1644B1BBDCD8415700F66BDE784CC564736F6C63430006 0xC STOP CALLER ", | |
| "sourceMap": "1825:5141:1:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5477:1316;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3624:242;;;;;;;;;;;;;:::i;:::-;;2609:27;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;4419:607;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;3874:537;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;5034:435;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;2643:17;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2667:29;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;2529:44;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2478;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;2428:43;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;3210:406;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;2705:51;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;2582:20;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;5477:1316;5611:12;5658:5;;;;;;;;;;5644:19;;:10;:19;;;5636:88;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5737:14;5775:6;5783:5;5790:9;5801:4;5807:3;5764:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5754:58;;;;;;5737:75;;5831:18;:26;5850:6;5831:26;;;;;;;;;;;;;;;;;;;;;5823:100;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5965:3;5942:19;:17;:19::i;:::-;:26;;5934:108;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6084:21;2464:7;6084:3;:7;;:21;;;;:::i;:::-;6061:19;:17;:19::i;:::-;:44;;6053:108;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6203:5;6174:18;:26;6193:6;6174:26;;;;;;;;;;;;:34;;;;;;;;;;;;;;;;;;6221:21;6286:1;6265:9;6259:23;:28;6255:179;;;6315:4;6304:15;;6255:179;;;6403:9;6387:27;;;;;;6417:4;6363:59;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6352:70;;6255:179;6507:12;6521:23;6548:6;:11;;6566:5;6573:8;6548:34;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6506:76;;;;6601:7;6593:81;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6719:6;6692:63;;6711:6;6692:63;6727:5;6734:9;6745:4;6751:3;6692:63;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6775:10;6768:17;;;;;;5477:1316;;;;;;;:::o;3624:242::-;3687:12;;;;;;;;;;;3673:26;;:10;:26;;;3665:95;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3779:10;3771:5;;:18;;;;;;;;;;;;;;;;;;3823:1;3800:12;;:25;;;;;;;;;;;;;;;;;;3852:5;;;;;;;;;;3843:15;;;;;;;;;;;;3624:242::o;2609:27::-;;;;;;;;;;;;;:::o;4419:607::-;4543:7;4585:5;;;;;;;;;;;4571:19;;:10;:19;;;4563:86;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4675:30;4699:5;;4675:19;:17;:19::i;:::-;:23;;:30;;;;:::i;:::-;4668:3;:37;;4660:123;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4796:14;4834:6;4842:5;4849:9;4860:4;4866:3;4823:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4813:58;;;;;;4796:75;;4911:4;4882:18;:26;4901:6;4882:26;;;;;;;;;;;;:33;;;;;;;;;;;;;;;;;;4958:6;4933:61;;4950:6;4933:61;4966:5;4973:9;4984:4;4990:3;4933:61;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5012:6;5005:13;;;4419:607;;;;;;;:::o;3874:537::-;4013:17;;;;;;;;;;;4009:309;;;4077:4;4055:27;;:10;:27;;;4047:96;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4009:309;;;4198:5;;;;;;;;;;4184:19;;:10;:19;;;4176:91;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4302:4;4282:17;;:24;;;;;;;;;;;;;;;;;;4009:309;4343:13;4328:12;;:28;;;;;;;;;;;;;;;;;;4390:12;;;;;;;;;;;4374:29;;;;;;;;;;;;3874:537;:::o;5034:435::-;5183:5;;;;;;;;;;5169:19;;:10;:19;;;5161:87;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5261:14;5299:6;5307:5;5314:9;5325:4;5331:3;5288:47;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5278:58;;;;;;5261:75;;5376:5;5347:18;:26;5366:6;5347:26;;;;;;;;;;;;:34;;;;;;;;;;;;;;;;;;5425:6;5399:62;;5417:6;5399:62;5433:5;5440:9;5451:4;5457:3;5399:62;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;5034:435;;;;;;:::o;2643:17::-;;;;:::o;2667:29::-;;;;;;;;;;;;;:::o;2529:44::-;2566:7;2529:44;:::o;2478:::-;2515:7;2478:44;:::o;2428:43::-;2464:7;2428:43;:::o;3210:406::-;3289:4;3267:27;;:10;:27;;;3259:89;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2515:7;3367:6;:23;;3359:88;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2566:7;3466:6;:23;;3458:92;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;3569:6;3561:5;:14;;;;3602:5;;3593:15;;;;;;;;;;3210:406;:::o;2705:51::-;;;;;;;;;;;;;;;;;;;;;;:::o;2582:20::-;;;;;;;;;;;;:::o;6801:162::-;6853:4;6940:15;6933:22;;6801:162;:::o;875:176:0:-;933:7;952:9;968:1;964;:5;952:17;;992:1;987;:6;;979:46;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1043:1;1036:8;;;875:176;;;;:::o" | |
| }, | |
| "gasEstimates": { | |
| "creation": { | |
| "codeDepositCost": "1597000", | |
| "executionCost": "infinite", | |
| "totalCost": "infinite" | |
| }, | |
| "external": { | |
| "GRACE_PERIOD()": "227", | |
| "MAXIMUM_DELAY()": "250", | |
| "MINIMUM_DELAY()": "272", | |
| "acceptAdmin()": "infinite", | |
| "admin()": "1132", | |
| "admin_initialized()": "1070", | |
| "cancelTransaction(address,uint256,string,bytes,uint256)": "infinite", | |
| "delay()": "1094", | |
| "executeTransaction(address,uint256,string,bytes,uint256)": "infinite", | |
| "pendingAdmin()": "1115", | |
| "queueTransaction(address,uint256,string,bytes,uint256)": "infinite", | |
| "queuedTransactions(bytes32)": "1260", | |
| "setDelay(uint256)": "infinite", | |
| "setPendingAdmin(address)": "infinite" | |
| }, | |
| "internal": { | |
| "getBlockTimestamp()": "22" | |
| } | |
| }, | |
| "methodIdentifiers": { | |
| "GRACE_PERIOD()": "c1a287e2", | |
| "MAXIMUM_DELAY()": "7d645fab", | |
| "MINIMUM_DELAY()": "b1b43ae5", | |
| "acceptAdmin()": "0e18b681", | |
| "admin()": "f851a440", | |
| "admin_initialized()": "6fc1f57e", | |
| "cancelTransaction(address,uint256,string,bytes,uint256)": "591fcdfe", | |
| "delay()": "6a42b8f8", | |
| "executeTransaction(address,uint256,string,bytes,uint256)": "0825f38f", | |
| "pendingAdmin()": "26782247", | |
| "queueTransaction(address,uint256,string,bytes,uint256)": "3a66f901", | |
| "queuedTransactions(bytes32)": "f2b06537", | |
| "setDelay(uint256)": "e177246e", | |
| "setPendingAdmin(address)": "4dd18bf5" | |
| } | |
| }, | |
| "abi": [ | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "admin_", | |
| "type": "address" | |
| }, | |
| { | |
| "internalType": "uint256", | |
| "name": "delay_", | |
| "type": "uint256" | |
| } | |
| ], | |
| "stateMutability": "nonpayable", | |
| "type": "constructor" | |
| }, | |
| { | |
| "anonymous": false, | |
| "inputs": [ | |
| { | |
| "indexed": true, | |
| "internalType": "bytes32", | |
| "name": "txHash", | |
| "type": "bytes32" | |
| }, | |
| { | |
| "indexed": true, | |
| "internalType": "address", | |
| "name": "target", | |
| "type": "address" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "uint256", | |
| "name": "value", | |
| "type": "uint256" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "string", | |
| "name": "signature", | |
| "type": "string" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "bytes", | |
| "name": "data", | |
| "type": "bytes" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "uint256", | |
| "name": "eta", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "CancelTransaction", | |
| "type": "event" | |
| }, | |
| { | |
| "anonymous": false, | |
| "inputs": [ | |
| { | |
| "indexed": true, | |
| "internalType": "bytes32", | |
| "name": "txHash", | |
| "type": "bytes32" | |
| }, | |
| { | |
| "indexed": true, | |
| "internalType": "address", | |
| "name": "target", | |
| "type": "address" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "uint256", | |
| "name": "value", | |
| "type": "uint256" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "string", | |
| "name": "signature", | |
| "type": "string" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "bytes", | |
| "name": "data", | |
| "type": "bytes" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "uint256", | |
| "name": "eta", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "ExecuteTransaction", | |
| "type": "event" | |
| }, | |
| { | |
| "anonymous": false, | |
| "inputs": [ | |
| { | |
| "indexed": true, | |
| "internalType": "address", | |
| "name": "newAdmin", | |
| "type": "address" | |
| } | |
| ], | |
| "name": "NewAdmin", | |
| "type": "event" | |
| }, | |
| { | |
| "anonymous": false, | |
| "inputs": [ | |
| { | |
| "indexed": true, | |
| "internalType": "uint256", | |
| "name": "newDelay", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "NewDelay", | |
| "type": "event" | |
| }, | |
| { | |
| "anonymous": false, | |
| "inputs": [ | |
| { | |
| "indexed": true, | |
| "internalType": "address", | |
| "name": "newPendingAdmin", | |
| "type": "address" | |
| } | |
| ], | |
| "name": "NewPendingAdmin", | |
| "type": "event" | |
| }, | |
| { | |
| "anonymous": false, | |
| "inputs": [ | |
| { | |
| "indexed": true, | |
| "internalType": "bytes32", | |
| "name": "txHash", | |
| "type": "bytes32" | |
| }, | |
| { | |
| "indexed": true, | |
| "internalType": "address", | |
| "name": "target", | |
| "type": "address" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "uint256", | |
| "name": "value", | |
| "type": "uint256" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "string", | |
| "name": "signature", | |
| "type": "string" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "bytes", | |
| "name": "data", | |
| "type": "bytes" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "uint256", | |
| "name": "eta", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "QueueTransaction", | |
| "type": "event" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "GRACE_PERIOD", | |
| "outputs": [ | |
| { | |
| "internalType": "uint256", | |
| "name": "", | |
| "type": "uint256" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "MAXIMUM_DELAY", | |
| "outputs": [ | |
| { | |
| "internalType": "uint256", | |
| "name": "", | |
| "type": "uint256" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "MINIMUM_DELAY", | |
| "outputs": [ | |
| { | |
| "internalType": "uint256", | |
| "name": "", | |
| "type": "uint256" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "acceptAdmin", | |
| "outputs": [], | |
| "stateMutability": "nonpayable", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "admin", | |
| "outputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "", | |
| "type": "address" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "admin_initialized", | |
| "outputs": [ | |
| { | |
| "internalType": "bool", | |
| "name": "", | |
| "type": "bool" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "target", | |
| "type": "address" | |
| }, | |
| { | |
| "internalType": "uint256", | |
| "name": "value", | |
| "type": "uint256" | |
| }, | |
| { | |
| "internalType": "string", | |
| "name": "signature", | |
| "type": "string" | |
| }, | |
| { | |
| "internalType": "bytes", | |
| "name": "data", | |
| "type": "bytes" | |
| }, | |
| { | |
| "internalType": "uint256", | |
| "name": "eta", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "cancelTransaction", | |
| "outputs": [], | |
| "stateMutability": "nonpayable", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "delay", | |
| "outputs": [ | |
| { | |
| "internalType": "uint256", | |
| "name": "", | |
| "type": "uint256" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "target", | |
| "type": "address" | |
| }, | |
| { | |
| "internalType": "uint256", | |
| "name": "value", | |
| "type": "uint256" | |
| }, | |
| { | |
| "internalType": "string", | |
| "name": "signature", | |
| "type": "string" | |
| }, | |
| { | |
| "internalType": "bytes", | |
| "name": "data", | |
| "type": "bytes" | |
| }, | |
| { | |
| "internalType": "uint256", | |
| "name": "eta", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "executeTransaction", | |
| "outputs": [ | |
| { | |
| "internalType": "bytes", | |
| "name": "", | |
| "type": "bytes" | |
| } | |
| ], | |
| "stateMutability": "payable", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "pendingAdmin", | |
| "outputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "", | |
| "type": "address" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "target", | |
| "type": "address" | |
| }, | |
| { | |
| "internalType": "uint256", | |
| "name": "value", | |
| "type": "uint256" | |
| }, | |
| { | |
| "internalType": "string", | |
| "name": "signature", | |
| "type": "string" | |
| }, | |
| { | |
| "internalType": "bytes", | |
| "name": "data", | |
| "type": "bytes" | |
| }, | |
| { | |
| "internalType": "uint256", | |
| "name": "eta", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "queueTransaction", | |
| "outputs": [ | |
| { | |
| "internalType": "bytes32", | |
| "name": "", | |
| "type": "bytes32" | |
| } | |
| ], | |
| "stateMutability": "nonpayable", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "bytes32", | |
| "name": "", | |
| "type": "bytes32" | |
| } | |
| ], | |
| "name": "queuedTransactions", | |
| "outputs": [ | |
| { | |
| "internalType": "bool", | |
| "name": "", | |
| "type": "bool" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "uint256", | |
| "name": "delay_", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "setDelay", | |
| "outputs": [], | |
| "stateMutability": "nonpayable", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "pendingAdmin_", | |
| "type": "address" | |
| } | |
| ], | |
| "name": "setPendingAdmin", | |
| "outputs": [], | |
| "stateMutability": "nonpayable", | |
| "type": "function" | |
| }, | |
| { | |
| "stateMutability": "payable", | |
| "type": "receive" | |
| } | |
| ] | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "compiler": { | |
| "version": "0.6.12+commit.27d51765" | |
| }, | |
| "language": "Solidity", | |
| "output": { | |
| "abi": [ | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "admin_", | |
| "type": "address" | |
| }, | |
| { | |
| "internalType": "uint256", | |
| "name": "delay_", | |
| "type": "uint256" | |
| } | |
| ], | |
| "stateMutability": "nonpayable", | |
| "type": "constructor" | |
| }, | |
| { | |
| "anonymous": false, | |
| "inputs": [ | |
| { | |
| "indexed": true, | |
| "internalType": "bytes32", | |
| "name": "txHash", | |
| "type": "bytes32" | |
| }, | |
| { | |
| "indexed": true, | |
| "internalType": "address", | |
| "name": "target", | |
| "type": "address" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "uint256", | |
| "name": "value", | |
| "type": "uint256" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "string", | |
| "name": "signature", | |
| "type": "string" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "bytes", | |
| "name": "data", | |
| "type": "bytes" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "uint256", | |
| "name": "eta", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "CancelTransaction", | |
| "type": "event" | |
| }, | |
| { | |
| "anonymous": false, | |
| "inputs": [ | |
| { | |
| "indexed": true, | |
| "internalType": "bytes32", | |
| "name": "txHash", | |
| "type": "bytes32" | |
| }, | |
| { | |
| "indexed": true, | |
| "internalType": "address", | |
| "name": "target", | |
| "type": "address" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "uint256", | |
| "name": "value", | |
| "type": "uint256" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "string", | |
| "name": "signature", | |
| "type": "string" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "bytes", | |
| "name": "data", | |
| "type": "bytes" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "uint256", | |
| "name": "eta", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "ExecuteTransaction", | |
| "type": "event" | |
| }, | |
| { | |
| "anonymous": false, | |
| "inputs": [ | |
| { | |
| "indexed": true, | |
| "internalType": "address", | |
| "name": "newAdmin", | |
| "type": "address" | |
| } | |
| ], | |
| "name": "NewAdmin", | |
| "type": "event" | |
| }, | |
| { | |
| "anonymous": false, | |
| "inputs": [ | |
| { | |
| "indexed": true, | |
| "internalType": "uint256", | |
| "name": "newDelay", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "NewDelay", | |
| "type": "event" | |
| }, | |
| { | |
| "anonymous": false, | |
| "inputs": [ | |
| { | |
| "indexed": true, | |
| "internalType": "address", | |
| "name": "newPendingAdmin", | |
| "type": "address" | |
| } | |
| ], | |
| "name": "NewPendingAdmin", | |
| "type": "event" | |
| }, | |
| { | |
| "anonymous": false, | |
| "inputs": [ | |
| { | |
| "indexed": true, | |
| "internalType": "bytes32", | |
| "name": "txHash", | |
| "type": "bytes32" | |
| }, | |
| { | |
| "indexed": true, | |
| "internalType": "address", | |
| "name": "target", | |
| "type": "address" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "uint256", | |
| "name": "value", | |
| "type": "uint256" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "string", | |
| "name": "signature", | |
| "type": "string" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "bytes", | |
| "name": "data", | |
| "type": "bytes" | |
| }, | |
| { | |
| "indexed": false, | |
| "internalType": "uint256", | |
| "name": "eta", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "QueueTransaction", | |
| "type": "event" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "GRACE_PERIOD", | |
| "outputs": [ | |
| { | |
| "internalType": "uint256", | |
| "name": "", | |
| "type": "uint256" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "MAXIMUM_DELAY", | |
| "outputs": [ | |
| { | |
| "internalType": "uint256", | |
| "name": "", | |
| "type": "uint256" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "MINIMUM_DELAY", | |
| "outputs": [ | |
| { | |
| "internalType": "uint256", | |
| "name": "", | |
| "type": "uint256" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "acceptAdmin", | |
| "outputs": [], | |
| "stateMutability": "nonpayable", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "admin", | |
| "outputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "", | |
| "type": "address" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "admin_initialized", | |
| "outputs": [ | |
| { | |
| "internalType": "bool", | |
| "name": "", | |
| "type": "bool" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "target", | |
| "type": "address" | |
| }, | |
| { | |
| "internalType": "uint256", | |
| "name": "value", | |
| "type": "uint256" | |
| }, | |
| { | |
| "internalType": "string", | |
| "name": "signature", | |
| "type": "string" | |
| }, | |
| { | |
| "internalType": "bytes", | |
| "name": "data", | |
| "type": "bytes" | |
| }, | |
| { | |
| "internalType": "uint256", | |
| "name": "eta", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "cancelTransaction", | |
| "outputs": [], | |
| "stateMutability": "nonpayable", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "delay", | |
| "outputs": [ | |
| { | |
| "internalType": "uint256", | |
| "name": "", | |
| "type": "uint256" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "target", | |
| "type": "address" | |
| }, | |
| { | |
| "internalType": "uint256", | |
| "name": "value", | |
| "type": "uint256" | |
| }, | |
| { | |
| "internalType": "string", | |
| "name": "signature", | |
| "type": "string" | |
| }, | |
| { | |
| "internalType": "bytes", | |
| "name": "data", | |
| "type": "bytes" | |
| }, | |
| { | |
| "internalType": "uint256", | |
| "name": "eta", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "executeTransaction", | |
| "outputs": [ | |
| { | |
| "internalType": "bytes", | |
| "name": "", | |
| "type": "bytes" | |
| } | |
| ], | |
| "stateMutability": "payable", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [], | |
| "name": "pendingAdmin", | |
| "outputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "", | |
| "type": "address" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "target", | |
| "type": "address" | |
| }, | |
| { | |
| "internalType": "uint256", | |
| "name": "value", | |
| "type": "uint256" | |
| }, | |
| { | |
| "internalType": "string", | |
| "name": "signature", | |
| "type": "string" | |
| }, | |
| { | |
| "internalType": "bytes", | |
| "name": "data", | |
| "type": "bytes" | |
| }, | |
| { | |
| "internalType": "uint256", | |
| "name": "eta", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "queueTransaction", | |
| "outputs": [ | |
| { | |
| "internalType": "bytes32", | |
| "name": "", | |
| "type": "bytes32" | |
| } | |
| ], | |
| "stateMutability": "nonpayable", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "bytes32", | |
| "name": "", | |
| "type": "bytes32" | |
| } | |
| ], | |
| "name": "queuedTransactions", | |
| "outputs": [ | |
| { | |
| "internalType": "bool", | |
| "name": "", | |
| "type": "bool" | |
| } | |
| ], | |
| "stateMutability": "view", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "uint256", | |
| "name": "delay_", | |
| "type": "uint256" | |
| } | |
| ], | |
| "name": "setDelay", | |
| "outputs": [], | |
| "stateMutability": "nonpayable", | |
| "type": "function" | |
| }, | |
| { | |
| "inputs": [ | |
| { | |
| "internalType": "address", | |
| "name": "pendingAdmin_", | |
| "type": "address" | |
| } | |
| ], | |
| "name": "setPendingAdmin", | |
| "outputs": [], | |
| "stateMutability": "nonpayable", | |
| "type": "function" | |
| }, | |
| { | |
| "stateMutability": "payable", | |
| "type": "receive" | |
| } | |
| ], | |
| "devdoc": { | |
| "kind": "dev", | |
| "methods": {}, | |
| "version": 1 | |
| }, | |
| "userdoc": { | |
| "kind": "user", | |
| "methods": {}, | |
| "version": 1 | |
| } | |
| }, | |
| "settings": { | |
| "compilationTarget": { | |
| "contracts/Timelock.sol": "Timelock" | |
| }, | |
| "evmVersion": "istanbul", | |
| "libraries": {}, | |
| "metadata": { | |
| "bytecodeHash": "ipfs" | |
| }, | |
| "optimizer": { | |
| "enabled": false, | |
| "runs": 200 | |
| }, | |
| "remappings": [] | |
| }, | |
| "sources": { | |
| "@pancakeswap/pancake-swap-lib/contracts/math/SafeMath.sol": { | |
| "keccak256": "0xd4b1686c1494213666dc1423cea64333c3063f334327216d69ca3d59f75a2517", | |
| "license": "MIT", | |
| "urls": [ | |
| "bzz-raw://3a3c967dc005a8966266b6052724b7cd04231c6d95abcc03f49e1cbb9ffb890a", | |
| "dweb:/ipfs/QmRWofmmac5HLRYpMTDQLzmgZyJYeYLB2MY8uTFRKfJuJL" | |
| ] | |
| }, | |
| "contracts/Timelock.sol": { | |
| "keccak256": "0xd3844e7458e6d4ca7321449d768fbde58da4da9e4fd63d5c073e5e527c39cccd", | |
| "urls": [ | |
| "bzz-raw://8d871fe0d3d20b8b53d8cc45cb9a62c767e575408d276656ad85627232cc236e", | |
| "dweb:/ipfs/QmT6DkGkatwKM6vDD3RgHCa8N4qJ4FjJGZFX5xugfcaDUQ" | |
| ] | |
| } | |
| }, | |
| "version": 1 | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity 0.6.12; | |
| import '@pancakeswap/pancake-swap-lib/contracts/math/SafeMath.sol'; | |
| import '@pancakeswap/pancake-swap-lib/contracts/token/BEP20/IBEP20.sol'; | |
| import '@pancakeswap/pancake-swap-lib/contracts/token/BEP20/SafeBEP20.sol'; | |
| import '@pancakeswap/pancake-swap-lib/contracts/access/Ownable.sol'; | |
| // import "@nomiclabs/buidler/console.sol"; | |
| interface IWBNB { | |
| function deposit() external payable; | |
| function transfer(address to, uint256 value) external returns (bool); | |
| function withdraw(uint256) external; | |
| } | |
| contract BnbStaking is Ownable { | |
| using SafeMath for uint256; | |
| using SafeBEP20 for IBEP20; | |
| // Info of each user. | |
| struct UserInfo { | |
| uint256 amount; // How many LP tokens the user has provided. | |
| uint256 rewardDebt; // Reward debt. See explanation below. | |
| bool inBlackList; | |
| } | |
| // Info of each pool. | |
| struct PoolInfo { | |
| IBEP20 lpToken; // Address of LP token contract. | |
| uint256 allocPoint; // How many allocation points assigned to this pool. CAKEs to distribute per block. | |
| uint256 lastRewardBlock; // Last block number that CAKEs distribution occurs. | |
| uint256 accCakePerShare; // Accumulated CAKEs per share, times 1e12. See below. | |
| } | |
| // The REWARD TOKEN | |
| IBEP20 public rewardToken; | |
| // adminAddress | |
| address public adminAddress; | |
| // WBNB | |
| address public immutable WBNB; | |
| // CAKE tokens created per block. | |
| uint256 public rewardPerBlock; | |
| // Info of each pool. | |
| PoolInfo[] public poolInfo; | |
| // Info of each user that stakes LP tokens. | |
| mapping (address => UserInfo) public userInfo; | |
| // limit 10 BNB here | |
| uint256 public limitAmount = 10000000000000000000; | |
| // Total allocation poitns. Must be the sum of all allocation points in all pools. | |
| uint256 public totalAllocPoint = 0; | |
| // The block number when CAKE mining starts. | |
| uint256 public startBlock; | |
| // The block number when CAKE mining ends. | |
| uint256 public bonusEndBlock; | |
| event Deposit(address indexed user, uint256 amount); | |
| event Withdraw(address indexed user, uint256 amount); | |
| event EmergencyWithdraw(address indexed user, uint256 amount); | |
| constructor( | |
| IBEP20 _lp, | |
| IBEP20 _rewardToken, | |
| uint256 _rewardPerBlock, | |
| uint256 _startBlock, | |
| uint256 _bonusEndBlock, | |
| address _adminAddress, | |
| address _wbnb | |
| ) public { | |
| rewardToken = _rewardToken; | |
| rewardPerBlock = _rewardPerBlock; | |
| startBlock = _startBlock; | |
| bonusEndBlock = _bonusEndBlock; | |
| adminAddress = _adminAddress; | |
| WBNB = _wbnb; | |
| // staking pool | |
| poolInfo.push(PoolInfo({ | |
| lpToken: _lp, | |
| allocPoint: 1000, | |
| lastRewardBlock: startBlock, | |
| accCakePerShare: 0 | |
| })); | |
| totalAllocPoint = 1000; | |
| } | |
| modifier onlyAdmin() { | |
| require(msg.sender == adminAddress, "admin: wut?"); | |
| _; | |
| } | |
| receive() external payable { | |
| assert(msg.sender == WBNB); // only accept BNB via fallback from the WBNB contract | |
| } | |
| // Update admin address by the previous dev. | |
| function setAdmin(address _adminAddress) public onlyOwner { | |
| adminAddress = _adminAddress; | |
| } | |
| function setBlackList(address _blacklistAddress) public onlyAdmin { | |
| userInfo[_blacklistAddress].inBlackList = true; | |
| } | |
| function removeBlackList(address _blacklistAddress) public onlyAdmin { | |
| userInfo[_blacklistAddress].inBlackList = false; | |
| } | |
| // Set the limit amount. Can only be called by the owner. | |
| function setLimitAmount(uint256 _amount) public onlyOwner { | |
| limitAmount = _amount; | |
| } | |
| // Return reward multiplier over the given _from to _to block. | |
| function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) { | |
| if (_to <= bonusEndBlock) { | |
| return _to.sub(_from); | |
| } else if (_from >= bonusEndBlock) { | |
| return 0; | |
| } else { | |
| return bonusEndBlock.sub(_from); | |
| } | |
| } | |
| // View function to see pending Reward on frontend. | |
| function pendingReward(address _user) external view returns (uint256) { | |
| PoolInfo storage pool = poolInfo[0]; | |
| UserInfo storage user = userInfo[_user]; | |
| uint256 accCakePerShare = pool.accCakePerShare; | |
| uint256 lpSupply = pool.lpToken.balanceOf(address(this)); | |
| if (block.number > pool.lastRewardBlock && lpSupply != 0) { | |
| uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number); | |
| uint256 cakeReward = multiplier.mul(rewardPerBlock).mul(pool.allocPoint).div(totalAllocPoint); | |
| accCakePerShare = accCakePerShare.add(cakeReward.mul(1e12).div(lpSupply)); | |
| } | |
| return user.amount.mul(accCakePerShare).div(1e12).sub(user.rewardDebt); | |
| } | |
| // Update reward variables of the given pool to be up-to-date. | |
| function updatePool(uint256 _pid) public { | |
| PoolInfo storage pool = poolInfo[_pid]; | |
| if (block.number <= pool.lastRewardBlock) { | |
| return; | |
| } | |
| uint256 lpSupply = pool.lpToken.balanceOf(address(this)); | |
| if (lpSupply == 0) { | |
| pool.lastRewardBlock = block.number; | |
| return; | |
| } | |
| uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number); | |
| uint256 cakeReward = multiplier.mul(rewardPerBlock).mul(pool.allocPoint).div(totalAllocPoint); | |
| pool.accCakePerShare = pool.accCakePerShare.add(cakeReward.mul(1e12).div(lpSupply)); | |
| pool.lastRewardBlock = block.number; | |
| } | |
| // Update reward variables for all pools. Be careful of gas spending! | |
| function massUpdatePools() public { | |
| uint256 length = poolInfo.length; | |
| for (uint256 pid = 0; pid < length; ++pid) { | |
| updatePool(pid); | |
| } | |
| } | |
| // Stake tokens to SmartChef | |
| function deposit() public payable { | |
| PoolInfo storage pool = poolInfo[0]; | |
| UserInfo storage user = userInfo[msg.sender]; | |
| require (user.amount.add(msg.value) <= limitAmount, 'exceed the top'); | |
| require (!user.inBlackList, 'in black list'); | |
| updatePool(0); | |
| if (user.amount > 0) { | |
| uint256 pending = user.amount.mul(pool.accCakePerShare).div(1e12).sub(user.rewardDebt); | |
| if(pending > 0) { | |
| rewardToken.safeTransfer(address(msg.sender), pending); | |
| } | |
| } | |
| if(msg.value > 0) { | |
| IWBNB(WBNB).deposit{value: msg.value}(); | |
| assert(IWBNB(WBNB).transfer(address(this), msg.value)); | |
| user.amount = user.amount.add(msg.value); | |
| } | |
| user.rewardDebt = user.amount.mul(pool.accCakePerShare).div(1e12); | |
| emit Deposit(msg.sender, msg.value); | |
| } | |
| function safeTransferBNB(address to, uint256 value) internal { | |
| (bool success, ) = to.call{gas: 23000, value: value}(""); | |
| // (bool success,) = to.call{value:value}(new bytes(0)); | |
| require(success, 'TransferHelper: ETH_TRANSFER_FAILED'); | |
| } | |
| // Withdraw tokens from STAKING. | |
| function withdraw(uint256 _amount) public { | |
| PoolInfo storage pool = poolInfo[0]; | |
| UserInfo storage user = userInfo[msg.sender]; | |
| require(user.amount >= _amount, "withdraw: not good"); | |
| updatePool(0); | |
| uint256 pending = user.amount.mul(pool.accCakePerShare).div(1e12).sub(user.rewardDebt); | |
| if(pending > 0 && !user.inBlackList) { | |
| rewardToken.safeTransfer(address(msg.sender), pending); | |
| } | |
| if(_amount > 0) { | |
| user.amount = user.amount.sub(_amount); | |
| IWBNB(WBNB).withdraw(_amount); | |
| safeTransferBNB(address(msg.sender), _amount); | |
| } | |
| user.rewardDebt = user.amount.mul(pool.accCakePerShare).div(1e12); | |
| emit Withdraw(msg.sender, _amount); | |
| } | |
| // Withdraw without caring about rewards. EMERGENCY ONLY. | |
| function emergencyWithdraw() public { | |
| PoolInfo storage pool = poolInfo[0]; | |
| UserInfo storage user = userInfo[msg.sender]; | |
| pool.lpToken.safeTransfer(address(msg.sender), user.amount); | |
| emit EmergencyWithdraw(msg.sender, user.amount); | |
| user.amount = 0; | |
| user.rewardDebt = 0; | |
| } | |
| // Withdraw reward. EMERGENCY ONLY. | |
| function emergencyRewardWithdraw(uint256 _amount) public onlyOwner { | |
| require(_amount < rewardToken.balanceOf(address(this)), 'not enough token'); | |
| rewardToken.safeTransfer(address(msg.sender), _amount); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity 0.6.12; | |
| import "@citrino-network/citrino-swap-lib/contracts/token/BEP20/BEP20.sol"; | |
| // CakeToken with Governance. | |
| contract CakeToken is BEP20('PancakeSwap Token', 'Cake') { | |
| /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef). | |
| function mint(address _to, uint256 _amount) public onlyOwner { | |
| _mint(_to, _amount); | |
| _moveDelegates(address(0), _delegates[_to], _amount); | |
| } | |
| // Copied and modified from YAM code: | |
| // https://github.com/yam-finance/yam-protocol/blob/master/contracts/token/YAMGovernanceStorage.sol | |
| // https://github.com/yam-finance/yam-protocol/blob/master/contracts/token/YAMGovernance.sol | |
| // Which is copied and modified from COMPOUND: | |
| // https://github.com/compound-finance/compound-protocol/blob/master/contracts/Governance/Comp.sol | |
| /// @notice A record of each accounts delegate | |
| mapping (address => address) internal _delegates; | |
| /// @notice A checkpoint for marking number of votes from a given block | |
| struct Checkpoint { | |
| uint32 fromBlock; | |
| uint256 votes; | |
| } | |
| /// @notice A record of votes checkpoints for each account, by index | |
| mapping (address => mapping (uint32 => Checkpoint)) public checkpoints; | |
| /// @notice The number of checkpoints for each account | |
| mapping (address => uint32) public numCheckpoints; | |
| /// @notice The EIP-712 typehash for the contract's domain | |
| bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); | |
| /// @notice The EIP-712 typehash for the delegation struct used by the contract | |
| bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); | |
| /// @notice A record of states for signing / validating signatures | |
| mapping (address => uint) public nonces; | |
| /// @notice An event thats emitted when an account changes its delegate | |
| event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); | |
| /// @notice An event thats emitted when a delegate account's vote balance changes | |
| event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance); | |
| /** | |
| * @notice Delegate votes from `msg.sender` to `delegatee` | |
| * @param delegator The address to get delegatee for | |
| */ | |
| function delegates(address delegator) | |
| external | |
| view | |
| returns (address) | |
| { | |
| return _delegates[delegator]; | |
| } | |
| /** | |
| * @notice Delegate votes from `msg.sender` to `delegatee` | |
| * @param delegatee The address to delegate votes to | |
| */ | |
| function delegate(address delegatee) external { | |
| return _delegate(msg.sender, delegatee); | |
| } | |
| /** | |
| * @notice Delegates votes from signatory to `delegatee` | |
| * @param delegatee The address to delegate votes to | |
| * @param nonce The contract state required to match the signature | |
| * @param expiry The time at which to expire the signature | |
| * @param v The recovery byte of the signature | |
| * @param r Half of the ECDSA signature pair | |
| * @param s Half of the ECDSA signature pair | |
| */ | |
| function delegateBySig( | |
| address delegatee, | |
| uint nonce, | |
| uint expiry, | |
| uint8 v, | |
| bytes32 r, | |
| bytes32 s | |
| ) | |
| external | |
| { | |
| bytes32 domainSeparator = keccak256( | |
| abi.encode( | |
| DOMAIN_TYPEHASH, | |
| keccak256(bytes(name())), | |
| getChainId(), | |
| address(this) | |
| ) | |
| ); | |
| bytes32 structHash = keccak256( | |
| abi.encode( | |
| DELEGATION_TYPEHASH, | |
| delegatee, | |
| nonce, | |
| expiry | |
| ) | |
| ); | |
| bytes32 digest = keccak256( | |
| abi.encodePacked( | |
| "\x19\x01", | |
| domainSeparator, | |
| structHash | |
| ) | |
| ); | |
| address signatory = ecrecover(digest, v, r, s); | |
| require(signatory != address(0), "CAKE::delegateBySig: invalid signature"); | |
| require(nonce == nonces[signatory]++, "CAKE::delegateBySig: invalid nonce"); | |
| require(now <= expiry, "CAKE::delegateBySig: signature expired"); | |
| return _delegate(signatory, delegatee); | |
| } | |
| /** | |
| * @notice Gets the current votes balance for `account` | |
| * @param account The address to get votes balance | |
| * @return The number of current votes for `account` | |
| */ | |
| function getCurrentVotes(address account) | |
| external | |
| view | |
| returns (uint256) | |
| { | |
| uint32 nCheckpoints = numCheckpoints[account]; | |
| return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; | |
| } | |
| /** | |
| * @notice Determine the prior number of votes for an account as of a block number | |
| * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. | |
| * @param account The address of the account to check | |
| * @param blockNumber The block number to get the vote balance at | |
| * @return The number of votes the account had as of the given block | |
| */ | |
| function getPriorVotes(address account, uint blockNumber) | |
| external | |
| view | |
| returns (uint256) | |
| { | |
| require(blockNumber < block.number, "CAKE::getPriorVotes: not yet determined"); | |
| uint32 nCheckpoints = numCheckpoints[account]; | |
| if (nCheckpoints == 0) { | |
| return 0; | |
| } | |
| // First check most recent balance | |
| if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) { | |
| return checkpoints[account][nCheckpoints - 1].votes; | |
| } | |
| // Next check implicit zero balance | |
| if (checkpoints[account][0].fromBlock > blockNumber) { | |
| return 0; | |
| } | |
| uint32 lower = 0; | |
| uint32 upper = nCheckpoints - 1; | |
| while (upper > lower) { | |
| uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow | |
| Checkpoint memory cp = checkpoints[account][center]; | |
| if (cp.fromBlock == blockNumber) { | |
| return cp.votes; | |
| } else if (cp.fromBlock < blockNumber) { | |
| lower = center; | |
| } else { | |
| upper = center - 1; | |
| } | |
| } | |
| return checkpoints[account][lower].votes; | |
| } | |
| function _delegate(address delegator, address delegatee) | |
| internal | |
| { | |
| address currentDelegate = _delegates[delegator]; | |
| uint256 delegatorBalance = balanceOf(delegator); // balance of underlying CAKEs (not scaled); | |
| _delegates[delegator] = delegatee; | |
| emit DelegateChanged(delegator, currentDelegate, delegatee); | |
| _moveDelegates(currentDelegate, delegatee, delegatorBalance); | |
| } | |
| function _moveDelegates(address srcRep, address dstRep, uint256 amount) internal { | |
| if (srcRep != dstRep && amount > 0) { | |
| if (srcRep != address(0)) { | |
| // decrease old representative | |
| uint32 srcRepNum = numCheckpoints[srcRep]; | |
| uint256 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; | |
| uint256 srcRepNew = srcRepOld.sub(amount); | |
| _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew); | |
| } | |
| if (dstRep != address(0)) { | |
| // increase new representative | |
| uint32 dstRepNum = numCheckpoints[dstRep]; | |
| uint256 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0; | |
| uint256 dstRepNew = dstRepOld.add(amount); | |
| _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); | |
| } | |
| } | |
| } | |
| function _writeCheckpoint( | |
| address delegatee, | |
| uint32 nCheckpoints, | |
| uint256 oldVotes, | |
| uint256 newVotes | |
| ) | |
| internal | |
| { | |
| uint32 blockNumber = safe32(block.number, "CAKE::_writeCheckpoint: block number exceeds 32 bits"); | |
| if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) { | |
| checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; | |
| } else { | |
| checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes); | |
| numCheckpoints[delegatee] = nCheckpoints + 1; | |
| } | |
| emit DelegateVotesChanged(delegatee, oldVotes, newVotes); | |
| } | |
| function safe32(uint n, string memory errorMessage) internal pure returns (uint32) { | |
| require(n < 2**32, errorMessage); | |
| return uint32(n); | |
| } | |
| function getChainId() internal pure returns (uint) { | |
| uint256 chainId; | |
| assembly { chainId := chainid() } | |
| return chainId; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity >=0.4.25 <0.7.0; | |
| contract Migrations { | |
| address public owner; | |
| uint public last_completed_migration; | |
| modifier restricted() { | |
| if (msg.sender == owner) _; | |
| } | |
| constructor() public { | |
| owner = msg.sender; | |
| } | |
| function setCompleted(uint completed) public restricted { | |
| last_completed_migration = completed; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity 0.6.12; | |
| import "@citrino-network/citrino-swap-lib/contracts/token/BEP20/BEP20.sol"; | |
| contract MockBEP20 is BEP20 { | |
| constructor( | |
| string memory name, | |
| string memory symbol, | |
| uint256 supply | |
| ) public BEP20(name, symbol) { | |
| _mint(msg.sender, supply); | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity >=0.5.0; | |
| pragma experimental ABIEncoderV2; | |
| /// @title Multicall - Aggregate results from multiple read-only function calls | |
| /// @author Michael Elliot <[email protected]> | |
| /// @author Joshua Levine <[email protected]> | |
| /// @author Nick Johnson <[email protected]> | |
| contract Multicall { | |
| struct Call { | |
| address target; | |
| bytes callData; | |
| } | |
| function aggregate(Call[] memory calls) public returns (uint256 blockNumber, bytes[] memory returnData) { | |
| blockNumber = block.number; | |
| returnData = new bytes[](calls.length); | |
| for(uint256 i = 0; i < calls.length; i++) { | |
| (bool success, bytes memory ret) = calls[i].target.call(calls[i].callData); | |
| require(success); | |
| returnData[i] = ret; | |
| } | |
| } | |
| // Helper functions | |
| function getEthBalance(address addr) public view returns (uint256 balance) { | |
| balance = addr.balance; | |
| } | |
| function getBlockHash(uint256 blockNumber) public view returns (bytes32 blockHash) { | |
| blockHash = blockhash(blockNumber); | |
| } | |
| function getLastBlockHash() public view returns (bytes32 blockHash) { | |
| blockHash = blockhash(block.number - 1); | |
| } | |
| function getCurrentBlockTimestamp() public view returns (uint256 timestamp) { | |
| timestamp = block.timestamp; | |
| } | |
| function getCurrentBlockDifficulty() public view returns (uint256 difficulty) { | |
| difficulty = block.difficulty; | |
| } | |
| function getCurrentBlockGasLimit() public view returns (uint256 gaslimit) { | |
| gaslimit = block.gaslimit; | |
| } | |
| function getCurrentBlockCoinbase() public view returns (address coinbase) { | |
| coinbase = block.coinbase; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity 0.6.12; | |
| interface IBEP20 { | |
| /** | |
| * @dev Returns the amount of tokens in existence. | |
| */ | |
| function totalSupply() external view returns (uint256); | |
| /** | |
| * @dev Returns the token decimals. | |
| */ | |
| function decimals() external view returns (uint8); | |
| /** | |
| * @dev Returns the token symbol. | |
| */ | |
| function symbol() external view returns (string memory); | |
| /** | |
| * @dev Returns the token name. | |
| */ | |
| function name() external view returns (string memory); | |
| /** | |
| * @dev Returns the bep token owner. | |
| */ | |
| function getOwner() external view returns (address); | |
| /** | |
| * @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); | |
| } | |
| contract PancakeVoterProxy { | |
| // SYRUP | |
| address public constant votes = 0x009cF7bC57584b7998236eff51b98A168DceA9B0; | |
| function decimals() external pure returns (uint8) { | |
| return uint8(18); | |
| } | |
| function name() external pure returns (string memory) { | |
| return 'SYRUPVOTE'; | |
| } | |
| function symbol() external pure returns (string memory) { | |
| return 'SYRUP'; | |
| } | |
| function totalSupply() external view returns (uint256) { | |
| return IBEP20(votes).totalSupply(); | |
| } | |
| function balanceOf(address _voter) external view returns (uint256) { | |
| return IBEP20(votes).balanceOf(_voter); | |
| } | |
| constructor() public {} | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity >0.4.18; | |
| contract WBNB { | |
| string public name = "Wrapped BNB"; | |
| string public symbol = "WBNB"; | |
| uint8 public decimals = 18; | |
| event Approval(address indexed src, address indexed guy, uint wad); | |
| event Transfer(address indexed src, address indexed dst, uint wad); | |
| event Deposit(address indexed dst, uint wad); | |
| event Withdrawal(address indexed src, uint wad); | |
| mapping (address => uint) public balanceOf; | |
| mapping (address => mapping (address => uint)) public allowance; | |
| function a() public payable { | |
| deposit(); | |
| } | |
| function deposit() public payable { | |
| balanceOf[msg.sender] += msg.value; | |
| emit Deposit(msg.sender, msg.value); | |
| } | |
| function withdraw(uint wad) public { | |
| require(balanceOf[msg.sender] >= wad); | |
| balanceOf[msg.sender] -= wad; | |
| msg.sender.transfer(wad); | |
| emit Withdrawal(msg.sender, wad); | |
| } | |
| function totalSupply() public view returns (uint) { | |
| return address(this).balance; | |
| } | |
| function approve(address guy, uint wad) public returns (bool) { | |
| allowance[msg.sender][guy] = wad; | |
| emit Approval(msg.sender, guy, wad); | |
| return true; | |
| } | |
| function transfer(address dst, uint wad) public returns (bool) { | |
| return transferFrom(msg.sender, dst, wad); | |
| } | |
| function transferFrom(address src, address dst, uint wad) | |
| public | |
| returns (bool) | |
| { | |
| require(balanceOf[src] >= wad); | |
| if (src != msg.sender && allowance[src][msg.sender] != uint(-1)) { | |
| require(allowance[src][msg.sender] >= wad); | |
| allowance[src][msg.sender] -= wad; | |
| } | |
| balanceOf[src] -= wad; | |
| balanceOf[dst] += wad; | |
| Transfer(src, dst, wad); | |
| return true; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity 0.6.12; | |
| import '@pancakeswap/pancake-swap-lib/contracts/token/BEP20/IBEP20.sol'; | |
| import '@pancakeswap/pancake-swap-lib/contracts/token/BEP20/SafeBEP20.sol'; | |
| import '@pancakeswap/pancake-swap-lib/contracts/access/Ownable.sol'; | |
| import './MasterChef.sol'; | |
| contract LotteryRewardPool is Ownable { | |
| using SafeBEP20 for IBEP20; | |
| MasterChef public chef; | |
| address public adminAddress; | |
| address public receiver; | |
| IBEP20 public lptoken; | |
| IBEP20 public cake; | |
| constructor( | |
| MasterChef _chef, | |
| IBEP20 _cake, | |
| address _admin, | |
| address _receiver | |
| ) public { | |
| chef = _chef; | |
| cake = _cake; | |
| adminAddress = _admin; | |
| receiver = _receiver; | |
| } | |
| event StartFarming(address indexed user, uint256 indexed pid); | |
| event Harvest(address indexed user, uint256 indexed pid); | |
| event EmergencyWithdraw(address indexed user, uint256 amount); | |
| modifier onlyAdmin() { | |
| require(msg.sender == adminAddress, "admin: wut?"); | |
| _; | |
| } | |
| function startFarming(uint256 _pid, IBEP20 _lptoken, uint256 _amount) external onlyAdmin { | |
| _lptoken.safeApprove(address(chef), _amount); | |
| chef.deposit(_pid, _amount); | |
| emit StartFarming(msg.sender, _pid); | |
| } | |
| function harvest(uint256 _pid) external onlyAdmin { | |
| chef.deposit(_pid, 0); | |
| uint256 balance = cake.balanceOf(address(this)); | |
| cake.safeTransfer(receiver, balance); | |
| emit Harvest(msg.sender, _pid); | |
| } | |
| function setReceiver(address _receiver) external onlyAdmin { | |
| receiver = _receiver; | |
| } | |
| function pendingReward(uint256 _pid) external view returns (uint256) { | |
| return chef.pendingCake(_pid, address(this)); | |
| } | |
| // EMERGENCY ONLY. | |
| function emergencyWithdraw(IBEP20 _token, uint256 _amount) external onlyOwner { | |
| cake.safeTransfer(address(msg.sender), _amount); | |
| emit EmergencyWithdraw(msg.sender, _amount); | |
| } | |
| function setAdmin(address _admin) external onlyOwner { | |
| adminAddress = _admin; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity 0.6.12; | |
| import '@citrino-network/citrino-swap-lib/contracts/math/SafeMath.sol'; | |
| import '@citrino-network/citrino-swap-lib/contracts/token/BEP20/IBEP20.sol'; | |
| import '@citrino-network/citrino-swap-lib/contracts/token/BEP20/SafeBEP20.sol'; | |
| import '@citrino-network/citrino-swap-lib/contracts/access/Ownable.sol'; | |
| import "./CakeToken.sol"; | |
| import "./SyrupBar.sol"; | |
| // import "@nomiclabs/buidler/console.sol"; | |
| interface IMigratorChef { | |
| // Perform LP token migration from legacy PancakeSwap to CakeSwap. | |
| // Take the current LP token address and return the new LP token address. | |
| // Migrator should have full access to the caller's LP token. | |
| // Return the new LP token address. | |
| // | |
| // XXX Migrator must have allowance access to PancakeSwap LP tokens. | |
| // CakeSwap must mint EXACTLY the same amount of CakeSwap LP tokens or | |
| // else something bad will happen. Traditional PancakeSwap does not | |
| // do that so be careful! | |
| function migrate(IBEP20 token) external returns (IBEP20); | |
| } | |
| // MasterChef is the master of Cake. He can make Cake and he is a fair guy. | |
| // | |
| // Note that it's ownable and the owner wields tremendous power. The ownership | |
| // will be transferred to a governance smart contract once CAKE is sufficiently | |
| // distributed and the community can show to govern itself. | |
| // | |
| // Have fun reading it. Hopefully it's bug-free. God bless. | |
| contract MasterChef is Ownable { | |
| using SafeMath for uint256; | |
| using SafeBEP20 for IBEP20; | |
| // Info of each user. | |
| struct UserInfo { | |
| uint256 amount; // How many LP tokens the user has provided. | |
| uint256 rewardDebt; // Reward debt. See explanation below. | |
| // | |
| // We do some fancy math here. Basically, any point in time, the amount of CAKEs | |
| // entitled to a user but is pending to be distributed is: | |
| // | |
| // pending reward = (user.amount * pool.accCakePerShare) - user.rewardDebt | |
| // | |
| // Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens: | |
| // 1. The pool's `accCakePerShare` (and `lastRewardBlock`) gets updated. | |
| // 2. User receives the pending reward sent to his/her address. | |
| // 3. User's `amount` gets updated. | |
| // 4. User's `rewardDebt` gets updated. | |
| } | |
| // Info of each pool. | |
| struct PoolInfo { | |
| IBEP20 lpToken; // Address of LP token contract. | |
| uint256 allocPoint; // How many allocation points assigned to this pool. CAKEs to distribute per block. | |
| uint256 lastRewardBlock; // Last block number that CAKEs distribution occurs. | |
| uint256 accCakePerShare; // Accumulated CAKEs per share, times 1e12. See below. | |
| } | |
| // The CAKE TOKEN! | |
| CakeToken public cake; | |
| // The SYRUP TOKEN! | |
| SyrupBar public syrup; | |
| // Dev address. | |
| address public devaddr; | |
| // CAKE tokens created per block. | |
| uint256 public cakePerBlock; | |
| // Bonus muliplier for early cake makers. | |
| uint256 public BONUS_MULTIPLIER = 1; | |
| // The migrator contract. It has a lot of power. Can only be set through governance (owner). | |
| IMigratorChef public migrator; | |
| // Info of each pool. | |
| PoolInfo[] public poolInfo; | |
| // Info of each user that stakes LP tokens. | |
| mapping (uint256 => mapping (address => UserInfo)) public userInfo; | |
| // Total allocation points. Must be the sum of all allocation points in all pools. | |
| uint256 public totalAllocPoint = 0; | |
| // The block number when CAKE mining starts. | |
| uint256 public startBlock; | |
| event Deposit(address indexed user, uint256 indexed pid, uint256 amount); | |
| event Withdraw(address indexed user, uint256 indexed pid, uint256 amount); | |
| event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount); | |
| constructor( | |
| CakeToken _cake, | |
| SyrupBar _syrup, | |
| address _devaddr, | |
| uint256 _cakePerBlock, | |
| uint256 _startBlock | |
| ) public { | |
| cake = _cake; | |
| syrup = _syrup; | |
| devaddr = _devaddr; | |
| cakePerBlock = _cakePerBlock; | |
| startBlock = _startBlock; | |
| // staking pool | |
| poolInfo.push(PoolInfo({ | |
| lpToken: _cake, | |
| allocPoint: 1000, | |
| lastRewardBlock: startBlock, | |
| accCakePerShare: 0 | |
| })); | |
| totalAllocPoint = 1000; | |
| } | |
| function updateMultiplier(uint256 multiplierNumber) public onlyOwner { | |
| BONUS_MULTIPLIER = multiplierNumber; | |
| } | |
| function poolLength() external view returns (uint256) { | |
| return poolInfo.length; | |
| } | |
| // Add a new lp to the pool. Can only be called by the owner. | |
| // XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do. | |
| function add(uint256 _allocPoint, IBEP20 _lpToken, bool _withUpdate) public onlyOwner { | |
| if (_withUpdate) { | |
| massUpdatePools(); | |
| } | |
| uint256 lastRewardBlock = block.number > startBlock ? block.number : startBlock; | |
| totalAllocPoint = totalAllocPoint.add(_allocPoint); | |
| poolInfo.push(PoolInfo({ | |
| lpToken: _lpToken, | |
| allocPoint: _allocPoint, | |
| lastRewardBlock: lastRewardBlock, | |
| accCakePerShare: 0 | |
| })); | |
| updateStakingPool(); | |
| } | |
| // Update the given pool's CAKE allocation point. Can only be called by the owner. | |
| function set(uint256 _pid, uint256 _allocPoint, bool _withUpdate) public onlyOwner { | |
| if (_withUpdate) { | |
| massUpdatePools(); | |
| } | |
| uint256 prevAllocPoint = poolInfo[_pid].allocPoint; | |
| poolInfo[_pid].allocPoint = _allocPoint; | |
| if (prevAllocPoint != _allocPoint) { | |
| totalAllocPoint = totalAllocPoint.sub(prevAllocPoint).add(_allocPoint); | |
| updateStakingPool(); | |
| } | |
| } | |
| function updateStakingPool() internal { | |
| uint256 length = poolInfo.length; | |
| uint256 points = 0; | |
| for (uint256 pid = 1; pid < length; ++pid) { | |
| points = points.add(poolInfo[pid].allocPoint); | |
| } | |
| if (points != 0) { | |
| points = points.div(3); | |
| totalAllocPoint = totalAllocPoint.sub(poolInfo[0].allocPoint).add(points); | |
| poolInfo[0].allocPoint = points; | |
| } | |
| } | |
| // Set the migrator contract. Can only be called by the owner. | |
| function setMigrator(IMigratorChef _migrator) public onlyOwner { | |
| migrator = _migrator; | |
| } | |
| // Migrate lp token to another lp contract. Can be called by anyone. We trust that migrator contract is good. | |
| function migrate(uint256 _pid) public { | |
| require(address(migrator) != address(0), "migrate: no migrator"); | |
| PoolInfo storage pool = poolInfo[_pid]; | |
| IBEP20 lpToken = pool.lpToken; | |
| uint256 bal = lpToken.balanceOf(address(this)); | |
| lpToken.safeApprove(address(migrator), bal); | |
| IBEP20 newLpToken = migrator.migrate(lpToken); | |
| require(bal == newLpToken.balanceOf(address(this)), "migrate: bad"); | |
| pool.lpToken = newLpToken; | |
| } | |
| // Return reward multiplier over the given _from to _to block. | |
| function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) { | |
| return _to.sub(_from).mul(BONUS_MULTIPLIER); | |
| } | |
| // View function to see pending CAKEs on frontend. | |
| function pendingCake(uint256 _pid, address _user) external view returns (uint256) { | |
| PoolInfo storage pool = poolInfo[_pid]; | |
| UserInfo storage user = userInfo[_pid][_user]; | |
| uint256 accCakePerShare = pool.accCakePerShare; | |
| uint256 lpSupply = pool.lpToken.balanceOf(address(this)); | |
| if (block.number > pool.lastRewardBlock && lpSupply != 0) { | |
| uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number); | |
| uint256 cakeReward = multiplier.mul(cakePerBlock).mul(pool.allocPoint).div(totalAllocPoint); | |
| accCakePerShare = accCakePerShare.add(cakeReward.mul(1e12).div(lpSupply)); | |
| } | |
| return user.amount.mul(accCakePerShare).div(1e12).sub(user.rewardDebt); | |
| } | |
| // Update reward variables for all pools. Be careful of gas spending! | |
| function massUpdatePools() public { | |
| uint256 length = poolInfo.length; | |
| for (uint256 pid = 0; pid < length; ++pid) { | |
| updatePool(pid); | |
| } | |
| } | |
| // Update reward variables of the given pool to be up-to-date. | |
| function updatePool(uint256 _pid) public { | |
| PoolInfo storage pool = poolInfo[_pid]; | |
| if (block.number <= pool.lastRewardBlock) { | |
| return; | |
| } | |
| uint256 lpSupply = pool.lpToken.balanceOf(address(this)); | |
| if (lpSupply == 0) { | |
| pool.lastRewardBlock = block.number; | |
| return; | |
| } | |
| uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number); | |
| uint256 cakeReward = multiplier.mul(cakePerBlock).mul(pool.allocPoint).div(totalAllocPoint); | |
| cake.mint(devaddr, cakeReward.div(10)); | |
| cake.mint(address(syrup), cakeReward); | |
| pool.accCakePerShare = pool.accCakePerShare.add(cakeReward.mul(1e12).div(lpSupply)); | |
| pool.lastRewardBlock = block.number; | |
| } | |
| // Deposit LP tokens to MasterChef for CAKE allocation. | |
| function deposit(uint256 _pid, uint256 _amount) public { | |
| require (_pid != 0, 'deposit CAKE by staking'); | |
| PoolInfo storage pool = poolInfo[_pid]; | |
| UserInfo storage user = userInfo[_pid][msg.sender]; | |
| updatePool(_pid); | |
| if (user.amount > 0) { | |
| uint256 pending = user.amount.mul(pool.accCakePerShare).div(1e12).sub(user.rewardDebt); | |
| if(pending > 0) { | |
| safeCakeTransfer(msg.sender, pending); | |
| } | |
| } | |
| if (_amount > 0) { | |
| pool.lpToken.safeTransferFrom(address(msg.sender), address(this), _amount); | |
| user.amount = user.amount.add(_amount); | |
| } | |
| user.rewardDebt = user.amount.mul(pool.accCakePerShare).div(1e12); | |
| emit Deposit(msg.sender, _pid, _amount); | |
| } | |
| // Withdraw LP tokens from MasterChef. | |
| function withdraw(uint256 _pid, uint256 _amount) public { | |
| require (_pid != 0, 'withdraw CAKE by unstaking'); | |
| PoolInfo storage pool = poolInfo[_pid]; | |
| UserInfo storage user = userInfo[_pid][msg.sender]; | |
| require(user.amount >= _amount, "withdraw: not good"); | |
| updatePool(_pid); | |
| uint256 pending = user.amount.mul(pool.accCakePerShare).div(1e12).sub(user.rewardDebt); | |
| if(pending > 0) { | |
| safeCakeTransfer(msg.sender, pending); | |
| } | |
| if(_amount > 0) { | |
| user.amount = user.amount.sub(_amount); | |
| pool.lpToken.safeTransfer(address(msg.sender), _amount); | |
| } | |
| user.rewardDebt = user.amount.mul(pool.accCakePerShare).div(1e12); | |
| emit Withdraw(msg.sender, _pid, _amount); | |
| } | |
| // Stake CAKE tokens to MasterChef | |
| function enterStaking(uint256 _amount) public { | |
| PoolInfo storage pool = poolInfo[0]; | |
| UserInfo storage user = userInfo[0][msg.sender]; | |
| updatePool(0); | |
| if (user.amount > 0) { | |
| uint256 pending = user.amount.mul(pool.accCakePerShare).div(1e12).sub(user.rewardDebt); | |
| if(pending > 0) { | |
| safeCakeTransfer(msg.sender, pending); | |
| } | |
| } | |
| if(_amount > 0) { | |
| pool.lpToken.safeTransferFrom(address(msg.sender), address(this), _amount); | |
| user.amount = user.amount.add(_amount); | |
| } | |
| user.rewardDebt = user.amount.mul(pool.accCakePerShare).div(1e12); | |
| syrup.mint(msg.sender, _amount); | |
| emit Deposit(msg.sender, 0, _amount); | |
| } | |
| // Withdraw CAKE tokens from STAKING. | |
| function leaveStaking(uint256 _amount) public { | |
| PoolInfo storage pool = poolInfo[0]; | |
| UserInfo storage user = userInfo[0][msg.sender]; | |
| require(user.amount >= _amount, "withdraw: not good"); | |
| updatePool(0); | |
| uint256 pending = user.amount.mul(pool.accCakePerShare).div(1e12).sub(user.rewardDebt); | |
| if(pending > 0) { | |
| safeCakeTransfer(msg.sender, pending); | |
| } | |
| if(_amount > 0) { | |
| user.amount = user.amount.sub(_amount); | |
| pool.lpToken.safeTransfer(address(msg.sender), _amount); | |
| } | |
| user.rewardDebt = user.amount.mul(pool.accCakePerShare).div(1e12); | |
| syrup.burn(msg.sender, _amount); | |
| emit Withdraw(msg.sender, 0, _amount); | |
| } | |
| // Withdraw without caring about rewards. EMERGENCY ONLY. | |
| function emergencyWithdraw(uint256 _pid) public { | |
| PoolInfo storage pool = poolInfo[_pid]; | |
| UserInfo storage user = userInfo[_pid][msg.sender]; | |
| pool.lpToken.safeTransfer(address(msg.sender), user.amount); | |
| emit EmergencyWithdraw(msg.sender, _pid, user.amount); | |
| user.amount = 0; | |
| user.rewardDebt = 0; | |
| } | |
| // Safe cake transfer function, just in case if rounding error causes pool to not have enough CAKEs. | |
| function safeCakeTransfer(address _to, uint256 _amount) internal { | |
| syrup.safeCakeTransfer(_to, _amount); | |
| } | |
| // Update dev address by the previous dev. | |
| function dev(address _devaddr) public { | |
| require(msg.sender == devaddr, "dev: wut?"); | |
| devaddr = _devaddr; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity 0.6.12; | |
| import '@citrino-network/citrino-swap-lib/contracts/math/SafeMath.sol'; | |
| import '@citrino-network/citrino-swap-lib/contracts/token/BEP20/IBEP20.sol'; | |
| import '@citrino-network/citrino-swap-lib/contracts/token/BEP20/SafeBEP20.sol'; | |
| // import "@nomiclabs/buidler/console.sol"; | |
| // SousChef is the chef of new tokens. He can make yummy food and he is a fair guy as well as MasterChef. | |
| contract SousChef { | |
| using SafeMath for uint256; | |
| using SafeBEP20 for IBEP20; | |
| // Info of each user. | |
| struct UserInfo { | |
| uint256 amount; // How many SYRUP tokens the user has provided. | |
| uint256 rewardDebt; // Reward debt. See explanation below. | |
| uint256 rewardPending; | |
| // | |
| // We do some fancy math here. Basically, any point in time, the amount of SYRUPs | |
| // entitled to a user but is pending to be distributed is: | |
| // | |
| // pending reward = (user.amount * pool.accRewardPerShare) - user.rewardDebt + user.rewardPending | |
| // | |
| // Whenever a user deposits or withdraws SYRUP tokens to a pool. Here's what happens: | |
| // 1. The pool's `accRewardPerShare` (and `lastRewardBlock`) gets updated. | |
| // 2. User receives the pending reward sent to his/her address. | |
| // 3. User's `amount` gets updated. | |
| // 3. User's `amount` gets updated. | |
| // 4. User's `rewardDebt` gets updated. | |
| } | |
| // Info of Pool | |
| struct PoolInfo { | |
| uint256 lastRewardBlock; // Last block number that Rewards distribution occurs. | |
| uint256 accRewardPerShare; // Accumulated reward per share, times 1e12. See below. | |
| } | |
| // The SYRUP TOKEN! | |
| IBEP20 public syrup; | |
| // rewards created per block. | |
| uint256 public rewardPerBlock; | |
| // Info. | |
| PoolInfo public poolInfo; | |
| // Info of each user that stakes Syrup tokens. | |
| mapping (address => UserInfo) public userInfo; | |
| // addresses list | |
| address[] public addressList; | |
| // The block number when mining starts. | |
| uint256 public startBlock; | |
| // The block number when mining ends. | |
| uint256 public bonusEndBlock; | |
| event Deposit(address indexed user, uint256 amount); | |
| event Withdraw(address indexed user, uint256 amount); | |
| event EmergencyWithdraw(address indexed user, uint256 amount); | |
| constructor( | |
| IBEP20 _syrup, | |
| uint256 _rewardPerBlock, | |
| uint256 _startBlock, | |
| uint256 _endBlock | |
| ) public { | |
| syrup = _syrup; | |
| rewardPerBlock = _rewardPerBlock; | |
| startBlock = _startBlock; | |
| bonusEndBlock = _endBlock; | |
| // staking pool | |
| poolInfo = PoolInfo({ | |
| lastRewardBlock: startBlock, | |
| accRewardPerShare: 0 | |
| }); | |
| } | |
| function addressLength() external view returns (uint256) { | |
| return addressList.length; | |
| } | |
| // Return reward multiplier over the given _from to _to block. | |
| function getMultiplier(uint256 _from, uint256 _to) internal view returns (uint256) { | |
| if (_to <= bonusEndBlock) { | |
| return _to.sub(_from); | |
| } else if (_from >= bonusEndBlock) { | |
| return 0; | |
| } else { | |
| return bonusEndBlock.sub(_from); | |
| } | |
| } | |
| // View function to see pending Tokens on frontend. | |
| function pendingReward(address _user) external view returns (uint256) { | |
| PoolInfo storage pool = poolInfo; | |
| UserInfo storage user = userInfo[_user]; | |
| uint256 accRewardPerShare = pool.accRewardPerShare; | |
| uint256 stakedSupply = syrup.balanceOf(address(this)); | |
| if (block.number > pool.lastRewardBlock && stakedSupply != 0) { | |
| uint256 multiplier = getMultiplier(pool.lastRewardBlock, block.number); | |
| uint256 tokenReward = multiplier.mul(rewardPerBlock); | |
| accRewardPerShare = accRewardPerShare.add(tokenReward.mul(1e12).div(stakedSupply)); | |
| } | |
| return user.amount.mul(accRewardPerShare).div(1e12).sub(user.rewardDebt).add(user.rewardPending); | |
| } | |
| // Update reward variables of the given pool to be up-to-date. | |
| function updatePool() public { | |
| if (block.number <= poolInfo.lastRewardBlock) { | |
| return; | |
| } | |
| uint256 syrupSupply = syrup.balanceOf(address(this)); | |
| if (syrupSupply == 0) { | |
| poolInfo.lastRewardBlock = block.number; | |
| return; | |
| } | |
| uint256 multiplier = getMultiplier(poolInfo.lastRewardBlock, block.number); | |
| uint256 tokenReward = multiplier.mul(rewardPerBlock); | |
| poolInfo.accRewardPerShare = poolInfo.accRewardPerShare.add(tokenReward.mul(1e12).div(syrupSupply)); | |
| poolInfo.lastRewardBlock = block.number; | |
| } | |
| // Deposit Syrup tokens to SousChef for Reward allocation. | |
| function deposit(uint256 _amount) public { | |
| require (_amount > 0, 'amount 0'); | |
| UserInfo storage user = userInfo[msg.sender]; | |
| updatePool(); | |
| syrup.safeTransferFrom(address(msg.sender), address(this), _amount); | |
| // The deposit behavior before farming will result in duplicate addresses, and thus we will manually remove them when airdropping. | |
| if (user.amount == 0 && user.rewardPending == 0 && user.rewardDebt == 0) { | |
| addressList.push(address(msg.sender)); | |
| } | |
| user.rewardPending = user.amount.mul(poolInfo.accRewardPerShare).div(1e12).sub(user.rewardDebt).add(user.rewardPending); | |
| user.amount = user.amount.add(_amount); | |
| user.rewardDebt = user.amount.mul(poolInfo.accRewardPerShare).div(1e12); | |
| emit Deposit(msg.sender, _amount); | |
| } | |
| // Withdraw Syrup tokens from SousChef. | |
| function withdraw(uint256 _amount) public { | |
| require (_amount > 0, 'amount 0'); | |
| UserInfo storage user = userInfo[msg.sender]; | |
| require(user.amount >= _amount, "withdraw: not enough"); | |
| updatePool(); | |
| syrup.safeTransfer(address(msg.sender), _amount); | |
| user.rewardPending = user.amount.mul(poolInfo.accRewardPerShare).div(1e12).sub(user.rewardDebt).add(user.rewardPending); | |
| user.amount = user.amount.sub(_amount); | |
| user.rewardDebt = user.amount.mul(poolInfo.accRewardPerShare).div(1e12); | |
| emit Withdraw(msg.sender, _amount); | |
| } | |
| // Withdraw without caring about rewards. EMERGENCY ONLY. | |
| function emergencyWithdraw() public { | |
| UserInfo storage user = userInfo[msg.sender]; | |
| syrup.safeTransfer(address(msg.sender), user.amount); | |
| emit EmergencyWithdraw(msg.sender, user.amount); | |
| user.amount = 0; | |
| user.rewardDebt = 0; | |
| user.rewardPending = 0; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity 0.6.12; | |
| import "@citrino-network/citrino-swap-lib/contracts/token/BEP20/BEP20.sol"; | |
| import "./CakeToken.sol"; | |
| // SyrupBar with Governance. | |
| contract SyrupBar is BEP20('SyrupBar Token', 'SYRUP') { | |
| /// @notice Creates `_amount` token to `_to`. Must only be called by the owner (MasterChef). | |
| function mint(address _to, uint256 _amount) public onlyOwner { | |
| _mint(_to, _amount); | |
| _moveDelegates(address(0), _delegates[_to], _amount); | |
| } | |
| function burn(address _from ,uint256 _amount) public onlyOwner { | |
| _burn(_from, _amount); | |
| _moveDelegates(_delegates[_from], address(0), _amount); | |
| } | |
| // The CAKE TOKEN! | |
| CakeToken public cake; | |
| constructor( | |
| CakeToken _cake | |
| ) public { | |
| cake = _cake; | |
| } | |
| // Safe cake transfer function, just in case if rounding error causes pool to not have enough CAKEs. | |
| function safeCakeTransfer(address _to, uint256 _amount) public onlyOwner { | |
| uint256 cakeBal = cake.balanceOf(address(this)); | |
| if (_amount > cakeBal) { | |
| cake.transfer(_to, cakeBal); | |
| } else { | |
| cake.transfer(_to, _amount); | |
| } | |
| } | |
| // Copied and modified from YAM code: | |
| // https://github.com/yam-finance/yam-protocol/blob/master/contracts/token/YAMGovernanceStorage.sol | |
| // https://github.com/yam-finance/yam-protocol/blob/master/contracts/token/YAMGovernance.sol | |
| // Which is copied and modified from COMPOUND: | |
| // https://github.com/compound-finance/compound-protocol/blob/master/contracts/Governance/Comp.sol | |
| /// @notice A record of each accounts delegate | |
| mapping (address => address) internal _delegates; | |
| /// @notice A checkpoint for marking number of votes from a given block | |
| struct Checkpoint { | |
| uint32 fromBlock; | |
| uint256 votes; | |
| } | |
| /// @notice A record of votes checkpoints for each account, by index | |
| mapping (address => mapping (uint32 => Checkpoint)) public checkpoints; | |
| /// @notice The number of checkpoints for each account | |
| mapping (address => uint32) public numCheckpoints; | |
| /// @notice The EIP-712 typehash for the contract's domain | |
| bytes32 public constant DOMAIN_TYPEHASH = keccak256("EIP712Domain(string name,uint256 chainId,address verifyingContract)"); | |
| /// @notice The EIP-712 typehash for the delegation struct used by the contract | |
| bytes32 public constant DELEGATION_TYPEHASH = keccak256("Delegation(address delegatee,uint256 nonce,uint256 expiry)"); | |
| /// @notice A record of states for signing / validating signatures | |
| mapping (address => uint) public nonces; | |
| /// @notice An event thats emitted when an account changes its delegate | |
| event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate); | |
| /// @notice An event thats emitted when a delegate account's vote balance changes | |
| event DelegateVotesChanged(address indexed delegate, uint previousBalance, uint newBalance); | |
| /** | |
| * @notice Delegate votes from `msg.sender` to `delegatee` | |
| * @param delegator The address to get delegatee for | |
| */ | |
| function delegates(address delegator) | |
| external | |
| view | |
| returns (address) | |
| { | |
| return _delegates[delegator]; | |
| } | |
| /** | |
| * @notice Delegate votes from `msg.sender` to `delegatee` | |
| * @param delegatee The address to delegate votes to | |
| */ | |
| function delegate(address delegatee) external { | |
| return _delegate(msg.sender, delegatee); | |
| } | |
| /** | |
| * @notice Delegates votes from signatory to `delegatee` | |
| * @param delegatee The address to delegate votes to | |
| * @param nonce The contract state required to match the signature | |
| * @param expiry The time at which to expire the signature | |
| * @param v The recovery byte of the signature | |
| * @param r Half of the ECDSA signature pair | |
| * @param s Half of the ECDSA signature pair | |
| */ | |
| function delegateBySig( | |
| address delegatee, | |
| uint nonce, | |
| uint expiry, | |
| uint8 v, | |
| bytes32 r, | |
| bytes32 s | |
| ) | |
| external | |
| { | |
| bytes32 domainSeparator = keccak256( | |
| abi.encode( | |
| DOMAIN_TYPEHASH, | |
| keccak256(bytes(name())), | |
| getChainId(), | |
| address(this) | |
| ) | |
| ); | |
| bytes32 structHash = keccak256( | |
| abi.encode( | |
| DELEGATION_TYPEHASH, | |
| delegatee, | |
| nonce, | |
| expiry | |
| ) | |
| ); | |
| bytes32 digest = keccak256( | |
| abi.encodePacked( | |
| "\x19\x01", | |
| domainSeparator, | |
| structHash | |
| ) | |
| ); | |
| address signatory = ecrecover(digest, v, r, s); | |
| require(signatory != address(0), "CAKE::delegateBySig: invalid signature"); | |
| require(nonce == nonces[signatory]++, "CAKE::delegateBySig: invalid nonce"); | |
| require(now <= expiry, "CAKE::delegateBySig: signature expired"); | |
| return _delegate(signatory, delegatee); | |
| } | |
| /** | |
| * @notice Gets the current votes balance for `account` | |
| * @param account The address to get votes balance | |
| * @return The number of current votes for `account` | |
| */ | |
| function getCurrentVotes(address account) | |
| external | |
| view | |
| returns (uint256) | |
| { | |
| uint32 nCheckpoints = numCheckpoints[account]; | |
| return nCheckpoints > 0 ? checkpoints[account][nCheckpoints - 1].votes : 0; | |
| } | |
| /** | |
| * @notice Determine the prior number of votes for an account as of a block number | |
| * @dev Block number must be a finalized block or else this function will revert to prevent misinformation. | |
| * @param account The address of the account to check | |
| * @param blockNumber The block number to get the vote balance at | |
| * @return The number of votes the account had as of the given block | |
| */ | |
| function getPriorVotes(address account, uint blockNumber) | |
| external | |
| view | |
| returns (uint256) | |
| { | |
| require(blockNumber < block.number, "CAKE::getPriorVotes: not yet determined"); | |
| uint32 nCheckpoints = numCheckpoints[account]; | |
| if (nCheckpoints == 0) { | |
| return 0; | |
| } | |
| // First check most recent balance | |
| if (checkpoints[account][nCheckpoints - 1].fromBlock <= blockNumber) { | |
| return checkpoints[account][nCheckpoints - 1].votes; | |
| } | |
| // Next check implicit zero balance | |
| if (checkpoints[account][0].fromBlock > blockNumber) { | |
| return 0; | |
| } | |
| uint32 lower = 0; | |
| uint32 upper = nCheckpoints - 1; | |
| while (upper > lower) { | |
| uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow | |
| Checkpoint memory cp = checkpoints[account][center]; | |
| if (cp.fromBlock == blockNumber) { | |
| return cp.votes; | |
| } else if (cp.fromBlock < blockNumber) { | |
| lower = center; | |
| } else { | |
| upper = center - 1; | |
| } | |
| } | |
| return checkpoints[account][lower].votes; | |
| } | |
| function _delegate(address delegator, address delegatee) | |
| internal | |
| { | |
| address currentDelegate = _delegates[delegator]; | |
| uint256 delegatorBalance = balanceOf(delegator); // balance of underlying CAKEs (not scaled); | |
| _delegates[delegator] = delegatee; | |
| emit DelegateChanged(delegator, currentDelegate, delegatee); | |
| _moveDelegates(currentDelegate, delegatee, delegatorBalance); | |
| } | |
| function _moveDelegates(address srcRep, address dstRep, uint256 amount) internal { | |
| if (srcRep != dstRep && amount > 0) { | |
| if (srcRep != address(0)) { | |
| // decrease old representative | |
| uint32 srcRepNum = numCheckpoints[srcRep]; | |
| uint256 srcRepOld = srcRepNum > 0 ? checkpoints[srcRep][srcRepNum - 1].votes : 0; | |
| uint256 srcRepNew = srcRepOld.sub(amount); | |
| _writeCheckpoint(srcRep, srcRepNum, srcRepOld, srcRepNew); | |
| } | |
| if (dstRep != address(0)) { | |
| // increase new representative | |
| uint32 dstRepNum = numCheckpoints[dstRep]; | |
| uint256 dstRepOld = dstRepNum > 0 ? checkpoints[dstRep][dstRepNum - 1].votes : 0; | |
| uint256 dstRepNew = dstRepOld.add(amount); | |
| _writeCheckpoint(dstRep, dstRepNum, dstRepOld, dstRepNew); | |
| } | |
| } | |
| } | |
| function _writeCheckpoint( | |
| address delegatee, | |
| uint32 nCheckpoints, | |
| uint256 oldVotes, | |
| uint256 newVotes | |
| ) | |
| internal | |
| { | |
| uint32 blockNumber = safe32(block.number, "CAKE::_writeCheckpoint: block number exceeds 32 bits"); | |
| if (nCheckpoints > 0 && checkpoints[delegatee][nCheckpoints - 1].fromBlock == blockNumber) { | |
| checkpoints[delegatee][nCheckpoints - 1].votes = newVotes; | |
| } else { | |
| checkpoints[delegatee][nCheckpoints] = Checkpoint(blockNumber, newVotes); | |
| numCheckpoints[delegatee] = nCheckpoints + 1; | |
| } | |
| emit DelegateVotesChanged(delegatee, oldVotes, newVotes); | |
| } | |
| function safe32(uint n, string memory errorMessage) internal pure returns (uint32) { | |
| require(n < 2**32, errorMessage); | |
| return uint32(n); | |
| } | |
| function getChainId() internal pure returns (uint) { | |
| uint256 chainId; | |
| assembly { chainId := chainid() } | |
| return chainId; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // COPIED FROM https://github.com/compound-finance/compound-protocol/blob/master/contracts/Governance/GovernorAlpha.sol | |
| // Copyright 2020 Compound Labs, Inc. | |
| // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | |
| // 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | |
| // 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | |
| // 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | |
| // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| // | |
| // Ctrl+f for XXX to see all the modifications. | |
| // XXX: pragma solidity ^0.5.16; | |
| pragma solidity 0.6.12; | |
| // XXX: import "./SafeMath.sol"; | |
| import "@pancakeswap/pancake-swap-lib/contracts/math/SafeMath.sol"; | |
| contract Timelock { | |
| using SafeMath for uint; | |
| event NewAdmin(address indexed newAdmin); | |
| event NewPendingAdmin(address indexed newPendingAdmin); | |
| event NewDelay(uint indexed newDelay); | |
| event CancelTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); | |
| event ExecuteTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); | |
| event QueueTransaction(bytes32 indexed txHash, address indexed target, uint value, string signature, bytes data, uint eta); | |
| uint public constant GRACE_PERIOD = 14 days; | |
| uint public constant MINIMUM_DELAY = 6 hours; | |
| uint public constant MAXIMUM_DELAY = 30 days; | |
| address public admin; | |
| address public pendingAdmin; | |
| uint public delay; | |
| bool public admin_initialized; | |
| mapping (bytes32 => bool) public queuedTransactions; | |
| constructor(address admin_, uint delay_) public { | |
| require(delay_ >= MINIMUM_DELAY, "Timelock::constructor: Delay must exceed minimum delay."); | |
| require(delay_ <= MAXIMUM_DELAY, "Timelock::constructor: Delay must not exceed maximum delay."); | |
| admin = admin_; | |
| delay = delay_; | |
| admin_initialized = false; | |
| } | |
| // XXX: function() external payable { } | |
| receive() external payable { } | |
| function setDelay(uint delay_) public { | |
| require(msg.sender == address(this), "Timelock::setDelay: Call must come from Timelock."); | |
| require(delay_ >= MINIMUM_DELAY, "Timelock::setDelay: Delay must exceed minimum delay."); | |
| require(delay_ <= MAXIMUM_DELAY, "Timelock::setDelay: Delay must not exceed maximum delay."); | |
| delay = delay_; | |
| emit NewDelay(delay); | |
| } | |
| function acceptAdmin() public { | |
| require(msg.sender == pendingAdmin, "Timelock::acceptAdmin: Call must come from pendingAdmin."); | |
| admin = msg.sender; | |
| pendingAdmin = address(0); | |
| emit NewAdmin(admin); | |
| } | |
| function setPendingAdmin(address pendingAdmin_) public { | |
| // allows one time setting of admin for deployment purposes | |
| if (admin_initialized) { | |
| require(msg.sender == address(this), "Timelock::setPendingAdmin: Call must come from Timelock."); | |
| } else { | |
| require(msg.sender == admin, "Timelock::setPendingAdmin: First call must come from admin."); | |
| admin_initialized = true; | |
| } | |
| pendingAdmin = pendingAdmin_; | |
| emit NewPendingAdmin(pendingAdmin); | |
| } | |
| function queueTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public returns (bytes32) { | |
| require(msg.sender == admin, "Timelock::queueTransaction: Call must come from admin."); | |
| require(eta >= getBlockTimestamp().add(delay), "Timelock::queueTransaction: Estimated execution block must satisfy delay."); | |
| bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); | |
| queuedTransactions[txHash] = true; | |
| emit QueueTransaction(txHash, target, value, signature, data, eta); | |
| return txHash; | |
| } | |
| function cancelTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public { | |
| require(msg.sender == admin, "Timelock::cancelTransaction: Call must come from admin."); | |
| bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); | |
| queuedTransactions[txHash] = false; | |
| emit CancelTransaction(txHash, target, value, signature, data, eta); | |
| } | |
| function executeTransaction(address target, uint value, string memory signature, bytes memory data, uint eta) public payable returns (bytes memory) { | |
| require(msg.sender == admin, "Timelock::executeTransaction: Call must come from admin."); | |
| bytes32 txHash = keccak256(abi.encode(target, value, signature, data, eta)); | |
| require(queuedTransactions[txHash], "Timelock::executeTransaction: Transaction hasn't been queued."); | |
| require(getBlockTimestamp() >= eta, "Timelock::executeTransaction: Transaction hasn't surpassed time lock."); | |
| require(getBlockTimestamp() <= eta.add(GRACE_PERIOD), "Timelock::executeTransaction: Transaction is stale."); | |
| queuedTransactions[txHash] = false; | |
| bytes memory callData; | |
| if (bytes(signature).length == 0) { | |
| callData = data; | |
| } else { | |
| callData = abi.encodePacked(bytes4(keccak256(bytes(signature))), data); | |
| } | |
| // solium-disable-next-line security/no-call-value | |
| (bool success, bytes memory returnData) = target.call.value(value)(callData); | |
| require(success, "Timelock::executeTransaction: Transaction execution reverted."); | |
| emit ExecuteTransaction(txHash, target, value, signature, data, eta); | |
| return returnData; | |
| } | |
| function getBlockTimestamp() internal view returns (uint) { | |
| // solium-disable-next-line security/no-block-members | |
| return block.timestamp; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Migrations = artifacts.require("Migrations"); | |
| module.exports = function(deployer) { | |
| deployer.deploy(Migrations); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = function(deployer) {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { expectRevert, time } = require('@openzeppelin/test-helpers'); | |
| const { assert } = require('chai'); | |
| const CakeToken = artifacts.require('CakeToken'); | |
| const BnbStaking = artifacts.require('BnbStaking'); | |
| const MockBEP20 = artifacts.require('libs/MockBEP20'); | |
| const WBNB = artifacts.require('libs/WBNB'); | |
| contract('BnbStaking.......', async ([alice, bob, admin, dev, minter]) => { | |
| beforeEach(async () => { | |
| this.rewardToken = await CakeToken.new({ from: minter }); | |
| this.lpToken = await MockBEP20.new('LPToken', 'LP1', '1000000', { | |
| from: minter, | |
| }); | |
| this.wBNB = await WBNB.new({ from: minter }); | |
| this.bnbChef = await BnbStaking.new( | |
| this.wBNB.address, | |
| this.rewardToken.address, | |
| 1000, | |
| 10, | |
| 1010, | |
| admin, | |
| this.wBNB.address, | |
| { from: minter } | |
| ); | |
| await this.rewardToken.mint(this.bnbChef.address, 100000, { from: minter }); | |
| }); | |
| it('deposit/withdraw', async () => { | |
| await time.advanceBlockTo('10'); | |
| await this.bnbChef.deposit({ from: alice, value: 100 }); | |
| await this.bnbChef.deposit({ from: bob, value: 200 }); | |
| assert.equal( | |
| (await this.wBNB.balanceOf(this.bnbChef.address)).toString(), | |
| '300' | |
| ); | |
| assert.equal((await this.bnbChef.pendingReward(alice)).toString(), '1000'); | |
| await this.bnbChef.deposit({ from: alice, value: 300 }); | |
| assert.equal((await this.bnbChef.pendingReward(alice)).toString(), '0'); | |
| assert.equal((await this.rewardToken.balanceOf(alice)).toString(), '1333'); | |
| await this.bnbChef.withdraw('100', { from: alice }); | |
| assert.equal( | |
| (await this.wBNB.balanceOf(this.bnbChef.address)).toString(), | |
| '500' | |
| ); | |
| await this.bnbChef.emergencyRewardWithdraw(1000, { from: minter }); | |
| assert.equal((await this.bnbChef.pendingReward(bob)).toString(), '1399'); | |
| }); | |
| it('should block man who in blanklist', async () => { | |
| await this.bnbChef.setBlackList(alice, { from: admin }); | |
| await expectRevert( | |
| this.bnbChef.deposit({ from: alice, value: 100 }), | |
| 'in black list' | |
| ); | |
| await this.bnbChef.removeBlackList(alice, { from: admin }); | |
| await this.bnbChef.deposit({ from: alice, value: 100 }); | |
| await this.bnbChef.setAdmin(dev, { from: minter }); | |
| await expectRevert( | |
| this.bnbChef.setBlackList(alice, { from: admin }), | |
| 'admin: wut?' | |
| ); | |
| }); | |
| it('emergencyWithdraw', async () => { | |
| await this.bnbChef.deposit({ from: alice, value: 100 }); | |
| await this.bnbChef.deposit({ from: bob, value: 200 }); | |
| assert.equal( | |
| (await this.wBNB.balanceOf(this.bnbChef.address)).toString(), | |
| '300' | |
| ); | |
| await this.bnbChef.emergencyWithdraw({ from: alice }); | |
| assert.equal( | |
| (await this.wBNB.balanceOf(this.bnbChef.address)).toString(), | |
| '200' | |
| ); | |
| assert.equal((await this.wBNB.balanceOf(alice)).toString(), '100'); | |
| }); | |
| it('emergencyRewardWithdraw', async () => { | |
| await expectRevert( | |
| this.bnbChef.emergencyRewardWithdraw(100, { from: alice }), | |
| 'caller is not the owner' | |
| ); | |
| await this.bnbChef.emergencyRewardWithdraw(1000, { from: minter }); | |
| assert.equal((await this.rewardToken.balanceOf(minter)).toString(), '1000'); | |
| }); | |
| it('setLimitAmount', async () => { | |
| // set limit to 1e-12 BNB | |
| await this.bnbChef.setLimitAmount('1000000', { from: minter }); | |
| await expectRevert( | |
| this.bnbChef.deposit({ from: alice, value: 100000000 }), | |
| 'exceed the to' | |
| ); | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { assert } = require("chai"); | |
| const CakeToken = artifacts.require('CakeToken'); | |
| contract('CakeToken', ([alice, bob, carol, dev, minter]) => { | |
| beforeEach(async () => { | |
| this.cake = await CakeToken.new({ from: minter }); | |
| }); | |
| it('mint', async () => { | |
| await this.cake.mint(alice, 1000, { from: minter }); | |
| assert.equal((await this.cake.balanceOf(alice)).toString(), '1000'); | |
| }) | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { expectRevert, time } = require('@openzeppelin/test-helpers'); | |
| const { assert } = require('chai'); | |
| const CakeToken = artifacts.require('CakeToken'); | |
| const SyrupBar = artifacts.require('SyrupBar'); | |
| const MasterChef = artifacts.require('MasterChef'); | |
| const MockBEP20 = artifacts.require('libs/MockBEP20'); | |
| const LotteryRewardPool = artifacts.require('LotteryRewardPool'); | |
| contract('MasterChef', ([alice, bob, carol, dev, minter]) => { | |
| beforeEach(async () => { | |
| this.cake = await CakeToken.new({ from: minter }); | |
| this.syrup = await SyrupBar.new(this.cake.address, { from: minter }); | |
| this.lp1 = await MockBEP20.new('LPToken', 'LP1', '1000000', { | |
| from: minter, | |
| }); | |
| this.lp2 = await MockBEP20.new('LPToken', 'LP2', '1000000', { | |
| from: minter, | |
| }); | |
| this.lp3 = await MockBEP20.new('LPToken', 'LP3', '1000000', { | |
| from: minter, | |
| }); | |
| this.lp4 = await MockBEP20.new('LPToken', 'LP4', '1000000', { | |
| from: minter, | |
| }); | |
| this.chef = await MasterChef.new( | |
| this.cake.address, | |
| this.syrup.address, | |
| dev, | |
| '10', | |
| '10', | |
| { from: minter } | |
| ); | |
| await this.cake.transferOwnership(this.chef.address, { from: minter }); | |
| await this.syrup.transferOwnership(this.chef.address, { from: minter }); | |
| await this.lp1.transfer(bob, '2000', { from: minter }); | |
| await this.lp2.transfer(bob, '2000', { from: minter }); | |
| await this.lp3.transfer(bob, '2000', { from: minter }); | |
| await this.lp1.transfer(alice, '2000', { from: minter }); | |
| await this.lp2.transfer(alice, '2000', { from: minter }); | |
| await this.lp3.transfer(alice, '2000', { from: minter }); | |
| }); | |
| it('real case', async () => { | |
| await time.advanceBlockTo('70'); | |
| this.lottery = await LotteryRewardPool.new( | |
| this.chef.address, | |
| this.cake.address, | |
| dev, | |
| carol, | |
| { from: minter } | |
| ); | |
| await this.lp4.transfer(this.lottery.address, '10', { from: minter }); | |
| await this.chef.add('1000', this.lp1.address, true, { from: minter }); | |
| await this.chef.add('1000', this.lp2.address, true, { from: minter }); | |
| await this.chef.add('500', this.lp3.address, true, { from: minter }); | |
| await this.chef.add('500', this.lp4.address, true, { from: minter }); | |
| assert.equal( | |
| (await this.lp4.balanceOf(this.lottery.address)).toString(), | |
| '10' | |
| ); | |
| await this.lottery.startFarming(4, this.lp4.address, '1', { from: dev }); | |
| await time.advanceBlockTo('80'); | |
| assert.equal((await this.lottery.pendingReward('4')).toString(), '3'); | |
| assert.equal( | |
| (await this.cake.balanceOf(this.lottery.address)).toString(), | |
| '0' | |
| ); | |
| await this.lottery.harvest(4, { from: dev }); | |
| // console.log(await this.lottery.pendingReward(4).toString()) | |
| assert.equal( | |
| (await this.cake.balanceOf(this.lottery.address)).toString(), | |
| '0' | |
| ); | |
| assert.equal((await this.cake.balanceOf(carol)).toString(), '5'); | |
| }); | |
| it('setReceiver', async () => { | |
| this.lottery = await LotteryRewardPool.new( | |
| this.chef.address, | |
| this.cake.address, | |
| dev, | |
| carol, | |
| { from: minter } | |
| ); | |
| await this.lp1.transfer(this.lottery.address, '10', { from: minter }); | |
| await this.chef.add('1000', this.lp1.address, true, { from: minter }); | |
| await this.lottery.startFarming(1, this.lp1.address, '1', { | |
| from: dev, | |
| }); | |
| await this.lottery.harvest(1, { from: dev }); | |
| assert.equal((await this.cake.balanceOf(carol)).toString(), '7'); | |
| await this.lottery.setReceiver(alice, { from: dev }); | |
| assert.equal((await this.lottery.pendingReward('1')).toString(), '7'); | |
| await this.lottery.harvest(1, { from: dev }); | |
| assert.equal((await this.cake.balanceOf(alice)).toString(), '15'); | |
| }); | |
| it('emergencyWithdraw', async () => {}); | |
| it('update admin', async () => { | |
| this.lottery = await LotteryRewardPool.new( | |
| this.chef.address, | |
| this.cake.address, | |
| dev, | |
| carol, | |
| { from: minter } | |
| ); | |
| assert.equal(await this.lottery.adminAddress(), dev); | |
| await this.lottery.setAdmin(alice, { from: minter }); | |
| assert.equal(await this.lottery.adminAddress(), alice); | |
| await this.chef.add('1000', this.lp1.address, true, { from: minter }); | |
| await expectRevert( | |
| this.lottery.startFarming(1, this.lp1.address, '1', { from: dev }), | |
| 'admin: wut?' | |
| ); | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { expectRevert, time } = require('@openzeppelin/test-helpers'); | |
| const CakeToken = artifacts.require('CakeToken'); | |
| const SyrupBar = artifacts.require('SyrupBar'); | |
| const MasterChef = artifacts.require('MasterChef'); | |
| const MockBEP20 = artifacts.require('libs/MockBEP20'); | |
| contract('MasterChef', ([alice, bob, carol, dev, minter]) => { | |
| beforeEach(async () => { | |
| this.cake = await CakeToken.new({ from: minter }); | |
| this.syrup = await SyrupBar.new(this.cake.address, { from: minter }); | |
| this.lp1 = await MockBEP20.new('LPToken', 'LP1', '1000000', { from: minter }); | |
| this.lp2 = await MockBEP20.new('LPToken', 'LP2', '1000000', { from: minter }); | |
| this.lp3 = await MockBEP20.new('LPToken', 'LP3', '1000000', { from: minter }); | |
| this.chef = await MasterChef.new(this.cake.address, this.syrup.address, dev, '1000', '100', { from: minter }); | |
| await this.cake.transferOwnership(this.chef.address, { from: minter }); | |
| await this.syrup.transferOwnership(this.chef.address, { from: minter }); | |
| await this.lp1.transfer(bob, '2000', { from: minter }); | |
| await this.lp2.transfer(bob, '2000', { from: minter }); | |
| await this.lp3.transfer(bob, '2000', { from: minter }); | |
| await this.lp1.transfer(alice, '2000', { from: minter }); | |
| await this.lp2.transfer(alice, '2000', { from: minter }); | |
| await this.lp3.transfer(alice, '2000', { from: minter }); | |
| }); | |
| it('real case', async () => { | |
| this.lp4 = await MockBEP20.new('LPToken', 'LP1', '1000000', { from: minter }); | |
| this.lp5 = await MockBEP20.new('LPToken', 'LP2', '1000000', { from: minter }); | |
| this.lp6 = await MockBEP20.new('LPToken', 'LP3', '1000000', { from: minter }); | |
| this.lp7 = await MockBEP20.new('LPToken', 'LP1', '1000000', { from: minter }); | |
| this.lp8 = await MockBEP20.new('LPToken', 'LP2', '1000000', { from: minter }); | |
| this.lp9 = await MockBEP20.new('LPToken', 'LP3', '1000000', { from: minter }); | |
| await this.chef.add('2000', this.lp1.address, true, { from: minter }); | |
| await this.chef.add('1000', this.lp2.address, true, { from: minter }); | |
| await this.chef.add('500', this.lp3.address, true, { from: minter }); | |
| await this.chef.add('500', this.lp3.address, true, { from: minter }); | |
| await this.chef.add('500', this.lp3.address, true, { from: minter }); | |
| await this.chef.add('500', this.lp3.address, true, { from: minter }); | |
| await this.chef.add('500', this.lp3.address, true, { from: minter }); | |
| await this.chef.add('100', this.lp3.address, true, { from: minter }); | |
| await this.chef.add('100', this.lp3.address, true, { from: minter }); | |
| assert.equal((await this.chef.poolLength()).toString(), "10"); | |
| await time.advanceBlockTo('170'); | |
| await this.lp1.approve(this.chef.address, '1000', { from: alice }); | |
| assert.equal((await this.cake.balanceOf(alice)).toString(), '0'); | |
| await this.chef.deposit(1, '20', { from: alice }); | |
| await this.chef.withdraw(1, '20', { from: alice }); | |
| assert.equal((await this.cake.balanceOf(alice)).toString(), '263'); | |
| await this.cake.approve(this.chef.address, '1000', { from: alice }); | |
| await this.chef.enterStaking('20', { from: alice }); | |
| await this.chef.enterStaking('0', { from: alice }); | |
| await this.chef.enterStaking('0', { from: alice }); | |
| await this.chef.enterStaking('0', { from: alice }); | |
| assert.equal((await this.cake.balanceOf(alice)).toString(), '993'); | |
| // assert.equal((await this.chef.getPoolPoint(0, { from: minter })).toString(), '1900'); | |
| }) | |
| it('deposit/withdraw', async () => { | |
| await this.chef.add('1000', this.lp1.address, true, { from: minter }); | |
| await this.chef.add('1000', this.lp2.address, true, { from: minter }); | |
| await this.chef.add('1000', this.lp3.address, true, { from: minter }); | |
| await this.lp1.approve(this.chef.address, '100', { from: alice }); | |
| await this.chef.deposit(1, '20', { from: alice }); | |
| await this.chef.deposit(1, '0', { from: alice }); | |
| await this.chef.deposit(1, '40', { from: alice }); | |
| await this.chef.deposit(1, '0', { from: alice }); | |
| assert.equal((await this.lp1.balanceOf(alice)).toString(), '1940'); | |
| await this.chef.withdraw(1, '10', { from: alice }); | |
| assert.equal((await this.lp1.balanceOf(alice)).toString(), '1950'); | |
| assert.equal((await this.cake.balanceOf(alice)).toString(), '999'); | |
| assert.equal((await this.cake.balanceOf(dev)).toString(), '100'); | |
| await this.lp1.approve(this.chef.address, '100', { from: bob }); | |
| assert.equal((await this.lp1.balanceOf(bob)).toString(), '2000'); | |
| await this.chef.deposit(1, '50', { from: bob }); | |
| assert.equal((await this.lp1.balanceOf(bob)).toString(), '1950'); | |
| await this.chef.deposit(1, '0', { from: bob }); | |
| assert.equal((await this.cake.balanceOf(bob)).toString(), '125'); | |
| await this.chef.emergencyWithdraw(1, { from: bob }); | |
| assert.equal((await this.lp1.balanceOf(bob)).toString(), '2000'); | |
| }) | |
| it('staking/unstaking', async () => { | |
| await this.chef.add('1000', this.lp1.address, true, { from: minter }); | |
| await this.chef.add('1000', this.lp2.address, true, { from: minter }); | |
| await this.chef.add('1000', this.lp3.address, true, { from: minter }); | |
| await this.lp1.approve(this.chef.address, '10', { from: alice }); | |
| await this.chef.deposit(1, '2', { from: alice }); //0 | |
| await this.chef.withdraw(1, '2', { from: alice }); //1 | |
| await this.cake.approve(this.chef.address, '250', { from: alice }); | |
| await this.chef.enterStaking('240', { from: alice }); //3 | |
| assert.equal((await this.syrup.balanceOf(alice)).toString(), '240'); | |
| assert.equal((await this.cake.balanceOf(alice)).toString(), '10'); | |
| await this.chef.enterStaking('10', { from: alice }); //4 | |
| assert.equal((await this.syrup.balanceOf(alice)).toString(), '250'); | |
| assert.equal((await this.cake.balanceOf(alice)).toString(), '249'); | |
| await this.chef.leaveStaking(250); | |
| assert.equal((await this.syrup.balanceOf(alice)).toString(), '0'); | |
| assert.equal((await this.cake.balanceOf(alice)).toString(), '749'); | |
| }); | |
| it('updaate multiplier', async () => { | |
| await this.chef.add('1000', this.lp1.address, true, { from: minter }); | |
| await this.chef.add('1000', this.lp2.address, true, { from: minter }); | |
| await this.chef.add('1000', this.lp3.address, true, { from: minter }); | |
| await this.lp1.approve(this.chef.address, '100', { from: alice }); | |
| await this.lp1.approve(this.chef.address, '100', { from: bob }); | |
| await this.chef.deposit(1, '100', { from: alice }); | |
| await this.chef.deposit(1, '100', { from: bob }); | |
| await this.chef.deposit(1, '0', { from: alice }); | |
| await this.chef.deposit(1, '0', { from: bob }); | |
| await this.cake.approve(this.chef.address, '100', { from: alice }); | |
| await this.cake.approve(this.chef.address, '100', { from: bob }); | |
| await this.chef.enterStaking('50', { from: alice }); | |
| await this.chef.enterStaking('100', { from: bob }); | |
| await this.chef.updateMultiplier('0', { from: minter }); | |
| await this.chef.enterStaking('0', { from: alice }); | |
| await this.chef.enterStaking('0', { from: bob }); | |
| await this.chef.deposit(1, '0', { from: alice }); | |
| await this.chef.deposit(1, '0', { from: bob }); | |
| assert.equal((await this.cake.balanceOf(alice)).toString(), '700'); | |
| assert.equal((await this.cake.balanceOf(bob)).toString(), '150'); | |
| await time.advanceBlockTo('265'); | |
| await this.chef.enterStaking('0', { from: alice }); | |
| await this.chef.enterStaking('0', { from: bob }); | |
| await this.chef.deposit(1, '0', { from: alice }); | |
| await this.chef.deposit(1, '0', { from: bob }); | |
| assert.equal((await this.cake.balanceOf(alice)).toString(), '700'); | |
| assert.equal((await this.cake.balanceOf(bob)).toString(), '150'); | |
| await this.chef.leaveStaking('50', { from: alice }); | |
| await this.chef.leaveStaking('100', { from: bob }); | |
| await this.chef.withdraw(1, '100', { from: alice }); | |
| await this.chef.withdraw(1, '100', { from: bob }); | |
| }); | |
| it('should allow dev and only dev to update dev', async () => { | |
| assert.equal((await this.chef.devaddr()).valueOf(), dev); | |
| await expectRevert(this.chef.dev(bob, { from: bob }), 'dev: wut?'); | |
| await this.chef.dev(bob, { from: dev }); | |
| assert.equal((await this.chef.devaddr()).valueOf(), bob); | |
| await this.chef.dev(alice, { from: bob }); | |
| assert.equal((await this.chef.devaddr()).valueOf(), alice); | |
| }) | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { expectRevert, time } = require('@openzeppelin/test-helpers'); | |
| const CakeToken = artifacts.require('CakeToken'); | |
| const MasterChef = artifacts.require('MasterChef'); | |
| const SyrupBar = artifacts.require('SyrupBar'); | |
| const SousChef = artifacts.require('SousChef'); | |
| const MockBEP20 = artifacts.require('libs/MockBEP20'); | |
| contract('SousChef', ([alice, bob, carol, dev, minter]) => { | |
| beforeEach(async () => { | |
| this.syrup = await MockBEP20.new('LPToken', 'LP1', '1000000', { | |
| from: minter, | |
| }); | |
| this.chef = await SousChef.new(this.syrup.address, '40', '300', '400', { | |
| from: minter, | |
| }); | |
| }); | |
| it('sous chef now', async () => { | |
| await this.syrup.transfer(bob, '1000', { from: minter }); | |
| await this.syrup.transfer(carol, '1000', { from: minter }); | |
| await this.syrup.transfer(alice, '1000', { from: minter }); | |
| assert.equal((await this.syrup.balanceOf(bob)).toString(), '1000'); | |
| await this.syrup.approve(this.chef.address, '1000', { from: bob }); | |
| await this.syrup.approve(this.chef.address, '1000', { from: alice }); | |
| await this.syrup.approve(this.chef.address, '1000', { from: carol }); | |
| await this.chef.deposit('10', { from: bob }); | |
| assert.equal( | |
| (await this.syrup.balanceOf(this.chef.address)).toString(), | |
| '10' | |
| ); | |
| await time.advanceBlockTo('300'); | |
| await this.chef.deposit('30', { from: alice }); | |
| assert.equal( | |
| (await this.syrup.balanceOf(this.chef.address)).toString(), | |
| '40' | |
| ); | |
| assert.equal( | |
| (await this.chef.pendingReward(bob, { from: bob })).toString(), | |
| '40' | |
| ); | |
| await time.advanceBlockTo('302'); | |
| assert.equal( | |
| (await this.chef.pendingReward(bob, { from: bob })).toString(), | |
| '50' | |
| ); | |
| assert.equal( | |
| (await this.chef.pendingReward(alice, { from: alice })).toString(), | |
| '30' | |
| ); | |
| await this.chef.deposit('40', { from: carol }); | |
| assert.equal( | |
| (await this.syrup.balanceOf(this.chef.address)).toString(), | |
| '80' | |
| ); | |
| await time.advanceBlockTo('304'); | |
| // bob 10, alice 30, carol 40 | |
| assert.equal( | |
| (await this.chef.pendingReward(bob, { from: bob })).toString(), | |
| '65' | |
| ); | |
| assert.equal( | |
| (await this.chef.pendingReward(alice, { from: alice })).toString(), | |
| '75' | |
| ); | |
| assert.equal( | |
| (await this.chef.pendingReward(carol, { from: carol })).toString(), | |
| '20' | |
| ); | |
| await this.chef.deposit('20', { from: alice }); // 305 bob 10, alice 50, carol 40 | |
| await this.chef.deposit('30', { from: bob }); // 306 bob 40, alice 50, carol 40 | |
| assert.equal( | |
| (await this.chef.pendingReward(bob, { from: bob })).toString(), | |
| '74' | |
| ); | |
| assert.equal( | |
| (await this.chef.pendingReward(alice, { from: alice })).toString(), | |
| '110' | |
| ); | |
| await time.advanceBlockTo('307'); | |
| assert.equal( | |
| (await this.chef.pendingReward(bob, { from: bob })).toString(), | |
| '86' | |
| ); | |
| assert.equal( | |
| (await this.chef.pendingReward(alice, { from: alice })).toString(), | |
| '125' | |
| ); | |
| await this.chef.withdraw('20', { from: alice }); // 308 bob 40, alice 30, carol 40 | |
| await this.chef.withdraw('30', { from: bob }); // 309 bob 10, alice 30, carol 40 | |
| await time.advanceBlockTo('310'); | |
| assert.equal( | |
| (await this.chef.pendingReward(bob, { from: bob })).toString(), | |
| '118' | |
| ); | |
| assert.equal( | |
| (await this.chef.pendingReward(alice, { from: alice })).toString(), | |
| '166' | |
| ); | |
| assert.equal( | |
| (await this.syrup.balanceOf(this.chef.address)).toString(), | |
| '80' | |
| ); | |
| await time.advanceBlockTo('400'); | |
| assert.equal( | |
| (await this.chef.pendingReward(bob, { from: bob })).toString(), | |
| '568' | |
| ); | |
| assert.equal( | |
| (await this.chef.pendingReward(alice, { from: alice })).toString(), | |
| '1516' | |
| ); | |
| assert.equal( | |
| (await this.chef.pendingReward(carol, { from: alice })).toString(), | |
| '1915' | |
| ); | |
| await time.advanceBlockTo('420'); | |
| assert.equal( | |
| (await this.chef.pendingReward(bob, { from: bob })).toString(), | |
| '568' | |
| ); | |
| assert.equal( | |
| (await this.chef.pendingReward(alice, { from: alice })).toString(), | |
| '1516' | |
| ); | |
| assert.equal( | |
| (await this.chef.pendingReward(carol, { from: alice })).toString(), | |
| '1915' | |
| ); | |
| await this.chef.withdraw('10', { from: bob }); | |
| await this.chef.withdraw('30', { from: alice }); | |
| await expectRevert(this.chef.withdraw('50', { from: carol }), 'not enough'); | |
| await this.chef.deposit('30', { from: carol }); | |
| await time.advanceBlockTo('450'); | |
| assert.equal( | |
| (await this.chef.pendingReward(bob, { from: bob })).toString(), | |
| '568' | |
| ); | |
| assert.equal( | |
| (await this.chef.pendingReward(alice, { from: alice })).toString(), | |
| '1516' | |
| ); | |
| assert.equal( | |
| (await this.chef.pendingReward(carol, { from: alice })).toString(), | |
| '1915' | |
| ); | |
| await this.chef.withdraw('70', { from: carol }); | |
| assert.equal((await this.chef.addressLength()).toString(), '3'); | |
| }); | |
| it('try syrup', async () => { | |
| this.cake = await CakeToken.new({ from: minter }); | |
| this.syrup = await SyrupBar.new(this.cake.address, { from: minter }); | |
| this.lp1 = await MockBEP20.new('LPToken', 'LP1', '1000000', { | |
| from: minter, | |
| }); | |
| this.chef = await MasterChef.new( | |
| this.cake.address, | |
| this.syrup.address, | |
| dev, | |
| '1000', | |
| '300', | |
| { from: minter } | |
| ); | |
| await this.cake.transferOwnership(this.chef.address, { from: minter }); | |
| await this.syrup.transferOwnership(this.chef.address, { from: minter }); | |
| await this.lp1.transfer(bob, '2000', { from: minter }); | |
| await this.lp1.transfer(alice, '2000', { from: minter }); | |
| await this.lp1.approve(this.chef.address, '1000', { from: alice }); | |
| await this.cake.approve(this.chef.address, '1000', { from: alice }); | |
| await this.chef.add('1000', this.lp1.address, true, { from: minter }); | |
| await this.chef.deposit(1, '20', { from: alice }); | |
| await time.advanceBlockTo('500'); | |
| await this.chef.deposit(1, '0', { from: alice }); | |
| await this.chef.add('1000', this.lp1.address, true, { from: minter }); | |
| await this.chef.enterStaking('10', { from: alice }); | |
| await time.advanceBlockTo('510'); | |
| await this.chef.enterStaking('10', { from: alice }); | |
| this.chef2 = await SousChef.new(this.syrup.address, '40', '600', '800', { | |
| from: minter, | |
| }); | |
| await this.syrup.approve(this.chef2.address, '10', { from: alice }); | |
| await time.advanceBlockTo('590'); | |
| this.chef2.deposit('10', { from: alice }); //520 | |
| await time.advanceBlockTo('610'); | |
| assert.equal( | |
| (await this.syrup.balanceOf(this.chef2.address)).toString(), | |
| '10' | |
| ); | |
| assert.equal( | |
| (await this.chef2.pendingReward(alice, { from: alice })).toString(), | |
| '400' | |
| ); | |
| }); | |
| it('emergencyWithdraw', async () => { | |
| await this.syrup.transfer(alice, '1000', { from: minter }); | |
| assert.equal((await this.syrup.balanceOf(alice)).toString(), '1000'); | |
| await this.syrup.approve(this.chef.address, '1000', { from: alice }); | |
| await this.chef.deposit('10', { from: alice }); | |
| assert.equal((await this.syrup.balanceOf(alice)).toString(), '990'); | |
| await this.chef.emergencyWithdraw({ from: alice }); | |
| assert.equal((await this.syrup.balanceOf(alice)).toString(), '1000'); | |
| assert.equal( | |
| (await this.chef.pendingReward(alice, { from: alice })).toString(), | |
| '0' | |
| ); | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { advanceBlockTo } = require('@openzeppelin/test-helpers/src/time'); | |
| const { assert } = require('chai'); | |
| const CakeToken = artifacts.require('CakeToken'); | |
| const SyrupBar = artifacts.require('SyrupBar'); | |
| contract('SyrupBar', ([alice, bob, carol, dev, minter]) => { | |
| beforeEach(async () => { | |
| this.cake = await CakeToken.new({ from: minter }); | |
| this.syrup = await SyrupBar.new(this.cake.address, { from: minter }); | |
| }); | |
| it('mint', async () => { | |
| await this.syrup.mint(alice, 1000, { from: minter }); | |
| assert.equal((await this.syrup.balanceOf(alice)).toString(), '1000'); | |
| }); | |
| it('burn', async () => { | |
| await advanceBlockTo('650'); | |
| await this.syrup.mint(alice, 1000, { from: minter }); | |
| await this.syrup.mint(bob, 1000, { from: minter }); | |
| assert.equal((await this.syrup.totalSupply()).toString(), '2000'); | |
| await this.syrup.burn(alice, 200, { from: minter }); | |
| assert.equal((await this.syrup.balanceOf(alice)).toString(), '800'); | |
| assert.equal((await this.syrup.totalSupply()).toString(), '1800'); | |
| }); | |
| it('safeCakeTransfer', async () => { | |
| assert.equal( | |
| (await this.cake.balanceOf(this.syrup.address)).toString(), | |
| '0' | |
| ); | |
| await this.cake.mint(this.syrup.address, 1000, { from: minter }); | |
| await this.syrup.safeCakeTransfer(bob, 200, { from: minter }); | |
| assert.equal((await this.cake.balanceOf(bob)).toString(), '200'); | |
| assert.equal( | |
| (await this.cake.balanceOf(this.syrup.address)).toString(), | |
| '800' | |
| ); | |
| await this.syrup.safeCakeTransfer(bob, 2000, { from: minter }); | |
| assert.equal((await this.cake.balanceOf(bob)).toString(), '1000'); | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { expectRevert, time } = require('@openzeppelin/test-helpers'); | |
| const ethers = require('ethers'); | |
| const CakeToken = artifacts.require('CakeToken'); | |
| const MasterChef = artifacts.require('MasterChef'); | |
| const MockBEP20 = artifacts.require('libs/MockBEP20'); | |
| const Timelock = artifacts.require('Timelock'); | |
| const SyrupBar = artifacts.require('SyrupBar'); | |
| function encodeParameters(types, values) { | |
| const abi = new ethers.utils.AbiCoder(); | |
| return abi.encode(types, values); | |
| } | |
| contract('Timelock', ([alice, bob, carol, dev, minter]) => { | |
| beforeEach(async () => { | |
| this.cake = await CakeToken.new({ from: alice }); | |
| this.timelock = await Timelock.new(bob, '28800', { from: alice }); //8hours | |
| }); | |
| it('should not allow non-owner to do operation', async () => { | |
| await this.cake.transferOwnership(this.timelock.address, { from: alice }); | |
| await expectRevert( | |
| this.cake.transferOwnership(carol, { from: alice }), | |
| 'Ownable: caller is not the owner', | |
| ); | |
| await expectRevert( | |
| this.cake.transferOwnership(carol, { from: bob }), | |
| 'Ownable: caller is not the owner', | |
| ); | |
| await expectRevert( | |
| this.timelock.queueTransaction( | |
| this.cake.address, '0', 'transferOwnership(address)', | |
| encodeParameters(['address'], [carol]), | |
| (await time.latest()).add(time.duration.hours(6)), | |
| { from: alice }, | |
| ), | |
| 'Timelock::queueTransaction: Call must come from admin.', | |
| ); | |
| }); | |
| it('should do the timelock thing', async () => { | |
| await this.cake.transferOwnership(this.timelock.address, { from: alice }); | |
| const eta = (await time.latest()).add(time.duration.hours(9)); | |
| await this.timelock.queueTransaction( | |
| this.cake.address, '0', 'transferOwnership(address)', | |
| encodeParameters(['address'], [carol]), eta, { from: bob }, | |
| ); | |
| await time.increase(time.duration.hours(1)); | |
| await expectRevert( | |
| this.timelock.executeTransaction( | |
| this.cake.address, '0', 'transferOwnership(address)', | |
| encodeParameters(['address'], [carol]), eta, { from: bob }, | |
| ), | |
| "Timelock::executeTransaction: Transaction hasn't surpassed time lock.", | |
| ); | |
| await time.increase(time.duration.hours(8)); | |
| await this.timelock.executeTransaction( | |
| this.cake.address, '0', 'transferOwnership(address)', | |
| encodeParameters(['address'], [carol]), eta, { from: bob }, | |
| ); | |
| assert.equal((await this.cake.owner()).valueOf(), carol); | |
| }); | |
| it('should also work with MasterChef', async () => { | |
| this.lp1 = await MockBEP20.new('LPToken', 'LP', '10000000000', { from: minter }); | |
| this.lp2 = await MockBEP20.new('LPToken', 'LP', '10000000000', { from: minter }); | |
| this.syrup = await SyrupBar.new(this.cake.address, { from: minter }); | |
| this.chef = await MasterChef.new(this.cake.address, this.syrup.address, dev, '1000', '0', { from: alice }); | |
| await this.cake.transferOwnership(this.chef.address, { from: alice }); | |
| await this.syrup.transferOwnership(this.chef.address, { from: minter }); | |
| await this.chef.add('100', this.lp1.address, true, { from: alice }); | |
| await this.chef.transferOwnership(this.timelock.address, { from: alice }); | |
| await expectRevert( | |
| this.chef.add('100', this.lp1.address, true, { from: alice }), | |
| "revert Ownable: caller is not the owner", | |
| ); | |
| const eta = (await time.latest()).add(time.duration.hours(9)); | |
| await this.timelock.queueTransaction( | |
| this.chef.address, '0', 'transferOwnership(address)', | |
| encodeParameters(['address'], [minter]), eta, { from: bob }, | |
| ); | |
| // await this.timelock.queueTransaction( | |
| // this.chef.address, '0', 'add(uint256,address,bool)', | |
| // encodeParameters(['uint256', 'address', 'bool'], ['100', this.lp2.address, false]), eta, { from: bob }, | |
| // ); | |
| await time.increase(time.duration.hours(9)); | |
| await this.timelock.executeTransaction( | |
| this.chef.address, '0', 'transferOwnership(address)', | |
| encodeParameters(['address'], [minter]), eta, { from: bob }, | |
| ); | |
| await expectRevert( | |
| this.chef.add('100', this.lp1.address, true, { from: alice }), | |
| "revert Ownable: caller is not the owner", | |
| ); | |
| await this.chef.add('100', this.lp1.address, true, { from: minter }) | |
| // await this.timelock.executeTransaction( | |
| // this.chef.address, '0', 'add(uint256,address,bool)', | |
| // encodeParameters(['uint256', 'address', 'bool'], ['100', this.lp2.address, false]), eta, { from: bob }, | |
| // ); | |
| // assert.equal((await this.chef.poolInfo('0')).valueOf().allocPoint, '200'); | |
| // assert.equal((await this.chef.totalAllocPoint()).valueOf(), '300'); | |
| // assert.equal((await this.chef.poolLength()).valueOf(), '2'); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment