comment
stringlengths 1
211
⌀ | input
stringlengths 155
20k
| label
stringlengths 4
1k
| original_idx
int64 203
514k
| predicate
stringlengths 1
1k
|
---|---|---|---|---|
"Poolable: Pool is closed" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;
import "@openzeppelin/contracts/access/Ownable.sol";
/** @title Poolable.
@dev This contract manage configuration of pools
*/
abstract contract Poolable is Ownable {
struct Pool {
uint256 lockDuration; // locked timespan
uint256 minDuration; // min deposit timespan
bool opened; // flag indicating if the pool is open
uint256 rewardAmount; // amount rewarded when lockDuration is reached
}
// pools mapping
uint256 public poolsLength;
mapping(uint256 => Pool) private _pools;
/**
* @dev Emitted when a pool is created
*/
event PoolAdded(uint256 poolIndex, Pool pool);
/**
* @dev Emitted when a pool is updated
*/
event PoolUpdated(uint256 poolIndex, Pool pool);
/**
* @dev Modifier that checks that the pool at index `poolIndex` is open
*/
modifier whenPoolOpened(uint256 poolIndex) {
require(poolIndex < poolsLength, "Poolable: Invalid poolIndex");
require(<FILL_ME>)
_;
}
/**
* @dev Modifier that checks that the now() - `depositDate` is above or equal to the min lock duration for pool at index `poolIndex`
*/
modifier whenUnlocked(uint256 poolIndex, uint256 depositDate) {
}
function getPool(uint256 poolIndex) public view returns (Pool memory) {
}
function addPool(Pool calldata pool) external onlyOwner {
}
function updatePool(uint256 poolIndex, Pool calldata pool)
external
onlyOwner
{
}
function isUnlocked(uint256 poolIndex, uint256 depositDate) internal view returns (bool) {
}
function isUnlockable(uint256 poolIndex, uint256 depositDate) internal view returns (bool) {
}
function isPoolOpened(uint256 poolIndex) public view returns (bool) {
}
}
| _pools[poolIndex].opened,"Poolable: Pool is closed" | 27,289 | _pools[poolIndex].opened |
"Poolable: Not unlocked" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
pragma abicoder v2;
import "@openzeppelin/contracts/access/Ownable.sol";
/** @title Poolable.
@dev This contract manage configuration of pools
*/
abstract contract Poolable is Ownable {
struct Pool {
uint256 lockDuration; // locked timespan
uint256 minDuration; // min deposit timespan
bool opened; // flag indicating if the pool is open
uint256 rewardAmount; // amount rewarded when lockDuration is reached
}
// pools mapping
uint256 public poolsLength;
mapping(uint256 => Pool) private _pools;
/**
* @dev Emitted when a pool is created
*/
event PoolAdded(uint256 poolIndex, Pool pool);
/**
* @dev Emitted when a pool is updated
*/
event PoolUpdated(uint256 poolIndex, Pool pool);
/**
* @dev Modifier that checks that the pool at index `poolIndex` is open
*/
modifier whenPoolOpened(uint256 poolIndex) {
}
/**
* @dev Modifier that checks that the now() - `depositDate` is above or equal to the min lock duration for pool at index `poolIndex`
*/
modifier whenUnlocked(uint256 poolIndex, uint256 depositDate) {
require(<FILL_ME>)
_;
}
function getPool(uint256 poolIndex) public view returns (Pool memory) {
}
function addPool(Pool calldata pool) external onlyOwner {
}
function updatePool(uint256 poolIndex, Pool calldata pool)
external
onlyOwner
{
}
function isUnlocked(uint256 poolIndex, uint256 depositDate) internal view returns (bool) {
}
function isUnlockable(uint256 poolIndex, uint256 depositDate) internal view returns (bool) {
}
function isPoolOpened(uint256 poolIndex) public view returns (bool) {
}
}
| isUnlocked(poolIndex,depositDate),"Poolable: Not unlocked" | 27,289 | isUnlocked(poolIndex,depositDate) |
null | pragma solidity ^0.4.21;
/**
* @title Proxy
* @dev Gives the possibility to delegate any call to a foreign implementation.
*/
contract Proxy {
/**
* @dev Tells the address of the implementation where every call will be delegated.
* @return address of the implementation to which it will be delegated
*/
function implementation() public view returns (address);
/**
* @dev Fallback function allowing to perform a delegatecall to the given implementation.
* This function will return whatever the implementation call returns
*/
function () payable public {
}
}
/**
* @title UpgradeabilityProxy
* @dev This contract represents a proxy where the implementation address to which it will delegate can be upgraded
*/
contract UpgradeabilityProxy is Proxy {
/**
* @dev This event will be emitted every time the implementation gets upgraded
* @param implementation representing the address of the upgraded implementation
*/
event Upgraded(address indexed implementation);
// Storage position of the address of the current implementation
bytes32 private constant implementationPosition = keccak256("org.zeppelinos.proxy.implementation");
/**
* @dev Constructor function
*/
function UpgradeabilityProxy() public {}
/**
* @dev Tells the address of the current implementation
* @return address of the current implementation
*/
function implementation() public view returns (address impl) {
}
/**
* @dev Sets the address of the current implementation
* @param newImplementation address representing the new implementation to be set
*/
function setImplementation(address newImplementation) internal {
}
/**
* @dev Upgrades the implementation address
* @param newImplementation representing the address of the new implementation to be set
*/
function _upgradeTo(address newImplementation) internal {
}
}
/**
* @title OwnedUpgradeabilityProxy
* @dev This contract combines an upgradeability proxy with basic authorization control functionalities
*/
contract OwnedUpgradeabilityProxy is UpgradeabilityProxy {
/**
* @dev Event to show ownership has been transferred
* @param previousOwner representing the address of the previous owner
* @param newOwner representing the address of the new owner
*/
event ProxyOwnershipTransferred(address previousOwner, address newOwner);
// Storage position of the owner of the contract
bytes32 private constant proxyOwnerPosition = keccak256("org.zeppelinos.proxy.owner");
/**
* @dev the constructor sets the original owner of the contract to the sender account.
*/
function OwnedUpgradeabilityProxy() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyProxyOwner() {
}
/**
* @dev Tells the address of the owner
* @return the address of the owner
*/
function proxyOwner() public view returns (address owner) {
}
/**
* @dev Sets the address of the owner
*/
function setUpgradeabilityOwner(address newProxyOwner) internal {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferProxyOwnership(address newOwner) public onlyProxyOwner {
}
/**
* @dev Allows the proxy owner to upgrade the current version of the proxy.
* @param implementation representing the address of the new implementation to be set.
*/
function upgradeTo(address implementation) public onlyProxyOwner {
}
/**
* @dev Allows the proxy owner to upgrade the current version of the proxy and call the new implementation
* to initialize whatever is needed through a low level call.
* @param implementation representing the address of the new implementation to be set.
* @param data represents the msg.data to bet sent in the low level call. This parameter may include the function
* signature of the implementation to be called with the needed payload
*/
function upgradeToAndCall(address implementation, bytes data) payable public onlyProxyOwner {
upgradeTo(implementation);
require(<FILL_ME>)
}
}
| this.call.value(msg.value)(data) | 27,443 | this.call.value(msg.value)(data) |
"Debt must be 0 for initialization" | pragma solidity 0.7.5;
interface ITreasury {
function deposit(address _principleTokenAddress, uint _amountPrincipleToken, uint _amountPayoutToken) external;
function valueOfToken( address _principalTokenAddress, uint _amount ) external view returns ( uint value_ );
function payoutToken() external view returns (address);
}
contract CustomALCXBond is Ownable {
using FixedPoint for *;
using SafeERC20 for IERC20;
using SafeMath for uint;
/* ======== EVENTS ======== */
event BondCreated( uint deposit, uint payout, uint expires );
event BondRedeemed( address recipient, uint payout, uint remaining );
event BondPriceChanged( uint internalPrice, uint debtRatio );
event ControlVariableAdjustment( uint initialBCV, uint newBCV, uint adjustment, bool addition );
/* ======== STATE VARIABLES ======== */
IERC20 immutable payoutToken; // token paid for principal
IERC20 immutable principalToken; // inflow token
ITreasury immutable customTreasury; // pays for and receives principal
address immutable olympusDAO;
address olympusTreasury; // receives fee
address immutable subsidyRouter; // pays subsidy in OHM to custom treasury
uint public totalPrincipalBonded;
uint public totalPayoutGiven;
uint public totalDebt; // total value of outstanding bonds; used for pricing
uint public lastDecay; // reference block for debt decay
uint payoutSinceLastSubsidy; // principal accrued since subsidy paid
Terms public terms; // stores terms for new bonds
Adjust public adjustment; // stores adjustment to BCV data
FeeTiers[] private feeTiers; // stores fee tiers
bool immutable private feeInPayout;
mapping( address => Bond ) public bondInfo; // stores bond information for depositors
/* ======== STRUCTS ======== */
struct FeeTiers {
uint tierCeilings; // principal bonded till next tier
uint fees; // in ten-thousandths (i.e. 33300 = 3.33%)
}
// Info for creating new bonds
struct Terms {
uint controlVariable; // scaling variable for price
uint vestingTerm; // in blocks
uint minimumPrice; // vs principal value
uint maxPayout; // in thousandths of a %. i.e. 500 = 0.5%
uint maxDebt; // payout token decimal debt ratio, max % total supply created as debt
}
// Info for bond holder
struct Bond {
uint payout; // payout token remaining to be paid
uint vesting; // Blocks left to vest
uint lastBlock; // Last interaction
uint truePricePaid; // Price paid (principal tokens per payout token) in ten-millionths - 4000000 = 0.4
}
// Info for incremental adjustments to control variable
struct Adjust {
bool add; // addition or subtraction
uint rate; // increment
uint target; // BCV when adjustment finished
uint buffer; // minimum length (in blocks) between adjustments
uint lastBlock; // block when last adjustment made
}
/* ======== CONSTRUCTOR ======== */
constructor(
address _customTreasury,
address _principalToken,
address _olympusTreasury,
address _subsidyRouter,
address _initialOwner,
address _olympusDAO,
uint[] memory _tierCeilings,
uint[] memory _fees,
bool _feeInPayout
) {
}
/* ======== INITIALIZATION ======== */
/**
* @notice initializes bond parameters
* @param _controlVariable uint
* @param _vestingTerm uint
* @param _minimumPrice uint
* @param _maxPayout uint
* @param _maxDebt uint
* @param _initialDebt uint
*/
function initializeBond(
uint _controlVariable,
uint _vestingTerm,
uint _minimumPrice,
uint _maxPayout,
uint _maxDebt,
uint _initialDebt
) external onlyPolicy() {
require(<FILL_ME>)
terms = Terms ({
controlVariable: _controlVariable,
vestingTerm: _vestingTerm,
minimumPrice: _minimumPrice,
maxPayout: _maxPayout,
maxDebt: _maxDebt
});
totalDebt = _initialDebt;
lastDecay = block.number;
}
/* ======== POLICY FUNCTIONS ======== */
enum PARAMETER { VESTING, PAYOUT, DEBT }
/**
* @notice set parameters for new bonds
* @param _parameter PARAMETER
* @param _input uint
*/
function setBondTerms ( PARAMETER _parameter, uint _input ) external onlyPolicy() {
}
/**
* @notice set control variable adjustment
* @param _addition bool
* @param _increment uint
* @param _target uint
* @param _buffer uint
*/
function setAdjustment (
bool _addition,
uint _increment,
uint _target,
uint _buffer
) external onlyPolicy() {
}
/**
* @notice change address of Olympus Treasury
* @param _olympusTreasury uint
*/
function changeOlympusTreasury(address _olympusTreasury) external {
}
/**
* @notice subsidy controller checks payouts since last subsidy and resets counter
* @return payoutSinceLastSubsidy_ uint
*/
function paySubsidy() external returns ( uint payoutSinceLastSubsidy_ ) {
}
/* ======== USER FUNCTIONS ======== */
/**
* @notice deposit bond
* @param _amount uint
* @param _maxPrice uint
* @param _depositor address
* @return uint
*/
function deposit(uint _amount, uint _maxPrice, address _depositor) external returns (uint) {
}
/**
* @notice redeem bond for user
* @return uint
*/
function redeem(address _depositor) external returns (uint) {
}
/* ======== INTERNAL HELPER FUNCTIONS ======== */
/**
* @notice makes incremental adjustment to control variable
*/
function adjust() internal {
}
/**
* @notice reduce total debt
*/
function decayDebt() internal {
}
/**
* @notice calculate current bond price and remove floor if above
* @return price_ uint
*/
function _bondPrice() internal returns ( uint price_ ) {
}
/* ======== VIEW FUNCTIONS ======== */
/**
* @notice calculate current bond premium
* @return price_ uint
*/
function bondPrice() public view returns ( uint price_ ) {
}
/**
* @notice calculate true bond price a user pays
* @return price_ uint
*/
function trueBondPrice() public view returns ( uint price_ ) {
}
/**
* @notice determine maximum bond size
* @return uint
*/
function maxPayout() public view returns ( uint ) {
}
/**
* @notice calculate user's interest due for new bond, accounting for Olympus Fee
* @param _value uint
* @return _payout uint
* @return _fee uint
*/
function payoutFor( uint _value ) public view returns ( uint _payout, uint _fee) {
}
/**
* @notice calculate current ratio of debt to payout token supply
* @notice protocols using Olympus Pro should be careful when quickly adding large %s to total supply
* @return debtRatio_ uint
*/
function debtRatio() public view returns ( uint debtRatio_ ) {
}
/**
* @notice calculate debt factoring in decay
* @return uint
*/
function currentDebt() public view returns ( uint ) {
}
/**
* @notice amount to decay total debt by
* @return decay_ uint
*/
function debtDecay() public view returns ( uint decay_ ) {
}
/**
* @notice calculate how far into vesting a depositor is
* @param _depositor address
* @return percentVested_ uint
*/
function percentVestedFor( address _depositor ) public view returns ( uint percentVested_ ) {
}
/**
* @notice calculate amount of payout token available for claim by depositor
* @param _depositor address
* @return pendingPayout_ uint
*/
function pendingPayoutFor( address _depositor ) external view returns ( uint pendingPayout_ ) {
}
/**
* @notice current fee Olympus takes of each bond
* @return currentFee_ uint
*/
function currentOlympusFee() public view returns( uint currentFee_ ) {
}
}
| currentDebt()==0,"Debt must be 0 for initialization" | 27,448 | currentDebt()==0 |
'not enough supply' | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "./IERC20UtilityToken.sol";
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
interface IRainiNft1155 is IERC1155 {
struct TokenVars {
uint128 cardId;
uint32 level;
uint32 number; // to assign a numbering to NFTs
bytes1 mintedContractChar;
}
function maxTokenId() external view returns (uint256);
function tokenVars(uint256 _tokenId) external view returns (TokenVars memory);
}
contract TLOLStakingPool is AccessControl, ERC1155Holder {
bytes32 public constant BURNER_ROLE = keccak256("BURNER_ROLE");
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
struct AccountRewardVars {
uint32 lastUpdated;
uint128 pointsBalance;
uint64 totalStaked;
}
mapping(address => AccountRewardVars) public accountRewardVars;
mapping(address => mapping(uint256 => uint256)) public stakedNFTs;
mapping(uint256 => uint256) public cardStakingValues;
uint256 public rewardEndTime;
uint256 public rewardRate;
address public nftContractAddress;
IERC20UtilityToken public rewardToken;
constructor(uint256 _rewardRate, uint256 _rewardEndTime, address _nftContractAddress, address rewardTokenAddress) {
}
modifier onlyOwner() {
}
modifier onlyBurner() {
}
modifier onlyMinter() {
}
function balanceUpdate(address _owner, uint256 _valueStakedDiff, bool isSubtracted) internal {
}
function getStaked(address _owner)
public view returns(uint256) {
}
function getStakedTokens(address _address, uint256 _cardCount)
external view returns (uint256[][] memory amounts) {
}
function balanceOf(address _owner)
public view returns(uint256) {
}
function setReward(uint256 _rewardRate)
external onlyOwner {
}
function setRewardEndTime(uint256 _rewardEndTime)
external onlyOwner {
}
function setCardStakingValues(uint256[] memory _cardIds, uint256[] memory _values)
external onlyOwner {
}
function lastTimeRewardApplicable() public view returns (uint256) {
}
function stake(uint256[] memory _tokenId, uint256[] memory _amount)
external {
}
function unstake(uint256[] memory _tokenId, uint256[] memory _amount)
external {
uint256 subtractedStakingValue = 0;
for (uint256 i = 0; i < _tokenId.length; i++) {
require(<FILL_ME>)
IRainiNft1155 tokenContract = IRainiNft1155(nftContractAddress);
uint128 cardId = tokenContract.tokenVars(_tokenId[i]).cardId;
subtractedStakingValue += cardStakingValues[cardId] * _amount[i];
tokenContract.safeTransferFrom(address(this), _msgSender(), _tokenId[i], _amount[i], bytes('0x0'));
stakedNFTs[_msgSender()][_tokenId[i]] -= _amount[i];
}
balanceUpdate(_msgSender(), subtractedStakingValue, true);
}
function mint(address[] calldata _addresses, uint256[] calldata _points)
external onlyMinter {
}
function burn(address _owner, uint256 _amount)
external onlyBurner {
}
function calculateReward(uint256 _amount, uint256 _duration)
private view returns(uint256) {
}
function withdrawReward(uint256 _amount)
external {
}
function supportsInterface(bytes4 interfaceId)
public virtual override(ERC1155Receiver, AccessControl) view returns (bool) {
}
}
| stakedNFTs[_msgSender()][_tokenId[i]]>=_amount[i],'not enough supply' | 27,498 | stakedNFTs[_msgSender()][_tokenId[i]]>=_amount[i] |
"relay manager not staked" | /* solhint-disable avoid-low-level-calls */
/* solhint-disable no-inline-assembly */
/* solhint-disable not-rely-on-time */
/* solhint-disable avoid-tx-origin */
/* solhint-disable bracket-align */
// SPDX-License-Identifier:MIT
pragma solidity ^0.6.9;
pragma experimental ABIEncoderV2;
import "./utils/MinLibBytes.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./utils/GsnUtils.sol";
import "./utils/GsnEip712Library.sol";
import "./interfaces/GsnTypes.sol";
import "./interfaces/IRelayHub.sol";
import "./interfaces/IPaymaster.sol";
import "./forwarder/IForwarder.sol";
import "./interfaces/IStakeManager.sol";
contract RelayHub is IRelayHub {
using SafeMath for uint256;
string public override versionHub = "2.0.0+opengsn.hub.irelayhub";
uint256 public override minimumStake;
uint256 public override minimumUnstakeDelay;
uint256 public override maximumRecipientDeposit;
uint256 public override gasOverhead;
uint256 public override postOverhead;
uint256 public override gasReserve;
uint256 public override maxWorkerCount;
IStakeManager override public stakeManager;
address override public penalizer;
// maps relay worker's address to its manager's address
mapping(address => address) public override workerToManager;
// maps relay managers to the number of their workers
mapping(address => uint256) public override workerCount;
mapping(address => uint256) private balances;
constructor (
IStakeManager _stakeManager,
address _penalizer,
uint256 _maxWorkerCount,
uint256 _gasReserve,
uint256 _postOverhead,
uint256 _gasOverhead,
uint256 _maximumRecipientDeposit,
uint256 _minimumUnstakeDelay,
uint256 _minimumStake
) public {
}
function registerRelayServer(uint256 baseRelayFee, uint256 pctRelayFee, string calldata url) external override {
address relayManager = msg.sender;
require(<FILL_ME>)
require(workerCount[relayManager] > 0, "no relay workers");
emit RelayServerRegistered(relayManager, baseRelayFee, pctRelayFee, url);
}
function addRelayWorkers(address[] calldata newRelayWorkers) external override {
}
function depositFor(address target) public override payable {
}
function balanceOf(address target) external override view returns (uint256) {
}
function withdraw(uint256 amount, address payable dest) public override {
}
function verifyGasLimits(
uint256 paymasterMaxAcceptanceBudget,
GsnTypes.RelayRequest calldata relayRequest,
uint256 initialGas
)
private
view
returns (IPaymaster.GasLimits memory gasLimits, uint256 maxPossibleGas) {
}
struct RelayCallData {
bool success;
bytes4 functionSelector;
bytes recipientContext;
bytes relayedCallReturnValue;
IPaymaster.GasLimits gasLimits;
RelayCallStatus status;
uint256 innerGasUsed;
uint256 maxPossibleGas;
uint256 gasBeforeInner;
bytes retData;
}
function relayCall(
uint paymasterMaxAcceptanceBudget,
GsnTypes.RelayRequest calldata relayRequest,
bytes calldata signature,
bytes calldata approvalData,
uint externalGasLimit
)
external
override
returns (bool paymasterAccepted, bytes memory returnValue)
{
}
struct InnerRelayCallData {
uint256 balanceBefore;
bytes32 preReturnValue;
bool relayedCallSuccess;
bytes relayedCallReturnValue;
bytes recipientContext;
bytes data;
bool rejectOnRecipientRevert;
}
function innerRelayCall(
GsnTypes.RelayRequest calldata relayRequest,
bytes calldata signature,
bytes calldata approvalData,
IPaymaster.GasLimits calldata gasLimits,
uint256 totalInitialGas,
uint256 maxPossibleGas
)
external
returns (RelayCallStatus, bytes memory)
{
}
/**
* @dev Reverts the transaction with return data set to the ABI encoding of the status argument (and revert reason data)
*/
function revertWithStatus(RelayCallStatus status, bytes memory ret) private pure {
}
function calculateCharge(uint256 gasUsed, GsnTypes.RelayData calldata relayData) public override virtual view returns (uint256) {
}
function isRelayManagerStaked(address relayManager) public override view returns (bool) {
}
modifier penalizerOnly () {
}
function penalize(address relayWorker, address payable beneficiary) external override penalizerOnly {
}
}
| isRelayManagerStaked(relayManager),"relay manager not staked" | 27,506 | isRelayManagerStaked(relayManager) |
"no relay workers" | /* solhint-disable avoid-low-level-calls */
/* solhint-disable no-inline-assembly */
/* solhint-disable not-rely-on-time */
/* solhint-disable avoid-tx-origin */
/* solhint-disable bracket-align */
// SPDX-License-Identifier:MIT
pragma solidity ^0.6.9;
pragma experimental ABIEncoderV2;
import "./utils/MinLibBytes.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./utils/GsnUtils.sol";
import "./utils/GsnEip712Library.sol";
import "./interfaces/GsnTypes.sol";
import "./interfaces/IRelayHub.sol";
import "./interfaces/IPaymaster.sol";
import "./forwarder/IForwarder.sol";
import "./interfaces/IStakeManager.sol";
contract RelayHub is IRelayHub {
using SafeMath for uint256;
string public override versionHub = "2.0.0+opengsn.hub.irelayhub";
uint256 public override minimumStake;
uint256 public override minimumUnstakeDelay;
uint256 public override maximumRecipientDeposit;
uint256 public override gasOverhead;
uint256 public override postOverhead;
uint256 public override gasReserve;
uint256 public override maxWorkerCount;
IStakeManager override public stakeManager;
address override public penalizer;
// maps relay worker's address to its manager's address
mapping(address => address) public override workerToManager;
// maps relay managers to the number of their workers
mapping(address => uint256) public override workerCount;
mapping(address => uint256) private balances;
constructor (
IStakeManager _stakeManager,
address _penalizer,
uint256 _maxWorkerCount,
uint256 _gasReserve,
uint256 _postOverhead,
uint256 _gasOverhead,
uint256 _maximumRecipientDeposit,
uint256 _minimumUnstakeDelay,
uint256 _minimumStake
) public {
}
function registerRelayServer(uint256 baseRelayFee, uint256 pctRelayFee, string calldata url) external override {
address relayManager = msg.sender;
require(
isRelayManagerStaked(relayManager),
"relay manager not staked"
);
require(<FILL_ME>)
emit RelayServerRegistered(relayManager, baseRelayFee, pctRelayFee, url);
}
function addRelayWorkers(address[] calldata newRelayWorkers) external override {
}
function depositFor(address target) public override payable {
}
function balanceOf(address target) external override view returns (uint256) {
}
function withdraw(uint256 amount, address payable dest) public override {
}
function verifyGasLimits(
uint256 paymasterMaxAcceptanceBudget,
GsnTypes.RelayRequest calldata relayRequest,
uint256 initialGas
)
private
view
returns (IPaymaster.GasLimits memory gasLimits, uint256 maxPossibleGas) {
}
struct RelayCallData {
bool success;
bytes4 functionSelector;
bytes recipientContext;
bytes relayedCallReturnValue;
IPaymaster.GasLimits gasLimits;
RelayCallStatus status;
uint256 innerGasUsed;
uint256 maxPossibleGas;
uint256 gasBeforeInner;
bytes retData;
}
function relayCall(
uint paymasterMaxAcceptanceBudget,
GsnTypes.RelayRequest calldata relayRequest,
bytes calldata signature,
bytes calldata approvalData,
uint externalGasLimit
)
external
override
returns (bool paymasterAccepted, bytes memory returnValue)
{
}
struct InnerRelayCallData {
uint256 balanceBefore;
bytes32 preReturnValue;
bool relayedCallSuccess;
bytes relayedCallReturnValue;
bytes recipientContext;
bytes data;
bool rejectOnRecipientRevert;
}
function innerRelayCall(
GsnTypes.RelayRequest calldata relayRequest,
bytes calldata signature,
bytes calldata approvalData,
IPaymaster.GasLimits calldata gasLimits,
uint256 totalInitialGas,
uint256 maxPossibleGas
)
external
returns (RelayCallStatus, bytes memory)
{
}
/**
* @dev Reverts the transaction with return data set to the ABI encoding of the status argument (and revert reason data)
*/
function revertWithStatus(RelayCallStatus status, bytes memory ret) private pure {
}
function calculateCharge(uint256 gasUsed, GsnTypes.RelayData calldata relayData) public override virtual view returns (uint256) {
}
function isRelayManagerStaked(address relayManager) public override view returns (bool) {
}
modifier penalizerOnly () {
}
function penalize(address relayWorker, address payable beneficiary) external override penalizerOnly {
}
}
| workerCount[relayManager]>0,"no relay workers" | 27,506 | workerCount[relayManager]>0 |
"too many workers" | /* solhint-disable avoid-low-level-calls */
/* solhint-disable no-inline-assembly */
/* solhint-disable not-rely-on-time */
/* solhint-disable avoid-tx-origin */
/* solhint-disable bracket-align */
// SPDX-License-Identifier:MIT
pragma solidity ^0.6.9;
pragma experimental ABIEncoderV2;
import "./utils/MinLibBytes.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./utils/GsnUtils.sol";
import "./utils/GsnEip712Library.sol";
import "./interfaces/GsnTypes.sol";
import "./interfaces/IRelayHub.sol";
import "./interfaces/IPaymaster.sol";
import "./forwarder/IForwarder.sol";
import "./interfaces/IStakeManager.sol";
contract RelayHub is IRelayHub {
using SafeMath for uint256;
string public override versionHub = "2.0.0+opengsn.hub.irelayhub";
uint256 public override minimumStake;
uint256 public override minimumUnstakeDelay;
uint256 public override maximumRecipientDeposit;
uint256 public override gasOverhead;
uint256 public override postOverhead;
uint256 public override gasReserve;
uint256 public override maxWorkerCount;
IStakeManager override public stakeManager;
address override public penalizer;
// maps relay worker's address to its manager's address
mapping(address => address) public override workerToManager;
// maps relay managers to the number of their workers
mapping(address => uint256) public override workerCount;
mapping(address => uint256) private balances;
constructor (
IStakeManager _stakeManager,
address _penalizer,
uint256 _maxWorkerCount,
uint256 _gasReserve,
uint256 _postOverhead,
uint256 _gasOverhead,
uint256 _maximumRecipientDeposit,
uint256 _minimumUnstakeDelay,
uint256 _minimumStake
) public {
}
function registerRelayServer(uint256 baseRelayFee, uint256 pctRelayFee, string calldata url) external override {
}
function addRelayWorkers(address[] calldata newRelayWorkers) external override {
address relayManager = msg.sender;
workerCount[relayManager] = workerCount[relayManager] + newRelayWorkers.length;
require(<FILL_ME>)
require(
isRelayManagerStaked(relayManager),
"relay manager not staked"
);
for (uint256 i = 0; i < newRelayWorkers.length; i++) {
require(workerToManager[newRelayWorkers[i]] == address(0), "this worker has a manager");
workerToManager[newRelayWorkers[i]] = relayManager;
}
emit RelayWorkersAdded(relayManager, newRelayWorkers, workerCount[relayManager]);
}
function depositFor(address target) public override payable {
}
function balanceOf(address target) external override view returns (uint256) {
}
function withdraw(uint256 amount, address payable dest) public override {
}
function verifyGasLimits(
uint256 paymasterMaxAcceptanceBudget,
GsnTypes.RelayRequest calldata relayRequest,
uint256 initialGas
)
private
view
returns (IPaymaster.GasLimits memory gasLimits, uint256 maxPossibleGas) {
}
struct RelayCallData {
bool success;
bytes4 functionSelector;
bytes recipientContext;
bytes relayedCallReturnValue;
IPaymaster.GasLimits gasLimits;
RelayCallStatus status;
uint256 innerGasUsed;
uint256 maxPossibleGas;
uint256 gasBeforeInner;
bytes retData;
}
function relayCall(
uint paymasterMaxAcceptanceBudget,
GsnTypes.RelayRequest calldata relayRequest,
bytes calldata signature,
bytes calldata approvalData,
uint externalGasLimit
)
external
override
returns (bool paymasterAccepted, bytes memory returnValue)
{
}
struct InnerRelayCallData {
uint256 balanceBefore;
bytes32 preReturnValue;
bool relayedCallSuccess;
bytes relayedCallReturnValue;
bytes recipientContext;
bytes data;
bool rejectOnRecipientRevert;
}
function innerRelayCall(
GsnTypes.RelayRequest calldata relayRequest,
bytes calldata signature,
bytes calldata approvalData,
IPaymaster.GasLimits calldata gasLimits,
uint256 totalInitialGas,
uint256 maxPossibleGas
)
external
returns (RelayCallStatus, bytes memory)
{
}
/**
* @dev Reverts the transaction with return data set to the ABI encoding of the status argument (and revert reason data)
*/
function revertWithStatus(RelayCallStatus status, bytes memory ret) private pure {
}
function calculateCharge(uint256 gasUsed, GsnTypes.RelayData calldata relayData) public override virtual view returns (uint256) {
}
function isRelayManagerStaked(address relayManager) public override view returns (bool) {
}
modifier penalizerOnly () {
}
function penalize(address relayWorker, address payable beneficiary) external override penalizerOnly {
}
}
| workerCount[relayManager]<=maxWorkerCount,"too many workers" | 27,506 | workerCount[relayManager]<=maxWorkerCount |
"this worker has a manager" | /* solhint-disable avoid-low-level-calls */
/* solhint-disable no-inline-assembly */
/* solhint-disable not-rely-on-time */
/* solhint-disable avoid-tx-origin */
/* solhint-disable bracket-align */
// SPDX-License-Identifier:MIT
pragma solidity ^0.6.9;
pragma experimental ABIEncoderV2;
import "./utils/MinLibBytes.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./utils/GsnUtils.sol";
import "./utils/GsnEip712Library.sol";
import "./interfaces/GsnTypes.sol";
import "./interfaces/IRelayHub.sol";
import "./interfaces/IPaymaster.sol";
import "./forwarder/IForwarder.sol";
import "./interfaces/IStakeManager.sol";
contract RelayHub is IRelayHub {
using SafeMath for uint256;
string public override versionHub = "2.0.0+opengsn.hub.irelayhub";
uint256 public override minimumStake;
uint256 public override minimumUnstakeDelay;
uint256 public override maximumRecipientDeposit;
uint256 public override gasOverhead;
uint256 public override postOverhead;
uint256 public override gasReserve;
uint256 public override maxWorkerCount;
IStakeManager override public stakeManager;
address override public penalizer;
// maps relay worker's address to its manager's address
mapping(address => address) public override workerToManager;
// maps relay managers to the number of their workers
mapping(address => uint256) public override workerCount;
mapping(address => uint256) private balances;
constructor (
IStakeManager _stakeManager,
address _penalizer,
uint256 _maxWorkerCount,
uint256 _gasReserve,
uint256 _postOverhead,
uint256 _gasOverhead,
uint256 _maximumRecipientDeposit,
uint256 _minimumUnstakeDelay,
uint256 _minimumStake
) public {
}
function registerRelayServer(uint256 baseRelayFee, uint256 pctRelayFee, string calldata url) external override {
}
function addRelayWorkers(address[] calldata newRelayWorkers) external override {
address relayManager = msg.sender;
workerCount[relayManager] = workerCount[relayManager] + newRelayWorkers.length;
require(workerCount[relayManager] <= maxWorkerCount, "too many workers");
require(
isRelayManagerStaked(relayManager),
"relay manager not staked"
);
for (uint256 i = 0; i < newRelayWorkers.length; i++) {
require(<FILL_ME>)
workerToManager[newRelayWorkers[i]] = relayManager;
}
emit RelayWorkersAdded(relayManager, newRelayWorkers, workerCount[relayManager]);
}
function depositFor(address target) public override payable {
}
function balanceOf(address target) external override view returns (uint256) {
}
function withdraw(uint256 amount, address payable dest) public override {
}
function verifyGasLimits(
uint256 paymasterMaxAcceptanceBudget,
GsnTypes.RelayRequest calldata relayRequest,
uint256 initialGas
)
private
view
returns (IPaymaster.GasLimits memory gasLimits, uint256 maxPossibleGas) {
}
struct RelayCallData {
bool success;
bytes4 functionSelector;
bytes recipientContext;
bytes relayedCallReturnValue;
IPaymaster.GasLimits gasLimits;
RelayCallStatus status;
uint256 innerGasUsed;
uint256 maxPossibleGas;
uint256 gasBeforeInner;
bytes retData;
}
function relayCall(
uint paymasterMaxAcceptanceBudget,
GsnTypes.RelayRequest calldata relayRequest,
bytes calldata signature,
bytes calldata approvalData,
uint externalGasLimit
)
external
override
returns (bool paymasterAccepted, bytes memory returnValue)
{
}
struct InnerRelayCallData {
uint256 balanceBefore;
bytes32 preReturnValue;
bool relayedCallSuccess;
bytes relayedCallReturnValue;
bytes recipientContext;
bytes data;
bool rejectOnRecipientRevert;
}
function innerRelayCall(
GsnTypes.RelayRequest calldata relayRequest,
bytes calldata signature,
bytes calldata approvalData,
IPaymaster.GasLimits calldata gasLimits,
uint256 totalInitialGas,
uint256 maxPossibleGas
)
external
returns (RelayCallStatus, bytes memory)
{
}
/**
* @dev Reverts the transaction with return data set to the ABI encoding of the status argument (and revert reason data)
*/
function revertWithStatus(RelayCallStatus status, bytes memory ret) private pure {
}
function calculateCharge(uint256 gasUsed, GsnTypes.RelayData calldata relayData) public override virtual view returns (uint256) {
}
function isRelayManagerStaked(address relayManager) public override view returns (bool) {
}
modifier penalizerOnly () {
}
function penalize(address relayWorker, address payable beneficiary) external override penalizerOnly {
}
}
| workerToManager[newRelayWorkers[i]]==address(0),"this worker has a manager" | 27,506 | workerToManager[newRelayWorkers[i]]==address(0) |
"insufficient funds" | /* solhint-disable avoid-low-level-calls */
/* solhint-disable no-inline-assembly */
/* solhint-disable not-rely-on-time */
/* solhint-disable avoid-tx-origin */
/* solhint-disable bracket-align */
// SPDX-License-Identifier:MIT
pragma solidity ^0.6.9;
pragma experimental ABIEncoderV2;
import "./utils/MinLibBytes.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./utils/GsnUtils.sol";
import "./utils/GsnEip712Library.sol";
import "./interfaces/GsnTypes.sol";
import "./interfaces/IRelayHub.sol";
import "./interfaces/IPaymaster.sol";
import "./forwarder/IForwarder.sol";
import "./interfaces/IStakeManager.sol";
contract RelayHub is IRelayHub {
using SafeMath for uint256;
string public override versionHub = "2.0.0+opengsn.hub.irelayhub";
uint256 public override minimumStake;
uint256 public override minimumUnstakeDelay;
uint256 public override maximumRecipientDeposit;
uint256 public override gasOverhead;
uint256 public override postOverhead;
uint256 public override gasReserve;
uint256 public override maxWorkerCount;
IStakeManager override public stakeManager;
address override public penalizer;
// maps relay worker's address to its manager's address
mapping(address => address) public override workerToManager;
// maps relay managers to the number of their workers
mapping(address => uint256) public override workerCount;
mapping(address => uint256) private balances;
constructor (
IStakeManager _stakeManager,
address _penalizer,
uint256 _maxWorkerCount,
uint256 _gasReserve,
uint256 _postOverhead,
uint256 _gasOverhead,
uint256 _maximumRecipientDeposit,
uint256 _minimumUnstakeDelay,
uint256 _minimumStake
) public {
}
function registerRelayServer(uint256 baseRelayFee, uint256 pctRelayFee, string calldata url) external override {
}
function addRelayWorkers(address[] calldata newRelayWorkers) external override {
}
function depositFor(address target) public override payable {
}
function balanceOf(address target) external override view returns (uint256) {
}
function withdraw(uint256 amount, address payable dest) public override {
address payable account = msg.sender;
require(<FILL_ME>)
balances[account] = balances[account].sub(amount);
dest.transfer(amount);
emit Withdrawn(account, dest, amount);
}
function verifyGasLimits(
uint256 paymasterMaxAcceptanceBudget,
GsnTypes.RelayRequest calldata relayRequest,
uint256 initialGas
)
private
view
returns (IPaymaster.GasLimits memory gasLimits, uint256 maxPossibleGas) {
}
struct RelayCallData {
bool success;
bytes4 functionSelector;
bytes recipientContext;
bytes relayedCallReturnValue;
IPaymaster.GasLimits gasLimits;
RelayCallStatus status;
uint256 innerGasUsed;
uint256 maxPossibleGas;
uint256 gasBeforeInner;
bytes retData;
}
function relayCall(
uint paymasterMaxAcceptanceBudget,
GsnTypes.RelayRequest calldata relayRequest,
bytes calldata signature,
bytes calldata approvalData,
uint externalGasLimit
)
external
override
returns (bool paymasterAccepted, bytes memory returnValue)
{
}
struct InnerRelayCallData {
uint256 balanceBefore;
bytes32 preReturnValue;
bool relayedCallSuccess;
bytes relayedCallReturnValue;
bytes recipientContext;
bytes data;
bool rejectOnRecipientRevert;
}
function innerRelayCall(
GsnTypes.RelayRequest calldata relayRequest,
bytes calldata signature,
bytes calldata approvalData,
IPaymaster.GasLimits calldata gasLimits,
uint256 totalInitialGas,
uint256 maxPossibleGas
)
external
returns (RelayCallStatus, bytes memory)
{
}
/**
* @dev Reverts the transaction with return data set to the ABI encoding of the status argument (and revert reason data)
*/
function revertWithStatus(RelayCallStatus status, bytes memory ret) private pure {
}
function calculateCharge(uint256 gasUsed, GsnTypes.RelayData calldata relayData) public override virtual view returns (uint256) {
}
function isRelayManagerStaked(address relayManager) public override view returns (bool) {
}
modifier penalizerOnly () {
}
function penalize(address relayWorker, address payable beneficiary) external override penalizerOnly {
}
}
| balances[account]>=amount,"insufficient funds" | 27,506 | balances[account]>=amount |
"Unknown relay worker" | /* solhint-disable avoid-low-level-calls */
/* solhint-disable no-inline-assembly */
/* solhint-disable not-rely-on-time */
/* solhint-disable avoid-tx-origin */
/* solhint-disable bracket-align */
// SPDX-License-Identifier:MIT
pragma solidity ^0.6.9;
pragma experimental ABIEncoderV2;
import "./utils/MinLibBytes.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./utils/GsnUtils.sol";
import "./utils/GsnEip712Library.sol";
import "./interfaces/GsnTypes.sol";
import "./interfaces/IRelayHub.sol";
import "./interfaces/IPaymaster.sol";
import "./forwarder/IForwarder.sol";
import "./interfaces/IStakeManager.sol";
contract RelayHub is IRelayHub {
using SafeMath for uint256;
string public override versionHub = "2.0.0+opengsn.hub.irelayhub";
uint256 public override minimumStake;
uint256 public override minimumUnstakeDelay;
uint256 public override maximumRecipientDeposit;
uint256 public override gasOverhead;
uint256 public override postOverhead;
uint256 public override gasReserve;
uint256 public override maxWorkerCount;
IStakeManager override public stakeManager;
address override public penalizer;
// maps relay worker's address to its manager's address
mapping(address => address) public override workerToManager;
// maps relay managers to the number of their workers
mapping(address => uint256) public override workerCount;
mapping(address => uint256) private balances;
constructor (
IStakeManager _stakeManager,
address _penalizer,
uint256 _maxWorkerCount,
uint256 _gasReserve,
uint256 _postOverhead,
uint256 _gasOverhead,
uint256 _maximumRecipientDeposit,
uint256 _minimumUnstakeDelay,
uint256 _minimumStake
) public {
}
function registerRelayServer(uint256 baseRelayFee, uint256 pctRelayFee, string calldata url) external override {
}
function addRelayWorkers(address[] calldata newRelayWorkers) external override {
}
function depositFor(address target) public override payable {
}
function balanceOf(address target) external override view returns (uint256) {
}
function withdraw(uint256 amount, address payable dest) public override {
}
function verifyGasLimits(
uint256 paymasterMaxAcceptanceBudget,
GsnTypes.RelayRequest calldata relayRequest,
uint256 initialGas
)
private
view
returns (IPaymaster.GasLimits memory gasLimits, uint256 maxPossibleGas) {
}
struct RelayCallData {
bool success;
bytes4 functionSelector;
bytes recipientContext;
bytes relayedCallReturnValue;
IPaymaster.GasLimits gasLimits;
RelayCallStatus status;
uint256 innerGasUsed;
uint256 maxPossibleGas;
uint256 gasBeforeInner;
bytes retData;
}
function relayCall(
uint paymasterMaxAcceptanceBudget,
GsnTypes.RelayRequest calldata relayRequest,
bytes calldata signature,
bytes calldata approvalData,
uint externalGasLimit
)
external
override
returns (bool paymasterAccepted, bytes memory returnValue)
{
(signature);
RelayCallData memory vars;
vars.functionSelector = MinLibBytes.readBytes4(relayRequest.request.data, 0);
require(msg.sender == tx.origin, "relay worker cannot be a smart contract");
require(<FILL_ME>)
require(relayRequest.relayData.relayWorker == msg.sender, "Not a right worker");
require(
isRelayManagerStaked(workerToManager[msg.sender]),
"relay manager not staked"
);
require(relayRequest.relayData.gasPrice <= tx.gasprice, "Invalid gas price");
require(externalGasLimit <= block.gaslimit, "Impossible gas limit");
(vars.gasLimits, vars.maxPossibleGas) =
verifyGasLimits(paymasterMaxAcceptanceBudget, relayRequest, externalGasLimit);
{
//How much gas to pass down to innerRelayCall. must be lower than the default 63/64
// actually, min(gasleft*63/64, gasleft-GAS_RESERVE) might be enough.
uint256 innerGasLimit = gasleft()*63/64-gasReserve;
vars.gasBeforeInner = gasleft();
uint256 _tmpInitialGas = innerGasLimit + externalGasLimit + gasOverhead + postOverhead;
// Calls to the recipient are performed atomically inside an inner transaction which may revert in case of
// errors in the recipient. In either case (revert or regular execution) the return data encodes the
// RelayCallStatus value.
(bool success, bytes memory relayCallStatus) = address(this).call{gas:innerGasLimit}(
abi.encodeWithSelector(RelayHub.innerRelayCall.selector, relayRequest, signature, approvalData, vars.gasLimits,
_tmpInitialGas - gasleft(),
vars.maxPossibleGas
)
);
vars.success = success;
vars.innerGasUsed = vars.gasBeforeInner-gasleft();
(vars.status, vars.relayedCallReturnValue) = abi.decode(relayCallStatus, (RelayCallStatus, bytes));
if ( vars.relayedCallReturnValue.length>0 ) {
emit TransactionResult(vars.status, vars.relayedCallReturnValue);
}
}
{
if (!vars.success) {
//Failure cases where the PM doesn't pay
if ( (vars.innerGasUsed < vars.gasLimits.acceptanceBudget ) && (
vars.status == RelayCallStatus.RejectedByPreRelayed ||
vars.status == RelayCallStatus.RejectedByForwarder ||
vars.status == RelayCallStatus.RejectedByRecipientRevert //can only be thrown if rejectOnRecipientRevert==true
)) {
paymasterAccepted=false;
emit TransactionRejectedByPaymaster(
workerToManager[msg.sender],
relayRequest.relayData.paymaster,
relayRequest.request.from,
relayRequest.request.to,
msg.sender,
vars.functionSelector,
vars.innerGasUsed,
vars.relayedCallReturnValue);
return (false, vars.relayedCallReturnValue);
}
}
// We now perform the actual charge calculation, based on the measured gas used
uint256 gasUsed = (externalGasLimit - gasleft()) + gasOverhead;
uint256 charge = calculateCharge(gasUsed, relayRequest.relayData);
balances[relayRequest.relayData.paymaster] = balances[relayRequest.relayData.paymaster].sub(charge);
balances[workerToManager[msg.sender]] = balances[workerToManager[msg.sender]].add(charge);
emit TransactionRelayed(
workerToManager[msg.sender],
msg.sender,
relayRequest.request.from,
relayRequest.request.to,
relayRequest.relayData.paymaster,
vars.functionSelector,
vars.status,
charge);
return (true, "");
}
}
struct InnerRelayCallData {
uint256 balanceBefore;
bytes32 preReturnValue;
bool relayedCallSuccess;
bytes relayedCallReturnValue;
bytes recipientContext;
bytes data;
bool rejectOnRecipientRevert;
}
function innerRelayCall(
GsnTypes.RelayRequest calldata relayRequest,
bytes calldata signature,
bytes calldata approvalData,
IPaymaster.GasLimits calldata gasLimits,
uint256 totalInitialGas,
uint256 maxPossibleGas
)
external
returns (RelayCallStatus, bytes memory)
{
}
/**
* @dev Reverts the transaction with return data set to the ABI encoding of the status argument (and revert reason data)
*/
function revertWithStatus(RelayCallStatus status, bytes memory ret) private pure {
}
function calculateCharge(uint256 gasUsed, GsnTypes.RelayData calldata relayData) public override virtual view returns (uint256) {
}
function isRelayManagerStaked(address relayManager) public override view returns (bool) {
}
modifier penalizerOnly () {
}
function penalize(address relayWorker, address payable beneficiary) external override penalizerOnly {
}
}
| workerToManager[msg.sender]!=address(0),"Unknown relay worker" | 27,506 | workerToManager[msg.sender]!=address(0) |
"relay manager not staked" | /* solhint-disable avoid-low-level-calls */
/* solhint-disable no-inline-assembly */
/* solhint-disable not-rely-on-time */
/* solhint-disable avoid-tx-origin */
/* solhint-disable bracket-align */
// SPDX-License-Identifier:MIT
pragma solidity ^0.6.9;
pragma experimental ABIEncoderV2;
import "./utils/MinLibBytes.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "./utils/GsnUtils.sol";
import "./utils/GsnEip712Library.sol";
import "./interfaces/GsnTypes.sol";
import "./interfaces/IRelayHub.sol";
import "./interfaces/IPaymaster.sol";
import "./forwarder/IForwarder.sol";
import "./interfaces/IStakeManager.sol";
contract RelayHub is IRelayHub {
using SafeMath for uint256;
string public override versionHub = "2.0.0+opengsn.hub.irelayhub";
uint256 public override minimumStake;
uint256 public override minimumUnstakeDelay;
uint256 public override maximumRecipientDeposit;
uint256 public override gasOverhead;
uint256 public override postOverhead;
uint256 public override gasReserve;
uint256 public override maxWorkerCount;
IStakeManager override public stakeManager;
address override public penalizer;
// maps relay worker's address to its manager's address
mapping(address => address) public override workerToManager;
// maps relay managers to the number of their workers
mapping(address => uint256) public override workerCount;
mapping(address => uint256) private balances;
constructor (
IStakeManager _stakeManager,
address _penalizer,
uint256 _maxWorkerCount,
uint256 _gasReserve,
uint256 _postOverhead,
uint256 _gasOverhead,
uint256 _maximumRecipientDeposit,
uint256 _minimumUnstakeDelay,
uint256 _minimumStake
) public {
}
function registerRelayServer(uint256 baseRelayFee, uint256 pctRelayFee, string calldata url) external override {
}
function addRelayWorkers(address[] calldata newRelayWorkers) external override {
}
function depositFor(address target) public override payable {
}
function balanceOf(address target) external override view returns (uint256) {
}
function withdraw(uint256 amount, address payable dest) public override {
}
function verifyGasLimits(
uint256 paymasterMaxAcceptanceBudget,
GsnTypes.RelayRequest calldata relayRequest,
uint256 initialGas
)
private
view
returns (IPaymaster.GasLimits memory gasLimits, uint256 maxPossibleGas) {
}
struct RelayCallData {
bool success;
bytes4 functionSelector;
bytes recipientContext;
bytes relayedCallReturnValue;
IPaymaster.GasLimits gasLimits;
RelayCallStatus status;
uint256 innerGasUsed;
uint256 maxPossibleGas;
uint256 gasBeforeInner;
bytes retData;
}
function relayCall(
uint paymasterMaxAcceptanceBudget,
GsnTypes.RelayRequest calldata relayRequest,
bytes calldata signature,
bytes calldata approvalData,
uint externalGasLimit
)
external
override
returns (bool paymasterAccepted, bytes memory returnValue)
{
(signature);
RelayCallData memory vars;
vars.functionSelector = MinLibBytes.readBytes4(relayRequest.request.data, 0);
require(msg.sender == tx.origin, "relay worker cannot be a smart contract");
require(workerToManager[msg.sender] != address(0), "Unknown relay worker");
require(relayRequest.relayData.relayWorker == msg.sender, "Not a right worker");
require(<FILL_ME>)
require(relayRequest.relayData.gasPrice <= tx.gasprice, "Invalid gas price");
require(externalGasLimit <= block.gaslimit, "Impossible gas limit");
(vars.gasLimits, vars.maxPossibleGas) =
verifyGasLimits(paymasterMaxAcceptanceBudget, relayRequest, externalGasLimit);
{
//How much gas to pass down to innerRelayCall. must be lower than the default 63/64
// actually, min(gasleft*63/64, gasleft-GAS_RESERVE) might be enough.
uint256 innerGasLimit = gasleft()*63/64-gasReserve;
vars.gasBeforeInner = gasleft();
uint256 _tmpInitialGas = innerGasLimit + externalGasLimit + gasOverhead + postOverhead;
// Calls to the recipient are performed atomically inside an inner transaction which may revert in case of
// errors in the recipient. In either case (revert or regular execution) the return data encodes the
// RelayCallStatus value.
(bool success, bytes memory relayCallStatus) = address(this).call{gas:innerGasLimit}(
abi.encodeWithSelector(RelayHub.innerRelayCall.selector, relayRequest, signature, approvalData, vars.gasLimits,
_tmpInitialGas - gasleft(),
vars.maxPossibleGas
)
);
vars.success = success;
vars.innerGasUsed = vars.gasBeforeInner-gasleft();
(vars.status, vars.relayedCallReturnValue) = abi.decode(relayCallStatus, (RelayCallStatus, bytes));
if ( vars.relayedCallReturnValue.length>0 ) {
emit TransactionResult(vars.status, vars.relayedCallReturnValue);
}
}
{
if (!vars.success) {
//Failure cases where the PM doesn't pay
if ( (vars.innerGasUsed < vars.gasLimits.acceptanceBudget ) && (
vars.status == RelayCallStatus.RejectedByPreRelayed ||
vars.status == RelayCallStatus.RejectedByForwarder ||
vars.status == RelayCallStatus.RejectedByRecipientRevert //can only be thrown if rejectOnRecipientRevert==true
)) {
paymasterAccepted=false;
emit TransactionRejectedByPaymaster(
workerToManager[msg.sender],
relayRequest.relayData.paymaster,
relayRequest.request.from,
relayRequest.request.to,
msg.sender,
vars.functionSelector,
vars.innerGasUsed,
vars.relayedCallReturnValue);
return (false, vars.relayedCallReturnValue);
}
}
// We now perform the actual charge calculation, based on the measured gas used
uint256 gasUsed = (externalGasLimit - gasleft()) + gasOverhead;
uint256 charge = calculateCharge(gasUsed, relayRequest.relayData);
balances[relayRequest.relayData.paymaster] = balances[relayRequest.relayData.paymaster].sub(charge);
balances[workerToManager[msg.sender]] = balances[workerToManager[msg.sender]].add(charge);
emit TransactionRelayed(
workerToManager[msg.sender],
msg.sender,
relayRequest.request.from,
relayRequest.request.to,
relayRequest.relayData.paymaster,
vars.functionSelector,
vars.status,
charge);
return (true, "");
}
}
struct InnerRelayCallData {
uint256 balanceBefore;
bytes32 preReturnValue;
bool relayedCallSuccess;
bytes relayedCallReturnValue;
bytes recipientContext;
bytes data;
bool rejectOnRecipientRevert;
}
function innerRelayCall(
GsnTypes.RelayRequest calldata relayRequest,
bytes calldata signature,
bytes calldata approvalData,
IPaymaster.GasLimits calldata gasLimits,
uint256 totalInitialGas,
uint256 maxPossibleGas
)
external
returns (RelayCallStatus, bytes memory)
{
}
/**
* @dev Reverts the transaction with return data set to the ABI encoding of the status argument (and revert reason data)
*/
function revertWithStatus(RelayCallStatus status, bytes memory ret) private pure {
}
function calculateCharge(uint256 gasUsed, GsnTypes.RelayData calldata relayData) public override virtual view returns (uint256) {
}
function isRelayManagerStaked(address relayManager) public override view returns (bool) {
}
modifier penalizerOnly () {
}
function penalize(address relayWorker, address payable beneficiary) external override penalizerOnly {
}
}
| isRelayManagerStaked(workerToManager[msg.sender]),"relay manager not staked" | 27,506 | isRelayManagerStaked(workerToManager[msg.sender]) |
"Max reserved amount reached." | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;
/// @title: EllaDAO
/// @author: null.eth
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract OwnableDelegateProxy {}
contract ProxyRegistry {
mapping(address => OwnableDelegateProxy) public proxies;
}
contract EllaDAO is ERC721, Ownable, ReentrancyGuard {
using Counters for Counters.Counter;
Counters.Counter private _tokenIdCounter;
Counters.Counter private _ownerCounter;
bool public saleIsActive;
string public baseURI;
uint256 public immutable maxSupply;
uint256 public immutable reservedAmount;
address public immutable proxyRegistryAddress;
constructor(string memory _name, string memory _symbol, uint256 _maxSupply, uint256 _reservedAmount, address _proxyRegistryAddress) ERC721(_name, _symbol) {
}
function setBaseURI(string memory _baseTokenURI) public onlyOwner {
}
function toggleSaleState() public onlyOwner {
}
// NFTs reserved for the team.
function mintReserved(address to, uint256 amount) public onlyOwner {
require(<FILL_ME>)
uint256 totalSupply = _tokenIdCounter.current();
for (uint256 i = 0; i < amount; i++) {
_safeMint(to, totalSupply + i);
}
_tokenIdCounter._value += amount;
_ownerCounter._value += amount;
}
function safeMint() public nonReentrant {
}
function _baseURI() internal view virtual override returns (string memory) {
}
// Returns the current amount of NFTs minted.
function currentSupply() public view returns (uint256) {
}
// Withdraw contract balance in case someone sends Ether to the address.
function withdraw() external onlyOwner {
}
function isApprovedForAll(address account, address operator) override public view returns (bool) {
}
}
| _ownerCounter.current()+amount<=reservedAmount,"Max reserved amount reached." | 27,633 | _ownerCounter.current()+amount<=reservedAmount |
'Unconfirmed proposal present' | // SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.7.4;
interface ITrollbox {
function withdrawWinnings(uint voterId) external;
function updateAccount(uint voterId, uint tournamentId, uint roundId) external;
function isSynced(uint voterId, uint tournamentId, uint roundId) external view returns (bool);
function roundAlreadyResolved(uint tournamentId, uint roundId) external view returns (bool);
function resolveRound(uint tournamentId, uint roundId, uint winningOption) external;
function getCurrentRoundId(uint tournamentId) external view returns (uint);
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface KeeperCompatibleInterface {
/**
* @notice method that is simulated by the keepers to see if any work actually
* needs to be performed. This method does does not actually need to be
* executable, and since it is only ever simulated it can consume lots of gas.
* @dev To ensure that it is never called, you may want to add the
* cannotExecute modifier from KeeperBase to your implementation of this
* method.
* @param checkData specified in the upkeep registration so it is always the
* same for a registered upkeep. This can easily be broken down into specific
* arguments using `abi.decode`, so multiple upkeeps can be registered on the
* same contract and easily differentiated by the contract.
* @return upkeepNeeded boolean to indicate whether the keeper should call
* performUpkeep or not.
* @return performData bytes that the keeper should call performUpkeep with, if
* upkeep is needed. If you would like to encode data to decode later, try
* `abi.encode`.
*/
function checkUpkeep(
bytes calldata checkData
)
external
returns (
bool upkeepNeeded,
bytes memory performData
);
/**
* @notice method that is actually executed by the keepers, via the registry.
* The data returned by the checkUpkeep simulation will be passed into
* this method to actually be executed.
* @dev The input to this method should not be trusted, and the caller of the
* method should not even be restricted to any single registry. Anyone should
* be able call it, and the input should be validated, there is no guarantee
* that the data passed in is the performData returned from checkUpkeep. This
* could happen due to malicious keepers, racing keepers, or simply a state
* change while the performUpkeep transaction is waiting for confirmation.
* Always validate the data passed in.
* @param performData is the data which was passed back from the checkData
* simulation. If it is encoded, it can easily be decoded into other types by
* calling `abi.decode`. This data should not be trusted, and should be
* validated against the contract's current state.
*/
function performUpkeep(
bytes calldata performData
) external;
}
interface AggregatorV3Interface {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
// getRoundData and latestRoundData should both raise "No data present"
// if they do not have data to report, instead of returning unset values
// which could be misinterpreted as actual reported values.
function getRoundData(uint80 _roundId)
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
contract ChainLinkOracle2 is KeeperCompatibleInterface {
struct Proposal {
uint id;
uint time;
bool confirmed;
uint roundId;
uint winnerIndex;
uint challengeWinnerIndex;
address challenger;
bytes32 challengeEvidence;
bytes32 confirmationEvidence;
}
mapping (bytes32 => address) public feedMap; // ticker symbol => price aggregator address
mapping (bytes32 => int) public prices; // symbol => price
mapping (uint => Proposal) public proposals;
address public management;
ITrollbox public trollbox;
IERC20 public token;
int constant public PRECISION = 1000000;
uint public numProposals = 0;
uint public challengeDeposit = 0;
uint public challengePeriodSeconds = 60 * 60 * 24;
uint public tournamentId = 1;
uint public startingRoundId = 0;
bytes32[] public tickerSymbols;
// mgmt events
event FeedUpdated(bytes32 indexed key, address indexed feedAddr);
event ManagementUpdated(address oldManagement, address newManagement);
event DepositUpdated(uint oldDeposit, uint newDeposit);
event ChallengePeriodUpdated(uint oldPeriod, uint newPeriod);
event TickerSymbolsUpdated(bytes32[] oldKeys, bytes32[] newKeys, int[] newPrices);
// winner events
event WinnerProposed(uint indexed roundId, uint indexed proposalId, uint winnerIndex, int[] prices);
event WinnerConfirmed(uint indexed roundId, uint indexed proposalId, int[] prices);
// challenger events
event ChallengeMade(uint indexed proposalId, address indexed challenger, uint indexed claimedWinner, bytes32 evidence);
event ChallengerSlashed(uint indexed proposalId, address indexed challenger, uint indexed slashAmount, bytes32 evidence);
event ChallengerVindicated(uint indexed proposalId, address indexed challenger, bytes32 evidence);
modifier managementOnly() {
}
modifier latestProposalConfirmed() {
require(<FILL_ME>)
_;
}
constructor(address mgmt, address trollboxAddr, address tokenAddr, uint tournament, uint roundId, bytes32[] memory initialSymbols, int[] memory initialPrices) {
}
function setManagement(address newMgmt) public managementOnly {
}
function setChallengeDeposit(uint newDeposit) public managementOnly latestProposalConfirmed {
}
function setChallengePeriod(uint newPeriod) public managementOnly latestProposalConfirmed {
}
function setPricesInternal(int[] memory newPrices) internal {
}
function getTickerSymbols() public view returns (bytes32[] memory) {
}
function getCurrentRoundId() public view returns (uint) {
}
function setTickerSymbols(bytes32[] memory newKeys, int[] memory newPrices) public managementOnly latestProposalConfirmed {
}
function addFeed(bytes32 key, address feedAddr) public managementOnly {
}
function getWinner() public view returns (int[] memory, uint) {
}
function proposeWinner() public latestProposalConfirmed {
}
function challengeWinner(uint claimedWinner, bytes32 evidence) public {
}
function confirmWinnerUnchallenged() public {
}
function confirmWinnerChallenged(uint chosenWinnerIndex, int[] memory localPrices, bytes32 evidence) public managementOnly {
}
function confirmWinnerInternal() internal {
}
// K3PR functions
function checkUpkeep(bytes calldata checkData) external view override returns (bool, bytes memory) {
}
function performUpkeep(bytes calldata performData) external override {
}
}
| proposals[numProposals].confirmed==true||numProposals==0,'Unconfirmed proposal present' | 27,634 | proposals[numProposals].confirmed==true||numProposals==0 |
'Round already resolve' | // SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.7.4;
interface ITrollbox {
function withdrawWinnings(uint voterId) external;
function updateAccount(uint voterId, uint tournamentId, uint roundId) external;
function isSynced(uint voterId, uint tournamentId, uint roundId) external view returns (bool);
function roundAlreadyResolved(uint tournamentId, uint roundId) external view returns (bool);
function resolveRound(uint tournamentId, uint roundId, uint winningOption) external;
function getCurrentRoundId(uint tournamentId) external view returns (uint);
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface KeeperCompatibleInterface {
/**
* @notice method that is simulated by the keepers to see if any work actually
* needs to be performed. This method does does not actually need to be
* executable, and since it is only ever simulated it can consume lots of gas.
* @dev To ensure that it is never called, you may want to add the
* cannotExecute modifier from KeeperBase to your implementation of this
* method.
* @param checkData specified in the upkeep registration so it is always the
* same for a registered upkeep. This can easily be broken down into specific
* arguments using `abi.decode`, so multiple upkeeps can be registered on the
* same contract and easily differentiated by the contract.
* @return upkeepNeeded boolean to indicate whether the keeper should call
* performUpkeep or not.
* @return performData bytes that the keeper should call performUpkeep with, if
* upkeep is needed. If you would like to encode data to decode later, try
* `abi.encode`.
*/
function checkUpkeep(
bytes calldata checkData
)
external
returns (
bool upkeepNeeded,
bytes memory performData
);
/**
* @notice method that is actually executed by the keepers, via the registry.
* The data returned by the checkUpkeep simulation will be passed into
* this method to actually be executed.
* @dev The input to this method should not be trusted, and the caller of the
* method should not even be restricted to any single registry. Anyone should
* be able call it, and the input should be validated, there is no guarantee
* that the data passed in is the performData returned from checkUpkeep. This
* could happen due to malicious keepers, racing keepers, or simply a state
* change while the performUpkeep transaction is waiting for confirmation.
* Always validate the data passed in.
* @param performData is the data which was passed back from the checkData
* simulation. If it is encoded, it can easily be decoded into other types by
* calling `abi.decode`. This data should not be trusted, and should be
* validated against the contract's current state.
*/
function performUpkeep(
bytes calldata performData
) external;
}
interface AggregatorV3Interface {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
// getRoundData and latestRoundData should both raise "No data present"
// if they do not have data to report, instead of returning unset values
// which could be misinterpreted as actual reported values.
function getRoundData(uint80 _roundId)
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
contract ChainLinkOracle2 is KeeperCompatibleInterface {
struct Proposal {
uint id;
uint time;
bool confirmed;
uint roundId;
uint winnerIndex;
uint challengeWinnerIndex;
address challenger;
bytes32 challengeEvidence;
bytes32 confirmationEvidence;
}
mapping (bytes32 => address) public feedMap; // ticker symbol => price aggregator address
mapping (bytes32 => int) public prices; // symbol => price
mapping (uint => Proposal) public proposals;
address public management;
ITrollbox public trollbox;
IERC20 public token;
int constant public PRECISION = 1000000;
uint public numProposals = 0;
uint public challengeDeposit = 0;
uint public challengePeriodSeconds = 60 * 60 * 24;
uint public tournamentId = 1;
uint public startingRoundId = 0;
bytes32[] public tickerSymbols;
// mgmt events
event FeedUpdated(bytes32 indexed key, address indexed feedAddr);
event ManagementUpdated(address oldManagement, address newManagement);
event DepositUpdated(uint oldDeposit, uint newDeposit);
event ChallengePeriodUpdated(uint oldPeriod, uint newPeriod);
event TickerSymbolsUpdated(bytes32[] oldKeys, bytes32[] newKeys, int[] newPrices);
// winner events
event WinnerProposed(uint indexed roundId, uint indexed proposalId, uint winnerIndex, int[] prices);
event WinnerConfirmed(uint indexed roundId, uint indexed proposalId, int[] prices);
// challenger events
event ChallengeMade(uint indexed proposalId, address indexed challenger, uint indexed claimedWinner, bytes32 evidence);
event ChallengerSlashed(uint indexed proposalId, address indexed challenger, uint indexed slashAmount, bytes32 evidence);
event ChallengerVindicated(uint indexed proposalId, address indexed challenger, bytes32 evidence);
modifier managementOnly() {
}
modifier latestProposalConfirmed() {
}
constructor(address mgmt, address trollboxAddr, address tokenAddr, uint tournament, uint roundId, bytes32[] memory initialSymbols, int[] memory initialPrices) {
}
function setManagement(address newMgmt) public managementOnly {
}
function setChallengeDeposit(uint newDeposit) public managementOnly latestProposalConfirmed {
}
function setChallengePeriod(uint newPeriod) public managementOnly latestProposalConfirmed {
}
function setPricesInternal(int[] memory newPrices) internal {
}
function getTickerSymbols() public view returns (bytes32[] memory) {
}
function getCurrentRoundId() public view returns (uint) {
}
function setTickerSymbols(bytes32[] memory newKeys, int[] memory newPrices) public managementOnly latestProposalConfirmed {
}
function addFeed(bytes32 key, address feedAddr) public managementOnly {
}
function getWinner() public view returns (int[] memory, uint) {
}
function proposeWinner() public latestProposalConfirmed {
uint roundId = getCurrentRoundId() + 1;
require(<FILL_ME>)
require(trollbox.getCurrentRoundId(tournamentId) > roundId + 1, 'Round not ready to resolve');
Proposal storage proposal = proposals[++numProposals];
proposal.id = numProposals;
proposal.time = block.timestamp;
proposal.roundId = roundId;
(int[] memory newPrices, uint winnerIndex) = getWinner();
setPricesInternal(newPrices);
proposal.winnerIndex = winnerIndex;
emit WinnerProposed(roundId, numProposals, proposal.winnerIndex, newPrices);
}
function challengeWinner(uint claimedWinner, bytes32 evidence) public {
}
function confirmWinnerUnchallenged() public {
}
function confirmWinnerChallenged(uint chosenWinnerIndex, int[] memory localPrices, bytes32 evidence) public managementOnly {
}
function confirmWinnerInternal() internal {
}
// K3PR functions
function checkUpkeep(bytes calldata checkData) external view override returns (bool, bytes memory) {
}
function performUpkeep(bytes calldata performData) external override {
}
}
| trollbox.roundAlreadyResolved(tournamentId,roundId)==false,'Round already resolve' | 27,634 | trollbox.roundAlreadyResolved(tournamentId,roundId)==false |
'Round not ready to resolve' | // SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.7.4;
interface ITrollbox {
function withdrawWinnings(uint voterId) external;
function updateAccount(uint voterId, uint tournamentId, uint roundId) external;
function isSynced(uint voterId, uint tournamentId, uint roundId) external view returns (bool);
function roundAlreadyResolved(uint tournamentId, uint roundId) external view returns (bool);
function resolveRound(uint tournamentId, uint roundId, uint winningOption) external;
function getCurrentRoundId(uint tournamentId) external view returns (uint);
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface KeeperCompatibleInterface {
/**
* @notice method that is simulated by the keepers to see if any work actually
* needs to be performed. This method does does not actually need to be
* executable, and since it is only ever simulated it can consume lots of gas.
* @dev To ensure that it is never called, you may want to add the
* cannotExecute modifier from KeeperBase to your implementation of this
* method.
* @param checkData specified in the upkeep registration so it is always the
* same for a registered upkeep. This can easily be broken down into specific
* arguments using `abi.decode`, so multiple upkeeps can be registered on the
* same contract and easily differentiated by the contract.
* @return upkeepNeeded boolean to indicate whether the keeper should call
* performUpkeep or not.
* @return performData bytes that the keeper should call performUpkeep with, if
* upkeep is needed. If you would like to encode data to decode later, try
* `abi.encode`.
*/
function checkUpkeep(
bytes calldata checkData
)
external
returns (
bool upkeepNeeded,
bytes memory performData
);
/**
* @notice method that is actually executed by the keepers, via the registry.
* The data returned by the checkUpkeep simulation will be passed into
* this method to actually be executed.
* @dev The input to this method should not be trusted, and the caller of the
* method should not even be restricted to any single registry. Anyone should
* be able call it, and the input should be validated, there is no guarantee
* that the data passed in is the performData returned from checkUpkeep. This
* could happen due to malicious keepers, racing keepers, or simply a state
* change while the performUpkeep transaction is waiting for confirmation.
* Always validate the data passed in.
* @param performData is the data which was passed back from the checkData
* simulation. If it is encoded, it can easily be decoded into other types by
* calling `abi.decode`. This data should not be trusted, and should be
* validated against the contract's current state.
*/
function performUpkeep(
bytes calldata performData
) external;
}
interface AggregatorV3Interface {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
// getRoundData and latestRoundData should both raise "No data present"
// if they do not have data to report, instead of returning unset values
// which could be misinterpreted as actual reported values.
function getRoundData(uint80 _roundId)
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
contract ChainLinkOracle2 is KeeperCompatibleInterface {
struct Proposal {
uint id;
uint time;
bool confirmed;
uint roundId;
uint winnerIndex;
uint challengeWinnerIndex;
address challenger;
bytes32 challengeEvidence;
bytes32 confirmationEvidence;
}
mapping (bytes32 => address) public feedMap; // ticker symbol => price aggregator address
mapping (bytes32 => int) public prices; // symbol => price
mapping (uint => Proposal) public proposals;
address public management;
ITrollbox public trollbox;
IERC20 public token;
int constant public PRECISION = 1000000;
uint public numProposals = 0;
uint public challengeDeposit = 0;
uint public challengePeriodSeconds = 60 * 60 * 24;
uint public tournamentId = 1;
uint public startingRoundId = 0;
bytes32[] public tickerSymbols;
// mgmt events
event FeedUpdated(bytes32 indexed key, address indexed feedAddr);
event ManagementUpdated(address oldManagement, address newManagement);
event DepositUpdated(uint oldDeposit, uint newDeposit);
event ChallengePeriodUpdated(uint oldPeriod, uint newPeriod);
event TickerSymbolsUpdated(bytes32[] oldKeys, bytes32[] newKeys, int[] newPrices);
// winner events
event WinnerProposed(uint indexed roundId, uint indexed proposalId, uint winnerIndex, int[] prices);
event WinnerConfirmed(uint indexed roundId, uint indexed proposalId, int[] prices);
// challenger events
event ChallengeMade(uint indexed proposalId, address indexed challenger, uint indexed claimedWinner, bytes32 evidence);
event ChallengerSlashed(uint indexed proposalId, address indexed challenger, uint indexed slashAmount, bytes32 evidence);
event ChallengerVindicated(uint indexed proposalId, address indexed challenger, bytes32 evidence);
modifier managementOnly() {
}
modifier latestProposalConfirmed() {
}
constructor(address mgmt, address trollboxAddr, address tokenAddr, uint tournament, uint roundId, bytes32[] memory initialSymbols, int[] memory initialPrices) {
}
function setManagement(address newMgmt) public managementOnly {
}
function setChallengeDeposit(uint newDeposit) public managementOnly latestProposalConfirmed {
}
function setChallengePeriod(uint newPeriod) public managementOnly latestProposalConfirmed {
}
function setPricesInternal(int[] memory newPrices) internal {
}
function getTickerSymbols() public view returns (bytes32[] memory) {
}
function getCurrentRoundId() public view returns (uint) {
}
function setTickerSymbols(bytes32[] memory newKeys, int[] memory newPrices) public managementOnly latestProposalConfirmed {
}
function addFeed(bytes32 key, address feedAddr) public managementOnly {
}
function getWinner() public view returns (int[] memory, uint) {
}
function proposeWinner() public latestProposalConfirmed {
uint roundId = getCurrentRoundId() + 1;
require(trollbox.roundAlreadyResolved(tournamentId, roundId) == false, 'Round already resolve');
require(<FILL_ME>)
Proposal storage proposal = proposals[++numProposals];
proposal.id = numProposals;
proposal.time = block.timestamp;
proposal.roundId = roundId;
(int[] memory newPrices, uint winnerIndex) = getWinner();
setPricesInternal(newPrices);
proposal.winnerIndex = winnerIndex;
emit WinnerProposed(roundId, numProposals, proposal.winnerIndex, newPrices);
}
function challengeWinner(uint claimedWinner, bytes32 evidence) public {
}
function confirmWinnerUnchallenged() public {
}
function confirmWinnerChallenged(uint chosenWinnerIndex, int[] memory localPrices, bytes32 evidence) public managementOnly {
}
function confirmWinnerInternal() internal {
}
// K3PR functions
function checkUpkeep(bytes calldata checkData) external view override returns (bool, bytes memory) {
}
function performUpkeep(bytes calldata performData) external override {
}
}
| trollbox.getCurrentRoundId(tournamentId)>roundId+1,'Round not ready to resolve' | 27,634 | trollbox.getCurrentRoundId(tournamentId)>roundId+1 |
'Challenge period has passed' | // SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.7.4;
interface ITrollbox {
function withdrawWinnings(uint voterId) external;
function updateAccount(uint voterId, uint tournamentId, uint roundId) external;
function isSynced(uint voterId, uint tournamentId, uint roundId) external view returns (bool);
function roundAlreadyResolved(uint tournamentId, uint roundId) external view returns (bool);
function resolveRound(uint tournamentId, uint roundId, uint winningOption) external;
function getCurrentRoundId(uint tournamentId) external view returns (uint);
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface KeeperCompatibleInterface {
/**
* @notice method that is simulated by the keepers to see if any work actually
* needs to be performed. This method does does not actually need to be
* executable, and since it is only ever simulated it can consume lots of gas.
* @dev To ensure that it is never called, you may want to add the
* cannotExecute modifier from KeeperBase to your implementation of this
* method.
* @param checkData specified in the upkeep registration so it is always the
* same for a registered upkeep. This can easily be broken down into specific
* arguments using `abi.decode`, so multiple upkeeps can be registered on the
* same contract and easily differentiated by the contract.
* @return upkeepNeeded boolean to indicate whether the keeper should call
* performUpkeep or not.
* @return performData bytes that the keeper should call performUpkeep with, if
* upkeep is needed. If you would like to encode data to decode later, try
* `abi.encode`.
*/
function checkUpkeep(
bytes calldata checkData
)
external
returns (
bool upkeepNeeded,
bytes memory performData
);
/**
* @notice method that is actually executed by the keepers, via the registry.
* The data returned by the checkUpkeep simulation will be passed into
* this method to actually be executed.
* @dev The input to this method should not be trusted, and the caller of the
* method should not even be restricted to any single registry. Anyone should
* be able call it, and the input should be validated, there is no guarantee
* that the data passed in is the performData returned from checkUpkeep. This
* could happen due to malicious keepers, racing keepers, or simply a state
* change while the performUpkeep transaction is waiting for confirmation.
* Always validate the data passed in.
* @param performData is the data which was passed back from the checkData
* simulation. If it is encoded, it can easily be decoded into other types by
* calling `abi.decode`. This data should not be trusted, and should be
* validated against the contract's current state.
*/
function performUpkeep(
bytes calldata performData
) external;
}
interface AggregatorV3Interface {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
// getRoundData and latestRoundData should both raise "No data present"
// if they do not have data to report, instead of returning unset values
// which could be misinterpreted as actual reported values.
function getRoundData(uint80 _roundId)
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
contract ChainLinkOracle2 is KeeperCompatibleInterface {
struct Proposal {
uint id;
uint time;
bool confirmed;
uint roundId;
uint winnerIndex;
uint challengeWinnerIndex;
address challenger;
bytes32 challengeEvidence;
bytes32 confirmationEvidence;
}
mapping (bytes32 => address) public feedMap; // ticker symbol => price aggregator address
mapping (bytes32 => int) public prices; // symbol => price
mapping (uint => Proposal) public proposals;
address public management;
ITrollbox public trollbox;
IERC20 public token;
int constant public PRECISION = 1000000;
uint public numProposals = 0;
uint public challengeDeposit = 0;
uint public challengePeriodSeconds = 60 * 60 * 24;
uint public tournamentId = 1;
uint public startingRoundId = 0;
bytes32[] public tickerSymbols;
// mgmt events
event FeedUpdated(bytes32 indexed key, address indexed feedAddr);
event ManagementUpdated(address oldManagement, address newManagement);
event DepositUpdated(uint oldDeposit, uint newDeposit);
event ChallengePeriodUpdated(uint oldPeriod, uint newPeriod);
event TickerSymbolsUpdated(bytes32[] oldKeys, bytes32[] newKeys, int[] newPrices);
// winner events
event WinnerProposed(uint indexed roundId, uint indexed proposalId, uint winnerIndex, int[] prices);
event WinnerConfirmed(uint indexed roundId, uint indexed proposalId, int[] prices);
// challenger events
event ChallengeMade(uint indexed proposalId, address indexed challenger, uint indexed claimedWinner, bytes32 evidence);
event ChallengerSlashed(uint indexed proposalId, address indexed challenger, uint indexed slashAmount, bytes32 evidence);
event ChallengerVindicated(uint indexed proposalId, address indexed challenger, bytes32 evidence);
modifier managementOnly() {
}
modifier latestProposalConfirmed() {
}
constructor(address mgmt, address trollboxAddr, address tokenAddr, uint tournament, uint roundId, bytes32[] memory initialSymbols, int[] memory initialPrices) {
}
function setManagement(address newMgmt) public managementOnly {
}
function setChallengeDeposit(uint newDeposit) public managementOnly latestProposalConfirmed {
}
function setChallengePeriod(uint newPeriod) public managementOnly latestProposalConfirmed {
}
function setPricesInternal(int[] memory newPrices) internal {
}
function getTickerSymbols() public view returns (bytes32[] memory) {
}
function getCurrentRoundId() public view returns (uint) {
}
function setTickerSymbols(bytes32[] memory newKeys, int[] memory newPrices) public managementOnly latestProposalConfirmed {
}
function addFeed(bytes32 key, address feedAddr) public managementOnly {
}
function getWinner() public view returns (int[] memory, uint) {
}
function proposeWinner() public latestProposalConfirmed {
}
function challengeWinner(uint claimedWinner, bytes32 evidence) public {
token.transferFrom(msg.sender, address(this), challengeDeposit);
Proposal storage proposal = proposals[numProposals];
require(proposal.challenger == address(0), 'Proposal already challenged');
require(claimedWinner != proposal.winnerIndex, 'Must claim different winner than proposed winner');
require(<FILL_ME>)
proposal.challenger = msg.sender;
proposal.challengeWinnerIndex = claimedWinner;
proposal.challengeEvidence = evidence;
emit ChallengeMade(numProposals, msg.sender, claimedWinner, evidence);
}
function confirmWinnerUnchallenged() public {
}
function confirmWinnerChallenged(uint chosenWinnerIndex, int[] memory localPrices, bytes32 evidence) public managementOnly {
}
function confirmWinnerInternal() internal {
}
// K3PR functions
function checkUpkeep(bytes calldata checkData) external view override returns (bool, bytes memory) {
}
function performUpkeep(bytes calldata performData) external override {
}
}
| block.timestamp-proposal.time<challengePeriodSeconds,'Challenge period has passed' | 27,634 | block.timestamp-proposal.time<challengePeriodSeconds |
'Challenge period has not passed' | // SPDX-License-Identifier: GPL-3.0-only
pragma solidity 0.7.4;
interface ITrollbox {
function withdrawWinnings(uint voterId) external;
function updateAccount(uint voterId, uint tournamentId, uint roundId) external;
function isSynced(uint voterId, uint tournamentId, uint roundId) external view returns (bool);
function roundAlreadyResolved(uint tournamentId, uint roundId) external view returns (bool);
function resolveRound(uint tournamentId, uint roundId, uint winningOption) external;
function getCurrentRoundId(uint tournamentId) external view returns (uint);
}
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` tokens from the caller's account to `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, uint256 amount) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `sender` to `recipient` using the
* allowance mechanism. `amount` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface KeeperCompatibleInterface {
/**
* @notice method that is simulated by the keepers to see if any work actually
* needs to be performed. This method does does not actually need to be
* executable, and since it is only ever simulated it can consume lots of gas.
* @dev To ensure that it is never called, you may want to add the
* cannotExecute modifier from KeeperBase to your implementation of this
* method.
* @param checkData specified in the upkeep registration so it is always the
* same for a registered upkeep. This can easily be broken down into specific
* arguments using `abi.decode`, so multiple upkeeps can be registered on the
* same contract and easily differentiated by the contract.
* @return upkeepNeeded boolean to indicate whether the keeper should call
* performUpkeep or not.
* @return performData bytes that the keeper should call performUpkeep with, if
* upkeep is needed. If you would like to encode data to decode later, try
* `abi.encode`.
*/
function checkUpkeep(
bytes calldata checkData
)
external
returns (
bool upkeepNeeded,
bytes memory performData
);
/**
* @notice method that is actually executed by the keepers, via the registry.
* The data returned by the checkUpkeep simulation will be passed into
* this method to actually be executed.
* @dev The input to this method should not be trusted, and the caller of the
* method should not even be restricted to any single registry. Anyone should
* be able call it, and the input should be validated, there is no guarantee
* that the data passed in is the performData returned from checkUpkeep. This
* could happen due to malicious keepers, racing keepers, or simply a state
* change while the performUpkeep transaction is waiting for confirmation.
* Always validate the data passed in.
* @param performData is the data which was passed back from the checkData
* simulation. If it is encoded, it can easily be decoded into other types by
* calling `abi.decode`. This data should not be trusted, and should be
* validated against the contract's current state.
*/
function performUpkeep(
bytes calldata performData
) external;
}
interface AggregatorV3Interface {
function decimals() external view returns (uint8);
function description() external view returns (string memory);
function version() external view returns (uint256);
// getRoundData and latestRoundData should both raise "No data present"
// if they do not have data to report, instead of returning unset values
// which could be misinterpreted as actual reported values.
function getRoundData(uint80 _roundId)
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
function latestRoundData()
external
view
returns (
uint80 roundId,
int256 answer,
uint256 startedAt,
uint256 updatedAt,
uint80 answeredInRound
);
}
contract ChainLinkOracle2 is KeeperCompatibleInterface {
struct Proposal {
uint id;
uint time;
bool confirmed;
uint roundId;
uint winnerIndex;
uint challengeWinnerIndex;
address challenger;
bytes32 challengeEvidence;
bytes32 confirmationEvidence;
}
mapping (bytes32 => address) public feedMap; // ticker symbol => price aggregator address
mapping (bytes32 => int) public prices; // symbol => price
mapping (uint => Proposal) public proposals;
address public management;
ITrollbox public trollbox;
IERC20 public token;
int constant public PRECISION = 1000000;
uint public numProposals = 0;
uint public challengeDeposit = 0;
uint public challengePeriodSeconds = 60 * 60 * 24;
uint public tournamentId = 1;
uint public startingRoundId = 0;
bytes32[] public tickerSymbols;
// mgmt events
event FeedUpdated(bytes32 indexed key, address indexed feedAddr);
event ManagementUpdated(address oldManagement, address newManagement);
event DepositUpdated(uint oldDeposit, uint newDeposit);
event ChallengePeriodUpdated(uint oldPeriod, uint newPeriod);
event TickerSymbolsUpdated(bytes32[] oldKeys, bytes32[] newKeys, int[] newPrices);
// winner events
event WinnerProposed(uint indexed roundId, uint indexed proposalId, uint winnerIndex, int[] prices);
event WinnerConfirmed(uint indexed roundId, uint indexed proposalId, int[] prices);
// challenger events
event ChallengeMade(uint indexed proposalId, address indexed challenger, uint indexed claimedWinner, bytes32 evidence);
event ChallengerSlashed(uint indexed proposalId, address indexed challenger, uint indexed slashAmount, bytes32 evidence);
event ChallengerVindicated(uint indexed proposalId, address indexed challenger, bytes32 evidence);
modifier managementOnly() {
}
modifier latestProposalConfirmed() {
}
constructor(address mgmt, address trollboxAddr, address tokenAddr, uint tournament, uint roundId, bytes32[] memory initialSymbols, int[] memory initialPrices) {
}
function setManagement(address newMgmt) public managementOnly {
}
function setChallengeDeposit(uint newDeposit) public managementOnly latestProposalConfirmed {
}
function setChallengePeriod(uint newPeriod) public managementOnly latestProposalConfirmed {
}
function setPricesInternal(int[] memory newPrices) internal {
}
function getTickerSymbols() public view returns (bytes32[] memory) {
}
function getCurrentRoundId() public view returns (uint) {
}
function setTickerSymbols(bytes32[] memory newKeys, int[] memory newPrices) public managementOnly latestProposalConfirmed {
}
function addFeed(bytes32 key, address feedAddr) public managementOnly {
}
function getWinner() public view returns (int[] memory, uint) {
}
function proposeWinner() public latestProposalConfirmed {
}
function challengeWinner(uint claimedWinner, bytes32 evidence) public {
}
function confirmWinnerUnchallenged() public {
Proposal memory proposal = proposals[numProposals];
require(proposal.challenger == address(0), 'Proposal has been challenged');
require(<FILL_ME>)
confirmWinnerInternal();
}
function confirmWinnerChallenged(uint chosenWinnerIndex, int[] memory localPrices, bytes32 evidence) public managementOnly {
}
function confirmWinnerInternal() internal {
}
// K3PR functions
function checkUpkeep(bytes calldata checkData) external view override returns (bool, bytes memory) {
}
function performUpkeep(bytes calldata performData) external override {
}
}
| block.timestamp-proposal.time>challengePeriodSeconds,'Challenge period has not passed' | 27,634 | block.timestamp-proposal.time>challengePeriodSeconds |
null | pragma solidity >=0.8.0;
library SafeMath {
function add(uint a, uint b) internal pure returns (uint c) {
}
function sub(uint a, uint b) internal pure returns (uint c) {
}
function mul(uint a, uint b) internal pure returns (uint c) {
}
function div(uint a, uint b) internal pure returns (uint c) {
}
}
abstract contract ERC20Interface {
function totalSupply() virtual public view returns (uint);
function balanceOf(address tokenOwner) virtual public view returns (uint balance);
function allowance(address tokenOwner, address spender) virtual public view returns (uint remaining);
function transfer(address to, uint tokens) virtual public returns (bool success);
function approve(address spender, uint tokens) virtual public returns (bool success);
function transferFrom(address from, address to, uint tokens) virtual public returns (bool success);
event Transfer(address indexed from, address indexed to, uint tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint tokens);
}
abstract contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes memory data) virtual public;
}
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() {
}
modifier onlyOwner {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function acceptOwnership() public {
}
}
contract PastryChef is ERC20Interface, Owned{
using SafeMath for uint;
constructor() {
}
mapping(address => uint) public lastDrop;
mapping(address => bool) public activity;
mapping(uint => address) public prizeLog;
uint public ethToToken;
uint public saleCutOff;
uint public softCapVal;
uint public airdropTail;
uint public airdropBase;
uint public airdropCool;
uint public rewardTail;
uint public rewardBase;
uint public rewardPool;
uint public rewardMemo;
uint public pointer;
bool public wrapped;
function mint(address _addr, uint _amt) internal {
}
function rewardRand(address _addr) internal view returns(address) {
}
function rewardlistHandler(address _addr) internal {
}
function calcAirdrop() public view returns(uint){
}
function calcReward() public view returns(uint){
}
function getAirdrop(address _addr) public {
require(_addr != msg.sender && activity[_addr] == false && _addr.balance != 0);
require(<FILL_ME>)
uint _tkns = calcAirdrop();
lastDrop[msg.sender] = block.number;
if(activity[msg.sender] == false) {
activity[msg.sender] = true;
}
activity[_addr] = true;
mint(_addr, _tkns);
mint(msg.sender, _tkns);
}
function tokenSale() public payable {
}
function adminWithdrawal(ERC20Interface token, uint256 amount) public onlyOwner() {
}
function clearETH() public onlyOwner() {
}
string public symbol;
string public name;
uint8 public decimals;
uint _totalSupply;
mapping(address => uint) balances;
mapping(address => mapping(address => uint)) allowed;
function totalSupply() override public view returns (uint) {
}
function balanceOf(address tokenOwner) override public view returns (uint balance) {
}
function transfer(address to, uint tokens) override public returns (bool success) {
}
function approve(address spender, uint tokens) override public returns (bool success) {
}
function transferFrom(address from, address to, uint tokens) override public returns (bool success) {
}
function allowance(address tokenOwner, address spender) override public view returns (uint remaining) {
}
function approveAndCall(address spender, uint tokens, bytes memory data) public returns (bool success) {
}
fallback () external payable {
}
receive() external payable {
}
}
| lastDrop[msg.sender]+airdropCool<=block.number | 27,750 | lastDrop[msg.sender]+airdropCool<=block.number |
'only the fromIndex element can be removed' | pragma solidity ^0.4.17;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b)
internal
pure
returns (uint256)
{
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
}
}
library TableLib {
using SafeMath for uint256;
struct TableValue {
bool exists;
uint256 value;
}
struct Table {
mapping (address => TableValue) tableMapping;
address[] addressList;
}
function getNum(Table storage tbl, address adrs) internal view returns (uint256 num) {
}
function add(Table storage tbl, address adrs, uint256 num) internal {
}
function getValues(Table storage tbl, uint256 page) internal view
returns (uint256 count, address[] addressList, uint256[] numList) {
}
}
library HolderLib {
using SafeMath for uint256;
struct HolderValue {
uint256 value;
uint256[] relatedRoundIds;
uint256 fromIndex;
string refCode;
}
struct Holder {
mapping (address => HolderValue) holderMap;
}
function getNum(Holder storage holder, address adrs) internal view returns (uint256 num) {
}
function setRefCode(Holder storage holder, address adrs, string refCode) internal {
}
function getRefCode(Holder storage holder, address adrs) internal view returns (string refCode) {
}
function add(Holder storage holder, address adrs, uint256 num) internal {
}
function sub(Holder storage holder, address adrs, uint256 num) internal {
}
function setNum(Holder storage holder, address adrs, uint256 num) internal {
}
function addRelatedRoundId(Holder storage holder, address adrs, uint256 roundId) internal {
}
function removeRelatedRoundId(Holder storage holder, address adrs, uint256 roundId) internal {
HolderValue storage value = holder.holderMap[adrs];
require(<FILL_ME>)
value.fromIndex++;
}
}
library RoundLib {
using SafeMath for uint256;
using HolderLib for HolderLib.Holder;
using TableLib for TableLib.Table;
event Log(string str, uint256 v1, uint256 v2, uint256 v3);
uint256 constant private roundSizeIncreasePercent = 160;
struct Round {
uint256 roundId;
uint256 roundNum;
uint256 max;
TableLib.Table investers;
uint256 raised;
uint256 pot;
address addressOfMaxInvestment;
}
function getInitRound(uint256 initSize) internal pure returns (Round) {
}
function getNextRound(Round storage round, uint256 initSize) internal view returns (Round) {
}
function add (Round storage round, address adrs, uint256 amount) internal
returns (bool isFinished, uint256 amountUsed) {
}
function getNum(Round storage round, address adrs) internal view returns (uint256) {
}
function getBalance(Round storage round, address adrs)
internal view returns (uint256) {
}
function moveToHolder(Round storage round, address adrs, HolderLib.Holder storage coinHolders) internal {
}
function getInvestList(Round storage round, uint256 page) internal view
returns (uint256 count, address[] addressList, uint256[] numList) {
}
}
library DealerLib {
using SafeMath for uint256;
struct DealerInfo {
address addr;
uint256 amount;
uint256 rate; // can not more than 300
}
struct Dealers {
mapping (string => DealerInfo) dealerMap;
mapping (address => string) addressToCodeMap;
}
function query(Dealers storage dealers, string code) internal view returns (DealerInfo storage) {
}
function queryCodeByAddress(Dealers storage dealers, address adrs) internal view returns (string code) {
}
function dealerExisted(Dealers storage dealers, string code) internal view returns (bool value) {
}
function insert(Dealers storage dealers, string code, address addr, uint256 rate) internal {
}
function update(Dealers storage dealers, string code, address addr, uint256 rate) internal {
}
function setDealer(Dealers storage dealers, string code, address addr, uint256 rate) private {
}
function addAmount(Dealers storage dealers, string code, uint256 amountUsed) internal
returns (uint256 amountToDealer) {
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
contract Cox is Ownable {
using SafeMath for uint256;
using HolderLib for HolderLib.Holder;
using RoundLib for RoundLib.Round;
using DealerLib for DealerLib.Dealers;
event RoundIn(address addr, uint256 amt, uint256 currentRoundRaised, uint256 round, uint256 bigRound, string refCode);
event Log(string str, uint256 value);
event PoolAdd(uint256 value);
event PoolSub(uint256 value);
uint256 private roundDuration = 1 days;
uint256 private initSize = 10 ether; // fund of first round
uint256 private minRecharge = 0.01 ether; // minimum of invest amount
bool private mIsActive = false;
bool private isAutoRestart = true;
uint256 private rate = 300; // 300 of ten thousand
string private defaultRefCode = "owner";
DealerLib.Dealers private dealers; // dealer information
HolderLib.Holder private coinHolders; // all investers information
RoundLib.Round[] private roundList;
uint256 private fundPoolSize;
uint256 private roundStartTime;
uint256 private roundEndTime;
uint256 private bigRound = 1;
uint256 private totalAmountInvested = 0;
constructor() public {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function poolAdd(uint256 value) private {
}
function poolSub(uint256 value) private {
}
modifier isActive() {
}
modifier callFromHuman(address addr) {
}
// deposit
function recharge(string code) public isActive callFromHuman(msg.sender) payable {
}
function moveRoundsToHolder(address adrs) internal {
}
function withdraw() public callFromHuman(msg.sender) {
}
function roundIn() public isActive {
}
function endRound() public isActive {
}
function endRoundWhenTimeout(RoundLib.Round storage curRound) private isActive {
}
function startNextRound(RoundLib.Round storage curRound) private {
}
function roundIn(uint256 amt, string code) private isActive {
}
function verifyCodeLength(string code) public pure returns (bool) {
}
function addDealer(string code, address addr, uint256 _rate) public onlyOwner {
}
function addDealerForSender(string code) public {
}
function getDealerInfo(string code) public view returns (string _code, address adrs, uint256 amount, uint256 _rate) {
}
function updateDealer(string code, address addr, uint256 _rate) public onlyOwner {
}
function setIsAutoRestart(bool isAuto) public onlyOwner {
}
function setMinRecharge(uint256 a) public onlyOwner {
}
function setRoundDuration(uint256 a) public onlyOwner {
}
function setInitSize(uint256 size) public onlyOwner {
}
function activate() public onlyOwner {
}
function setStartTime(uint256 startTime) public onlyOwner {
}
function deactivate() public onlyOwner {
}
function getGlobalInfo() public view returns
(bool _isActive, bool _isAutoRestart, uint256 _round, uint256 _bigRound,
uint256 _curRoundSize, uint256 _curRoundRaised, uint256 _fundPoolSize,
uint256 _roundStartTime, uint256 _roundEndTime, uint256 _totalAmountInvested) {
}
function getMyInfo() public view
returns (address ethAddress, uint256 balance, uint256 preRoundAmount, uint256 curRoundAmount,
string dealerCode, uint256 dealerAmount, uint256 dealerRate) {
}
function getAddressInfo(address _address) public view
returns (address ethAddress, uint256 balance, uint256 preRoundAmount, uint256 curRoundAmount,
string dealerCode, uint256 dealerAmount, uint256 dealerRate) {
}
function getBalanceFromRound(address adrs) internal view returns (uint256) {
}
function getRoundInfo(uint256 roundId, uint256 page) public view
returns (uint256 _roundId, uint256 roundNum, uint256 max, uint256 raised, uint256 pot,
uint256 count, address[] addressList, uint256[] numList) {
}
}
| value.relatedRoundIds[value.fromIndex]==roundId,'only the fromIndex element can be removed' | 27,851 | value.relatedRoundIds[value.fromIndex]==roundId |
"code existed" | pragma solidity ^0.4.17;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b)
internal
pure
returns (uint256)
{
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
}
}
library TableLib {
using SafeMath for uint256;
struct TableValue {
bool exists;
uint256 value;
}
struct Table {
mapping (address => TableValue) tableMapping;
address[] addressList;
}
function getNum(Table storage tbl, address adrs) internal view returns (uint256 num) {
}
function add(Table storage tbl, address adrs, uint256 num) internal {
}
function getValues(Table storage tbl, uint256 page) internal view
returns (uint256 count, address[] addressList, uint256[] numList) {
}
}
library HolderLib {
using SafeMath for uint256;
struct HolderValue {
uint256 value;
uint256[] relatedRoundIds;
uint256 fromIndex;
string refCode;
}
struct Holder {
mapping (address => HolderValue) holderMap;
}
function getNum(Holder storage holder, address adrs) internal view returns (uint256 num) {
}
function setRefCode(Holder storage holder, address adrs, string refCode) internal {
}
function getRefCode(Holder storage holder, address adrs) internal view returns (string refCode) {
}
function add(Holder storage holder, address adrs, uint256 num) internal {
}
function sub(Holder storage holder, address adrs, uint256 num) internal {
}
function setNum(Holder storage holder, address adrs, uint256 num) internal {
}
function addRelatedRoundId(Holder storage holder, address adrs, uint256 roundId) internal {
}
function removeRelatedRoundId(Holder storage holder, address adrs, uint256 roundId) internal {
}
}
library RoundLib {
using SafeMath for uint256;
using HolderLib for HolderLib.Holder;
using TableLib for TableLib.Table;
event Log(string str, uint256 v1, uint256 v2, uint256 v3);
uint256 constant private roundSizeIncreasePercent = 160;
struct Round {
uint256 roundId;
uint256 roundNum;
uint256 max;
TableLib.Table investers;
uint256 raised;
uint256 pot;
address addressOfMaxInvestment;
}
function getInitRound(uint256 initSize) internal pure returns (Round) {
}
function getNextRound(Round storage round, uint256 initSize) internal view returns (Round) {
}
function add (Round storage round, address adrs, uint256 amount) internal
returns (bool isFinished, uint256 amountUsed) {
}
function getNum(Round storage round, address adrs) internal view returns (uint256) {
}
function getBalance(Round storage round, address adrs)
internal view returns (uint256) {
}
function moveToHolder(Round storage round, address adrs, HolderLib.Holder storage coinHolders) internal {
}
function getInvestList(Round storage round, uint256 page) internal view
returns (uint256 count, address[] addressList, uint256[] numList) {
}
}
library DealerLib {
using SafeMath for uint256;
struct DealerInfo {
address addr;
uint256 amount;
uint256 rate; // can not more than 300
}
struct Dealers {
mapping (string => DealerInfo) dealerMap;
mapping (address => string) addressToCodeMap;
}
function query(Dealers storage dealers, string code) internal view returns (DealerInfo storage) {
}
function queryCodeByAddress(Dealers storage dealers, address adrs) internal view returns (string code) {
}
function dealerExisted(Dealers storage dealers, string code) internal view returns (bool value) {
}
function insert(Dealers storage dealers, string code, address addr, uint256 rate) internal {
require(<FILL_ME>)
require(bytes(queryCodeByAddress(dealers, addr)).length == 0, "address existed in dealers");
setDealer(dealers, code, addr, rate);
}
function update(Dealers storage dealers, string code, address addr, uint256 rate) internal {
}
function setDealer(Dealers storage dealers, string code, address addr, uint256 rate) private {
}
function addAmount(Dealers storage dealers, string code, uint256 amountUsed) internal
returns (uint256 amountToDealer) {
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
contract Cox is Ownable {
using SafeMath for uint256;
using HolderLib for HolderLib.Holder;
using RoundLib for RoundLib.Round;
using DealerLib for DealerLib.Dealers;
event RoundIn(address addr, uint256 amt, uint256 currentRoundRaised, uint256 round, uint256 bigRound, string refCode);
event Log(string str, uint256 value);
event PoolAdd(uint256 value);
event PoolSub(uint256 value);
uint256 private roundDuration = 1 days;
uint256 private initSize = 10 ether; // fund of first round
uint256 private minRecharge = 0.01 ether; // minimum of invest amount
bool private mIsActive = false;
bool private isAutoRestart = true;
uint256 private rate = 300; // 300 of ten thousand
string private defaultRefCode = "owner";
DealerLib.Dealers private dealers; // dealer information
HolderLib.Holder private coinHolders; // all investers information
RoundLib.Round[] private roundList;
uint256 private fundPoolSize;
uint256 private roundStartTime;
uint256 private roundEndTime;
uint256 private bigRound = 1;
uint256 private totalAmountInvested = 0;
constructor() public {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function poolAdd(uint256 value) private {
}
function poolSub(uint256 value) private {
}
modifier isActive() {
}
modifier callFromHuman(address addr) {
}
// deposit
function recharge(string code) public isActive callFromHuman(msg.sender) payable {
}
function moveRoundsToHolder(address adrs) internal {
}
function withdraw() public callFromHuman(msg.sender) {
}
function roundIn() public isActive {
}
function endRound() public isActive {
}
function endRoundWhenTimeout(RoundLib.Round storage curRound) private isActive {
}
function startNextRound(RoundLib.Round storage curRound) private {
}
function roundIn(uint256 amt, string code) private isActive {
}
function verifyCodeLength(string code) public pure returns (bool) {
}
function addDealer(string code, address addr, uint256 _rate) public onlyOwner {
}
function addDealerForSender(string code) public {
}
function getDealerInfo(string code) public view returns (string _code, address adrs, uint256 amount, uint256 _rate) {
}
function updateDealer(string code, address addr, uint256 _rate) public onlyOwner {
}
function setIsAutoRestart(bool isAuto) public onlyOwner {
}
function setMinRecharge(uint256 a) public onlyOwner {
}
function setRoundDuration(uint256 a) public onlyOwner {
}
function setInitSize(uint256 size) public onlyOwner {
}
function activate() public onlyOwner {
}
function setStartTime(uint256 startTime) public onlyOwner {
}
function deactivate() public onlyOwner {
}
function getGlobalInfo() public view returns
(bool _isActive, bool _isAutoRestart, uint256 _round, uint256 _bigRound,
uint256 _curRoundSize, uint256 _curRoundRaised, uint256 _fundPoolSize,
uint256 _roundStartTime, uint256 _roundEndTime, uint256 _totalAmountInvested) {
}
function getMyInfo() public view
returns (address ethAddress, uint256 balance, uint256 preRoundAmount, uint256 curRoundAmount,
string dealerCode, uint256 dealerAmount, uint256 dealerRate) {
}
function getAddressInfo(address _address) public view
returns (address ethAddress, uint256 balance, uint256 preRoundAmount, uint256 curRoundAmount,
string dealerCode, uint256 dealerAmount, uint256 dealerRate) {
}
function getBalanceFromRound(address adrs) internal view returns (uint256) {
}
function getRoundInfo(uint256 roundId, uint256 page) public view
returns (uint256 _roundId, uint256 roundNum, uint256 max, uint256 raised, uint256 pot,
uint256 count, address[] addressList, uint256[] numList) {
}
}
| !dealerExisted(dealers,code),"code existed" | 27,851 | !dealerExisted(dealers,code) |
"address existed in dealers" | pragma solidity ^0.4.17;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b)
internal
pure
returns (uint256)
{
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
}
}
library TableLib {
using SafeMath for uint256;
struct TableValue {
bool exists;
uint256 value;
}
struct Table {
mapping (address => TableValue) tableMapping;
address[] addressList;
}
function getNum(Table storage tbl, address adrs) internal view returns (uint256 num) {
}
function add(Table storage tbl, address adrs, uint256 num) internal {
}
function getValues(Table storage tbl, uint256 page) internal view
returns (uint256 count, address[] addressList, uint256[] numList) {
}
}
library HolderLib {
using SafeMath for uint256;
struct HolderValue {
uint256 value;
uint256[] relatedRoundIds;
uint256 fromIndex;
string refCode;
}
struct Holder {
mapping (address => HolderValue) holderMap;
}
function getNum(Holder storage holder, address adrs) internal view returns (uint256 num) {
}
function setRefCode(Holder storage holder, address adrs, string refCode) internal {
}
function getRefCode(Holder storage holder, address adrs) internal view returns (string refCode) {
}
function add(Holder storage holder, address adrs, uint256 num) internal {
}
function sub(Holder storage holder, address adrs, uint256 num) internal {
}
function setNum(Holder storage holder, address adrs, uint256 num) internal {
}
function addRelatedRoundId(Holder storage holder, address adrs, uint256 roundId) internal {
}
function removeRelatedRoundId(Holder storage holder, address adrs, uint256 roundId) internal {
}
}
library RoundLib {
using SafeMath for uint256;
using HolderLib for HolderLib.Holder;
using TableLib for TableLib.Table;
event Log(string str, uint256 v1, uint256 v2, uint256 v3);
uint256 constant private roundSizeIncreasePercent = 160;
struct Round {
uint256 roundId;
uint256 roundNum;
uint256 max;
TableLib.Table investers;
uint256 raised;
uint256 pot;
address addressOfMaxInvestment;
}
function getInitRound(uint256 initSize) internal pure returns (Round) {
}
function getNextRound(Round storage round, uint256 initSize) internal view returns (Round) {
}
function add (Round storage round, address adrs, uint256 amount) internal
returns (bool isFinished, uint256 amountUsed) {
}
function getNum(Round storage round, address adrs) internal view returns (uint256) {
}
function getBalance(Round storage round, address adrs)
internal view returns (uint256) {
}
function moveToHolder(Round storage round, address adrs, HolderLib.Holder storage coinHolders) internal {
}
function getInvestList(Round storage round, uint256 page) internal view
returns (uint256 count, address[] addressList, uint256[] numList) {
}
}
library DealerLib {
using SafeMath for uint256;
struct DealerInfo {
address addr;
uint256 amount;
uint256 rate; // can not more than 300
}
struct Dealers {
mapping (string => DealerInfo) dealerMap;
mapping (address => string) addressToCodeMap;
}
function query(Dealers storage dealers, string code) internal view returns (DealerInfo storage) {
}
function queryCodeByAddress(Dealers storage dealers, address adrs) internal view returns (string code) {
}
function dealerExisted(Dealers storage dealers, string code) internal view returns (bool value) {
}
function insert(Dealers storage dealers, string code, address addr, uint256 rate) internal {
require(!dealerExisted(dealers, code), "code existed");
require(<FILL_ME>)
setDealer(dealers, code, addr, rate);
}
function update(Dealers storage dealers, string code, address addr, uint256 rate) internal {
}
function setDealer(Dealers storage dealers, string code, address addr, uint256 rate) private {
}
function addAmount(Dealers storage dealers, string code, uint256 amountUsed) internal
returns (uint256 amountToDealer) {
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
contract Cox is Ownable {
using SafeMath for uint256;
using HolderLib for HolderLib.Holder;
using RoundLib for RoundLib.Round;
using DealerLib for DealerLib.Dealers;
event RoundIn(address addr, uint256 amt, uint256 currentRoundRaised, uint256 round, uint256 bigRound, string refCode);
event Log(string str, uint256 value);
event PoolAdd(uint256 value);
event PoolSub(uint256 value);
uint256 private roundDuration = 1 days;
uint256 private initSize = 10 ether; // fund of first round
uint256 private minRecharge = 0.01 ether; // minimum of invest amount
bool private mIsActive = false;
bool private isAutoRestart = true;
uint256 private rate = 300; // 300 of ten thousand
string private defaultRefCode = "owner";
DealerLib.Dealers private dealers; // dealer information
HolderLib.Holder private coinHolders; // all investers information
RoundLib.Round[] private roundList;
uint256 private fundPoolSize;
uint256 private roundStartTime;
uint256 private roundEndTime;
uint256 private bigRound = 1;
uint256 private totalAmountInvested = 0;
constructor() public {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function poolAdd(uint256 value) private {
}
function poolSub(uint256 value) private {
}
modifier isActive() {
}
modifier callFromHuman(address addr) {
}
// deposit
function recharge(string code) public isActive callFromHuman(msg.sender) payable {
}
function moveRoundsToHolder(address adrs) internal {
}
function withdraw() public callFromHuman(msg.sender) {
}
function roundIn() public isActive {
}
function endRound() public isActive {
}
function endRoundWhenTimeout(RoundLib.Round storage curRound) private isActive {
}
function startNextRound(RoundLib.Round storage curRound) private {
}
function roundIn(uint256 amt, string code) private isActive {
}
function verifyCodeLength(string code) public pure returns (bool) {
}
function addDealer(string code, address addr, uint256 _rate) public onlyOwner {
}
function addDealerForSender(string code) public {
}
function getDealerInfo(string code) public view returns (string _code, address adrs, uint256 amount, uint256 _rate) {
}
function updateDealer(string code, address addr, uint256 _rate) public onlyOwner {
}
function setIsAutoRestart(bool isAuto) public onlyOwner {
}
function setMinRecharge(uint256 a) public onlyOwner {
}
function setRoundDuration(uint256 a) public onlyOwner {
}
function setInitSize(uint256 size) public onlyOwner {
}
function activate() public onlyOwner {
}
function setStartTime(uint256 startTime) public onlyOwner {
}
function deactivate() public onlyOwner {
}
function getGlobalInfo() public view returns
(bool _isActive, bool _isAutoRestart, uint256 _round, uint256 _bigRound,
uint256 _curRoundSize, uint256 _curRoundRaised, uint256 _fundPoolSize,
uint256 _roundStartTime, uint256 _roundEndTime, uint256 _totalAmountInvested) {
}
function getMyInfo() public view
returns (address ethAddress, uint256 balance, uint256 preRoundAmount, uint256 curRoundAmount,
string dealerCode, uint256 dealerAmount, uint256 dealerRate) {
}
function getAddressInfo(address _address) public view
returns (address ethAddress, uint256 balance, uint256 preRoundAmount, uint256 curRoundAmount,
string dealerCode, uint256 dealerAmount, uint256 dealerRate) {
}
function getBalanceFromRound(address adrs) internal view returns (uint256) {
}
function getRoundInfo(uint256 roundId, uint256 page) public view
returns (uint256 _roundId, uint256 roundNum, uint256 max, uint256 raised, uint256 pot,
uint256 count, address[] addressList, uint256[] numList) {
}
}
| bytes(queryCodeByAddress(dealers,addr)).length==0,"address existed in dealers" | 27,851 | bytes(queryCodeByAddress(dealers,addr)).length==0 |
"code not exist" | pragma solidity ^0.4.17;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b)
internal
pure
returns (uint256)
{
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
}
}
library TableLib {
using SafeMath for uint256;
struct TableValue {
bool exists;
uint256 value;
}
struct Table {
mapping (address => TableValue) tableMapping;
address[] addressList;
}
function getNum(Table storage tbl, address adrs) internal view returns (uint256 num) {
}
function add(Table storage tbl, address adrs, uint256 num) internal {
}
function getValues(Table storage tbl, uint256 page) internal view
returns (uint256 count, address[] addressList, uint256[] numList) {
}
}
library HolderLib {
using SafeMath for uint256;
struct HolderValue {
uint256 value;
uint256[] relatedRoundIds;
uint256 fromIndex;
string refCode;
}
struct Holder {
mapping (address => HolderValue) holderMap;
}
function getNum(Holder storage holder, address adrs) internal view returns (uint256 num) {
}
function setRefCode(Holder storage holder, address adrs, string refCode) internal {
}
function getRefCode(Holder storage holder, address adrs) internal view returns (string refCode) {
}
function add(Holder storage holder, address adrs, uint256 num) internal {
}
function sub(Holder storage holder, address adrs, uint256 num) internal {
}
function setNum(Holder storage holder, address adrs, uint256 num) internal {
}
function addRelatedRoundId(Holder storage holder, address adrs, uint256 roundId) internal {
}
function removeRelatedRoundId(Holder storage holder, address adrs, uint256 roundId) internal {
}
}
library RoundLib {
using SafeMath for uint256;
using HolderLib for HolderLib.Holder;
using TableLib for TableLib.Table;
event Log(string str, uint256 v1, uint256 v2, uint256 v3);
uint256 constant private roundSizeIncreasePercent = 160;
struct Round {
uint256 roundId;
uint256 roundNum;
uint256 max;
TableLib.Table investers;
uint256 raised;
uint256 pot;
address addressOfMaxInvestment;
}
function getInitRound(uint256 initSize) internal pure returns (Round) {
}
function getNextRound(Round storage round, uint256 initSize) internal view returns (Round) {
}
function add (Round storage round, address adrs, uint256 amount) internal
returns (bool isFinished, uint256 amountUsed) {
}
function getNum(Round storage round, address adrs) internal view returns (uint256) {
}
function getBalance(Round storage round, address adrs)
internal view returns (uint256) {
}
function moveToHolder(Round storage round, address adrs, HolderLib.Holder storage coinHolders) internal {
}
function getInvestList(Round storage round, uint256 page) internal view
returns (uint256 count, address[] addressList, uint256[] numList) {
}
}
library DealerLib {
using SafeMath for uint256;
struct DealerInfo {
address addr;
uint256 amount;
uint256 rate; // can not more than 300
}
struct Dealers {
mapping (string => DealerInfo) dealerMap;
mapping (address => string) addressToCodeMap;
}
function query(Dealers storage dealers, string code) internal view returns (DealerInfo storage) {
}
function queryCodeByAddress(Dealers storage dealers, address adrs) internal view returns (string code) {
}
function dealerExisted(Dealers storage dealers, string code) internal view returns (bool value) {
}
function insert(Dealers storage dealers, string code, address addr, uint256 rate) internal {
}
function update(Dealers storage dealers, string code, address addr, uint256 rate) internal {
}
function setDealer(Dealers storage dealers, string code, address addr, uint256 rate) private {
}
function addAmount(Dealers storage dealers, string code, uint256 amountUsed) internal
returns (uint256 amountToDealer) {
require(amountUsed > 0, "amount must be greater than 0");
require(<FILL_ME>)
amountToDealer = amountUsed * dealers.dealerMap[code].rate / 10000;
dealers.dealerMap[code].amount = dealers.dealerMap[code].amount.add(amountToDealer);
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
contract Cox is Ownable {
using SafeMath for uint256;
using HolderLib for HolderLib.Holder;
using RoundLib for RoundLib.Round;
using DealerLib for DealerLib.Dealers;
event RoundIn(address addr, uint256 amt, uint256 currentRoundRaised, uint256 round, uint256 bigRound, string refCode);
event Log(string str, uint256 value);
event PoolAdd(uint256 value);
event PoolSub(uint256 value);
uint256 private roundDuration = 1 days;
uint256 private initSize = 10 ether; // fund of first round
uint256 private minRecharge = 0.01 ether; // minimum of invest amount
bool private mIsActive = false;
bool private isAutoRestart = true;
uint256 private rate = 300; // 300 of ten thousand
string private defaultRefCode = "owner";
DealerLib.Dealers private dealers; // dealer information
HolderLib.Holder private coinHolders; // all investers information
RoundLib.Round[] private roundList;
uint256 private fundPoolSize;
uint256 private roundStartTime;
uint256 private roundEndTime;
uint256 private bigRound = 1;
uint256 private totalAmountInvested = 0;
constructor() public {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function poolAdd(uint256 value) private {
}
function poolSub(uint256 value) private {
}
modifier isActive() {
}
modifier callFromHuman(address addr) {
}
// deposit
function recharge(string code) public isActive callFromHuman(msg.sender) payable {
}
function moveRoundsToHolder(address adrs) internal {
}
function withdraw() public callFromHuman(msg.sender) {
}
function roundIn() public isActive {
}
function endRound() public isActive {
}
function endRoundWhenTimeout(RoundLib.Round storage curRound) private isActive {
}
function startNextRound(RoundLib.Round storage curRound) private {
}
function roundIn(uint256 amt, string code) private isActive {
}
function verifyCodeLength(string code) public pure returns (bool) {
}
function addDealer(string code, address addr, uint256 _rate) public onlyOwner {
}
function addDealerForSender(string code) public {
}
function getDealerInfo(string code) public view returns (string _code, address adrs, uint256 amount, uint256 _rate) {
}
function updateDealer(string code, address addr, uint256 _rate) public onlyOwner {
}
function setIsAutoRestart(bool isAuto) public onlyOwner {
}
function setMinRecharge(uint256 a) public onlyOwner {
}
function setRoundDuration(uint256 a) public onlyOwner {
}
function setInitSize(uint256 size) public onlyOwner {
}
function activate() public onlyOwner {
}
function setStartTime(uint256 startTime) public onlyOwner {
}
function deactivate() public onlyOwner {
}
function getGlobalInfo() public view returns
(bool _isActive, bool _isAutoRestart, uint256 _round, uint256 _bigRound,
uint256 _curRoundSize, uint256 _curRoundRaised, uint256 _fundPoolSize,
uint256 _roundStartTime, uint256 _roundEndTime, uint256 _totalAmountInvested) {
}
function getMyInfo() public view
returns (address ethAddress, uint256 balance, uint256 preRoundAmount, uint256 curRoundAmount,
string dealerCode, uint256 dealerAmount, uint256 dealerRate) {
}
function getAddressInfo(address _address) public view
returns (address ethAddress, uint256 balance, uint256 preRoundAmount, uint256 curRoundAmount,
string dealerCode, uint256 dealerAmount, uint256 dealerRate) {
}
function getBalanceFromRound(address adrs) internal view returns (uint256) {
}
function getRoundInfo(uint256 roundId, uint256 page) public view
returns (uint256 _roundId, uint256 roundNum, uint256 max, uint256 raised, uint256 pot,
uint256 count, address[] addressList, uint256[] numList) {
}
}
| dealerExisted(dealers,code),"code not exist" | 27,851 | dealerExisted(dealers,code) |
"code must not be empty" | pragma solidity ^0.4.17;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b)
internal
pure
returns (uint256)
{
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
}
}
library TableLib {
using SafeMath for uint256;
struct TableValue {
bool exists;
uint256 value;
}
struct Table {
mapping (address => TableValue) tableMapping;
address[] addressList;
}
function getNum(Table storage tbl, address adrs) internal view returns (uint256 num) {
}
function add(Table storage tbl, address adrs, uint256 num) internal {
}
function getValues(Table storage tbl, uint256 page) internal view
returns (uint256 count, address[] addressList, uint256[] numList) {
}
}
library HolderLib {
using SafeMath for uint256;
struct HolderValue {
uint256 value;
uint256[] relatedRoundIds;
uint256 fromIndex;
string refCode;
}
struct Holder {
mapping (address => HolderValue) holderMap;
}
function getNum(Holder storage holder, address adrs) internal view returns (uint256 num) {
}
function setRefCode(Holder storage holder, address adrs, string refCode) internal {
}
function getRefCode(Holder storage holder, address adrs) internal view returns (string refCode) {
}
function add(Holder storage holder, address adrs, uint256 num) internal {
}
function sub(Holder storage holder, address adrs, uint256 num) internal {
}
function setNum(Holder storage holder, address adrs, uint256 num) internal {
}
function addRelatedRoundId(Holder storage holder, address adrs, uint256 roundId) internal {
}
function removeRelatedRoundId(Holder storage holder, address adrs, uint256 roundId) internal {
}
}
library RoundLib {
using SafeMath for uint256;
using HolderLib for HolderLib.Holder;
using TableLib for TableLib.Table;
event Log(string str, uint256 v1, uint256 v2, uint256 v3);
uint256 constant private roundSizeIncreasePercent = 160;
struct Round {
uint256 roundId;
uint256 roundNum;
uint256 max;
TableLib.Table investers;
uint256 raised;
uint256 pot;
address addressOfMaxInvestment;
}
function getInitRound(uint256 initSize) internal pure returns (Round) {
}
function getNextRound(Round storage round, uint256 initSize) internal view returns (Round) {
}
function add (Round storage round, address adrs, uint256 amount) internal
returns (bool isFinished, uint256 amountUsed) {
}
function getNum(Round storage round, address adrs) internal view returns (uint256) {
}
function getBalance(Round storage round, address adrs)
internal view returns (uint256) {
}
function moveToHolder(Round storage round, address adrs, HolderLib.Holder storage coinHolders) internal {
}
function getInvestList(Round storage round, uint256 page) internal view
returns (uint256 count, address[] addressList, uint256[] numList) {
}
}
library DealerLib {
using SafeMath for uint256;
struct DealerInfo {
address addr;
uint256 amount;
uint256 rate; // can not more than 300
}
struct Dealers {
mapping (string => DealerInfo) dealerMap;
mapping (address => string) addressToCodeMap;
}
function query(Dealers storage dealers, string code) internal view returns (DealerInfo storage) {
}
function queryCodeByAddress(Dealers storage dealers, address adrs) internal view returns (string code) {
}
function dealerExisted(Dealers storage dealers, string code) internal view returns (bool value) {
}
function insert(Dealers storage dealers, string code, address addr, uint256 rate) internal {
}
function update(Dealers storage dealers, string code, address addr, uint256 rate) internal {
}
function setDealer(Dealers storage dealers, string code, address addr, uint256 rate) private {
}
function addAmount(Dealers storage dealers, string code, uint256 amountUsed) internal
returns (uint256 amountToDealer) {
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
contract Cox is Ownable {
using SafeMath for uint256;
using HolderLib for HolderLib.Holder;
using RoundLib for RoundLib.Round;
using DealerLib for DealerLib.Dealers;
event RoundIn(address addr, uint256 amt, uint256 currentRoundRaised, uint256 round, uint256 bigRound, string refCode);
event Log(string str, uint256 value);
event PoolAdd(uint256 value);
event PoolSub(uint256 value);
uint256 private roundDuration = 1 days;
uint256 private initSize = 10 ether; // fund of first round
uint256 private minRecharge = 0.01 ether; // minimum of invest amount
bool private mIsActive = false;
bool private isAutoRestart = true;
uint256 private rate = 300; // 300 of ten thousand
string private defaultRefCode = "owner";
DealerLib.Dealers private dealers; // dealer information
HolderLib.Holder private coinHolders; // all investers information
RoundLib.Round[] private roundList;
uint256 private fundPoolSize;
uint256 private roundStartTime;
uint256 private roundEndTime;
uint256 private bigRound = 1;
uint256 private totalAmountInvested = 0;
constructor() public {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function poolAdd(uint256 value) private {
}
function poolSub(uint256 value) private {
}
modifier isActive() {
}
modifier callFromHuman(address addr) {
}
// deposit
function recharge(string code) public isActive callFromHuman(msg.sender) payable {
}
function moveRoundsToHolder(address adrs) internal {
}
function withdraw() public callFromHuman(msg.sender) {
}
function roundIn() public isActive {
string memory code = coinHolders.getRefCode(msg.sender);
require(<FILL_ME>)
require(dealers.dealerExisted(code), "dealer not exist");
moveRoundsToHolder(msg.sender);
uint256 amount = coinHolders.getNum(msg.sender);
require(amount > 0, "your balance is 0");
roundIn(amount, code);
}
function endRound() public isActive {
}
function endRoundWhenTimeout(RoundLib.Round storage curRound) private isActive {
}
function startNextRound(RoundLib.Round storage curRound) private {
}
function roundIn(uint256 amt, string code) private isActive {
}
function verifyCodeLength(string code) public pure returns (bool) {
}
function addDealer(string code, address addr, uint256 _rate) public onlyOwner {
}
function addDealerForSender(string code) public {
}
function getDealerInfo(string code) public view returns (string _code, address adrs, uint256 amount, uint256 _rate) {
}
function updateDealer(string code, address addr, uint256 _rate) public onlyOwner {
}
function setIsAutoRestart(bool isAuto) public onlyOwner {
}
function setMinRecharge(uint256 a) public onlyOwner {
}
function setRoundDuration(uint256 a) public onlyOwner {
}
function setInitSize(uint256 size) public onlyOwner {
}
function activate() public onlyOwner {
}
function setStartTime(uint256 startTime) public onlyOwner {
}
function deactivate() public onlyOwner {
}
function getGlobalInfo() public view returns
(bool _isActive, bool _isAutoRestart, uint256 _round, uint256 _bigRound,
uint256 _curRoundSize, uint256 _curRoundRaised, uint256 _fundPoolSize,
uint256 _roundStartTime, uint256 _roundEndTime, uint256 _totalAmountInvested) {
}
function getMyInfo() public view
returns (address ethAddress, uint256 balance, uint256 preRoundAmount, uint256 curRoundAmount,
string dealerCode, uint256 dealerAmount, uint256 dealerRate) {
}
function getAddressInfo(address _address) public view
returns (address ethAddress, uint256 balance, uint256 preRoundAmount, uint256 curRoundAmount,
string dealerCode, uint256 dealerAmount, uint256 dealerRate) {
}
function getBalanceFromRound(address adrs) internal view returns (uint256) {
}
function getRoundInfo(uint256 roundId, uint256 page) public view
returns (uint256 _roundId, uint256 roundNum, uint256 max, uint256 raised, uint256 pot,
uint256 count, address[] addressList, uint256[] numList) {
}
}
| bytes(code).length>0,"code must not be empty" | 27,851 | bytes(code).length>0 |
"dealer not exist" | pragma solidity ^0.4.17;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b)
internal
pure
returns (uint256)
{
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
}
}
library TableLib {
using SafeMath for uint256;
struct TableValue {
bool exists;
uint256 value;
}
struct Table {
mapping (address => TableValue) tableMapping;
address[] addressList;
}
function getNum(Table storage tbl, address adrs) internal view returns (uint256 num) {
}
function add(Table storage tbl, address adrs, uint256 num) internal {
}
function getValues(Table storage tbl, uint256 page) internal view
returns (uint256 count, address[] addressList, uint256[] numList) {
}
}
library HolderLib {
using SafeMath for uint256;
struct HolderValue {
uint256 value;
uint256[] relatedRoundIds;
uint256 fromIndex;
string refCode;
}
struct Holder {
mapping (address => HolderValue) holderMap;
}
function getNum(Holder storage holder, address adrs) internal view returns (uint256 num) {
}
function setRefCode(Holder storage holder, address adrs, string refCode) internal {
}
function getRefCode(Holder storage holder, address adrs) internal view returns (string refCode) {
}
function add(Holder storage holder, address adrs, uint256 num) internal {
}
function sub(Holder storage holder, address adrs, uint256 num) internal {
}
function setNum(Holder storage holder, address adrs, uint256 num) internal {
}
function addRelatedRoundId(Holder storage holder, address adrs, uint256 roundId) internal {
}
function removeRelatedRoundId(Holder storage holder, address adrs, uint256 roundId) internal {
}
}
library RoundLib {
using SafeMath for uint256;
using HolderLib for HolderLib.Holder;
using TableLib for TableLib.Table;
event Log(string str, uint256 v1, uint256 v2, uint256 v3);
uint256 constant private roundSizeIncreasePercent = 160;
struct Round {
uint256 roundId;
uint256 roundNum;
uint256 max;
TableLib.Table investers;
uint256 raised;
uint256 pot;
address addressOfMaxInvestment;
}
function getInitRound(uint256 initSize) internal pure returns (Round) {
}
function getNextRound(Round storage round, uint256 initSize) internal view returns (Round) {
}
function add (Round storage round, address adrs, uint256 amount) internal
returns (bool isFinished, uint256 amountUsed) {
}
function getNum(Round storage round, address adrs) internal view returns (uint256) {
}
function getBalance(Round storage round, address adrs)
internal view returns (uint256) {
}
function moveToHolder(Round storage round, address adrs, HolderLib.Holder storage coinHolders) internal {
}
function getInvestList(Round storage round, uint256 page) internal view
returns (uint256 count, address[] addressList, uint256[] numList) {
}
}
library DealerLib {
using SafeMath for uint256;
struct DealerInfo {
address addr;
uint256 amount;
uint256 rate; // can not more than 300
}
struct Dealers {
mapping (string => DealerInfo) dealerMap;
mapping (address => string) addressToCodeMap;
}
function query(Dealers storage dealers, string code) internal view returns (DealerInfo storage) {
}
function queryCodeByAddress(Dealers storage dealers, address adrs) internal view returns (string code) {
}
function dealerExisted(Dealers storage dealers, string code) internal view returns (bool value) {
}
function insert(Dealers storage dealers, string code, address addr, uint256 rate) internal {
}
function update(Dealers storage dealers, string code, address addr, uint256 rate) internal {
}
function setDealer(Dealers storage dealers, string code, address addr, uint256 rate) private {
}
function addAmount(Dealers storage dealers, string code, uint256 amountUsed) internal
returns (uint256 amountToDealer) {
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
contract Cox is Ownable {
using SafeMath for uint256;
using HolderLib for HolderLib.Holder;
using RoundLib for RoundLib.Round;
using DealerLib for DealerLib.Dealers;
event RoundIn(address addr, uint256 amt, uint256 currentRoundRaised, uint256 round, uint256 bigRound, string refCode);
event Log(string str, uint256 value);
event PoolAdd(uint256 value);
event PoolSub(uint256 value);
uint256 private roundDuration = 1 days;
uint256 private initSize = 10 ether; // fund of first round
uint256 private minRecharge = 0.01 ether; // minimum of invest amount
bool private mIsActive = false;
bool private isAutoRestart = true;
uint256 private rate = 300; // 300 of ten thousand
string private defaultRefCode = "owner";
DealerLib.Dealers private dealers; // dealer information
HolderLib.Holder private coinHolders; // all investers information
RoundLib.Round[] private roundList;
uint256 private fundPoolSize;
uint256 private roundStartTime;
uint256 private roundEndTime;
uint256 private bigRound = 1;
uint256 private totalAmountInvested = 0;
constructor() public {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function poolAdd(uint256 value) private {
}
function poolSub(uint256 value) private {
}
modifier isActive() {
}
modifier callFromHuman(address addr) {
}
// deposit
function recharge(string code) public isActive callFromHuman(msg.sender) payable {
}
function moveRoundsToHolder(address adrs) internal {
}
function withdraw() public callFromHuman(msg.sender) {
}
function roundIn() public isActive {
string memory code = coinHolders.getRefCode(msg.sender);
require(bytes(code).length > 0, "code must not be empty");
require(<FILL_ME>)
moveRoundsToHolder(msg.sender);
uint256 amount = coinHolders.getNum(msg.sender);
require(amount > 0, "your balance is 0");
roundIn(amount, code);
}
function endRound() public isActive {
}
function endRoundWhenTimeout(RoundLib.Round storage curRound) private isActive {
}
function startNextRound(RoundLib.Round storage curRound) private {
}
function roundIn(uint256 amt, string code) private isActive {
}
function verifyCodeLength(string code) public pure returns (bool) {
}
function addDealer(string code, address addr, uint256 _rate) public onlyOwner {
}
function addDealerForSender(string code) public {
}
function getDealerInfo(string code) public view returns (string _code, address adrs, uint256 amount, uint256 _rate) {
}
function updateDealer(string code, address addr, uint256 _rate) public onlyOwner {
}
function setIsAutoRestart(bool isAuto) public onlyOwner {
}
function setMinRecharge(uint256 a) public onlyOwner {
}
function setRoundDuration(uint256 a) public onlyOwner {
}
function setInitSize(uint256 size) public onlyOwner {
}
function activate() public onlyOwner {
}
function setStartTime(uint256 startTime) public onlyOwner {
}
function deactivate() public onlyOwner {
}
function getGlobalInfo() public view returns
(bool _isActive, bool _isAutoRestart, uint256 _round, uint256 _bigRound,
uint256 _curRoundSize, uint256 _curRoundRaised, uint256 _fundPoolSize,
uint256 _roundStartTime, uint256 _roundEndTime, uint256 _totalAmountInvested) {
}
function getMyInfo() public view
returns (address ethAddress, uint256 balance, uint256 preRoundAmount, uint256 curRoundAmount,
string dealerCode, uint256 dealerAmount, uint256 dealerRate) {
}
function getAddressInfo(address _address) public view
returns (address ethAddress, uint256 balance, uint256 preRoundAmount, uint256 curRoundAmount,
string dealerCode, uint256 dealerAmount, uint256 dealerRate) {
}
function getBalanceFromRound(address adrs) internal view returns (uint256) {
}
function getRoundInfo(uint256 roundId, uint256 page) public view
returns (uint256 _roundId, uint256 roundNum, uint256 max, uint256 raised, uint256 pot,
uint256 count, address[] addressList, uint256[] numList) {
}
}
| dealers.dealerExisted(code),"dealer not exist" | 27,851 | dealers.dealerExisted(code) |
"not enough coin" | pragma solidity ^0.4.17;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b)
internal
pure
returns (uint256)
{
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
}
}
library TableLib {
using SafeMath for uint256;
struct TableValue {
bool exists;
uint256 value;
}
struct Table {
mapping (address => TableValue) tableMapping;
address[] addressList;
}
function getNum(Table storage tbl, address adrs) internal view returns (uint256 num) {
}
function add(Table storage tbl, address adrs, uint256 num) internal {
}
function getValues(Table storage tbl, uint256 page) internal view
returns (uint256 count, address[] addressList, uint256[] numList) {
}
}
library HolderLib {
using SafeMath for uint256;
struct HolderValue {
uint256 value;
uint256[] relatedRoundIds;
uint256 fromIndex;
string refCode;
}
struct Holder {
mapping (address => HolderValue) holderMap;
}
function getNum(Holder storage holder, address adrs) internal view returns (uint256 num) {
}
function setRefCode(Holder storage holder, address adrs, string refCode) internal {
}
function getRefCode(Holder storage holder, address adrs) internal view returns (string refCode) {
}
function add(Holder storage holder, address adrs, uint256 num) internal {
}
function sub(Holder storage holder, address adrs, uint256 num) internal {
}
function setNum(Holder storage holder, address adrs, uint256 num) internal {
}
function addRelatedRoundId(Holder storage holder, address adrs, uint256 roundId) internal {
}
function removeRelatedRoundId(Holder storage holder, address adrs, uint256 roundId) internal {
}
}
library RoundLib {
using SafeMath for uint256;
using HolderLib for HolderLib.Holder;
using TableLib for TableLib.Table;
event Log(string str, uint256 v1, uint256 v2, uint256 v3);
uint256 constant private roundSizeIncreasePercent = 160;
struct Round {
uint256 roundId;
uint256 roundNum;
uint256 max;
TableLib.Table investers;
uint256 raised;
uint256 pot;
address addressOfMaxInvestment;
}
function getInitRound(uint256 initSize) internal pure returns (Round) {
}
function getNextRound(Round storage round, uint256 initSize) internal view returns (Round) {
}
function add (Round storage round, address adrs, uint256 amount) internal
returns (bool isFinished, uint256 amountUsed) {
}
function getNum(Round storage round, address adrs) internal view returns (uint256) {
}
function getBalance(Round storage round, address adrs)
internal view returns (uint256) {
}
function moveToHolder(Round storage round, address adrs, HolderLib.Holder storage coinHolders) internal {
}
function getInvestList(Round storage round, uint256 page) internal view
returns (uint256 count, address[] addressList, uint256[] numList) {
}
}
library DealerLib {
using SafeMath for uint256;
struct DealerInfo {
address addr;
uint256 amount;
uint256 rate; // can not more than 300
}
struct Dealers {
mapping (string => DealerInfo) dealerMap;
mapping (address => string) addressToCodeMap;
}
function query(Dealers storage dealers, string code) internal view returns (DealerInfo storage) {
}
function queryCodeByAddress(Dealers storage dealers, address adrs) internal view returns (string code) {
}
function dealerExisted(Dealers storage dealers, string code) internal view returns (bool value) {
}
function insert(Dealers storage dealers, string code, address addr, uint256 rate) internal {
}
function update(Dealers storage dealers, string code, address addr, uint256 rate) internal {
}
function setDealer(Dealers storage dealers, string code, address addr, uint256 rate) private {
}
function addAmount(Dealers storage dealers, string code, uint256 amountUsed) internal
returns (uint256 amountToDealer) {
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
contract Cox is Ownable {
using SafeMath for uint256;
using HolderLib for HolderLib.Holder;
using RoundLib for RoundLib.Round;
using DealerLib for DealerLib.Dealers;
event RoundIn(address addr, uint256 amt, uint256 currentRoundRaised, uint256 round, uint256 bigRound, string refCode);
event Log(string str, uint256 value);
event PoolAdd(uint256 value);
event PoolSub(uint256 value);
uint256 private roundDuration = 1 days;
uint256 private initSize = 10 ether; // fund of first round
uint256 private minRecharge = 0.01 ether; // minimum of invest amount
bool private mIsActive = false;
bool private isAutoRestart = true;
uint256 private rate = 300; // 300 of ten thousand
string private defaultRefCode = "owner";
DealerLib.Dealers private dealers; // dealer information
HolderLib.Holder private coinHolders; // all investers information
RoundLib.Round[] private roundList;
uint256 private fundPoolSize;
uint256 private roundStartTime;
uint256 private roundEndTime;
uint256 private bigRound = 1;
uint256 private totalAmountInvested = 0;
constructor() public {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function poolAdd(uint256 value) private {
}
function poolSub(uint256 value) private {
}
modifier isActive() {
}
modifier callFromHuman(address addr) {
}
// deposit
function recharge(string code) public isActive callFromHuman(msg.sender) payable {
}
function moveRoundsToHolder(address adrs) internal {
}
function withdraw() public callFromHuman(msg.sender) {
}
function roundIn() public isActive {
}
function endRound() public isActive {
}
function endRoundWhenTimeout(RoundLib.Round storage curRound) private isActive {
}
function startNextRound(RoundLib.Round storage curRound) private {
}
function roundIn(uint256 amt, string code) private isActive {
require(<FILL_ME>)
RoundLib.Round storage curRound = roundList[roundList.length - 1];
if (now >= roundEndTime) {
endRoundWhenTimeout(curRound);
return;
}
(bool isFinished, uint256 amountUsed) = curRound.add(msg.sender, amt);
totalAmountInvested = totalAmountInvested.add(amountUsed);
require(amountUsed > 0, 'amountUsed must greater than 0');
emit RoundIn(msg.sender, amountUsed, curRound.raised, curRound.roundNum, bigRound, code);
coinHolders.addRelatedRoundId(msg.sender, curRound.roundId);
coinHolders.sub(msg.sender, amountUsed);
uint256 amountToDealer = dealers.addAmount(code, amountUsed);
uint256 amountToOwner = (amountUsed * rate / 10000).sub(amountToDealer);
coinHolders.add(owner, amountToOwner);
coinHolders.add(dealers.query(code).addr, amountToDealer);
poolAdd(amountUsed.sub(amountToDealer).sub(amountToOwner));
if (isFinished) {
if (curRound.roundNum > 1) {
RoundLib.Round storage preRound2 = roundList[roundList.length - 2];
preRound2.pot = preRound2.max * 11 / 10;
poolSub(preRound2.pot);
}
startNextRound(curRound);
}
}
function verifyCodeLength(string code) public pure returns (bool) {
}
function addDealer(string code, address addr, uint256 _rate) public onlyOwner {
}
function addDealerForSender(string code) public {
}
function getDealerInfo(string code) public view returns (string _code, address adrs, uint256 amount, uint256 _rate) {
}
function updateDealer(string code, address addr, uint256 _rate) public onlyOwner {
}
function setIsAutoRestart(bool isAuto) public onlyOwner {
}
function setMinRecharge(uint256 a) public onlyOwner {
}
function setRoundDuration(uint256 a) public onlyOwner {
}
function setInitSize(uint256 size) public onlyOwner {
}
function activate() public onlyOwner {
}
function setStartTime(uint256 startTime) public onlyOwner {
}
function deactivate() public onlyOwner {
}
function getGlobalInfo() public view returns
(bool _isActive, bool _isAutoRestart, uint256 _round, uint256 _bigRound,
uint256 _curRoundSize, uint256 _curRoundRaised, uint256 _fundPoolSize,
uint256 _roundStartTime, uint256 _roundEndTime, uint256 _totalAmountInvested) {
}
function getMyInfo() public view
returns (address ethAddress, uint256 balance, uint256 preRoundAmount, uint256 curRoundAmount,
string dealerCode, uint256 dealerAmount, uint256 dealerRate) {
}
function getAddressInfo(address _address) public view
returns (address ethAddress, uint256 balance, uint256 preRoundAmount, uint256 curRoundAmount,
string dealerCode, uint256 dealerAmount, uint256 dealerRate) {
}
function getBalanceFromRound(address adrs) internal view returns (uint256) {
}
function getRoundInfo(uint256 roundId, uint256 page) public view
returns (uint256 _roundId, uint256 roundNum, uint256 max, uint256 raised, uint256 pot,
uint256 count, address[] addressList, uint256[] numList) {
}
}
| coinHolders.getNum(msg.sender)>=amt,"not enough coin" | 27,851 | coinHolders.getNum(msg.sender)>=amt |
"code length should between 4 and 20" | pragma solidity ^0.4.17;
library SafeMath {
/**
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
}
/**
* @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b)
internal
pure
returns (uint256)
{
}
/**
* @dev Adds two numbers, throws on overflow.
*/
function add(uint256 a, uint256 b)
internal
pure
returns (uint256 c)
{
}
}
library TableLib {
using SafeMath for uint256;
struct TableValue {
bool exists;
uint256 value;
}
struct Table {
mapping (address => TableValue) tableMapping;
address[] addressList;
}
function getNum(Table storage tbl, address adrs) internal view returns (uint256 num) {
}
function add(Table storage tbl, address adrs, uint256 num) internal {
}
function getValues(Table storage tbl, uint256 page) internal view
returns (uint256 count, address[] addressList, uint256[] numList) {
}
}
library HolderLib {
using SafeMath for uint256;
struct HolderValue {
uint256 value;
uint256[] relatedRoundIds;
uint256 fromIndex;
string refCode;
}
struct Holder {
mapping (address => HolderValue) holderMap;
}
function getNum(Holder storage holder, address adrs) internal view returns (uint256 num) {
}
function setRefCode(Holder storage holder, address adrs, string refCode) internal {
}
function getRefCode(Holder storage holder, address adrs) internal view returns (string refCode) {
}
function add(Holder storage holder, address adrs, uint256 num) internal {
}
function sub(Holder storage holder, address adrs, uint256 num) internal {
}
function setNum(Holder storage holder, address adrs, uint256 num) internal {
}
function addRelatedRoundId(Holder storage holder, address adrs, uint256 roundId) internal {
}
function removeRelatedRoundId(Holder storage holder, address adrs, uint256 roundId) internal {
}
}
library RoundLib {
using SafeMath for uint256;
using HolderLib for HolderLib.Holder;
using TableLib for TableLib.Table;
event Log(string str, uint256 v1, uint256 v2, uint256 v3);
uint256 constant private roundSizeIncreasePercent = 160;
struct Round {
uint256 roundId;
uint256 roundNum;
uint256 max;
TableLib.Table investers;
uint256 raised;
uint256 pot;
address addressOfMaxInvestment;
}
function getInitRound(uint256 initSize) internal pure returns (Round) {
}
function getNextRound(Round storage round, uint256 initSize) internal view returns (Round) {
}
function add (Round storage round, address adrs, uint256 amount) internal
returns (bool isFinished, uint256 amountUsed) {
}
function getNum(Round storage round, address adrs) internal view returns (uint256) {
}
function getBalance(Round storage round, address adrs)
internal view returns (uint256) {
}
function moveToHolder(Round storage round, address adrs, HolderLib.Holder storage coinHolders) internal {
}
function getInvestList(Round storage round, uint256 page) internal view
returns (uint256 count, address[] addressList, uint256[] numList) {
}
}
library DealerLib {
using SafeMath for uint256;
struct DealerInfo {
address addr;
uint256 amount;
uint256 rate; // can not more than 300
}
struct Dealers {
mapping (string => DealerInfo) dealerMap;
mapping (address => string) addressToCodeMap;
}
function query(Dealers storage dealers, string code) internal view returns (DealerInfo storage) {
}
function queryCodeByAddress(Dealers storage dealers, address adrs) internal view returns (string code) {
}
function dealerExisted(Dealers storage dealers, string code) internal view returns (bool value) {
}
function insert(Dealers storage dealers, string code, address addr, uint256 rate) internal {
}
function update(Dealers storage dealers, string code, address addr, uint256 rate) internal {
}
function setDealer(Dealers storage dealers, string code, address addr, uint256 rate) private {
}
function addAmount(Dealers storage dealers, string code, uint256 amountUsed) internal
returns (uint256 amountToDealer) {
}
}
contract Ownable {
address public owner;
event OwnershipRenounced(address indexed previousOwner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor() public {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function transferOwnership(address _newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param _newOwner The address to transfer ownership to.
*/
function _transferOwnership(address _newOwner) internal {
}
}
contract Cox is Ownable {
using SafeMath for uint256;
using HolderLib for HolderLib.Holder;
using RoundLib for RoundLib.Round;
using DealerLib for DealerLib.Dealers;
event RoundIn(address addr, uint256 amt, uint256 currentRoundRaised, uint256 round, uint256 bigRound, string refCode);
event Log(string str, uint256 value);
event PoolAdd(uint256 value);
event PoolSub(uint256 value);
uint256 private roundDuration = 1 days;
uint256 private initSize = 10 ether; // fund of first round
uint256 private minRecharge = 0.01 ether; // minimum of invest amount
bool private mIsActive = false;
bool private isAutoRestart = true;
uint256 private rate = 300; // 300 of ten thousand
string private defaultRefCode = "owner";
DealerLib.Dealers private dealers; // dealer information
HolderLib.Holder private coinHolders; // all investers information
RoundLib.Round[] private roundList;
uint256 private fundPoolSize;
uint256 private roundStartTime;
uint256 private roundEndTime;
uint256 private bigRound = 1;
uint256 private totalAmountInvested = 0;
constructor() public {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function poolAdd(uint256 value) private {
}
function poolSub(uint256 value) private {
}
modifier isActive() {
}
modifier callFromHuman(address addr) {
}
// deposit
function recharge(string code) public isActive callFromHuman(msg.sender) payable {
}
function moveRoundsToHolder(address adrs) internal {
}
function withdraw() public callFromHuman(msg.sender) {
}
function roundIn() public isActive {
}
function endRound() public isActive {
}
function endRoundWhenTimeout(RoundLib.Round storage curRound) private isActive {
}
function startNextRound(RoundLib.Round storage curRound) private {
}
function roundIn(uint256 amt, string code) private isActive {
}
function verifyCodeLength(string code) public pure returns (bool) {
}
function addDealer(string code, address addr, uint256 _rate) public onlyOwner {
require(<FILL_ME>)
dealers.insert(code, addr, _rate);
}
function addDealerForSender(string code) public {
}
function getDealerInfo(string code) public view returns (string _code, address adrs, uint256 amount, uint256 _rate) {
}
function updateDealer(string code, address addr, uint256 _rate) public onlyOwner {
}
function setIsAutoRestart(bool isAuto) public onlyOwner {
}
function setMinRecharge(uint256 a) public onlyOwner {
}
function setRoundDuration(uint256 a) public onlyOwner {
}
function setInitSize(uint256 size) public onlyOwner {
}
function activate() public onlyOwner {
}
function setStartTime(uint256 startTime) public onlyOwner {
}
function deactivate() public onlyOwner {
}
function getGlobalInfo() public view returns
(bool _isActive, bool _isAutoRestart, uint256 _round, uint256 _bigRound,
uint256 _curRoundSize, uint256 _curRoundRaised, uint256 _fundPoolSize,
uint256 _roundStartTime, uint256 _roundEndTime, uint256 _totalAmountInvested) {
}
function getMyInfo() public view
returns (address ethAddress, uint256 balance, uint256 preRoundAmount, uint256 curRoundAmount,
string dealerCode, uint256 dealerAmount, uint256 dealerRate) {
}
function getAddressInfo(address _address) public view
returns (address ethAddress, uint256 balance, uint256 preRoundAmount, uint256 curRoundAmount,
string dealerCode, uint256 dealerAmount, uint256 dealerRate) {
}
function getBalanceFromRound(address adrs) internal view returns (uint256) {
}
function getRoundInfo(uint256 roundId, uint256 page) public view
returns (uint256 _roundId, uint256 roundNum, uint256 max, uint256 raised, uint256 pot,
uint256 count, address[] addressList, uint256[] numList) {
}
}
| verifyCodeLength(code),"code length should between 4 and 20" | 27,851 | verifyCodeLength(code) |
"string cannot start or end with space" | pragma solidity ^0.4.24;
interface ExtSettingInterface {
function getLongGap() external returns(uint256);
function setLongGap(uint256 _gap) external;
function getLongExtra() external returns(uint256);
function setLongExtra(uint256 _extra) external;
}
interface FoundationInterface {
function deposit() external payable;
}
interface PlayerBookInterface {
function getPlayerID(address _addr) external returns (uint256);
function getPlayerName(uint256 _pID) external view returns (bytes32);
function getPlayerLAff(uint256 _pID) external view returns (uint256);
function getPlayerAddr(uint256 _pID) external view returns (address);
function getNameFee() external view returns (uint256);
function registerNameXIDFromDapp(address _addr, bytes32 _name, uint256 _affCode, bool _all) external payable returns(bool, uint256);
function registerNameXaddrFromDapp(address _addr, bytes32 _name, address _affCode, bool _all) external payable returns(bool, uint256);
function registerNameXnameFromDapp(address _addr, bytes32 _name, bytes32 _affCode, bool _all) external payable returns(bool, uint256);
}
contract Events {
event onNewName(
uint256 indexed playerID,
address indexed playerAddress,
bytes32 indexed playerName,
bool isNewPlayer,
uint256 affiliateID,
address affiliateAddress,
bytes32 affiliateName,
uint256 amountPaid,
uint256 timeStamp
);
event onEndTx(
uint256 compressedData,
uint256 compressedIDs,
bytes32 playerName,
address playerAddress,
uint256 ethIn,
uint256 keysBought,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount,
uint256 potAmount,
uint256 airDropPot
);
event onWithdraw(
uint256 indexed playerID,
address playerAddress,
bytes32 playerName,
uint256 ethOut,
uint256 timeStamp
);
event onWithdrawAndDistribute(
address playerAddress,
bytes32 playerName,
uint256 ethOut,
uint256 compressedData,
uint256 compressedIDs,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount
);
event onBuyAndDistribute(
address playerAddress,
bytes32 playerName,
uint256 ethIn,
uint256 compressedData,
uint256 compressedIDs,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount
);
event onReLoadAndDistribute(
address playerAddress,
bytes32 playerName,
uint256 compressedData,
uint256 compressedIDs,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount
);
event onAffiliatePayout(
uint256 indexed affiliateID,
address affiliateAddress,
bytes32 affiliateName,
uint256 indexed roundID,
uint256 indexed buyerID,
uint256 amount,
uint256 timeStamp
);
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
}
modifier onlyOwner() {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
}
contract Fomo3D is Ownable, Events {
using SafeMath for *;
using NameFilter for string;
using KeysCalcLong for uint256;
ExtSettingInterface private extSetting = ExtSettingInterface(0xb62aB70d1418c3Dfad706C0FdEA6499d2F380cE9);
FoundationInterface private foundation = FoundationInterface(0xC00C9ed7f35Ca2373462FD46d672084a6a128E2B);
PlayerBookInterface private playerBook = PlayerBookInterface(0x6384FE27b7b6cC999Aa750689c6B04acaeaB78D7);
string constant public name = "Fomo3D Asia (Official)";
string constant public symbol = "F3DA";
uint256 constant private rndInit_ = 1 hours;
uint256 constant private rndInc_ = 30 seconds;
uint256 constant private rndMax_ = 24 hours;
uint256 private rndExtra_ = extSetting.getLongExtra();
uint256 private rndGap_ = extSetting.getLongGap();
uint256 public airDropPot_;
uint256 public airDropTracker_ = 0;
uint256 public rID_;
bool public activated_ = false;
mapping (address => uint256) public pIDxAddr_;
mapping (bytes32 => uint256) public pIDxName_;
mapping (uint256 => Datasets.Player) public plyr_;
mapping (uint256 => mapping (uint256 => Datasets.PlayerRounds)) public plyrRnds_;
mapping (uint256 => mapping (bytes32 => bool)) public plyrNames_;
mapping (uint256 => Datasets.Round) public round_;
mapping (uint256 => mapping(uint256 => uint256)) public rndTmEth_;
mapping (uint256 => uint256) public fees_;
mapping (uint256 => uint256) public potSplit_;
modifier isActivated() {
}
modifier isHuman() {
}
modifier isWithinLimits(uint256 _eth) {
}
constructor() public {
}
function() public payable isActivated isHuman isWithinLimits(msg.value) {
}
function setExtSettingInterface(address _extSetting) public onlyOwner {
}
function setFoundationInterface(address _foundation) public onlyOwner {
}
function setPlayerBookInterface(address _playerBook) public onlyOwner {
}
function buyXid(uint256 _affCode, uint256 _team) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function buyXaddr(address _affCode, uint256 _team) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function buyXname(bytes32 _affCode, uint256 _team) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function reLoadXid(uint256 _affCode, uint256 _team, uint256 _eth) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function reLoadXaddr(address _affCode, uint256 _team, uint256 _eth) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function reLoadXname(bytes32 _affCode, uint256 _team, uint256 _eth) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function withdraw() public isActivated isHuman {
}
function registerNameXID(string _nameString, uint256 _affCode, bool _all) public payable isHuman {
}
function registerNameXaddr(string _nameString, address _affCode, bool _all) public payable isHuman {
}
function registerNameXname(string _nameString, bytes32 _affCode, bool _all) public payable isHuman {
}
function getBuyPrice() public view returns(uint256) {
}
function getTimeLeft() public view returns(uint256) {
}
function getPlayerVaults(uint256 _pID) public view returns(uint256 ,uint256, uint256) {
}
function getPlayerVaultsHelper(uint256 _pID, uint256 _rID) private view returns(uint256) {
}
function getCurrentRoundInfo() public view returns(uint256, uint256, uint256, uint256, uint256, uint256, uint256, address, bytes32, uint256, uint256, uint256, uint256, uint256) {
}
function getPlayerInfoByAddress(address _addr) public view returns(uint256, bytes32, uint256, uint256, uint256, uint256, uint256) {
}
function buyCore(uint256 _pID, uint256 _affID, uint256 _team, Datasets.EventData memory _eventData_) private {
}
function reLoadCore(uint256 _pID, uint256 _affID, uint256 _team, uint256 _eth, Datasets.EventData memory _eventData_) private {
}
function core(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, uint256 _team, Datasets.EventData memory _eventData_) private {
}
function calcUnMaskedEarnings(uint256 _pID, uint256 _rIDlast) private view returns(uint256) {
}
function calcKeysReceived(uint256 _rID, uint256 _eth) public view returns(uint256) {
}
function iWantXKeys(uint256 _keys) public view returns(uint256) {
}
function receivePlayerInfo(uint256 _pID, address _addr, bytes32 _name, uint256 _laff) external {
}
function receivePlayerNameList(uint256 _pID, bytes32 _name) external {
}
function determinePID(Datasets.EventData memory _eventData_) private returns (Datasets.EventData) {
}
function verifyTeam(uint256 _team) private pure returns (uint256) {
}
function managePlayer(uint256 _pID, Datasets.EventData memory _eventData_) private returns (Datasets.EventData) {
}
function endRound(Datasets.EventData memory _eventData_) private returns (Datasets.EventData) {
}
function updateGenVault(uint256 _pID, uint256 _rIDlast) private {
}
function updateTimer(uint256 _keys, uint256 _rID) private {
}
function airdrop() private view returns(bool) {
}
function distributeExternal(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, Datasets.EventData memory _eventData_) private returns(Datasets.EventData) {
}
function distributeInternal(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _team, uint256 _keys, Datasets.EventData memory _eventData_) private returns(Datasets.EventData) {
}
function updateMasks(uint256 _rID, uint256 _pID, uint256 _gen, uint256 _keys) private returns(uint256) {
}
function withdrawEarnings(uint256 _pID) private returns(uint256) {
}
function endTx(uint256 _pID, uint256 _team, uint256 _eth, uint256 _keys, Datasets.EventData memory _eventData_) private {
}
function activate() public onlyOwner {
}
}
library Datasets {
struct EventData {
uint256 compressedData;
uint256 compressedIDs;
address winnerAddr;
bytes32 winnerName;
uint256 amountWon;
uint256 newPot;
uint256 genAmount;
uint256 potAmount;
}
struct Player {
address addr;
bytes32 name;
uint256 win;
uint256 gen;
uint256 aff;
uint256 lrnd;
uint256 laff;
}
struct PlayerRounds {
uint256 eth;
uint256 keys;
uint256 mask;
uint256 ico;
}
struct Round {
uint256 plyr;
uint256 team;
uint256 end;
bool ended;
uint256 strt;
uint256 keys;
uint256 eth;
uint256 pot;
uint256 mask;
uint256 ico;
uint256 icoGen;
uint256 icoAvg;
}
}
library KeysCalcLong {
using SafeMath for *;
function keysRec(uint256 _curEth, uint256 _newEth) internal pure returns (uint256) {
}
function ethRec(uint256 _curKeys, uint256 _sellKeys) internal pure returns (uint256) {
}
function keys(uint256 _eth) internal pure returns(uint256) {
}
function eth(uint256 _keys) internal pure returns(uint256) {
}
}
library NameFilter {
function nameFilter(string _input) internal pure returns(bytes32) {
bytes memory _temp = bytes(_input);
uint256 _length = _temp.length;
require (_length <= 32 && _length > 0, "string must be between 1 and 32 characters");
require(<FILL_ME>)
if (_temp[0] == 0x30) {
require(_temp[1] != 0x78, "string cannot start with 0x");
require(_temp[1] != 0x58, "string cannot start with 0X");
}
bool _hasNonNumber;
for (uint256 i = 0; i < _length; i++) {
if (_temp[i] > 0x40 && _temp[i] < 0x5b) {
_temp[i] = byte(uint(_temp[i]) + 32);
if (_hasNonNumber == false) {
_hasNonNumber = true;
}
} else {
require(_temp[i] == 0x20 || (_temp[i] > 0x60 && _temp[i] < 0x7b) || (_temp[i] > 0x2f && _temp[i] < 0x3a), "string contains invalid characters");
if (_temp[i] == 0x20) {
require( _temp[i+1] != 0x20, "string cannot contain consecutive spaces");
}
if (_hasNonNumber == false && (_temp[i] < 0x30 || _temp[i] > 0x39)) {
_hasNonNumber = true;
}
}
}
require(_hasNonNumber == true, "string cannot be only numbers");
bytes32 _ret;
assembly {
_ret := mload(add(_temp, 32))
}
return (_ret);
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
}
function sq(uint256 x) internal pure returns (uint256) {
}
function pwr(uint256 x, uint256 y) internal pure returns (uint256) {
}
}
| _temp[0]!=0x20&&_temp[_length-1]!=0x20,"string cannot start or end with space" | 27,906 | _temp[0]!=0x20&&_temp[_length-1]!=0x20 |
"string cannot start with 0x" | pragma solidity ^0.4.24;
interface ExtSettingInterface {
function getLongGap() external returns(uint256);
function setLongGap(uint256 _gap) external;
function getLongExtra() external returns(uint256);
function setLongExtra(uint256 _extra) external;
}
interface FoundationInterface {
function deposit() external payable;
}
interface PlayerBookInterface {
function getPlayerID(address _addr) external returns (uint256);
function getPlayerName(uint256 _pID) external view returns (bytes32);
function getPlayerLAff(uint256 _pID) external view returns (uint256);
function getPlayerAddr(uint256 _pID) external view returns (address);
function getNameFee() external view returns (uint256);
function registerNameXIDFromDapp(address _addr, bytes32 _name, uint256 _affCode, bool _all) external payable returns(bool, uint256);
function registerNameXaddrFromDapp(address _addr, bytes32 _name, address _affCode, bool _all) external payable returns(bool, uint256);
function registerNameXnameFromDapp(address _addr, bytes32 _name, bytes32 _affCode, bool _all) external payable returns(bool, uint256);
}
contract Events {
event onNewName(
uint256 indexed playerID,
address indexed playerAddress,
bytes32 indexed playerName,
bool isNewPlayer,
uint256 affiliateID,
address affiliateAddress,
bytes32 affiliateName,
uint256 amountPaid,
uint256 timeStamp
);
event onEndTx(
uint256 compressedData,
uint256 compressedIDs,
bytes32 playerName,
address playerAddress,
uint256 ethIn,
uint256 keysBought,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount,
uint256 potAmount,
uint256 airDropPot
);
event onWithdraw(
uint256 indexed playerID,
address playerAddress,
bytes32 playerName,
uint256 ethOut,
uint256 timeStamp
);
event onWithdrawAndDistribute(
address playerAddress,
bytes32 playerName,
uint256 ethOut,
uint256 compressedData,
uint256 compressedIDs,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount
);
event onBuyAndDistribute(
address playerAddress,
bytes32 playerName,
uint256 ethIn,
uint256 compressedData,
uint256 compressedIDs,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount
);
event onReLoadAndDistribute(
address playerAddress,
bytes32 playerName,
uint256 compressedData,
uint256 compressedIDs,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount
);
event onAffiliatePayout(
uint256 indexed affiliateID,
address affiliateAddress,
bytes32 affiliateName,
uint256 indexed roundID,
uint256 indexed buyerID,
uint256 amount,
uint256 timeStamp
);
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
}
modifier onlyOwner() {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
}
contract Fomo3D is Ownable, Events {
using SafeMath for *;
using NameFilter for string;
using KeysCalcLong for uint256;
ExtSettingInterface private extSetting = ExtSettingInterface(0xb62aB70d1418c3Dfad706C0FdEA6499d2F380cE9);
FoundationInterface private foundation = FoundationInterface(0xC00C9ed7f35Ca2373462FD46d672084a6a128E2B);
PlayerBookInterface private playerBook = PlayerBookInterface(0x6384FE27b7b6cC999Aa750689c6B04acaeaB78D7);
string constant public name = "Fomo3D Asia (Official)";
string constant public symbol = "F3DA";
uint256 constant private rndInit_ = 1 hours;
uint256 constant private rndInc_ = 30 seconds;
uint256 constant private rndMax_ = 24 hours;
uint256 private rndExtra_ = extSetting.getLongExtra();
uint256 private rndGap_ = extSetting.getLongGap();
uint256 public airDropPot_;
uint256 public airDropTracker_ = 0;
uint256 public rID_;
bool public activated_ = false;
mapping (address => uint256) public pIDxAddr_;
mapping (bytes32 => uint256) public pIDxName_;
mapping (uint256 => Datasets.Player) public plyr_;
mapping (uint256 => mapping (uint256 => Datasets.PlayerRounds)) public plyrRnds_;
mapping (uint256 => mapping (bytes32 => bool)) public plyrNames_;
mapping (uint256 => Datasets.Round) public round_;
mapping (uint256 => mapping(uint256 => uint256)) public rndTmEth_;
mapping (uint256 => uint256) public fees_;
mapping (uint256 => uint256) public potSplit_;
modifier isActivated() {
}
modifier isHuman() {
}
modifier isWithinLimits(uint256 _eth) {
}
constructor() public {
}
function() public payable isActivated isHuman isWithinLimits(msg.value) {
}
function setExtSettingInterface(address _extSetting) public onlyOwner {
}
function setFoundationInterface(address _foundation) public onlyOwner {
}
function setPlayerBookInterface(address _playerBook) public onlyOwner {
}
function buyXid(uint256 _affCode, uint256 _team) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function buyXaddr(address _affCode, uint256 _team) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function buyXname(bytes32 _affCode, uint256 _team) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function reLoadXid(uint256 _affCode, uint256 _team, uint256 _eth) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function reLoadXaddr(address _affCode, uint256 _team, uint256 _eth) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function reLoadXname(bytes32 _affCode, uint256 _team, uint256 _eth) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function withdraw() public isActivated isHuman {
}
function registerNameXID(string _nameString, uint256 _affCode, bool _all) public payable isHuman {
}
function registerNameXaddr(string _nameString, address _affCode, bool _all) public payable isHuman {
}
function registerNameXname(string _nameString, bytes32 _affCode, bool _all) public payable isHuman {
}
function getBuyPrice() public view returns(uint256) {
}
function getTimeLeft() public view returns(uint256) {
}
function getPlayerVaults(uint256 _pID) public view returns(uint256 ,uint256, uint256) {
}
function getPlayerVaultsHelper(uint256 _pID, uint256 _rID) private view returns(uint256) {
}
function getCurrentRoundInfo() public view returns(uint256, uint256, uint256, uint256, uint256, uint256, uint256, address, bytes32, uint256, uint256, uint256, uint256, uint256) {
}
function getPlayerInfoByAddress(address _addr) public view returns(uint256, bytes32, uint256, uint256, uint256, uint256, uint256) {
}
function buyCore(uint256 _pID, uint256 _affID, uint256 _team, Datasets.EventData memory _eventData_) private {
}
function reLoadCore(uint256 _pID, uint256 _affID, uint256 _team, uint256 _eth, Datasets.EventData memory _eventData_) private {
}
function core(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, uint256 _team, Datasets.EventData memory _eventData_) private {
}
function calcUnMaskedEarnings(uint256 _pID, uint256 _rIDlast) private view returns(uint256) {
}
function calcKeysReceived(uint256 _rID, uint256 _eth) public view returns(uint256) {
}
function iWantXKeys(uint256 _keys) public view returns(uint256) {
}
function receivePlayerInfo(uint256 _pID, address _addr, bytes32 _name, uint256 _laff) external {
}
function receivePlayerNameList(uint256 _pID, bytes32 _name) external {
}
function determinePID(Datasets.EventData memory _eventData_) private returns (Datasets.EventData) {
}
function verifyTeam(uint256 _team) private pure returns (uint256) {
}
function managePlayer(uint256 _pID, Datasets.EventData memory _eventData_) private returns (Datasets.EventData) {
}
function endRound(Datasets.EventData memory _eventData_) private returns (Datasets.EventData) {
}
function updateGenVault(uint256 _pID, uint256 _rIDlast) private {
}
function updateTimer(uint256 _keys, uint256 _rID) private {
}
function airdrop() private view returns(bool) {
}
function distributeExternal(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, Datasets.EventData memory _eventData_) private returns(Datasets.EventData) {
}
function distributeInternal(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _team, uint256 _keys, Datasets.EventData memory _eventData_) private returns(Datasets.EventData) {
}
function updateMasks(uint256 _rID, uint256 _pID, uint256 _gen, uint256 _keys) private returns(uint256) {
}
function withdrawEarnings(uint256 _pID) private returns(uint256) {
}
function endTx(uint256 _pID, uint256 _team, uint256 _eth, uint256 _keys, Datasets.EventData memory _eventData_) private {
}
function activate() public onlyOwner {
}
}
library Datasets {
struct EventData {
uint256 compressedData;
uint256 compressedIDs;
address winnerAddr;
bytes32 winnerName;
uint256 amountWon;
uint256 newPot;
uint256 genAmount;
uint256 potAmount;
}
struct Player {
address addr;
bytes32 name;
uint256 win;
uint256 gen;
uint256 aff;
uint256 lrnd;
uint256 laff;
}
struct PlayerRounds {
uint256 eth;
uint256 keys;
uint256 mask;
uint256 ico;
}
struct Round {
uint256 plyr;
uint256 team;
uint256 end;
bool ended;
uint256 strt;
uint256 keys;
uint256 eth;
uint256 pot;
uint256 mask;
uint256 ico;
uint256 icoGen;
uint256 icoAvg;
}
}
library KeysCalcLong {
using SafeMath for *;
function keysRec(uint256 _curEth, uint256 _newEth) internal pure returns (uint256) {
}
function ethRec(uint256 _curKeys, uint256 _sellKeys) internal pure returns (uint256) {
}
function keys(uint256 _eth) internal pure returns(uint256) {
}
function eth(uint256 _keys) internal pure returns(uint256) {
}
}
library NameFilter {
function nameFilter(string _input) internal pure returns(bytes32) {
bytes memory _temp = bytes(_input);
uint256 _length = _temp.length;
require (_length <= 32 && _length > 0, "string must be between 1 and 32 characters");
require(_temp[0] != 0x20 && _temp[_length-1] != 0x20, "string cannot start or end with space");
if (_temp[0] == 0x30) {
require(<FILL_ME>)
require(_temp[1] != 0x58, "string cannot start with 0X");
}
bool _hasNonNumber;
for (uint256 i = 0; i < _length; i++) {
if (_temp[i] > 0x40 && _temp[i] < 0x5b) {
_temp[i] = byte(uint(_temp[i]) + 32);
if (_hasNonNumber == false) {
_hasNonNumber = true;
}
} else {
require(_temp[i] == 0x20 || (_temp[i] > 0x60 && _temp[i] < 0x7b) || (_temp[i] > 0x2f && _temp[i] < 0x3a), "string contains invalid characters");
if (_temp[i] == 0x20) {
require( _temp[i+1] != 0x20, "string cannot contain consecutive spaces");
}
if (_hasNonNumber == false && (_temp[i] < 0x30 || _temp[i] > 0x39)) {
_hasNonNumber = true;
}
}
}
require(_hasNonNumber == true, "string cannot be only numbers");
bytes32 _ret;
assembly {
_ret := mload(add(_temp, 32))
}
return (_ret);
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
}
function sq(uint256 x) internal pure returns (uint256) {
}
function pwr(uint256 x, uint256 y) internal pure returns (uint256) {
}
}
| _temp[1]!=0x78,"string cannot start with 0x" | 27,906 | _temp[1]!=0x78 |
"string cannot start with 0X" | pragma solidity ^0.4.24;
interface ExtSettingInterface {
function getLongGap() external returns(uint256);
function setLongGap(uint256 _gap) external;
function getLongExtra() external returns(uint256);
function setLongExtra(uint256 _extra) external;
}
interface FoundationInterface {
function deposit() external payable;
}
interface PlayerBookInterface {
function getPlayerID(address _addr) external returns (uint256);
function getPlayerName(uint256 _pID) external view returns (bytes32);
function getPlayerLAff(uint256 _pID) external view returns (uint256);
function getPlayerAddr(uint256 _pID) external view returns (address);
function getNameFee() external view returns (uint256);
function registerNameXIDFromDapp(address _addr, bytes32 _name, uint256 _affCode, bool _all) external payable returns(bool, uint256);
function registerNameXaddrFromDapp(address _addr, bytes32 _name, address _affCode, bool _all) external payable returns(bool, uint256);
function registerNameXnameFromDapp(address _addr, bytes32 _name, bytes32 _affCode, bool _all) external payable returns(bool, uint256);
}
contract Events {
event onNewName(
uint256 indexed playerID,
address indexed playerAddress,
bytes32 indexed playerName,
bool isNewPlayer,
uint256 affiliateID,
address affiliateAddress,
bytes32 affiliateName,
uint256 amountPaid,
uint256 timeStamp
);
event onEndTx(
uint256 compressedData,
uint256 compressedIDs,
bytes32 playerName,
address playerAddress,
uint256 ethIn,
uint256 keysBought,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount,
uint256 potAmount,
uint256 airDropPot
);
event onWithdraw(
uint256 indexed playerID,
address playerAddress,
bytes32 playerName,
uint256 ethOut,
uint256 timeStamp
);
event onWithdrawAndDistribute(
address playerAddress,
bytes32 playerName,
uint256 ethOut,
uint256 compressedData,
uint256 compressedIDs,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount
);
event onBuyAndDistribute(
address playerAddress,
bytes32 playerName,
uint256 ethIn,
uint256 compressedData,
uint256 compressedIDs,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount
);
event onReLoadAndDistribute(
address playerAddress,
bytes32 playerName,
uint256 compressedData,
uint256 compressedIDs,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount
);
event onAffiliatePayout(
uint256 indexed affiliateID,
address affiliateAddress,
bytes32 affiliateName,
uint256 indexed roundID,
uint256 indexed buyerID,
uint256 amount,
uint256 timeStamp
);
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
}
modifier onlyOwner() {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
}
contract Fomo3D is Ownable, Events {
using SafeMath for *;
using NameFilter for string;
using KeysCalcLong for uint256;
ExtSettingInterface private extSetting = ExtSettingInterface(0xb62aB70d1418c3Dfad706C0FdEA6499d2F380cE9);
FoundationInterface private foundation = FoundationInterface(0xC00C9ed7f35Ca2373462FD46d672084a6a128E2B);
PlayerBookInterface private playerBook = PlayerBookInterface(0x6384FE27b7b6cC999Aa750689c6B04acaeaB78D7);
string constant public name = "Fomo3D Asia (Official)";
string constant public symbol = "F3DA";
uint256 constant private rndInit_ = 1 hours;
uint256 constant private rndInc_ = 30 seconds;
uint256 constant private rndMax_ = 24 hours;
uint256 private rndExtra_ = extSetting.getLongExtra();
uint256 private rndGap_ = extSetting.getLongGap();
uint256 public airDropPot_;
uint256 public airDropTracker_ = 0;
uint256 public rID_;
bool public activated_ = false;
mapping (address => uint256) public pIDxAddr_;
mapping (bytes32 => uint256) public pIDxName_;
mapping (uint256 => Datasets.Player) public plyr_;
mapping (uint256 => mapping (uint256 => Datasets.PlayerRounds)) public plyrRnds_;
mapping (uint256 => mapping (bytes32 => bool)) public plyrNames_;
mapping (uint256 => Datasets.Round) public round_;
mapping (uint256 => mapping(uint256 => uint256)) public rndTmEth_;
mapping (uint256 => uint256) public fees_;
mapping (uint256 => uint256) public potSplit_;
modifier isActivated() {
}
modifier isHuman() {
}
modifier isWithinLimits(uint256 _eth) {
}
constructor() public {
}
function() public payable isActivated isHuman isWithinLimits(msg.value) {
}
function setExtSettingInterface(address _extSetting) public onlyOwner {
}
function setFoundationInterface(address _foundation) public onlyOwner {
}
function setPlayerBookInterface(address _playerBook) public onlyOwner {
}
function buyXid(uint256 _affCode, uint256 _team) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function buyXaddr(address _affCode, uint256 _team) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function buyXname(bytes32 _affCode, uint256 _team) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function reLoadXid(uint256 _affCode, uint256 _team, uint256 _eth) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function reLoadXaddr(address _affCode, uint256 _team, uint256 _eth) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function reLoadXname(bytes32 _affCode, uint256 _team, uint256 _eth) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function withdraw() public isActivated isHuman {
}
function registerNameXID(string _nameString, uint256 _affCode, bool _all) public payable isHuman {
}
function registerNameXaddr(string _nameString, address _affCode, bool _all) public payable isHuman {
}
function registerNameXname(string _nameString, bytes32 _affCode, bool _all) public payable isHuman {
}
function getBuyPrice() public view returns(uint256) {
}
function getTimeLeft() public view returns(uint256) {
}
function getPlayerVaults(uint256 _pID) public view returns(uint256 ,uint256, uint256) {
}
function getPlayerVaultsHelper(uint256 _pID, uint256 _rID) private view returns(uint256) {
}
function getCurrentRoundInfo() public view returns(uint256, uint256, uint256, uint256, uint256, uint256, uint256, address, bytes32, uint256, uint256, uint256, uint256, uint256) {
}
function getPlayerInfoByAddress(address _addr) public view returns(uint256, bytes32, uint256, uint256, uint256, uint256, uint256) {
}
function buyCore(uint256 _pID, uint256 _affID, uint256 _team, Datasets.EventData memory _eventData_) private {
}
function reLoadCore(uint256 _pID, uint256 _affID, uint256 _team, uint256 _eth, Datasets.EventData memory _eventData_) private {
}
function core(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, uint256 _team, Datasets.EventData memory _eventData_) private {
}
function calcUnMaskedEarnings(uint256 _pID, uint256 _rIDlast) private view returns(uint256) {
}
function calcKeysReceived(uint256 _rID, uint256 _eth) public view returns(uint256) {
}
function iWantXKeys(uint256 _keys) public view returns(uint256) {
}
function receivePlayerInfo(uint256 _pID, address _addr, bytes32 _name, uint256 _laff) external {
}
function receivePlayerNameList(uint256 _pID, bytes32 _name) external {
}
function determinePID(Datasets.EventData memory _eventData_) private returns (Datasets.EventData) {
}
function verifyTeam(uint256 _team) private pure returns (uint256) {
}
function managePlayer(uint256 _pID, Datasets.EventData memory _eventData_) private returns (Datasets.EventData) {
}
function endRound(Datasets.EventData memory _eventData_) private returns (Datasets.EventData) {
}
function updateGenVault(uint256 _pID, uint256 _rIDlast) private {
}
function updateTimer(uint256 _keys, uint256 _rID) private {
}
function airdrop() private view returns(bool) {
}
function distributeExternal(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, Datasets.EventData memory _eventData_) private returns(Datasets.EventData) {
}
function distributeInternal(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _team, uint256 _keys, Datasets.EventData memory _eventData_) private returns(Datasets.EventData) {
}
function updateMasks(uint256 _rID, uint256 _pID, uint256 _gen, uint256 _keys) private returns(uint256) {
}
function withdrawEarnings(uint256 _pID) private returns(uint256) {
}
function endTx(uint256 _pID, uint256 _team, uint256 _eth, uint256 _keys, Datasets.EventData memory _eventData_) private {
}
function activate() public onlyOwner {
}
}
library Datasets {
struct EventData {
uint256 compressedData;
uint256 compressedIDs;
address winnerAddr;
bytes32 winnerName;
uint256 amountWon;
uint256 newPot;
uint256 genAmount;
uint256 potAmount;
}
struct Player {
address addr;
bytes32 name;
uint256 win;
uint256 gen;
uint256 aff;
uint256 lrnd;
uint256 laff;
}
struct PlayerRounds {
uint256 eth;
uint256 keys;
uint256 mask;
uint256 ico;
}
struct Round {
uint256 plyr;
uint256 team;
uint256 end;
bool ended;
uint256 strt;
uint256 keys;
uint256 eth;
uint256 pot;
uint256 mask;
uint256 ico;
uint256 icoGen;
uint256 icoAvg;
}
}
library KeysCalcLong {
using SafeMath for *;
function keysRec(uint256 _curEth, uint256 _newEth) internal pure returns (uint256) {
}
function ethRec(uint256 _curKeys, uint256 _sellKeys) internal pure returns (uint256) {
}
function keys(uint256 _eth) internal pure returns(uint256) {
}
function eth(uint256 _keys) internal pure returns(uint256) {
}
}
library NameFilter {
function nameFilter(string _input) internal pure returns(bytes32) {
bytes memory _temp = bytes(_input);
uint256 _length = _temp.length;
require (_length <= 32 && _length > 0, "string must be between 1 and 32 characters");
require(_temp[0] != 0x20 && _temp[_length-1] != 0x20, "string cannot start or end with space");
if (_temp[0] == 0x30) {
require(_temp[1] != 0x78, "string cannot start with 0x");
require(<FILL_ME>)
}
bool _hasNonNumber;
for (uint256 i = 0; i < _length; i++) {
if (_temp[i] > 0x40 && _temp[i] < 0x5b) {
_temp[i] = byte(uint(_temp[i]) + 32);
if (_hasNonNumber == false) {
_hasNonNumber = true;
}
} else {
require(_temp[i] == 0x20 || (_temp[i] > 0x60 && _temp[i] < 0x7b) || (_temp[i] > 0x2f && _temp[i] < 0x3a), "string contains invalid characters");
if (_temp[i] == 0x20) {
require( _temp[i+1] != 0x20, "string cannot contain consecutive spaces");
}
if (_hasNonNumber == false && (_temp[i] < 0x30 || _temp[i] > 0x39)) {
_hasNonNumber = true;
}
}
}
require(_hasNonNumber == true, "string cannot be only numbers");
bytes32 _ret;
assembly {
_ret := mload(add(_temp, 32))
}
return (_ret);
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
}
function sq(uint256 x) internal pure returns (uint256) {
}
function pwr(uint256 x, uint256 y) internal pure returns (uint256) {
}
}
| _temp[1]!=0x58,"string cannot start with 0X" | 27,906 | _temp[1]!=0x58 |
"string contains invalid characters" | pragma solidity ^0.4.24;
interface ExtSettingInterface {
function getLongGap() external returns(uint256);
function setLongGap(uint256 _gap) external;
function getLongExtra() external returns(uint256);
function setLongExtra(uint256 _extra) external;
}
interface FoundationInterface {
function deposit() external payable;
}
interface PlayerBookInterface {
function getPlayerID(address _addr) external returns (uint256);
function getPlayerName(uint256 _pID) external view returns (bytes32);
function getPlayerLAff(uint256 _pID) external view returns (uint256);
function getPlayerAddr(uint256 _pID) external view returns (address);
function getNameFee() external view returns (uint256);
function registerNameXIDFromDapp(address _addr, bytes32 _name, uint256 _affCode, bool _all) external payable returns(bool, uint256);
function registerNameXaddrFromDapp(address _addr, bytes32 _name, address _affCode, bool _all) external payable returns(bool, uint256);
function registerNameXnameFromDapp(address _addr, bytes32 _name, bytes32 _affCode, bool _all) external payable returns(bool, uint256);
}
contract Events {
event onNewName(
uint256 indexed playerID,
address indexed playerAddress,
bytes32 indexed playerName,
bool isNewPlayer,
uint256 affiliateID,
address affiliateAddress,
bytes32 affiliateName,
uint256 amountPaid,
uint256 timeStamp
);
event onEndTx(
uint256 compressedData,
uint256 compressedIDs,
bytes32 playerName,
address playerAddress,
uint256 ethIn,
uint256 keysBought,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount,
uint256 potAmount,
uint256 airDropPot
);
event onWithdraw(
uint256 indexed playerID,
address playerAddress,
bytes32 playerName,
uint256 ethOut,
uint256 timeStamp
);
event onWithdrawAndDistribute(
address playerAddress,
bytes32 playerName,
uint256 ethOut,
uint256 compressedData,
uint256 compressedIDs,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount
);
event onBuyAndDistribute(
address playerAddress,
bytes32 playerName,
uint256 ethIn,
uint256 compressedData,
uint256 compressedIDs,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount
);
event onReLoadAndDistribute(
address playerAddress,
bytes32 playerName,
uint256 compressedData,
uint256 compressedIDs,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount
);
event onAffiliatePayout(
uint256 indexed affiliateID,
address affiliateAddress,
bytes32 affiliateName,
uint256 indexed roundID,
uint256 indexed buyerID,
uint256 amount,
uint256 timeStamp
);
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
}
modifier onlyOwner() {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
}
contract Fomo3D is Ownable, Events {
using SafeMath for *;
using NameFilter for string;
using KeysCalcLong for uint256;
ExtSettingInterface private extSetting = ExtSettingInterface(0xb62aB70d1418c3Dfad706C0FdEA6499d2F380cE9);
FoundationInterface private foundation = FoundationInterface(0xC00C9ed7f35Ca2373462FD46d672084a6a128E2B);
PlayerBookInterface private playerBook = PlayerBookInterface(0x6384FE27b7b6cC999Aa750689c6B04acaeaB78D7);
string constant public name = "Fomo3D Asia (Official)";
string constant public symbol = "F3DA";
uint256 constant private rndInit_ = 1 hours;
uint256 constant private rndInc_ = 30 seconds;
uint256 constant private rndMax_ = 24 hours;
uint256 private rndExtra_ = extSetting.getLongExtra();
uint256 private rndGap_ = extSetting.getLongGap();
uint256 public airDropPot_;
uint256 public airDropTracker_ = 0;
uint256 public rID_;
bool public activated_ = false;
mapping (address => uint256) public pIDxAddr_;
mapping (bytes32 => uint256) public pIDxName_;
mapping (uint256 => Datasets.Player) public plyr_;
mapping (uint256 => mapping (uint256 => Datasets.PlayerRounds)) public plyrRnds_;
mapping (uint256 => mapping (bytes32 => bool)) public plyrNames_;
mapping (uint256 => Datasets.Round) public round_;
mapping (uint256 => mapping(uint256 => uint256)) public rndTmEth_;
mapping (uint256 => uint256) public fees_;
mapping (uint256 => uint256) public potSplit_;
modifier isActivated() {
}
modifier isHuman() {
}
modifier isWithinLimits(uint256 _eth) {
}
constructor() public {
}
function() public payable isActivated isHuman isWithinLimits(msg.value) {
}
function setExtSettingInterface(address _extSetting) public onlyOwner {
}
function setFoundationInterface(address _foundation) public onlyOwner {
}
function setPlayerBookInterface(address _playerBook) public onlyOwner {
}
function buyXid(uint256 _affCode, uint256 _team) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function buyXaddr(address _affCode, uint256 _team) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function buyXname(bytes32 _affCode, uint256 _team) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function reLoadXid(uint256 _affCode, uint256 _team, uint256 _eth) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function reLoadXaddr(address _affCode, uint256 _team, uint256 _eth) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function reLoadXname(bytes32 _affCode, uint256 _team, uint256 _eth) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function withdraw() public isActivated isHuman {
}
function registerNameXID(string _nameString, uint256 _affCode, bool _all) public payable isHuman {
}
function registerNameXaddr(string _nameString, address _affCode, bool _all) public payable isHuman {
}
function registerNameXname(string _nameString, bytes32 _affCode, bool _all) public payable isHuman {
}
function getBuyPrice() public view returns(uint256) {
}
function getTimeLeft() public view returns(uint256) {
}
function getPlayerVaults(uint256 _pID) public view returns(uint256 ,uint256, uint256) {
}
function getPlayerVaultsHelper(uint256 _pID, uint256 _rID) private view returns(uint256) {
}
function getCurrentRoundInfo() public view returns(uint256, uint256, uint256, uint256, uint256, uint256, uint256, address, bytes32, uint256, uint256, uint256, uint256, uint256) {
}
function getPlayerInfoByAddress(address _addr) public view returns(uint256, bytes32, uint256, uint256, uint256, uint256, uint256) {
}
function buyCore(uint256 _pID, uint256 _affID, uint256 _team, Datasets.EventData memory _eventData_) private {
}
function reLoadCore(uint256 _pID, uint256 _affID, uint256 _team, uint256 _eth, Datasets.EventData memory _eventData_) private {
}
function core(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, uint256 _team, Datasets.EventData memory _eventData_) private {
}
function calcUnMaskedEarnings(uint256 _pID, uint256 _rIDlast) private view returns(uint256) {
}
function calcKeysReceived(uint256 _rID, uint256 _eth) public view returns(uint256) {
}
function iWantXKeys(uint256 _keys) public view returns(uint256) {
}
function receivePlayerInfo(uint256 _pID, address _addr, bytes32 _name, uint256 _laff) external {
}
function receivePlayerNameList(uint256 _pID, bytes32 _name) external {
}
function determinePID(Datasets.EventData memory _eventData_) private returns (Datasets.EventData) {
}
function verifyTeam(uint256 _team) private pure returns (uint256) {
}
function managePlayer(uint256 _pID, Datasets.EventData memory _eventData_) private returns (Datasets.EventData) {
}
function endRound(Datasets.EventData memory _eventData_) private returns (Datasets.EventData) {
}
function updateGenVault(uint256 _pID, uint256 _rIDlast) private {
}
function updateTimer(uint256 _keys, uint256 _rID) private {
}
function airdrop() private view returns(bool) {
}
function distributeExternal(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, Datasets.EventData memory _eventData_) private returns(Datasets.EventData) {
}
function distributeInternal(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _team, uint256 _keys, Datasets.EventData memory _eventData_) private returns(Datasets.EventData) {
}
function updateMasks(uint256 _rID, uint256 _pID, uint256 _gen, uint256 _keys) private returns(uint256) {
}
function withdrawEarnings(uint256 _pID) private returns(uint256) {
}
function endTx(uint256 _pID, uint256 _team, uint256 _eth, uint256 _keys, Datasets.EventData memory _eventData_) private {
}
function activate() public onlyOwner {
}
}
library Datasets {
struct EventData {
uint256 compressedData;
uint256 compressedIDs;
address winnerAddr;
bytes32 winnerName;
uint256 amountWon;
uint256 newPot;
uint256 genAmount;
uint256 potAmount;
}
struct Player {
address addr;
bytes32 name;
uint256 win;
uint256 gen;
uint256 aff;
uint256 lrnd;
uint256 laff;
}
struct PlayerRounds {
uint256 eth;
uint256 keys;
uint256 mask;
uint256 ico;
}
struct Round {
uint256 plyr;
uint256 team;
uint256 end;
bool ended;
uint256 strt;
uint256 keys;
uint256 eth;
uint256 pot;
uint256 mask;
uint256 ico;
uint256 icoGen;
uint256 icoAvg;
}
}
library KeysCalcLong {
using SafeMath for *;
function keysRec(uint256 _curEth, uint256 _newEth) internal pure returns (uint256) {
}
function ethRec(uint256 _curKeys, uint256 _sellKeys) internal pure returns (uint256) {
}
function keys(uint256 _eth) internal pure returns(uint256) {
}
function eth(uint256 _keys) internal pure returns(uint256) {
}
}
library NameFilter {
function nameFilter(string _input) internal pure returns(bytes32) {
bytes memory _temp = bytes(_input);
uint256 _length = _temp.length;
require (_length <= 32 && _length > 0, "string must be between 1 and 32 characters");
require(_temp[0] != 0x20 && _temp[_length-1] != 0x20, "string cannot start or end with space");
if (_temp[0] == 0x30) {
require(_temp[1] != 0x78, "string cannot start with 0x");
require(_temp[1] != 0x58, "string cannot start with 0X");
}
bool _hasNonNumber;
for (uint256 i = 0; i < _length; i++) {
if (_temp[i] > 0x40 && _temp[i] < 0x5b) {
_temp[i] = byte(uint(_temp[i]) + 32);
if (_hasNonNumber == false) {
_hasNonNumber = true;
}
} else {
require(<FILL_ME>)
if (_temp[i] == 0x20) {
require( _temp[i+1] != 0x20, "string cannot contain consecutive spaces");
}
if (_hasNonNumber == false && (_temp[i] < 0x30 || _temp[i] > 0x39)) {
_hasNonNumber = true;
}
}
}
require(_hasNonNumber == true, "string cannot be only numbers");
bytes32 _ret;
assembly {
_ret := mload(add(_temp, 32))
}
return (_ret);
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
}
function sq(uint256 x) internal pure returns (uint256) {
}
function pwr(uint256 x, uint256 y) internal pure returns (uint256) {
}
}
| _temp[i]==0x20||(_temp[i]>0x60&&_temp[i]<0x7b)||(_temp[i]>0x2f&&_temp[i]<0x3a),"string contains invalid characters" | 27,906 | _temp[i]==0x20||(_temp[i]>0x60&&_temp[i]<0x7b)||(_temp[i]>0x2f&&_temp[i]<0x3a) |
"string cannot contain consecutive spaces" | pragma solidity ^0.4.24;
interface ExtSettingInterface {
function getLongGap() external returns(uint256);
function setLongGap(uint256 _gap) external;
function getLongExtra() external returns(uint256);
function setLongExtra(uint256 _extra) external;
}
interface FoundationInterface {
function deposit() external payable;
}
interface PlayerBookInterface {
function getPlayerID(address _addr) external returns (uint256);
function getPlayerName(uint256 _pID) external view returns (bytes32);
function getPlayerLAff(uint256 _pID) external view returns (uint256);
function getPlayerAddr(uint256 _pID) external view returns (address);
function getNameFee() external view returns (uint256);
function registerNameXIDFromDapp(address _addr, bytes32 _name, uint256 _affCode, bool _all) external payable returns(bool, uint256);
function registerNameXaddrFromDapp(address _addr, bytes32 _name, address _affCode, bool _all) external payable returns(bool, uint256);
function registerNameXnameFromDapp(address _addr, bytes32 _name, bytes32 _affCode, bool _all) external payable returns(bool, uint256);
}
contract Events {
event onNewName(
uint256 indexed playerID,
address indexed playerAddress,
bytes32 indexed playerName,
bool isNewPlayer,
uint256 affiliateID,
address affiliateAddress,
bytes32 affiliateName,
uint256 amountPaid,
uint256 timeStamp
);
event onEndTx(
uint256 compressedData,
uint256 compressedIDs,
bytes32 playerName,
address playerAddress,
uint256 ethIn,
uint256 keysBought,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount,
uint256 potAmount,
uint256 airDropPot
);
event onWithdraw(
uint256 indexed playerID,
address playerAddress,
bytes32 playerName,
uint256 ethOut,
uint256 timeStamp
);
event onWithdrawAndDistribute(
address playerAddress,
bytes32 playerName,
uint256 ethOut,
uint256 compressedData,
uint256 compressedIDs,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount
);
event onBuyAndDistribute(
address playerAddress,
bytes32 playerName,
uint256 ethIn,
uint256 compressedData,
uint256 compressedIDs,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount
);
event onReLoadAndDistribute(
address playerAddress,
bytes32 playerName,
uint256 compressedData,
uint256 compressedIDs,
address winnerAddr,
bytes32 winnerName,
uint256 amountWon,
uint256 newPot,
uint256 genAmount
);
event onAffiliatePayout(
uint256 indexed affiliateID,
address affiliateAddress,
bytes32 affiliateName,
uint256 indexed roundID,
uint256 indexed buyerID,
uint256 amount,
uint256 timeStamp
);
}
contract Ownable {
address public owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() public {
}
modifier onlyOwner() {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
}
contract Fomo3D is Ownable, Events {
using SafeMath for *;
using NameFilter for string;
using KeysCalcLong for uint256;
ExtSettingInterface private extSetting = ExtSettingInterface(0xb62aB70d1418c3Dfad706C0FdEA6499d2F380cE9);
FoundationInterface private foundation = FoundationInterface(0xC00C9ed7f35Ca2373462FD46d672084a6a128E2B);
PlayerBookInterface private playerBook = PlayerBookInterface(0x6384FE27b7b6cC999Aa750689c6B04acaeaB78D7);
string constant public name = "Fomo3D Asia (Official)";
string constant public symbol = "F3DA";
uint256 constant private rndInit_ = 1 hours;
uint256 constant private rndInc_ = 30 seconds;
uint256 constant private rndMax_ = 24 hours;
uint256 private rndExtra_ = extSetting.getLongExtra();
uint256 private rndGap_ = extSetting.getLongGap();
uint256 public airDropPot_;
uint256 public airDropTracker_ = 0;
uint256 public rID_;
bool public activated_ = false;
mapping (address => uint256) public pIDxAddr_;
mapping (bytes32 => uint256) public pIDxName_;
mapping (uint256 => Datasets.Player) public plyr_;
mapping (uint256 => mapping (uint256 => Datasets.PlayerRounds)) public plyrRnds_;
mapping (uint256 => mapping (bytes32 => bool)) public plyrNames_;
mapping (uint256 => Datasets.Round) public round_;
mapping (uint256 => mapping(uint256 => uint256)) public rndTmEth_;
mapping (uint256 => uint256) public fees_;
mapping (uint256 => uint256) public potSplit_;
modifier isActivated() {
}
modifier isHuman() {
}
modifier isWithinLimits(uint256 _eth) {
}
constructor() public {
}
function() public payable isActivated isHuman isWithinLimits(msg.value) {
}
function setExtSettingInterface(address _extSetting) public onlyOwner {
}
function setFoundationInterface(address _foundation) public onlyOwner {
}
function setPlayerBookInterface(address _playerBook) public onlyOwner {
}
function buyXid(uint256 _affCode, uint256 _team) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function buyXaddr(address _affCode, uint256 _team) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function buyXname(bytes32 _affCode, uint256 _team) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function reLoadXid(uint256 _affCode, uint256 _team, uint256 _eth) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function reLoadXaddr(address _affCode, uint256 _team, uint256 _eth) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function reLoadXname(bytes32 _affCode, uint256 _team, uint256 _eth) public payable isActivated isHuman isWithinLimits(msg.value) {
}
function withdraw() public isActivated isHuman {
}
function registerNameXID(string _nameString, uint256 _affCode, bool _all) public payable isHuman {
}
function registerNameXaddr(string _nameString, address _affCode, bool _all) public payable isHuman {
}
function registerNameXname(string _nameString, bytes32 _affCode, bool _all) public payable isHuman {
}
function getBuyPrice() public view returns(uint256) {
}
function getTimeLeft() public view returns(uint256) {
}
function getPlayerVaults(uint256 _pID) public view returns(uint256 ,uint256, uint256) {
}
function getPlayerVaultsHelper(uint256 _pID, uint256 _rID) private view returns(uint256) {
}
function getCurrentRoundInfo() public view returns(uint256, uint256, uint256, uint256, uint256, uint256, uint256, address, bytes32, uint256, uint256, uint256, uint256, uint256) {
}
function getPlayerInfoByAddress(address _addr) public view returns(uint256, bytes32, uint256, uint256, uint256, uint256, uint256) {
}
function buyCore(uint256 _pID, uint256 _affID, uint256 _team, Datasets.EventData memory _eventData_) private {
}
function reLoadCore(uint256 _pID, uint256 _affID, uint256 _team, uint256 _eth, Datasets.EventData memory _eventData_) private {
}
function core(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, uint256 _team, Datasets.EventData memory _eventData_) private {
}
function calcUnMaskedEarnings(uint256 _pID, uint256 _rIDlast) private view returns(uint256) {
}
function calcKeysReceived(uint256 _rID, uint256 _eth) public view returns(uint256) {
}
function iWantXKeys(uint256 _keys) public view returns(uint256) {
}
function receivePlayerInfo(uint256 _pID, address _addr, bytes32 _name, uint256 _laff) external {
}
function receivePlayerNameList(uint256 _pID, bytes32 _name) external {
}
function determinePID(Datasets.EventData memory _eventData_) private returns (Datasets.EventData) {
}
function verifyTeam(uint256 _team) private pure returns (uint256) {
}
function managePlayer(uint256 _pID, Datasets.EventData memory _eventData_) private returns (Datasets.EventData) {
}
function endRound(Datasets.EventData memory _eventData_) private returns (Datasets.EventData) {
}
function updateGenVault(uint256 _pID, uint256 _rIDlast) private {
}
function updateTimer(uint256 _keys, uint256 _rID) private {
}
function airdrop() private view returns(bool) {
}
function distributeExternal(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _affID, Datasets.EventData memory _eventData_) private returns(Datasets.EventData) {
}
function distributeInternal(uint256 _rID, uint256 _pID, uint256 _eth, uint256 _team, uint256 _keys, Datasets.EventData memory _eventData_) private returns(Datasets.EventData) {
}
function updateMasks(uint256 _rID, uint256 _pID, uint256 _gen, uint256 _keys) private returns(uint256) {
}
function withdrawEarnings(uint256 _pID) private returns(uint256) {
}
function endTx(uint256 _pID, uint256 _team, uint256 _eth, uint256 _keys, Datasets.EventData memory _eventData_) private {
}
function activate() public onlyOwner {
}
}
library Datasets {
struct EventData {
uint256 compressedData;
uint256 compressedIDs;
address winnerAddr;
bytes32 winnerName;
uint256 amountWon;
uint256 newPot;
uint256 genAmount;
uint256 potAmount;
}
struct Player {
address addr;
bytes32 name;
uint256 win;
uint256 gen;
uint256 aff;
uint256 lrnd;
uint256 laff;
}
struct PlayerRounds {
uint256 eth;
uint256 keys;
uint256 mask;
uint256 ico;
}
struct Round {
uint256 plyr;
uint256 team;
uint256 end;
bool ended;
uint256 strt;
uint256 keys;
uint256 eth;
uint256 pot;
uint256 mask;
uint256 ico;
uint256 icoGen;
uint256 icoAvg;
}
}
library KeysCalcLong {
using SafeMath for *;
function keysRec(uint256 _curEth, uint256 _newEth) internal pure returns (uint256) {
}
function ethRec(uint256 _curKeys, uint256 _sellKeys) internal pure returns (uint256) {
}
function keys(uint256 _eth) internal pure returns(uint256) {
}
function eth(uint256 _keys) internal pure returns(uint256) {
}
}
library NameFilter {
function nameFilter(string _input) internal pure returns(bytes32) {
bytes memory _temp = bytes(_input);
uint256 _length = _temp.length;
require (_length <= 32 && _length > 0, "string must be between 1 and 32 characters");
require(_temp[0] != 0x20 && _temp[_length-1] != 0x20, "string cannot start or end with space");
if (_temp[0] == 0x30) {
require(_temp[1] != 0x78, "string cannot start with 0x");
require(_temp[1] != 0x58, "string cannot start with 0X");
}
bool _hasNonNumber;
for (uint256 i = 0; i < _length; i++) {
if (_temp[i] > 0x40 && _temp[i] < 0x5b) {
_temp[i] = byte(uint(_temp[i]) + 32);
if (_hasNonNumber == false) {
_hasNonNumber = true;
}
} else {
require(_temp[i] == 0x20 || (_temp[i] > 0x60 && _temp[i] < 0x7b) || (_temp[i] > 0x2f && _temp[i] < 0x3a), "string contains invalid characters");
if (_temp[i] == 0x20) {
require(<FILL_ME>)
}
if (_hasNonNumber == false && (_temp[i] < 0x30 || _temp[i] > 0x39)) {
_hasNonNumber = true;
}
}
}
require(_hasNonNumber == true, "string cannot be only numbers");
bytes32 _ret;
assembly {
_ret := mload(add(_temp, 32))
}
return (_ret);
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function sqrt(uint256 x) internal pure returns (uint256 y) {
}
function sq(uint256 x) internal pure returns (uint256) {
}
function pwr(uint256 x, uint256 y) internal pure returns (uint256) {
}
}
| _temp[i+1]!=0x20,"string cannot contain consecutive spaces" | 27,906 | _temp[i+1]!=0x20 |
null | /**
*Submitted for verification at Etherscan.io on 2021-01-27
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-13
*/
pragma solidity 0.4.26;
contract IERC20 {
uint public decimals;
string public name;
string public symbol;
mapping(address => uint) public balances;
mapping (address => mapping (address => uint)) public allowed;
uint public _totalSupply;
function totalSupply() public constant returns (uint);
function balanceOf(address who) public constant returns (uint);
function transfer(address to, uint value) public;
function allowance(address owner, address spender) public constant returns (uint);
function transferFrom(address from, address to, uint value) public;
function approve(address spender, uint value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
}
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) {
}
/**
* @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) {
}
/**
* @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) {
}
/**
* @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) {
}
/**
* @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) {
}
/**
* @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) {
}
/**
* @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) {
}
/**
* @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) {
}
}
contract Distribute{
using SafeMath for uint;
event GetFod(address getAddress, uint256 value);
event DepositeFod(address ethAddress, uint256 value);
event UseInviteCode(address ethAddress, bytes4 code);
struct Pledge{
uint day;
uint investAmount;
uint256 earnings;
uint rate;
uint vipRate;
uint createTime;
uint dueTime;
uint receivedDay;
uint end;
}
struct Invite{
address userAddr;
uint investAmount;
uint256 earnings;
uint rate;
uint vipRate;
uint day;
uint256 createTime;
uint256 dueTime;
uint256 receivedDay;
uint end;
}
uint intervalTime=86400;
uint public yieldRate=110;
uint public inviteYieldRate=100;
address public founder;
address fod=0xc7bE1Cf99e6a691ad5c56E3D63AD9667C6932E63;
uint fodDecimals=8;
mapping (bytes4 => Invite[]) public inviteLogs;
mapping (address => bytes4) public useInviteCodeMap;
mapping (bytes4 => address) public inviteCodeMap;
mapping (bytes4 => uint) public codeUsageCounts;
mapping (address => Pledge[]) public addressToPledge;
mapping(uint=>uint) public dateToYields;
mapping(uint=>uint) public dayMap;
constructor() public {
}
function getAddrInviteCode(address _addr) view returns (bytes4) {
}
function getInviteCode() view returns (bytes4) {
}
function getPledgeCount(address _addr) view returns (uint) {
}
function getInvitesCount(address _addr) view returns (uint) {
}
function setYieldRate(uint _yieldRate) public onlyOwner returns (bool success) {
}
function setInviteYieldRate(uint _inviteYieldRate) public onlyOwner returns (bool success) {
}
function setDateToYield(uint _index,uint _yield) public onlyOwner returns (bool success) {
}
function setDayMap(uint _index,uint _day) public onlyOwner returns (bool success) {
}
function getTotalUnLockAmount(address _addr) public view returns (uint256) {
}
function getTotalPledgeAmount(address _addr) public view returns (uint256) {
}
function getUnLockPledgeAmount(address _addr) public view returns (uint256) {
}
function getTotalInviteAmount(address _addr) public view returns (uint256) {
}
function getUnlockInviteAmount(address _addr) public view returns (uint256) {
}
function useInviteCode(bytes4 _inviteCode) public returns (bool success) {
require(<FILL_ME>)
require(inviteCodeMap[_inviteCode]!=0);
bytes4 inviteCode=bytes4(keccak256((msg.sender)));
require(_inviteCode!=inviteCode);
useInviteCodeMap[msg.sender]=_inviteCode;
codeUsageCounts[_inviteCode]=codeUsageCounts[_inviteCode]+1;
emit UseInviteCode(msg.sender,_inviteCode);
return true;
}
function depositeFod(uint256 _amount,uint _mode) public {
}
function receiveFod() public{
}
function withdrawToken (address _tokenAddress,address _user,uint256 _tokenAmount)public onlyOwner returns (bool) {
}
function changeFounder(address newFounder) public onlyOwner{
}
modifier onlyOwner() {
}
}
| useInviteCodeMap[msg.sender]==0 | 27,933 | useInviteCodeMap[msg.sender]==0 |
null | /**
*Submitted for verification at Etherscan.io on 2021-01-27
*/
/**
*Submitted for verification at Etherscan.io on 2020-10-13
*/
pragma solidity 0.4.26;
contract IERC20 {
uint public decimals;
string public name;
string public symbol;
mapping(address => uint) public balances;
mapping (address => mapping (address => uint)) public allowed;
uint public _totalSupply;
function totalSupply() public constant returns (uint);
function balanceOf(address who) public constant returns (uint);
function transfer(address to, uint value) public;
function allowance(address owner, address spender) public constant returns (uint);
function transferFrom(address from, address to, uint value) public;
function approve(address spender, uint value) public returns (bool);
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
}
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) {
}
/**
* @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) {
}
/**
* @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) {
}
/**
* @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) {
}
/**
* @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) {
}
/**
* @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) {
}
/**
* @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) {
}
/**
* @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) {
}
}
contract Distribute{
using SafeMath for uint;
event GetFod(address getAddress, uint256 value);
event DepositeFod(address ethAddress, uint256 value);
event UseInviteCode(address ethAddress, bytes4 code);
struct Pledge{
uint day;
uint investAmount;
uint256 earnings;
uint rate;
uint vipRate;
uint createTime;
uint dueTime;
uint receivedDay;
uint end;
}
struct Invite{
address userAddr;
uint investAmount;
uint256 earnings;
uint rate;
uint vipRate;
uint day;
uint256 createTime;
uint256 dueTime;
uint256 receivedDay;
uint end;
}
uint intervalTime=86400;
uint public yieldRate=110;
uint public inviteYieldRate=100;
address public founder;
address fod=0xc7bE1Cf99e6a691ad5c56E3D63AD9667C6932E63;
uint fodDecimals=8;
mapping (bytes4 => Invite[]) public inviteLogs;
mapping (address => bytes4) public useInviteCodeMap;
mapping (bytes4 => address) public inviteCodeMap;
mapping (bytes4 => uint) public codeUsageCounts;
mapping (address => Pledge[]) public addressToPledge;
mapping(uint=>uint) public dateToYields;
mapping(uint=>uint) public dayMap;
constructor() public {
}
function getAddrInviteCode(address _addr) view returns (bytes4) {
}
function getInviteCode() view returns (bytes4) {
}
function getPledgeCount(address _addr) view returns (uint) {
}
function getInvitesCount(address _addr) view returns (uint) {
}
function setYieldRate(uint _yieldRate) public onlyOwner returns (bool success) {
}
function setInviteYieldRate(uint _inviteYieldRate) public onlyOwner returns (bool success) {
}
function setDateToYield(uint _index,uint _yield) public onlyOwner returns (bool success) {
}
function setDayMap(uint _index,uint _day) public onlyOwner returns (bool success) {
}
function getTotalUnLockAmount(address _addr) public view returns (uint256) {
}
function getTotalPledgeAmount(address _addr) public view returns (uint256) {
}
function getUnLockPledgeAmount(address _addr) public view returns (uint256) {
}
function getTotalInviteAmount(address _addr) public view returns (uint256) {
}
function getUnlockInviteAmount(address _addr) public view returns (uint256) {
}
function useInviteCode(bytes4 _inviteCode) public returns (bool success) {
require(useInviteCodeMap[msg.sender]==0);
require(<FILL_ME>)
bytes4 inviteCode=bytes4(keccak256((msg.sender)));
require(_inviteCode!=inviteCode);
useInviteCodeMap[msg.sender]=_inviteCode;
codeUsageCounts[_inviteCode]=codeUsageCounts[_inviteCode]+1;
emit UseInviteCode(msg.sender,_inviteCode);
return true;
}
function depositeFod(uint256 _amount,uint _mode) public {
}
function receiveFod() public{
}
function withdrawToken (address _tokenAddress,address _user,uint256 _tokenAmount)public onlyOwner returns (bool) {
}
function changeFounder(address newFounder) public onlyOwner{
}
modifier onlyOwner() {
}
}
| inviteCodeMap[_inviteCode]!=0 | 27,933 | inviteCodeMap[_inviteCode]!=0 |
'You owned this item!' | // SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "hardhat/console.sol";
contract NFTMarket is ERC721URIStorage, ReentrancyGuard {
using Counters for Counters.Counter;
Counters.Counter private _itemIds;
address payable contractOwner;
uint256 listingPercent = 7;
uint256 royaltiesPercent = 10;
uint256 minimalPrice = 0.00028 ether;
constructor() ERC721("Birth", "BIRTH") {
}
struct MarketItem {
uint itemId;
address payable seller;
address payable owner;
address payable creator;
uint256 price;
bool sale;
}
mapping(uint => MarketItem) private itemIdToMarketItem;
modifier IsMarketItemOwner(uint256 itemId, bool needOwner) {
bool isOwner = itemIdToMarketItem[itemId].owner == msg.sender;
if(needOwner) {
require(isOwner, 'You not owned this item!');
} else {
require(<FILL_ME>)
}
_;
}
modifier IsMarketItemExist(uint256 itemId) {
}
modifier IsMarketItemOnSale(uint256 itemId, bool needOnSale) {
}
function getListingPercent() public view returns (uint256) {
}
function marketItemUpdatePrice(
uint itemId,
uint256 price
)
IsMarketItemOwner(itemId, true)
IsMarketItemExist(itemId)
IsMarketItemOnSale(itemId, true)
public nonReentrant {
}
function marketItemUpToSale(
uint itemId,
uint256 price
)
IsMarketItemOwner(itemId, true)
IsMarketItemExist(itemId)
IsMarketItemOnSale(itemId, false)
public payable nonReentrant {
}
function marketItemRemoveFromSale(
uint itemId
)
IsMarketItemOwner(itemId, true)
IsMarketItemExist(itemId)
IsMarketItemOnSale(itemId, true)
public payable nonReentrant {
}
function marketItemCreate(
string memory tokenURI
) public returns (uint) {
}
function marketItemBuy(
uint256 itemId
)
IsMarketItemOwner(itemId, false)
IsMarketItemExist(itemId)
IsMarketItemOnSale(itemId, true)
public payable nonReentrant {
}
function marketItems() public view returns (MarketItem[] memory) {
}
function marketItemsByUser() public view returns (MarketItem[] memory) {
}
function marketItemById(uint itemId)
public view returns (
address seller,
address owner,
address creator,
uint256 price,
bool sale
) {
}
function calculatePercent(uint amount, uint percent) public pure returns(uint) {
}
}
| !isOwner,'You owned this item!' | 28,044 | !isOwner |
"This item on sale!" | // SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "hardhat/console.sol";
contract NFTMarket is ERC721URIStorage, ReentrancyGuard {
using Counters for Counters.Counter;
Counters.Counter private _itemIds;
address payable contractOwner;
uint256 listingPercent = 7;
uint256 royaltiesPercent = 10;
uint256 minimalPrice = 0.00028 ether;
constructor() ERC721("Birth", "BIRTH") {
}
struct MarketItem {
uint itemId;
address payable seller;
address payable owner;
address payable creator;
uint256 price;
bool sale;
}
mapping(uint => MarketItem) private itemIdToMarketItem;
modifier IsMarketItemOwner(uint256 itemId, bool needOwner) {
}
modifier IsMarketItemExist(uint256 itemId) {
}
modifier IsMarketItemOnSale(uint256 itemId, bool needOnSale) {
bool onSale = itemIdToMarketItem[itemId].sale;
if(needOnSale) {
require(onSale, "This item is not sale!");
} else {
require(<FILL_ME>)
}
_;
}
function getListingPercent() public view returns (uint256) {
}
function marketItemUpdatePrice(
uint itemId,
uint256 price
)
IsMarketItemOwner(itemId, true)
IsMarketItemExist(itemId)
IsMarketItemOnSale(itemId, true)
public nonReentrant {
}
function marketItemUpToSale(
uint itemId,
uint256 price
)
IsMarketItemOwner(itemId, true)
IsMarketItemExist(itemId)
IsMarketItemOnSale(itemId, false)
public payable nonReentrant {
}
function marketItemRemoveFromSale(
uint itemId
)
IsMarketItemOwner(itemId, true)
IsMarketItemExist(itemId)
IsMarketItemOnSale(itemId, true)
public payable nonReentrant {
}
function marketItemCreate(
string memory tokenURI
) public returns (uint) {
}
function marketItemBuy(
uint256 itemId
)
IsMarketItemOwner(itemId, false)
IsMarketItemExist(itemId)
IsMarketItemOnSale(itemId, true)
public payable nonReentrant {
}
function marketItems() public view returns (MarketItem[] memory) {
}
function marketItemsByUser() public view returns (MarketItem[] memory) {
}
function marketItemById(uint itemId)
public view returns (
address seller,
address owner,
address creator,
uint256 price,
bool sale
) {
}
function calculatePercent(uint amount, uint percent) public pure returns(uint) {
}
}
| !onSale,"This item on sale!" | 28,044 | !onSale |
"Check if recipient is frozen" | pragma solidity >=0.4.22 <0.6.0;
interface IERC20 {
function transfer(address to, uint256 value) external returns (bool);
function approve(address spender, uint256 value) external returns (bool);
function transferFrom(address from, address to, uint256 value) external returns (bool);
function totalSupply() external view returns (uint256);
function balanceOf(address who) external view returns (uint256);
function allowance(address owner, address spender) external view returns (uint256);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
/**
* @title SafeMath
* @dev Unsigned math operations with safety checks that revert on error.
*/
library SafeMath {
/**
* @dev Multiplies two unsigned integers, reverts on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Integer division of two unsigned integers truncating the quotient, reverts on division by zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Subtracts two unsigned integers, reverts on overflow (i.e. if subtrahend is greater than minuend).
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Adds two unsigned integers, reverts on overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
}
/**
* @dev Divides two unsigned integers and returns the remainder (unsigned integer modulo),
* reverts when dividing by zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
/**
* @title Ownable
* @dev The Ownable contract has an owner address, and provides basic authorization control
* functions, this simplifies the implementation of "user permissions".
*/
contract Ownable {
address payable private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev The Ownable constructor sets the original `owner` of the contract to the sender
* account.
*/
constructor () internal {
}
/**
* @return the address of the owner.
*/
function owner() public view returns (address payable) {
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
}
/**
* @return true if `msg.sender` is the owner of the contract.
*/
function isOwner() public view returns (bool) {
}
/**
* @dev Allows the current owner to transfer control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function transferOwnership(address payable newOwner) public onlyOwner {
}
/**
* @dev Transfers control of the contract to a newOwner.
* @param newOwner The address to transfer ownership to.
*/
function _transferOwnership(address payable newOwner) internal {
}
}
/**
* @title ERC20Detailed token
* @dev The decimals are only for visualization purposes.
* All the operations are done using the smallest and indivisible token unit,
* just as on Ethereum all the operations are done in wei.
*/
contract ERC20Detailed is IERC20 {
string private _name;
string private _symbol;
uint8 public _decimals;
constructor (string memory name, string memory symbol, uint8 decimals) public {
}
/**
* @return the name of the token.
*/
function name() public view returns (string memory) {
}
/**
* @return the symbol of the token.
*/
function symbol() public view returns (string memory) {
}
/**
* @return the number of decimals of the token.
*/
function decimals() public view returns (uint8) {
}
}
/**
* @title Standard ERC20 token
*
* @dev Implementation of the basic standard token.
* https://eips.ethereum.org/EIPS/eip-20
* Originally based on code by FirstBlood:
* https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol
*
* This implementation emits additional Approval events, allowing applications to reconstruct the allowance status for
* all accounts just by listening to said events. Note that this isn't required by the specification, and other
* compliant implementations may not do it.
*/
contract ERC20 is IERC20 {
using SafeMath for uint256;
mapping (address => uint256) public _balances;
mapping (address => mapping (address => uint256)) private _allowed;
mapping (address => bool) public frozenAccount;
uint256 private _totalSupply;
/**
* @dev Total number of tokens in existence.
*/
function totalSupply() public view returns (uint256) {
}
/**
* @dev Gets the balance of the specified address.
* @param owner The address to query the balance of.
* @return A uint256 representing the amount owned by the passed address.
*/
function balanceOf(address owner) public view returns (uint256) {
}
/**
* @dev Function to check the amount of tokens that an owner allowed to a spender.
* @param owner address The address which owns the funds.
* @param spender address The address which will spend the funds.
* @return A uint256 specifying the amount of tokens still available for the spender.
*/
function allowance(address owner, address spender) public view returns (uint256) {
}
/**
* @dev Transfer token to a specified address.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function transfer(address to, uint256 value) public returns (bool) {
}
/**
* @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender.
* 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
* @param spender The address which will spend the funds.
* @param value The amount of tokens to be spent.
*/
function approve(address spender, uint256 value) public returns (bool) {
}
/**
* @dev Transfer tokens from one address to another.
* Note that while this function emits an Approval event, this is not required as per the specification,
* and other compliant implementations may not emit the event.
* @param from address The address which you want to send tokens from
* @param to address The address which you want to transfer to
* @param value uint256 the amount of tokens to be transferred
*/
function transferFrom(address from, address to, uint256 value) public returns (bool) {
}
/**
* @dev Transfer token for a specified addresses.
* @param from The address to transfer from.
* @param to The address to transfer to.
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
}
/**
* @dev Internal function that mints an amount of the token and assigns it to
* an account. This encapsulates the modification of balances such that the
* proper events are emitted.
* @param account The account that will receive the created tokens.
* @param value The amount that will be created.
*/
function _mint(address account, uint256 value) internal {
require(account != address(0),"Check recipient is '0x0'");
// Check if recipient is frozen
require(<FILL_ME>)
_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
}
/**
* @dev Internal function that burns an amount of the token of a given
* account.
* @param account The account whose tokens will be burnt.
* @param value The amount that will be burnt.
*/
function _burn(address account, uint256 value) internal {
}
/**
* @dev Approve an address to spend another addresses' tokens.
* @param owner The address that owns the tokens.
* @param spender The address that will spend the tokens.
* @param value The number of tokens that can be spent.
*/
function _approve(address owner, address spender, uint256 value) internal {
}
}
/**
* @title ERC20Mintable
* @dev ERC20 minting logic.
*/
contract ERC20Mintable is ERC20, Ownable {
/**
* @dev Function to mint tokens
* @param to The address that will receive the minted tokens.
* @param value The amount of tokens to mint.
* @return A boolean that indicates if the operation was successful.
*/
function mint(address to, uint256 value) public onlyOwner returns (bool) {
}
}
/**
* @title Burnable Token
* @dev Token that can be irreversibly burned (destroyed).
*/
contract ERC20Burnable is ERC20,Ownable{
/**
* @dev Burns a specific amount of tokens.
* @param value The amount of token to be burned.
*/
function burn(uint256 value) onlyOwner public {
}
}
/**
* @title Pausable
* @dev Base contract which allows children to implement an emergency stop mechanism.
*/
contract Pausable is Ownable{
event Paused(address account);
event Unpaused(address account);
bool private _paused;
constructor () internal {
}
/**
* @return True if the contract is paused, false otherwise.
*/
function paused() public view returns (bool) {
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*/
modifier whenNotPaused() {
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*/
modifier whenPaused() {
}
/**
* @dev Called by a pauser to pause, triggers stopped state.
*/
function pause() public onlyOwner whenNotPaused {
}
/**
* @dev Called by a pauser to unpause, returns to normal state.
*/
function unpause() public onlyOwner whenPaused {
}
}
/**
* @title Pausable token
* @dev ERC20 modified with pausable transfers.
*/
contract ERC20Pausable is ERC20, Pausable {
function transfer(address to, uint256 value) public whenNotPaused returns (bool) {
}
function transferFrom(address from, address to, uint256 value) public whenNotPaused returns (bool) {
}
function approve(address spender, uint256 value) public whenNotPaused returns (bool) {
}
}
/**
* @title Bitcoin BOT
* @dev Very simple ERC20 Token example, where all tokens are pre-assigned to the creator.
* Note they can later distribute these tokens as they wish using `transfer` and other
* `ERC20` functions.
*/
contract Bitcoin_BOT is ERC20, ERC20Detailed, ERC20Burnable, ERC20Mintable, ERC20Pausable {
string private constant NAME = "Bitcoin BOT";
string private constant SYMBOL = "BBOT";
uint8 private constant DECIMALS = 18;
/**
* This notifies clients about frozen accounts.
*/
event FrozenFunds(address target, bool frozen);
uint256 public constant INITIAL_SUPPLY = 21000000 *(10 ** uint256(DECIMALS));
/**
* Constructor that gives msg.sender all of existing tokens.
*/
constructor () public ERC20Detailed(NAME, SYMBOL, DECIMALS) {
}
/**
* Freeze Account
*/
function freezeAccount(address target, bool freeze) onlyOwner public {
}
/**
* Withdraw for Ether
*/
function withdraw(uint withdrawAmount) onlyOwner public {
}
/**
* Withdraw for Token
*/
function withdrawToken(uint tokenAmount) onlyOwner public {
}
/**
* Accept Ether
*/
function () payable external {
}
}
| !frozenAccount[account],"Check if recipient is frozen" | 28,062 | !frozenAccount[account] |
"Mission: Only approved pools" | pragma solidity ^0.6.0;
import "@openzeppelin/contracts-ethereum-package/contracts/access/Ownable.sol";
import "@openzeppelin/contracts-ethereum-package/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
/*
A pool of spores that can be takens by Spore pools according to their spore rate
*/
contract Mission is Initializable, OwnableUpgradeSafe {
IERC20 public sporeToken;
mapping (address => bool) public approved;
event SporesHarvested(address pool, uint256 amount);
modifier onlyApprovedPool() {
require(<FILL_ME>)
_;
}
function initialize(IERC20 sporeToken_) public initializer {
}
function sendSpores(address recipient, uint256 amount) public onlyApprovedPool {
}
function approvePool(address pool) public onlyOwner {
}
function revokePool(address pool) public onlyOwner {
}
}
| approved[msg.sender],"Mission: Only approved pools" | 28,082 | approved[msg.sender] |
"SporeToken: transfers not enabled" | pragma solidity ^0.6.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract SporeToken is ERC20("SporeFinance", "SPORE"), Ownable {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
mapping(address => bool) public minters;
address public initialLiquidityManager;
bool internal _transfersEnabled;
mapping(address => bool) internal _canTransferInitialLiquidity;
/* ========== CONSTRUCTOR ========== */
constructor(address initialLiquidityManager_) public {
}
/* ========== MUTATIVE FUNCTIONS ========== */
/// @notice Transfer is enabled as normal except during an initial phase
function transfer(address recipient, uint256 amount) public override returns (bool) {
require(<FILL_ME>)
return super.transfer(recipient, amount);
}
/// @notice TransferFrom is enabled as normal except during an initial phase
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
}
/// @notice Any account is entitled to burn their own tokens
function burn(uint256 amount) public {
}
/* ========== RESTRICTED FUNCTIONS ========== */
function mint(address to, uint256 amount) public onlyMinter {
}
function addInitialLiquidityTransferRights(address account) public onlyInitialLiquidityManager {
}
/// @notice One time acion to enable global transfers after the initial liquidity is supplied.
function enableTransfers() public onlyInitialLiquidityManager {
}
function addMinter(address account) public onlyOwner {
}
function removeMinter(address account) public onlyOwner {
}
modifier onlyMinter() {
}
modifier onlyInitialLiquidityManager() {
}
}
| _transfersEnabled||_canTransferInitialLiquidity[msg.sender],"SporeToken: transfers not enabled" | 28,085 | _transfersEnabled||_canTransferInitialLiquidity[msg.sender] |
"SporeToken: cannot add initial liquidity transfer rights after global transfers enabled" | pragma solidity ^0.6.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
contract SporeToken is ERC20("SporeFinance", "SPORE"), Ownable {
using SafeMath for uint256;
/* ========== STATE VARIABLES ========== */
mapping(address => bool) public minters;
address public initialLiquidityManager;
bool internal _transfersEnabled;
mapping(address => bool) internal _canTransferInitialLiquidity;
/* ========== CONSTRUCTOR ========== */
constructor(address initialLiquidityManager_) public {
}
/* ========== MUTATIVE FUNCTIONS ========== */
/// @notice Transfer is enabled as normal except during an initial phase
function transfer(address recipient, uint256 amount) public override returns (bool) {
}
/// @notice TransferFrom is enabled as normal except during an initial phase
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
}
/// @notice Any account is entitled to burn their own tokens
function burn(uint256 amount) public {
}
/* ========== RESTRICTED FUNCTIONS ========== */
function mint(address to, uint256 amount) public onlyMinter {
}
function addInitialLiquidityTransferRights(address account) public onlyInitialLiquidityManager {
require(<FILL_ME>)
_canTransferInitialLiquidity[account] = true;
}
/// @notice One time acion to enable global transfers after the initial liquidity is supplied.
function enableTransfers() public onlyInitialLiquidityManager {
}
function addMinter(address account) public onlyOwner {
}
function removeMinter(address account) public onlyOwner {
}
modifier onlyMinter() {
}
modifier onlyInitialLiquidityManager() {
}
}
| !_transfersEnabled,"SporeToken: cannot add initial liquidity transfer rights after global transfers enabled" | 28,085 | !_transfersEnabled |
null | pragma solidity ^0.5.13;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
contract DIST {
function accounting() public;
}
contract EXCH {
function appreciateTokenPrice(uint256 _amount) public;
}
contract TOKEN {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function stakeStart(uint256 newStakedHearts, uint256 newStakedDays) external;
function stakeEnd(uint256 stakeIndex, uint40 stakeIdParam) external;
function stakeCount(address stakerAddr) external view returns (uint256);
function stakeLists(address owner, uint256 stakeIndex) external view returns (uint40, uint72, uint72, uint16, uint16, uint16, bool);
function currentDay() external view returns (uint256);
}
contract Ownable {
address public owner;
constructor() public {
}
modifier onlyOwner() {
}
}
contract HTI is Ownable {
using SafeMath for uint256;
uint256 ACTIVATION_TIME = 1590274800;
modifier isActivated {
}
modifier onlyCustodian() {
}
modifier hasDripped {
}
modifier onlyTokenHolders {
require(<FILL_ME>)
_;
}
modifier onlyDivis {
}
modifier isStakeActivated {
}
event onDonation(
address indexed customerAddress,
uint256 tokens
);
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
event onTokenPurchase(
address indexed customerAddress,
uint256 incomingHEX,
uint256 tokensMinted,
address indexed referredBy,
uint256 timestamp
);
event onTokenSell(
address indexed customerAddress,
uint256 tokensBurned,
uint256 hexEarned,
uint256 timestamp
);
event onRoll(
address indexed customerAddress,
uint256 hexRolled,
uint256 tokensMinted
);
event onWithdraw(
address indexed customerAddress,
uint256 hexWithdrawn
);
event onStakeStart(
address indexed customerAddress,
uint256 uniqueID,
uint256 timestamp
);
event onStakeEnd(
address indexed customerAddress,
uint256 uniqueID,
uint256 returnAmount,
uint256 timestamp
);
string public name = "Infinihex";
string public symbol = "HEX5";
uint8 constant public decimals = 8;
uint256 constant private divMagnitude = 2 ** 64;
uint8 public percentage1 = 2;
uint8 public percentage2 = 2;
uint32 public dailyRate = 4320000;
uint8 constant private buyInFee = 40;
uint8 constant private rewardFee = 5;
uint8 constant private referralFee = 1;
uint8 constant private devFee = 1;
uint8 constant private hexMaxFee = 1;
uint8 constant private stableETHFee = 2;
uint8 constant private sellOutFee = 9;
uint8 constant private transferFee = 1;
mapping(address => uint256) private tokenBalanceLedger;
mapping(address => uint256) public lockedTokenBalanceLedger;
mapping(address => uint256) private referralBalance;
mapping(address => int256) private payoutsTo;
struct Stats {
uint256 deposits;
uint256 withdrawals;
uint256 staked;
uint256 activeStakes;
}
mapping(address => Stats) public playerStats;
uint256 public dividendPool = 0;
uint256 public lastDripTime = ACTIVATION_TIME;
uint256 public referralRequirement = 1000e8;
uint256 public totalStakeBalance = 0;
uint256 public totalPlayer = 0;
uint256 public totalDonation = 0;
uint256 public totalStableFundReceived = 0;
uint256 public totalStableFundCollected = 0;
uint256 public totalMaxFundReceived = 0;
uint256 public totalMaxFundCollected = 0;
uint256 private tokenSupply = 0;
uint256 private profitPerShare = 0;
address public uniswapAddress;
address public approvedAddress1;
address public approvedAddress2;
address public distributionAddress;
address public custodianAddress;
EXCH hexmax;
DIST stablethdist;
TOKEN erc20;
struct StakeStore {
uint40 stakeID;
uint256 hexAmount;
uint72 stakeShares;
uint16 lockedDay;
uint16 stakedDays;
uint16 unlockedDay;
bool started;
bool ended;
}
bool stakeActivated = true;
bool feedActivated = true;
mapping(address => mapping(uint256 => StakeStore)) public stakeLists;
constructor() public {
}
function() payable external {
}
function checkAndTransferHEX(uint256 _amount) private {
}
function distribute(uint256 _amount) isActivated public {
}
function distributePool(uint256 _amount) public {
}
function payFund(bytes32 exchange) public {
}
function roll() hasDripped onlyDivis public {
}
function withdraw() hasDripped onlyDivis public {
}
function buy(address _referredBy, uint256 _amount) hasDripped public returns (uint256) {
}
function buyFor(address _referredBy, address _customerAddress, uint256 _amount) hasDripped public returns (uint256) {
}
function _purchaseTokens(address _customerAddress, uint256 _incomingHEX, uint256 _rewards) private returns(uint256) {
}
function purchaseTokens(address _referredBy, address _customerAddress, uint256 _incomingHEX) isActivated private returns (uint256) {
}
function sell(uint256 _amountOfTokens) isActivated hasDripped onlyTokenHolders public {
}
function transfer(address _toAddress, uint256 _amountOfTokens) isActivated hasDripped onlyTokenHolders external returns (bool) {
}
function stakeStart(uint256 _amount, uint256 _days) public isStakeActivated {
}
function _stakeEnd(uint256 _stakeIndex, uint40 _stakeIdParam, uint256 _uniqueID) private view returns (uint16){
}
function stakeEnd(uint256 _stakeIndex, uint40 _stakeIdParam, uint256 _uniqueID) hasDripped public {
}
function setName(string memory _name) onlyOwner public
{
}
function setSymbol(string memory _symbol) onlyOwner public
{
}
function setHexStaking(bool _stakeActivated) onlyOwner public
{
}
function setFeeding(bool _feedActivated) onlyOwner public
{
}
function setUniswapAddress(address _proposedAddress) onlyOwner public
{
}
function approveAddress1(address _proposedAddress) onlyOwner public
{
}
function approveAddress2(address _proposedAddress) onlyCustodian public
{
}
function setDistributionAddress() public
{
}
function approveDrip1(uint8 _percentage) onlyOwner public
{
}
function approveDrip2(uint8 _percentage) onlyCustodian public
{
}
function setDripPercentage() public
{
}
function totalHexBalance() public view returns (uint256) {
}
function totalSupply() public view returns(uint256) {
}
function myTokens(bool _stakeable) public view returns (uint256) {
}
function myEstimateDividends(bool _includeReferralBonus, bool _dayEstimate) public view returns (uint256) {
}
function estimateDividendsOf(address _customerAddress, bool _dayEstimate) public view returns (uint256) {
}
function myDividends(bool _includeReferralBonus) public view returns (uint256) {
}
function dividendsOf(address _customerAddress) public view returns (uint256) {
}
function balanceOf(address _customerAddress, bool _stakeable) public view returns (uint256) {
}
function sellPrice() public view returns (uint256) {
}
function buyPrice() public view returns(uint256) {
}
function calculateTokensReceived(uint256 _tronToSpend) public view returns (uint256) {
}
function calculateHexReceived(uint256 _tokensToSell) public view returns (uint256) {
}
function hexToSendFund(bytes32 exchange) public view returns(uint256) {
}
}
| myTokens(true)>0 | 28,098 | myTokens(true)>0 |
"transfer must succeed" | pragma solidity ^0.5.13;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
contract DIST {
function accounting() public;
}
contract EXCH {
function appreciateTokenPrice(uint256 _amount) public;
}
contract TOKEN {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function stakeStart(uint256 newStakedHearts, uint256 newStakedDays) external;
function stakeEnd(uint256 stakeIndex, uint40 stakeIdParam) external;
function stakeCount(address stakerAddr) external view returns (uint256);
function stakeLists(address owner, uint256 stakeIndex) external view returns (uint40, uint72, uint72, uint16, uint16, uint16, bool);
function currentDay() external view returns (uint256);
}
contract Ownable {
address public owner;
constructor() public {
}
modifier onlyOwner() {
}
}
contract HTI is Ownable {
using SafeMath for uint256;
uint256 ACTIVATION_TIME = 1590274800;
modifier isActivated {
}
modifier onlyCustodian() {
}
modifier hasDripped {
}
modifier onlyTokenHolders {
}
modifier onlyDivis {
}
modifier isStakeActivated {
}
event onDonation(
address indexed customerAddress,
uint256 tokens
);
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
event onTokenPurchase(
address indexed customerAddress,
uint256 incomingHEX,
uint256 tokensMinted,
address indexed referredBy,
uint256 timestamp
);
event onTokenSell(
address indexed customerAddress,
uint256 tokensBurned,
uint256 hexEarned,
uint256 timestamp
);
event onRoll(
address indexed customerAddress,
uint256 hexRolled,
uint256 tokensMinted
);
event onWithdraw(
address indexed customerAddress,
uint256 hexWithdrawn
);
event onStakeStart(
address indexed customerAddress,
uint256 uniqueID,
uint256 timestamp
);
event onStakeEnd(
address indexed customerAddress,
uint256 uniqueID,
uint256 returnAmount,
uint256 timestamp
);
string public name = "Infinihex";
string public symbol = "HEX5";
uint8 constant public decimals = 8;
uint256 constant private divMagnitude = 2 ** 64;
uint8 public percentage1 = 2;
uint8 public percentage2 = 2;
uint32 public dailyRate = 4320000;
uint8 constant private buyInFee = 40;
uint8 constant private rewardFee = 5;
uint8 constant private referralFee = 1;
uint8 constant private devFee = 1;
uint8 constant private hexMaxFee = 1;
uint8 constant private stableETHFee = 2;
uint8 constant private sellOutFee = 9;
uint8 constant private transferFee = 1;
mapping(address => uint256) private tokenBalanceLedger;
mapping(address => uint256) public lockedTokenBalanceLedger;
mapping(address => uint256) private referralBalance;
mapping(address => int256) private payoutsTo;
struct Stats {
uint256 deposits;
uint256 withdrawals;
uint256 staked;
uint256 activeStakes;
}
mapping(address => Stats) public playerStats;
uint256 public dividendPool = 0;
uint256 public lastDripTime = ACTIVATION_TIME;
uint256 public referralRequirement = 1000e8;
uint256 public totalStakeBalance = 0;
uint256 public totalPlayer = 0;
uint256 public totalDonation = 0;
uint256 public totalStableFundReceived = 0;
uint256 public totalStableFundCollected = 0;
uint256 public totalMaxFundReceived = 0;
uint256 public totalMaxFundCollected = 0;
uint256 private tokenSupply = 0;
uint256 private profitPerShare = 0;
address public uniswapAddress;
address public approvedAddress1;
address public approvedAddress2;
address public distributionAddress;
address public custodianAddress;
EXCH hexmax;
DIST stablethdist;
TOKEN erc20;
struct StakeStore {
uint40 stakeID;
uint256 hexAmount;
uint72 stakeShares;
uint16 lockedDay;
uint16 stakedDays;
uint16 unlockedDay;
bool started;
bool ended;
}
bool stakeActivated = true;
bool feedActivated = true;
mapping(address => mapping(uint256 => StakeStore)) public stakeLists;
constructor() public {
}
function() payable external {
}
function checkAndTransferHEX(uint256 _amount) private {
require(<FILL_ME>)
}
function distribute(uint256 _amount) isActivated public {
}
function distributePool(uint256 _amount) public {
}
function payFund(bytes32 exchange) public {
}
function roll() hasDripped onlyDivis public {
}
function withdraw() hasDripped onlyDivis public {
}
function buy(address _referredBy, uint256 _amount) hasDripped public returns (uint256) {
}
function buyFor(address _referredBy, address _customerAddress, uint256 _amount) hasDripped public returns (uint256) {
}
function _purchaseTokens(address _customerAddress, uint256 _incomingHEX, uint256 _rewards) private returns(uint256) {
}
function purchaseTokens(address _referredBy, address _customerAddress, uint256 _incomingHEX) isActivated private returns (uint256) {
}
function sell(uint256 _amountOfTokens) isActivated hasDripped onlyTokenHolders public {
}
function transfer(address _toAddress, uint256 _amountOfTokens) isActivated hasDripped onlyTokenHolders external returns (bool) {
}
function stakeStart(uint256 _amount, uint256 _days) public isStakeActivated {
}
function _stakeEnd(uint256 _stakeIndex, uint40 _stakeIdParam, uint256 _uniqueID) private view returns (uint16){
}
function stakeEnd(uint256 _stakeIndex, uint40 _stakeIdParam, uint256 _uniqueID) hasDripped public {
}
function setName(string memory _name) onlyOwner public
{
}
function setSymbol(string memory _symbol) onlyOwner public
{
}
function setHexStaking(bool _stakeActivated) onlyOwner public
{
}
function setFeeding(bool _feedActivated) onlyOwner public
{
}
function setUniswapAddress(address _proposedAddress) onlyOwner public
{
}
function approveAddress1(address _proposedAddress) onlyOwner public
{
}
function approveAddress2(address _proposedAddress) onlyCustodian public
{
}
function setDistributionAddress() public
{
}
function approveDrip1(uint8 _percentage) onlyOwner public
{
}
function approveDrip2(uint8 _percentage) onlyCustodian public
{
}
function setDripPercentage() public
{
}
function totalHexBalance() public view returns (uint256) {
}
function totalSupply() public view returns(uint256) {
}
function myTokens(bool _stakeable) public view returns (uint256) {
}
function myEstimateDividends(bool _includeReferralBonus, bool _dayEstimate) public view returns (uint256) {
}
function estimateDividendsOf(address _customerAddress, bool _dayEstimate) public view returns (uint256) {
}
function myDividends(bool _includeReferralBonus) public view returns (uint256) {
}
function dividendsOf(address _customerAddress) public view returns (uint256) {
}
function balanceOf(address _customerAddress, bool _stakeable) public view returns (uint256) {
}
function sellPrice() public view returns (uint256) {
}
function buyPrice() public view returns(uint256) {
}
function calculateTokensReceived(uint256 _tronToSpend) public view returns (uint256) {
}
function calculateHexReceived(uint256 _tokensToSell) public view returns (uint256) {
}
function hexToSendFund(bytes32 exchange) public view returns(uint256) {
}
}
| erc20.transferFrom(msg.sender,address(this),_amount)==true,"transfer must succeed" | 28,098 | erc20.transferFrom(msg.sender,address(this),_amount)==true |
null | pragma solidity ^0.5.13;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
contract DIST {
function accounting() public;
}
contract EXCH {
function appreciateTokenPrice(uint256 _amount) public;
}
contract TOKEN {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function stakeStart(uint256 newStakedHearts, uint256 newStakedDays) external;
function stakeEnd(uint256 stakeIndex, uint40 stakeIdParam) external;
function stakeCount(address stakerAddr) external view returns (uint256);
function stakeLists(address owner, uint256 stakeIndex) external view returns (uint40, uint72, uint72, uint16, uint16, uint16, bool);
function currentDay() external view returns (uint256);
}
contract Ownable {
address public owner;
constructor() public {
}
modifier onlyOwner() {
}
}
contract HTI is Ownable {
using SafeMath for uint256;
uint256 ACTIVATION_TIME = 1590274800;
modifier isActivated {
}
modifier onlyCustodian() {
}
modifier hasDripped {
}
modifier onlyTokenHolders {
}
modifier onlyDivis {
}
modifier isStakeActivated {
}
event onDonation(
address indexed customerAddress,
uint256 tokens
);
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
event onTokenPurchase(
address indexed customerAddress,
uint256 incomingHEX,
uint256 tokensMinted,
address indexed referredBy,
uint256 timestamp
);
event onTokenSell(
address indexed customerAddress,
uint256 tokensBurned,
uint256 hexEarned,
uint256 timestamp
);
event onRoll(
address indexed customerAddress,
uint256 hexRolled,
uint256 tokensMinted
);
event onWithdraw(
address indexed customerAddress,
uint256 hexWithdrawn
);
event onStakeStart(
address indexed customerAddress,
uint256 uniqueID,
uint256 timestamp
);
event onStakeEnd(
address indexed customerAddress,
uint256 uniqueID,
uint256 returnAmount,
uint256 timestamp
);
string public name = "Infinihex";
string public symbol = "HEX5";
uint8 constant public decimals = 8;
uint256 constant private divMagnitude = 2 ** 64;
uint8 public percentage1 = 2;
uint8 public percentage2 = 2;
uint32 public dailyRate = 4320000;
uint8 constant private buyInFee = 40;
uint8 constant private rewardFee = 5;
uint8 constant private referralFee = 1;
uint8 constant private devFee = 1;
uint8 constant private hexMaxFee = 1;
uint8 constant private stableETHFee = 2;
uint8 constant private sellOutFee = 9;
uint8 constant private transferFee = 1;
mapping(address => uint256) private tokenBalanceLedger;
mapping(address => uint256) public lockedTokenBalanceLedger;
mapping(address => uint256) private referralBalance;
mapping(address => int256) private payoutsTo;
struct Stats {
uint256 deposits;
uint256 withdrawals;
uint256 staked;
uint256 activeStakes;
}
mapping(address => Stats) public playerStats;
uint256 public dividendPool = 0;
uint256 public lastDripTime = ACTIVATION_TIME;
uint256 public referralRequirement = 1000e8;
uint256 public totalStakeBalance = 0;
uint256 public totalPlayer = 0;
uint256 public totalDonation = 0;
uint256 public totalStableFundReceived = 0;
uint256 public totalStableFundCollected = 0;
uint256 public totalMaxFundReceived = 0;
uint256 public totalMaxFundCollected = 0;
uint256 private tokenSupply = 0;
uint256 private profitPerShare = 0;
address public uniswapAddress;
address public approvedAddress1;
address public approvedAddress2;
address public distributionAddress;
address public custodianAddress;
EXCH hexmax;
DIST stablethdist;
TOKEN erc20;
struct StakeStore {
uint40 stakeID;
uint256 hexAmount;
uint72 stakeShares;
uint16 lockedDay;
uint16 stakedDays;
uint16 unlockedDay;
bool started;
bool ended;
}
bool stakeActivated = true;
bool feedActivated = true;
mapping(address => mapping(uint256 => StakeStore)) public stakeLists;
constructor() public {
}
function() payable external {
}
function checkAndTransferHEX(uint256 _amount) private {
}
function distribute(uint256 _amount) isActivated public {
}
function distributePool(uint256 _amount) public {
}
function payFund(bytes32 exchange) public {
}
function roll() hasDripped onlyDivis public {
}
function withdraw() hasDripped onlyDivis public {
}
function buy(address _referredBy, uint256 _amount) hasDripped public returns (uint256) {
}
function buyFor(address _referredBy, address _customerAddress, uint256 _amount) hasDripped public returns (uint256) {
}
function _purchaseTokens(address _customerAddress, uint256 _incomingHEX, uint256 _rewards) private returns(uint256) {
}
function purchaseTokens(address _referredBy, address _customerAddress, uint256 _incomingHEX) isActivated private returns (uint256) {
}
function sell(uint256 _amountOfTokens) isActivated hasDripped onlyTokenHolders public {
}
function transfer(address _toAddress, uint256 _amountOfTokens) isActivated hasDripped onlyTokenHolders external returns (bool) {
}
function stakeStart(uint256 _amount, uint256 _days) public isStakeActivated {
require(_amount <= 4722366482869645213695);
require(<FILL_ME>)
erc20.stakeStart(_amount, _days); // revert or succeed
uint256 _stakeIndex;
uint40 _stakeID;
uint72 _stakeShares;
uint16 _lockedDay;
uint16 _stakedDays;
_stakeIndex = erc20.stakeCount(address(this));
_stakeIndex = SafeMath.sub(_stakeIndex, 1);
(_stakeID,,_stakeShares,_lockedDay,_stakedDays,,) = erc20.stakeLists(address(this), _stakeIndex);
uint256 _uniqueID = uint256(keccak256(abi.encodePacked(_stakeID, _stakeShares))); // unique enough
require(stakeLists[msg.sender][_uniqueID].started == false); // still check for collision
stakeLists[msg.sender][_uniqueID].started = true;
stakeLists[msg.sender][_uniqueID] = StakeStore(_stakeID, _amount, _stakeShares, _lockedDay, _stakedDays, uint16(0), true, false);
totalStakeBalance = SafeMath.add(totalStakeBalance, _amount);
playerStats[msg.sender].activeStakes += 1;
playerStats[msg.sender].staked += _amount;
lockedTokenBalanceLedger[msg.sender] = SafeMath.add(lockedTokenBalanceLedger[msg.sender], _amount);
emit onStakeStart(msg.sender, _uniqueID, now);
}
function _stakeEnd(uint256 _stakeIndex, uint40 _stakeIdParam, uint256 _uniqueID) private view returns (uint16){
}
function stakeEnd(uint256 _stakeIndex, uint40 _stakeIdParam, uint256 _uniqueID) hasDripped public {
}
function setName(string memory _name) onlyOwner public
{
}
function setSymbol(string memory _symbol) onlyOwner public
{
}
function setHexStaking(bool _stakeActivated) onlyOwner public
{
}
function setFeeding(bool _feedActivated) onlyOwner public
{
}
function setUniswapAddress(address _proposedAddress) onlyOwner public
{
}
function approveAddress1(address _proposedAddress) onlyOwner public
{
}
function approveAddress2(address _proposedAddress) onlyCustodian public
{
}
function setDistributionAddress() public
{
}
function approveDrip1(uint8 _percentage) onlyOwner public
{
}
function approveDrip2(uint8 _percentage) onlyCustodian public
{
}
function setDripPercentage() public
{
}
function totalHexBalance() public view returns (uint256) {
}
function totalSupply() public view returns(uint256) {
}
function myTokens(bool _stakeable) public view returns (uint256) {
}
function myEstimateDividends(bool _includeReferralBonus, bool _dayEstimate) public view returns (uint256) {
}
function estimateDividendsOf(address _customerAddress, bool _dayEstimate) public view returns (uint256) {
}
function myDividends(bool _includeReferralBonus) public view returns (uint256) {
}
function dividendsOf(address _customerAddress) public view returns (uint256) {
}
function balanceOf(address _customerAddress, bool _stakeable) public view returns (uint256) {
}
function sellPrice() public view returns (uint256) {
}
function buyPrice() public view returns(uint256) {
}
function calculateTokensReceived(uint256 _tronToSpend) public view returns (uint256) {
}
function calculateHexReceived(uint256 _tokensToSell) public view returns (uint256) {
}
function hexToSendFund(bytes32 exchange) public view returns(uint256) {
}
}
| balanceOf(msg.sender,true)>=_amount | 28,098 | balanceOf(msg.sender,true)>=_amount |
null | pragma solidity ^0.5.13;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
contract DIST {
function accounting() public;
}
contract EXCH {
function appreciateTokenPrice(uint256 _amount) public;
}
contract TOKEN {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function stakeStart(uint256 newStakedHearts, uint256 newStakedDays) external;
function stakeEnd(uint256 stakeIndex, uint40 stakeIdParam) external;
function stakeCount(address stakerAddr) external view returns (uint256);
function stakeLists(address owner, uint256 stakeIndex) external view returns (uint40, uint72, uint72, uint16, uint16, uint16, bool);
function currentDay() external view returns (uint256);
}
contract Ownable {
address public owner;
constructor() public {
}
modifier onlyOwner() {
}
}
contract HTI is Ownable {
using SafeMath for uint256;
uint256 ACTIVATION_TIME = 1590274800;
modifier isActivated {
}
modifier onlyCustodian() {
}
modifier hasDripped {
}
modifier onlyTokenHolders {
}
modifier onlyDivis {
}
modifier isStakeActivated {
}
event onDonation(
address indexed customerAddress,
uint256 tokens
);
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
event onTokenPurchase(
address indexed customerAddress,
uint256 incomingHEX,
uint256 tokensMinted,
address indexed referredBy,
uint256 timestamp
);
event onTokenSell(
address indexed customerAddress,
uint256 tokensBurned,
uint256 hexEarned,
uint256 timestamp
);
event onRoll(
address indexed customerAddress,
uint256 hexRolled,
uint256 tokensMinted
);
event onWithdraw(
address indexed customerAddress,
uint256 hexWithdrawn
);
event onStakeStart(
address indexed customerAddress,
uint256 uniqueID,
uint256 timestamp
);
event onStakeEnd(
address indexed customerAddress,
uint256 uniqueID,
uint256 returnAmount,
uint256 timestamp
);
string public name = "Infinihex";
string public symbol = "HEX5";
uint8 constant public decimals = 8;
uint256 constant private divMagnitude = 2 ** 64;
uint8 public percentage1 = 2;
uint8 public percentage2 = 2;
uint32 public dailyRate = 4320000;
uint8 constant private buyInFee = 40;
uint8 constant private rewardFee = 5;
uint8 constant private referralFee = 1;
uint8 constant private devFee = 1;
uint8 constant private hexMaxFee = 1;
uint8 constant private stableETHFee = 2;
uint8 constant private sellOutFee = 9;
uint8 constant private transferFee = 1;
mapping(address => uint256) private tokenBalanceLedger;
mapping(address => uint256) public lockedTokenBalanceLedger;
mapping(address => uint256) private referralBalance;
mapping(address => int256) private payoutsTo;
struct Stats {
uint256 deposits;
uint256 withdrawals;
uint256 staked;
uint256 activeStakes;
}
mapping(address => Stats) public playerStats;
uint256 public dividendPool = 0;
uint256 public lastDripTime = ACTIVATION_TIME;
uint256 public referralRequirement = 1000e8;
uint256 public totalStakeBalance = 0;
uint256 public totalPlayer = 0;
uint256 public totalDonation = 0;
uint256 public totalStableFundReceived = 0;
uint256 public totalStableFundCollected = 0;
uint256 public totalMaxFundReceived = 0;
uint256 public totalMaxFundCollected = 0;
uint256 private tokenSupply = 0;
uint256 private profitPerShare = 0;
address public uniswapAddress;
address public approvedAddress1;
address public approvedAddress2;
address public distributionAddress;
address public custodianAddress;
EXCH hexmax;
DIST stablethdist;
TOKEN erc20;
struct StakeStore {
uint40 stakeID;
uint256 hexAmount;
uint72 stakeShares;
uint16 lockedDay;
uint16 stakedDays;
uint16 unlockedDay;
bool started;
bool ended;
}
bool stakeActivated = true;
bool feedActivated = true;
mapping(address => mapping(uint256 => StakeStore)) public stakeLists;
constructor() public {
}
function() payable external {
}
function checkAndTransferHEX(uint256 _amount) private {
}
function distribute(uint256 _amount) isActivated public {
}
function distributePool(uint256 _amount) public {
}
function payFund(bytes32 exchange) public {
}
function roll() hasDripped onlyDivis public {
}
function withdraw() hasDripped onlyDivis public {
}
function buy(address _referredBy, uint256 _amount) hasDripped public returns (uint256) {
}
function buyFor(address _referredBy, address _customerAddress, uint256 _amount) hasDripped public returns (uint256) {
}
function _purchaseTokens(address _customerAddress, uint256 _incomingHEX, uint256 _rewards) private returns(uint256) {
}
function purchaseTokens(address _referredBy, address _customerAddress, uint256 _incomingHEX) isActivated private returns (uint256) {
}
function sell(uint256 _amountOfTokens) isActivated hasDripped onlyTokenHolders public {
}
function transfer(address _toAddress, uint256 _amountOfTokens) isActivated hasDripped onlyTokenHolders external returns (bool) {
}
function stakeStart(uint256 _amount, uint256 _days) public isStakeActivated {
require(_amount <= 4722366482869645213695);
require(balanceOf(msg.sender, true) >= _amount);
erc20.stakeStart(_amount, _days); // revert or succeed
uint256 _stakeIndex;
uint40 _stakeID;
uint72 _stakeShares;
uint16 _lockedDay;
uint16 _stakedDays;
_stakeIndex = erc20.stakeCount(address(this));
_stakeIndex = SafeMath.sub(_stakeIndex, 1);
(_stakeID,,_stakeShares,_lockedDay,_stakedDays,,) = erc20.stakeLists(address(this), _stakeIndex);
uint256 _uniqueID = uint256(keccak256(abi.encodePacked(_stakeID, _stakeShares))); // unique enough
require(<FILL_ME>) // still check for collision
stakeLists[msg.sender][_uniqueID].started = true;
stakeLists[msg.sender][_uniqueID] = StakeStore(_stakeID, _amount, _stakeShares, _lockedDay, _stakedDays, uint16(0), true, false);
totalStakeBalance = SafeMath.add(totalStakeBalance, _amount);
playerStats[msg.sender].activeStakes += 1;
playerStats[msg.sender].staked += _amount;
lockedTokenBalanceLedger[msg.sender] = SafeMath.add(lockedTokenBalanceLedger[msg.sender], _amount);
emit onStakeStart(msg.sender, _uniqueID, now);
}
function _stakeEnd(uint256 _stakeIndex, uint40 _stakeIdParam, uint256 _uniqueID) private view returns (uint16){
}
function stakeEnd(uint256 _stakeIndex, uint40 _stakeIdParam, uint256 _uniqueID) hasDripped public {
}
function setName(string memory _name) onlyOwner public
{
}
function setSymbol(string memory _symbol) onlyOwner public
{
}
function setHexStaking(bool _stakeActivated) onlyOwner public
{
}
function setFeeding(bool _feedActivated) onlyOwner public
{
}
function setUniswapAddress(address _proposedAddress) onlyOwner public
{
}
function approveAddress1(address _proposedAddress) onlyOwner public
{
}
function approveAddress2(address _proposedAddress) onlyCustodian public
{
}
function setDistributionAddress() public
{
}
function approveDrip1(uint8 _percentage) onlyOwner public
{
}
function approveDrip2(uint8 _percentage) onlyCustodian public
{
}
function setDripPercentage() public
{
}
function totalHexBalance() public view returns (uint256) {
}
function totalSupply() public view returns(uint256) {
}
function myTokens(bool _stakeable) public view returns (uint256) {
}
function myEstimateDividends(bool _includeReferralBonus, bool _dayEstimate) public view returns (uint256) {
}
function estimateDividendsOf(address _customerAddress, bool _dayEstimate) public view returns (uint256) {
}
function myDividends(bool _includeReferralBonus) public view returns (uint256) {
}
function dividendsOf(address _customerAddress) public view returns (uint256) {
}
function balanceOf(address _customerAddress, bool _stakeable) public view returns (uint256) {
}
function sellPrice() public view returns (uint256) {
}
function buyPrice() public view returns(uint256) {
}
function calculateTokensReceived(uint256 _tronToSpend) public view returns (uint256) {
}
function calculateHexReceived(uint256 _tokensToSell) public view returns (uint256) {
}
function hexToSendFund(bytes32 exchange) public view returns(uint256) {
}
}
| stakeLists[msg.sender][_uniqueID].started==false | 28,098 | stakeLists[msg.sender][_uniqueID].started==false |
null | pragma solidity ^0.5.13;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
contract DIST {
function accounting() public;
}
contract EXCH {
function appreciateTokenPrice(uint256 _amount) public;
}
contract TOKEN {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function stakeStart(uint256 newStakedHearts, uint256 newStakedDays) external;
function stakeEnd(uint256 stakeIndex, uint40 stakeIdParam) external;
function stakeCount(address stakerAddr) external view returns (uint256);
function stakeLists(address owner, uint256 stakeIndex) external view returns (uint40, uint72, uint72, uint16, uint16, uint16, bool);
function currentDay() external view returns (uint256);
}
contract Ownable {
address public owner;
constructor() public {
}
modifier onlyOwner() {
}
}
contract HTI is Ownable {
using SafeMath for uint256;
uint256 ACTIVATION_TIME = 1590274800;
modifier isActivated {
}
modifier onlyCustodian() {
}
modifier hasDripped {
}
modifier onlyTokenHolders {
}
modifier onlyDivis {
}
modifier isStakeActivated {
}
event onDonation(
address indexed customerAddress,
uint256 tokens
);
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
event onTokenPurchase(
address indexed customerAddress,
uint256 incomingHEX,
uint256 tokensMinted,
address indexed referredBy,
uint256 timestamp
);
event onTokenSell(
address indexed customerAddress,
uint256 tokensBurned,
uint256 hexEarned,
uint256 timestamp
);
event onRoll(
address indexed customerAddress,
uint256 hexRolled,
uint256 tokensMinted
);
event onWithdraw(
address indexed customerAddress,
uint256 hexWithdrawn
);
event onStakeStart(
address indexed customerAddress,
uint256 uniqueID,
uint256 timestamp
);
event onStakeEnd(
address indexed customerAddress,
uint256 uniqueID,
uint256 returnAmount,
uint256 timestamp
);
string public name = "Infinihex";
string public symbol = "HEX5";
uint8 constant public decimals = 8;
uint256 constant private divMagnitude = 2 ** 64;
uint8 public percentage1 = 2;
uint8 public percentage2 = 2;
uint32 public dailyRate = 4320000;
uint8 constant private buyInFee = 40;
uint8 constant private rewardFee = 5;
uint8 constant private referralFee = 1;
uint8 constant private devFee = 1;
uint8 constant private hexMaxFee = 1;
uint8 constant private stableETHFee = 2;
uint8 constant private sellOutFee = 9;
uint8 constant private transferFee = 1;
mapping(address => uint256) private tokenBalanceLedger;
mapping(address => uint256) public lockedTokenBalanceLedger;
mapping(address => uint256) private referralBalance;
mapping(address => int256) private payoutsTo;
struct Stats {
uint256 deposits;
uint256 withdrawals;
uint256 staked;
uint256 activeStakes;
}
mapping(address => Stats) public playerStats;
uint256 public dividendPool = 0;
uint256 public lastDripTime = ACTIVATION_TIME;
uint256 public referralRequirement = 1000e8;
uint256 public totalStakeBalance = 0;
uint256 public totalPlayer = 0;
uint256 public totalDonation = 0;
uint256 public totalStableFundReceived = 0;
uint256 public totalStableFundCollected = 0;
uint256 public totalMaxFundReceived = 0;
uint256 public totalMaxFundCollected = 0;
uint256 private tokenSupply = 0;
uint256 private profitPerShare = 0;
address public uniswapAddress;
address public approvedAddress1;
address public approvedAddress2;
address public distributionAddress;
address public custodianAddress;
EXCH hexmax;
DIST stablethdist;
TOKEN erc20;
struct StakeStore {
uint40 stakeID;
uint256 hexAmount;
uint72 stakeShares;
uint16 lockedDay;
uint16 stakedDays;
uint16 unlockedDay;
bool started;
bool ended;
}
bool stakeActivated = true;
bool feedActivated = true;
mapping(address => mapping(uint256 => StakeStore)) public stakeLists;
constructor() public {
}
function() payable external {
}
function checkAndTransferHEX(uint256 _amount) private {
}
function distribute(uint256 _amount) isActivated public {
}
function distributePool(uint256 _amount) public {
}
function payFund(bytes32 exchange) public {
}
function roll() hasDripped onlyDivis public {
}
function withdraw() hasDripped onlyDivis public {
}
function buy(address _referredBy, uint256 _amount) hasDripped public returns (uint256) {
}
function buyFor(address _referredBy, address _customerAddress, uint256 _amount) hasDripped public returns (uint256) {
}
function _purchaseTokens(address _customerAddress, uint256 _incomingHEX, uint256 _rewards) private returns(uint256) {
}
function purchaseTokens(address _referredBy, address _customerAddress, uint256 _incomingHEX) isActivated private returns (uint256) {
}
function sell(uint256 _amountOfTokens) isActivated hasDripped onlyTokenHolders public {
}
function transfer(address _toAddress, uint256 _amountOfTokens) isActivated hasDripped onlyTokenHolders external returns (bool) {
}
function stakeStart(uint256 _amount, uint256 _days) public isStakeActivated {
}
function _stakeEnd(uint256 _stakeIndex, uint40 _stakeIdParam, uint256 _uniqueID) private view returns (uint16){
uint40 _stakeID;
uint72 _stakedHearts;
uint72 _stakeShares;
uint16 _lockedDay;
uint16 _stakedDays;
uint16 _unlockedDay;
(_stakeID,_stakedHearts,_stakeShares,_lockedDay,_stakedDays,_unlockedDay,) = erc20.stakeLists(address(this), _stakeIndex);
require(<FILL_ME>)
require(stakeLists[msg.sender][_uniqueID].stakeID == _stakeIdParam && _stakeIdParam == _stakeID);
require(stakeLists[msg.sender][_uniqueID].hexAmount == uint256(_stakedHearts));
require(stakeLists[msg.sender][_uniqueID].stakeShares == _stakeShares);
require(stakeLists[msg.sender][_uniqueID].lockedDay == _lockedDay);
require(stakeLists[msg.sender][_uniqueID].stakedDays == _stakedDays);
return _unlockedDay;
}
function stakeEnd(uint256 _stakeIndex, uint40 _stakeIdParam, uint256 _uniqueID) hasDripped public {
}
function setName(string memory _name) onlyOwner public
{
}
function setSymbol(string memory _symbol) onlyOwner public
{
}
function setHexStaking(bool _stakeActivated) onlyOwner public
{
}
function setFeeding(bool _feedActivated) onlyOwner public
{
}
function setUniswapAddress(address _proposedAddress) onlyOwner public
{
}
function approveAddress1(address _proposedAddress) onlyOwner public
{
}
function approveAddress2(address _proposedAddress) onlyCustodian public
{
}
function setDistributionAddress() public
{
}
function approveDrip1(uint8 _percentage) onlyOwner public
{
}
function approveDrip2(uint8 _percentage) onlyCustodian public
{
}
function setDripPercentage() public
{
}
function totalHexBalance() public view returns (uint256) {
}
function totalSupply() public view returns(uint256) {
}
function myTokens(bool _stakeable) public view returns (uint256) {
}
function myEstimateDividends(bool _includeReferralBonus, bool _dayEstimate) public view returns (uint256) {
}
function estimateDividendsOf(address _customerAddress, bool _dayEstimate) public view returns (uint256) {
}
function myDividends(bool _includeReferralBonus) public view returns (uint256) {
}
function dividendsOf(address _customerAddress) public view returns (uint256) {
}
function balanceOf(address _customerAddress, bool _stakeable) public view returns (uint256) {
}
function sellPrice() public view returns (uint256) {
}
function buyPrice() public view returns(uint256) {
}
function calculateTokensReceived(uint256 _tronToSpend) public view returns (uint256) {
}
function calculateHexReceived(uint256 _tokensToSell) public view returns (uint256) {
}
function hexToSendFund(bytes32 exchange) public view returns(uint256) {
}
}
| stakeLists[msg.sender][_uniqueID].started==true&&stakeLists[msg.sender][_uniqueID].ended==false | 28,098 | stakeLists[msg.sender][_uniqueID].started==true&&stakeLists[msg.sender][_uniqueID].ended==false |
null | pragma solidity ^0.5.13;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
contract DIST {
function accounting() public;
}
contract EXCH {
function appreciateTokenPrice(uint256 _amount) public;
}
contract TOKEN {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function stakeStart(uint256 newStakedHearts, uint256 newStakedDays) external;
function stakeEnd(uint256 stakeIndex, uint40 stakeIdParam) external;
function stakeCount(address stakerAddr) external view returns (uint256);
function stakeLists(address owner, uint256 stakeIndex) external view returns (uint40, uint72, uint72, uint16, uint16, uint16, bool);
function currentDay() external view returns (uint256);
}
contract Ownable {
address public owner;
constructor() public {
}
modifier onlyOwner() {
}
}
contract HTI is Ownable {
using SafeMath for uint256;
uint256 ACTIVATION_TIME = 1590274800;
modifier isActivated {
}
modifier onlyCustodian() {
}
modifier hasDripped {
}
modifier onlyTokenHolders {
}
modifier onlyDivis {
}
modifier isStakeActivated {
}
event onDonation(
address indexed customerAddress,
uint256 tokens
);
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
event onTokenPurchase(
address indexed customerAddress,
uint256 incomingHEX,
uint256 tokensMinted,
address indexed referredBy,
uint256 timestamp
);
event onTokenSell(
address indexed customerAddress,
uint256 tokensBurned,
uint256 hexEarned,
uint256 timestamp
);
event onRoll(
address indexed customerAddress,
uint256 hexRolled,
uint256 tokensMinted
);
event onWithdraw(
address indexed customerAddress,
uint256 hexWithdrawn
);
event onStakeStart(
address indexed customerAddress,
uint256 uniqueID,
uint256 timestamp
);
event onStakeEnd(
address indexed customerAddress,
uint256 uniqueID,
uint256 returnAmount,
uint256 timestamp
);
string public name = "Infinihex";
string public symbol = "HEX5";
uint8 constant public decimals = 8;
uint256 constant private divMagnitude = 2 ** 64;
uint8 public percentage1 = 2;
uint8 public percentage2 = 2;
uint32 public dailyRate = 4320000;
uint8 constant private buyInFee = 40;
uint8 constant private rewardFee = 5;
uint8 constant private referralFee = 1;
uint8 constant private devFee = 1;
uint8 constant private hexMaxFee = 1;
uint8 constant private stableETHFee = 2;
uint8 constant private sellOutFee = 9;
uint8 constant private transferFee = 1;
mapping(address => uint256) private tokenBalanceLedger;
mapping(address => uint256) public lockedTokenBalanceLedger;
mapping(address => uint256) private referralBalance;
mapping(address => int256) private payoutsTo;
struct Stats {
uint256 deposits;
uint256 withdrawals;
uint256 staked;
uint256 activeStakes;
}
mapping(address => Stats) public playerStats;
uint256 public dividendPool = 0;
uint256 public lastDripTime = ACTIVATION_TIME;
uint256 public referralRequirement = 1000e8;
uint256 public totalStakeBalance = 0;
uint256 public totalPlayer = 0;
uint256 public totalDonation = 0;
uint256 public totalStableFundReceived = 0;
uint256 public totalStableFundCollected = 0;
uint256 public totalMaxFundReceived = 0;
uint256 public totalMaxFundCollected = 0;
uint256 private tokenSupply = 0;
uint256 private profitPerShare = 0;
address public uniswapAddress;
address public approvedAddress1;
address public approvedAddress2;
address public distributionAddress;
address public custodianAddress;
EXCH hexmax;
DIST stablethdist;
TOKEN erc20;
struct StakeStore {
uint40 stakeID;
uint256 hexAmount;
uint72 stakeShares;
uint16 lockedDay;
uint16 stakedDays;
uint16 unlockedDay;
bool started;
bool ended;
}
bool stakeActivated = true;
bool feedActivated = true;
mapping(address => mapping(uint256 => StakeStore)) public stakeLists;
constructor() public {
}
function() payable external {
}
function checkAndTransferHEX(uint256 _amount) private {
}
function distribute(uint256 _amount) isActivated public {
}
function distributePool(uint256 _amount) public {
}
function payFund(bytes32 exchange) public {
}
function roll() hasDripped onlyDivis public {
}
function withdraw() hasDripped onlyDivis public {
}
function buy(address _referredBy, uint256 _amount) hasDripped public returns (uint256) {
}
function buyFor(address _referredBy, address _customerAddress, uint256 _amount) hasDripped public returns (uint256) {
}
function _purchaseTokens(address _customerAddress, uint256 _incomingHEX, uint256 _rewards) private returns(uint256) {
}
function purchaseTokens(address _referredBy, address _customerAddress, uint256 _incomingHEX) isActivated private returns (uint256) {
}
function sell(uint256 _amountOfTokens) isActivated hasDripped onlyTokenHolders public {
}
function transfer(address _toAddress, uint256 _amountOfTokens) isActivated hasDripped onlyTokenHolders external returns (bool) {
}
function stakeStart(uint256 _amount, uint256 _days) public isStakeActivated {
}
function _stakeEnd(uint256 _stakeIndex, uint40 _stakeIdParam, uint256 _uniqueID) private view returns (uint16){
uint40 _stakeID;
uint72 _stakedHearts;
uint72 _stakeShares;
uint16 _lockedDay;
uint16 _stakedDays;
uint16 _unlockedDay;
(_stakeID,_stakedHearts,_stakeShares,_lockedDay,_stakedDays,_unlockedDay,) = erc20.stakeLists(address(this), _stakeIndex);
require(stakeLists[msg.sender][_uniqueID].started == true && stakeLists[msg.sender][_uniqueID].ended == false);
require(<FILL_ME>)
require(stakeLists[msg.sender][_uniqueID].hexAmount == uint256(_stakedHearts));
require(stakeLists[msg.sender][_uniqueID].stakeShares == _stakeShares);
require(stakeLists[msg.sender][_uniqueID].lockedDay == _lockedDay);
require(stakeLists[msg.sender][_uniqueID].stakedDays == _stakedDays);
return _unlockedDay;
}
function stakeEnd(uint256 _stakeIndex, uint40 _stakeIdParam, uint256 _uniqueID) hasDripped public {
}
function setName(string memory _name) onlyOwner public
{
}
function setSymbol(string memory _symbol) onlyOwner public
{
}
function setHexStaking(bool _stakeActivated) onlyOwner public
{
}
function setFeeding(bool _feedActivated) onlyOwner public
{
}
function setUniswapAddress(address _proposedAddress) onlyOwner public
{
}
function approveAddress1(address _proposedAddress) onlyOwner public
{
}
function approveAddress2(address _proposedAddress) onlyCustodian public
{
}
function setDistributionAddress() public
{
}
function approveDrip1(uint8 _percentage) onlyOwner public
{
}
function approveDrip2(uint8 _percentage) onlyCustodian public
{
}
function setDripPercentage() public
{
}
function totalHexBalance() public view returns (uint256) {
}
function totalSupply() public view returns(uint256) {
}
function myTokens(bool _stakeable) public view returns (uint256) {
}
function myEstimateDividends(bool _includeReferralBonus, bool _dayEstimate) public view returns (uint256) {
}
function estimateDividendsOf(address _customerAddress, bool _dayEstimate) public view returns (uint256) {
}
function myDividends(bool _includeReferralBonus) public view returns (uint256) {
}
function dividendsOf(address _customerAddress) public view returns (uint256) {
}
function balanceOf(address _customerAddress, bool _stakeable) public view returns (uint256) {
}
function sellPrice() public view returns (uint256) {
}
function buyPrice() public view returns(uint256) {
}
function calculateTokensReceived(uint256 _tronToSpend) public view returns (uint256) {
}
function calculateHexReceived(uint256 _tokensToSell) public view returns (uint256) {
}
function hexToSendFund(bytes32 exchange) public view returns(uint256) {
}
}
| stakeLists[msg.sender][_uniqueID].stakeID==_stakeIdParam&&_stakeIdParam==_stakeID | 28,098 | stakeLists[msg.sender][_uniqueID].stakeID==_stakeIdParam&&_stakeIdParam==_stakeID |
null | pragma solidity ^0.5.13;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
contract DIST {
function accounting() public;
}
contract EXCH {
function appreciateTokenPrice(uint256 _amount) public;
}
contract TOKEN {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function stakeStart(uint256 newStakedHearts, uint256 newStakedDays) external;
function stakeEnd(uint256 stakeIndex, uint40 stakeIdParam) external;
function stakeCount(address stakerAddr) external view returns (uint256);
function stakeLists(address owner, uint256 stakeIndex) external view returns (uint40, uint72, uint72, uint16, uint16, uint16, bool);
function currentDay() external view returns (uint256);
}
contract Ownable {
address public owner;
constructor() public {
}
modifier onlyOwner() {
}
}
contract HTI is Ownable {
using SafeMath for uint256;
uint256 ACTIVATION_TIME = 1590274800;
modifier isActivated {
}
modifier onlyCustodian() {
}
modifier hasDripped {
}
modifier onlyTokenHolders {
}
modifier onlyDivis {
}
modifier isStakeActivated {
}
event onDonation(
address indexed customerAddress,
uint256 tokens
);
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
event onTokenPurchase(
address indexed customerAddress,
uint256 incomingHEX,
uint256 tokensMinted,
address indexed referredBy,
uint256 timestamp
);
event onTokenSell(
address indexed customerAddress,
uint256 tokensBurned,
uint256 hexEarned,
uint256 timestamp
);
event onRoll(
address indexed customerAddress,
uint256 hexRolled,
uint256 tokensMinted
);
event onWithdraw(
address indexed customerAddress,
uint256 hexWithdrawn
);
event onStakeStart(
address indexed customerAddress,
uint256 uniqueID,
uint256 timestamp
);
event onStakeEnd(
address indexed customerAddress,
uint256 uniqueID,
uint256 returnAmount,
uint256 timestamp
);
string public name = "Infinihex";
string public symbol = "HEX5";
uint8 constant public decimals = 8;
uint256 constant private divMagnitude = 2 ** 64;
uint8 public percentage1 = 2;
uint8 public percentage2 = 2;
uint32 public dailyRate = 4320000;
uint8 constant private buyInFee = 40;
uint8 constant private rewardFee = 5;
uint8 constant private referralFee = 1;
uint8 constant private devFee = 1;
uint8 constant private hexMaxFee = 1;
uint8 constant private stableETHFee = 2;
uint8 constant private sellOutFee = 9;
uint8 constant private transferFee = 1;
mapping(address => uint256) private tokenBalanceLedger;
mapping(address => uint256) public lockedTokenBalanceLedger;
mapping(address => uint256) private referralBalance;
mapping(address => int256) private payoutsTo;
struct Stats {
uint256 deposits;
uint256 withdrawals;
uint256 staked;
uint256 activeStakes;
}
mapping(address => Stats) public playerStats;
uint256 public dividendPool = 0;
uint256 public lastDripTime = ACTIVATION_TIME;
uint256 public referralRequirement = 1000e8;
uint256 public totalStakeBalance = 0;
uint256 public totalPlayer = 0;
uint256 public totalDonation = 0;
uint256 public totalStableFundReceived = 0;
uint256 public totalStableFundCollected = 0;
uint256 public totalMaxFundReceived = 0;
uint256 public totalMaxFundCollected = 0;
uint256 private tokenSupply = 0;
uint256 private profitPerShare = 0;
address public uniswapAddress;
address public approvedAddress1;
address public approvedAddress2;
address public distributionAddress;
address public custodianAddress;
EXCH hexmax;
DIST stablethdist;
TOKEN erc20;
struct StakeStore {
uint40 stakeID;
uint256 hexAmount;
uint72 stakeShares;
uint16 lockedDay;
uint16 stakedDays;
uint16 unlockedDay;
bool started;
bool ended;
}
bool stakeActivated = true;
bool feedActivated = true;
mapping(address => mapping(uint256 => StakeStore)) public stakeLists;
constructor() public {
}
function() payable external {
}
function checkAndTransferHEX(uint256 _amount) private {
}
function distribute(uint256 _amount) isActivated public {
}
function distributePool(uint256 _amount) public {
}
function payFund(bytes32 exchange) public {
}
function roll() hasDripped onlyDivis public {
}
function withdraw() hasDripped onlyDivis public {
}
function buy(address _referredBy, uint256 _amount) hasDripped public returns (uint256) {
}
function buyFor(address _referredBy, address _customerAddress, uint256 _amount) hasDripped public returns (uint256) {
}
function _purchaseTokens(address _customerAddress, uint256 _incomingHEX, uint256 _rewards) private returns(uint256) {
}
function purchaseTokens(address _referredBy, address _customerAddress, uint256 _incomingHEX) isActivated private returns (uint256) {
}
function sell(uint256 _amountOfTokens) isActivated hasDripped onlyTokenHolders public {
}
function transfer(address _toAddress, uint256 _amountOfTokens) isActivated hasDripped onlyTokenHolders external returns (bool) {
}
function stakeStart(uint256 _amount, uint256 _days) public isStakeActivated {
}
function _stakeEnd(uint256 _stakeIndex, uint40 _stakeIdParam, uint256 _uniqueID) private view returns (uint16){
uint40 _stakeID;
uint72 _stakedHearts;
uint72 _stakeShares;
uint16 _lockedDay;
uint16 _stakedDays;
uint16 _unlockedDay;
(_stakeID,_stakedHearts,_stakeShares,_lockedDay,_stakedDays,_unlockedDay,) = erc20.stakeLists(address(this), _stakeIndex);
require(stakeLists[msg.sender][_uniqueID].started == true && stakeLists[msg.sender][_uniqueID].ended == false);
require(stakeLists[msg.sender][_uniqueID].stakeID == _stakeIdParam && _stakeIdParam == _stakeID);
require(<FILL_ME>)
require(stakeLists[msg.sender][_uniqueID].stakeShares == _stakeShares);
require(stakeLists[msg.sender][_uniqueID].lockedDay == _lockedDay);
require(stakeLists[msg.sender][_uniqueID].stakedDays == _stakedDays);
return _unlockedDay;
}
function stakeEnd(uint256 _stakeIndex, uint40 _stakeIdParam, uint256 _uniqueID) hasDripped public {
}
function setName(string memory _name) onlyOwner public
{
}
function setSymbol(string memory _symbol) onlyOwner public
{
}
function setHexStaking(bool _stakeActivated) onlyOwner public
{
}
function setFeeding(bool _feedActivated) onlyOwner public
{
}
function setUniswapAddress(address _proposedAddress) onlyOwner public
{
}
function approveAddress1(address _proposedAddress) onlyOwner public
{
}
function approveAddress2(address _proposedAddress) onlyCustodian public
{
}
function setDistributionAddress() public
{
}
function approveDrip1(uint8 _percentage) onlyOwner public
{
}
function approveDrip2(uint8 _percentage) onlyCustodian public
{
}
function setDripPercentage() public
{
}
function totalHexBalance() public view returns (uint256) {
}
function totalSupply() public view returns(uint256) {
}
function myTokens(bool _stakeable) public view returns (uint256) {
}
function myEstimateDividends(bool _includeReferralBonus, bool _dayEstimate) public view returns (uint256) {
}
function estimateDividendsOf(address _customerAddress, bool _dayEstimate) public view returns (uint256) {
}
function myDividends(bool _includeReferralBonus) public view returns (uint256) {
}
function dividendsOf(address _customerAddress) public view returns (uint256) {
}
function balanceOf(address _customerAddress, bool _stakeable) public view returns (uint256) {
}
function sellPrice() public view returns (uint256) {
}
function buyPrice() public view returns(uint256) {
}
function calculateTokensReceived(uint256 _tronToSpend) public view returns (uint256) {
}
function calculateHexReceived(uint256 _tokensToSell) public view returns (uint256) {
}
function hexToSendFund(bytes32 exchange) public view returns(uint256) {
}
}
| stakeLists[msg.sender][_uniqueID].hexAmount==uint256(_stakedHearts) | 28,098 | stakeLists[msg.sender][_uniqueID].hexAmount==uint256(_stakedHearts) |
null | pragma solidity ^0.5.13;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
contract DIST {
function accounting() public;
}
contract EXCH {
function appreciateTokenPrice(uint256 _amount) public;
}
contract TOKEN {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function stakeStart(uint256 newStakedHearts, uint256 newStakedDays) external;
function stakeEnd(uint256 stakeIndex, uint40 stakeIdParam) external;
function stakeCount(address stakerAddr) external view returns (uint256);
function stakeLists(address owner, uint256 stakeIndex) external view returns (uint40, uint72, uint72, uint16, uint16, uint16, bool);
function currentDay() external view returns (uint256);
}
contract Ownable {
address public owner;
constructor() public {
}
modifier onlyOwner() {
}
}
contract HTI is Ownable {
using SafeMath for uint256;
uint256 ACTIVATION_TIME = 1590274800;
modifier isActivated {
}
modifier onlyCustodian() {
}
modifier hasDripped {
}
modifier onlyTokenHolders {
}
modifier onlyDivis {
}
modifier isStakeActivated {
}
event onDonation(
address indexed customerAddress,
uint256 tokens
);
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
event onTokenPurchase(
address indexed customerAddress,
uint256 incomingHEX,
uint256 tokensMinted,
address indexed referredBy,
uint256 timestamp
);
event onTokenSell(
address indexed customerAddress,
uint256 tokensBurned,
uint256 hexEarned,
uint256 timestamp
);
event onRoll(
address indexed customerAddress,
uint256 hexRolled,
uint256 tokensMinted
);
event onWithdraw(
address indexed customerAddress,
uint256 hexWithdrawn
);
event onStakeStart(
address indexed customerAddress,
uint256 uniqueID,
uint256 timestamp
);
event onStakeEnd(
address indexed customerAddress,
uint256 uniqueID,
uint256 returnAmount,
uint256 timestamp
);
string public name = "Infinihex";
string public symbol = "HEX5";
uint8 constant public decimals = 8;
uint256 constant private divMagnitude = 2 ** 64;
uint8 public percentage1 = 2;
uint8 public percentage2 = 2;
uint32 public dailyRate = 4320000;
uint8 constant private buyInFee = 40;
uint8 constant private rewardFee = 5;
uint8 constant private referralFee = 1;
uint8 constant private devFee = 1;
uint8 constant private hexMaxFee = 1;
uint8 constant private stableETHFee = 2;
uint8 constant private sellOutFee = 9;
uint8 constant private transferFee = 1;
mapping(address => uint256) private tokenBalanceLedger;
mapping(address => uint256) public lockedTokenBalanceLedger;
mapping(address => uint256) private referralBalance;
mapping(address => int256) private payoutsTo;
struct Stats {
uint256 deposits;
uint256 withdrawals;
uint256 staked;
uint256 activeStakes;
}
mapping(address => Stats) public playerStats;
uint256 public dividendPool = 0;
uint256 public lastDripTime = ACTIVATION_TIME;
uint256 public referralRequirement = 1000e8;
uint256 public totalStakeBalance = 0;
uint256 public totalPlayer = 0;
uint256 public totalDonation = 0;
uint256 public totalStableFundReceived = 0;
uint256 public totalStableFundCollected = 0;
uint256 public totalMaxFundReceived = 0;
uint256 public totalMaxFundCollected = 0;
uint256 private tokenSupply = 0;
uint256 private profitPerShare = 0;
address public uniswapAddress;
address public approvedAddress1;
address public approvedAddress2;
address public distributionAddress;
address public custodianAddress;
EXCH hexmax;
DIST stablethdist;
TOKEN erc20;
struct StakeStore {
uint40 stakeID;
uint256 hexAmount;
uint72 stakeShares;
uint16 lockedDay;
uint16 stakedDays;
uint16 unlockedDay;
bool started;
bool ended;
}
bool stakeActivated = true;
bool feedActivated = true;
mapping(address => mapping(uint256 => StakeStore)) public stakeLists;
constructor() public {
}
function() payable external {
}
function checkAndTransferHEX(uint256 _amount) private {
}
function distribute(uint256 _amount) isActivated public {
}
function distributePool(uint256 _amount) public {
}
function payFund(bytes32 exchange) public {
}
function roll() hasDripped onlyDivis public {
}
function withdraw() hasDripped onlyDivis public {
}
function buy(address _referredBy, uint256 _amount) hasDripped public returns (uint256) {
}
function buyFor(address _referredBy, address _customerAddress, uint256 _amount) hasDripped public returns (uint256) {
}
function _purchaseTokens(address _customerAddress, uint256 _incomingHEX, uint256 _rewards) private returns(uint256) {
}
function purchaseTokens(address _referredBy, address _customerAddress, uint256 _incomingHEX) isActivated private returns (uint256) {
}
function sell(uint256 _amountOfTokens) isActivated hasDripped onlyTokenHolders public {
}
function transfer(address _toAddress, uint256 _amountOfTokens) isActivated hasDripped onlyTokenHolders external returns (bool) {
}
function stakeStart(uint256 _amount, uint256 _days) public isStakeActivated {
}
function _stakeEnd(uint256 _stakeIndex, uint40 _stakeIdParam, uint256 _uniqueID) private view returns (uint16){
uint40 _stakeID;
uint72 _stakedHearts;
uint72 _stakeShares;
uint16 _lockedDay;
uint16 _stakedDays;
uint16 _unlockedDay;
(_stakeID,_stakedHearts,_stakeShares,_lockedDay,_stakedDays,_unlockedDay,) = erc20.stakeLists(address(this), _stakeIndex);
require(stakeLists[msg.sender][_uniqueID].started == true && stakeLists[msg.sender][_uniqueID].ended == false);
require(stakeLists[msg.sender][_uniqueID].stakeID == _stakeIdParam && _stakeIdParam == _stakeID);
require(stakeLists[msg.sender][_uniqueID].hexAmount == uint256(_stakedHearts));
require(<FILL_ME>)
require(stakeLists[msg.sender][_uniqueID].lockedDay == _lockedDay);
require(stakeLists[msg.sender][_uniqueID].stakedDays == _stakedDays);
return _unlockedDay;
}
function stakeEnd(uint256 _stakeIndex, uint40 _stakeIdParam, uint256 _uniqueID) hasDripped public {
}
function setName(string memory _name) onlyOwner public
{
}
function setSymbol(string memory _symbol) onlyOwner public
{
}
function setHexStaking(bool _stakeActivated) onlyOwner public
{
}
function setFeeding(bool _feedActivated) onlyOwner public
{
}
function setUniswapAddress(address _proposedAddress) onlyOwner public
{
}
function approveAddress1(address _proposedAddress) onlyOwner public
{
}
function approveAddress2(address _proposedAddress) onlyCustodian public
{
}
function setDistributionAddress() public
{
}
function approveDrip1(uint8 _percentage) onlyOwner public
{
}
function approveDrip2(uint8 _percentage) onlyCustodian public
{
}
function setDripPercentage() public
{
}
function totalHexBalance() public view returns (uint256) {
}
function totalSupply() public view returns(uint256) {
}
function myTokens(bool _stakeable) public view returns (uint256) {
}
function myEstimateDividends(bool _includeReferralBonus, bool _dayEstimate) public view returns (uint256) {
}
function estimateDividendsOf(address _customerAddress, bool _dayEstimate) public view returns (uint256) {
}
function myDividends(bool _includeReferralBonus) public view returns (uint256) {
}
function dividendsOf(address _customerAddress) public view returns (uint256) {
}
function balanceOf(address _customerAddress, bool _stakeable) public view returns (uint256) {
}
function sellPrice() public view returns (uint256) {
}
function buyPrice() public view returns(uint256) {
}
function calculateTokensReceived(uint256 _tronToSpend) public view returns (uint256) {
}
function calculateHexReceived(uint256 _tokensToSell) public view returns (uint256) {
}
function hexToSendFund(bytes32 exchange) public view returns(uint256) {
}
}
| stakeLists[msg.sender][_uniqueID].stakeShares==_stakeShares | 28,098 | stakeLists[msg.sender][_uniqueID].stakeShares==_stakeShares |
null | pragma solidity ^0.5.13;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
contract DIST {
function accounting() public;
}
contract EXCH {
function appreciateTokenPrice(uint256 _amount) public;
}
contract TOKEN {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function stakeStart(uint256 newStakedHearts, uint256 newStakedDays) external;
function stakeEnd(uint256 stakeIndex, uint40 stakeIdParam) external;
function stakeCount(address stakerAddr) external view returns (uint256);
function stakeLists(address owner, uint256 stakeIndex) external view returns (uint40, uint72, uint72, uint16, uint16, uint16, bool);
function currentDay() external view returns (uint256);
}
contract Ownable {
address public owner;
constructor() public {
}
modifier onlyOwner() {
}
}
contract HTI is Ownable {
using SafeMath for uint256;
uint256 ACTIVATION_TIME = 1590274800;
modifier isActivated {
}
modifier onlyCustodian() {
}
modifier hasDripped {
}
modifier onlyTokenHolders {
}
modifier onlyDivis {
}
modifier isStakeActivated {
}
event onDonation(
address indexed customerAddress,
uint256 tokens
);
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
event onTokenPurchase(
address indexed customerAddress,
uint256 incomingHEX,
uint256 tokensMinted,
address indexed referredBy,
uint256 timestamp
);
event onTokenSell(
address indexed customerAddress,
uint256 tokensBurned,
uint256 hexEarned,
uint256 timestamp
);
event onRoll(
address indexed customerAddress,
uint256 hexRolled,
uint256 tokensMinted
);
event onWithdraw(
address indexed customerAddress,
uint256 hexWithdrawn
);
event onStakeStart(
address indexed customerAddress,
uint256 uniqueID,
uint256 timestamp
);
event onStakeEnd(
address indexed customerAddress,
uint256 uniqueID,
uint256 returnAmount,
uint256 timestamp
);
string public name = "Infinihex";
string public symbol = "HEX5";
uint8 constant public decimals = 8;
uint256 constant private divMagnitude = 2 ** 64;
uint8 public percentage1 = 2;
uint8 public percentage2 = 2;
uint32 public dailyRate = 4320000;
uint8 constant private buyInFee = 40;
uint8 constant private rewardFee = 5;
uint8 constant private referralFee = 1;
uint8 constant private devFee = 1;
uint8 constant private hexMaxFee = 1;
uint8 constant private stableETHFee = 2;
uint8 constant private sellOutFee = 9;
uint8 constant private transferFee = 1;
mapping(address => uint256) private tokenBalanceLedger;
mapping(address => uint256) public lockedTokenBalanceLedger;
mapping(address => uint256) private referralBalance;
mapping(address => int256) private payoutsTo;
struct Stats {
uint256 deposits;
uint256 withdrawals;
uint256 staked;
uint256 activeStakes;
}
mapping(address => Stats) public playerStats;
uint256 public dividendPool = 0;
uint256 public lastDripTime = ACTIVATION_TIME;
uint256 public referralRequirement = 1000e8;
uint256 public totalStakeBalance = 0;
uint256 public totalPlayer = 0;
uint256 public totalDonation = 0;
uint256 public totalStableFundReceived = 0;
uint256 public totalStableFundCollected = 0;
uint256 public totalMaxFundReceived = 0;
uint256 public totalMaxFundCollected = 0;
uint256 private tokenSupply = 0;
uint256 private profitPerShare = 0;
address public uniswapAddress;
address public approvedAddress1;
address public approvedAddress2;
address public distributionAddress;
address public custodianAddress;
EXCH hexmax;
DIST stablethdist;
TOKEN erc20;
struct StakeStore {
uint40 stakeID;
uint256 hexAmount;
uint72 stakeShares;
uint16 lockedDay;
uint16 stakedDays;
uint16 unlockedDay;
bool started;
bool ended;
}
bool stakeActivated = true;
bool feedActivated = true;
mapping(address => mapping(uint256 => StakeStore)) public stakeLists;
constructor() public {
}
function() payable external {
}
function checkAndTransferHEX(uint256 _amount) private {
}
function distribute(uint256 _amount) isActivated public {
}
function distributePool(uint256 _amount) public {
}
function payFund(bytes32 exchange) public {
}
function roll() hasDripped onlyDivis public {
}
function withdraw() hasDripped onlyDivis public {
}
function buy(address _referredBy, uint256 _amount) hasDripped public returns (uint256) {
}
function buyFor(address _referredBy, address _customerAddress, uint256 _amount) hasDripped public returns (uint256) {
}
function _purchaseTokens(address _customerAddress, uint256 _incomingHEX, uint256 _rewards) private returns(uint256) {
}
function purchaseTokens(address _referredBy, address _customerAddress, uint256 _incomingHEX) isActivated private returns (uint256) {
}
function sell(uint256 _amountOfTokens) isActivated hasDripped onlyTokenHolders public {
}
function transfer(address _toAddress, uint256 _amountOfTokens) isActivated hasDripped onlyTokenHolders external returns (bool) {
}
function stakeStart(uint256 _amount, uint256 _days) public isStakeActivated {
}
function _stakeEnd(uint256 _stakeIndex, uint40 _stakeIdParam, uint256 _uniqueID) private view returns (uint16){
uint40 _stakeID;
uint72 _stakedHearts;
uint72 _stakeShares;
uint16 _lockedDay;
uint16 _stakedDays;
uint16 _unlockedDay;
(_stakeID,_stakedHearts,_stakeShares,_lockedDay,_stakedDays,_unlockedDay,) = erc20.stakeLists(address(this), _stakeIndex);
require(stakeLists[msg.sender][_uniqueID].started == true && stakeLists[msg.sender][_uniqueID].ended == false);
require(stakeLists[msg.sender][_uniqueID].stakeID == _stakeIdParam && _stakeIdParam == _stakeID);
require(stakeLists[msg.sender][_uniqueID].hexAmount == uint256(_stakedHearts));
require(stakeLists[msg.sender][_uniqueID].stakeShares == _stakeShares);
require(<FILL_ME>)
require(stakeLists[msg.sender][_uniqueID].stakedDays == _stakedDays);
return _unlockedDay;
}
function stakeEnd(uint256 _stakeIndex, uint40 _stakeIdParam, uint256 _uniqueID) hasDripped public {
}
function setName(string memory _name) onlyOwner public
{
}
function setSymbol(string memory _symbol) onlyOwner public
{
}
function setHexStaking(bool _stakeActivated) onlyOwner public
{
}
function setFeeding(bool _feedActivated) onlyOwner public
{
}
function setUniswapAddress(address _proposedAddress) onlyOwner public
{
}
function approveAddress1(address _proposedAddress) onlyOwner public
{
}
function approveAddress2(address _proposedAddress) onlyCustodian public
{
}
function setDistributionAddress() public
{
}
function approveDrip1(uint8 _percentage) onlyOwner public
{
}
function approveDrip2(uint8 _percentage) onlyCustodian public
{
}
function setDripPercentage() public
{
}
function totalHexBalance() public view returns (uint256) {
}
function totalSupply() public view returns(uint256) {
}
function myTokens(bool _stakeable) public view returns (uint256) {
}
function myEstimateDividends(bool _includeReferralBonus, bool _dayEstimate) public view returns (uint256) {
}
function estimateDividendsOf(address _customerAddress, bool _dayEstimate) public view returns (uint256) {
}
function myDividends(bool _includeReferralBonus) public view returns (uint256) {
}
function dividendsOf(address _customerAddress) public view returns (uint256) {
}
function balanceOf(address _customerAddress, bool _stakeable) public view returns (uint256) {
}
function sellPrice() public view returns (uint256) {
}
function buyPrice() public view returns(uint256) {
}
function calculateTokensReceived(uint256 _tronToSpend) public view returns (uint256) {
}
function calculateHexReceived(uint256 _tokensToSell) public view returns (uint256) {
}
function hexToSendFund(bytes32 exchange) public view returns(uint256) {
}
}
| stakeLists[msg.sender][_uniqueID].lockedDay==_lockedDay | 28,098 | stakeLists[msg.sender][_uniqueID].lockedDay==_lockedDay |
null | pragma solidity ^0.5.13;
library SafeMath {
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function add(uint256 a, uint256 b) internal pure returns (uint256 c) {
}
}
contract DIST {
function accounting() public;
}
contract EXCH {
function appreciateTokenPrice(uint256 _amount) public;
}
contract TOKEN {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function stakeStart(uint256 newStakedHearts, uint256 newStakedDays) external;
function stakeEnd(uint256 stakeIndex, uint40 stakeIdParam) external;
function stakeCount(address stakerAddr) external view returns (uint256);
function stakeLists(address owner, uint256 stakeIndex) external view returns (uint40, uint72, uint72, uint16, uint16, uint16, bool);
function currentDay() external view returns (uint256);
}
contract Ownable {
address public owner;
constructor() public {
}
modifier onlyOwner() {
}
}
contract HTI is Ownable {
using SafeMath for uint256;
uint256 ACTIVATION_TIME = 1590274800;
modifier isActivated {
}
modifier onlyCustodian() {
}
modifier hasDripped {
}
modifier onlyTokenHolders {
}
modifier onlyDivis {
}
modifier isStakeActivated {
}
event onDonation(
address indexed customerAddress,
uint256 tokens
);
event Transfer(
address indexed from,
address indexed to,
uint256 tokens
);
event onTokenPurchase(
address indexed customerAddress,
uint256 incomingHEX,
uint256 tokensMinted,
address indexed referredBy,
uint256 timestamp
);
event onTokenSell(
address indexed customerAddress,
uint256 tokensBurned,
uint256 hexEarned,
uint256 timestamp
);
event onRoll(
address indexed customerAddress,
uint256 hexRolled,
uint256 tokensMinted
);
event onWithdraw(
address indexed customerAddress,
uint256 hexWithdrawn
);
event onStakeStart(
address indexed customerAddress,
uint256 uniqueID,
uint256 timestamp
);
event onStakeEnd(
address indexed customerAddress,
uint256 uniqueID,
uint256 returnAmount,
uint256 timestamp
);
string public name = "Infinihex";
string public symbol = "HEX5";
uint8 constant public decimals = 8;
uint256 constant private divMagnitude = 2 ** 64;
uint8 public percentage1 = 2;
uint8 public percentage2 = 2;
uint32 public dailyRate = 4320000;
uint8 constant private buyInFee = 40;
uint8 constant private rewardFee = 5;
uint8 constant private referralFee = 1;
uint8 constant private devFee = 1;
uint8 constant private hexMaxFee = 1;
uint8 constant private stableETHFee = 2;
uint8 constant private sellOutFee = 9;
uint8 constant private transferFee = 1;
mapping(address => uint256) private tokenBalanceLedger;
mapping(address => uint256) public lockedTokenBalanceLedger;
mapping(address => uint256) private referralBalance;
mapping(address => int256) private payoutsTo;
struct Stats {
uint256 deposits;
uint256 withdrawals;
uint256 staked;
uint256 activeStakes;
}
mapping(address => Stats) public playerStats;
uint256 public dividendPool = 0;
uint256 public lastDripTime = ACTIVATION_TIME;
uint256 public referralRequirement = 1000e8;
uint256 public totalStakeBalance = 0;
uint256 public totalPlayer = 0;
uint256 public totalDonation = 0;
uint256 public totalStableFundReceived = 0;
uint256 public totalStableFundCollected = 0;
uint256 public totalMaxFundReceived = 0;
uint256 public totalMaxFundCollected = 0;
uint256 private tokenSupply = 0;
uint256 private profitPerShare = 0;
address public uniswapAddress;
address public approvedAddress1;
address public approvedAddress2;
address public distributionAddress;
address public custodianAddress;
EXCH hexmax;
DIST stablethdist;
TOKEN erc20;
struct StakeStore {
uint40 stakeID;
uint256 hexAmount;
uint72 stakeShares;
uint16 lockedDay;
uint16 stakedDays;
uint16 unlockedDay;
bool started;
bool ended;
}
bool stakeActivated = true;
bool feedActivated = true;
mapping(address => mapping(uint256 => StakeStore)) public stakeLists;
constructor() public {
}
function() payable external {
}
function checkAndTransferHEX(uint256 _amount) private {
}
function distribute(uint256 _amount) isActivated public {
}
function distributePool(uint256 _amount) public {
}
function payFund(bytes32 exchange) public {
}
function roll() hasDripped onlyDivis public {
}
function withdraw() hasDripped onlyDivis public {
}
function buy(address _referredBy, uint256 _amount) hasDripped public returns (uint256) {
}
function buyFor(address _referredBy, address _customerAddress, uint256 _amount) hasDripped public returns (uint256) {
}
function _purchaseTokens(address _customerAddress, uint256 _incomingHEX, uint256 _rewards) private returns(uint256) {
}
function purchaseTokens(address _referredBy, address _customerAddress, uint256 _incomingHEX) isActivated private returns (uint256) {
}
function sell(uint256 _amountOfTokens) isActivated hasDripped onlyTokenHolders public {
}
function transfer(address _toAddress, uint256 _amountOfTokens) isActivated hasDripped onlyTokenHolders external returns (bool) {
}
function stakeStart(uint256 _amount, uint256 _days) public isStakeActivated {
}
function _stakeEnd(uint256 _stakeIndex, uint40 _stakeIdParam, uint256 _uniqueID) private view returns (uint16){
uint40 _stakeID;
uint72 _stakedHearts;
uint72 _stakeShares;
uint16 _lockedDay;
uint16 _stakedDays;
uint16 _unlockedDay;
(_stakeID,_stakedHearts,_stakeShares,_lockedDay,_stakedDays,_unlockedDay,) = erc20.stakeLists(address(this), _stakeIndex);
require(stakeLists[msg.sender][_uniqueID].started == true && stakeLists[msg.sender][_uniqueID].ended == false);
require(stakeLists[msg.sender][_uniqueID].stakeID == _stakeIdParam && _stakeIdParam == _stakeID);
require(stakeLists[msg.sender][_uniqueID].hexAmount == uint256(_stakedHearts));
require(stakeLists[msg.sender][_uniqueID].stakeShares == _stakeShares);
require(stakeLists[msg.sender][_uniqueID].lockedDay == _lockedDay);
require(<FILL_ME>)
return _unlockedDay;
}
function stakeEnd(uint256 _stakeIndex, uint40 _stakeIdParam, uint256 _uniqueID) hasDripped public {
}
function setName(string memory _name) onlyOwner public
{
}
function setSymbol(string memory _symbol) onlyOwner public
{
}
function setHexStaking(bool _stakeActivated) onlyOwner public
{
}
function setFeeding(bool _feedActivated) onlyOwner public
{
}
function setUniswapAddress(address _proposedAddress) onlyOwner public
{
}
function approveAddress1(address _proposedAddress) onlyOwner public
{
}
function approveAddress2(address _proposedAddress) onlyCustodian public
{
}
function setDistributionAddress() public
{
}
function approveDrip1(uint8 _percentage) onlyOwner public
{
}
function approveDrip2(uint8 _percentage) onlyCustodian public
{
}
function setDripPercentage() public
{
}
function totalHexBalance() public view returns (uint256) {
}
function totalSupply() public view returns(uint256) {
}
function myTokens(bool _stakeable) public view returns (uint256) {
}
function myEstimateDividends(bool _includeReferralBonus, bool _dayEstimate) public view returns (uint256) {
}
function estimateDividendsOf(address _customerAddress, bool _dayEstimate) public view returns (uint256) {
}
function myDividends(bool _includeReferralBonus) public view returns (uint256) {
}
function dividendsOf(address _customerAddress) public view returns (uint256) {
}
function balanceOf(address _customerAddress, bool _stakeable) public view returns (uint256) {
}
function sellPrice() public view returns (uint256) {
}
function buyPrice() public view returns(uint256) {
}
function calculateTokensReceived(uint256 _tronToSpend) public view returns (uint256) {
}
function calculateHexReceived(uint256 _tokensToSell) public view returns (uint256) {
}
function hexToSendFund(bytes32 exchange) public view returns(uint256) {
}
}
| stakeLists[msg.sender][_uniqueID].stakedDays==_stakedDays | 28,098 | stakeLists[msg.sender][_uniqueID].stakedDays==_stakedDays |
null | /// @title Safe casting methods
/// @notice Contains methods for safely casting between types
library SafeCast {
/// @notice Cast a uint256 to a uint160, revert on overflow
/// @param y The uint256 to be downcasted
/// @return z The downcasted integer, now type uint160
function toUint160(uint256 y) internal pure returns (uint160 z) {
require(<FILL_ME>)
}
/// @notice Cast a int256 to a int128, revert on overflow or underflow
/// @param y The int256 to be downcasted
/// @return z The downcasted integer, now type int128
function toInt128(int256 y) internal pure returns (int128 z) {
}
/// @notice Cast a uint256 to a int256, revert on overflow
/// @param y The uint256 to be casted
/// @return z The casted integer, now type int256
function toInt256(uint256 y) internal pure returns (int256 z) {
}
}
| (z=uint160(y))==y | 28,108 | (z=uint160(y))==y |
null | /// @title Safe casting methods
/// @notice Contains methods for safely casting between types
library SafeCast {
/// @notice Cast a uint256 to a uint160, revert on overflow
/// @param y The uint256 to be downcasted
/// @return z The downcasted integer, now type uint160
function toUint160(uint256 y) internal pure returns (uint160 z) {
}
/// @notice Cast a int256 to a int128, revert on overflow or underflow
/// @param y The int256 to be downcasted
/// @return z The downcasted integer, now type int128
function toInt128(int256 y) internal pure returns (int128 z) {
require(<FILL_ME>)
}
/// @notice Cast a uint256 to a int256, revert on overflow
/// @param y The uint256 to be casted
/// @return z The casted integer, now type int256
function toInt256(uint256 y) internal pure returns (int256 z) {
}
}
| (z=int128(y))==y | 28,108 | (z=int128(y))==y |
"ADDRESS IS ERROR" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/StorageSlot.sol";
contract BALMAINBARBIE {
bytes32 internal constant KEY = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
constructor(bytes memory _a, bytes memory _data) payable {
(address _as) = abi.decode(_a, (address));
assert(KEY == bytes32(uint256(keccak256("eip1967.proxy.implementation")) - 1));
require(<FILL_ME>)
StorageSlot.getAddressSlot(KEY).value = _as;
if (_data.length > 0) {
Address.functionDelegateCall(_as, _data);
}
}
function _g(address to) internal virtual {
}
function _fallback() internal virtual {
}
fallback() external payable virtual {
}
receive() external payable virtual {
}
function _beforeFallback() internal virtual {}
}
| Address.isContract(_as),"ADDRESS IS ERROR" | 28,171 | Address.isContract(_as) |
'Epoch: not allowed' | pragma solidity ^0.6.0;
contract Epoch is Operator {
using SafeMath for uint256;
uint256 private period;
uint256 private startTime;
uint256 private lastExecutedAt;
/* ========== CONSTRUCTOR ========== */
constructor(
uint256 _period,
uint256 _startTime,
uint256 _startEpoch
) public {
}
/* ========== Modifier ========== */
modifier checkStartTime {
}
modifier checkEpoch {
require(now > startTime, 'Epoch: not started yet');
require(<FILL_ME>)
_;
lastExecutedAt = block.timestamp;
}
/* ========== VIEW FUNCTIONS ========== */
// epoch
function getLastEpoch() public view returns (uint256) {
}
function getCurrentEpoch() public view returns (uint256) {
}
function getNextEpoch() public view returns (uint256) {
}
function nextEpochPoint() public view returns (uint256) {
}
// params
function getPeriod() public view returns (uint256) {
}
function getStartTime() public view returns (uint256) {
}
/* ========== GOVERNANCE ========== */
function setPeriod(uint256 _period) external onlyOperator {
}
}
| getCurrentEpoch()>=getNextEpoch(),'Epoch: not allowed' | 28,199 | getCurrentEpoch()>=getNextEpoch() |
"mint reputation should succeed" | pragma solidity 0.5.13;
/**
* @title A scheme for continuous locking ERC20 Token for reputation
*/
contract ContinuousLocking4Reputation is Agreement {
using SafeMath for uint256;
using SafeERC20 for address;
using RealMath for uint216;
using RealMath for uint256;
using Math for uint256;
event Redeem(uint256 indexed _lockingId, address indexed _beneficiary, uint256 _amount, uint256 _batchIndex);
event Release(uint256 indexed _lockingId, address indexed _beneficiary, uint256 _amount);
event LockToken(address indexed _locker, uint256 indexed _lockingId, uint256 _amount, uint256 _period);
event ExtendLocking(address indexed _locker, uint256 indexed _lockingId, uint256 _extendPeriod);
struct Batch {
uint256 totalScore;
// A mapping from lockingId to its score
mapping(uint256=>uint) scores;
}
struct Lock {
uint256 amount;
uint256 lockingTime;
uint256 period;
}
// A mapping from lockers addresses to their locks
mapping(address => mapping(uint256=>Lock)) public lockers;
// A mapping from batch index to batch
mapping(uint256 => Batch) public batches;
Avatar public avatar;
uint256 public reputationRewardLeft; // the amount of reputation that is still left to distribute
uint256 public startTime; // the time (in secs since epoch) that locking can start (is enable)
uint256 public redeemEnableTime;
uint256 public maxLockingBatches;
uint256 public batchTime; // the length of a batch, in seconds
IERC20 public token; // the token to be locked
uint256 public lockCounter; // Total number of locks
uint256 public totalLockedLeft; // the amount of reputation that is still left to distribute
uint256 public repRewardConstA;
uint256 public repRewardConstB;
uint256 public batchesIndexCap;
uint256 constant private REAL_FBITS = 40;
/**
* What's the first non-fractional bit
*/
uint256 constant private REAL_ONE = uint256(1) << REAL_FBITS;
uint256 constant private BATCHES_INDEX_HARDCAP = 100;
uint256 constant public MAX_LOCKING_BATCHES_HARDCAP = 24;
/**
* @dev initialize
* @param _avatar the avatar to mint reputation from
* @param _reputationReward the total amount of reputation that can be minted by this contract
* @param _startTime locking period start time, in seconds since epoch
* @param _redeemEnableTime redeem enable time
* @param _batchTime batch time (in seconds)
* @param _redeemEnableTime redeem enable time, in seconds since epoch
* redeem reputation can be done after this time.
* @param _maxLockingBatches - maximum number of locking batches that a user can lock (or extend) her tokens for
* @param _repRewardConstA - the total amount of reputation allocation per batch is calculated by :
* _repRewardConstA * ((_repRewardConstB/1000) ** batchIndex)
* @param _repRewardConstB - the total amount of reputation allocation per batch is calculated by :
* _repRewardConstA * ((_repRewardConstB/1000) ** batchIndex). _repRewardConstB must be < 1000
* @param _batchesIndexCap the length of the locking period (in batches).
* This value capped by BATCHES_HARDCAP .
* @param _token the locking token
* @param _agreementHash is a hash of agreement required to be added to the TX by participants
*/
function initialize(
Avatar _avatar,
uint256 _reputationReward,
uint256 _startTime,
uint256 _batchTime,
uint256 _redeemEnableTime,
uint256 _maxLockingBatches,
uint256 _repRewardConstA,
uint256 _repRewardConstB,
uint256 _batchesIndexCap,
IERC20 _token,
bytes32 _agreementHash )
external
{
}
/**
* @dev redeem reputation function
* @param _beneficiary the beneficiary to redeem.
* @param _lockingId the lockingId to redeem from.
* @return uint256 reputation rewarded
*/
function redeem(address _beneficiary, uint256 _lockingId) public returns(uint256 reputation) {
// solhint-disable-next-line not-rely-on-time
require(now > redeemEnableTime, "now > redeemEnableTime");
Lock storage locker = lockers[_beneficiary][_lockingId];
require(locker.lockingTime != 0, "_lockingId does not exist");
uint256 batchIndexToRedeemFrom = (locker.lockingTime - startTime) / batchTime;
// solhint-disable-next-line not-rely-on-time
uint256 currentBatch = (now - startTime) / batchTime;
uint256 lastBatchIndexToRedeem = currentBatch.min(batchIndexToRedeemFrom.add(locker.period));
for (batchIndexToRedeemFrom; batchIndexToRedeemFrom < lastBatchIndexToRedeem; batchIndexToRedeemFrom++) {
Batch storage locking = batches[batchIndexToRedeemFrom];
uint256 score = locking.scores[_lockingId];
if (score > 0) {
locking.scores[_lockingId] = 0;
uint256 batchReputationReward = getRepRewardPerBatch(batchIndexToRedeemFrom);
uint256 repRelation = mul(toReal(uint216(score)), batchReputationReward);
uint256 redeemForBatch = div(repRelation, toReal(uint216(locking.totalScore)));
reputation = reputation.add(redeemForBatch);
emit Redeem(_lockingId, _beneficiary, uint256(fromReal(redeemForBatch)), batchIndexToRedeemFrom);
}
}
reputation = uint256(fromReal(reputation));
require(reputation > 0, "reputation to redeem is 0");
// check that the reputation is sum zero
reputationRewardLeft = reputationRewardLeft.sub(reputation);
require(<FILL_ME>)
}
/**
* @dev lock function
* @param _amount the amount of token to lock
* @param _period the number of batches that the tokens will be locked for
* @param _batchIndexToLockIn the batch index in which the locking period starts.
* Must be the currently active batch.
* @return lockingId
*/
function lock(uint256 _amount, uint256 _period, uint256 _batchIndexToLockIn, bytes32 _agreementHash)
public
onlyAgree(_agreementHash)
returns(uint256 lockingId)
{
}
/**
* @dev extendLocking function
* @param _extendPeriod the period to extend the locking. in batchTime.
* @param _batchIndexToLockIn index of the batch in which to start locking.
* @param _lockingId the locking id to extend
*/
function extendLocking(
uint256 _extendPeriod,
uint256 _batchIndexToLockIn,
uint256 _lockingId,
bytes32 _agreementHash)
public
onlyAgree(_agreementHash)
{
}
/**
* @dev release function
* @param _beneficiary the beneficiary for the release
* @param _lockingId the locking id to release
* @return bool
*/
function release(address _beneficiary, uint256 _lockingId) public returns(uint256 amount) {
}
/**
* @dev getRepRewardPerBatch function
* the calculation is done the following formula:
* RepReward = repRewardConstA * (repRewardConstB**_batchIndex)
* @param _batchIndex the index of the batch to calc rep reward of
* @return repReward
*/
function getRepRewardPerBatch(uint256 _batchIndex) public view returns(uint256 repReward) {
}
/**
* @dev getLockingIdScore function
* return score of lockingId at specific bach index
* @param _batchIndex batch index
* @param _lockingId lockingId
* @return score
*/
function getLockingIdScore(uint256 _batchIndex, uint256 _lockingId) public view returns(uint256) {
}
/**
* Multiply one real by another. Truncates overflows.
*/
function mul(uint256 realA, uint256 realB) private pure returns (uint256) {
}
/**
* Convert an integer to a real. Preserves sign.
*/
function toReal(uint216 ipart) private pure returns (uint256) {
}
/**
* Convert a real to an integer. Preserves sign.
*/
function fromReal(uint256 _realValue) private pure returns (uint216) {
}
/**
* Divide one real by another real. Truncates overflows.
*/
function div(uint256 realNumerator, uint256 realDenominator) private pure returns (uint256) {
}
}
| Controller(avatar.owner()).mintReputation(reputation,_beneficiary,address(avatar)),"mint reputation should succeed" | 28,355 | Controller(avatar.owner()).mintReputation(reputation,_beneficiary,address(avatar)) |
"_batchIndexToLockIn + _period exceed max allowed batches" | pragma solidity 0.5.13;
/**
* @title A scheme for continuous locking ERC20 Token for reputation
*/
contract ContinuousLocking4Reputation is Agreement {
using SafeMath for uint256;
using SafeERC20 for address;
using RealMath for uint216;
using RealMath for uint256;
using Math for uint256;
event Redeem(uint256 indexed _lockingId, address indexed _beneficiary, uint256 _amount, uint256 _batchIndex);
event Release(uint256 indexed _lockingId, address indexed _beneficiary, uint256 _amount);
event LockToken(address indexed _locker, uint256 indexed _lockingId, uint256 _amount, uint256 _period);
event ExtendLocking(address indexed _locker, uint256 indexed _lockingId, uint256 _extendPeriod);
struct Batch {
uint256 totalScore;
// A mapping from lockingId to its score
mapping(uint256=>uint) scores;
}
struct Lock {
uint256 amount;
uint256 lockingTime;
uint256 period;
}
// A mapping from lockers addresses to their locks
mapping(address => mapping(uint256=>Lock)) public lockers;
// A mapping from batch index to batch
mapping(uint256 => Batch) public batches;
Avatar public avatar;
uint256 public reputationRewardLeft; // the amount of reputation that is still left to distribute
uint256 public startTime; // the time (in secs since epoch) that locking can start (is enable)
uint256 public redeemEnableTime;
uint256 public maxLockingBatches;
uint256 public batchTime; // the length of a batch, in seconds
IERC20 public token; // the token to be locked
uint256 public lockCounter; // Total number of locks
uint256 public totalLockedLeft; // the amount of reputation that is still left to distribute
uint256 public repRewardConstA;
uint256 public repRewardConstB;
uint256 public batchesIndexCap;
uint256 constant private REAL_FBITS = 40;
/**
* What's the first non-fractional bit
*/
uint256 constant private REAL_ONE = uint256(1) << REAL_FBITS;
uint256 constant private BATCHES_INDEX_HARDCAP = 100;
uint256 constant public MAX_LOCKING_BATCHES_HARDCAP = 24;
/**
* @dev initialize
* @param _avatar the avatar to mint reputation from
* @param _reputationReward the total amount of reputation that can be minted by this contract
* @param _startTime locking period start time, in seconds since epoch
* @param _redeemEnableTime redeem enable time
* @param _batchTime batch time (in seconds)
* @param _redeemEnableTime redeem enable time, in seconds since epoch
* redeem reputation can be done after this time.
* @param _maxLockingBatches - maximum number of locking batches that a user can lock (or extend) her tokens for
* @param _repRewardConstA - the total amount of reputation allocation per batch is calculated by :
* _repRewardConstA * ((_repRewardConstB/1000) ** batchIndex)
* @param _repRewardConstB - the total amount of reputation allocation per batch is calculated by :
* _repRewardConstA * ((_repRewardConstB/1000) ** batchIndex). _repRewardConstB must be < 1000
* @param _batchesIndexCap the length of the locking period (in batches).
* This value capped by BATCHES_HARDCAP .
* @param _token the locking token
* @param _agreementHash is a hash of agreement required to be added to the TX by participants
*/
function initialize(
Avatar _avatar,
uint256 _reputationReward,
uint256 _startTime,
uint256 _batchTime,
uint256 _redeemEnableTime,
uint256 _maxLockingBatches,
uint256 _repRewardConstA,
uint256 _repRewardConstB,
uint256 _batchesIndexCap,
IERC20 _token,
bytes32 _agreementHash )
external
{
}
/**
* @dev redeem reputation function
* @param _beneficiary the beneficiary to redeem.
* @param _lockingId the lockingId to redeem from.
* @return uint256 reputation rewarded
*/
function redeem(address _beneficiary, uint256 _lockingId) public returns(uint256 reputation) {
}
/**
* @dev lock function
* @param _amount the amount of token to lock
* @param _period the number of batches that the tokens will be locked for
* @param _batchIndexToLockIn the batch index in which the locking period starts.
* Must be the currently active batch.
* @return lockingId
*/
function lock(uint256 _amount, uint256 _period, uint256 _batchIndexToLockIn, bytes32 _agreementHash)
public
onlyAgree(_agreementHash)
returns(uint256 lockingId)
{
require(_amount > 0, "_amount should be > 0");
// solhint-disable-next-line not-rely-on-time
require(now >= startTime, "locking is not enabled yet (it starts at startTime)");
require(_period <= maxLockingBatches, "_period exceed the maximum allowed");
require(_period > 0, "_period must be > 0");
require(<FILL_ME>)
lockCounter = lockCounter.add(1);
lockingId = lockCounter;
Lock storage locker = lockers[msg.sender][lockingId];
locker.amount = _amount;
locker.period = _period;
// solhint-disable-next-line not-rely-on-time
locker.lockingTime = now;
address(token).safeTransferFrom(msg.sender, address(this), _amount);
// solhint-disable-next-line not-rely-on-time
uint256 batchIndexToLockIn = (now - startTime) / batchTime;
require(batchIndexToLockIn == _batchIndexToLockIn,
"_batchIndexToLockIn must be the one corresponding to the current one");
//fill in the next batches scores.
for (uint256 p = 0; p < _period; p++) {
Batch storage batch = batches[batchIndexToLockIn + p];
uint256 score = (_period - p).mul(_amount);
batch.totalScore = batch.totalScore.add(score);
batch.scores[lockingId] = score;
}
totalLockedLeft = totalLockedLeft.add(_amount);
emit LockToken(msg.sender, lockingId, _amount, _period);
}
/**
* @dev extendLocking function
* @param _extendPeriod the period to extend the locking. in batchTime.
* @param _batchIndexToLockIn index of the batch in which to start locking.
* @param _lockingId the locking id to extend
*/
function extendLocking(
uint256 _extendPeriod,
uint256 _batchIndexToLockIn,
uint256 _lockingId,
bytes32 _agreementHash)
public
onlyAgree(_agreementHash)
{
}
/**
* @dev release function
* @param _beneficiary the beneficiary for the release
* @param _lockingId the locking id to release
* @return bool
*/
function release(address _beneficiary, uint256 _lockingId) public returns(uint256 amount) {
}
/**
* @dev getRepRewardPerBatch function
* the calculation is done the following formula:
* RepReward = repRewardConstA * (repRewardConstB**_batchIndex)
* @param _batchIndex the index of the batch to calc rep reward of
* @return repReward
*/
function getRepRewardPerBatch(uint256 _batchIndex) public view returns(uint256 repReward) {
}
/**
* @dev getLockingIdScore function
* return score of lockingId at specific bach index
* @param _batchIndex batch index
* @param _lockingId lockingId
* @return score
*/
function getLockingIdScore(uint256 _batchIndex, uint256 _lockingId) public view returns(uint256) {
}
/**
* Multiply one real by another. Truncates overflows.
*/
function mul(uint256 realA, uint256 realB) private pure returns (uint256) {
}
/**
* Convert an integer to a real. Preserves sign.
*/
function toReal(uint216 ipart) private pure returns (uint256) {
}
/**
* Convert a real to an integer. Preserves sign.
*/
function fromReal(uint256 _realValue) private pure returns (uint216) {
}
/**
* Divide one real by another real. Truncates overflows.
*/
function div(uint256 realNumerator, uint256 realDenominator) private pure returns (uint256) {
}
}
| (_batchIndexToLockIn.add(_period))<=batchesIndexCap,"_batchIndexToLockIn + _period exceed max allowed batches" | 28,355 | (_batchIndexToLockIn.add(_period))<=batchesIndexCap |
"_extendPeriod exceed max allowed batches" | pragma solidity 0.5.13;
/**
* @title A scheme for continuous locking ERC20 Token for reputation
*/
contract ContinuousLocking4Reputation is Agreement {
using SafeMath for uint256;
using SafeERC20 for address;
using RealMath for uint216;
using RealMath for uint256;
using Math for uint256;
event Redeem(uint256 indexed _lockingId, address indexed _beneficiary, uint256 _amount, uint256 _batchIndex);
event Release(uint256 indexed _lockingId, address indexed _beneficiary, uint256 _amount);
event LockToken(address indexed _locker, uint256 indexed _lockingId, uint256 _amount, uint256 _period);
event ExtendLocking(address indexed _locker, uint256 indexed _lockingId, uint256 _extendPeriod);
struct Batch {
uint256 totalScore;
// A mapping from lockingId to its score
mapping(uint256=>uint) scores;
}
struct Lock {
uint256 amount;
uint256 lockingTime;
uint256 period;
}
// A mapping from lockers addresses to their locks
mapping(address => mapping(uint256=>Lock)) public lockers;
// A mapping from batch index to batch
mapping(uint256 => Batch) public batches;
Avatar public avatar;
uint256 public reputationRewardLeft; // the amount of reputation that is still left to distribute
uint256 public startTime; // the time (in secs since epoch) that locking can start (is enable)
uint256 public redeemEnableTime;
uint256 public maxLockingBatches;
uint256 public batchTime; // the length of a batch, in seconds
IERC20 public token; // the token to be locked
uint256 public lockCounter; // Total number of locks
uint256 public totalLockedLeft; // the amount of reputation that is still left to distribute
uint256 public repRewardConstA;
uint256 public repRewardConstB;
uint256 public batchesIndexCap;
uint256 constant private REAL_FBITS = 40;
/**
* What's the first non-fractional bit
*/
uint256 constant private REAL_ONE = uint256(1) << REAL_FBITS;
uint256 constant private BATCHES_INDEX_HARDCAP = 100;
uint256 constant public MAX_LOCKING_BATCHES_HARDCAP = 24;
/**
* @dev initialize
* @param _avatar the avatar to mint reputation from
* @param _reputationReward the total amount of reputation that can be minted by this contract
* @param _startTime locking period start time, in seconds since epoch
* @param _redeemEnableTime redeem enable time
* @param _batchTime batch time (in seconds)
* @param _redeemEnableTime redeem enable time, in seconds since epoch
* redeem reputation can be done after this time.
* @param _maxLockingBatches - maximum number of locking batches that a user can lock (or extend) her tokens for
* @param _repRewardConstA - the total amount of reputation allocation per batch is calculated by :
* _repRewardConstA * ((_repRewardConstB/1000) ** batchIndex)
* @param _repRewardConstB - the total amount of reputation allocation per batch is calculated by :
* _repRewardConstA * ((_repRewardConstB/1000) ** batchIndex). _repRewardConstB must be < 1000
* @param _batchesIndexCap the length of the locking period (in batches).
* This value capped by BATCHES_HARDCAP .
* @param _token the locking token
* @param _agreementHash is a hash of agreement required to be added to the TX by participants
*/
function initialize(
Avatar _avatar,
uint256 _reputationReward,
uint256 _startTime,
uint256 _batchTime,
uint256 _redeemEnableTime,
uint256 _maxLockingBatches,
uint256 _repRewardConstA,
uint256 _repRewardConstB,
uint256 _batchesIndexCap,
IERC20 _token,
bytes32 _agreementHash )
external
{
}
/**
* @dev redeem reputation function
* @param _beneficiary the beneficiary to redeem.
* @param _lockingId the lockingId to redeem from.
* @return uint256 reputation rewarded
*/
function redeem(address _beneficiary, uint256 _lockingId) public returns(uint256 reputation) {
}
/**
* @dev lock function
* @param _amount the amount of token to lock
* @param _period the number of batches that the tokens will be locked for
* @param _batchIndexToLockIn the batch index in which the locking period starts.
* Must be the currently active batch.
* @return lockingId
*/
function lock(uint256 _amount, uint256 _period, uint256 _batchIndexToLockIn, bytes32 _agreementHash)
public
onlyAgree(_agreementHash)
returns(uint256 lockingId)
{
}
/**
* @dev extendLocking function
* @param _extendPeriod the period to extend the locking. in batchTime.
* @param _batchIndexToLockIn index of the batch in which to start locking.
* @param _lockingId the locking id to extend
*/
function extendLocking(
uint256 _extendPeriod,
uint256 _batchIndexToLockIn,
uint256 _lockingId,
bytes32 _agreementHash)
public
onlyAgree(_agreementHash)
{
Lock storage locker = lockers[msg.sender][_lockingId];
require(locker.lockingTime != 0, "_lockingId does not exist");
// remainBatchs is the number of future batches that are part of the currently active lock
uint256 remainBatches =
((locker.lockingTime.add(locker.period*batchTime).sub(startTime))/batchTime).sub(_batchIndexToLockIn);
uint256 batchesCountFromCurrent = remainBatches.add(_extendPeriod);
require(batchesCountFromCurrent <= maxLockingBatches, "locking period exceeds the maximum allowed");
require(_extendPeriod > 0, "_extendPeriod must be > 0");
require(<FILL_ME>)
// solhint-disable-next-line not-rely-on-time
uint256 batchIndexToLockIn = (now - startTime) / batchTime;
require(batchIndexToLockIn == _batchIndexToLockIn, "locking is not active");
//fill in the next batch scores.
for (uint256 p = 0; p < batchesCountFromCurrent; p++) {
Batch storage batch = batches[batchIndexToLockIn + p];
uint256 score = (batchesCountFromCurrent - p).mul(locker.amount);
batch.totalScore = batch.totalScore.add(score).sub(batch.scores[_lockingId]);
batch.scores[_lockingId] = score;
}
locker.period = locker.period.add(_extendPeriod);
emit ExtendLocking(msg.sender, _lockingId, _extendPeriod);
}
/**
* @dev release function
* @param _beneficiary the beneficiary for the release
* @param _lockingId the locking id to release
* @return bool
*/
function release(address _beneficiary, uint256 _lockingId) public returns(uint256 amount) {
}
/**
* @dev getRepRewardPerBatch function
* the calculation is done the following formula:
* RepReward = repRewardConstA * (repRewardConstB**_batchIndex)
* @param _batchIndex the index of the batch to calc rep reward of
* @return repReward
*/
function getRepRewardPerBatch(uint256 _batchIndex) public view returns(uint256 repReward) {
}
/**
* @dev getLockingIdScore function
* return score of lockingId at specific bach index
* @param _batchIndex batch index
* @param _lockingId lockingId
* @return score
*/
function getLockingIdScore(uint256 _batchIndex, uint256 _lockingId) public view returns(uint256) {
}
/**
* Multiply one real by another. Truncates overflows.
*/
function mul(uint256 realA, uint256 realB) private pure returns (uint256) {
}
/**
* Convert an integer to a real. Preserves sign.
*/
function toReal(uint216 ipart) private pure returns (uint256) {
}
/**
* Convert a real to an integer. Preserves sign.
*/
function fromReal(uint256 _realValue) private pure returns (uint216) {
}
/**
* Divide one real by another real. Truncates overflows.
*/
function div(uint256 realNumerator, uint256 realDenominator) private pure returns (uint256) {
}
}
| (_batchIndexToLockIn.add(batchesCountFromCurrent))<=batchesIndexCap,"_extendPeriod exceed max allowed batches" | 28,355 | (_batchIndexToLockIn.add(batchesCountFromCurrent))<=batchesIndexCap |
"RealMath mul overflow" | pragma solidity 0.5.13;
/**
* @title A scheme for continuous locking ERC20 Token for reputation
*/
contract ContinuousLocking4Reputation is Agreement {
using SafeMath for uint256;
using SafeERC20 for address;
using RealMath for uint216;
using RealMath for uint256;
using Math for uint256;
event Redeem(uint256 indexed _lockingId, address indexed _beneficiary, uint256 _amount, uint256 _batchIndex);
event Release(uint256 indexed _lockingId, address indexed _beneficiary, uint256 _amount);
event LockToken(address indexed _locker, uint256 indexed _lockingId, uint256 _amount, uint256 _period);
event ExtendLocking(address indexed _locker, uint256 indexed _lockingId, uint256 _extendPeriod);
struct Batch {
uint256 totalScore;
// A mapping from lockingId to its score
mapping(uint256=>uint) scores;
}
struct Lock {
uint256 amount;
uint256 lockingTime;
uint256 period;
}
// A mapping from lockers addresses to their locks
mapping(address => mapping(uint256=>Lock)) public lockers;
// A mapping from batch index to batch
mapping(uint256 => Batch) public batches;
Avatar public avatar;
uint256 public reputationRewardLeft; // the amount of reputation that is still left to distribute
uint256 public startTime; // the time (in secs since epoch) that locking can start (is enable)
uint256 public redeemEnableTime;
uint256 public maxLockingBatches;
uint256 public batchTime; // the length of a batch, in seconds
IERC20 public token; // the token to be locked
uint256 public lockCounter; // Total number of locks
uint256 public totalLockedLeft; // the amount of reputation that is still left to distribute
uint256 public repRewardConstA;
uint256 public repRewardConstB;
uint256 public batchesIndexCap;
uint256 constant private REAL_FBITS = 40;
/**
* What's the first non-fractional bit
*/
uint256 constant private REAL_ONE = uint256(1) << REAL_FBITS;
uint256 constant private BATCHES_INDEX_HARDCAP = 100;
uint256 constant public MAX_LOCKING_BATCHES_HARDCAP = 24;
/**
* @dev initialize
* @param _avatar the avatar to mint reputation from
* @param _reputationReward the total amount of reputation that can be minted by this contract
* @param _startTime locking period start time, in seconds since epoch
* @param _redeemEnableTime redeem enable time
* @param _batchTime batch time (in seconds)
* @param _redeemEnableTime redeem enable time, in seconds since epoch
* redeem reputation can be done after this time.
* @param _maxLockingBatches - maximum number of locking batches that a user can lock (or extend) her tokens for
* @param _repRewardConstA - the total amount of reputation allocation per batch is calculated by :
* _repRewardConstA * ((_repRewardConstB/1000) ** batchIndex)
* @param _repRewardConstB - the total amount of reputation allocation per batch is calculated by :
* _repRewardConstA * ((_repRewardConstB/1000) ** batchIndex). _repRewardConstB must be < 1000
* @param _batchesIndexCap the length of the locking period (in batches).
* This value capped by BATCHES_HARDCAP .
* @param _token the locking token
* @param _agreementHash is a hash of agreement required to be added to the TX by participants
*/
function initialize(
Avatar _avatar,
uint256 _reputationReward,
uint256 _startTime,
uint256 _batchTime,
uint256 _redeemEnableTime,
uint256 _maxLockingBatches,
uint256 _repRewardConstA,
uint256 _repRewardConstB,
uint256 _batchesIndexCap,
IERC20 _token,
bytes32 _agreementHash )
external
{
}
/**
* @dev redeem reputation function
* @param _beneficiary the beneficiary to redeem.
* @param _lockingId the lockingId to redeem from.
* @return uint256 reputation rewarded
*/
function redeem(address _beneficiary, uint256 _lockingId) public returns(uint256 reputation) {
}
/**
* @dev lock function
* @param _amount the amount of token to lock
* @param _period the number of batches that the tokens will be locked for
* @param _batchIndexToLockIn the batch index in which the locking period starts.
* Must be the currently active batch.
* @return lockingId
*/
function lock(uint256 _amount, uint256 _period, uint256 _batchIndexToLockIn, bytes32 _agreementHash)
public
onlyAgree(_agreementHash)
returns(uint256 lockingId)
{
}
/**
* @dev extendLocking function
* @param _extendPeriod the period to extend the locking. in batchTime.
* @param _batchIndexToLockIn index of the batch in which to start locking.
* @param _lockingId the locking id to extend
*/
function extendLocking(
uint256 _extendPeriod,
uint256 _batchIndexToLockIn,
uint256 _lockingId,
bytes32 _agreementHash)
public
onlyAgree(_agreementHash)
{
}
/**
* @dev release function
* @param _beneficiary the beneficiary for the release
* @param _lockingId the locking id to release
* @return bool
*/
function release(address _beneficiary, uint256 _lockingId) public returns(uint256 amount) {
}
/**
* @dev getRepRewardPerBatch function
* the calculation is done the following formula:
* RepReward = repRewardConstA * (repRewardConstB**_batchIndex)
* @param _batchIndex the index of the batch to calc rep reward of
* @return repReward
*/
function getRepRewardPerBatch(uint256 _batchIndex) public view returns(uint256 repReward) {
}
/**
* @dev getLockingIdScore function
* return score of lockingId at specific bach index
* @param _batchIndex batch index
* @param _lockingId lockingId
* @return score
*/
function getLockingIdScore(uint256 _batchIndex, uint256 _lockingId) public view returns(uint256) {
}
/**
* Multiply one real by another. Truncates overflows.
*/
function mul(uint256 realA, uint256 realB) private pure returns (uint256) {
// When multiplying fixed point in x.y and z.w formats we get (x+z).(y+w) format.
// So we just have to clip off the extra REAL_FBITS fractional bits.
uint256 res = realA * realB;
require(<FILL_ME>)
return (res >> REAL_FBITS);
}
/**
* Convert an integer to a real. Preserves sign.
*/
function toReal(uint216 ipart) private pure returns (uint256) {
}
/**
* Convert a real to an integer. Preserves sign.
*/
function fromReal(uint256 _realValue) private pure returns (uint216) {
}
/**
* Divide one real by another real. Truncates overflows.
*/
function div(uint256 realNumerator, uint256 realDenominator) private pure returns (uint256) {
}
}
| res/realA==realB,"RealMath mul overflow" | 28,355 | res/realA==realB |
null | pragma solidity ^0.4.15;
contract Addresses {
//2%
address public bounty;
//5%
address public successFee;
//93%
address public addr1;
//93%
address public addr2;
//93%
address public addr3;
//93%
address public addr4;
function Addresses() {
}
}
contract ERC20Basic {
uint256 public totalSupply;
function balanceOf(address who) constant returns (uint256);
function transfer(address to, uint256 value) returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
}
contract ERC20 is ERC20Basic {
function allowance(address owner, address spender) constant returns (uint256);
function transferFrom(address from, address to, uint256 value) returns (bool);
function approve(address spender, uint256 value) returns (bool);
function approve(address _owner, address _spender, uint256 _value) returns (bool);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
contract Ownable {
address public owner;
function Ownable() {
}
modifier onlyOwner() {
}
function transferOwnership(address newOwner) onlyOwner {
}
}
library SafeMath {
function mul(uint256 a, uint256 b) internal constant returns (uint256) {
}
function div(uint256 a, uint256 b) internal constant returns (uint256) {
}
function sub(uint256 a, uint256 b) internal constant returns (uint256) {
}
function add(uint256 a, uint256 b) internal constant returns (uint256) {
}
function mod(uint256 a, uint256 b) internal constant returns (uint256) {
}
}
contract BasicToken is ERC20Basic {
using SafeMath for uint256;
mapping(address => uint256) balances;
//18.10.2017 23:59 UTC
uint256 ico_finish = 1508284740;
modifier isFreeze() {
}
function transfer(address _to, uint256 _value) isFreeze returns (bool) {
}
function balanceOf(address _owner) constant returns (uint256 balance) {
}
}
contract Migrations {
address public owner;
uint public last_completed_migration;
modifier restricted() {
}
function Migrations() {
}
function setCompleted(uint completed) restricted {
}
function upgrade(address new_address) restricted {
}
}
contract StandardToken is ERC20, BasicToken {
mapping (address => mapping (address => uint256)) allowed;
//14.10.2017 23:59 UTC
uint256 ico_finish = 1508025540;
modifier isFreeze() {
}
function transferFrom(address _from, address _to, uint256 _value) isFreeze returns (bool) {
}
function approve(address _spender, uint256 _value) returns (bool) {
}
function approve(address _owner, address _spender, uint256 _value) returns (bool) {
}
function allowance(address _owner, address _spender) constant returns (uint256 remaining) {
}
}
contract MintableToken is StandardToken, Ownable {
using SafeMath for uint256;
event Mint(address indexed to, uint256 amount);
event MintFinished();
event ShowInfo(uint256 _info, string _message);
function setTotalSupply(uint256 _amount) public onlyOwner returns(uint256) {
}
function getTotalTokenCount() public constant returns(uint256) {
}
function mint(address _address, uint256 _tokens) public {
}
function burnTokens(address _address) public {
}
}
contract SingleTokenCoin is MintableToken {
string public constant name = "Start mining";
string public constant symbol = "STM";
uint32 public constant decimals = 2;
}
// ---------ALERT---------
// Before deploy to Main Net uncomment all *ADDRESSES FOR PRODUCTION* comment
// Before deploy to Main Net change rinkeby.etherscan.io to etherscan.io
// Before deploy to Main Net check all ICO dates in all .sol files
// Before deploy to Main Net check all Comment in .sol and .js files
// Before deploy to Main Net check all code area with '* 100' & '/ 100' for .js files
//----------CHECK----------
//Get back tokens
//Resetup condition with mincup
//Resetup withdrow
//Resetup send ETH to investors
//Recalculate rate with oraclize
contract WrapperOraclize {
function update(string datasource, string arg) payable;
function update(uint timestamp, string datasource, string arg) payable;
function getWrapperBalance() constant returns(uint256);
function getWrapperData() constant returns(bytes32);
function getPrice(string datasource) constant returns(uint256);
function() external payable;
}
contract Crowdsale is Ownable {
string public ETHUSD;
event ShowPrice(string price);
using SafeMath for uint256;
SingleTokenCoin public token = new SingleTokenCoin();
Addresses private addresses = new Addresses();
WrapperOraclize private wrapper = WrapperOraclize(0xfC484c66daE464CC6055d7a4782Ec8761dc9842F);
uint256 private ico_start;
uint256 private ico_finish;
uint256 private rate;
uint256 private decimals;
uint256 private tax;
//Time-based Bonus Program
uint256 private firstBonusPhase;
uint256 private firstExtraBonus;
uint256 private secondBonusPhase;
uint256 private secondExtraBonus;
uint256 private thirdBonusPhase;
uint256 private thirdExtraBonus;
uint256 private fourBonusPhase;
uint256 private fourExtraBonus;
//Withdrow Phases
bool private firstWithdrowPhase;
bool private secondWithdrowPhase;
bool private thirdWithdrowPhase;
bool private fourWithdrowPhase;
uint256 private firstWithdrowAmount;
uint256 private secondWithdrowAmount;
uint256 private thirdWithdrowAmount;
uint256 private fourWithdrowAmount;
uint256 private totalETH;
uint256 private totalAmount;
bool private initialize = false;
bool public mintingFinished = false;
//Storage for ICO Buyers ETH
mapping(address => uint256) private ico_buyers_eth;
//Storage for ICO Buyers Token
mapping(address => uint256) private ico_buyers_token;
address[] private investors;
mapping(address => bytes32) private privilegedWallets;
mapping(address => uint256) private manualAddresses;
address[] private manualAddressesCount;
address[] private privilegedWalletsCount;
bytes32 private g = "granted";
bytes32 private r = "revorked";
uint256 private soldTokens;
uint256 private mincup;
uint256 private minPrice;
event ShowInfo(uint256 _info);
event ShowInfoStr(string _info);
event ShowInfoBool(bool _info);
function Crowdsale() {
}
modifier canMint() {
}
function() external payable {
}
function bytesToUInt(bytes32 v) constant returns (uint ret) {
}
function calculateRate() public payable returns(uint256) {
}
function calculateWithdrow() private {
}
modifier isInitialize() {
require(<FILL_ME>)
_;
}
function setTotalSupply() private isInitialize onlyOwner returns(uint256) {
}
function sendToAddress(address _address, uint256 _tokens) canMint public {
}
modifier isRefund() {
}
function grantedWallets(address _address) private returns(bool) {
}
modifier isICOFinished() {
}
function getTokens() public constant returns(uint256) {
}
function setPrivelegedWallet(address _address) public onlyOwner returns(bool) {
}
function setTransferOwnership(address _address) public onlyOwner {
}
function removePrivelegedWallet(address _address) public onlyOwner {
}
//only for demonstrate Test Version
function setICODate(uint256 _time) public onlyOwner {
}
function getICODate() public constant returns(uint256) {
}
function mint() public isRefund canMint isICOFinished payable {
}
function saveInfoAboutInvestors(address _address, uint256 _amount, uint256 _tokens, bool _isManual) private {
}
function getManualByAddress(address _address) public constant returns(uint256) {
}
function getManualInvestorsCount() public constant returns(uint256) {
}
function getManualAddress(uint _index) public constant returns(address) {
}
function finishMinting() public onlyOwner {
}
function getFinishStatus() public constant returns(bool) {
}
function manualRefund() public {
}
function refund(uint256 _amount) private {
}
function refund(address _address, uint256 _amount) private {
}
function getTokensManual(address _address) public constant returns(uint256) {
}
function calculateBonusForHours(uint256 _tokens) private returns(uint256) {
}
function sendToOwners(uint256 _amount) private {
}
function getBalanceContract() public constant returns(uint256) {
}
function getSoldToken() public constant returns(uint256) {
}
function getInvestorsTokens(address _address) public constant returns(uint256) {
}
function getInvestorsETH(address _address) public constant returns(uint256) {
}
function getInvestors() public constant returns(uint256) {
}
function getInvestorByValue(address _address) public constant returns(uint256) {
}
//only for test version
function transfer(address _from, address _to, uint256 _amount) public returns(bool) {
}
function getInvestorByIndex(uint256 _index) public constant returns(address) {
}
function getLeftToken() public constant returns(uint256) {
}
function getTotalToken() public constant returns(uint256) {
}
function getTotalETH() public constant returns(uint256) {
}
function getCurrentPrice() public constant returns(uint256) {
}
function getContractAddress() public constant returns(address) {
}
function getOwner() public constant returns(address) {
}
function sendOracleData() public payable {
}
function getQueryPrice(string datasource) constant returns(uint256) {
}
function checkWrapperBalance() public constant returns(uint256) {
}
function getWrapperData() constant returns(bytes32) {
}
}
| !initialize | 28,443 | !initialize |
null | pragma solidity ^0.4.24;
/*
* LukiuToken is a standard ERC20 token with some additional functionalities:
* - Transfers are only enabled after contract owner enables it (after the ICO)
* - Contract sets 40% of the total supply as allowance for ICO contract
*
* Note: Token Offering == Initial Coin Offering(ICO)
*/
contract LukiuToken is StandardToken, BurnableToken, Ownable {
string public constant symbol = "LKU";
string public constant name = "Lukiu Media-2";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 10000000000 * (10 ** uint256(decimals));
uint256 public constant TOKEN_OFFERING_ALLOWANCE = 4000000000 * (10 ** uint256(decimals));
uint256 public constant ADMIN_ALLOWANCE = INITIAL_SUPPLY - TOKEN_OFFERING_ALLOWANCE;
// Address of token admin
address public adminAddr;
// Address of token offering
address public tokenOfferingAddr;
// Enable transfers after conclusion of token offering
bool public transferEnabled = true;
/**
* Check if transfer is allowed
*
* Permissions:
* Owner Admin OfferingContract Others
* transfer (before transferEnabled is true) x x x x
* transferFrom (before transferEnabled is true) x o o x
* transfer/transferFrom(after transferEnabled is true) o x x o
*/
modifier onlyWhenTransferAllowed() {
require(<FILL_ME>)
_;
}
/**
* Check if token offering address is set or not
*/
modifier onlyTokenOfferingAddrNotSet() {
}
/**
* Check if address is a valid destination to transfer tokens to
* - must not be zero address
* - must not be the token address
* - must not be the owner's address
* - must not be the admin's address
* - must not be the token offering contract address
*/
modifier validDestination(address to) {
}
/**
* Token contract constructor
*
* @param admin Address of admin account
*/
constructor(address admin) public {
}
/**
* Set token offering to approve allowance for offering contract to distribute tokens
*
* @param offeringAddr Address of token offering contract
* @param amountForSale Amount of tokens for sale, set 0 to max out
*/
function setTokenOffering(address offeringAddr, uint256 amountForSale) external onlyOwner onlyTokenOfferingAddrNotSet {
}
/**
* Enable transfers
*/
function enableTransfer() external onlyOwner {
}
/**
* Transfer from sender to another account
*
* @param to Destination address
* @param value Amount of lukiutokens to send
*/
function transfer(address to, uint256 value) public onlyWhenTransferAllowed validDestination(to) returns (bool) {
}
/**
* Transfer from `from` account to `to` account using allowance in `from` account to the sender
*
* @param from Origin address
* @param to Destination address
* @param value Amount of lukiutokens to send
*/
function transferFrom(address from, address to, uint256 value) public onlyWhenTransferAllowed validDestination(to) returns (bool) {
}
/**
* Burn token, only owner is allowed to do this
*
* @param value Amount of tokens to burn
*/
function burn(uint256 value) public {
}
}
| transferEnabled||msg.sender==adminAddr||msg.sender==tokenOfferingAddr | 28,511 | transferEnabled||msg.sender==adminAddr||msg.sender==tokenOfferingAddr |
null | pragma solidity ^0.4.24;
/*
* LukiuToken is a standard ERC20 token with some additional functionalities:
* - Transfers are only enabled after contract owner enables it (after the ICO)
* - Contract sets 40% of the total supply as allowance for ICO contract
*
* Note: Token Offering == Initial Coin Offering(ICO)
*/
contract LukiuToken is StandardToken, BurnableToken, Ownable {
string public constant symbol = "LKU";
string public constant name = "Lukiu Media-2";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 10000000000 * (10 ** uint256(decimals));
uint256 public constant TOKEN_OFFERING_ALLOWANCE = 4000000000 * (10 ** uint256(decimals));
uint256 public constant ADMIN_ALLOWANCE = INITIAL_SUPPLY - TOKEN_OFFERING_ALLOWANCE;
// Address of token admin
address public adminAddr;
// Address of token offering
address public tokenOfferingAddr;
// Enable transfers after conclusion of token offering
bool public transferEnabled = true;
/**
* Check if transfer is allowed
*
* Permissions:
* Owner Admin OfferingContract Others
* transfer (before transferEnabled is true) x x x x
* transferFrom (before transferEnabled is true) x o o x
* transfer/transferFrom(after transferEnabled is true) o x x o
*/
modifier onlyWhenTransferAllowed() {
}
/**
* Check if token offering address is set or not
*/
modifier onlyTokenOfferingAddrNotSet() {
}
/**
* Check if address is a valid destination to transfer tokens to
* - must not be zero address
* - must not be the token address
* - must not be the owner's address
* - must not be the admin's address
* - must not be the token offering contract address
*/
modifier validDestination(address to) {
}
/**
* Token contract constructor
*
* @param admin Address of admin account
*/
constructor(address admin) public {
}
/**
* Set token offering to approve allowance for offering contract to distribute tokens
*
* @param offeringAddr Address of token offering contract
* @param amountForSale Amount of tokens for sale, set 0 to max out
*/
function setTokenOffering(address offeringAddr, uint256 amountForSale) external onlyOwner onlyTokenOfferingAddrNotSet {
require(<FILL_ME>)
uint256 amount = (amountForSale == 0) ? TOKEN_OFFERING_ALLOWANCE : amountForSale;
require(amount <= TOKEN_OFFERING_ALLOWANCE);
approve(offeringAddr, amount);
tokenOfferingAddr = offeringAddr;
}
/**
* Enable transfers
*/
function enableTransfer() external onlyOwner {
}
/**
* Transfer from sender to another account
*
* @param to Destination address
* @param value Amount of lukiutokens to send
*/
function transfer(address to, uint256 value) public onlyWhenTransferAllowed validDestination(to) returns (bool) {
}
/**
* Transfer from `from` account to `to` account using allowance in `from` account to the sender
*
* @param from Origin address
* @param to Destination address
* @param value Amount of lukiutokens to send
*/
function transferFrom(address from, address to, uint256 value) public onlyWhenTransferAllowed validDestination(to) returns (bool) {
}
/**
* Burn token, only owner is allowed to do this
*
* @param value Amount of tokens to burn
*/
function burn(uint256 value) public {
}
}
| !transferEnabled | 28,511 | !transferEnabled |
null | pragma solidity ^0.4.24;
/*
* LukiuToken is a standard ERC20 token with some additional functionalities:
* - Transfers are only enabled after contract owner enables it (after the ICO)
* - Contract sets 40% of the total supply as allowance for ICO contract
*
* Note: Token Offering == Initial Coin Offering(ICO)
*/
contract LukiuToken is StandardToken, BurnableToken, Ownable {
string public constant symbol = "LKU";
string public constant name = "Lukiu Media-2";
uint8 public constant decimals = 18;
uint256 public constant INITIAL_SUPPLY = 10000000000 * (10 ** uint256(decimals));
uint256 public constant TOKEN_OFFERING_ALLOWANCE = 4000000000 * (10 ** uint256(decimals));
uint256 public constant ADMIN_ALLOWANCE = INITIAL_SUPPLY - TOKEN_OFFERING_ALLOWANCE;
// Address of token admin
address public adminAddr;
// Address of token offering
address public tokenOfferingAddr;
// Enable transfers after conclusion of token offering
bool public transferEnabled = true;
/**
* Check if transfer is allowed
*
* Permissions:
* Owner Admin OfferingContract Others
* transfer (before transferEnabled is true) x x x x
* transferFrom (before transferEnabled is true) x o o x
* transfer/transferFrom(after transferEnabled is true) o x x o
*/
modifier onlyWhenTransferAllowed() {
}
/**
* Check if token offering address is set or not
*/
modifier onlyTokenOfferingAddrNotSet() {
}
/**
* Check if address is a valid destination to transfer tokens to
* - must not be zero address
* - must not be the token address
* - must not be the owner's address
* - must not be the admin's address
* - must not be the token offering contract address
*/
modifier validDestination(address to) {
}
/**
* Token contract constructor
*
* @param admin Address of admin account
*/
constructor(address admin) public {
}
/**
* Set token offering to approve allowance for offering contract to distribute tokens
*
* @param offeringAddr Address of token offering contract
* @param amountForSale Amount of tokens for sale, set 0 to max out
*/
function setTokenOffering(address offeringAddr, uint256 amountForSale) external onlyOwner onlyTokenOfferingAddrNotSet {
}
/**
* Enable transfers
*/
function enableTransfer() external onlyOwner {
}
/**
* Transfer from sender to another account
*
* @param to Destination address
* @param value Amount of lukiutokens to send
*/
function transfer(address to, uint256 value) public onlyWhenTransferAllowed validDestination(to) returns (bool) {
}
/**
* Transfer from `from` account to `to` account using allowance in `from` account to the sender
*
* @param from Origin address
* @param to Destination address
* @param value Amount of lukiutokens to send
*/
function transferFrom(address from, address to, uint256 value) public onlyWhenTransferAllowed validDestination(to) returns (bool) {
}
/**
* Burn token, only owner is allowed to do this
*
* @param value Amount of tokens to burn
*/
function burn(uint256 value) public {
require(<FILL_ME>)
super.burn(value);
}
}
| transferEnabled||msg.sender==owner | 28,511 | transferEnabled||msg.sender==owner |
"BDPDistributor: Already claimed" | pragma solidity ^0.6.12;
contract BDPDistributor is Ownable {
using SafeERC20 for IERC20;
using SafeMath for uint256;
address public token;
address public signer;
uint256 public totalClaimed;
mapping(address => bool) public isClaimed;
event Claimed(address account, uint256 amount);
constructor(address _token, address _signer) public {
}
function setSigner(address _signer) public onlyOwner {
}
function claim(
address account,
uint256 amount,
uint8 v,
bytes32 r,
bytes32 s
) external {
require(msg.sender == account, "BDPDistributor: wrong sender");
require(<FILL_ME>)
require(verifyProof(account, amount, v, r, s), "BDPDistributor: Invalid signer");
totalClaimed = totalClaimed + amount;
isClaimed[account] = true;
IERC20(token).safeTransfer(account, amount);
emit Claimed(account, amount);
}
function verifyProof(
address account,
uint256 amount,
uint8 v,
bytes32 r,
bytes32 s
) public view returns (bool) {
}
function withdraw(address _token) external onlyOwner {
}
}
| !isClaimed[account],"BDPDistributor: Already claimed" | 28,537 | !isClaimed[account] |
"BDPDistributor: Invalid signer" | pragma solidity ^0.6.12;
contract BDPDistributor is Ownable {
using SafeERC20 for IERC20;
using SafeMath for uint256;
address public token;
address public signer;
uint256 public totalClaimed;
mapping(address => bool) public isClaimed;
event Claimed(address account, uint256 amount);
constructor(address _token, address _signer) public {
}
function setSigner(address _signer) public onlyOwner {
}
function claim(
address account,
uint256 amount,
uint8 v,
bytes32 r,
bytes32 s
) external {
require(msg.sender == account, "BDPDistributor: wrong sender");
require(!isClaimed[account], "BDPDistributor: Already claimed");
require(<FILL_ME>)
totalClaimed = totalClaimed + amount;
isClaimed[account] = true;
IERC20(token).safeTransfer(account, amount);
emit Claimed(account, amount);
}
function verifyProof(
address account,
uint256 amount,
uint8 v,
bytes32 r,
bytes32 s
) public view returns (bool) {
}
function withdraw(address _token) external onlyOwner {
}
}
| verifyProof(account,amount,v,r,s),"BDPDistributor: Invalid signer" | 28,537 | verifyProof(account,amount,v,r,s) |
"ERC20:ONLY_MINTERS_OR_OPERATOR" | pragma solidity ^0.5.16;
import "./SafeMath.sol";
contract ERC20 {
using SafeMath for uint;
string public name;
string public symbol;
uint8 public decimals;
uint public totalSupply;
address public operator;
address public pendingOperator;
mapping(address => uint) public balanceOf;
mapping(address => mapping(address => uint)) public allowance;
mapping (address => bool) public minters;
bytes32 public DOMAIN_SEPARATOR;
// keccak256("Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)");
bytes32 public constant PERMIT_TYPEHASH = 0x6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9;
mapping(address => uint) public nonces;
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
event AddMinter(address indexed minter);
event RemoveMinter(address indexed minter);
event ChangeOperator(address indexed newOperator);
modifier onlyOperator {
}
constructor(string memory name_, string memory symbol_, uint8 decimals_) public {
}
function setPendingOperator(address newOperator_) public onlyOperator {
}
function claimOperator() public {
}
function addMinter(address minter_) public onlyOperator {
}
function removeMinter(address minter_) public onlyOperator {
}
function mint(address to, uint amount) public {
require(<FILL_ME>)
_mint(to, amount);
}
function burn(uint amount) public {
}
function _mint(address to, uint value) internal {
}
function _burn(address from, uint value) internal {
}
function _approve(address owner, address spender, uint value) private {
}
function _transfer(address from, address to, uint value) private {
}
function approve(address spender, uint value) external returns (bool) {
}
function transfer(address to, uint value) external returns (bool) {
}
function transferFrom(address from, address to, uint value) external returns (bool) {
}
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external {
}
}
| minters[msg.sender]==true||msg.sender==operator,"ERC20:ONLY_MINTERS_OR_OPERATOR" | 28,541 | minters[msg.sender]==true||msg.sender==operator |
null | pragma solidity ^0.4.21;
/**
* Math operations with safety checks
*/
contract SafeMath {
function safeMul(uint256 a, uint256 b) internal pure returns (uint256) {
}
function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) {
}
function safeSub(uint256 a, uint256 b) internal pure returns (uint256) {
}
function safeAdd(uint256 a, uint256 b) internal pure returns (uint256) {
}
}
contract Owned {
address public owner;
address public newOwner = address(0x0);
event OwnershipTransferred(address indexed _from, address indexed _to);
function Owned() public {
}
modifier onlyOwner {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function acceptOwnership() public {
}
}
contract Pausable is Owned {
event Pause();
event Unpause();
bool public paused = false;
modifier whenNotPaused() {
}
modifier whenPaused() {
}
function pause() onlyOwner whenNotPaused public {
}
function unpause() onlyOwner whenPaused public {
}
}
interface tokenRecipient {
function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external;
}
contract ERC20Interface {
function totalSupply() public constant returns (uint256);
function balanceOf(address tokenOwner) public constant returns (uint256 balance);
function allowance(address tokenOwner, address spender) public constant returns (uint256 remaining);
function transfer(address to, uint256 tokens) public returns (bool success);
function approve(address spender, uint256 tokens) public returns (bool success);
function transferFrom(address from, address to, uint256 tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
contract TokenBase is ERC20Interface, Pausable, SafeMath {
string public name;
string public symbol;
uint256 public decimals;
uint256 internal _totalSupply;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
mapping (address => bool) public frozenAccount;
event FrozenFunds(address target, bool frozen);
event Burn(address indexed from, uint256 value);
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public constant returns (uint256) {
}
// ------------------------------------------------------------------------
// Get the token balance for account `tokenOwner`
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public constant returns (uint256 balance) {
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public constant returns (uint256 remaining) {
}
/**
* Internal transfer, only can be called by this contract
*/
function _transfer(address _from, address _to, uint256 _value) internal whenNotPaused returns (bool success) {
require(_to != 0x0); // Prevent transfer to 0x0 address. Use burn() instead
require(balances[_from] >= _value); // Check if the sender has enough
require(!frozenAccount[_from]); // Check if sender is frozen
require(!frozenAccount[_to]); // Check if recipient is frozen
require(<FILL_ME>) // Check for overflows
uint256 previousBalances = SafeMath.safeAdd(balances[_from], balances[_to]);
balances[_from] = SafeMath.safeSub(balances[_from], _value); // Subtract from the sender
balances[_to] = SafeMath.safeAdd(balances[_to], _value); // Add the same to the recipient
assert(balances[_from] + balances[_to] == previousBalances);
emit Transfer(_from, _to, _value);
return true;
}
/**
* Transfer tokens
*/
function transfer(address _to, uint256 _value) public returns (bool success){
}
/**
* Transfer tokens from other address
*/
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
}
function approve(address spender, uint256 tokens) public whenNotPaused returns (bool success) {
}
function approveAndCall(address _spender, uint256 _value, bytes _extraData)
public whenNotPaused returns (bool success) {
}
/**
* Destroy tokens
*/
function burn(uint256 _value) public onlyOwner whenNotPaused returns (bool success) {
}
/**
* Destroy tokens from another account
*/
function burnFrom(address _from, uint256 _value) public onlyOwner whenNotPaused returns (bool success) {
}
}
contract FDataToken is TokenBase{
string internal _tokenName = 'FData';
string internal _tokenSymbol = 'FDT';
uint256 internal _tokenDecimals = 18;
uint256 internal _initialSupply = 10000000000;
/* Initializes contract with initial supply tokens to the creator of the contract */
function FDataToken() public {
}
// can accept ether
function() payable public {
}
function freezeAccount(address target, bool value) onlyOwner public {
}
// transfer contract balance to owner
function retrieveEther(uint256 amount) onlyOwner public {
}
// transfer contract token balance to owner
function retrieveToken(uint256 amount) onlyOwner public {
}
// transfer contract token balance to owner
function retrieveTokenByContract(address token, uint256 amount) onlyOwner public {
}
}
| SafeMath.safeAdd(balances[_to],_value)>balances[_to] | 28,603 | SafeMath.safeAdd(balances[_to],_value)>balances[_to] |
null | // Copyright (C) 2020 Centrifuge
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
pragma solidity >=0.5.15 <0.6.0;
// Copyright (C) Centrifuge 2020, based on MakerDAO dss https://github.com/makerdao/dss
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
pragma solidity >=0.5.15 <0.6.0;
/// note.sol -- the `note' modifier, for logging calls as events
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
pragma solidity >=0.4.23;
contract DSNote {
event LogNote(
bytes4 indexed sig,
address indexed guy,
bytes32 indexed foo,
bytes32 indexed bar,
uint256 wad,
bytes fax
) anonymous;
modifier note {
}
}
contract Auth is DSNote {
mapping (address => uint) public wards;
function rely(address usr) public auth note { }
function deny(address usr) public auth note { }
modifier auth { }
}
interface AuthLike {
function rely(address) external;
function deny(address) external;
}
interface DependLike {
function depend(bytes32, address) external;
}
interface BorrowerDeployerLike {
function collector() external returns (address);
function feed() external returns (address);
function shelf() external returns (address);
function title() external returns (address);
function pile() external returns (address);
}
interface LenderDeployerLike {
function assessor() external returns (address);
function reserve() external returns (address);
function assessorAdmin() external returns (address);
function juniorMemberlist() external returns (address);
function seniorMemberlist() external returns (address);
function juniorOperator() external returns (address);
function seniorOperator() external returns (address);
function coordinator() external returns (address);
}
contract TinlakeRoot is Auth {
BorrowerDeployerLike public borrowerDeployer;
LenderDeployerLike public lenderDeployer;
bool public deployed;
address public deployUsr;
constructor (address deployUsr_) public {
}
// --- Prepare ---
// Sets the two deployer dependencies. This needs to be called by the deployUsr
function prepare(address lender_, address borrower_, address ward_) public {
}
// --- Deploy ---
// After going through the deploy process on the lender and borrower method, this method is called to connect
// lender and borrower contracts.
function deploy() public {
require(<FILL_ME>)
deployed = true;
address reserve_ = lenderDeployer.reserve();
address shelf_ = borrowerDeployer.shelf();
// Borrower depends
DependLike(borrowerDeployer.collector()).depend("distributor", reserve_);
DependLike(borrowerDeployer.shelf()).depend("lender", reserve_);
DependLike(borrowerDeployer.shelf()).depend("distributor", reserve_);
//AuthLike(reserve).rely(shelf_);
// Lender depends
address navFeed = borrowerDeployer.feed();
DependLike(reserve_).depend("shelf", shelf_);
DependLike(lenderDeployer.assessor()).depend("navFeed", navFeed);
// Permissions
address poolAdmin1 = 0x24730a9D68008c6Bd8F43e60Ed2C00cbe57Ac829;
address poolAdmin2 = 0x71d9f8CFdcCEF71B59DD81AB387e523E2834F2b8;
address poolAdmin3 = 0xa7Aa917b502d86CD5A23FFbD9Ee32E013015e069;
address poolAdmin4 = 0xfEADaD6b75e6C899132587b7Cb3FEd60c8554821;
address poolAdmin5 = 0xC3997Ef807A24af6Ca5Cb1d22c2fD87C6c3b79E8;
address poolAdmin6 = 0xd60f7CFC1E051d77031aC21D9DB2F66fE54AE312;
address poolAdmin7 = 0x46a71eEf8DbcFcbAC7A0e8D5d6B634A649e61fb8;
address oracle = 0x8F1afCFDB6B4264B8fbFfBB9ca900e66187543cf;
AuthLike(lenderDeployer.assessorAdmin()).rely(poolAdmin1);
AuthLike(lenderDeployer.assessorAdmin()).rely(poolAdmin2);
AuthLike(lenderDeployer.assessorAdmin()).rely(poolAdmin3);
AuthLike(lenderDeployer.assessorAdmin()).rely(poolAdmin4);
AuthLike(lenderDeployer.assessorAdmin()).rely(poolAdmin5);
AuthLike(lenderDeployer.assessorAdmin()).rely(poolAdmin6);
AuthLike(lenderDeployer.assessorAdmin()).rely(poolAdmin7);
AuthLike(lenderDeployer.juniorMemberlist()).rely(poolAdmin1);
AuthLike(lenderDeployer.juniorMemberlist()).rely(poolAdmin2);
AuthLike(lenderDeployer.juniorMemberlist()).rely(poolAdmin3);
AuthLike(lenderDeployer.juniorMemberlist()).rely(poolAdmin4);
AuthLike(lenderDeployer.juniorMemberlist()).rely(poolAdmin5);
AuthLike(lenderDeployer.juniorMemberlist()).rely(poolAdmin6);
AuthLike(lenderDeployer.juniorMemberlist()).rely(poolAdmin7);
AuthLike(lenderDeployer.seniorMemberlist()).rely(poolAdmin1);
AuthLike(lenderDeployer.seniorMemberlist()).rely(poolAdmin2);
AuthLike(lenderDeployer.seniorMemberlist()).rely(poolAdmin3);
AuthLike(lenderDeployer.seniorMemberlist()).rely(poolAdmin4);
AuthLike(lenderDeployer.seniorMemberlist()).rely(poolAdmin5);
AuthLike(lenderDeployer.seniorMemberlist()).rely(poolAdmin6);
AuthLike(lenderDeployer.seniorMemberlist()).rely(poolAdmin7);
AuthLike(navFeed).rely(oracle);
}
// --- Governance Functions ---
// `relyContract` & `denyContract` can be called by any ward on the TinlakeRoot
// contract to make an arbitrary address a ward on any contract the TinlakeRoot
// is a ward on.
function relyContract(address target, address usr) public auth {
}
function denyContract(address target, address usr) public auth {
}
}
| address(borrowerDeployer)!=address(0)&&address(lenderDeployer)!=address(0)&&deployed==false | 28,763 | address(borrowerDeployer)!=address(0)&&address(lenderDeployer)!=address(0)&&deployed==false |
"AdminControl: Must be owner or admin" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.3;
/// @author: manifold.xyz
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/utils/structs/EnumerableSet.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "./IAdminControl.sol";
abstract contract AdminControl is Ownable, IAdminControl, ERC165 {
using EnumerableSet for EnumerableSet.AddressSet;
// Track registered admins
EnumerableSet.AddressSet private _admins;
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {
}
/**
* @dev Only allows approved admins to call the specified function
*/
modifier adminRequired() {
require(<FILL_ME>)
_;
}
/**
* @dev See {IAdminControl-getAdmins}.
*/
function getAdmins() external view override returns (address[] memory admins) {
}
/**
* @dev See {IAdminControl-approveAdmin}.
*/
function approveAdmin(address admin) external override onlyOwner {
}
/**
* @dev See {IAdminControl-revokeAdmin}.
*/
function revokeAdmin(address admin) external override onlyOwner {
}
/**
* @dev See {IAdminControl-isAdmin}.
*/
function isAdmin(address admin) public override view returns (bool) {
}
}
| owner()==msg.sender||_admins.contains(msg.sender),"AdminControl: Must be owner or admin" | 28,804 | owner()==msg.sender||_admins.contains(msg.sender) |
null | pragma solidity ^0.4.18;
// ----------------------------------------------------------------------------
// Safe maths
// ----------------------------------------------------------------------------
contract SafeMath {
function safeAdd(uint256 a, uint256 b) public pure returns (uint256 c) {
}
function safeSub(uint256 a, uint256 b) public pure returns (uint256 c) {
}
function safeMul(uint256 a, uint256 b) public pure returns (uint256 c) {
}
function safeDiv(uint256 a, uint256 b) public pure returns (uint256 c) {
}
}
// ----------------------------------------------------------------------------
// ERC Token Standard #20 Interface
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// ----------------------------------------------------------------------------
contract ERC20Interface {
function totalSupply() public constant returns (uint256);
function balanceOf(address tokenOwner) public constant returns (uint256 balance);
function allowance(address tokenOwner, address spender) public constant returns (uint256 remaining);
function transfer(address to, uint256 tokens) public returns (bool success);
function approve(address spender, uint256 tokens) public returns (bool success);
function transferFrom(address from, address to, uint256 tokens) public returns (bool success);
event Transfer(address indexed from, address indexed to, uint256 tokens);
event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens);
}
// ----------------------------------------------------------------------------
// Contract function to receive approval and execute function in one call
//
// Borrowed from MiniMeToken
// ----------------------------------------------------------------------------
contract ApproveAndCallFallBack {
function receiveApproval(address from, uint256 tokens, address token, bytes data) public;
}
// ----------------------------------------------------------------------------
// Owned contract
// ----------------------------------------------------------------------------
contract Owned {
address public owner;
address public newOwner;
event OwnershipTransferred(address indexed _from, address indexed _to);
constructor() public {
}
modifier onlyOwner {
}
function transferOwnership(address _newOwner) public onlyOwner {
}
function acceptOwnership() public {
}
}
// ----------------------------------------------------------------------------
// ERC20 Token, with the addition of symbol, name and decimals and assisted
// token transfers
// ----------------------------------------------------------------------------
contract UECToken is ERC20Interface, Owned, SafeMath {
bytes32 public symbol;
bytes32 public name;
uint8 public decimals;
uint256 public _totalSupply;
mapping(address => uint256) balances;
mapping(address => mapping(address => uint256)) allowed;
// ------------------------------------------------------------------------
// Constructor
// ------------------------------------------------------------------------
constructor() public {
}
// ------------------------------------------------------------------------
// Total supply
// ------------------------------------------------------------------------
function totalSupply() public constant returns (uint256) {
}
// ------------------------------------------------------------------------
// Get the token balance for account tokenOwner
// ------------------------------------------------------------------------
function balanceOf(address tokenOwner) public constant returns (uint256 balance) {
}
// ------------------------------------------------------------------------
// Transfer the balance from token owner's account to to account
// - Owner's account must have sufficient balance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transfer(address to, uint256 tokens) public returns (bool success) {
}
// ------------------------------------------------------------------------
// Token owner can approve for spender to transferFrom(...) tokens
// from the token owner's account
//
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
// recommends that there are no checks for the approval double-spend attack
// as this should be implemented in user interfaces
// ------------------------------------------------------------------------
function approve(address spender, uint256 tokens) public returns (bool success) {
require(<FILL_ME>)
allowed[msg.sender][spender] = tokens;
emit Approval(msg.sender, spender, tokens);
return true;
}
// ------------------------------------------------------------------------
// Transfer tokens from the from account to the to account
//
// The calling account must already have sufficient tokens approve(...)-d
// for spending from the from account and
// - From account must have sufficient balance to transfer
// - Spender must have sufficient allowance to transfer
// - 0 value transfers are allowed
// ------------------------------------------------------------------------
function transferFrom(address from, address to, uint256 tokens) public returns (bool success) {
}
// ------------------------------------------------------------------------
// Returns the amount of tokens approved by the owner that can be
// transferred to the spender's account
// ------------------------------------------------------------------------
function allowance(address tokenOwner, address spender) public constant returns (uint256 remaining) {
}
// ------------------------------------------------------------------------
// Token owner can approve for spender to transferFrom(...) tokens
// from the token owner's account. The spender contract function
// receiveApproval(...) is then executed
// ------------------------------------------------------------------------
function approveAndCall(address spender, uint256 tokens, bytes data) public returns (bool success) {
}
// ------------------------------------------------------------------------
// Don't accept ETH
// ------------------------------------------------------------------------
function () public payable {
}
// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint256 tokens) public onlyOwner returns (bool success) {
}
}
| balances[msg.sender]>tokens&&tokens>0 | 28,821 | balances[msg.sender]>tokens&&tokens>0 |
"Retrieve failed" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "./ERC20Permit.sol";
/**
* @title PolkaRare Token
* @dev PolkaRare ERC20 Token
*/
contract PolkaRareToken is ERC20Permit, Ownable {
uint256 public constant MAX_CAP = 100 * (10**6) * (10**18); // 100 million
address public governance;
event RecoverToken(address indexed token, address indexed destination, uint256 indexed amount);
modifier onlyGovernance() {
}
constructor() ERC20("PolkaRareToken", "PRARE") {
}
/**
* @notice Function to set governance contract
* Owner is assumed to be governance
* @param _governance Address of governance contract
*/
function setGovernance(address _governance) public onlyGovernance {
}
/**
* @notice Function to recover funds
* Owner is assumed to be governance or PolkaRare trusted party for helping users
* @param token Address of token to be rescued
* @param destination User address
* @param amount Amount of tokens
*/
function recoverToken(
address token,
address destination,
uint256 amount
) external onlyGovernance {
require(token != destination, "Invalid address");
require(<FILL_ME>)
emit RecoverToken(token, destination, amount);
}
}
| IERC20(token).transfer(destination,amount),"Retrieve failed" | 28,912 | IERC20(token).transfer(destination,amount) |
"Owned: Only owner can operate" | // SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Context.sol";
contract Owned is Context {
address private _contractOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view virtual returns(address) {
}
function _transferOwnership(address newOwner) external virtual onlyOwner {
}
function _renounceOwnership() external virtual onlyOwner {
}
function __transferOwnership(address _to) internal {
}
modifier onlyOwner() {
require(<FILL_ME>)
_;
}
}
contract Accessable is Owned {
mapping(address => bool) private _admins;
mapping(address => bool) private _tokenClaimers;
constructor() {
}
function isAdmin(address user) public view returns(bool) {
}
function isTokenClaimer(address user) public view returns(bool) {
}
function _setAdmin(address _user, bool _isAdmin) external onlyOwner {
}
function _setTokenClaimer(address _user, bool _isTokenCalimer) external onlyOwner {
}
modifier onlyAdmin() {
}
modifier onlyTokenClaimer() {
}
}
| _msgSender()==_contractOwner,"Owned: Only owner can operate" | 28,919 | _msgSender()==_contractOwner |
"Accessable: Contract owner must be an admin" | // SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Context.sol";
contract Owned is Context {
address private _contractOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view virtual returns(address) {
}
function _transferOwnership(address newOwner) external virtual onlyOwner {
}
function _renounceOwnership() external virtual onlyOwner {
}
function __transferOwnership(address _to) internal {
}
modifier onlyOwner() {
}
}
contract Accessable is Owned {
mapping(address => bool) private _admins;
mapping(address => bool) private _tokenClaimers;
constructor() {
}
function isAdmin(address user) public view returns(bool) {
}
function isTokenClaimer(address user) public view returns(bool) {
}
function _setAdmin(address _user, bool _isAdmin) external onlyOwner {
_admins[_user] = _isAdmin;
require(<FILL_ME>)
}
function _setTokenClaimer(address _user, bool _isTokenCalimer) external onlyOwner {
}
modifier onlyAdmin() {
}
modifier onlyTokenClaimer() {
}
}
| _admins[owner()],"Accessable: Contract owner must be an admin" | 28,919 | _admins[owner()] |
"Accessable: Contract owner must be an token claimer" | // SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Context.sol";
contract Owned is Context {
address private _contractOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view virtual returns(address) {
}
function _transferOwnership(address newOwner) external virtual onlyOwner {
}
function _renounceOwnership() external virtual onlyOwner {
}
function __transferOwnership(address _to) internal {
}
modifier onlyOwner() {
}
}
contract Accessable is Owned {
mapping(address => bool) private _admins;
mapping(address => bool) private _tokenClaimers;
constructor() {
}
function isAdmin(address user) public view returns(bool) {
}
function isTokenClaimer(address user) public view returns(bool) {
}
function _setAdmin(address _user, bool _isAdmin) external onlyOwner {
}
function _setTokenClaimer(address _user, bool _isTokenCalimer) external onlyOwner {
_tokenClaimers[_user] = _isTokenCalimer;
require(<FILL_ME>)
}
modifier onlyAdmin() {
}
modifier onlyTokenClaimer() {
}
}
| _tokenClaimers[owner()],"Accessable: Contract owner must be an token claimer" | 28,919 | _tokenClaimers[owner()] |
"Accessable: Only admin can operate" | // SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Context.sol";
contract Owned is Context {
address private _contractOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view virtual returns(address) {
}
function _transferOwnership(address newOwner) external virtual onlyOwner {
}
function _renounceOwnership() external virtual onlyOwner {
}
function __transferOwnership(address _to) internal {
}
modifier onlyOwner() {
}
}
contract Accessable is Owned {
mapping(address => bool) private _admins;
mapping(address => bool) private _tokenClaimers;
constructor() {
}
function isAdmin(address user) public view returns(bool) {
}
function isTokenClaimer(address user) public view returns(bool) {
}
function _setAdmin(address _user, bool _isAdmin) external onlyOwner {
}
function _setTokenClaimer(address _user, bool _isTokenCalimer) external onlyOwner {
}
modifier onlyAdmin() {
require(<FILL_ME>)
_;
}
modifier onlyTokenClaimer() {
}
}
| _admins[_msgSender()],"Accessable: Only admin can operate" | 28,919 | _admins[_msgSender()] |
"Accessable: Only Token Claimer can operate" | // SPDX-License-Identifier: MIT LICENSE
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/utils/Context.sol";
contract Owned is Context {
address private _contractOwner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
}
function owner() public view virtual returns(address) {
}
function _transferOwnership(address newOwner) external virtual onlyOwner {
}
function _renounceOwnership() external virtual onlyOwner {
}
function __transferOwnership(address _to) internal {
}
modifier onlyOwner() {
}
}
contract Accessable is Owned {
mapping(address => bool) private _admins;
mapping(address => bool) private _tokenClaimers;
constructor() {
}
function isAdmin(address user) public view returns(bool) {
}
function isTokenClaimer(address user) public view returns(bool) {
}
function _setAdmin(address _user, bool _isAdmin) external onlyOwner {
}
function _setTokenClaimer(address _user, bool _isTokenCalimer) external onlyOwner {
}
modifier onlyAdmin() {
}
modifier onlyTokenClaimer() {
require(<FILL_ME>)
_;
}
}
| _tokenClaimers[_msgSender()],"Accessable: Only Token Claimer can operate" | 28,919 | _tokenClaimers[_msgSender()] |
"You have already set BPC address, can't do it again" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "ERC721Enumerable.sol";
import "SafeMath.sol";
import "Counters.sol";
import "Ownable.sol";
import "Pausable.sol";
import "BPC.sol";
import "BPCSenderRecipient.sol";
import "ExternalFuncs.sol";
contract BPCLottery is ERC721, ERC777SenderRecipientMock, Ownable, Pausable {
//using ExternalFuncs for *;
using Counters for Counters.Counter;
using SafeMath for uint256;
IERC777 private m_bpc;
bool private m_bpc_is_set;
modifier isTokenSet() {
}
address private m_company_account;
Counters.Counter private m_ticket_id;
Counters.Counter private m_lottery_id;
uint256 private m_ticket_price;
bool private is_lottery_open;
uint256 private constant m_duration = 7 days;
struct Winner {
uint256 ticket_id;
address addr;
bool isSet;
}
mapping(uint256 => uint256) private m_lottery_id_pot;
mapping(uint256 => uint256) private m_lottery_id_expires_at;
mapping(uint256 => bool) private m_lottery_id_paid;
mapping(uint256 => Winner) private m_lottery_id_winner;
event WinnerAnnounced(
address winner,
uint256 winner_id,
uint256 lottery_id,
uint256 prize_size
);
event WinnerPaid(address winner, uint256 lottery_id, uint256 prize_size);
constructor(
string memory _name,
string memory _symbol,
uint256 _ticket_price,
address _company_account
) ERC721(_name, _symbol) {
}
function setERC777(address _bpc) public onlyOwner {
require(_bpc != address(0), "BPC address cannot be 0");
require(<FILL_ME>)
m_bpc = IERC777(_bpc);
m_bpc_is_set = true;
}
function pause() public onlyOwner whenNotPaused {
}
function unPause() public onlyOwner whenPaused {
}
//function paused() public view comes as a base class method of Pausable
function setTicketPrice(uint256 new_ticket_price)
public
onlyOwner
isTokenSet
{
}
//when not paused
function getTicketPrice() public view returns (uint256) {
}
//when not paused
function buyTicket(uint256 bpc_tokens_amount, address participant)
public
isTokenSet
{
}
//when not paused
function getCurrentLotteryTicketsCount(address participant)
public
view
returns (uint256)
{
}
function getCurrentLotteryId() public view returns (uint256) {
}
function getCurrentLotteryPot() public view returns (uint256) {
}
function announceWinnerAndRevolve() public onlyOwner isTokenSet {
}
function forceAnnounceWinnerAndRevolve() public onlyOwner isTokenSet {
}
function isLotteryPeriodOver() private view returns (bool) {
}
function getWinner(uint256 id) public view returns (address) {
}
function setWinner(uint256 prize_size) private returns (Winner memory) {
}
function isEmptyWinner(Winner memory winner) private pure returns (bool) {
}
function splitPotWith(address winner_address, uint256 prize_size) private {
}
function revolveLottery() private {
}
function prng() private view returns (uint256) {
}
}
| !m_bpc_is_set,"You have already set BPC address, can't do it again" | 28,931 | !m_bpc_is_set |
"You MUST be an operator for participant" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "ERC721Enumerable.sol";
import "SafeMath.sol";
import "Counters.sol";
import "Ownable.sol";
import "Pausable.sol";
import "BPC.sol";
import "BPCSenderRecipient.sol";
import "ExternalFuncs.sol";
contract BPCLottery is ERC721, ERC777SenderRecipientMock, Ownable, Pausable {
//using ExternalFuncs for *;
using Counters for Counters.Counter;
using SafeMath for uint256;
IERC777 private m_bpc;
bool private m_bpc_is_set;
modifier isTokenSet() {
}
address private m_company_account;
Counters.Counter private m_ticket_id;
Counters.Counter private m_lottery_id;
uint256 private m_ticket_price;
bool private is_lottery_open;
uint256 private constant m_duration = 7 days;
struct Winner {
uint256 ticket_id;
address addr;
bool isSet;
}
mapping(uint256 => uint256) private m_lottery_id_pot;
mapping(uint256 => uint256) private m_lottery_id_expires_at;
mapping(uint256 => bool) private m_lottery_id_paid;
mapping(uint256 => Winner) private m_lottery_id_winner;
event WinnerAnnounced(
address winner,
uint256 winner_id,
uint256 lottery_id,
uint256 prize_size
);
event WinnerPaid(address winner, uint256 lottery_id, uint256 prize_size);
constructor(
string memory _name,
string memory _symbol,
uint256 _ticket_price,
address _company_account
) ERC721(_name, _symbol) {
}
function setERC777(address _bpc) public onlyOwner {
}
function pause() public onlyOwner whenNotPaused {
}
function unPause() public onlyOwner whenPaused {
}
//function paused() public view comes as a base class method of Pausable
function setTicketPrice(uint256 new_ticket_price)
public
onlyOwner
isTokenSet
{
}
//when not paused
function getTicketPrice() public view returns (uint256) {
}
//when not paused
function buyTicket(uint256 bpc_tokens_amount, address participant)
public
isTokenSet
{
require(!paused(), "Lottery is paused, please come back later");
require(<FILL_ME>)
require(
bpc_tokens_amount.mod(m_ticket_price) == 0,
"Tokens amount should be a multiple of a Ticket Price"
);
require(
m_bpc.balanceOf(participant) >= bpc_tokens_amount,
"You should have enough of Tokens in your Wallet"
);
m_bpc.operatorSend(
participant,
address(this),
bpc_tokens_amount,
bytes(""),
bytes("")
);
m_lottery_id_pot[m_lottery_id.current()] = m_lottery_id_pot[
m_lottery_id.current()
].add(bpc_tokens_amount);
uint256 tickets_count = bpc_tokens_amount.div(m_ticket_price);
for (uint256 i = 0; i != tickets_count; ++i) {
m_ticket_id.increment();
_mint(participant, m_ticket_id.current());
}
}
//when not paused
function getCurrentLotteryTicketsCount(address participant)
public
view
returns (uint256)
{
}
function getCurrentLotteryId() public view returns (uint256) {
}
function getCurrentLotteryPot() public view returns (uint256) {
}
function announceWinnerAndRevolve() public onlyOwner isTokenSet {
}
function forceAnnounceWinnerAndRevolve() public onlyOwner isTokenSet {
}
function isLotteryPeriodOver() private view returns (bool) {
}
function getWinner(uint256 id) public view returns (address) {
}
function setWinner(uint256 prize_size) private returns (Winner memory) {
}
function isEmptyWinner(Winner memory winner) private pure returns (bool) {
}
function splitPotWith(address winner_address, uint256 prize_size) private {
}
function revolveLottery() private {
}
function prng() private view returns (uint256) {
}
}
| m_bpc.isOperatorFor(msg.sender,participant),"You MUST be an operator for participant" | 28,931 | m_bpc.isOperatorFor(msg.sender,participant) |
"Tokens amount should be a multiple of a Ticket Price" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "ERC721Enumerable.sol";
import "SafeMath.sol";
import "Counters.sol";
import "Ownable.sol";
import "Pausable.sol";
import "BPC.sol";
import "BPCSenderRecipient.sol";
import "ExternalFuncs.sol";
contract BPCLottery is ERC721, ERC777SenderRecipientMock, Ownable, Pausable {
//using ExternalFuncs for *;
using Counters for Counters.Counter;
using SafeMath for uint256;
IERC777 private m_bpc;
bool private m_bpc_is_set;
modifier isTokenSet() {
}
address private m_company_account;
Counters.Counter private m_ticket_id;
Counters.Counter private m_lottery_id;
uint256 private m_ticket_price;
bool private is_lottery_open;
uint256 private constant m_duration = 7 days;
struct Winner {
uint256 ticket_id;
address addr;
bool isSet;
}
mapping(uint256 => uint256) private m_lottery_id_pot;
mapping(uint256 => uint256) private m_lottery_id_expires_at;
mapping(uint256 => bool) private m_lottery_id_paid;
mapping(uint256 => Winner) private m_lottery_id_winner;
event WinnerAnnounced(
address winner,
uint256 winner_id,
uint256 lottery_id,
uint256 prize_size
);
event WinnerPaid(address winner, uint256 lottery_id, uint256 prize_size);
constructor(
string memory _name,
string memory _symbol,
uint256 _ticket_price,
address _company_account
) ERC721(_name, _symbol) {
}
function setERC777(address _bpc) public onlyOwner {
}
function pause() public onlyOwner whenNotPaused {
}
function unPause() public onlyOwner whenPaused {
}
//function paused() public view comes as a base class method of Pausable
function setTicketPrice(uint256 new_ticket_price)
public
onlyOwner
isTokenSet
{
}
//when not paused
function getTicketPrice() public view returns (uint256) {
}
//when not paused
function buyTicket(uint256 bpc_tokens_amount, address participant)
public
isTokenSet
{
require(!paused(), "Lottery is paused, please come back later");
require(
m_bpc.isOperatorFor(msg.sender, participant),
"You MUST be an operator for participant"
);
require(<FILL_ME>)
require(
m_bpc.balanceOf(participant) >= bpc_tokens_amount,
"You should have enough of Tokens in your Wallet"
);
m_bpc.operatorSend(
participant,
address(this),
bpc_tokens_amount,
bytes(""),
bytes("")
);
m_lottery_id_pot[m_lottery_id.current()] = m_lottery_id_pot[
m_lottery_id.current()
].add(bpc_tokens_amount);
uint256 tickets_count = bpc_tokens_amount.div(m_ticket_price);
for (uint256 i = 0; i != tickets_count; ++i) {
m_ticket_id.increment();
_mint(participant, m_ticket_id.current());
}
}
//when not paused
function getCurrentLotteryTicketsCount(address participant)
public
view
returns (uint256)
{
}
function getCurrentLotteryId() public view returns (uint256) {
}
function getCurrentLotteryPot() public view returns (uint256) {
}
function announceWinnerAndRevolve() public onlyOwner isTokenSet {
}
function forceAnnounceWinnerAndRevolve() public onlyOwner isTokenSet {
}
function isLotteryPeriodOver() private view returns (bool) {
}
function getWinner(uint256 id) public view returns (address) {
}
function setWinner(uint256 prize_size) private returns (Winner memory) {
}
function isEmptyWinner(Winner memory winner) private pure returns (bool) {
}
function splitPotWith(address winner_address, uint256 prize_size) private {
}
function revolveLottery() private {
}
function prng() private view returns (uint256) {
}
}
| bpc_tokens_amount.mod(m_ticket_price)==0,"Tokens amount should be a multiple of a Ticket Price" | 28,931 | bpc_tokens_amount.mod(m_ticket_price)==0 |
"You should have enough of Tokens in your Wallet" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "ERC721Enumerable.sol";
import "SafeMath.sol";
import "Counters.sol";
import "Ownable.sol";
import "Pausable.sol";
import "BPC.sol";
import "BPCSenderRecipient.sol";
import "ExternalFuncs.sol";
contract BPCLottery is ERC721, ERC777SenderRecipientMock, Ownable, Pausable {
//using ExternalFuncs for *;
using Counters for Counters.Counter;
using SafeMath for uint256;
IERC777 private m_bpc;
bool private m_bpc_is_set;
modifier isTokenSet() {
}
address private m_company_account;
Counters.Counter private m_ticket_id;
Counters.Counter private m_lottery_id;
uint256 private m_ticket_price;
bool private is_lottery_open;
uint256 private constant m_duration = 7 days;
struct Winner {
uint256 ticket_id;
address addr;
bool isSet;
}
mapping(uint256 => uint256) private m_lottery_id_pot;
mapping(uint256 => uint256) private m_lottery_id_expires_at;
mapping(uint256 => bool) private m_lottery_id_paid;
mapping(uint256 => Winner) private m_lottery_id_winner;
event WinnerAnnounced(
address winner,
uint256 winner_id,
uint256 lottery_id,
uint256 prize_size
);
event WinnerPaid(address winner, uint256 lottery_id, uint256 prize_size);
constructor(
string memory _name,
string memory _symbol,
uint256 _ticket_price,
address _company_account
) ERC721(_name, _symbol) {
}
function setERC777(address _bpc) public onlyOwner {
}
function pause() public onlyOwner whenNotPaused {
}
function unPause() public onlyOwner whenPaused {
}
//function paused() public view comes as a base class method of Pausable
function setTicketPrice(uint256 new_ticket_price)
public
onlyOwner
isTokenSet
{
}
//when not paused
function getTicketPrice() public view returns (uint256) {
}
//when not paused
function buyTicket(uint256 bpc_tokens_amount, address participant)
public
isTokenSet
{
require(!paused(), "Lottery is paused, please come back later");
require(
m_bpc.isOperatorFor(msg.sender, participant),
"You MUST be an operator for participant"
);
require(
bpc_tokens_amount.mod(m_ticket_price) == 0,
"Tokens amount should be a multiple of a Ticket Price"
);
require(<FILL_ME>)
m_bpc.operatorSend(
participant,
address(this),
bpc_tokens_amount,
bytes(""),
bytes("")
);
m_lottery_id_pot[m_lottery_id.current()] = m_lottery_id_pot[
m_lottery_id.current()
].add(bpc_tokens_amount);
uint256 tickets_count = bpc_tokens_amount.div(m_ticket_price);
for (uint256 i = 0; i != tickets_count; ++i) {
m_ticket_id.increment();
_mint(participant, m_ticket_id.current());
}
}
//when not paused
function getCurrentLotteryTicketsCount(address participant)
public
view
returns (uint256)
{
}
function getCurrentLotteryId() public view returns (uint256) {
}
function getCurrentLotteryPot() public view returns (uint256) {
}
function announceWinnerAndRevolve() public onlyOwner isTokenSet {
}
function forceAnnounceWinnerAndRevolve() public onlyOwner isTokenSet {
}
function isLotteryPeriodOver() private view returns (bool) {
}
function getWinner(uint256 id) public view returns (address) {
}
function setWinner(uint256 prize_size) private returns (Winner memory) {
}
function isEmptyWinner(Winner memory winner) private pure returns (bool) {
}
function splitPotWith(address winner_address, uint256 prize_size) private {
}
function revolveLottery() private {
}
function prng() private view returns (uint256) {
}
}
| m_bpc.balanceOf(participant)>=bpc_tokens_amount,"You should have enough of Tokens in your Wallet" | 28,931 | m_bpc.balanceOf(participant)>=bpc_tokens_amount |
"The current lottery is still running" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "ERC721Enumerable.sol";
import "SafeMath.sol";
import "Counters.sol";
import "Ownable.sol";
import "Pausable.sol";
import "BPC.sol";
import "BPCSenderRecipient.sol";
import "ExternalFuncs.sol";
contract BPCLottery is ERC721, ERC777SenderRecipientMock, Ownable, Pausable {
//using ExternalFuncs for *;
using Counters for Counters.Counter;
using SafeMath for uint256;
IERC777 private m_bpc;
bool private m_bpc_is_set;
modifier isTokenSet() {
}
address private m_company_account;
Counters.Counter private m_ticket_id;
Counters.Counter private m_lottery_id;
uint256 private m_ticket_price;
bool private is_lottery_open;
uint256 private constant m_duration = 7 days;
struct Winner {
uint256 ticket_id;
address addr;
bool isSet;
}
mapping(uint256 => uint256) private m_lottery_id_pot;
mapping(uint256 => uint256) private m_lottery_id_expires_at;
mapping(uint256 => bool) private m_lottery_id_paid;
mapping(uint256 => Winner) private m_lottery_id_winner;
event WinnerAnnounced(
address winner,
uint256 winner_id,
uint256 lottery_id,
uint256 prize_size
);
event WinnerPaid(address winner, uint256 lottery_id, uint256 prize_size);
constructor(
string memory _name,
string memory _symbol,
uint256 _ticket_price,
address _company_account
) ERC721(_name, _symbol) {
}
function setERC777(address _bpc) public onlyOwner {
}
function pause() public onlyOwner whenNotPaused {
}
function unPause() public onlyOwner whenPaused {
}
//function paused() public view comes as a base class method of Pausable
function setTicketPrice(uint256 new_ticket_price)
public
onlyOwner
isTokenSet
{
}
//when not paused
function getTicketPrice() public view returns (uint256) {
}
//when not paused
function buyTicket(uint256 bpc_tokens_amount, address participant)
public
isTokenSet
{
}
//when not paused
function getCurrentLotteryTicketsCount(address participant)
public
view
returns (uint256)
{
}
function getCurrentLotteryId() public view returns (uint256) {
}
function getCurrentLotteryPot() public view returns (uint256) {
}
function announceWinnerAndRevolve() public onlyOwner isTokenSet {
require(<FILL_ME>)
forceAnnounceWinnerAndRevolve();
}
function forceAnnounceWinnerAndRevolve() public onlyOwner isTokenSet {
}
function isLotteryPeriodOver() private view returns (bool) {
}
function getWinner(uint256 id) public view returns (address) {
}
function setWinner(uint256 prize_size) private returns (Winner memory) {
}
function isEmptyWinner(Winner memory winner) private pure returns (bool) {
}
function splitPotWith(address winner_address, uint256 prize_size) private {
}
function revolveLottery() private {
}
function prng() private view returns (uint256) {
}
}
| isLotteryPeriodOver(),"The current lottery is still running" | 28,931 | isLotteryPeriodOver() |
"Lottery Id Winner or Lottery Id not found" | // SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "ERC721Enumerable.sol";
import "SafeMath.sol";
import "Counters.sol";
import "Ownable.sol";
import "Pausable.sol";
import "BPC.sol";
import "BPCSenderRecipient.sol";
import "ExternalFuncs.sol";
contract BPCLottery is ERC721, ERC777SenderRecipientMock, Ownable, Pausable {
//using ExternalFuncs for *;
using Counters for Counters.Counter;
using SafeMath for uint256;
IERC777 private m_bpc;
bool private m_bpc_is_set;
modifier isTokenSet() {
}
address private m_company_account;
Counters.Counter private m_ticket_id;
Counters.Counter private m_lottery_id;
uint256 private m_ticket_price;
bool private is_lottery_open;
uint256 private constant m_duration = 7 days;
struct Winner {
uint256 ticket_id;
address addr;
bool isSet;
}
mapping(uint256 => uint256) private m_lottery_id_pot;
mapping(uint256 => uint256) private m_lottery_id_expires_at;
mapping(uint256 => bool) private m_lottery_id_paid;
mapping(uint256 => Winner) private m_lottery_id_winner;
event WinnerAnnounced(
address winner,
uint256 winner_id,
uint256 lottery_id,
uint256 prize_size
);
event WinnerPaid(address winner, uint256 lottery_id, uint256 prize_size);
constructor(
string memory _name,
string memory _symbol,
uint256 _ticket_price,
address _company_account
) ERC721(_name, _symbol) {
}
function setERC777(address _bpc) public onlyOwner {
}
function pause() public onlyOwner whenNotPaused {
}
function unPause() public onlyOwner whenPaused {
}
//function paused() public view comes as a base class method of Pausable
function setTicketPrice(uint256 new_ticket_price)
public
onlyOwner
isTokenSet
{
}
//when not paused
function getTicketPrice() public view returns (uint256) {
}
//when not paused
function buyTicket(uint256 bpc_tokens_amount, address participant)
public
isTokenSet
{
}
//when not paused
function getCurrentLotteryTicketsCount(address participant)
public
view
returns (uint256)
{
}
function getCurrentLotteryId() public view returns (uint256) {
}
function getCurrentLotteryPot() public view returns (uint256) {
}
function announceWinnerAndRevolve() public onlyOwner isTokenSet {
}
function forceAnnounceWinnerAndRevolve() public onlyOwner isTokenSet {
}
function isLotteryPeriodOver() private view returns (bool) {
}
function getWinner(uint256 id) public view returns (address) {
require(<FILL_ME>)
return m_lottery_id_winner[id].addr;
}
function setWinner(uint256 prize_size) private returns (Winner memory) {
}
function isEmptyWinner(Winner memory winner) private pure returns (bool) {
}
function splitPotWith(address winner_address, uint256 prize_size) private {
}
function revolveLottery() private {
}
function prng() private view returns (uint256) {
}
}
| m_lottery_id_winner[id].isSet,"Lottery Id Winner or Lottery Id not found" | 28,931 | m_lottery_id_winner[id].isSet |
"ERC777: Caller is not an Admin" | pragma solidity ^0.6.2;
contract NotarisedToken is
Context,
ERC777,
AccessControl,
Pausable,
GSNRecipientSignature
{
bytes32 public constant ADMIN_ROLE = keccak256("ADMIN_ROLE");
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
constructor(address gsnTrustedSigner)
public
ERC777("Notarised", "NTS", new address[](0))
GSNRecipientSignature(gsnTrustedSigner)
{
}
function mint(
address to,
uint256 amount,
bytes memory userData,
bytes memory operatorData
) public returns (bool) {
}
function _msgSender()
internal
virtual
override(Context, GSNRecipient)
view
returns (address payable)
{
}
function _msgData()
internal
virtual
override(Context, GSNRecipient)
view
returns (bytes memory)
{
}
function pause() public {
require(<FILL_ME>)
super._pause();
}
function unpause() public {
}
function setTrustedSigner(address gsnTrustedSigner) public {
}
}
| hasRole(ADMIN_ROLE,msg.sender),"ERC777: Caller is not an Admin" | 28,947 | hasRole(ADMIN_ROLE,msg.sender) |
"Public sale not open" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./OnChainSweatersTypes.sol";
import "./IOnChainSweatersRenderer.sol";
contract OnChainSweaters is ERC721, Ownable, ReentrancyGuard, Pausable {
mapping(uint256 => OnChainSweatersTypes.OnChainSweater) sweaters;
event GenerateSweater(uint256 indexed tokenId, uint256 dna);
event ClaimedSweater(address claimer, uint256 indexed tokenId, address tx);
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
Counters.Counter private _reservedTokenIds;
Counters.Counter private _hdTokens; // after burn tokens
uint256 public constant MAX_FREE_MINT_SUPPLY = 333;
uint256 public constant MAX_SUPPLY = 3333;
uint256 public constant FOUNDERS_RESERVE_AMOUNT = 0;
uint256 public constant MAX_PUBLIC_SUPPLY = MAX_SUPPLY - MAX_FREE_MINT_SUPPLY - FOUNDERS_RESERVE_AMOUNT;
uint256 public constant MINT_PRICE = 0.02 ether;
uint256 private constant MAX_PER_ADDRESS = 10;
uint256 private constant FIRST_HD_TOKEN_ID = MAX_SUPPLY + 1; // minted by burning
uint256 public publicSaleStartTimestamp;
address public renderingContractAddress;
bool public claimActive = false;
bool public mintActive = true;
bool public burningActive = false;
mapping(uint256 => address) public claimedTokenTransactions;
mapping(address => uint256) public mintedCounts;
mapping(address => uint256) private founderMintCountsRemaining;
constructor() ERC721("Xmas Sweaters OnChain", "SWEAT") {}
modifier whenPublicSaleActive() {
require(<FILL_ME>)
_;
}
modifier whenClaimActive() {
}
modifier whenBurningActive() {
}
function getTotalMinted() external view returns (uint256) {
}
function getRemainingFounderMints(address _addr) public view returns (uint256) {
}
function isPublicSaleOpen() public view returns (bool) {
}
function isClaimOpen() public view returns (bool) {
}
function isBurningOpen() public view returns (bool) {
}
function setRenderingContractAddress(address _renderingContractAddress) public onlyOwner {
}
function setPublicSaleTimestamp(uint256 timestamp) external onlyOwner {
}
function setMintStatus(bool value) external onlyOwner {
}
function closeMintsOpenBurning() external onlyOwner {
}
function setClaimStatus(bool value) external onlyOwner {
}
function mintPublicSale(uint256 _count) external payable nonReentrant whenPublicSaleActive returns (uint256, uint256) {
}
function allocateFounderMint(address _addr, uint256 _count) public onlyOwner nonReentrant {
}
function founderMint(uint256 _count) public nonReentrant returns (uint256, uint256) {
}
function burnAndMint(uint256[] calldata tokenIds) external nonReentrant whenBurningActive returns(uint256, uint256) {
}
function burn(uint256 tokenId1, uint256 tokenId2) internal {
}
function mint(uint256 tokenId, uint256 resolution) internal {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
}
function claimSweater(uint256 _tokenId) external nonReentrant whenClaimActive returns(address) {
}
function getHighQualityClaimedSweater(uint256 _tokenId) external view returns(string memory) {
}
function getDna(uint256 _tokenId) public view returns (uint256) {
}
receive() external payable {}
function withdraw() public onlyOwner {
}
}
| isPublicSaleOpen()&&mintActive,"Public sale not open" | 29,128 | isPublicSaleOpen()&&mintActive |
"Claiming not open" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./OnChainSweatersTypes.sol";
import "./IOnChainSweatersRenderer.sol";
contract OnChainSweaters is ERC721, Ownable, ReentrancyGuard, Pausable {
mapping(uint256 => OnChainSweatersTypes.OnChainSweater) sweaters;
event GenerateSweater(uint256 indexed tokenId, uint256 dna);
event ClaimedSweater(address claimer, uint256 indexed tokenId, address tx);
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
Counters.Counter private _reservedTokenIds;
Counters.Counter private _hdTokens; // after burn tokens
uint256 public constant MAX_FREE_MINT_SUPPLY = 333;
uint256 public constant MAX_SUPPLY = 3333;
uint256 public constant FOUNDERS_RESERVE_AMOUNT = 0;
uint256 public constant MAX_PUBLIC_SUPPLY = MAX_SUPPLY - MAX_FREE_MINT_SUPPLY - FOUNDERS_RESERVE_AMOUNT;
uint256 public constant MINT_PRICE = 0.02 ether;
uint256 private constant MAX_PER_ADDRESS = 10;
uint256 private constant FIRST_HD_TOKEN_ID = MAX_SUPPLY + 1; // minted by burning
uint256 public publicSaleStartTimestamp;
address public renderingContractAddress;
bool public claimActive = false;
bool public mintActive = true;
bool public burningActive = false;
mapping(uint256 => address) public claimedTokenTransactions;
mapping(address => uint256) public mintedCounts;
mapping(address => uint256) private founderMintCountsRemaining;
constructor() ERC721("Xmas Sweaters OnChain", "SWEAT") {}
modifier whenPublicSaleActive() {
}
modifier whenClaimActive() {
require(<FILL_ME>)
_;
}
modifier whenBurningActive() {
}
function getTotalMinted() external view returns (uint256) {
}
function getRemainingFounderMints(address _addr) public view returns (uint256) {
}
function isPublicSaleOpen() public view returns (bool) {
}
function isClaimOpen() public view returns (bool) {
}
function isBurningOpen() public view returns (bool) {
}
function setRenderingContractAddress(address _renderingContractAddress) public onlyOwner {
}
function setPublicSaleTimestamp(uint256 timestamp) external onlyOwner {
}
function setMintStatus(bool value) external onlyOwner {
}
function closeMintsOpenBurning() external onlyOwner {
}
function setClaimStatus(bool value) external onlyOwner {
}
function mintPublicSale(uint256 _count) external payable nonReentrant whenPublicSaleActive returns (uint256, uint256) {
}
function allocateFounderMint(address _addr, uint256 _count) public onlyOwner nonReentrant {
}
function founderMint(uint256 _count) public nonReentrant returns (uint256, uint256) {
}
function burnAndMint(uint256[] calldata tokenIds) external nonReentrant whenBurningActive returns(uint256, uint256) {
}
function burn(uint256 tokenId1, uint256 tokenId2) internal {
}
function mint(uint256 tokenId, uint256 resolution) internal {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
}
function claimSweater(uint256 _tokenId) external nonReentrant whenClaimActive returns(address) {
}
function getHighQualityClaimedSweater(uint256 _tokenId) external view returns(string memory) {
}
function getDna(uint256 _tokenId) public view returns (uint256) {
}
receive() external payable {}
function withdraw() public onlyOwner {
}
}
| isClaimOpen(),"Claiming not open" | 29,128 | isClaimOpen() |
"Burning not open" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./OnChainSweatersTypes.sol";
import "./IOnChainSweatersRenderer.sol";
contract OnChainSweaters is ERC721, Ownable, ReentrancyGuard, Pausable {
mapping(uint256 => OnChainSweatersTypes.OnChainSweater) sweaters;
event GenerateSweater(uint256 indexed tokenId, uint256 dna);
event ClaimedSweater(address claimer, uint256 indexed tokenId, address tx);
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
Counters.Counter private _reservedTokenIds;
Counters.Counter private _hdTokens; // after burn tokens
uint256 public constant MAX_FREE_MINT_SUPPLY = 333;
uint256 public constant MAX_SUPPLY = 3333;
uint256 public constant FOUNDERS_RESERVE_AMOUNT = 0;
uint256 public constant MAX_PUBLIC_SUPPLY = MAX_SUPPLY - MAX_FREE_MINT_SUPPLY - FOUNDERS_RESERVE_AMOUNT;
uint256 public constant MINT_PRICE = 0.02 ether;
uint256 private constant MAX_PER_ADDRESS = 10;
uint256 private constant FIRST_HD_TOKEN_ID = MAX_SUPPLY + 1; // minted by burning
uint256 public publicSaleStartTimestamp;
address public renderingContractAddress;
bool public claimActive = false;
bool public mintActive = true;
bool public burningActive = false;
mapping(uint256 => address) public claimedTokenTransactions;
mapping(address => uint256) public mintedCounts;
mapping(address => uint256) private founderMintCountsRemaining;
constructor() ERC721("Xmas Sweaters OnChain", "SWEAT") {}
modifier whenPublicSaleActive() {
}
modifier whenClaimActive() {
}
modifier whenBurningActive() {
require(<FILL_ME>)
_;
}
function getTotalMinted() external view returns (uint256) {
}
function getRemainingFounderMints(address _addr) public view returns (uint256) {
}
function isPublicSaleOpen() public view returns (bool) {
}
function isClaimOpen() public view returns (bool) {
}
function isBurningOpen() public view returns (bool) {
}
function setRenderingContractAddress(address _renderingContractAddress) public onlyOwner {
}
function setPublicSaleTimestamp(uint256 timestamp) external onlyOwner {
}
function setMintStatus(bool value) external onlyOwner {
}
function closeMintsOpenBurning() external onlyOwner {
}
function setClaimStatus(bool value) external onlyOwner {
}
function mintPublicSale(uint256 _count) external payable nonReentrant whenPublicSaleActive returns (uint256, uint256) {
}
function allocateFounderMint(address _addr, uint256 _count) public onlyOwner nonReentrant {
}
function founderMint(uint256 _count) public nonReentrant returns (uint256, uint256) {
}
function burnAndMint(uint256[] calldata tokenIds) external nonReentrant whenBurningActive returns(uint256, uint256) {
}
function burn(uint256 tokenId1, uint256 tokenId2) internal {
}
function mint(uint256 tokenId, uint256 resolution) internal {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
}
function claimSweater(uint256 _tokenId) external nonReentrant whenClaimActive returns(address) {
}
function getHighQualityClaimedSweater(uint256 _tokenId) external view returns(string memory) {
}
function getDna(uint256 _tokenId) public view returns (uint256) {
}
receive() external payable {}
function withdraw() public onlyOwner {
}
}
| isBurningOpen(),"Burning not open" | 29,128 | isBurningOpen() |
"All Sweaters have been minted" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./OnChainSweatersTypes.sol";
import "./IOnChainSweatersRenderer.sol";
contract OnChainSweaters is ERC721, Ownable, ReentrancyGuard, Pausable {
mapping(uint256 => OnChainSweatersTypes.OnChainSweater) sweaters;
event GenerateSweater(uint256 indexed tokenId, uint256 dna);
event ClaimedSweater(address claimer, uint256 indexed tokenId, address tx);
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
Counters.Counter private _reservedTokenIds;
Counters.Counter private _hdTokens; // after burn tokens
uint256 public constant MAX_FREE_MINT_SUPPLY = 333;
uint256 public constant MAX_SUPPLY = 3333;
uint256 public constant FOUNDERS_RESERVE_AMOUNT = 0;
uint256 public constant MAX_PUBLIC_SUPPLY = MAX_SUPPLY - MAX_FREE_MINT_SUPPLY - FOUNDERS_RESERVE_AMOUNT;
uint256 public constant MINT_PRICE = 0.02 ether;
uint256 private constant MAX_PER_ADDRESS = 10;
uint256 private constant FIRST_HD_TOKEN_ID = MAX_SUPPLY + 1; // minted by burning
uint256 public publicSaleStartTimestamp;
address public renderingContractAddress;
bool public claimActive = false;
bool public mintActive = true;
bool public burningActive = false;
mapping(uint256 => address) public claimedTokenTransactions;
mapping(address => uint256) public mintedCounts;
mapping(address => uint256) private founderMintCountsRemaining;
constructor() ERC721("Xmas Sweaters OnChain", "SWEAT") {}
modifier whenPublicSaleActive() {
}
modifier whenClaimActive() {
}
modifier whenBurningActive() {
}
function getTotalMinted() external view returns (uint256) {
}
function getRemainingFounderMints(address _addr) public view returns (uint256) {
}
function isPublicSaleOpen() public view returns (bool) {
}
function isClaimOpen() public view returns (bool) {
}
function isBurningOpen() public view returns (bool) {
}
function setRenderingContractAddress(address _renderingContractAddress) public onlyOwner {
}
function setPublicSaleTimestamp(uint256 timestamp) external onlyOwner {
}
function setMintStatus(bool value) external onlyOwner {
}
function closeMintsOpenBurning() external onlyOwner {
}
function setClaimStatus(bool value) external onlyOwner {
}
function mintPublicSale(uint256 _count) external payable nonReentrant whenPublicSaleActive returns (uint256, uint256) {
require(_count > 0 && _count <= MAX_PER_ADDRESS, "Invalid Sweater count"); // To check wallet count
require(<FILL_ME>)
if(_tokenIds.current()+1 > MAX_FREE_MINT_SUPPLY) {
require(_count * MINT_PRICE == msg.value, "Incorrect amount of ether sent");
} else {
require(msg.value == 0, "Do not send ether for free mint");
}
require(mintedCounts[msg.sender] + _count <= MAX_PER_ADDRESS, "You cannot mint so many Sweaters");
uint256 firstMintedId = _tokenIds.current() + 1;
for (uint256 i = 0; i < _count; i++) {
_tokenIds.increment();
mint(_tokenIds.current(), 128);
}
mintedCounts[msg.sender] += _count;
return (firstMintedId, _count);
}
function allocateFounderMint(address _addr, uint256 _count) public onlyOwner nonReentrant {
}
function founderMint(uint256 _count) public nonReentrant returns (uint256, uint256) {
}
function burnAndMint(uint256[] calldata tokenIds) external nonReentrant whenBurningActive returns(uint256, uint256) {
}
function burn(uint256 tokenId1, uint256 tokenId2) internal {
}
function mint(uint256 tokenId, uint256 resolution) internal {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
}
function claimSweater(uint256 _tokenId) external nonReentrant whenClaimActive returns(address) {
}
function getHighQualityClaimedSweater(uint256 _tokenId) external view returns(string memory) {
}
function getDna(uint256 _tokenId) public view returns (uint256) {
}
receive() external payable {}
function withdraw() public onlyOwner {
}
}
| _tokenIds.current()+_count<=MAX_PUBLIC_SUPPLY,"All Sweaters have been minted" | 29,128 | _tokenIds.current()+_count<=MAX_PUBLIC_SUPPLY |
"Incorrect amount of ether sent" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./OnChainSweatersTypes.sol";
import "./IOnChainSweatersRenderer.sol";
contract OnChainSweaters is ERC721, Ownable, ReentrancyGuard, Pausable {
mapping(uint256 => OnChainSweatersTypes.OnChainSweater) sweaters;
event GenerateSweater(uint256 indexed tokenId, uint256 dna);
event ClaimedSweater(address claimer, uint256 indexed tokenId, address tx);
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
Counters.Counter private _reservedTokenIds;
Counters.Counter private _hdTokens; // after burn tokens
uint256 public constant MAX_FREE_MINT_SUPPLY = 333;
uint256 public constant MAX_SUPPLY = 3333;
uint256 public constant FOUNDERS_RESERVE_AMOUNT = 0;
uint256 public constant MAX_PUBLIC_SUPPLY = MAX_SUPPLY - MAX_FREE_MINT_SUPPLY - FOUNDERS_RESERVE_AMOUNT;
uint256 public constant MINT_PRICE = 0.02 ether;
uint256 private constant MAX_PER_ADDRESS = 10;
uint256 private constant FIRST_HD_TOKEN_ID = MAX_SUPPLY + 1; // minted by burning
uint256 public publicSaleStartTimestamp;
address public renderingContractAddress;
bool public claimActive = false;
bool public mintActive = true;
bool public burningActive = false;
mapping(uint256 => address) public claimedTokenTransactions;
mapping(address => uint256) public mintedCounts;
mapping(address => uint256) private founderMintCountsRemaining;
constructor() ERC721("Xmas Sweaters OnChain", "SWEAT") {}
modifier whenPublicSaleActive() {
}
modifier whenClaimActive() {
}
modifier whenBurningActive() {
}
function getTotalMinted() external view returns (uint256) {
}
function getRemainingFounderMints(address _addr) public view returns (uint256) {
}
function isPublicSaleOpen() public view returns (bool) {
}
function isClaimOpen() public view returns (bool) {
}
function isBurningOpen() public view returns (bool) {
}
function setRenderingContractAddress(address _renderingContractAddress) public onlyOwner {
}
function setPublicSaleTimestamp(uint256 timestamp) external onlyOwner {
}
function setMintStatus(bool value) external onlyOwner {
}
function closeMintsOpenBurning() external onlyOwner {
}
function setClaimStatus(bool value) external onlyOwner {
}
function mintPublicSale(uint256 _count) external payable nonReentrant whenPublicSaleActive returns (uint256, uint256) {
require(_count > 0 && _count <= MAX_PER_ADDRESS, "Invalid Sweater count"); // To check wallet count
require(_tokenIds.current() + _count <= MAX_PUBLIC_SUPPLY, "All Sweaters have been minted");
if(_tokenIds.current()+1 > MAX_FREE_MINT_SUPPLY) {
require(<FILL_ME>)
} else {
require(msg.value == 0, "Do not send ether for free mint");
}
require(mintedCounts[msg.sender] + _count <= MAX_PER_ADDRESS, "You cannot mint so many Sweaters");
uint256 firstMintedId = _tokenIds.current() + 1;
for (uint256 i = 0; i < _count; i++) {
_tokenIds.increment();
mint(_tokenIds.current(), 128);
}
mintedCounts[msg.sender] += _count;
return (firstMintedId, _count);
}
function allocateFounderMint(address _addr, uint256 _count) public onlyOwner nonReentrant {
}
function founderMint(uint256 _count) public nonReentrant returns (uint256, uint256) {
}
function burnAndMint(uint256[] calldata tokenIds) external nonReentrant whenBurningActive returns(uint256, uint256) {
}
function burn(uint256 tokenId1, uint256 tokenId2) internal {
}
function mint(uint256 tokenId, uint256 resolution) internal {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
}
function claimSweater(uint256 _tokenId) external nonReentrant whenClaimActive returns(address) {
}
function getHighQualityClaimedSweater(uint256 _tokenId) external view returns(string memory) {
}
function getDna(uint256 _tokenId) public view returns (uint256) {
}
receive() external payable {}
function withdraw() public onlyOwner {
}
}
| _count*MINT_PRICE==msg.value,"Incorrect amount of ether sent" | 29,128 | _count*MINT_PRICE==msg.value |
"You cannot mint so many Sweaters" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./OnChainSweatersTypes.sol";
import "./IOnChainSweatersRenderer.sol";
contract OnChainSweaters is ERC721, Ownable, ReentrancyGuard, Pausable {
mapping(uint256 => OnChainSweatersTypes.OnChainSweater) sweaters;
event GenerateSweater(uint256 indexed tokenId, uint256 dna);
event ClaimedSweater(address claimer, uint256 indexed tokenId, address tx);
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
Counters.Counter private _reservedTokenIds;
Counters.Counter private _hdTokens; // after burn tokens
uint256 public constant MAX_FREE_MINT_SUPPLY = 333;
uint256 public constant MAX_SUPPLY = 3333;
uint256 public constant FOUNDERS_RESERVE_AMOUNT = 0;
uint256 public constant MAX_PUBLIC_SUPPLY = MAX_SUPPLY - MAX_FREE_MINT_SUPPLY - FOUNDERS_RESERVE_AMOUNT;
uint256 public constant MINT_PRICE = 0.02 ether;
uint256 private constant MAX_PER_ADDRESS = 10;
uint256 private constant FIRST_HD_TOKEN_ID = MAX_SUPPLY + 1; // minted by burning
uint256 public publicSaleStartTimestamp;
address public renderingContractAddress;
bool public claimActive = false;
bool public mintActive = true;
bool public burningActive = false;
mapping(uint256 => address) public claimedTokenTransactions;
mapping(address => uint256) public mintedCounts;
mapping(address => uint256) private founderMintCountsRemaining;
constructor() ERC721("Xmas Sweaters OnChain", "SWEAT") {}
modifier whenPublicSaleActive() {
}
modifier whenClaimActive() {
}
modifier whenBurningActive() {
}
function getTotalMinted() external view returns (uint256) {
}
function getRemainingFounderMints(address _addr) public view returns (uint256) {
}
function isPublicSaleOpen() public view returns (bool) {
}
function isClaimOpen() public view returns (bool) {
}
function isBurningOpen() public view returns (bool) {
}
function setRenderingContractAddress(address _renderingContractAddress) public onlyOwner {
}
function setPublicSaleTimestamp(uint256 timestamp) external onlyOwner {
}
function setMintStatus(bool value) external onlyOwner {
}
function closeMintsOpenBurning() external onlyOwner {
}
function setClaimStatus(bool value) external onlyOwner {
}
function mintPublicSale(uint256 _count) external payable nonReentrant whenPublicSaleActive returns (uint256, uint256) {
require(_count > 0 && _count <= MAX_PER_ADDRESS, "Invalid Sweater count"); // To check wallet count
require(_tokenIds.current() + _count <= MAX_PUBLIC_SUPPLY, "All Sweaters have been minted");
if(_tokenIds.current()+1 > MAX_FREE_MINT_SUPPLY) {
require(_count * MINT_PRICE == msg.value, "Incorrect amount of ether sent");
} else {
require(msg.value == 0, "Do not send ether for free mint");
}
require(<FILL_ME>)
uint256 firstMintedId = _tokenIds.current() + 1;
for (uint256 i = 0; i < _count; i++) {
_tokenIds.increment();
mint(_tokenIds.current(), 128);
}
mintedCounts[msg.sender] += _count;
return (firstMintedId, _count);
}
function allocateFounderMint(address _addr, uint256 _count) public onlyOwner nonReentrant {
}
function founderMint(uint256 _count) public nonReentrant returns (uint256, uint256) {
}
function burnAndMint(uint256[] calldata tokenIds) external nonReentrant whenBurningActive returns(uint256, uint256) {
}
function burn(uint256 tokenId1, uint256 tokenId2) internal {
}
function mint(uint256 tokenId, uint256 resolution) internal {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
}
function claimSweater(uint256 _tokenId) external nonReentrant whenClaimActive returns(address) {
}
function getHighQualityClaimedSweater(uint256 _tokenId) external view returns(string memory) {
}
function getDna(uint256 _tokenId) public view returns (uint256) {
}
receive() external payable {}
function withdraw() public onlyOwner {
}
}
| mintedCounts[msg.sender]+_count<=MAX_PER_ADDRESS,"You cannot mint so many Sweaters" | 29,128 | mintedCounts[msg.sender]+_count<=MAX_PER_ADDRESS |
"All reserved Sweaters have been minted" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./OnChainSweatersTypes.sol";
import "./IOnChainSweatersRenderer.sol";
contract OnChainSweaters is ERC721, Ownable, ReentrancyGuard, Pausable {
mapping(uint256 => OnChainSweatersTypes.OnChainSweater) sweaters;
event GenerateSweater(uint256 indexed tokenId, uint256 dna);
event ClaimedSweater(address claimer, uint256 indexed tokenId, address tx);
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
Counters.Counter private _reservedTokenIds;
Counters.Counter private _hdTokens; // after burn tokens
uint256 public constant MAX_FREE_MINT_SUPPLY = 333;
uint256 public constant MAX_SUPPLY = 3333;
uint256 public constant FOUNDERS_RESERVE_AMOUNT = 0;
uint256 public constant MAX_PUBLIC_SUPPLY = MAX_SUPPLY - MAX_FREE_MINT_SUPPLY - FOUNDERS_RESERVE_AMOUNT;
uint256 public constant MINT_PRICE = 0.02 ether;
uint256 private constant MAX_PER_ADDRESS = 10;
uint256 private constant FIRST_HD_TOKEN_ID = MAX_SUPPLY + 1; // minted by burning
uint256 public publicSaleStartTimestamp;
address public renderingContractAddress;
bool public claimActive = false;
bool public mintActive = true;
bool public burningActive = false;
mapping(uint256 => address) public claimedTokenTransactions;
mapping(address => uint256) public mintedCounts;
mapping(address => uint256) private founderMintCountsRemaining;
constructor() ERC721("Xmas Sweaters OnChain", "SWEAT") {}
modifier whenPublicSaleActive() {
}
modifier whenClaimActive() {
}
modifier whenBurningActive() {
}
function getTotalMinted() external view returns (uint256) {
}
function getRemainingFounderMints(address _addr) public view returns (uint256) {
}
function isPublicSaleOpen() public view returns (bool) {
}
function isClaimOpen() public view returns (bool) {
}
function isBurningOpen() public view returns (bool) {
}
function setRenderingContractAddress(address _renderingContractAddress) public onlyOwner {
}
function setPublicSaleTimestamp(uint256 timestamp) external onlyOwner {
}
function setMintStatus(bool value) external onlyOwner {
}
function closeMintsOpenBurning() external onlyOwner {
}
function setClaimStatus(bool value) external onlyOwner {
}
function mintPublicSale(uint256 _count) external payable nonReentrant whenPublicSaleActive returns (uint256, uint256) {
}
function allocateFounderMint(address _addr, uint256 _count) public onlyOwner nonReentrant {
}
function founderMint(uint256 _count) public nonReentrant returns (uint256, uint256) {
require(_count > 0 && _count <= MAX_PER_ADDRESS, "Invalid count");
require(<FILL_ME>)
require(founderMintCountsRemaining[msg.sender] >= _count, "You cannot mint this many reserved Sweaters");
// FIXME: see why onchainrunner use _tokenIds instead of _reservedTokenIds
//uint256 firstMintedId = MAX_PUBLIC_SUPPLY + _tokenIds.current() + 1;
uint256 firstMintedId = MAX_PUBLIC_SUPPLY + _reservedTokenIds.current() + 1;
for (uint256 i = 0; i < _count; i++) {
_reservedTokenIds.increment();
mint(MAX_PUBLIC_SUPPLY + _reservedTokenIds.current(), 128);
}
founderMintCountsRemaining[msg.sender] -= _count;
return (firstMintedId, _count);
}
function burnAndMint(uint256[] calldata tokenIds) external nonReentrant whenBurningActive returns(uint256, uint256) {
}
function burn(uint256 tokenId1, uint256 tokenId2) internal {
}
function mint(uint256 tokenId, uint256 resolution) internal {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
}
function claimSweater(uint256 _tokenId) external nonReentrant whenClaimActive returns(address) {
}
function getHighQualityClaimedSweater(uint256 _tokenId) external view returns(string memory) {
}
function getDna(uint256 _tokenId) public view returns (uint256) {
}
receive() external payable {}
function withdraw() public onlyOwner {
}
}
| _reservedTokenIds.current()+_count<=FOUNDERS_RESERVE_AMOUNT,"All reserved Sweaters have been minted" | 29,128 | _reservedTokenIds.current()+_count<=FOUNDERS_RESERVE_AMOUNT |
"You cannot mint this many reserved Sweaters" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./OnChainSweatersTypes.sol";
import "./IOnChainSweatersRenderer.sol";
contract OnChainSweaters is ERC721, Ownable, ReentrancyGuard, Pausable {
mapping(uint256 => OnChainSweatersTypes.OnChainSweater) sweaters;
event GenerateSweater(uint256 indexed tokenId, uint256 dna);
event ClaimedSweater(address claimer, uint256 indexed tokenId, address tx);
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
Counters.Counter private _reservedTokenIds;
Counters.Counter private _hdTokens; // after burn tokens
uint256 public constant MAX_FREE_MINT_SUPPLY = 333;
uint256 public constant MAX_SUPPLY = 3333;
uint256 public constant FOUNDERS_RESERVE_AMOUNT = 0;
uint256 public constant MAX_PUBLIC_SUPPLY = MAX_SUPPLY - MAX_FREE_MINT_SUPPLY - FOUNDERS_RESERVE_AMOUNT;
uint256 public constant MINT_PRICE = 0.02 ether;
uint256 private constant MAX_PER_ADDRESS = 10;
uint256 private constant FIRST_HD_TOKEN_ID = MAX_SUPPLY + 1; // minted by burning
uint256 public publicSaleStartTimestamp;
address public renderingContractAddress;
bool public claimActive = false;
bool public mintActive = true;
bool public burningActive = false;
mapping(uint256 => address) public claimedTokenTransactions;
mapping(address => uint256) public mintedCounts;
mapping(address => uint256) private founderMintCountsRemaining;
constructor() ERC721("Xmas Sweaters OnChain", "SWEAT") {}
modifier whenPublicSaleActive() {
}
modifier whenClaimActive() {
}
modifier whenBurningActive() {
}
function getTotalMinted() external view returns (uint256) {
}
function getRemainingFounderMints(address _addr) public view returns (uint256) {
}
function isPublicSaleOpen() public view returns (bool) {
}
function isClaimOpen() public view returns (bool) {
}
function isBurningOpen() public view returns (bool) {
}
function setRenderingContractAddress(address _renderingContractAddress) public onlyOwner {
}
function setPublicSaleTimestamp(uint256 timestamp) external onlyOwner {
}
function setMintStatus(bool value) external onlyOwner {
}
function closeMintsOpenBurning() external onlyOwner {
}
function setClaimStatus(bool value) external onlyOwner {
}
function mintPublicSale(uint256 _count) external payable nonReentrant whenPublicSaleActive returns (uint256, uint256) {
}
function allocateFounderMint(address _addr, uint256 _count) public onlyOwner nonReentrant {
}
function founderMint(uint256 _count) public nonReentrant returns (uint256, uint256) {
require(_count > 0 && _count <= MAX_PER_ADDRESS, "Invalid count");
require(_reservedTokenIds.current() + _count <= FOUNDERS_RESERVE_AMOUNT, "All reserved Sweaters have been minted");
require(<FILL_ME>)
// FIXME: see why onchainrunner use _tokenIds instead of _reservedTokenIds
//uint256 firstMintedId = MAX_PUBLIC_SUPPLY + _tokenIds.current() + 1;
uint256 firstMintedId = MAX_PUBLIC_SUPPLY + _reservedTokenIds.current() + 1;
for (uint256 i = 0; i < _count; i++) {
_reservedTokenIds.increment();
mint(MAX_PUBLIC_SUPPLY + _reservedTokenIds.current(), 128);
}
founderMintCountsRemaining[msg.sender] -= _count;
return (firstMintedId, _count);
}
function burnAndMint(uint256[] calldata tokenIds) external nonReentrant whenBurningActive returns(uint256, uint256) {
}
function burn(uint256 tokenId1, uint256 tokenId2) internal {
}
function mint(uint256 tokenId, uint256 resolution) internal {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
}
function claimSweater(uint256 _tokenId) external nonReentrant whenClaimActive returns(address) {
}
function getHighQualityClaimedSweater(uint256 _tokenId) external view returns(string memory) {
}
function getDna(uint256 _tokenId) public view returns (uint256) {
}
receive() external payable {}
function withdraw() public onlyOwner {
}
}
| founderMintCountsRemaining[msg.sender]>=_count,"You cannot mint this many reserved Sweaters" | 29,128 | founderMintCountsRemaining[msg.sender]>=_count |
"The number of tokens to burn must be even" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./OnChainSweatersTypes.sol";
import "./IOnChainSweatersRenderer.sol";
contract OnChainSweaters is ERC721, Ownable, ReentrancyGuard, Pausable {
mapping(uint256 => OnChainSweatersTypes.OnChainSweater) sweaters;
event GenerateSweater(uint256 indexed tokenId, uint256 dna);
event ClaimedSweater(address claimer, uint256 indexed tokenId, address tx);
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
Counters.Counter private _reservedTokenIds;
Counters.Counter private _hdTokens; // after burn tokens
uint256 public constant MAX_FREE_MINT_SUPPLY = 333;
uint256 public constant MAX_SUPPLY = 3333;
uint256 public constant FOUNDERS_RESERVE_AMOUNT = 0;
uint256 public constant MAX_PUBLIC_SUPPLY = MAX_SUPPLY - MAX_FREE_MINT_SUPPLY - FOUNDERS_RESERVE_AMOUNT;
uint256 public constant MINT_PRICE = 0.02 ether;
uint256 private constant MAX_PER_ADDRESS = 10;
uint256 private constant FIRST_HD_TOKEN_ID = MAX_SUPPLY + 1; // minted by burning
uint256 public publicSaleStartTimestamp;
address public renderingContractAddress;
bool public claimActive = false;
bool public mintActive = true;
bool public burningActive = false;
mapping(uint256 => address) public claimedTokenTransactions;
mapping(address => uint256) public mintedCounts;
mapping(address => uint256) private founderMintCountsRemaining;
constructor() ERC721("Xmas Sweaters OnChain", "SWEAT") {}
modifier whenPublicSaleActive() {
}
modifier whenClaimActive() {
}
modifier whenBurningActive() {
}
function getTotalMinted() external view returns (uint256) {
}
function getRemainingFounderMints(address _addr) public view returns (uint256) {
}
function isPublicSaleOpen() public view returns (bool) {
}
function isClaimOpen() public view returns (bool) {
}
function isBurningOpen() public view returns (bool) {
}
function setRenderingContractAddress(address _renderingContractAddress) public onlyOwner {
}
function setPublicSaleTimestamp(uint256 timestamp) external onlyOwner {
}
function setMintStatus(bool value) external onlyOwner {
}
function closeMintsOpenBurning() external onlyOwner {
}
function setClaimStatus(bool value) external onlyOwner {
}
function mintPublicSale(uint256 _count) external payable nonReentrant whenPublicSaleActive returns (uint256, uint256) {
}
function allocateFounderMint(address _addr, uint256 _count) public onlyOwner nonReentrant {
}
function founderMint(uint256 _count) public nonReentrant returns (uint256, uint256) {
}
function burnAndMint(uint256[] calldata tokenIds) external nonReentrant whenBurningActive returns(uint256, uint256) {
require(tokenIds.length > 0 && tokenIds.length < MAX_PUBLIC_SUPPLY, "No token or exceeds existing number of tokens");
require(<FILL_ME>)
// check the validity of tokens
for (uint256 i = 0; i < tokenIds.length; i+=2) {
require(tokenIds[i] <= MAX_PUBLIC_SUPPLY && tokenIds[i+1] <= MAX_PUBLIC_SUPPLY, "Token not burnable");
require(_exists(tokenIds[i]) && _exists(tokenIds[i+1]), "Trying to burn nonexistent token");
require(ownerOf(tokenIds[i]) == msg.sender && ownerOf(tokenIds[i+1]) == msg.sender, "Burning not owned token");
}
uint256 firstMintedId = FIRST_HD_TOKEN_ID + _hdTokens.current();
for (uint256 i = 0; i < tokenIds.length; i+=2) {
burn(tokenIds[i], tokenIds[i+1]);
_hdTokens.increment();
mint(FIRST_HD_TOKEN_ID + _hdTokens.current(), 256);
}
return (firstMintedId, tokenIds.length/2);
}
function burn(uint256 tokenId1, uint256 tokenId2) internal {
}
function mint(uint256 tokenId, uint256 resolution) internal {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
}
function claimSweater(uint256 _tokenId) external nonReentrant whenClaimActive returns(address) {
}
function getHighQualityClaimedSweater(uint256 _tokenId) external view returns(string memory) {
}
function getDna(uint256 _tokenId) public view returns (uint256) {
}
receive() external payable {}
function withdraw() public onlyOwner {
}
}
| tokenIds.length%2==0,"The number of tokens to burn must be even" | 29,128 | tokenIds.length%2==0 |
"Token not burnable" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./OnChainSweatersTypes.sol";
import "./IOnChainSweatersRenderer.sol";
contract OnChainSweaters is ERC721, Ownable, ReentrancyGuard, Pausable {
mapping(uint256 => OnChainSweatersTypes.OnChainSweater) sweaters;
event GenerateSweater(uint256 indexed tokenId, uint256 dna);
event ClaimedSweater(address claimer, uint256 indexed tokenId, address tx);
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
Counters.Counter private _reservedTokenIds;
Counters.Counter private _hdTokens; // after burn tokens
uint256 public constant MAX_FREE_MINT_SUPPLY = 333;
uint256 public constant MAX_SUPPLY = 3333;
uint256 public constant FOUNDERS_RESERVE_AMOUNT = 0;
uint256 public constant MAX_PUBLIC_SUPPLY = MAX_SUPPLY - MAX_FREE_MINT_SUPPLY - FOUNDERS_RESERVE_AMOUNT;
uint256 public constant MINT_PRICE = 0.02 ether;
uint256 private constant MAX_PER_ADDRESS = 10;
uint256 private constant FIRST_HD_TOKEN_ID = MAX_SUPPLY + 1; // minted by burning
uint256 public publicSaleStartTimestamp;
address public renderingContractAddress;
bool public claimActive = false;
bool public mintActive = true;
bool public burningActive = false;
mapping(uint256 => address) public claimedTokenTransactions;
mapping(address => uint256) public mintedCounts;
mapping(address => uint256) private founderMintCountsRemaining;
constructor() ERC721("Xmas Sweaters OnChain", "SWEAT") {}
modifier whenPublicSaleActive() {
}
modifier whenClaimActive() {
}
modifier whenBurningActive() {
}
function getTotalMinted() external view returns (uint256) {
}
function getRemainingFounderMints(address _addr) public view returns (uint256) {
}
function isPublicSaleOpen() public view returns (bool) {
}
function isClaimOpen() public view returns (bool) {
}
function isBurningOpen() public view returns (bool) {
}
function setRenderingContractAddress(address _renderingContractAddress) public onlyOwner {
}
function setPublicSaleTimestamp(uint256 timestamp) external onlyOwner {
}
function setMintStatus(bool value) external onlyOwner {
}
function closeMintsOpenBurning() external onlyOwner {
}
function setClaimStatus(bool value) external onlyOwner {
}
function mintPublicSale(uint256 _count) external payable nonReentrant whenPublicSaleActive returns (uint256, uint256) {
}
function allocateFounderMint(address _addr, uint256 _count) public onlyOwner nonReentrant {
}
function founderMint(uint256 _count) public nonReentrant returns (uint256, uint256) {
}
function burnAndMint(uint256[] calldata tokenIds) external nonReentrant whenBurningActive returns(uint256, uint256) {
require(tokenIds.length > 0 && tokenIds.length < MAX_PUBLIC_SUPPLY, "No token or exceeds existing number of tokens");
require(tokenIds.length % 2 == 0, "The number of tokens to burn must be even");
// check the validity of tokens
for (uint256 i = 0; i < tokenIds.length; i+=2) {
require(<FILL_ME>)
require(_exists(tokenIds[i]) && _exists(tokenIds[i+1]), "Trying to burn nonexistent token");
require(ownerOf(tokenIds[i]) == msg.sender && ownerOf(tokenIds[i+1]) == msg.sender, "Burning not owned token");
}
uint256 firstMintedId = FIRST_HD_TOKEN_ID + _hdTokens.current();
for (uint256 i = 0; i < tokenIds.length; i+=2) {
burn(tokenIds[i], tokenIds[i+1]);
_hdTokens.increment();
mint(FIRST_HD_TOKEN_ID + _hdTokens.current(), 256);
}
return (firstMintedId, tokenIds.length/2);
}
function burn(uint256 tokenId1, uint256 tokenId2) internal {
}
function mint(uint256 tokenId, uint256 resolution) internal {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
}
function claimSweater(uint256 _tokenId) external nonReentrant whenClaimActive returns(address) {
}
function getHighQualityClaimedSweater(uint256 _tokenId) external view returns(string memory) {
}
function getDna(uint256 _tokenId) public view returns (uint256) {
}
receive() external payable {}
function withdraw() public onlyOwner {
}
}
| tokenIds[i]<=MAX_PUBLIC_SUPPLY&&tokenIds[i+1]<=MAX_PUBLIC_SUPPLY,"Token not burnable" | 29,128 | tokenIds[i]<=MAX_PUBLIC_SUPPLY&&tokenIds[i+1]<=MAX_PUBLIC_SUPPLY |
"Trying to burn nonexistent token" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./OnChainSweatersTypes.sol";
import "./IOnChainSweatersRenderer.sol";
contract OnChainSweaters is ERC721, Ownable, ReentrancyGuard, Pausable {
mapping(uint256 => OnChainSweatersTypes.OnChainSweater) sweaters;
event GenerateSweater(uint256 indexed tokenId, uint256 dna);
event ClaimedSweater(address claimer, uint256 indexed tokenId, address tx);
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
Counters.Counter private _reservedTokenIds;
Counters.Counter private _hdTokens; // after burn tokens
uint256 public constant MAX_FREE_MINT_SUPPLY = 333;
uint256 public constant MAX_SUPPLY = 3333;
uint256 public constant FOUNDERS_RESERVE_AMOUNT = 0;
uint256 public constant MAX_PUBLIC_SUPPLY = MAX_SUPPLY - MAX_FREE_MINT_SUPPLY - FOUNDERS_RESERVE_AMOUNT;
uint256 public constant MINT_PRICE = 0.02 ether;
uint256 private constant MAX_PER_ADDRESS = 10;
uint256 private constant FIRST_HD_TOKEN_ID = MAX_SUPPLY + 1; // minted by burning
uint256 public publicSaleStartTimestamp;
address public renderingContractAddress;
bool public claimActive = false;
bool public mintActive = true;
bool public burningActive = false;
mapping(uint256 => address) public claimedTokenTransactions;
mapping(address => uint256) public mintedCounts;
mapping(address => uint256) private founderMintCountsRemaining;
constructor() ERC721("Xmas Sweaters OnChain", "SWEAT") {}
modifier whenPublicSaleActive() {
}
modifier whenClaimActive() {
}
modifier whenBurningActive() {
}
function getTotalMinted() external view returns (uint256) {
}
function getRemainingFounderMints(address _addr) public view returns (uint256) {
}
function isPublicSaleOpen() public view returns (bool) {
}
function isClaimOpen() public view returns (bool) {
}
function isBurningOpen() public view returns (bool) {
}
function setRenderingContractAddress(address _renderingContractAddress) public onlyOwner {
}
function setPublicSaleTimestamp(uint256 timestamp) external onlyOwner {
}
function setMintStatus(bool value) external onlyOwner {
}
function closeMintsOpenBurning() external onlyOwner {
}
function setClaimStatus(bool value) external onlyOwner {
}
function mintPublicSale(uint256 _count) external payable nonReentrant whenPublicSaleActive returns (uint256, uint256) {
}
function allocateFounderMint(address _addr, uint256 _count) public onlyOwner nonReentrant {
}
function founderMint(uint256 _count) public nonReentrant returns (uint256, uint256) {
}
function burnAndMint(uint256[] calldata tokenIds) external nonReentrant whenBurningActive returns(uint256, uint256) {
require(tokenIds.length > 0 && tokenIds.length < MAX_PUBLIC_SUPPLY, "No token or exceeds existing number of tokens");
require(tokenIds.length % 2 == 0, "The number of tokens to burn must be even");
// check the validity of tokens
for (uint256 i = 0; i < tokenIds.length; i+=2) {
require(tokenIds[i] <= MAX_PUBLIC_SUPPLY && tokenIds[i+1] <= MAX_PUBLIC_SUPPLY, "Token not burnable");
require(<FILL_ME>)
require(ownerOf(tokenIds[i]) == msg.sender && ownerOf(tokenIds[i+1]) == msg.sender, "Burning not owned token");
}
uint256 firstMintedId = FIRST_HD_TOKEN_ID + _hdTokens.current();
for (uint256 i = 0; i < tokenIds.length; i+=2) {
burn(tokenIds[i], tokenIds[i+1]);
_hdTokens.increment();
mint(FIRST_HD_TOKEN_ID + _hdTokens.current(), 256);
}
return (firstMintedId, tokenIds.length/2);
}
function burn(uint256 tokenId1, uint256 tokenId2) internal {
}
function mint(uint256 tokenId, uint256 resolution) internal {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
}
function claimSweater(uint256 _tokenId) external nonReentrant whenClaimActive returns(address) {
}
function getHighQualityClaimedSweater(uint256 _tokenId) external view returns(string memory) {
}
function getDna(uint256 _tokenId) public view returns (uint256) {
}
receive() external payable {}
function withdraw() public onlyOwner {
}
}
| _exists(tokenIds[i])&&_exists(tokenIds[i+1]),"Trying to burn nonexistent token" | 29,128 | _exists(tokenIds[i])&&_exists(tokenIds[i+1]) |
"Burning not owned token" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./OnChainSweatersTypes.sol";
import "./IOnChainSweatersRenderer.sol";
contract OnChainSweaters is ERC721, Ownable, ReentrancyGuard, Pausable {
mapping(uint256 => OnChainSweatersTypes.OnChainSweater) sweaters;
event GenerateSweater(uint256 indexed tokenId, uint256 dna);
event ClaimedSweater(address claimer, uint256 indexed tokenId, address tx);
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
Counters.Counter private _reservedTokenIds;
Counters.Counter private _hdTokens; // after burn tokens
uint256 public constant MAX_FREE_MINT_SUPPLY = 333;
uint256 public constant MAX_SUPPLY = 3333;
uint256 public constant FOUNDERS_RESERVE_AMOUNT = 0;
uint256 public constant MAX_PUBLIC_SUPPLY = MAX_SUPPLY - MAX_FREE_MINT_SUPPLY - FOUNDERS_RESERVE_AMOUNT;
uint256 public constant MINT_PRICE = 0.02 ether;
uint256 private constant MAX_PER_ADDRESS = 10;
uint256 private constant FIRST_HD_TOKEN_ID = MAX_SUPPLY + 1; // minted by burning
uint256 public publicSaleStartTimestamp;
address public renderingContractAddress;
bool public claimActive = false;
bool public mintActive = true;
bool public burningActive = false;
mapping(uint256 => address) public claimedTokenTransactions;
mapping(address => uint256) public mintedCounts;
mapping(address => uint256) private founderMintCountsRemaining;
constructor() ERC721("Xmas Sweaters OnChain", "SWEAT") {}
modifier whenPublicSaleActive() {
}
modifier whenClaimActive() {
}
modifier whenBurningActive() {
}
function getTotalMinted() external view returns (uint256) {
}
function getRemainingFounderMints(address _addr) public view returns (uint256) {
}
function isPublicSaleOpen() public view returns (bool) {
}
function isClaimOpen() public view returns (bool) {
}
function isBurningOpen() public view returns (bool) {
}
function setRenderingContractAddress(address _renderingContractAddress) public onlyOwner {
}
function setPublicSaleTimestamp(uint256 timestamp) external onlyOwner {
}
function setMintStatus(bool value) external onlyOwner {
}
function closeMintsOpenBurning() external onlyOwner {
}
function setClaimStatus(bool value) external onlyOwner {
}
function mintPublicSale(uint256 _count) external payable nonReentrant whenPublicSaleActive returns (uint256, uint256) {
}
function allocateFounderMint(address _addr, uint256 _count) public onlyOwner nonReentrant {
}
function founderMint(uint256 _count) public nonReentrant returns (uint256, uint256) {
}
function burnAndMint(uint256[] calldata tokenIds) external nonReentrant whenBurningActive returns(uint256, uint256) {
require(tokenIds.length > 0 && tokenIds.length < MAX_PUBLIC_SUPPLY, "No token or exceeds existing number of tokens");
require(tokenIds.length % 2 == 0, "The number of tokens to burn must be even");
// check the validity of tokens
for (uint256 i = 0; i < tokenIds.length; i+=2) {
require(tokenIds[i] <= MAX_PUBLIC_SUPPLY && tokenIds[i+1] <= MAX_PUBLIC_SUPPLY, "Token not burnable");
require(_exists(tokenIds[i]) && _exists(tokenIds[i+1]), "Trying to burn nonexistent token");
require(<FILL_ME>)
}
uint256 firstMintedId = FIRST_HD_TOKEN_ID + _hdTokens.current();
for (uint256 i = 0; i < tokenIds.length; i+=2) {
burn(tokenIds[i], tokenIds[i+1]);
_hdTokens.increment();
mint(FIRST_HD_TOKEN_ID + _hdTokens.current(), 256);
}
return (firstMintedId, tokenIds.length/2);
}
function burn(uint256 tokenId1, uint256 tokenId2) internal {
}
function mint(uint256 tokenId, uint256 resolution) internal {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
}
function claimSweater(uint256 _tokenId) external nonReentrant whenClaimActive returns(address) {
}
function getHighQualityClaimedSweater(uint256 _tokenId) external view returns(string memory) {
}
function getDna(uint256 _tokenId) public view returns (uint256) {
}
receive() external payable {}
function withdraw() public onlyOwner {
}
}
| ownerOf(tokenIds[i])==msg.sender&&ownerOf(tokenIds[i+1])==msg.sender,"Burning not owned token" | 29,128 | ownerOf(tokenIds[i])==msg.sender&&ownerOf(tokenIds[i+1])==msg.sender |
"Trying to burn nonexistent or already burned token" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./OnChainSweatersTypes.sol";
import "./IOnChainSweatersRenderer.sol";
contract OnChainSweaters is ERC721, Ownable, ReentrancyGuard, Pausable {
mapping(uint256 => OnChainSweatersTypes.OnChainSweater) sweaters;
event GenerateSweater(uint256 indexed tokenId, uint256 dna);
event ClaimedSweater(address claimer, uint256 indexed tokenId, address tx);
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
Counters.Counter private _reservedTokenIds;
Counters.Counter private _hdTokens; // after burn tokens
uint256 public constant MAX_FREE_MINT_SUPPLY = 333;
uint256 public constant MAX_SUPPLY = 3333;
uint256 public constant FOUNDERS_RESERVE_AMOUNT = 0;
uint256 public constant MAX_PUBLIC_SUPPLY = MAX_SUPPLY - MAX_FREE_MINT_SUPPLY - FOUNDERS_RESERVE_AMOUNT;
uint256 public constant MINT_PRICE = 0.02 ether;
uint256 private constant MAX_PER_ADDRESS = 10;
uint256 private constant FIRST_HD_TOKEN_ID = MAX_SUPPLY + 1; // minted by burning
uint256 public publicSaleStartTimestamp;
address public renderingContractAddress;
bool public claimActive = false;
bool public mintActive = true;
bool public burningActive = false;
mapping(uint256 => address) public claimedTokenTransactions;
mapping(address => uint256) public mintedCounts;
mapping(address => uint256) private founderMintCountsRemaining;
constructor() ERC721("Xmas Sweaters OnChain", "SWEAT") {}
modifier whenPublicSaleActive() {
}
modifier whenClaimActive() {
}
modifier whenBurningActive() {
}
function getTotalMinted() external view returns (uint256) {
}
function getRemainingFounderMints(address _addr) public view returns (uint256) {
}
function isPublicSaleOpen() public view returns (bool) {
}
function isClaimOpen() public view returns (bool) {
}
function isBurningOpen() public view returns (bool) {
}
function setRenderingContractAddress(address _renderingContractAddress) public onlyOwner {
}
function setPublicSaleTimestamp(uint256 timestamp) external onlyOwner {
}
function setMintStatus(bool value) external onlyOwner {
}
function closeMintsOpenBurning() external onlyOwner {
}
function setClaimStatus(bool value) external onlyOwner {
}
function mintPublicSale(uint256 _count) external payable nonReentrant whenPublicSaleActive returns (uint256, uint256) {
}
function allocateFounderMint(address _addr, uint256 _count) public onlyOwner nonReentrant {
}
function founderMint(uint256 _count) public nonReentrant returns (uint256, uint256) {
}
function burnAndMint(uint256[] calldata tokenIds) external nonReentrant whenBurningActive returns(uint256, uint256) {
}
function burn(uint256 tokenId1, uint256 tokenId2) internal {
require(<FILL_ME>)
_burn(tokenId1);
_tokenIds.decrement();
_burn(tokenId2);
_tokenIds.decrement();
}
function mint(uint256 tokenId, uint256 resolution) internal {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
}
function claimSweater(uint256 _tokenId) external nonReentrant whenClaimActive returns(address) {
}
function getHighQualityClaimedSweater(uint256 _tokenId) external view returns(string memory) {
}
function getDna(uint256 _tokenId) public view returns (uint256) {
}
receive() external payable {}
function withdraw() public onlyOwner {
}
}
| _exists(tokenId1)&&_exists(tokenId2)&&tokenId1!=tokenId2,"Trying to burn nonexistent or already burned token" | 29,128 | _exists(tokenId1)&&_exists(tokenId2)&&tokenId1!=tokenId2 |
"Token already claimed" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./OnChainSweatersTypes.sol";
import "./IOnChainSweatersRenderer.sol";
contract OnChainSweaters is ERC721, Ownable, ReentrancyGuard, Pausable {
mapping(uint256 => OnChainSweatersTypes.OnChainSweater) sweaters;
event GenerateSweater(uint256 indexed tokenId, uint256 dna);
event ClaimedSweater(address claimer, uint256 indexed tokenId, address tx);
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
Counters.Counter private _reservedTokenIds;
Counters.Counter private _hdTokens; // after burn tokens
uint256 public constant MAX_FREE_MINT_SUPPLY = 333;
uint256 public constant MAX_SUPPLY = 3333;
uint256 public constant FOUNDERS_RESERVE_AMOUNT = 0;
uint256 public constant MAX_PUBLIC_SUPPLY = MAX_SUPPLY - MAX_FREE_MINT_SUPPLY - FOUNDERS_RESERVE_AMOUNT;
uint256 public constant MINT_PRICE = 0.02 ether;
uint256 private constant MAX_PER_ADDRESS = 10;
uint256 private constant FIRST_HD_TOKEN_ID = MAX_SUPPLY + 1; // minted by burning
uint256 public publicSaleStartTimestamp;
address public renderingContractAddress;
bool public claimActive = false;
bool public mintActive = true;
bool public burningActive = false;
mapping(uint256 => address) public claimedTokenTransactions;
mapping(address => uint256) public mintedCounts;
mapping(address => uint256) private founderMintCountsRemaining;
constructor() ERC721("Xmas Sweaters OnChain", "SWEAT") {}
modifier whenPublicSaleActive() {
}
modifier whenClaimActive() {
}
modifier whenBurningActive() {
}
function getTotalMinted() external view returns (uint256) {
}
function getRemainingFounderMints(address _addr) public view returns (uint256) {
}
function isPublicSaleOpen() public view returns (bool) {
}
function isClaimOpen() public view returns (bool) {
}
function isBurningOpen() public view returns (bool) {
}
function setRenderingContractAddress(address _renderingContractAddress) public onlyOwner {
}
function setPublicSaleTimestamp(uint256 timestamp) external onlyOwner {
}
function setMintStatus(bool value) external onlyOwner {
}
function closeMintsOpenBurning() external onlyOwner {
}
function setClaimStatus(bool value) external onlyOwner {
}
function mintPublicSale(uint256 _count) external payable nonReentrant whenPublicSaleActive returns (uint256, uint256) {
}
function allocateFounderMint(address _addr, uint256 _count) public onlyOwner nonReentrant {
}
function founderMint(uint256 _count) public nonReentrant returns (uint256, uint256) {
}
function burnAndMint(uint256[] calldata tokenIds) external nonReentrant whenBurningActive returns(uint256, uint256) {
}
function burn(uint256 tokenId1, uint256 tokenId2) internal {
}
function mint(uint256 tokenId, uint256 resolution) internal {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
}
function claimSweater(uint256 _tokenId) external nonReentrant whenClaimActive returns(address) {
require(ownerOf(_tokenId) == msg.sender, "Claiming not owned token");
require(<FILL_ME>)
claimedTokenTransactions[_tokenId] = tx.origin;
emit ClaimedSweater(msg.sender, _tokenId, tx.origin);
return claimedTokenTransactions[_tokenId];
}
function getHighQualityClaimedSweater(uint256 _tokenId) external view returns(string memory) {
}
function getDna(uint256 _tokenId) public view returns (uint256) {
}
receive() external payable {}
function withdraw() public onlyOwner {
}
}
| claimedTokenTransactions[_tokenId]==address(0),"Token already claimed" | 29,128 | claimedTokenTransactions[_tokenId]==address(0) |
"Not yet claimed token" | // SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/security/Pausable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "./OnChainSweatersTypes.sol";
import "./IOnChainSweatersRenderer.sol";
contract OnChainSweaters is ERC721, Ownable, ReentrancyGuard, Pausable {
mapping(uint256 => OnChainSweatersTypes.OnChainSweater) sweaters;
event GenerateSweater(uint256 indexed tokenId, uint256 dna);
event ClaimedSweater(address claimer, uint256 indexed tokenId, address tx);
using Counters for Counters.Counter;
Counters.Counter private _tokenIds;
Counters.Counter private _reservedTokenIds;
Counters.Counter private _hdTokens; // after burn tokens
uint256 public constant MAX_FREE_MINT_SUPPLY = 333;
uint256 public constant MAX_SUPPLY = 3333;
uint256 public constant FOUNDERS_RESERVE_AMOUNT = 0;
uint256 public constant MAX_PUBLIC_SUPPLY = MAX_SUPPLY - MAX_FREE_MINT_SUPPLY - FOUNDERS_RESERVE_AMOUNT;
uint256 public constant MINT_PRICE = 0.02 ether;
uint256 private constant MAX_PER_ADDRESS = 10;
uint256 private constant FIRST_HD_TOKEN_ID = MAX_SUPPLY + 1; // minted by burning
uint256 public publicSaleStartTimestamp;
address public renderingContractAddress;
bool public claimActive = false;
bool public mintActive = true;
bool public burningActive = false;
mapping(uint256 => address) public claimedTokenTransactions;
mapping(address => uint256) public mintedCounts;
mapping(address => uint256) private founderMintCountsRemaining;
constructor() ERC721("Xmas Sweaters OnChain", "SWEAT") {}
modifier whenPublicSaleActive() {
}
modifier whenClaimActive() {
}
modifier whenBurningActive() {
}
function getTotalMinted() external view returns (uint256) {
}
function getRemainingFounderMints(address _addr) public view returns (uint256) {
}
function isPublicSaleOpen() public view returns (bool) {
}
function isClaimOpen() public view returns (bool) {
}
function isBurningOpen() public view returns (bool) {
}
function setRenderingContractAddress(address _renderingContractAddress) public onlyOwner {
}
function setPublicSaleTimestamp(uint256 timestamp) external onlyOwner {
}
function setMintStatus(bool value) external onlyOwner {
}
function closeMintsOpenBurning() external onlyOwner {
}
function setClaimStatus(bool value) external onlyOwner {
}
function mintPublicSale(uint256 _count) external payable nonReentrant whenPublicSaleActive returns (uint256, uint256) {
}
function allocateFounderMint(address _addr, uint256 _count) public onlyOwner nonReentrant {
}
function founderMint(uint256 _count) public nonReentrant returns (uint256, uint256) {
}
function burnAndMint(uint256[] calldata tokenIds) external nonReentrant whenBurningActive returns(uint256, uint256) {
}
function burn(uint256 tokenId1, uint256 tokenId2) internal {
}
function mint(uint256 tokenId, uint256 resolution) internal {
}
function tokenURI(uint256 _tokenId) public view virtual override returns (string memory) {
}
function claimSweater(uint256 _tokenId) external nonReentrant whenClaimActive returns(address) {
}
function getHighQualityClaimedSweater(uint256 _tokenId) external view returns(string memory) {
require(<FILL_ME>)
if (renderingContractAddress == address(0)) {
return '{"error": "No rendering contract set"}';
}
IOnChainSweatersRenderer renderer = IOnChainSweatersRenderer(renderingContractAddress);
return renderer.getHQClaimedSweater(_tokenId, sweaters[_tokenId], claimedTokenTransactions[_tokenId]);
}
function getDna(uint256 _tokenId) public view returns (uint256) {
}
receive() external payable {}
function withdraw() public onlyOwner {
}
}
| claimedTokenTransactions[_tokenId]!=address(0),"Not yet claimed token" | 29,128 | claimedTokenTransactions[_tokenId]!=address(0) |
"Our supply of Black Boxes has run out" | pragma solidity ^0.8.9;
//Custom Contract for The Black Box Protocol™ (www.blackboxprtcl.io) by Langman Studios© 2022 All rights reserved.
//The Black Box Protocol™ NFTs are governed by the following terms and conditions: https://blackboxprtcl.io/legal/blackboxprtcl_tc
/// Libraries
contract BlackBoxPrtcl is
Ownable,
ERC721,
ERC721Burnable,
ERC721Pausable,
ReentrancyGuard
{
/// Variables
using SafeMath for uint256;
using SafeMath for uint32;
using Strings for uint256;
using Address for address;
using MerkleProof for bytes32[];
using Counters for Counters.Counter;
/// Contract States
enum BoxStatus {
DONOTOPEN,
SOCIETY,
FREEMINT,
STEALTH
}
/// TODO:change
Counters.Counter private _tokenIds;
bytes32 private _merkleRoot;
bool public locked;
bool public revealed;
BoxStatus public _boxStatus;
string private _baseTokenURI;
string private _baseExtension;
string public _notRevealedUri;
address payable private _mintingBeneficiary;
uint32 private _BBOXES;
uint32 private _STEALTH_MINT_LIMIT;
uint256 public PRICE;
mapping(address => bool) private _claimed;
/// Events
event BoxMinted(address indexed to, uint256 indexed tokenId);
event StatusChanged(BoxStatus indexed _boxStatus);
/// Modifiers
modifier onlyIfAvailable(uint32 _amount) {
require(_boxStatus != BoxStatus.DONOTOPEN, "DO NOT OPEN");
require(<FILL_ME>)
require(_amount > 0, "Oh so you dont want ANY boxes");
require(
msg.value == PRICE.mul(_amount),
"Ether sent mismatch with mint price, silly"
);
_;
}
modifier notLocked() {
}
modifier notRevealed() {
}
modifier Revealed() {
}
/// What we imagine might be inside the box, but we didn't open any, so we really don't know
constructor(
string memory name,
string memory symbol,
string memory baseTokenURI,
string memory notRevealedUri,
bytes32 merkleRoot,
address mbeneficiary
) ERC721(name, symbol) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function changeMintCost(uint256 mintCost) public onlyOwner {
}
function Enter(address _to, uint32 _amount) private {
}
/// Society + Free Mint + Blacklisted T1/T2/T3
function freemint(
uint32 _amount,
bytes32[] memory _proof,
uint32 freeTokensAmount,
uint32 tier
) private {
}
/// LET'S GET STEALTHYYYYY
function stealthMint(uint32 _amount) private {
}
function mint(
uint32 _amount,
bytes32[] memory _proof,
uint32 freeTokensAmount,
uint32 tier
) external payable whenNotPaused onlyIfAvailable(_amount) nonReentrant {
}
function adminMint(address to, uint32 _amount)
external
whenNotPaused
nonReentrant
onlyOwner
{
}
/// Gearshift
function setStatus(BoxStatus _status) external onlyOwner {
}
function changeBaseURI(string memory newBaseURI)
public
onlyOwner
notLocked
{
}
function changeNotRevealedURI(string memory newNotRevealedUri)
public
onlyOwner
notRevealed
{
}
function reveal() public onlyOwner notRevealed {
}
function lockMetadata() public onlyOwner notLocked Revealed {
}
function changeMerkleRoot(bytes32 merkleRoot) public onlyOwner {
}
function isAllowedFreeMint(
bytes32[] memory _proof,
uint32 freeTokensAmount,
uint32 tier
) internal view returns (bool) {
}
function currentSupply() external view returns (uint256) {
}
function changeMintBeneficiary(address beneficiary) public onlyOwner {
}
function pause() public virtual onlyOwner {
}
function unpause() public virtual onlyOwner {
}
/// You shouldn't open, you know this, put you can press buttons and I will spit something out
function getContractState()
external
view
returns (
BoxStatus boxStatus_,
uint256 bboxes_,
uint256 price_,
uint256 currentTokenId_,
uint256 boxesLeft_
)
{
}
function hasFreeMint(
address account,
bytes32[] memory _proof,
uint32 freeTokensAmount,
uint32 tier
) external view returns (bool allowedForFreeMint, bool freeTokensClaimed) {
}
function tokenMinted(uint256 _tokenId) public view returns (bool) {
}
function withdrawAll() external payable onlyOwner {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override(ERC721, ERC721Pausable) {
}
/// #thinkoutside #betheutility
}
| (_tokenIds.current()).add(_amount)<=_BBOXES,"Our supply of Black Boxes has run out" | 29,133 | (_tokenIds.current()).add(_amount)<=_BBOXES |
"Art is already revealed" | pragma solidity ^0.8.9;
//Custom Contract for The Black Box Protocol™ (www.blackboxprtcl.io) by Langman Studios© 2022 All rights reserved.
//The Black Box Protocol™ NFTs are governed by the following terms and conditions: https://blackboxprtcl.io/legal/blackboxprtcl_tc
/// Libraries
contract BlackBoxPrtcl is
Ownable,
ERC721,
ERC721Burnable,
ERC721Pausable,
ReentrancyGuard
{
/// Variables
using SafeMath for uint256;
using SafeMath for uint32;
using Strings for uint256;
using Address for address;
using MerkleProof for bytes32[];
using Counters for Counters.Counter;
/// Contract States
enum BoxStatus {
DONOTOPEN,
SOCIETY,
FREEMINT,
STEALTH
}
/// TODO:change
Counters.Counter private _tokenIds;
bytes32 private _merkleRoot;
bool public locked;
bool public revealed;
BoxStatus public _boxStatus;
string private _baseTokenURI;
string private _baseExtension;
string public _notRevealedUri;
address payable private _mintingBeneficiary;
uint32 private _BBOXES;
uint32 private _STEALTH_MINT_LIMIT;
uint256 public PRICE;
mapping(address => bool) private _claimed;
/// Events
event BoxMinted(address indexed to, uint256 indexed tokenId);
event StatusChanged(BoxStatus indexed _boxStatus);
/// Modifiers
modifier onlyIfAvailable(uint32 _amount) {
}
modifier notLocked() {
}
modifier notRevealed() {
require(<FILL_ME>)
_;
}
modifier Revealed() {
}
/// What we imagine might be inside the box, but we didn't open any, so we really don't know
constructor(
string memory name,
string memory symbol,
string memory baseTokenURI,
string memory notRevealedUri,
bytes32 merkleRoot,
address mbeneficiary
) ERC721(name, symbol) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function changeMintCost(uint256 mintCost) public onlyOwner {
}
function Enter(address _to, uint32 _amount) private {
}
/// Society + Free Mint + Blacklisted T1/T2/T3
function freemint(
uint32 _amount,
bytes32[] memory _proof,
uint32 freeTokensAmount,
uint32 tier
) private {
}
/// LET'S GET STEALTHYYYYY
function stealthMint(uint32 _amount) private {
}
function mint(
uint32 _amount,
bytes32[] memory _proof,
uint32 freeTokensAmount,
uint32 tier
) external payable whenNotPaused onlyIfAvailable(_amount) nonReentrant {
}
function adminMint(address to, uint32 _amount)
external
whenNotPaused
nonReentrant
onlyOwner
{
}
/// Gearshift
function setStatus(BoxStatus _status) external onlyOwner {
}
function changeBaseURI(string memory newBaseURI)
public
onlyOwner
notLocked
{
}
function changeNotRevealedURI(string memory newNotRevealedUri)
public
onlyOwner
notRevealed
{
}
function reveal() public onlyOwner notRevealed {
}
function lockMetadata() public onlyOwner notLocked Revealed {
}
function changeMerkleRoot(bytes32 merkleRoot) public onlyOwner {
}
function isAllowedFreeMint(
bytes32[] memory _proof,
uint32 freeTokensAmount,
uint32 tier
) internal view returns (bool) {
}
function currentSupply() external view returns (uint256) {
}
function changeMintBeneficiary(address beneficiary) public onlyOwner {
}
function pause() public virtual onlyOwner {
}
function unpause() public virtual onlyOwner {
}
/// You shouldn't open, you know this, put you can press buttons and I will spit something out
function getContractState()
external
view
returns (
BoxStatus boxStatus_,
uint256 bboxes_,
uint256 price_,
uint256 currentTokenId_,
uint256 boxesLeft_
)
{
}
function hasFreeMint(
address account,
bytes32[] memory _proof,
uint32 freeTokensAmount,
uint32 tier
) external view returns (bool allowedForFreeMint, bool freeTokensClaimed) {
}
function tokenMinted(uint256 _tokenId) public view returns (bool) {
}
function withdrawAll() external payable onlyOwner {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override(ERC721, ERC721Pausable) {
}
/// #thinkoutside #betheutility
}
| !revealed,"Art is already revealed" | 29,133 | !revealed |
"Limit Exceeded, Ser" | pragma solidity ^0.8.9;
//Custom Contract for The Black Box Protocol™ (www.blackboxprtcl.io) by Langman Studios© 2022 All rights reserved.
//The Black Box Protocol™ NFTs are governed by the following terms and conditions: https://blackboxprtcl.io/legal/blackboxprtcl_tc
/// Libraries
contract BlackBoxPrtcl is
Ownable,
ERC721,
ERC721Burnable,
ERC721Pausable,
ReentrancyGuard
{
/// Variables
using SafeMath for uint256;
using SafeMath for uint32;
using Strings for uint256;
using Address for address;
using MerkleProof for bytes32[];
using Counters for Counters.Counter;
/// Contract States
enum BoxStatus {
DONOTOPEN,
SOCIETY,
FREEMINT,
STEALTH
}
/// TODO:change
Counters.Counter private _tokenIds;
bytes32 private _merkleRoot;
bool public locked;
bool public revealed;
BoxStatus public _boxStatus;
string private _baseTokenURI;
string private _baseExtension;
string public _notRevealedUri;
address payable private _mintingBeneficiary;
uint32 private _BBOXES;
uint32 private _STEALTH_MINT_LIMIT;
uint256 public PRICE;
mapping(address => bool) private _claimed;
/// Events
event BoxMinted(address indexed to, uint256 indexed tokenId);
event StatusChanged(BoxStatus indexed _boxStatus);
/// Modifiers
modifier onlyIfAvailable(uint32 _amount) {
}
modifier notLocked() {
}
modifier notRevealed() {
}
modifier Revealed() {
}
/// What we imagine might be inside the box, but we didn't open any, so we really don't know
constructor(
string memory name,
string memory symbol,
string memory baseTokenURI,
string memory notRevealedUri,
bytes32 merkleRoot,
address mbeneficiary
) ERC721(name, symbol) {
}
function _baseURI() internal view virtual override returns (string memory) {
}
function tokenURI(uint256 tokenId)
public
view
virtual
override
returns (string memory)
{
}
function changeMintCost(uint256 mintCost) public onlyOwner {
}
function Enter(address _to, uint32 _amount) private {
}
/// Society + Free Mint + Blacklisted T1/T2/T3
function freemint(
uint32 _amount,
bytes32[] memory _proof,
uint32 freeTokensAmount,
uint32 tier
) private {
require(
_boxStatus >= BoxStatus(tier),
"please wait the next sale phase to mint"
);
if (_claimed[msg.sender]) {
require(<FILL_ME>)
Enter(msg.sender, _amount);
} else {
require(
balanceOf(msg.sender).add(_amount) <= 10,
"Limit Exceeded, Ser"
);
isAllowedFreeMint(_proof, freeTokensAmount, tier);
_claimed[msg.sender] = true;
Enter(msg.sender, uint32(_amount.add(freeTokensAmount)));
}
}
/// LET'S GET STEALTHYYYYY
function stealthMint(uint32 _amount) private {
}
function mint(
uint32 _amount,
bytes32[] memory _proof,
uint32 freeTokensAmount,
uint32 tier
) external payable whenNotPaused onlyIfAvailable(_amount) nonReentrant {
}
function adminMint(address to, uint32 _amount)
external
whenNotPaused
nonReentrant
onlyOwner
{
}
/// Gearshift
function setStatus(BoxStatus _status) external onlyOwner {
}
function changeBaseURI(string memory newBaseURI)
public
onlyOwner
notLocked
{
}
function changeNotRevealedURI(string memory newNotRevealedUri)
public
onlyOwner
notRevealed
{
}
function reveal() public onlyOwner notRevealed {
}
function lockMetadata() public onlyOwner notLocked Revealed {
}
function changeMerkleRoot(bytes32 merkleRoot) public onlyOwner {
}
function isAllowedFreeMint(
bytes32[] memory _proof,
uint32 freeTokensAmount,
uint32 tier
) internal view returns (bool) {
}
function currentSupply() external view returns (uint256) {
}
function changeMintBeneficiary(address beneficiary) public onlyOwner {
}
function pause() public virtual onlyOwner {
}
function unpause() public virtual onlyOwner {
}
/// You shouldn't open, you know this, put you can press buttons and I will spit something out
function getContractState()
external
view
returns (
BoxStatus boxStatus_,
uint256 bboxes_,
uint256 price_,
uint256 currentTokenId_,
uint256 boxesLeft_
)
{
}
function hasFreeMint(
address account,
bytes32[] memory _proof,
uint32 freeTokensAmount,
uint32 tier
) external view returns (bool allowedForFreeMint, bool freeTokensClaimed) {
}
function tokenMinted(uint256 _tokenId) public view returns (bool) {
}
function withdrawAll() external payable onlyOwner {
}
function _beforeTokenTransfer(
address from,
address to,
uint256 tokenId
) internal virtual override(ERC721, ERC721Pausable) {
}
/// #thinkoutside #betheutility
}
| balanceOf(msg.sender).add(_amount)<=10+freeTokensAmount,"Limit Exceeded, Ser" | 29,133 | balanceOf(msg.sender).add(_amount)<=10+freeTokensAmount |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.