BscScan - Sponsored slots available. Book your slot here!
More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 2,398 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Withdraw | 45325210 | 8 mins ago | IN | 0 BNB | 0.00010049 | ||||
Withdraw | 45325168 | 10 mins ago | IN | 0 BNB | 0.00010051 | ||||
Deposit | 45325164 | 10 mins ago | IN | 0 BNB | 0.00010788 | ||||
Deposit | 45325117 | 12 mins ago | IN | 0 BNB | 0.00012873 | ||||
Deposit | 45325055 | 15 mins ago | IN | 0 BNB | 0.00012873 | ||||
Deposit | 45324998 | 18 mins ago | IN | 0 BNB | 0.00037188 | ||||
Deposit | 45324603 | 38 mins ago | IN | 0 BNB | 0.0003862 | ||||
Withdraw | 45324594 | 39 mins ago | IN | 0 BNB | 0.00011055 | ||||
Deposit | 45324590 | 39 mins ago | IN | 0 BNB | 0.00011866 | ||||
Deposit | 45324431 | 47 mins ago | IN | 0 BNB | 0.0003862 | ||||
Deposit | 45324134 | 1 hr ago | IN | 0 BNB | 0.0003862 | ||||
Deposit | 45323822 | 1 hr ago | IN | 0 BNB | 0.0003862 | ||||
Deposit | 45323501 | 1 hr ago | IN | 0 BNB | 0.00012873 | ||||
Deposit | 45323385 | 1 hr ago | IN | 0 BNB | 0.00012396 | ||||
Deposit | 45323244 | 1 hr ago | IN | 0 BNB | 0.0003862 | ||||
Deposit | 45322962 | 2 hrs ago | IN | 0 BNB | 0.00013003 | ||||
Deposit | 45322930 | 2 hrs ago | IN | 0 BNB | 0.00012873 | ||||
Deposit | 45322788 | 2 hrs ago | IN | 0 BNB | 0.00012518 | ||||
Deposit | 45322647 | 2 hrs ago | IN | 0 BNB | 0.0003862 | ||||
Deposit | 45322634 | 2 hrs ago | IN | 0 BNB | 0.0003862 | ||||
Deposit | 45322223 | 2 hrs ago | IN | 0 BNB | 0.0003862 | ||||
Deposit | 45322109 | 2 hrs ago | IN | 0 BNB | 0.0003718 | ||||
Deposit | 45321908 | 2 hrs ago | IN | 0 BNB | 0.00012873 | ||||
Withdraw | 45321785 | 2 hrs ago | IN | 0 BNB | 0.00011054 | ||||
Withdraw | 45321750 | 3 hrs ago | IN | 0 BNB | 0.00011759 |
Latest 1 internal transaction
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
45033073 | 10 days ago | Contract Creation | 0 BNB |
Loading...
Loading
Similar Match Source Code This contract matches the deployed Bytecode of the Source Code for Contract 0x921Ea7e1...cEABd6477 The constructor portion of the code might be different and could alter the actual behaviour of the contract
Contract Name:
SmartChefInitializable
Compiler Version
v0.8.0+commit.c7dfd78e
Optimization Enabled:
Yes with 99999 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
/** *Submitted for verification at BscScan.com on 2021-05-05 */ // File: @openzeppelin/contracts/utils/Context.sol // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; //import "hardhat/console.sol"; interface IERC20 { /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `recipient`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address recipient, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `sender` to `recipient` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address sender, address recipient, uint256 amount ) external returns (bool); /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); } /** * @dev Interface for the optional metadata functions from the ERC20 standard. * * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** * @dev Returns the name of the token. */ function name() external view returns (string memory); /** * @dev Returns the symbol of the token. */ function symbol() external view returns (string memory); /** * @dev Returns the decimals places of the token. */ function decimals() external view returns (uint8); } /* * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } } // File: @openzeppelin/contracts/access/Ownable.sol abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _setOwner(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _setOwner(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _setOwner(newOwner); } function _setOwner(address newOwner) private { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } } // File: @openzeppelin/contracts/utils/ReentrancyGuard.sol /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { _status = _NOT_ENTERED; } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { // On the first call to nonReentrant, _notEntered will be true require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; _; // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } } // File: @openzeppelin/contracts/utils/Address.sol /** * @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) { // This method relies on extcodesize, which returns 0 for contracts in // construction, since the code is only stored at the end of the // constructor execution. uint256 size; assembly { size := extcodesize(account) } return size > 0; } /** * @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"); (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"); require(isContract(target), "Address: call to non-contract"); (bool success, bytes memory returndata) = target.call{value: value}(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, "Address: low-level static call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. * * _Available since v3.3._ */ function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { require(isContract(target), "Address: static call to non-contract"); (bool success, bytes memory returndata) = target.staticcall(data); return _verifyCallResult(success, returndata, errorMessage); } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, "Address: low-level delegate call failed"); } /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. * * _Available since v3.4._ */ function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { require(isContract(target), "Address: delegate call to non-contract"); (bool success, bytes memory returndata) = target.delegatecall(data); return _verifyCallResult(success, returndata, errorMessage); } function _verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) private pure returns (bytes memory) { 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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } } // File: "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; /** * @title SafeERC20 * @dev Wrappers around ERC20 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 SafeERC20 for IERC20;` statement to your contract, * which allows you to call the safe operations as `token.safeTransfer(...)`, etc. */ library SafeERC20 { using Address for address; function safeTransfer( IERC20 token, address to, uint256 value ) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } function safeTransferFrom( IERC20 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 * {IERC20-approve}, and its usage is discouraged. * * Whenever possible, use {safeIncreaseAllowance} and * {safeDecreaseAllowance} instead. */ function safeApprove( IERC20 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' require( (value == 0) || (token.allowance(address(this), spender) == 0), "SafeERC20: approve from non-zero to non-zero allowance" ); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value)); } function safeIncreaseAllowance( IERC20 token, address spender, uint256 value ) internal { uint256 newAllowance = token.allowance(address(this), spender) + value; _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance)); } function safeDecreaseAllowance( IERC20 token, address spender, uint256 value ) internal { unchecked { uint256 oldAllowance = token.allowance(address(this), spender); require(oldAllowance >= value, "SafeERC20: decreased allowance below zero"); uint256 newAllowance = oldAllowance - value; _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(IERC20 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, "SafeERC20: low-level call failed"); if (returndata.length > 0) { // Return data is optional require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed"); } } } // File: IPancakeProfile.sol /** * @title IPancakeProfile */ interface IPancakeProfile { function createProfile( uint256 _teamId, address _nftAddress, uint256 _tokenId ) external; function increaseUserPoints( address _userAddress, uint256 _numberPoints, uint256 _campaignId ) external; function removeUserPoints(address _userAddress, uint256 _numberPoints) external; function addNftAddress(address _nftAddress) external; function addTeam(string calldata _teamName, string calldata _teamDescription) external; function getUserProfile(address _userAddress) external view returns ( uint256, uint256, uint256, address, uint256, bool ); function getUserStatus(address _userAddress) external view returns (bool); function getTeamProfile(uint256 _teamId) external view returns ( string memory, string memory, uint256, uint256, bool ); } // File: contracts/SmartChefInitializable.sol contract SmartChefInitializable is Ownable, ReentrancyGuard { using SafeERC20 for IERC20Metadata; // The address of the smart chef factory address public immutable SMART_CHEF_FACTORY; // Whether a limit is set for users bool public userLimit; // Whether it is initialized bool public isInitialized; // Accrued token per share uint256 public accTokenPerShare; // The block number when CAKE mining ends. uint256 public bonusEndBlock; // The block number when CAKE mining starts. uint256 public startBlock; // The block number of the last pool update uint256 public lastRewardBlock; // The pool limit (0 if none) uint256 public poolLimitPerUser; // Block numbers available for user limit (after start block) uint256 public numberBlocksForUserLimit; // Pancake profile IPancakeProfile public immutable pancakeProfile; // Pancake Profile is requested bool public pancakeProfileIsRequested; // Pancake Profile points threshold uint256 public pancakeProfileThresholdPoints; // CAKE tokens created per block. uint256 public rewardPerBlock; // The precision factor uint256 public PRECISION_FACTOR; // The reward token IERC20Metadata public rewardToken; // The staked token IERC20Metadata public stakedToken; // Info of each user that stakes tokens (stakedToken) mapping(address => UserInfo) public userInfo; struct UserInfo { uint256 amount; // How many staked tokens the user has provided uint256 rewardDebt; // Reward debt } event Deposit(address indexed user, uint256 amount); event EmergencyWithdraw(address indexed user, uint256 amount); event NewStartAndEndBlocks(uint256 startBlock, uint256 endBlock); event NewRewardPerBlock(uint256 rewardPerBlock); event NewPoolLimit(uint256 poolLimitPerUser); event RewardsStop(uint256 blockNumber); event TokenRecovery(address indexed token, uint256 amount); event Withdraw(address indexed user, uint256 amount); event UpdateProfileAndThresholdPointsRequirement(bool isProfileRequested, uint256 thresholdPoints); /** * @notice Constructor * @param _pancakeProfile: Pancake Profile address * @param _pancakeProfileIsRequested: Pancake Profile is requested * @param _pancakeProfileThresholdPoints: Pancake Profile need threshold points */ constructor( address _pancakeProfile, bool _pancakeProfileIsRequested, uint256 _pancakeProfileThresholdPoints ) { SMART_CHEF_FACTORY = msg.sender; // Call to verify the address is correct IPancakeProfile(_pancakeProfile).getTeamProfile(1); pancakeProfile = IPancakeProfile(_pancakeProfile); // if pancakeProfile is requested pancakeProfileIsRequested = _pancakeProfileIsRequested; // pancakeProfile threshold points when profile & points are requested pancakeProfileThresholdPoints = _pancakeProfileThresholdPoints; } /* * @notice Initialize the contract * @param _stakedToken: staked token address * @param _rewardToken: reward token address * @param _rewardPerBlock: reward per block (in rewardToken) * @param _startBlock: start block * @param _bonusEndBlock: end block * @param _poolLimitPerUser: pool limit per user in stakedToken (if any, else 0) * @param _numberBlocksForUserLimit: block numbers available for user limit (after start block) * @param _admin: admin address with ownership */ function initialize( IERC20Metadata _stakedToken, IERC20Metadata _rewardToken, uint256 _rewardPerBlock, uint256 _startBlock, uint256 _bonusEndBlock, uint256 _poolLimitPerUser, uint256 _numberBlocksForUserLimit, address _admin ) external { require(!isInitialized, "Already initialized"); require(msg.sender == SMART_CHEF_FACTORY, "Not factory"); // Make this contract initialized isInitialized = true; stakedToken = _stakedToken; rewardToken = _rewardToken; rewardPerBlock = _rewardPerBlock; startBlock = _startBlock; bonusEndBlock = _bonusEndBlock; if (_poolLimitPerUser > 0) { userLimit = true; poolLimitPerUser = _poolLimitPerUser; numberBlocksForUserLimit = _numberBlocksForUserLimit; } uint256 decimalsRewardToken = uint256(rewardToken.decimals()); require(decimalsRewardToken < 30, "Must be less than 30"); PRECISION_FACTOR = uint256(10**(uint256(30) - decimalsRewardToken)); // Set the lastRewardBlock as the startBlock lastRewardBlock = startBlock; // Transfer ownership to the admin address who becomes owner of the contract transferOwnership(_admin); } /* * @notice Deposit staked tokens and collect reward tokens (if any) * @param _amount: amount to withdraw (in rewardToken) */ function deposit(uint256 _amount) external nonReentrant { UserInfo storage user = userInfo[msg.sender]; // Checks whether the user has an active profile require( (!pancakeProfileIsRequested && pancakeProfileThresholdPoints == 0) || pancakeProfile.getUserStatus(msg.sender), "Deposit: Must have an active profile" ); uint256 numberUserPoints = 0; if (pancakeProfileThresholdPoints > 0) { (, numberUserPoints, , , , ) = pancakeProfile.getUserProfile(msg.sender); } require( pancakeProfileThresholdPoints == 0 || numberUserPoints >= pancakeProfileThresholdPoints, "Deposit: User has not enough points" ); userLimit = hasUserLimit(); require(!userLimit || ((_amount + user.amount) <= poolLimitPerUser), "Deposit: Amount above limit"); _updatePool(); if (user.amount > 0) { uint256 pending = (user.amount * accTokenPerShare) / PRECISION_FACTOR - user.rewardDebt; if (pending > 0) { rewardToken.safeTransfer(address(msg.sender), pending); } } if (_amount > 0) { user.amount = user.amount + _amount; stakedToken.safeTransferFrom(address(msg.sender), address(this), _amount); } user.rewardDebt = (user.amount * accTokenPerShare) / PRECISION_FACTOR; emit Deposit(msg.sender, _amount); } /* * @notice Withdraw staked tokens and collect reward tokens * @param _amount: amount to withdraw (in rewardToken) */ function withdraw(uint256 _amount) external nonReentrant { UserInfo storage user = userInfo[msg.sender]; require(user.amount >= _amount, "Amount to withdraw too high"); _updatePool(); uint256 pending = (user.amount * accTokenPerShare) / PRECISION_FACTOR - user.rewardDebt; if (_amount > 0) { user.amount = user.amount - _amount; stakedToken.safeTransfer(address(msg.sender), _amount); } if (pending > 0) { rewardToken.safeTransfer(address(msg.sender), pending); } user.rewardDebt = (user.amount * accTokenPerShare) / PRECISION_FACTOR; emit Withdraw(msg.sender, _amount); } /* * @notice Withdraw staked tokens without caring about rewards rewards * @dev Needs to be for emergency. */ function emergencyWithdraw() external nonReentrant { UserInfo storage user = userInfo[msg.sender]; uint256 amountToTransfer = user.amount; user.amount = 0; user.rewardDebt = 0; if (amountToTransfer > 0) { stakedToken.safeTransfer(address(msg.sender), amountToTransfer); } emit EmergencyWithdraw(msg.sender, user.amount); } /* * @notice Stop rewards * @dev Only callable by owner. Needs to be for emergency. */ function emergencyRewardWithdraw(uint256 _amount) external onlyOwner { rewardToken.safeTransfer(address(msg.sender), _amount); } /** * @notice Allows the owner to recover tokens sent to the contract by mistake * @param _token: token address * @dev Callable by owner */ function recoverToken(address _token) external onlyOwner { require(_token != address(stakedToken), "Operations: Cannot recover staked token"); require(_token != address(rewardToken), "Operations: Cannot recover reward token"); uint256 balance = IERC20Metadata(_token).balanceOf(address(this)); require(balance != 0, "Operations: Cannot recover zero balance"); IERC20Metadata(_token).safeTransfer(address(msg.sender), balance); emit TokenRecovery(_token, balance); } /* * @notice Stop rewards * @dev Only callable by owner */ function stopReward() external onlyOwner { bonusEndBlock = block.number; } /* * @notice Update pool limit per user * @dev Only callable by owner. * @param _userLimit: whether the limit remains forced * @param _poolLimitPerUser: new pool limit per user */ function updatePoolLimitPerUser(bool _userLimit, uint256 _poolLimitPerUser) external onlyOwner { require(userLimit, "Must be set"); if (_userLimit) { require(_poolLimitPerUser > poolLimitPerUser, "New limit must be higher"); poolLimitPerUser = _poolLimitPerUser; } else { userLimit = _userLimit; poolLimitPerUser = 0; } emit NewPoolLimit(poolLimitPerUser); } /* * @notice Update reward per block * @dev Only callable by owner. * @param _rewardPerBlock: the reward per block */ function updateRewardPerBlock(uint256 _rewardPerBlock) external onlyOwner { require(block.number < startBlock, "Pool has started"); rewardPerBlock = _rewardPerBlock; emit NewRewardPerBlock(_rewardPerBlock); } /** * @notice It allows the admin to update start and end blocks * @dev This function is only callable by owner. * @param _startBlock: the new start block * @param _bonusEndBlock: the new end block */ function updateStartAndEndBlocks(uint256 _startBlock, uint256 _bonusEndBlock) external onlyOwner { require(block.number < startBlock, "Pool has started"); require(_startBlock < _bonusEndBlock, "New startBlock must be lower than new endBlock"); require(block.number < _startBlock, "New startBlock must be higher than current block"); startBlock = _startBlock; bonusEndBlock = _bonusEndBlock; // Set the lastRewardBlock as the startBlock lastRewardBlock = startBlock; emit NewStartAndEndBlocks(_startBlock, _bonusEndBlock); } /** * @notice It allows the admin to update profile and thresholdPoints' requirement. * @dev This function is only callable by owner. * @param _isRequested: the profile is requested * @param _thresholdPoints: the threshold points */ function updateProfileAndThresholdPointsRequirement(bool _isRequested, uint256 _thresholdPoints) external onlyOwner { require(_thresholdPoints >= 0, "Threshold points need to exceed 0"); pancakeProfileIsRequested = _isRequested; pancakeProfileThresholdPoints = _thresholdPoints; emit UpdateProfileAndThresholdPointsRequirement(_isRequested, _thresholdPoints); } /* * @notice View function to see pending reward on frontend. * @param _user: user address * @return Pending reward for a given user */ function pendingReward(address _user) external view returns (uint256) { UserInfo storage user = userInfo[_user]; uint256 stakedTokenSupply = stakedToken.balanceOf(address(this)); if (block.number > lastRewardBlock && stakedTokenSupply != 0) { uint256 multiplier = _getMultiplier(lastRewardBlock, block.number); uint256 cakeReward = multiplier * rewardPerBlock; uint256 adjustedTokenPerShare = accTokenPerShare + (cakeReward * PRECISION_FACTOR) / stakedTokenSupply; return (user.amount * adjustedTokenPerShare) / PRECISION_FACTOR - user.rewardDebt; } else { return (user.amount * accTokenPerShare) / PRECISION_FACTOR - user.rewardDebt; } } /* * @notice Update reward variables of the given pool to be up-to-date. */ function _updatePool() internal { if (block.number <= lastRewardBlock) { return; } uint256 stakedTokenSupply = stakedToken.balanceOf(address(this)); if (stakedTokenSupply == 0) { lastRewardBlock = block.number; return; } uint256 multiplier = _getMultiplier(lastRewardBlock, block.number); uint256 cakeReward = multiplier * rewardPerBlock; accTokenPerShare = accTokenPerShare + (cakeReward * PRECISION_FACTOR) / stakedTokenSupply; lastRewardBlock = block.number; } /* * @notice Return reward multiplier over the given _from to _to block. * @param _from: block to start * @param _to: block to finish */ function _getMultiplier(uint256 _from, uint256 _to) internal view returns (uint256) { if (_to <= bonusEndBlock) { return _to - _from; } else if (_from >= bonusEndBlock) { return 0; } else { return bonusEndBlock - _from; } } /* * @notice Return user limit is set or zero. */ function hasUserLimit() public view returns (bool) { if (!userLimit || (block.number >= (startBlock + numberBlocksForUserLimit))) { return false; } return true; } } // File: contracts/SmartChefFactory.sol contract SmartChefFactory is Ownable { event NewSmartChefContract(address indexed smartChef); constructor() { // } /* * @notice Deploy the pool * @param _stakedToken: staked token address * @param _rewardToken: reward token address * @param _rewardPerBlock: reward per block (in rewardToken) * @param _startBlock: start block * @param _endBlock: end block * @param _poolLimitPerUser: pool limit per user in stakedToken (if any, else 0) * @param _numberBlocksForUserLimit: block numbers available for user limit (after start block) * @param _pancakeProfile: Pancake Profile address * @param _pancakeProfileIsRequested: Pancake Profile is requested * @param _pancakeProfileThresholdPoints: Pancake Profile need threshold points * @param _admin: admin address with ownership * @return address of new smart chef contract */ function deployPool( IERC20Metadata _stakedToken, IERC20Metadata _rewardToken, uint256 _rewardPerBlock, uint256 _startBlock, uint256 _bonusEndBlock, uint256 _poolLimitPerUser, uint256 _numberBlocksForUserLimit, address _pancakeProfile, bool _pancakeProfileIsRequested, uint256 _pancakeProfileThresholdPoints, address _admin ) external onlyOwner { require(_stakedToken.totalSupply() >= 0); require(_rewardToken.totalSupply() >= 0); require(_stakedToken != _rewardToken, "Tokens must be be different"); bytes memory bytecode = type(SmartChefInitializable).creationCode; // pass constructor argument bytecode = abi.encodePacked( bytecode, abi.encode(_pancakeProfile, _pancakeProfileIsRequested, _pancakeProfileThresholdPoints) ); bytes32 salt = keccak256(abi.encodePacked(_stakedToken, _rewardToken, _startBlock)); address smartChefAddress; assembly { smartChefAddress := create2(0, add(bytecode, 32), mload(bytecode), salt) } SmartChefInitializable(smartChefAddress).initialize( _stakedToken, _rewardToken, _rewardPerBlock, _startBlock, _bonusEndBlock, _poolLimitPerUser, _numberBlocksForUserLimit, _admin ); emit NewSmartChefContract(smartChefAddress); } }
{ "optimizer": { "enabled": true, "runs": 99999 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"_pancakeProfile","type":"address"},{"internalType":"bool","name":"_pancakeProfileIsRequested","type":"bool"},{"internalType":"uint256","name":"_pancakeProfileThresholdPoints","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"EmergencyWithdraw","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"poolLimitPerUser","type":"uint256"}],"name":"NewPoolLimit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"rewardPerBlock","type":"uint256"}],"name":"NewRewardPerBlock","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"startBlock","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endBlock","type":"uint256"}],"name":"NewStartAndEndBlocks","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"blockNumber","type":"uint256"}],"name":"RewardsStop","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"TokenRecovery","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"isProfileRequested","type":"bool"},{"indexed":false,"internalType":"uint256","name":"thresholdPoints","type":"uint256"}],"name":"UpdateProfileAndThresholdPointsRequirement","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"user","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdraw","type":"event"},{"inputs":[],"name":"PRECISION_FACTOR","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SMART_CHEF_FACTORY","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accTokenPerShare","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"bonusEndBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"deposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"emergencyRewardWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"emergencyWithdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"hasUserLimit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20Metadata","name":"_stakedToken","type":"address"},{"internalType":"contract IERC20Metadata","name":"_rewardToken","type":"address"},{"internalType":"uint256","name":"_rewardPerBlock","type":"uint256"},{"internalType":"uint256","name":"_startBlock","type":"uint256"},{"internalType":"uint256","name":"_bonusEndBlock","type":"uint256"},{"internalType":"uint256","name":"_poolLimitPerUser","type":"uint256"},{"internalType":"uint256","name":"_numberBlocksForUserLimit","type":"uint256"},{"internalType":"address","name":"_admin","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isInitialized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lastRewardBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"numberBlocksForUserLimit","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pancakeProfile","outputs":[{"internalType":"contract IPancakeProfile","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pancakeProfileIsRequested","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pancakeProfileThresholdPoints","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_user","type":"address"}],"name":"pendingReward","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"poolLimitPerUser","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_token","type":"address"}],"name":"recoverToken","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"rewardPerBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"rewardToken","outputs":[{"internalType":"contract IERC20Metadata","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stakedToken","outputs":[{"internalType":"contract IERC20Metadata","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"startBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"stopReward","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_userLimit","type":"bool"},{"internalType":"uint256","name":"_poolLimitPerUser","type":"uint256"}],"name":"updatePoolLimitPerUser","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_isRequested","type":"bool"},{"internalType":"uint256","name":"_thresholdPoints","type":"uint256"}],"name":"updateProfileAndThresholdPointsRequirement","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_rewardPerBlock","type":"uint256"}],"name":"updateRewardPerBlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_startBlock","type":"uint256"},{"internalType":"uint256","name":"_bonusEndBlock","type":"uint256"}],"name":"updateStartAndEndBlocks","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"userInfo","outputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"rewardDebt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"userLimit","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]
Deployed Bytecode
0x608060405234801561001057600080fd5b506004361061020b5760003560e01c80638ae39cac1161012a578063b6b55f25116100bd578063ccd34cd51161008c578063f2fde38b11610071578063f2fde38b146103ae578063f40f0f52146103c1578063f7c618c1146103d45761020b565b8063ccd34cd51461039e578063db2e21bc146103a65761020b565b8063b6b55f2514610373578063bd61719114610386578063c7d936ec1461038e578063cc7a262e146103965761020b565b80639513997f116100f95780639513997f146103325780639be65a6014610345578063a0b4090514610358578063a9f8d1811461036b5761020b565b80638ae39cac146103055780638da5cb5b1461030d5780638f6629151461032257806392e8990e1461032a5761020b565b806348cd4cb1116101a2578063681096311161017157806368109631146102da578063715018a6146102ed57806380dc0672146102f55780638ad1071b146102fd5761020b565b806348cd4cb1146102ba5780634a7c01ec146102c25780635a0b5f34146102ca57806366fe9f8a146102d25761020b565b80632aa2c381116101de5780632aa2c3811461026c5780632e1a7d4d1461027f5780633279beab14610292578063392e53cd146102a55761020b565b806301f8a976146102105780630ace6247146102255780631959a002146102435780631aed655314610264575b600080fd5b61022361021e366004611ea4565b6103dc565b005b61022d6104d3565b60405161023a9190612671565b60405180910390f35b610256610251366004611dc6565b6104d9565b60405161023a92919061267a565b61022d6104f2565b61022361027a366004611e29565b6104f8565b61022361028d366004611ea4565b61078a565b6102236102a0366004611ea4565b610917565b6102ad6109b1565b60405161023a9190612008565b61022d6109bf565b6102ad6109c5565b6102ad6109ce565b61022d6109d7565b6102236102e8366004611dfe565b6109dd565b610223610abf565b610223610b3e565b61022d610bb7565b61022d610bbd565b610315610bc3565b60405161023a9190611f90565b61022d610be0565b6102ad610be6565b610223610340366004611ed4565b610c1d565b610223610353366004611dc6565b610d7e565b610223610366366004611dfe565b610fec565b61022d611149565b610223610381366004611ea4565b61114f565b610315611553565b610315611577565b61031561159b565b61022d6115b7565b6102236115bd565b6102236103bc366004611dc6565b61168a565b61022d6103cf366004611dc6565b611753565b6103156118e0565b6103e46118fc565b73ffffffffffffffffffffffffffffffffffffffff16610402610bc3565b73ffffffffffffffffffffffffffffffffffffffff1614610458576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f9061236d565b60405180910390fd5b6005544310610493576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f906121c2565b600b8190556040517f0c4d677eef92893ac7ec52faf8140fc6c851ab4736302b4f3a89dfb20696a0df906104c8908390612671565b60405180910390a150565b600a5481565b600f602052600090815260409020805460019091015482565b60045481565b600254610100900460ff161561053a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f906124db565b3373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000fff5812c35ec100df51d5c9842e8cc3fe60f9ad716146105a9576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f9061263a565b600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff16610100179055600e805473ffffffffffffffffffffffffffffffffffffffff808b167fffffffffffffffffffffffff000000000000000000000000000000000000000092831617909255600d8054928a1692909116919091179055600b86905560058590556004849055821561067557600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00166001179055600783905560088290555b600d54604080517f313ce567000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff169163313ce567916004808301926020929190829003018186803b1580156106e057600080fd5b505afa1580156106f4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107189190611f53565b60ff169050601e8110610757576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f9061256f565b61076281601e612848565b61076d90600a61271f565b600c5560055460065561077f8261168a565b505050505050505050565b600260015414156107c7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f90612603565b6002600155336000908152600f602052604090208054821115610816576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f9061246d565b61081e611900565b60008160010154600c54600354846000015461083a919061280b565b61084491906126a0565b61084e9190612848565b90508215610889578154610863908490612848565b8255600e546108899073ffffffffffffffffffffffffffffffffffffffff163385611a1a565b80156108b357600d546108b39073ffffffffffffffffffffffffffffffffffffffff163383611a1a565b600c5460035483546108c5919061280b565b6108cf91906126a0565b600183015560405133907f884edad9ce6fa2440d8a54cc123490eb96d2768479d49ff9c7366125a942436490610906908690612671565b60405180910390a250506001805550565b61091f6118fc565b73ffffffffffffffffffffffffffffffffffffffff1661093d610bc3565b73ffffffffffffffffffffffffffffffffffffffff161461098a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f9061236d565b600d546109ae9073ffffffffffffffffffffffffffffffffffffffff163383611a1a565b50565b600254610100900460ff1681565b60055481565b60025460ff1681565b60095460ff1681565b60075481565b6109e56118fc565b73ffffffffffffffffffffffffffffffffffffffff16610a03610bc3565b73ffffffffffffffffffffffffffffffffffffffff1614610a50576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f9061236d565b600980547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016831515179055600a8190556040517f915d08e0e89c58e352d7c1d66c942cb15dac8a7294d2ca80ddf46f1998f0512b90610ab39084908490612013565b60405180910390a15050565b610ac76118fc565b73ffffffffffffffffffffffffffffffffffffffff16610ae5610bc3565b73ffffffffffffffffffffffffffffffffffffffff1614610b32576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f9061236d565b610b3c6000611ac0565b565b610b466118fc565b73ffffffffffffffffffffffffffffffffffffffff16610b64610bc3565b73ffffffffffffffffffffffffffffffffffffffff1614610bb1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f9061236d565b43600455565b60085481565b600b5481565b60005473ffffffffffffffffffffffffffffffffffffffff165b90565b60035481565b60025460009060ff161580610c0a5750600854600554610c069190612688565b4310155b15610c1757506000610bdd565b50600190565b610c256118fc565b73ffffffffffffffffffffffffffffffffffffffff16610c43610bc3565b73ffffffffffffffffffffffffffffffffffffffff1614610c90576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f9061236d565b6005544310610ccb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f906121c2565b808210610d04576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f90612256565b814310610d3d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f90612310565b6005829055600481905560068290556040517f7cd0ab87d19036f3dfadadb232c78aa4879dda3f0c994a9d637532410ee2ce0690610ab3908490849061267a565b610d866118fc565b73ffffffffffffffffffffffffffffffffffffffff16610da4610bc3565b73ffffffffffffffffffffffffffffffffffffffff1614610df1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f9061236d565b600e5473ffffffffffffffffffffffffffffffffffffffff82811691161415610e46576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f90612512565b600d5473ffffffffffffffffffffffffffffffffffffffff82811691161415610e9b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f90612410565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815260009073ffffffffffffffffffffffffffffffffffffffff8316906370a0823190610ef0903090600401611f90565b60206040518083038186803b158015610f0857600080fd5b505afa158015610f1c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f409190611ebc565b905080610f79576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f906120d1565b610f9a73ffffffffffffffffffffffffffffffffffffffff83163383611a1a565b8173ffffffffffffffffffffffffffffffffffffffff167f14f11966a996e0629572e51064726d2057a80fbd34efc066682c06a71dbb6e9882604051610fe09190612671565b60405180910390a25050565b610ff46118fc565b73ffffffffffffffffffffffffffffffffffffffff16611012610bc3565b73ffffffffffffffffffffffffffffffffffffffff161461105f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f9061236d565b60025460ff1661109b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f906123a2565b81156110e65760075481116110dc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f906123d9565b6007819055611118565b600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff001683151517905560006007555b7f241f67ee5f41b7a5cabf911367329be7215900f602ebfc47f89dce2a6bcd847c600754604051610ab39190612671565b60065481565b6002600154141561118c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f90612603565b6002600155336000908152600f6020526040902060095460ff161580156111b35750600a54155b8061127b57506040517fea0d5dcd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000df4dbf6536201370f95e06a0f8a7a70fe40e388a169063ea0d5dcd9061122b903390600401611f90565b60206040518083038186803b15801561124357600080fd5b505afa158015611257573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061127b9190611de2565b6112b1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f90612074565b600a5460009015611387576040517f987ee15600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000df4dbf6536201370f95e06a0f8a7a70fe40e388a169063987ee1569061132e903390600401611f90565b60c06040518083038186803b15801561134657600080fd5b505afa15801561135a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061137e9190611ef5565b50929450505050505b600a5415806113985750600a548110155b6113ce576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f906121f9565b6113d6610be6565b600280547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179081905560ff161580611423575060075482546114209085612688565b11155b611459576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f9061212e565b611461611900565b8154156114c65760008260010154600c546003548560000154611484919061280b565b61148e91906126a0565b6114989190612848565b905080156114c457600d546114c49073ffffffffffffffffffffffffffffffffffffffff163383611a1a565b505b82156115005781546114d9908490612688565b8255600e546115009073ffffffffffffffffffffffffffffffffffffffff16333086611b35565b600c546003548354611512919061280b565b61151c91906126a0565b600183015560405133907fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c90610906908690612671565b7f000000000000000000000000fff5812c35ec100df51d5c9842e8cc3fe60f9ad781565b7f000000000000000000000000df4dbf6536201370f95e06a0f8a7a70fe40e388a81565b600e5473ffffffffffffffffffffffffffffffffffffffff1681565b600c5481565b600260015414156115fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f90612603565b60026001908155336000908152600f6020526040812080548282559281019190915590801561164757600e546116479073ffffffffffffffffffffffffffffffffffffffff163383611a1a565b815460405133917f5fafa99d0643513820be26656b45130b01e1c03062e1266bf36f88cbd3bd96959161167a9190612671565b60405180910390a2505060018055565b6116926118fc565b73ffffffffffffffffffffffffffffffffffffffff166116b0610bc3565b73ffffffffffffffffffffffffffffffffffffffff16146116fd576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f9061236d565b73ffffffffffffffffffffffffffffffffffffffff811661174a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f90612165565b6109ae81611ac0565b73ffffffffffffffffffffffffffffffffffffffff8082166000908152600f6020526040808220600e5491517f70a08231000000000000000000000000000000000000000000000000000000008152929390928492909116906370a08231906117c0903090600401611f90565b60206040518083038186803b1580156117d857600080fd5b505afa1580156117ec573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118109190611ebc565b90506006544311801561182257508015155b156118ab57600061183560065443611b5c565b90506000600b5482611847919061280b565b9050600083600c548361185a919061280b565b61186491906126a0565b6003546118719190612688565b90508460010154600c5482876000015461188b919061280b565b61189591906126a0565b61189f9190612848565b955050505050506118db565b6001820154600c5460035484546118c2919061280b565b6118cc91906126a0565b6118d69190612848565b925050505b919050565b600d5473ffffffffffffffffffffffffffffffffffffffff1681565b3390565b600654431161190e57610b3c565b600e546040517f70a0823100000000000000000000000000000000000000000000000000000000815260009173ffffffffffffffffffffffffffffffffffffffff16906370a0823190611965903090600401611f90565b60206040518083038186803b15801561197d57600080fd5b505afa158015611991573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119b59190611ebc565b9050806119c6575043600655610b3c565b60006119d460065443611b5c565b90506000600b54826119e6919061280b565b905082600c54826119f7919061280b565b611a0191906126a0565b600354611a0e9190612688565b60035550504360065550565b611abb8363a9059cbb60e01b8484604051602401611a39929190611fe2565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611b9d565b505050565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b611b56846323b872dd60e01b858585604051602401611a3993929190611fb1565b50505050565b60006004548211611b7857611b718383612848565b9050611b97565b6004548310611b8957506000611b97565b82600454611b719190612848565b92915050565b6000611bff826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611c539092919063ffffffff16565b805190915015611abb5780806020019051810190611c1d9190611de2565b611abb576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f906125a6565b6060611c628484600085611c6c565b90505b9392505050565b606082471015611ca8576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f906122b3565b611cb185611d6d565b611ce7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f906124a4565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051611d109190611f74565b60006040518083038185875af1925050503d8060008114611d4d576040519150601f19603f3d011682016040523d82523d6000602084013e611d52565b606091505b5091509150611d62828286611d73565b979650505050505050565b3b151590565b60608315611d82575081611c65565b825115611d925782518084602001fd5b816040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161044f9190612023565b600060208284031215611dd7578081fd5b8135611c65816128ba565b600060208284031215611df3578081fd5b8151611c65816128dc565b60008060408385031215611e10578081fd5b8235611e1b816128dc565b946020939093013593505050565b600080600080600080600080610100898b031215611e45578384fd5b8835611e50816128ba565b97506020890135611e60816128ba565b965060408901359550606089013594506080890135935060a0890135925060c0890135915060e0890135611e93816128ba565b809150509295985092959890939650565b600060208284031215611eb5578081fd5b5035919050565b600060208284031215611ecd578081fd5b5051919050565b60008060408385031215611ee6578182fd5b50508035926020909101359150565b60008060008060008060c08789031215611f0d578182fd5b8651955060208701519450604087015193506060870151611f2d816128ba565b608088015160a08901519194509250611f45816128dc565b809150509295509295509295565b600060208284031215611f64578081fd5b815160ff81168114611c65578182fd5b60008251611f8681846020870161285f565b9190910192915050565b73ffffffffffffffffffffffffffffffffffffffff91909116815260200190565b73ffffffffffffffffffffffffffffffffffffffff9384168152919092166020820152604081019190915260600190565b73ffffffffffffffffffffffffffffffffffffffff929092168252602082015260400190565b901515815260200190565b9115158252602082015260400190565b600060208252825180602084015261204281604085016020870161285f565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169190910160400192915050565b60208082526024908201527f4465706f7369743a204d757374206861766520616e206163746976652070726f60408201527f66696c6500000000000000000000000000000000000000000000000000000000606082015260800190565b60208082526027908201527f4f7065726174696f6e733a2043616e6e6f74207265636f766572207a65726f2060408201527f62616c616e636500000000000000000000000000000000000000000000000000606082015260800190565b6020808252601b908201527f4465706f7369743a20416d6f756e742061626f7665206c696d69740000000000604082015260600190565b60208082526026908201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160408201527f6464726573730000000000000000000000000000000000000000000000000000606082015260800190565b60208082526010908201527f506f6f6c20686173207374617274656400000000000000000000000000000000604082015260600190565b60208082526023908201527f4465706f7369743a205573657220686173206e6f7420656e6f75676820706f6960408201527f6e74730000000000000000000000000000000000000000000000000000000000606082015260800190565b6020808252602e908201527f4e6577207374617274426c6f636b206d757374206265206c6f7765722074686160408201527f6e206e657720656e64426c6f636b000000000000000000000000000000000000606082015260800190565b60208082526026908201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60408201527f722063616c6c0000000000000000000000000000000000000000000000000000606082015260800190565b60208082526030908201527f4e6577207374617274426c6f636b206d7573742062652068696768657220746860408201527f616e2063757272656e7420626c6f636b00000000000000000000000000000000606082015260800190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600b908201527f4d75737420626520736574000000000000000000000000000000000000000000604082015260600190565b60208082526018908201527f4e6577206c696d6974206d757374206265206869676865720000000000000000604082015260600190565b60208082526027908201527f4f7065726174696f6e733a2043616e6e6f74207265636f76657220726577617260408201527f6420746f6b656e00000000000000000000000000000000000000000000000000606082015260800190565b6020808252601b908201527f416d6f756e7420746f20776974686472617720746f6f20686967680000000000604082015260600190565b6020808252601d908201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604082015260600190565b60208082526013908201527f416c726561647920696e697469616c697a656400000000000000000000000000604082015260600190565b60208082526027908201527f4f7065726174696f6e733a2043616e6e6f74207265636f766572207374616b6560408201527f6420746f6b656e00000000000000000000000000000000000000000000000000606082015260800190565b60208082526014908201527f4d757374206265206c657373207468616e203330000000000000000000000000604082015260600190565b6020808252602a908201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60408201527f6f74207375636365656400000000000000000000000000000000000000000000606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6020808252600b908201527f4e6f7420666163746f7279000000000000000000000000000000000000000000604082015260600190565b90815260200190565b918252602082015260400190565b6000821982111561269b5761269b61288b565b500190565b6000826126d4577f4e487b710000000000000000000000000000000000000000000000000000000081526012600452602481fd5b500490565b80825b60018086116126eb5750612716565b8187048211156126fd576126fd61288b565b8086161561270a57918102915b9490941c9380026126dc565b94509492505050565b6000611c657fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff848460008261275657506001611c65565b8161276357506000611c65565b81600181146127795760028114612783576127b0565b6001915050611c65565b60ff8411156127945761279461288b565b6001841b9150848211156127aa576127aa61288b565b50611c65565b5060208310610133831016604e8410600b84101617156127e3575081810a838111156127de576127de61288b565b611c65565b6127f084848460016126d9565b8086048211156128025761280261288b565b02949350505050565b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156128435761284361288b565b500290565b60008282101561285a5761285a61288b565b500390565b60005b8381101561287a578181015183820152602001612862565b83811115611b565750506000910152565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b73ffffffffffffffffffffffffffffffffffffffff811681146109ae57600080fd5b80151581146109ae57600080fdfea26469706673582212207cfaa03f3b3e1bf891f997219863057fd5bafed532f07ed3232acc62b8b4168264736f6c63430008000033
Loading...
Loading
Loading...
Loading
Loading...
Loading
[ Download: CSV Export ]
[ Download: CSV Export ]
A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.