comment
stringlengths
1
211
input
stringlengths
155
20k
label
stringlengths
4
1k
original_idx
int64
203
514k
predicate
stringlengths
1
1k
"NOT_START_ROLLOVER_ROLE"
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; import "../interfaces/IManager.sol"; import "../interfaces/ILiquidityPool.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import {IERC20Upgradeable as IERC20} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import {SafeERC20Upgradeable as SafeERC20} from "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol"; import {EnumerableSetUpgradeable as EnumerableSet} from "@openzeppelin/contracts-upgradeable/utils/EnumerableSetUpgradeable.sol"; import {SafeMathUpgradeable as SafeMath} from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import {AccessControlUpgradeable as AccessControl} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "../interfaces/events/Destinations.sol"; import "../interfaces/events/CycleRolloverEvent.sol"; import "../interfaces/events/IEventSender.sol"; //solhint-disable not-rely-on-time //solhint-disable var-name-mixedcase contract Manager is IManager, Initializable, AccessControl, IEventSender { using SafeMath for uint256; using SafeERC20 for IERC20; using Address for address; using EnumerableSet for EnumerableSet.AddressSet; using EnumerableSet for EnumerableSet.Bytes32Set; bytes32 public immutable ADMIN_ROLE = keccak256("ADMIN_ROLE"); bytes32 public immutable ROLLOVER_ROLE = keccak256("ROLLOVER_ROLE"); bytes32 public immutable MID_CYCLE_ROLE = keccak256("MID_CYCLE_ROLE"); bytes32 public immutable START_ROLLOVER_ROLE = keccak256("START_ROLLOVER_ROLE"); uint256 public currentCycle; // Start timestamp of current cycle uint256 public currentCycleIndex; // Uint representing current cycle uint256 public cycleDuration; // Cycle duration in seconds bool public rolloverStarted; // Bytes32 controller id => controller address mapping(bytes32 => address) public registeredControllers; // Cycle index => ipfs rewards hash mapping(uint256 => string) public override cycleRewardsHashes; EnumerableSet.AddressSet private pools; EnumerableSet.Bytes32Set private controllerIds; // Reentrancy Guard bool private _entered; bool public _eventSend; Destinations public destinations; uint256 public nextCycleStartTime; bool private isLogicContract; modifier onlyAdmin() { } modifier onlyRollover() { } modifier onlyMidCycle() { } modifier nonReentrant() { } modifier onEventSend() { } modifier onlyStartRollover() { require(<FILL_ME>) _; } constructor() public { } function initialize(uint256 _cycleDuration, uint256 _nextCycleStartTime) public initializer { } function registerController(bytes32 id, address controller) external override onlyAdmin { } function unRegisterController(bytes32 id) external override onlyAdmin { } function registerPool(address pool) external override onlyAdmin { } function unRegisterPool(address pool) external override onlyAdmin { } function setCycleDuration(uint256 duration) external override onlyAdmin { } function setNextCycleStartTime(uint256 _nextCycleStartTime) public override onlyAdmin { } function getPools() external view override returns (address[] memory) { } function getControllers() external view override returns (bytes32[] memory) { } function completeRollover(string calldata rewardsIpfsHash) external override onlyRollover { } /// @notice Used for mid-cycle adjustments function executeMaintenance(MaintenanceExecution calldata params) external override onlyMidCycle nonReentrant { } function executeRollover(RolloverExecution calldata params) external override onlyRollover nonReentrant { } function sweep(address[] calldata poolAddresses) external override onlyRollover { } function _executeControllerCommand(ControllerTransferData calldata transfer) private { } function startCycleRollover() external override onlyStartRollover { } function _completeRollover(string calldata rewardsIpfsHash) private { } function getCurrentCycle() external view override returns (uint256) { } function getCycleDuration() external view override returns (uint256) { } function getCurrentCycleIndex() external view override returns (uint256) { } function getRolloverStatus() external view override returns (bool) { } function setDestinations(address _fxStateSender, address _destinationOnL2) external override onlyAdmin { } function setEventSend(bool _eventSendSet) external override onlyAdmin { } function setupRole(bytes32 role) external override onlyAdmin { } function encodeAndSendData(bytes32 _eventSig) private onEventSend { } }
hasRole(START_ROLLOVER_ROLE,_msgSender()),"NOT_START_ROLLOVER_ROLE"
392,959
hasRole(START_ROLLOVER_ROLE,_msgSender())
"ADD_FAIL"
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; import "../interfaces/IManager.sol"; import "../interfaces/ILiquidityPool.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import {IERC20Upgradeable as IERC20} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import {SafeERC20Upgradeable as SafeERC20} from "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol"; import {EnumerableSetUpgradeable as EnumerableSet} from "@openzeppelin/contracts-upgradeable/utils/EnumerableSetUpgradeable.sol"; import {SafeMathUpgradeable as SafeMath} from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import {AccessControlUpgradeable as AccessControl} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "../interfaces/events/Destinations.sol"; import "../interfaces/events/CycleRolloverEvent.sol"; import "../interfaces/events/IEventSender.sol"; //solhint-disable not-rely-on-time //solhint-disable var-name-mixedcase contract Manager is IManager, Initializable, AccessControl, IEventSender { using SafeMath for uint256; using SafeERC20 for IERC20; using Address for address; using EnumerableSet for EnumerableSet.AddressSet; using EnumerableSet for EnumerableSet.Bytes32Set; bytes32 public immutable ADMIN_ROLE = keccak256("ADMIN_ROLE"); bytes32 public immutable ROLLOVER_ROLE = keccak256("ROLLOVER_ROLE"); bytes32 public immutable MID_CYCLE_ROLE = keccak256("MID_CYCLE_ROLE"); bytes32 public immutable START_ROLLOVER_ROLE = keccak256("START_ROLLOVER_ROLE"); uint256 public currentCycle; // Start timestamp of current cycle uint256 public currentCycleIndex; // Uint representing current cycle uint256 public cycleDuration; // Cycle duration in seconds bool public rolloverStarted; // Bytes32 controller id => controller address mapping(bytes32 => address) public registeredControllers; // Cycle index => ipfs rewards hash mapping(uint256 => string) public override cycleRewardsHashes; EnumerableSet.AddressSet private pools; EnumerableSet.Bytes32Set private controllerIds; // Reentrancy Guard bool private _entered; bool public _eventSend; Destinations public destinations; uint256 public nextCycleStartTime; bool private isLogicContract; modifier onlyAdmin() { } modifier onlyRollover() { } modifier onlyMidCycle() { } modifier nonReentrant() { } modifier onEventSend() { } modifier onlyStartRollover() { } constructor() public { } function initialize(uint256 _cycleDuration, uint256 _nextCycleStartTime) public initializer { } function registerController(bytes32 id, address controller) external override onlyAdmin { registeredControllers[id] = controller; require(<FILL_ME>) emit ControllerRegistered(id, controller); } function unRegisterController(bytes32 id) external override onlyAdmin { } function registerPool(address pool) external override onlyAdmin { } function unRegisterPool(address pool) external override onlyAdmin { } function setCycleDuration(uint256 duration) external override onlyAdmin { } function setNextCycleStartTime(uint256 _nextCycleStartTime) public override onlyAdmin { } function getPools() external view override returns (address[] memory) { } function getControllers() external view override returns (bytes32[] memory) { } function completeRollover(string calldata rewardsIpfsHash) external override onlyRollover { } /// @notice Used for mid-cycle adjustments function executeMaintenance(MaintenanceExecution calldata params) external override onlyMidCycle nonReentrant { } function executeRollover(RolloverExecution calldata params) external override onlyRollover nonReentrant { } function sweep(address[] calldata poolAddresses) external override onlyRollover { } function _executeControllerCommand(ControllerTransferData calldata transfer) private { } function startCycleRollover() external override onlyStartRollover { } function _completeRollover(string calldata rewardsIpfsHash) private { } function getCurrentCycle() external view override returns (uint256) { } function getCycleDuration() external view override returns (uint256) { } function getCurrentCycleIndex() external view override returns (uint256) { } function getRolloverStatus() external view override returns (bool) { } function setDestinations(address _fxStateSender, address _destinationOnL2) external override onlyAdmin { } function setEventSend(bool _eventSendSet) external override onlyAdmin { } function setupRole(bytes32 role) external override onlyAdmin { } function encodeAndSendData(bytes32 _eventSig) private onEventSend { } }
controllerIds.add(id),"ADD_FAIL"
392,959
controllerIds.add(id)
"REMOVE_FAIL"
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; import "../interfaces/IManager.sol"; import "../interfaces/ILiquidityPool.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import {IERC20Upgradeable as IERC20} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import {SafeERC20Upgradeable as SafeERC20} from "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol"; import {EnumerableSetUpgradeable as EnumerableSet} from "@openzeppelin/contracts-upgradeable/utils/EnumerableSetUpgradeable.sol"; import {SafeMathUpgradeable as SafeMath} from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import {AccessControlUpgradeable as AccessControl} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "../interfaces/events/Destinations.sol"; import "../interfaces/events/CycleRolloverEvent.sol"; import "../interfaces/events/IEventSender.sol"; //solhint-disable not-rely-on-time //solhint-disable var-name-mixedcase contract Manager is IManager, Initializable, AccessControl, IEventSender { using SafeMath for uint256; using SafeERC20 for IERC20; using Address for address; using EnumerableSet for EnumerableSet.AddressSet; using EnumerableSet for EnumerableSet.Bytes32Set; bytes32 public immutable ADMIN_ROLE = keccak256("ADMIN_ROLE"); bytes32 public immutable ROLLOVER_ROLE = keccak256("ROLLOVER_ROLE"); bytes32 public immutable MID_CYCLE_ROLE = keccak256("MID_CYCLE_ROLE"); bytes32 public immutable START_ROLLOVER_ROLE = keccak256("START_ROLLOVER_ROLE"); uint256 public currentCycle; // Start timestamp of current cycle uint256 public currentCycleIndex; // Uint representing current cycle uint256 public cycleDuration; // Cycle duration in seconds bool public rolloverStarted; // Bytes32 controller id => controller address mapping(bytes32 => address) public registeredControllers; // Cycle index => ipfs rewards hash mapping(uint256 => string) public override cycleRewardsHashes; EnumerableSet.AddressSet private pools; EnumerableSet.Bytes32Set private controllerIds; // Reentrancy Guard bool private _entered; bool public _eventSend; Destinations public destinations; uint256 public nextCycleStartTime; bool private isLogicContract; modifier onlyAdmin() { } modifier onlyRollover() { } modifier onlyMidCycle() { } modifier nonReentrant() { } modifier onEventSend() { } modifier onlyStartRollover() { } constructor() public { } function initialize(uint256 _cycleDuration, uint256 _nextCycleStartTime) public initializer { } function registerController(bytes32 id, address controller) external override onlyAdmin { } function unRegisterController(bytes32 id) external override onlyAdmin { emit ControllerUnregistered(id, registeredControllers[id]); delete registeredControllers[id]; require(<FILL_ME>) } function registerPool(address pool) external override onlyAdmin { } function unRegisterPool(address pool) external override onlyAdmin { } function setCycleDuration(uint256 duration) external override onlyAdmin { } function setNextCycleStartTime(uint256 _nextCycleStartTime) public override onlyAdmin { } function getPools() external view override returns (address[] memory) { } function getControllers() external view override returns (bytes32[] memory) { } function completeRollover(string calldata rewardsIpfsHash) external override onlyRollover { } /// @notice Used for mid-cycle adjustments function executeMaintenance(MaintenanceExecution calldata params) external override onlyMidCycle nonReentrant { } function executeRollover(RolloverExecution calldata params) external override onlyRollover nonReentrant { } function sweep(address[] calldata poolAddresses) external override onlyRollover { } function _executeControllerCommand(ControllerTransferData calldata transfer) private { } function startCycleRollover() external override onlyStartRollover { } function _completeRollover(string calldata rewardsIpfsHash) private { } function getCurrentCycle() external view override returns (uint256) { } function getCycleDuration() external view override returns (uint256) { } function getCurrentCycleIndex() external view override returns (uint256) { } function getRolloverStatus() external view override returns (bool) { } function setDestinations(address _fxStateSender, address _destinationOnL2) external override onlyAdmin { } function setEventSend(bool _eventSendSet) external override onlyAdmin { } function setupRole(bytes32 role) external override onlyAdmin { } function encodeAndSendData(bytes32 _eventSig) private onEventSend { } }
controllerIds.remove(id),"REMOVE_FAIL"
392,959
controllerIds.remove(id)
"ADD_FAIL"
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; import "../interfaces/IManager.sol"; import "../interfaces/ILiquidityPool.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import {IERC20Upgradeable as IERC20} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import {SafeERC20Upgradeable as SafeERC20} from "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol"; import {EnumerableSetUpgradeable as EnumerableSet} from "@openzeppelin/contracts-upgradeable/utils/EnumerableSetUpgradeable.sol"; import {SafeMathUpgradeable as SafeMath} from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import {AccessControlUpgradeable as AccessControl} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "../interfaces/events/Destinations.sol"; import "../interfaces/events/CycleRolloverEvent.sol"; import "../interfaces/events/IEventSender.sol"; //solhint-disable not-rely-on-time //solhint-disable var-name-mixedcase contract Manager is IManager, Initializable, AccessControl, IEventSender { using SafeMath for uint256; using SafeERC20 for IERC20; using Address for address; using EnumerableSet for EnumerableSet.AddressSet; using EnumerableSet for EnumerableSet.Bytes32Set; bytes32 public immutable ADMIN_ROLE = keccak256("ADMIN_ROLE"); bytes32 public immutable ROLLOVER_ROLE = keccak256("ROLLOVER_ROLE"); bytes32 public immutable MID_CYCLE_ROLE = keccak256("MID_CYCLE_ROLE"); bytes32 public immutable START_ROLLOVER_ROLE = keccak256("START_ROLLOVER_ROLE"); uint256 public currentCycle; // Start timestamp of current cycle uint256 public currentCycleIndex; // Uint representing current cycle uint256 public cycleDuration; // Cycle duration in seconds bool public rolloverStarted; // Bytes32 controller id => controller address mapping(bytes32 => address) public registeredControllers; // Cycle index => ipfs rewards hash mapping(uint256 => string) public override cycleRewardsHashes; EnumerableSet.AddressSet private pools; EnumerableSet.Bytes32Set private controllerIds; // Reentrancy Guard bool private _entered; bool public _eventSend; Destinations public destinations; uint256 public nextCycleStartTime; bool private isLogicContract; modifier onlyAdmin() { } modifier onlyRollover() { } modifier onlyMidCycle() { } modifier nonReentrant() { } modifier onEventSend() { } modifier onlyStartRollover() { } constructor() public { } function initialize(uint256 _cycleDuration, uint256 _nextCycleStartTime) public initializer { } function registerController(bytes32 id, address controller) external override onlyAdmin { } function unRegisterController(bytes32 id) external override onlyAdmin { } function registerPool(address pool) external override onlyAdmin { require(<FILL_ME>) emit PoolRegistered(pool); } function unRegisterPool(address pool) external override onlyAdmin { } function setCycleDuration(uint256 duration) external override onlyAdmin { } function setNextCycleStartTime(uint256 _nextCycleStartTime) public override onlyAdmin { } function getPools() external view override returns (address[] memory) { } function getControllers() external view override returns (bytes32[] memory) { } function completeRollover(string calldata rewardsIpfsHash) external override onlyRollover { } /// @notice Used for mid-cycle adjustments function executeMaintenance(MaintenanceExecution calldata params) external override onlyMidCycle nonReentrant { } function executeRollover(RolloverExecution calldata params) external override onlyRollover nonReentrant { } function sweep(address[] calldata poolAddresses) external override onlyRollover { } function _executeControllerCommand(ControllerTransferData calldata transfer) private { } function startCycleRollover() external override onlyStartRollover { } function _completeRollover(string calldata rewardsIpfsHash) private { } function getCurrentCycle() external view override returns (uint256) { } function getCycleDuration() external view override returns (uint256) { } function getCurrentCycleIndex() external view override returns (uint256) { } function getRolloverStatus() external view override returns (bool) { } function setDestinations(address _fxStateSender, address _destinationOnL2) external override onlyAdmin { } function setEventSend(bool _eventSendSet) external override onlyAdmin { } function setupRole(bytes32 role) external override onlyAdmin { } function encodeAndSendData(bytes32 _eventSig) private onEventSend { } }
pools.add(pool),"ADD_FAIL"
392,959
pools.add(pool)
"REMOVE_FAIL"
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; import "../interfaces/IManager.sol"; import "../interfaces/ILiquidityPool.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import {IERC20Upgradeable as IERC20} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import {SafeERC20Upgradeable as SafeERC20} from "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol"; import {EnumerableSetUpgradeable as EnumerableSet} from "@openzeppelin/contracts-upgradeable/utils/EnumerableSetUpgradeable.sol"; import {SafeMathUpgradeable as SafeMath} from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import {AccessControlUpgradeable as AccessControl} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "../interfaces/events/Destinations.sol"; import "../interfaces/events/CycleRolloverEvent.sol"; import "../interfaces/events/IEventSender.sol"; //solhint-disable not-rely-on-time //solhint-disable var-name-mixedcase contract Manager is IManager, Initializable, AccessControl, IEventSender { using SafeMath for uint256; using SafeERC20 for IERC20; using Address for address; using EnumerableSet for EnumerableSet.AddressSet; using EnumerableSet for EnumerableSet.Bytes32Set; bytes32 public immutable ADMIN_ROLE = keccak256("ADMIN_ROLE"); bytes32 public immutable ROLLOVER_ROLE = keccak256("ROLLOVER_ROLE"); bytes32 public immutable MID_CYCLE_ROLE = keccak256("MID_CYCLE_ROLE"); bytes32 public immutable START_ROLLOVER_ROLE = keccak256("START_ROLLOVER_ROLE"); uint256 public currentCycle; // Start timestamp of current cycle uint256 public currentCycleIndex; // Uint representing current cycle uint256 public cycleDuration; // Cycle duration in seconds bool public rolloverStarted; // Bytes32 controller id => controller address mapping(bytes32 => address) public registeredControllers; // Cycle index => ipfs rewards hash mapping(uint256 => string) public override cycleRewardsHashes; EnumerableSet.AddressSet private pools; EnumerableSet.Bytes32Set private controllerIds; // Reentrancy Guard bool private _entered; bool public _eventSend; Destinations public destinations; uint256 public nextCycleStartTime; bool private isLogicContract; modifier onlyAdmin() { } modifier onlyRollover() { } modifier onlyMidCycle() { } modifier nonReentrant() { } modifier onEventSend() { } modifier onlyStartRollover() { } constructor() public { } function initialize(uint256 _cycleDuration, uint256 _nextCycleStartTime) public initializer { } function registerController(bytes32 id, address controller) external override onlyAdmin { } function unRegisterController(bytes32 id) external override onlyAdmin { } function registerPool(address pool) external override onlyAdmin { } function unRegisterPool(address pool) external override onlyAdmin { require(<FILL_ME>) emit PoolUnregistered(pool); } function setCycleDuration(uint256 duration) external override onlyAdmin { } function setNextCycleStartTime(uint256 _nextCycleStartTime) public override onlyAdmin { } function getPools() external view override returns (address[] memory) { } function getControllers() external view override returns (bytes32[] memory) { } function completeRollover(string calldata rewardsIpfsHash) external override onlyRollover { } /// @notice Used for mid-cycle adjustments function executeMaintenance(MaintenanceExecution calldata params) external override onlyMidCycle nonReentrant { } function executeRollover(RolloverExecution calldata params) external override onlyRollover nonReentrant { } function sweep(address[] calldata poolAddresses) external override onlyRollover { } function _executeControllerCommand(ControllerTransferData calldata transfer) private { } function startCycleRollover() external override onlyStartRollover { } function _completeRollover(string calldata rewardsIpfsHash) private { } function getCurrentCycle() external view override returns (uint256) { } function getCycleDuration() external view override returns (uint256) { } function getCurrentCycleIndex() external view override returns (uint256) { } function getRolloverStatus() external view override returns (bool) { } function setDestinations(address _fxStateSender, address _destinationOnL2) external override onlyAdmin { } function setEventSend(bool _eventSendSet) external override onlyAdmin { } function setupRole(bytes32 role) external override onlyAdmin { } function encodeAndSendData(bytes32 _eventSig) private onEventSend { } }
pools.remove(pool),"REMOVE_FAIL"
392,959
pools.remove(pool)
"INVALID_ADDRESS"
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; import "../interfaces/IManager.sol"; import "../interfaces/ILiquidityPool.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import {IERC20Upgradeable as IERC20} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import {SafeERC20Upgradeable as SafeERC20} from "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol"; import {EnumerableSetUpgradeable as EnumerableSet} from "@openzeppelin/contracts-upgradeable/utils/EnumerableSetUpgradeable.sol"; import {SafeMathUpgradeable as SafeMath} from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import {AccessControlUpgradeable as AccessControl} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "../interfaces/events/Destinations.sol"; import "../interfaces/events/CycleRolloverEvent.sol"; import "../interfaces/events/IEventSender.sol"; //solhint-disable not-rely-on-time //solhint-disable var-name-mixedcase contract Manager is IManager, Initializable, AccessControl, IEventSender { using SafeMath for uint256; using SafeERC20 for IERC20; using Address for address; using EnumerableSet for EnumerableSet.AddressSet; using EnumerableSet for EnumerableSet.Bytes32Set; bytes32 public immutable ADMIN_ROLE = keccak256("ADMIN_ROLE"); bytes32 public immutable ROLLOVER_ROLE = keccak256("ROLLOVER_ROLE"); bytes32 public immutable MID_CYCLE_ROLE = keccak256("MID_CYCLE_ROLE"); bytes32 public immutable START_ROLLOVER_ROLE = keccak256("START_ROLLOVER_ROLE"); uint256 public currentCycle; // Start timestamp of current cycle uint256 public currentCycleIndex; // Uint representing current cycle uint256 public cycleDuration; // Cycle duration in seconds bool public rolloverStarted; // Bytes32 controller id => controller address mapping(bytes32 => address) public registeredControllers; // Cycle index => ipfs rewards hash mapping(uint256 => string) public override cycleRewardsHashes; EnumerableSet.AddressSet private pools; EnumerableSet.Bytes32Set private controllerIds; // Reentrancy Guard bool private _entered; bool public _eventSend; Destinations public destinations; uint256 public nextCycleStartTime; bool private isLogicContract; modifier onlyAdmin() { } modifier onlyRollover() { } modifier onlyMidCycle() { } modifier nonReentrant() { } modifier onEventSend() { } modifier onlyStartRollover() { } constructor() public { } function initialize(uint256 _cycleDuration, uint256 _nextCycleStartTime) public initializer { } function registerController(bytes32 id, address controller) external override onlyAdmin { } function unRegisterController(bytes32 id) external override onlyAdmin { } function registerPool(address pool) external override onlyAdmin { } function unRegisterPool(address pool) external override onlyAdmin { } function setCycleDuration(uint256 duration) external override onlyAdmin { } function setNextCycleStartTime(uint256 _nextCycleStartTime) public override onlyAdmin { } function getPools() external view override returns (address[] memory) { } function getControllers() external view override returns (bytes32[] memory) { } function completeRollover(string calldata rewardsIpfsHash) external override onlyRollover { } /// @notice Used for mid-cycle adjustments function executeMaintenance(MaintenanceExecution calldata params) external override onlyMidCycle nonReentrant { } function executeRollover(RolloverExecution calldata params) external override onlyRollover nonReentrant { } function sweep(address[] calldata poolAddresses) external override onlyRollover { uint256 length = poolAddresses.length; uint256[] memory amounts = new uint256[](length); for (uint256 i = 0; i < length; i++) { address currentPoolAddress = poolAddresses[i]; require(<FILL_ME>) IERC20 underlyer = IERC20(ILiquidityPool(currentPoolAddress).underlyer()); uint256 amount = underlyer.balanceOf(address(this)); amounts[i] = amount; if (amount > 0) { underlyer.safeTransfer(currentPoolAddress, amount); } } emit ManagerSwept(poolAddresses, amounts); } function _executeControllerCommand(ControllerTransferData calldata transfer) private { } function startCycleRollover() external override onlyStartRollover { } function _completeRollover(string calldata rewardsIpfsHash) private { } function getCurrentCycle() external view override returns (uint256) { } function getCycleDuration() external view override returns (uint256) { } function getCurrentCycleIndex() external view override returns (uint256) { } function getRolloverStatus() external view override returns (bool) { } function setDestinations(address _fxStateSender, address _destinationOnL2) external override onlyAdmin { } function setEventSend(bool _eventSendSet) external override onlyAdmin { } function setupRole(bytes32 role) external override onlyAdmin { } function encodeAndSendData(bytes32 _eventSig) private onEventSend { } }
pools.contains(currentPoolAddress),"INVALID_ADDRESS"
392,959
pools.contains(currentPoolAddress)
"FORBIDDEN_CALL"
// SPDX-License-Identifier: MIT pragma solidity 0.6.11; pragma experimental ABIEncoderV2; import "../interfaces/IManager.sol"; import "../interfaces/ILiquidityPool.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts-upgradeable/proxy/Initializable.sol"; import {IERC20Upgradeable as IERC20} from "@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol"; import {SafeERC20Upgradeable as SafeERC20} from "@openzeppelin/contracts-upgradeable/token/ERC20/SafeERC20Upgradeable.sol"; import {EnumerableSetUpgradeable as EnumerableSet} from "@openzeppelin/contracts-upgradeable/utils/EnumerableSetUpgradeable.sol"; import {SafeMathUpgradeable as SafeMath} from "@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol"; import {AccessControlUpgradeable as AccessControl} from "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol"; import "../interfaces/events/Destinations.sol"; import "../interfaces/events/CycleRolloverEvent.sol"; import "../interfaces/events/IEventSender.sol"; //solhint-disable not-rely-on-time //solhint-disable var-name-mixedcase contract Manager is IManager, Initializable, AccessControl, IEventSender { using SafeMath for uint256; using SafeERC20 for IERC20; using Address for address; using EnumerableSet for EnumerableSet.AddressSet; using EnumerableSet for EnumerableSet.Bytes32Set; bytes32 public immutable ADMIN_ROLE = keccak256("ADMIN_ROLE"); bytes32 public immutable ROLLOVER_ROLE = keccak256("ROLLOVER_ROLE"); bytes32 public immutable MID_CYCLE_ROLE = keccak256("MID_CYCLE_ROLE"); bytes32 public immutable START_ROLLOVER_ROLE = keccak256("START_ROLLOVER_ROLE"); uint256 public currentCycle; // Start timestamp of current cycle uint256 public currentCycleIndex; // Uint representing current cycle uint256 public cycleDuration; // Cycle duration in seconds bool public rolloverStarted; // Bytes32 controller id => controller address mapping(bytes32 => address) public registeredControllers; // Cycle index => ipfs rewards hash mapping(uint256 => string) public override cycleRewardsHashes; EnumerableSet.AddressSet private pools; EnumerableSet.Bytes32Set private controllerIds; // Reentrancy Guard bool private _entered; bool public _eventSend; Destinations public destinations; uint256 public nextCycleStartTime; bool private isLogicContract; modifier onlyAdmin() { } modifier onlyRollover() { } modifier onlyMidCycle() { } modifier nonReentrant() { } modifier onEventSend() { } modifier onlyStartRollover() { } constructor() public { } function initialize(uint256 _cycleDuration, uint256 _nextCycleStartTime) public initializer { } function registerController(bytes32 id, address controller) external override onlyAdmin { } function unRegisterController(bytes32 id) external override onlyAdmin { } function registerPool(address pool) external override onlyAdmin { } function unRegisterPool(address pool) external override onlyAdmin { } function setCycleDuration(uint256 duration) external override onlyAdmin { } function setNextCycleStartTime(uint256 _nextCycleStartTime) public override onlyAdmin { } function getPools() external view override returns (address[] memory) { } function getControllers() external view override returns (bytes32[] memory) { } function completeRollover(string calldata rewardsIpfsHash) external override onlyRollover { } /// @notice Used for mid-cycle adjustments function executeMaintenance(MaintenanceExecution calldata params) external override onlyMidCycle nonReentrant { } function executeRollover(RolloverExecution calldata params) external override onlyRollover nonReentrant { } function sweep(address[] calldata poolAddresses) external override onlyRollover { } function _executeControllerCommand(ControllerTransferData calldata transfer) private { require(<FILL_ME>) address controllerAddress = registeredControllers[transfer.controllerId]; require(controllerAddress != address(0), "INVALID_CONTROLLER"); controllerAddress.functionDelegateCall(transfer.data, "CYCLE_STEP_EXECUTE_FAILED"); emit DeploymentStepExecuted(transfer.controllerId, controllerAddress, transfer.data); } function startCycleRollover() external override onlyStartRollover { } function _completeRollover(string calldata rewardsIpfsHash) private { } function getCurrentCycle() external view override returns (uint256) { } function getCycleDuration() external view override returns (uint256) { } function getCurrentCycleIndex() external view override returns (uint256) { } function getRolloverStatus() external view override returns (bool) { } function setDestinations(address _fxStateSender, address _destinationOnL2) external override onlyAdmin { } function setEventSend(bool _eventSendSet) external override onlyAdmin { } function setupRole(bytes32 role) external override onlyAdmin { } function encodeAndSendData(bytes32 _eventSig) private onEventSend { } }
!isLogicContract,"FORBIDDEN_CALL"
392,959
!isLogicContract
null
pragma solidity ^0.4.18; // solhint-disable-line // similar as shrimpfarmer, with three changes: // A. one third of your snails die when you sell eggs // B. you can transfer ownership of the devfee through sacrificing snails // C. the "free" 300 snails cost 0.001 eth (in line with the mining fee) // bots should have a harder time, and whales can compete for the devfee // http://ethfish.club/ contract ShrimpFarmer{ //uint256 EGGS_PER_SHRIMP_PER_SECOND=1; uint256 public EGGS_TO_HATCH_1SHRIMP=86400;//for final version should be seconds in a day uint256 public STARTING_SHRIMP=300; uint256 PSN=10000; uint256 PSNH=5000; bool public initialized=false; address public ceoAddress; mapping (address => uint256) public hatcheryShrimp; mapping (address => uint256) public claimedEggs; mapping (address => uint256) public lastHatch; mapping (address => address) public referrals; uint256 public marketEggs; uint256 public snailmasterReq=100000; function ShrimpFarmer() public{ } function becomeSnailmaster() public{ require(initialized); require(<FILL_ME>) //hatcheryShrimp[msg.sender]=SafeMath.sub(hatcheryShrimp[msg.sender],snailmasterReq); //snailmasterReq=SafeMath.add(snailmasterReq,100000);//+100k shrimps each time //ceoAddress=msg.sender; } function hatchEggs(address ref) public{ } function sellEggs() public{ } function buyEggs() public payable{ } //magic trade balancing algorithm function calculateTrade(uint256 rt,uint256 rs, uint256 bs) public view returns(uint256){ } function calculateEggSell(uint256 eggs) public view returns(uint256){ } function calculateEggBuy(uint256 eth,uint256 contractBalance) public view returns(uint256){ } function calculateEggBuySimple(uint256 eth) public view returns(uint256){ } function devFee(uint256 amount) public view returns(uint256){ } function seedMarket(uint256 eggs) public payable{ } function getFreeShrimp() public{ } function getBalance() public view returns(uint256){ } function getMyShrimp() public view returns(uint256){ } function getSnailmasterReq() public view returns(uint256){ } function getMyEggs() public view returns(uint256){ } function getEggsSinceLastHatch(address adr) public view returns(uint256){ } function min(uint256 a, uint256 b) private pure returns (uint256) { } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts 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) { } }
hatcheryShrimp[msg.sender]>=snailmasterReq
393,035
hatcheryShrimp[msg.sender]>=snailmasterReq
null
pragma solidity ^0.4.18; // solhint-disable-line // similar as shrimpfarmer, with three changes: // A. one third of your snails die when you sell eggs // B. you can transfer ownership of the devfee through sacrificing snails // C. the "free" 300 snails cost 0.001 eth (in line with the mining fee) // bots should have a harder time, and whales can compete for the devfee // http://ethfish.club/ contract ShrimpFarmer{ //uint256 EGGS_PER_SHRIMP_PER_SECOND=1; uint256 public EGGS_TO_HATCH_1SHRIMP=86400;//for final version should be seconds in a day uint256 public STARTING_SHRIMP=300; uint256 PSN=10000; uint256 PSNH=5000; bool public initialized=false; address public ceoAddress; mapping (address => uint256) public hatcheryShrimp; mapping (address => uint256) public claimedEggs; mapping (address => uint256) public lastHatch; mapping (address => address) public referrals; uint256 public marketEggs; uint256 public snailmasterReq=100000; function ShrimpFarmer() public{ } function becomeSnailmaster() public{ } function hatchEggs(address ref) public{ } function sellEggs() public{ } function buyEggs() public payable{ } //magic trade balancing algorithm function calculateTrade(uint256 rt,uint256 rs, uint256 bs) public view returns(uint256){ } function calculateEggSell(uint256 eggs) public view returns(uint256){ } function calculateEggBuy(uint256 eth,uint256 contractBalance) public view returns(uint256){ } function calculateEggBuySimple(uint256 eth) public view returns(uint256){ } function devFee(uint256 amount) public view returns(uint256){ } function seedMarket(uint256 eggs) public payable{ } function getFreeShrimp() public{ require(initialized); //require(msg.value==0.001 ether); //similar to mining fee, prevents bots //ceoAddress.transfer(msg.value); //snailmaster gets this entrance fee require(<FILL_ME>) lastHatch[msg.sender]=now; hatcheryShrimp[msg.sender]=STARTING_SHRIMP; } function getBalance() public view returns(uint256){ } function getMyShrimp() public view returns(uint256){ } function getSnailmasterReq() public view returns(uint256){ } function getMyEggs() public view returns(uint256){ } function getEggsSinceLastHatch(address adr) public view returns(uint256){ } function min(uint256 a, uint256 b) private pure returns (uint256) { } } library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Substracts 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) { } }
hatcheryShrimp[msg.sender]==0
393,035
hatcheryShrimp[msg.sender]==0
"Minion::invalid _actionTo"
pragma solidity 0.5.11; contract Minion { // --- Constants --- string public constant MINION_ACTION_DETAILS = '{"isMinion": true, "title":"MINION", "description":"'; // --- State and data structures --- IMoloch public moloch; address public molochApprovedToken; mapping (uint256 => Action) public actions; // proposalId => Action struct Action { uint256 value; address to; address proposer; bool executed; bytes data; } // --- Events --- event ActionProposed(uint256 proposalId, address proposer); event ActionCanceled(uint256 proposalId); event ActionExecuted(uint256 proposalId, address executor); // --- Modifiers --- modifier memberOnly() { } // --- Constructor --- constructor(address _moloch) public { } // --- Fallback function --- function() external payable {} // withdraw funds from the moloch function doWithdraw(address _token, uint256 _amount) public { } function proposeAction( address _actionTo, uint256 _actionValue, bytes calldata _actionData, string calldata _description ) external memberOnly returns (uint256) { // can't call arbitrary functions on parent moloch, and no calls to // zero address allows us to check that Minion submitted // the proposal without getting the proposal struct from the moloch require(<FILL_ME>) string memory details = string(abi.encodePacked(MINION_ACTION_DETAILS, _description, '"}')); uint256 proposalId = moloch.submitProposal( address(this), 0, 0, 0, molochApprovedToken, 0, molochApprovedToken, details ); Action memory action = Action({ value: _actionValue, to: _actionTo, proposer: msg.sender, executed: false, data: _actionData }); actions[proposalId] = action; emit ActionProposed(proposalId, msg.sender); return proposalId; } function cancelAction(uint256 _proposalId) external { } function executeAction(uint256 _proposalId) external returns (bytes memory) { } // --- View functions --- function isMember(address usr) public view returns (bool) { } }
!(_actionTo==address(0)||_actionTo==address(moloch)),"Minion::invalid _actionTo"
393,072
!(_actionTo==address(0)||_actionTo==address(moloch))
"Minion::action executed"
pragma solidity 0.5.11; contract Minion { // --- Constants --- string public constant MINION_ACTION_DETAILS = '{"isMinion": true, "title":"MINION", "description":"'; // --- State and data structures --- IMoloch public moloch; address public molochApprovedToken; mapping (uint256 => Action) public actions; // proposalId => Action struct Action { uint256 value; address to; address proposer; bool executed; bytes data; } // --- Events --- event ActionProposed(uint256 proposalId, address proposer); event ActionCanceled(uint256 proposalId); event ActionExecuted(uint256 proposalId, address executor); // --- Modifiers --- modifier memberOnly() { } // --- Constructor --- constructor(address _moloch) public { } // --- Fallback function --- function() external payable {} // withdraw funds from the moloch function doWithdraw(address _token, uint256 _amount) public { } function proposeAction( address _actionTo, uint256 _actionValue, bytes calldata _actionData, string calldata _description ) external memberOnly returns (uint256) { } function cancelAction(uint256 _proposalId) external { } function executeAction(uint256 _proposalId) external returns (bytes memory) { Action memory action = actions[_proposalId]; bool[6] memory flags = moloch.getProposalFlags(_proposalId); // minion did not submit this proposal require(action.to != address(0), "Minion::invalid _proposalId"); require(<FILL_ME>) require(address(this).balance >= action.value, "Minion::insufficient eth"); require(flags[2], "Minion::proposal not passed"); // execute call actions[_proposalId].executed = true; (bool success, bytes memory retData) = action.to.call.value(action.value)(action.data); require(success, "Minion::call failure"); emit ActionExecuted(_proposalId, msg.sender); return retData; } // --- View functions --- function isMember(address usr) public view returns (bool) { } }
!action.executed,"Minion::action executed"
393,072
!action.executed
"Minion::insufficient eth"
pragma solidity 0.5.11; contract Minion { // --- Constants --- string public constant MINION_ACTION_DETAILS = '{"isMinion": true, "title":"MINION", "description":"'; // --- State and data structures --- IMoloch public moloch; address public molochApprovedToken; mapping (uint256 => Action) public actions; // proposalId => Action struct Action { uint256 value; address to; address proposer; bool executed; bytes data; } // --- Events --- event ActionProposed(uint256 proposalId, address proposer); event ActionCanceled(uint256 proposalId); event ActionExecuted(uint256 proposalId, address executor); // --- Modifiers --- modifier memberOnly() { } // --- Constructor --- constructor(address _moloch) public { } // --- Fallback function --- function() external payable {} // withdraw funds from the moloch function doWithdraw(address _token, uint256 _amount) public { } function proposeAction( address _actionTo, uint256 _actionValue, bytes calldata _actionData, string calldata _description ) external memberOnly returns (uint256) { } function cancelAction(uint256 _proposalId) external { } function executeAction(uint256 _proposalId) external returns (bytes memory) { Action memory action = actions[_proposalId]; bool[6] memory flags = moloch.getProposalFlags(_proposalId); // minion did not submit this proposal require(action.to != address(0), "Minion::invalid _proposalId"); require(!action.executed, "Minion::action executed"); require(<FILL_ME>) require(flags[2], "Minion::proposal not passed"); // execute call actions[_proposalId].executed = true; (bool success, bytes memory retData) = action.to.call.value(action.value)(action.data); require(success, "Minion::call failure"); emit ActionExecuted(_proposalId, msg.sender); return retData; } // --- View functions --- function isMember(address usr) public view returns (bool) { } }
address(this).balance>=action.value,"Minion::insufficient eth"
393,072
address(this).balance>=action.value
"Minion::proposal not passed"
pragma solidity 0.5.11; contract Minion { // --- Constants --- string public constant MINION_ACTION_DETAILS = '{"isMinion": true, "title":"MINION", "description":"'; // --- State and data structures --- IMoloch public moloch; address public molochApprovedToken; mapping (uint256 => Action) public actions; // proposalId => Action struct Action { uint256 value; address to; address proposer; bool executed; bytes data; } // --- Events --- event ActionProposed(uint256 proposalId, address proposer); event ActionCanceled(uint256 proposalId); event ActionExecuted(uint256 proposalId, address executor); // --- Modifiers --- modifier memberOnly() { } // --- Constructor --- constructor(address _moloch) public { } // --- Fallback function --- function() external payable {} // withdraw funds from the moloch function doWithdraw(address _token, uint256 _amount) public { } function proposeAction( address _actionTo, uint256 _actionValue, bytes calldata _actionData, string calldata _description ) external memberOnly returns (uint256) { } function cancelAction(uint256 _proposalId) external { } function executeAction(uint256 _proposalId) external returns (bytes memory) { Action memory action = actions[_proposalId]; bool[6] memory flags = moloch.getProposalFlags(_proposalId); // minion did not submit this proposal require(action.to != address(0), "Minion::invalid _proposalId"); require(!action.executed, "Minion::action executed"); require(address(this).balance >= action.value, "Minion::insufficient eth"); require(<FILL_ME>) // execute call actions[_proposalId].executed = true; (bool success, bytes memory retData) = action.to.call.value(action.value)(action.data); require(success, "Minion::call failure"); emit ActionExecuted(_proposalId, msg.sender); return retData; } // --- View functions --- function isMember(address usr) public view returns (bool) { } }
flags[2],"Minion::proposal not passed"
393,072
flags[2]
null
pragma solidity ^0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } 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) { } } contract ApproveAndCallReceiver { function receiveApproval( address _from, uint256 _amount, address _token, bytes _data ) public; } //normal contract. already compiled as bin contract Controlled { /// @notice The address of the controller is the only address that can call /// a function with this modifier modifier onlyController { } //block for check//bool private initialed = false; address public controller; constructor() public { } /// @notice Changes the controller of the contract /// @param _newController The new controller of the contract function changeController(address _newController) onlyController public { } } //abstract contract. used for interface contract TokenController { /// @notice Called when `_owner` sends ether to the MiniMe Token contract /// @param _owner The address that sent the ether to create tokens /// @return True if the ether is accepted, false if it throws function proxyPayment(address _owner) payable public returns(bool); /// @notice Notifies the controller about a token transfer allowing the /// controller to react if desired /// @param _from The origin of the transfer /// @param _to The destination of the transfer /// @param _amount The amount of the transfer /// @return False if the controller does not authorize the transfer //function onTransfer(address _from, address _to, uint _amount) public returns(bool); /// @notice Notifies the controller about an approval allowing the /// controller to react if desired /// @param _owner The address that calls `approve()` /// @param _spender The spender in the `approve()` call /// @param _amount The amount in the `approve()` call /// @return False if the controller does not authorize the approval //function onApprove(address _owner, address _spender, uint _amount) public returns(bool); } contract ERC20Token { /* This is a slight change to the ERC20 base standard. function totalSupply() constant returns (uint256 supply); is replaced with: uint256 public totalSupply; This automatically creates a getter function for the totalSupply. This is moved to the base contract since public getter functions are not currently recognised as an implementation of the matching abstract function by the compiler. */ /// total amount of tokens uint256 public totalSupply; //function totalSupply() public constant returns (uint256 balance); /// @param _owner The address from which the balance will be retrieved /// @return The balance mapping (address => uint256) public balanceOf; //function balanceOf(address _owner) public constant returns (uint256 balance); /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) public returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); /// @notice `msg.sender` approves `_spender` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of tokens to be approved for transfer /// @return Whether the approval was successful or not function approve(address _spender, uint256 _value) public returns (bool success); /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent mapping (address => mapping (address => uint256)) public allowance; //function allowance(address _owner, address _spender) public constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract TokenI is ERC20Token, Controlled { string public name; //The Token's name: e.g. DigixDAO Tokens uint8 public decimals = 18; //Number of decimals of the smallest unit string public symbol; //An identifier: e.g. REP // ERC20 Methods /// @notice `msg.sender` approves `_spender` to send `_amount` tokens on /// its behalf, and then a function is triggered in the contract that is /// being approved, `_spender`. This allows users to use their tokens to /// interact with contracts in one function call instead of two /// @param _spender The address of the contract able to transfer the tokens /// @param _amount The amount of tokens to be approved for transfer /// @return True if the function call was successful function approveAndCall( address _spender, uint256 _amount, bytes _extraData ) public returns (bool success); // Generate and destroy tokens /// @notice Generates `_amount` tokens that are assigned to `_owner` /// @param _owner The address that will be assigned the new tokens /// @param _amount The quantity of tokens generated /// @return True if the tokens are generated correctly function generateTokens(address _owner, uint _amount) public returns (bool); /// @notice Burns `_amount` tokens from `_owner` /// @param _owner The address that will lose the tokens /// @param _amount The quantity of tokens to burn /// @return True if the tokens are burned correctly function destroyTokens(address _owner, uint _amount) public returns (bool); /// @notice Enables token holders to transfer their tokens freely if true /// @param _transfersEnabled True if transfers are allowed in the clone function enableTransfers(bool _transfersEnabled) public; // Safety Methods /// @notice This method can be used by the controller to extract mistakenly /// sent tokens to this contract. /// @param _tokens The address of the token contract that you want to recover /// set to 0 in case you want to extract ether. function claimTokens(address[] _tokens) public; // Events event ClaimedTokens(address indexed _token, address indexed _controller, uint _amount); } contract Token915 is TokenI { using SafeMath for uint256; address public owner; string public techProvider = "WeYii Tech(https://weyii.co)"; string public officialSite = "https://915club.com"; mapping (uint8 => uint256[]) public freezeOf; //所有数额,地址与数额合并为uint256,位运算拆分。 //解锁信息 uint8 currUnlockStep; //当前解锁step uint256 currUnlockSeq; //当前解锁step 内的游标 mapping (uint8 => bool) public stepUnlockInfo; //所有锁仓,key 使用序号向上增加,value,是否已解锁。 mapping (address => uint256) public freezeOfUser; //用户所有锁仓,方便用户查询自己锁仓余额 //mapping (uint8 => uint32) public lastFreezeSeq; //最后的 freezeOf 键值。key: step; value: sequence mapping (uint8 => uint256) public stepLockend; //key:锁仓step,value:解锁时间 //uint8[] public lockSteps; bool public transfersEnabled = true; /* This generates a public event on the blockchain that will notify clients */ //event Transfer(address indexed from, address indexed to, uint256 value); /* This notifies clients about the amount burnt */ event Burn(address indexed from, uint256 value); /* This notifies clients about the amount frozen */ event Freeze(address indexed from, uint256 value); /* This notifies clients about the amount unfrozen */ event Unfreeze(address indexed from, uint256 value); /* Initializes contract with initial supply tokens to the creator of the contract */ constructor( uint256 initialSupply, string tokenName, string tokenSymbol, address initialOwner ) public { } modifier onlyOwner() { } modifier ownerOrController(){ } modifier transable(){ } modifier ownerOrUser(address user){ } modifier userOrController(address user){ } //要求真实用户 modifier realUser(address user){ } modifier moreThanZero(uint256 _value){ } /// 余额足够 modifier userEnough(address _user, uint256 _amount) { } /// @dev Internal function to determine if an address is a contract /// @param _addr The address being queried /// @return True if `_addr` is a contract function isContract(address _addr) constant internal returns(bool) { } /// @dev Internal function to determine if an address is a contract function addLockStep(uint8 _step, uint _endTime) onlyController external returns(bool) { } /* Send coins */ function transfer(address _to, uint256 _value) realUser(_to) moreThanZero(_value) transable public returns (bool) { } /* Allow another contract to spend some tokens in your behalf */ function approve(address _spender, uint256 _value) transable public returns (bool success) { } /* decreace allowance*/ function unApprove(address _spender, uint256 _value) moreThanZero(_value) transable public returns (bool success) { } /** * @notice `msg.sender` approves `_spender` to send `_amount` tokens on * its behalf, and then a function is triggered in the contract that is * being approved, `_spender`. This allows users to use their tokens to * interact with contracts in one function call instead of two * @param _spender The address of the contract able to transfer the tokens * @param _amount The amount of tokens to be approved for transfer * @return True if the function call was successful */ function approveAndCall(address _spender, uint256 _amount, bytes _extraData) transable public returns (bool success) { } /* A contract attempts to get the coins */ function transferFrom(address _from, address _to, uint256 _value) realUser(_from) realUser(_to) moreThanZero(_value) transable public returns (bool success) { } function transferMulti(address[] _to, uint256[] _value) transable public returns (bool success, uint256 amount){ } function transferMultiSameVaule(address[] _to, uint256 _value) transable public returns (bool){ } //冻结账户 function freeze(address _user, uint256 _value, uint8 _step) moreThanZero(_value) onlyController public returns (bool success) { } //event info(string name, uint32 value); //event info256(string name, uint256 value); //为用户解锁账户资金 function unFreeze(uint8 _step) onlyController public returns (bool unlockOver) { require(<FILL_ME>) require(stepUnlockInfo[_step]==false); uint256[] memory currArr = freezeOf[_step]; currUnlockStep = _step; if(currUnlockSeq==uint256(0)){ currUnlockSeq = currArr.length; } uint256 start = ((currUnlockSeq>99)?(currUnlockSeq-99): 0); uint256 userLockInfo; uint256 _amount; address userAddress; for(uint256 end = currUnlockSeq; end>start; end--){ userLockInfo = freezeOf[_step][end-1]; _amount = userLockInfo&0xFFFFFFFFFFFFFFFFFFFFFFFF; userAddress = address(userLockInfo>>96); balanceOf[userAddress] += _amount; freezeOfUser[userAddress] = freezeOfUser[userAddress].sub(_amount); emit Unfreeze(userAddress, _amount); } if(start==0){ stepUnlockInfo[_step] = true; currUnlockSeq = 0; }else{ currUnlockSeq = start; } return true; } //accept ether function() payable public { } //////////////// // Generate and destroy tokens //////////////// /// @notice Generates `_amount` tokens that are assigned to `_owner` /// @param _user The address that will be assigned the new tokens /// @param _amount The quantity of tokens generated /// @return True if the tokens are generated correctly function generateTokens(address _user, uint _amount) onlyController public returns (bool) { } /// @notice Burns `_amount` tokens from `_owner` /// @param _user The address that will lose the tokens /// @param _amount The quantity of tokens to burn /// @return True if the tokens are burned correctly function destroyTokens(address _user, uint _amount) onlyController userEnough(_user, _amount) public returns (bool) { } function changeOwner(address newOwner) onlyOwner public returns (bool) { } //////////////// // Enable tokens transfers //////////////// /// @notice Enables token holders to transfer their tokens freely if true /// @param _transfersEnabled True if transfers are allowed in the clone function enableTransfers(bool _transfersEnabled) onlyController public { } ////////// // Safety Methods ////////// /// @notice This method can be used by the controller to extract mistakenly /// sent tokens to this contract. /// set to 0 in case you want to extract ether. function claimTokens(address[] tokens) onlyOwner public { } }
stepLockend[_step]<now&&(currUnlockStep==_step||currUnlockSeq==uint256(0))
393,200
stepLockend[_step]<now&&(currUnlockStep==_step||currUnlockSeq==uint256(0))
null
pragma solidity ^0.4.24; library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } 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) { } } contract ApproveAndCallReceiver { function receiveApproval( address _from, uint256 _amount, address _token, bytes _data ) public; } //normal contract. already compiled as bin contract Controlled { /// @notice The address of the controller is the only address that can call /// a function with this modifier modifier onlyController { } //block for check//bool private initialed = false; address public controller; constructor() public { } /// @notice Changes the controller of the contract /// @param _newController The new controller of the contract function changeController(address _newController) onlyController public { } } //abstract contract. used for interface contract TokenController { /// @notice Called when `_owner` sends ether to the MiniMe Token contract /// @param _owner The address that sent the ether to create tokens /// @return True if the ether is accepted, false if it throws function proxyPayment(address _owner) payable public returns(bool); /// @notice Notifies the controller about a token transfer allowing the /// controller to react if desired /// @param _from The origin of the transfer /// @param _to The destination of the transfer /// @param _amount The amount of the transfer /// @return False if the controller does not authorize the transfer //function onTransfer(address _from, address _to, uint _amount) public returns(bool); /// @notice Notifies the controller about an approval allowing the /// controller to react if desired /// @param _owner The address that calls `approve()` /// @param _spender The spender in the `approve()` call /// @param _amount The amount in the `approve()` call /// @return False if the controller does not authorize the approval //function onApprove(address _owner, address _spender, uint _amount) public returns(bool); } contract ERC20Token { /* This is a slight change to the ERC20 base standard. function totalSupply() constant returns (uint256 supply); is replaced with: uint256 public totalSupply; This automatically creates a getter function for the totalSupply. This is moved to the base contract since public getter functions are not currently recognised as an implementation of the matching abstract function by the compiler. */ /// total amount of tokens uint256 public totalSupply; //function totalSupply() public constant returns (uint256 balance); /// @param _owner The address from which the balance will be retrieved /// @return The balance mapping (address => uint256) public balanceOf; //function balanceOf(address _owner) public constant returns (uint256 balance); /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) public returns (bool success); /// @notice send `_value` token to `_to` from `_from` on the condition it is approved by `_from` /// @param _from The address of the sender /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); /// @notice `msg.sender` approves `_spender` to spend `_value` tokens /// @param _spender The address of the account able to transfer the tokens /// @param _value The amount of tokens to be approved for transfer /// @return Whether the approval was successful or not function approve(address _spender, uint256 _value) public returns (bool success); /// @param _owner The address of the account owning tokens /// @param _spender The address of the account able to transfer the tokens /// @return Amount of remaining tokens allowed to spent mapping (address => mapping (address => uint256)) public allowance; //function allowance(address _owner, address _spender) public constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract TokenI is ERC20Token, Controlled { string public name; //The Token's name: e.g. DigixDAO Tokens uint8 public decimals = 18; //Number of decimals of the smallest unit string public symbol; //An identifier: e.g. REP // ERC20 Methods /// @notice `msg.sender` approves `_spender` to send `_amount` tokens on /// its behalf, and then a function is triggered in the contract that is /// being approved, `_spender`. This allows users to use their tokens to /// interact with contracts in one function call instead of two /// @param _spender The address of the contract able to transfer the tokens /// @param _amount The amount of tokens to be approved for transfer /// @return True if the function call was successful function approveAndCall( address _spender, uint256 _amount, bytes _extraData ) public returns (bool success); // Generate and destroy tokens /// @notice Generates `_amount` tokens that are assigned to `_owner` /// @param _owner The address that will be assigned the new tokens /// @param _amount The quantity of tokens generated /// @return True if the tokens are generated correctly function generateTokens(address _owner, uint _amount) public returns (bool); /// @notice Burns `_amount` tokens from `_owner` /// @param _owner The address that will lose the tokens /// @param _amount The quantity of tokens to burn /// @return True if the tokens are burned correctly function destroyTokens(address _owner, uint _amount) public returns (bool); /// @notice Enables token holders to transfer their tokens freely if true /// @param _transfersEnabled True if transfers are allowed in the clone function enableTransfers(bool _transfersEnabled) public; // Safety Methods /// @notice This method can be used by the controller to extract mistakenly /// sent tokens to this contract. /// @param _tokens The address of the token contract that you want to recover /// set to 0 in case you want to extract ether. function claimTokens(address[] _tokens) public; // Events event ClaimedTokens(address indexed _token, address indexed _controller, uint _amount); } contract Token915 is TokenI { using SafeMath for uint256; address public owner; string public techProvider = "WeYii Tech(https://weyii.co)"; string public officialSite = "https://915club.com"; mapping (uint8 => uint256[]) public freezeOf; //所有数额,地址与数额合并为uint256,位运算拆分。 //解锁信息 uint8 currUnlockStep; //当前解锁step uint256 currUnlockSeq; //当前解锁step 内的游标 mapping (uint8 => bool) public stepUnlockInfo; //所有锁仓,key 使用序号向上增加,value,是否已解锁。 mapping (address => uint256) public freezeOfUser; //用户所有锁仓,方便用户查询自己锁仓余额 //mapping (uint8 => uint32) public lastFreezeSeq; //最后的 freezeOf 键值。key: step; value: sequence mapping (uint8 => uint256) public stepLockend; //key:锁仓step,value:解锁时间 //uint8[] public lockSteps; bool public transfersEnabled = true; /* This generates a public event on the blockchain that will notify clients */ //event Transfer(address indexed from, address indexed to, uint256 value); /* This notifies clients about the amount burnt */ event Burn(address indexed from, uint256 value); /* This notifies clients about the amount frozen */ event Freeze(address indexed from, uint256 value); /* This notifies clients about the amount unfrozen */ event Unfreeze(address indexed from, uint256 value); /* Initializes contract with initial supply tokens to the creator of the contract */ constructor( uint256 initialSupply, string tokenName, string tokenSymbol, address initialOwner ) public { } modifier onlyOwner() { } modifier ownerOrController(){ } modifier transable(){ } modifier ownerOrUser(address user){ } modifier userOrController(address user){ } //要求真实用户 modifier realUser(address user){ } modifier moreThanZero(uint256 _value){ } /// 余额足够 modifier userEnough(address _user, uint256 _amount) { } /// @dev Internal function to determine if an address is a contract /// @param _addr The address being queried /// @return True if `_addr` is a contract function isContract(address _addr) constant internal returns(bool) { } /// @dev Internal function to determine if an address is a contract function addLockStep(uint8 _step, uint _endTime) onlyController external returns(bool) { } /* Send coins */ function transfer(address _to, uint256 _value) realUser(_to) moreThanZero(_value) transable public returns (bool) { } /* Allow another contract to spend some tokens in your behalf */ function approve(address _spender, uint256 _value) transable public returns (bool success) { } /* decreace allowance*/ function unApprove(address _spender, uint256 _value) moreThanZero(_value) transable public returns (bool success) { } /** * @notice `msg.sender` approves `_spender` to send `_amount` tokens on * its behalf, and then a function is triggered in the contract that is * being approved, `_spender`. This allows users to use their tokens to * interact with contracts in one function call instead of two * @param _spender The address of the contract able to transfer the tokens * @param _amount The amount of tokens to be approved for transfer * @return True if the function call was successful */ function approveAndCall(address _spender, uint256 _amount, bytes _extraData) transable public returns (bool success) { } /* A contract attempts to get the coins */ function transferFrom(address _from, address _to, uint256 _value) realUser(_from) realUser(_to) moreThanZero(_value) transable public returns (bool success) { } function transferMulti(address[] _to, uint256[] _value) transable public returns (bool success, uint256 amount){ } function transferMultiSameVaule(address[] _to, uint256 _value) transable public returns (bool){ } //冻结账户 function freeze(address _user, uint256 _value, uint8 _step) moreThanZero(_value) onlyController public returns (bool success) { } //event info(string name, uint32 value); //event info256(string name, uint256 value); //为用户解锁账户资金 function unFreeze(uint8 _step) onlyController public returns (bool unlockOver) { require(stepLockend[_step]<now && (currUnlockStep==_step || currUnlockSeq==uint256(0))); require(<FILL_ME>) uint256[] memory currArr = freezeOf[_step]; currUnlockStep = _step; if(currUnlockSeq==uint256(0)){ currUnlockSeq = currArr.length; } uint256 start = ((currUnlockSeq>99)?(currUnlockSeq-99): 0); uint256 userLockInfo; uint256 _amount; address userAddress; for(uint256 end = currUnlockSeq; end>start; end--){ userLockInfo = freezeOf[_step][end-1]; _amount = userLockInfo&0xFFFFFFFFFFFFFFFFFFFFFFFF; userAddress = address(userLockInfo>>96); balanceOf[userAddress] += _amount; freezeOfUser[userAddress] = freezeOfUser[userAddress].sub(_amount); emit Unfreeze(userAddress, _amount); } if(start==0){ stepUnlockInfo[_step] = true; currUnlockSeq = 0; }else{ currUnlockSeq = start; } return true; } //accept ether function() payable public { } //////////////// // Generate and destroy tokens //////////////// /// @notice Generates `_amount` tokens that are assigned to `_owner` /// @param _user The address that will be assigned the new tokens /// @param _amount The quantity of tokens generated /// @return True if the tokens are generated correctly function generateTokens(address _user, uint _amount) onlyController public returns (bool) { } /// @notice Burns `_amount` tokens from `_owner` /// @param _user The address that will lose the tokens /// @param _amount The quantity of tokens to burn /// @return True if the tokens are burned correctly function destroyTokens(address _user, uint _amount) onlyController userEnough(_user, _amount) public returns (bool) { } function changeOwner(address newOwner) onlyOwner public returns (bool) { } //////////////// // Enable tokens transfers //////////////// /// @notice Enables token holders to transfer their tokens freely if true /// @param _transfersEnabled True if transfers are allowed in the clone function enableTransfers(bool _transfersEnabled) onlyController public { } ////////// // Safety Methods ////////// /// @notice This method can be used by the controller to extract mistakenly /// sent tokens to this contract. /// set to 0 in case you want to extract ether. function claimTokens(address[] tokens) onlyOwner public { } }
stepUnlockInfo[_step]==false
393,200
stepUnlockInfo[_step]==false
null
pragma solidity ^0.4.4; contract Token { function totalSupply() constant returns (uint256 supply) {} function balanceOf(address _owner) constant returns (uint256 balance) {} function transfer(address _to, uint256 _value) returns (bool success) {} function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {} function approve(address _spender, uint256 _value) returns (bool success) {} function allowance(address _owner, address _spender) constant returns (uint256 remaining) {} event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract StandardToken is Token { function transfer(address _to, uint256 _value) returns (bool success) { } function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint256 balance) { } function approve(address _spender, uint256 _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { } mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; uint256 public totalSupply; } contract YFLAND is StandardToken { string public name; uint8 public decimals; string public symbol; string public version = 'Y2.1'; Token public usdtToken ; address public contractOwner; uint256 public totalUSDTFarm; uint256 public totalcountUSDTFarm; uint256 public farmRate; uint256 public timeReceiveFarm; struct listFarm { uint256 amount; uint256 timeReceive; } mapping(address => listFarm) public allFarm; address[] private listAddressFarm; constructor( ) public { } function transferUSDTtoContractOwner( uint256 _amount) public returns (bool) { require(msg.sender == contractOwner); require(<FILL_ME>) if(msg.sender == contractOwner && usdtToken.balanceOf(address(this)) >= _amount){ return usdtToken.transfer(contractOwner,_amount); }else{ return false; } } function setTimeReceiveFarm( uint256 _hours) public returns (bool) { } function setFarmRate( uint256 _rate) public returns (bool) { } function getAllFarmAddress()public view returns( address [] memory){ } function removeListAddress( address _addr) private returns (bool) { } function createFarm( uint256 _amount) public returns (bool) { } function getContractUSDTBalance( ) public view returns (uint256) { } function cancelFarm() public returns (bool) { } function receiveFarm() public returns (bool) { } }
usdtToken.balanceOf(address(this))>=_amount
393,253
usdtToken.balanceOf(address(this))>=_amount
null
pragma solidity ^0.4.4; contract Token { function totalSupply() constant returns (uint256 supply) {} function balanceOf(address _owner) constant returns (uint256 balance) {} function transfer(address _to, uint256 _value) returns (bool success) {} function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {} function approve(address _spender, uint256 _value) returns (bool success) {} function allowance(address _owner, address _spender) constant returns (uint256 remaining) {} event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract StandardToken is Token { function transfer(address _to, uint256 _value) returns (bool success) { } function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint256 balance) { } function approve(address _spender, uint256 _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { } mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; uint256 public totalSupply; } contract YFLAND is StandardToken { string public name; uint8 public decimals; string public symbol; string public version = 'Y2.1'; Token public usdtToken ; address public contractOwner; uint256 public totalUSDTFarm; uint256 public totalcountUSDTFarm; uint256 public farmRate; uint256 public timeReceiveFarm; struct listFarm { uint256 amount; uint256 timeReceive; } mapping(address => listFarm) public allFarm; address[] private listAddressFarm; constructor( ) public { } function transferUSDTtoContractOwner( uint256 _amount) public returns (bool) { } function setTimeReceiveFarm( uint256 _hours) public returns (bool) { } function setFarmRate( uint256 _rate) public returns (bool) { } function getAllFarmAddress()public view returns( address [] memory){ } function removeListAddress( address _addr) private returns (bool) { } function createFarm( uint256 _amount) public returns (bool) { require(<FILL_ME>) if(usdtToken.allowance(msg.sender,address(this)) >= _amount){ usdtToken.transferFrom(msg.sender,address(this),_amount); allFarm[msg.sender].amount += _amount; allFarm[msg.sender].timeReceive = now + timeReceiveFarm; removeListAddress(msg.sender); listAddressFarm.push(msg.sender); totalUSDTFarm += _amount; totalcountUSDTFarm++; return true; }else{ return false; } } function getContractUSDTBalance( ) public view returns (uint256) { } function cancelFarm() public returns (bool) { } function receiveFarm() public returns (bool) { } }
usdtToken.allowance(msg.sender,address(this))>=_amount
393,253
usdtToken.allowance(msg.sender,address(this))>=_amount
null
pragma solidity ^0.4.4; contract Token { function totalSupply() constant returns (uint256 supply) {} function balanceOf(address _owner) constant returns (uint256 balance) {} function transfer(address _to, uint256 _value) returns (bool success) {} function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {} function approve(address _spender, uint256 _value) returns (bool success) {} function allowance(address _owner, address _spender) constant returns (uint256 remaining) {} event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract StandardToken is Token { function transfer(address _to, uint256 _value) returns (bool success) { } function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint256 balance) { } function approve(address _spender, uint256 _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { } mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; uint256 public totalSupply; } contract YFLAND is StandardToken { string public name; uint8 public decimals; string public symbol; string public version = 'Y2.1'; Token public usdtToken ; address public contractOwner; uint256 public totalUSDTFarm; uint256 public totalcountUSDTFarm; uint256 public farmRate; uint256 public timeReceiveFarm; struct listFarm { uint256 amount; uint256 timeReceive; } mapping(address => listFarm) public allFarm; address[] private listAddressFarm; constructor( ) public { } function transferUSDTtoContractOwner( uint256 _amount) public returns (bool) { } function setTimeReceiveFarm( uint256 _hours) public returns (bool) { } function setFarmRate( uint256 _rate) public returns (bool) { } function getAllFarmAddress()public view returns( address [] memory){ } function removeListAddress( address _addr) private returns (bool) { } function createFarm( uint256 _amount) public returns (bool) { } function getContractUSDTBalance( ) public view returns (uint256) { } function cancelFarm() public returns (bool) { require(<FILL_ME>) if(allFarm[msg.sender].amount > 0) { totalcountUSDTFarm--; totalUSDTFarm -= allFarm[msg.sender].amount; removeListAddress(msg.sender); usdtToken.transfer(msg.sender , allFarm[msg.sender].amount); allFarm[msg.sender].amount = 0; allFarm[msg.sender].timeReceive = 0; return true; } } function receiveFarm() public returns (bool) { } }
allFarm[msg.sender].amount>0
393,253
allFarm[msg.sender].amount>0
null
pragma solidity ^0.4.4; contract Token { function totalSupply() constant returns (uint256 supply) {} function balanceOf(address _owner) constant returns (uint256 balance) {} function transfer(address _to, uint256 _value) returns (bool success) {} function transferFrom(address _from, address _to, uint256 _value) returns (bool success) {} function approve(address _spender, uint256 _value) returns (bool success) {} function allowance(address _owner, address _spender) constant returns (uint256 remaining) {} event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } contract StandardToken is Token { function transfer(address _to, uint256 _value) returns (bool success) { } function transferFrom(address _from, address _to, uint256 _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint256 balance) { } function approve(address _spender, uint256 _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint256 remaining) { } mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; uint256 public totalSupply; } contract YFLAND is StandardToken { string public name; uint8 public decimals; string public symbol; string public version = 'Y2.1'; Token public usdtToken ; address public contractOwner; uint256 public totalUSDTFarm; uint256 public totalcountUSDTFarm; uint256 public farmRate; uint256 public timeReceiveFarm; struct listFarm { uint256 amount; uint256 timeReceive; } mapping(address => listFarm) public allFarm; address[] private listAddressFarm; constructor( ) public { } function transferUSDTtoContractOwner( uint256 _amount) public returns (bool) { } function setTimeReceiveFarm( uint256 _hours) public returns (bool) { } function setFarmRate( uint256 _rate) public returns (bool) { } function getAllFarmAddress()public view returns( address [] memory){ } function removeListAddress( address _addr) private returns (bool) { } function createFarm( uint256 _amount) public returns (bool) { } function getContractUSDTBalance( ) public view returns (uint256) { } function cancelFarm() public returns (bool) { } function receiveFarm() public returns (bool) { require(allFarm[msg.sender].amount > 0); require(<FILL_ME>) if(allFarm[msg.sender].amount > 0 && allFarm[msg.sender].timeReceive <= now) { StandardToken(address(this)).transfer(msg.sender , allFarm[msg.sender].amount * farmRate / 100); allFarm[msg.sender].timeReceive = now + timeReceiveFarm; return true; } } }
allFarm[msg.sender].timeReceive<=now
393,253
allFarm[msg.sender].timeReceive<=now
null
pragma solidity ^0.4.18; // zeppelin-solidity: 1.8.0 contract DataCenterInterface { function getResult(bytes32 gameId) view public returns (uint16, uint16, uint8); } contract DataCenterAddrResolverInterface { function getAddress() public returns (address _addr); } contract DataCenterBridge { uint8 constant networkID_auto = 0; uint8 constant networkID_mainnet = 1; uint8 constant networkID_testnet = 3; string public networkName; address public mainnetAddr = 0x6690E2698Bfa407DB697E69a11eA56810454549b; address public testnetAddr = 0x282b192518fc09568de0E66Df8e2533f88C16672; DataCenterAddrResolverInterface DAR; DataCenterInterface dataCenter; modifier dataCenterAPI() { } /** * @dev set network will indicate which net will be used * @notice comment out `networkID` to avoid 'unused parameter' warning */ function setNetwork(uint8 /*networkID*/) internal returns(bool){ } function setNetwork() internal returns(bool){ } function setNetworkName(string _networkName) internal { } function getNetworkName() internal view returns (string) { } function dataCenterGetResult(bytes32 _gameId) dataCenterAPI internal returns (uint16, uint16, uint8){ } function getCodeSize(address _addr) view internal returns (uint _size) { } } /** * @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 public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() 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 { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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) { } } contract Bet is Ownable, DataCenterBridge { using SafeMath for uint; event LogDistributeReward(address addr, uint reward, uint index); event LogGameResult(bytes32 indexed category, bytes32 indexed gameId, uint leftPts, uint rightPts); event LogParticipant(address addr, uint choice, uint betAmount); event LogRefund(address addr, uint betAmount); event LogBetClosed(bool isRefund, uint timestamp); event LogDealerWithdraw(address addr, uint withdrawAmount); /** * @desc * gameId: is a fixed string just like "0021701030" * the full gameId encode(include football, basketball, esports..) will publish on github * leftOdds: need divide 100, if odds is 216 means 2.16 * middleOdds: need divide 100, if odds is 175 means 1.75 * rightOdds: need divide 100, if odds is 250 means 2.50 * spread: need sub 0.5, if spread is 1 means 0.5, 0 means no spread * flag: indicate which team get spread, 1 means leftTeam, 3 means rightTeam */ struct BetInfo { bytes32 category; bytes32 gameId; uint8 spread; uint8 flag; uint16 leftOdds; uint16 middleOdds; uint16 rightOdds; uint minimumBet; uint startTime; uint deposit; address dealer; } struct Player { uint betAmount; uint choice; } /** * @desc * winChoice: Indicate the winner choice of this betting * 1 means leftTeam win, 3 means rightTeam win, 2 means draw(leftTeam is not always equivalent to the home team) */ uint8 public winChoice; uint8 public confirmations = 0; uint8 public neededConfirmations = 1; uint16 public leftPts; uint16 public rightPts; bool public isBetClosed = false; uint public totalBetAmount = 0; uint public leftAmount; uint public middleAmount; uint public rightAmount; uint public numberOfBet; address [] public players; mapping(address => Player) public playerInfo; /** * @dev Throws if called by any account other than the dealer */ modifier onlyDealer() { } function() payable public {} BetInfo betInfo; function Bet(address _dealer, bytes32 _category, bytes32 _gameId, uint _minimumBet, uint8 _spread, uint16 _leftOdds, uint16 _middleOdds, uint16 _rightOdds, uint8 _flag, uint _startTime, uint8 _neededConfirmations, address _owner) payable public { } /** * @dev get basic information of this bet */ function getBetInfo() public view returns (bytes32, bytes32, uint8, uint8, uint16, uint16, uint16, uint, uint, uint, address) { } /** * @dev get basic information of this bet * * uint public numberOfBet; * uint public totalBetAmount = 0; * uint public leftAmount; * uint public middleAmount; * uint public rightAmount; * uint public deposit; */ function getBetMutableData() public view returns (uint, uint, uint, uint, uint, uint) { } /** * @dev get bet result information * * uint8 public winChoice; * uint8 public confirmations = 0; * uint8 public neededConfirmations = 1; * uint16 public leftPts; * uint16 public rightPts; * bool public isBetClosed = false; */ function getBetResult() public view returns (uint8, uint8, uint8, uint16, uint16, bool) { } /** * @dev calculate the gas whichdistribute rewards will cost * set default gasPrice is 5000000000 */ function getRefundTxFee() public view returns (uint) { } /** * @dev find a player has participanted or not * @param player the address of the participant */ function checkPlayerExists(address player) public view returns (bool) { } /** * @dev to check the dealer is solvent or not * @param choice indicate which team user choose * @param amount indicate how many ether user bet */ function isSolvent(uint choice, uint amount) internal view returns (bool) { } /** * @dev update this bet some state * @param choice indicate which team user choose * @param amount indicate how many ether user bet */ function updateAmountOfEachChoice(uint choice, uint amount) internal { } /** * @dev place a bet with his/her choice * @param choice indicate which team user choose */ function placeBet(uint choice) public payable { require(now < betInfo.startTime); require(choice == 1 || choice == 2 || choice == 3); require(msg.value >= betInfo.minimumBet); require(<FILL_ME>) if (!isSolvent(choice, msg.value)) { revert(); } playerInfo[msg.sender].betAmount = msg.value; playerInfo[msg.sender].choice = choice; totalBetAmount = totalBetAmount.add(msg.value); numberOfBet = numberOfBet.add(1); updateAmountOfEachChoice(choice, msg.value); players.push(msg.sender); LogParticipant(msg.sender, choice, msg.value); } /** * @dev in order to let more people participant, dealer can recharge */ function rechargeDeposit() public payable { } /** * @dev given game result, _return win choice by specific spread */ function getWinChoice(uint _leftPts, uint _rightPts) public view returns (uint8) { } /** * @dev manualCloseBet could only be called by owner, * this method only be used for ropsten, * when ethereum-events-data deployed, * game result should not be upload by owner */ function manualCloseBet(uint16 _leftPts, uint16 _rightPts) onlyOwner external { } /** * @dev closeBet could be called by everyone, but owner/dealer should to this. */ function closeBet() external { } /** * @dev get the players */ function getPlayers() view public returns (address[]) { } /** * @dev get contract balance */ function getBalance() view public returns (uint) { } /** * @dev if there are some reasons lead game postpone or cancel * the bet will also cancel and refund every bet */ function refund() onlyOwner public { } /** * @dev dealer can withdraw the remain ether after refund or closed */ function withdraw() internal { } /** * @dev distribute ether to every winner as they choosed odds */ function distributeReward(uint winOdds) internal { } } contract BetCenter is Ownable { mapping(bytes32 => Bet[]) public bets; mapping(bytes32 => bytes32[]) public gameIds; event LogCreateBet(address indexed dealerAddr, address betAddr, bytes32 indexed category, uint indexed startTime); function() payable public {} function createBet(bytes32 category, bytes32 gameId, uint minimumBet, uint8 spread, uint16 leftOdds, uint16 middleOdds, uint16 rightOdds, uint8 flag, uint startTime, uint8 confirmations) payable public { } /** * @dev fetch bets use category * @param category Indicate the sports events type */ function getBetsByCategory(bytes32 category) view public returns (Bet[]) { } function getGameIdsByCategory(bytes32 category) view public returns (bytes32 []) { } }
!checkPlayerExists(msg.sender)
393,266
!checkPlayerExists(msg.sender)
null
pragma solidity ^0.4.18; // zeppelin-solidity: 1.8.0 contract DataCenterInterface { function getResult(bytes32 gameId) view public returns (uint16, uint16, uint8); } contract DataCenterAddrResolverInterface { function getAddress() public returns (address _addr); } contract DataCenterBridge { uint8 constant networkID_auto = 0; uint8 constant networkID_mainnet = 1; uint8 constant networkID_testnet = 3; string public networkName; address public mainnetAddr = 0x6690E2698Bfa407DB697E69a11eA56810454549b; address public testnetAddr = 0x282b192518fc09568de0E66Df8e2533f88C16672; DataCenterAddrResolverInterface DAR; DataCenterInterface dataCenter; modifier dataCenterAPI() { } /** * @dev set network will indicate which net will be used * @notice comment out `networkID` to avoid 'unused parameter' warning */ function setNetwork(uint8 /*networkID*/) internal returns(bool){ } function setNetwork() internal returns(bool){ } function setNetworkName(string _networkName) internal { } function getNetworkName() internal view returns (string) { } function dataCenterGetResult(bytes32 _gameId) dataCenterAPI internal returns (uint16, uint16, uint8){ } function getCodeSize(address _addr) view internal returns (uint _size) { } } /** * @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 public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() 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 { } } /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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) { } } contract Bet is Ownable, DataCenterBridge { using SafeMath for uint; event LogDistributeReward(address addr, uint reward, uint index); event LogGameResult(bytes32 indexed category, bytes32 indexed gameId, uint leftPts, uint rightPts); event LogParticipant(address addr, uint choice, uint betAmount); event LogRefund(address addr, uint betAmount); event LogBetClosed(bool isRefund, uint timestamp); event LogDealerWithdraw(address addr, uint withdrawAmount); /** * @desc * gameId: is a fixed string just like "0021701030" * the full gameId encode(include football, basketball, esports..) will publish on github * leftOdds: need divide 100, if odds is 216 means 2.16 * middleOdds: need divide 100, if odds is 175 means 1.75 * rightOdds: need divide 100, if odds is 250 means 2.50 * spread: need sub 0.5, if spread is 1 means 0.5, 0 means no spread * flag: indicate which team get spread, 1 means leftTeam, 3 means rightTeam */ struct BetInfo { bytes32 category; bytes32 gameId; uint8 spread; uint8 flag; uint16 leftOdds; uint16 middleOdds; uint16 rightOdds; uint minimumBet; uint startTime; uint deposit; address dealer; } struct Player { uint betAmount; uint choice; } /** * @desc * winChoice: Indicate the winner choice of this betting * 1 means leftTeam win, 3 means rightTeam win, 2 means draw(leftTeam is not always equivalent to the home team) */ uint8 public winChoice; uint8 public confirmations = 0; uint8 public neededConfirmations = 1; uint16 public leftPts; uint16 public rightPts; bool public isBetClosed = false; uint public totalBetAmount = 0; uint public leftAmount; uint public middleAmount; uint public rightAmount; uint public numberOfBet; address [] public players; mapping(address => Player) public playerInfo; /** * @dev Throws if called by any account other than the dealer */ modifier onlyDealer() { } function() payable public {} BetInfo betInfo; function Bet(address _dealer, bytes32 _category, bytes32 _gameId, uint _minimumBet, uint8 _spread, uint16 _leftOdds, uint16 _middleOdds, uint16 _rightOdds, uint8 _flag, uint _startTime, uint8 _neededConfirmations, address _owner) payable public { } /** * @dev get basic information of this bet */ function getBetInfo() public view returns (bytes32, bytes32, uint8, uint8, uint16, uint16, uint16, uint, uint, uint, address) { } /** * @dev get basic information of this bet * * uint public numberOfBet; * uint public totalBetAmount = 0; * uint public leftAmount; * uint public middleAmount; * uint public rightAmount; * uint public deposit; */ function getBetMutableData() public view returns (uint, uint, uint, uint, uint, uint) { } /** * @dev get bet result information * * uint8 public winChoice; * uint8 public confirmations = 0; * uint8 public neededConfirmations = 1; * uint16 public leftPts; * uint16 public rightPts; * bool public isBetClosed = false; */ function getBetResult() public view returns (uint8, uint8, uint8, uint16, uint16, bool) { } /** * @dev calculate the gas whichdistribute rewards will cost * set default gasPrice is 5000000000 */ function getRefundTxFee() public view returns (uint) { } /** * @dev find a player has participanted or not * @param player the address of the participant */ function checkPlayerExists(address player) public view returns (bool) { } /** * @dev to check the dealer is solvent or not * @param choice indicate which team user choose * @param amount indicate how many ether user bet */ function isSolvent(uint choice, uint amount) internal view returns (bool) { } /** * @dev update this bet some state * @param choice indicate which team user choose * @param amount indicate how many ether user bet */ function updateAmountOfEachChoice(uint choice, uint amount) internal { } /** * @dev place a bet with his/her choice * @param choice indicate which team user choose */ function placeBet(uint choice) public payable { } /** * @dev in order to let more people participant, dealer can recharge */ function rechargeDeposit() public payable { } /** * @dev given game result, _return win choice by specific spread */ function getWinChoice(uint _leftPts, uint _rightPts) public view returns (uint8) { } /** * @dev manualCloseBet could only be called by owner, * this method only be used for ropsten, * when ethereum-events-data deployed, * game result should not be upload by owner */ function manualCloseBet(uint16 _leftPts, uint16 _rightPts) onlyOwner external { require(<FILL_ME>) leftPts = _leftPts; rightPts = _rightPts; LogGameResult(betInfo.category, betInfo.gameId, leftPts, rightPts); winChoice = getWinChoice(leftPts, rightPts); if (winChoice == 1) { distributeReward(betInfo.leftOdds); } else if (winChoice == 2) { distributeReward(betInfo.middleOdds); } else { distributeReward(betInfo.rightOdds); } isBetClosed = true; LogBetClosed(false, now); withdraw(); } /** * @dev closeBet could be called by everyone, but owner/dealer should to this. */ function closeBet() external { } /** * @dev get the players */ function getPlayers() view public returns (address[]) { } /** * @dev get contract balance */ function getBalance() view public returns (uint) { } /** * @dev if there are some reasons lead game postpone or cancel * the bet will also cancel and refund every bet */ function refund() onlyOwner public { } /** * @dev dealer can withdraw the remain ether after refund or closed */ function withdraw() internal { } /** * @dev distribute ether to every winner as they choosed odds */ function distributeReward(uint winOdds) internal { } } contract BetCenter is Ownable { mapping(bytes32 => Bet[]) public bets; mapping(bytes32 => bytes32[]) public gameIds; event LogCreateBet(address indexed dealerAddr, address betAddr, bytes32 indexed category, uint indexed startTime); function() payable public {} function createBet(bytes32 category, bytes32 gameId, uint minimumBet, uint8 spread, uint16 leftOdds, uint16 middleOdds, uint16 rightOdds, uint8 flag, uint startTime, uint8 confirmations) payable public { } /** * @dev fetch bets use category * @param category Indicate the sports events type */ function getBetsByCategory(bytes32 category) view public returns (Bet[]) { } function getGameIdsByCategory(bytes32 category) view public returns (bytes32 []) { } }
!isBetClosed
393,266
!isBetClosed
"closed sale"
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.10; import {IMirrorOpenSaleV0, IMirrorOpenSaleV0Events} from "./interface/IMirrorOpenSaleV0.sol"; import {Reentrancy} from "../../lib/Reentrancy.sol"; import {IERC165} from "../../lib/ERC165/interface/IERC165.sol"; import {IERC2981} from "../../lib/ERC2981/interface/IERC2981.sol"; import {ITreasuryConfig} from "../../treasury/interface/ITreasuryConfig.sol"; import {IMirrorTreasury} from "../../treasury/interface/IMirrorTreasury.sol"; import {IMirrorFeeRegistry} from "../../fee-registry/MirrorFeeRegistry.sol"; import {IERC721Events} from "../../lib/ERC721/interface/IERC721.sol"; /** * @title MirrorOpenSaleV0 * * @notice The Mirror Open Sale allows anyone to list an ERC721 with a tokenId range. * * Each token will be sold with tokenId incrementing starting at the lower end of the range. * To minimize storage we hash all sale configuration to generate a unique ID and only store * the necessary data that maintains the sale state. * * The token holder must first approve this contract otherwise purchasing will revert. * * The contract forwards the ether payment to the specified recipient and pays an optional fee * to the Mirror Treasury (0x138c3d30a724de380739aad9ec94e59e613a9008). Additionally, sale * royalties are distributed using the NFT Roylaties Standard (EIP-2981). * * @author MirrorXYZ */ contract MirrorOpenSaleV0 is IMirrorOpenSaleV0, IMirrorOpenSaleV0Events, IERC721Events, Reentrancy { /// @notice Version uint8 public constant VERSION = 0; /// @notice Mirror treasury configuration address public immutable override treasuryConfig; /// @notice Mirror fee registry address public immutable override feeRegistry; /// @notice Mirror tributary registry address public immutable override tributaryRegistry; /// @notice Map of sale data hash to sale state mapping(bytes32 => Sale) internal sales_; /// @notice Store configuration and registry addresses as immutable /// @param treasuryConfig_ address for Mirror treasury configuration /// @param feeRegistry_ address for Mirror fee registry /// @param tributaryRegistry_ address for Mirror tributary registry constructor( address treasuryConfig_, address feeRegistry_, address tributaryRegistry_ ) { } /// @notice Get stored state for a specific sale /// @param h keccak256 of sale configuration (see `_getHash`) function sale(bytes32 h) external view override returns (Sale memory) { } /// @notice Register a sale /// @dev only the token itself or the operator can list tokens /// @param saleConfig_ sale configuration function register(SaleConfig calldata saleConfig_) external override { } /// @notice Close a sale /// @dev Reverts if called by an account that does not operate the sale /// @param saleConfig_ sale configuration function close(SaleConfig calldata saleConfig_) external override { } /// @notice Open a sale /// @dev Reverts if called by an account that does not operate the sale /// @param saleConfig_ sale configuration function open(SaleConfig calldata saleConfig_) external override { } /// @notice Purchase a token /// @dev Reverts if the sale configuration does not hash to an open sale, /// not enough ether is sent, he sale is sold out, or if token approval /// has not been granted. Sends funds to the recipient and treasury. /// @param saleConfig_ sale configuration /// @param recipient account that will receive the purchased token function purchase(SaleConfig calldata saleConfig_, address recipient) external payable override nonReentrant { // generate hash of sale data bytes32 h = _getHash(saleConfig_); // retrive stored sale data Sale storage s = sales_[h]; // the registered field serves to assert that the hash maps to // a listed sale and the open field asserts the listed sale is open require(<FILL_ME>) // assert correct amount of eth is received require(msg.value == saleConfig_.price, "incorrect value"); // calculate next tokenId, and increment amount sold uint256 tokenId = saleConfig_.startTokenId + s.sold++; // check that the tokenId is valid require(tokenId <= saleConfig_.endTokenId, "sold out"); // transfer token to recipient IERC721(saleConfig_.token).transferFrom( saleConfig_.operator, recipient, tokenId ); emit Purchase( // h h, // token saleConfig_.token, // tokenId tokenId, // buyer msg.sender, // recipient recipient ); // send funds to recipient and pay fees if necessary _withdraw( saleConfig_.operator, saleConfig_.token, tokenId, h, saleConfig_.recipient, msg.value, saleConfig_.feePercentage ); } // ============ Internal Methods ============ function _feeAmount(uint256 amount, uint256 fee) internal pure returns (uint256) { } function _getHash(SaleConfig calldata saleConfig_) internal pure returns (bytes32) { } function _register(SaleConfig calldata saleConfig_) internal { } function _setSaleStatus(SaleConfig calldata saleConfig_, bool status) internal { } function _withdraw( address operator, address token, uint256 tokenId, bytes32 h, address recipient, uint256 totalAmount, uint256 feePercentage ) internal { } function _royaltyInfo( address token, uint256 tokenId, uint256 amount ) internal view returns (address royaltyRecipient, uint256 royaltyAmount) { } function _send(address payable recipient, uint256 amount) internal { } } interface IERC721 { function transferFrom( address from, address to, uint256 tokenId ) external; }
s.registered&&s.open,"closed sale"
393,333
s.registered&&s.open
"sale already registered"
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.10; import {IMirrorOpenSaleV0, IMirrorOpenSaleV0Events} from "./interface/IMirrorOpenSaleV0.sol"; import {Reentrancy} from "../../lib/Reentrancy.sol"; import {IERC165} from "../../lib/ERC165/interface/IERC165.sol"; import {IERC2981} from "../../lib/ERC2981/interface/IERC2981.sol"; import {ITreasuryConfig} from "../../treasury/interface/ITreasuryConfig.sol"; import {IMirrorTreasury} from "../../treasury/interface/IMirrorTreasury.sol"; import {IMirrorFeeRegistry} from "../../fee-registry/MirrorFeeRegistry.sol"; import {IERC721Events} from "../../lib/ERC721/interface/IERC721.sol"; /** * @title MirrorOpenSaleV0 * * @notice The Mirror Open Sale allows anyone to list an ERC721 with a tokenId range. * * Each token will be sold with tokenId incrementing starting at the lower end of the range. * To minimize storage we hash all sale configuration to generate a unique ID and only store * the necessary data that maintains the sale state. * * The token holder must first approve this contract otherwise purchasing will revert. * * The contract forwards the ether payment to the specified recipient and pays an optional fee * to the Mirror Treasury (0x138c3d30a724de380739aad9ec94e59e613a9008). Additionally, sale * royalties are distributed using the NFT Roylaties Standard (EIP-2981). * * @author MirrorXYZ */ contract MirrorOpenSaleV0 is IMirrorOpenSaleV0, IMirrorOpenSaleV0Events, IERC721Events, Reentrancy { /// @notice Version uint8 public constant VERSION = 0; /// @notice Mirror treasury configuration address public immutable override treasuryConfig; /// @notice Mirror fee registry address public immutable override feeRegistry; /// @notice Mirror tributary registry address public immutable override tributaryRegistry; /// @notice Map of sale data hash to sale state mapping(bytes32 => Sale) internal sales_; /// @notice Store configuration and registry addresses as immutable /// @param treasuryConfig_ address for Mirror treasury configuration /// @param feeRegistry_ address for Mirror fee registry /// @param tributaryRegistry_ address for Mirror tributary registry constructor( address treasuryConfig_, address feeRegistry_, address tributaryRegistry_ ) { } /// @notice Get stored state for a specific sale /// @param h keccak256 of sale configuration (see `_getHash`) function sale(bytes32 h) external view override returns (Sale memory) { } /// @notice Register a sale /// @dev only the token itself or the operator can list tokens /// @param saleConfig_ sale configuration function register(SaleConfig calldata saleConfig_) external override { } /// @notice Close a sale /// @dev Reverts if called by an account that does not operate the sale /// @param saleConfig_ sale configuration function close(SaleConfig calldata saleConfig_) external override { } /// @notice Open a sale /// @dev Reverts if called by an account that does not operate the sale /// @param saleConfig_ sale configuration function open(SaleConfig calldata saleConfig_) external override { } /// @notice Purchase a token /// @dev Reverts if the sale configuration does not hash to an open sale, /// not enough ether is sent, he sale is sold out, or if token approval /// has not been granted. Sends funds to the recipient and treasury. /// @param saleConfig_ sale configuration /// @param recipient account that will receive the purchased token function purchase(SaleConfig calldata saleConfig_, address recipient) external payable override nonReentrant { } // ============ Internal Methods ============ function _feeAmount(uint256 amount, uint256 fee) internal pure returns (uint256) { } function _getHash(SaleConfig calldata saleConfig_) internal pure returns (bytes32) { } function _register(SaleConfig calldata saleConfig_) internal { // get maximum fee from fees registry uint256 maxFee = IMirrorFeeRegistry(feeRegistry).maxFee(); // allow to pay any fee below the max, including no fees require(saleConfig_.feePercentage <= maxFee, "fee too high"); // generate hash of sale data bytes32 h = _getHash(saleConfig_); // assert the sale has not been registered previously require(<FILL_ME>) // store critical sale data sales_[h] = Sale({ registered: true, open: saleConfig_.open, sold: 0, operator: saleConfig_.operator }); // all fields used to generate the hash need to be emitted to store and // generate the hash off-chain for interacting with the sale emit RegisteredSale( // h h, // token saleConfig_.token, // startTokenId saleConfig_.startTokenId, // endTokenId saleConfig_.endTokenId, // operator saleConfig_.operator, // recipient saleConfig_.recipient, // price saleConfig_.price, // open saleConfig_.open, // feePercentage saleConfig_.feePercentage ); if (saleConfig_.open) { emit OpenSale(h); } else { emit CloseSale(h); } } function _setSaleStatus(SaleConfig calldata saleConfig_, bool status) internal { } function _withdraw( address operator, address token, uint256 tokenId, bytes32 h, address recipient, uint256 totalAmount, uint256 feePercentage ) internal { } function _royaltyInfo( address token, uint256 tokenId, uint256 amount ) internal view returns (address royaltyRecipient, uint256 royaltyAmount) { } function _send(address payable recipient, uint256 amount) internal { } } interface IERC721 { function transferFrom( address from, address to, uint256 tokenId ) external; }
!sales_[h].registered,"sale already registered"
393,333
!sales_[h].registered
"unregistered sale"
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.10; import {IMirrorOpenSaleV0, IMirrorOpenSaleV0Events} from "./interface/IMirrorOpenSaleV0.sol"; import {Reentrancy} from "../../lib/Reentrancy.sol"; import {IERC165} from "../../lib/ERC165/interface/IERC165.sol"; import {IERC2981} from "../../lib/ERC2981/interface/IERC2981.sol"; import {ITreasuryConfig} from "../../treasury/interface/ITreasuryConfig.sol"; import {IMirrorTreasury} from "../../treasury/interface/IMirrorTreasury.sol"; import {IMirrorFeeRegistry} from "../../fee-registry/MirrorFeeRegistry.sol"; import {IERC721Events} from "../../lib/ERC721/interface/IERC721.sol"; /** * @title MirrorOpenSaleV0 * * @notice The Mirror Open Sale allows anyone to list an ERC721 with a tokenId range. * * Each token will be sold with tokenId incrementing starting at the lower end of the range. * To minimize storage we hash all sale configuration to generate a unique ID and only store * the necessary data that maintains the sale state. * * The token holder must first approve this contract otherwise purchasing will revert. * * The contract forwards the ether payment to the specified recipient and pays an optional fee * to the Mirror Treasury (0x138c3d30a724de380739aad9ec94e59e613a9008). Additionally, sale * royalties are distributed using the NFT Roylaties Standard (EIP-2981). * * @author MirrorXYZ */ contract MirrorOpenSaleV0 is IMirrorOpenSaleV0, IMirrorOpenSaleV0Events, IERC721Events, Reentrancy { /// @notice Version uint8 public constant VERSION = 0; /// @notice Mirror treasury configuration address public immutable override treasuryConfig; /// @notice Mirror fee registry address public immutable override feeRegistry; /// @notice Mirror tributary registry address public immutable override tributaryRegistry; /// @notice Map of sale data hash to sale state mapping(bytes32 => Sale) internal sales_; /// @notice Store configuration and registry addresses as immutable /// @param treasuryConfig_ address for Mirror treasury configuration /// @param feeRegistry_ address for Mirror fee registry /// @param tributaryRegistry_ address for Mirror tributary registry constructor( address treasuryConfig_, address feeRegistry_, address tributaryRegistry_ ) { } /// @notice Get stored state for a specific sale /// @param h keccak256 of sale configuration (see `_getHash`) function sale(bytes32 h) external view override returns (Sale memory) { } /// @notice Register a sale /// @dev only the token itself or the operator can list tokens /// @param saleConfig_ sale configuration function register(SaleConfig calldata saleConfig_) external override { } /// @notice Close a sale /// @dev Reverts if called by an account that does not operate the sale /// @param saleConfig_ sale configuration function close(SaleConfig calldata saleConfig_) external override { } /// @notice Open a sale /// @dev Reverts if called by an account that does not operate the sale /// @param saleConfig_ sale configuration function open(SaleConfig calldata saleConfig_) external override { } /// @notice Purchase a token /// @dev Reverts if the sale configuration does not hash to an open sale, /// not enough ether is sent, he sale is sold out, or if token approval /// has not been granted. Sends funds to the recipient and treasury. /// @param saleConfig_ sale configuration /// @param recipient account that will receive the purchased token function purchase(SaleConfig calldata saleConfig_, address recipient) external payable override nonReentrant { } // ============ Internal Methods ============ function _feeAmount(uint256 amount, uint256 fee) internal pure returns (uint256) { } function _getHash(SaleConfig calldata saleConfig_) internal pure returns (bytes32) { } function _register(SaleConfig calldata saleConfig_) internal { } function _setSaleStatus(SaleConfig calldata saleConfig_, bool status) internal { bytes32 h = _getHash(saleConfig_); // assert the sale is registered require(<FILL_ME>) require(sales_[h].open != status, "status already set"); sales_[h].open = status; if (status) { emit OpenSale(h); } else { emit CloseSale(h); } } function _withdraw( address operator, address token, uint256 tokenId, bytes32 h, address recipient, uint256 totalAmount, uint256 feePercentage ) internal { } function _royaltyInfo( address token, uint256 tokenId, uint256 amount ) internal view returns (address royaltyRecipient, uint256 royaltyAmount) { } function _send(address payable recipient, uint256 amount) internal { } } interface IERC721 { function transferFrom( address from, address to, uint256 tokenId ) external; }
sales_[h].registered,"unregistered sale"
393,333
sales_[h].registered
"status already set"
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.10; import {IMirrorOpenSaleV0, IMirrorOpenSaleV0Events} from "./interface/IMirrorOpenSaleV0.sol"; import {Reentrancy} from "../../lib/Reentrancy.sol"; import {IERC165} from "../../lib/ERC165/interface/IERC165.sol"; import {IERC2981} from "../../lib/ERC2981/interface/IERC2981.sol"; import {ITreasuryConfig} from "../../treasury/interface/ITreasuryConfig.sol"; import {IMirrorTreasury} from "../../treasury/interface/IMirrorTreasury.sol"; import {IMirrorFeeRegistry} from "../../fee-registry/MirrorFeeRegistry.sol"; import {IERC721Events} from "../../lib/ERC721/interface/IERC721.sol"; /** * @title MirrorOpenSaleV0 * * @notice The Mirror Open Sale allows anyone to list an ERC721 with a tokenId range. * * Each token will be sold with tokenId incrementing starting at the lower end of the range. * To minimize storage we hash all sale configuration to generate a unique ID and only store * the necessary data that maintains the sale state. * * The token holder must first approve this contract otherwise purchasing will revert. * * The contract forwards the ether payment to the specified recipient and pays an optional fee * to the Mirror Treasury (0x138c3d30a724de380739aad9ec94e59e613a9008). Additionally, sale * royalties are distributed using the NFT Roylaties Standard (EIP-2981). * * @author MirrorXYZ */ contract MirrorOpenSaleV0 is IMirrorOpenSaleV0, IMirrorOpenSaleV0Events, IERC721Events, Reentrancy { /// @notice Version uint8 public constant VERSION = 0; /// @notice Mirror treasury configuration address public immutable override treasuryConfig; /// @notice Mirror fee registry address public immutable override feeRegistry; /// @notice Mirror tributary registry address public immutable override tributaryRegistry; /// @notice Map of sale data hash to sale state mapping(bytes32 => Sale) internal sales_; /// @notice Store configuration and registry addresses as immutable /// @param treasuryConfig_ address for Mirror treasury configuration /// @param feeRegistry_ address for Mirror fee registry /// @param tributaryRegistry_ address for Mirror tributary registry constructor( address treasuryConfig_, address feeRegistry_, address tributaryRegistry_ ) { } /// @notice Get stored state for a specific sale /// @param h keccak256 of sale configuration (see `_getHash`) function sale(bytes32 h) external view override returns (Sale memory) { } /// @notice Register a sale /// @dev only the token itself or the operator can list tokens /// @param saleConfig_ sale configuration function register(SaleConfig calldata saleConfig_) external override { } /// @notice Close a sale /// @dev Reverts if called by an account that does not operate the sale /// @param saleConfig_ sale configuration function close(SaleConfig calldata saleConfig_) external override { } /// @notice Open a sale /// @dev Reverts if called by an account that does not operate the sale /// @param saleConfig_ sale configuration function open(SaleConfig calldata saleConfig_) external override { } /// @notice Purchase a token /// @dev Reverts if the sale configuration does not hash to an open sale, /// not enough ether is sent, he sale is sold out, or if token approval /// has not been granted. Sends funds to the recipient and treasury. /// @param saleConfig_ sale configuration /// @param recipient account that will receive the purchased token function purchase(SaleConfig calldata saleConfig_, address recipient) external payable override nonReentrant { } // ============ Internal Methods ============ function _feeAmount(uint256 amount, uint256 fee) internal pure returns (uint256) { } function _getHash(SaleConfig calldata saleConfig_) internal pure returns (bytes32) { } function _register(SaleConfig calldata saleConfig_) internal { } function _setSaleStatus(SaleConfig calldata saleConfig_, bool status) internal { bytes32 h = _getHash(saleConfig_); // assert the sale is registered require(sales_[h].registered, "unregistered sale"); require(<FILL_ME>) sales_[h].open = status; if (status) { emit OpenSale(h); } else { emit CloseSale(h); } } function _withdraw( address operator, address token, uint256 tokenId, bytes32 h, address recipient, uint256 totalAmount, uint256 feePercentage ) internal { } function _royaltyInfo( address token, uint256 tokenId, uint256 amount ) internal view returns (address royaltyRecipient, uint256 royaltyAmount) { } function _send(address payable recipient, uint256 amount) internal { } } interface IERC721 { function transferFrom( address from, address to, uint256 tokenId ) external; }
sales_[h].open!=status,"status already set"
393,333
sales_[h].open!=status
"SUPPLY: qty exceeds total suply"
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "./Assets.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; contract StripperVille is Assets, ERC721 { uint public stripperPrice = 0.095 ether; uint private _maxMint = 0; string public baseTokenURI = 'https://strippervillebackend.herokuapp.com/'; constructor() ERC721("StripperVille", "SpV") {} modifier isMine(uint tokenId){ } modifier canMint(uint qty){ require(<FILL_ME>) _; } function setStripperPrice(uint newPrice) external onlyAdmin { } function setMaxMint(uint newMaxMint) external onlyAdmin { } function buyStripper(uint qty) external payable canMint(qty) { } function giveaway(address to, uint qty) external onlyOwner canMint(qty) { } function _mintTo(address to) internal { } function createClub(string calldata clubName) external onlyAdmin { } function closeClub(uint tokenId) external onlyAdmin { } function reopenClub(uint tokenId) external onlyAdmin { } function setStripperName(uint tokenId, string calldata name) external isMine(tokenId) { } function withdrawAsset(uint tokenId, uint amount) external onlyAdmin { } function getAssetsByOwner(address owner) public view returns (Asset[] memory) { } function setBaseTokenURI(string calldata uri) external onlyOwner { } function _baseURI() internal override view returns (string memory) { } }
(qty+strippersCount)<=stripperSupply,"SUPPLY: qty exceeds total suply"
393,349
(qty+strippersCount)<=stripperSupply
"BUY: wrong value"
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "./Assets.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; contract StripperVille is Assets, ERC721 { uint public stripperPrice = 0.095 ether; uint private _maxMint = 0; string public baseTokenURI = 'https://strippervillebackend.herokuapp.com/'; constructor() ERC721("StripperVille", "SpV") {} modifier isMine(uint tokenId){ } modifier canMint(uint qty){ } function setStripperPrice(uint newPrice) external onlyAdmin { } function setMaxMint(uint newMaxMint) external onlyAdmin { } function buyStripper(uint qty) external payable canMint(qty) { require(<FILL_ME>) require((qty <= _maxMint), "MINT LIMIT: cannot mint more than allowed"); for(uint i=0; i < qty; i++) { _mintTo(_msgSender()); } emit MintStripper(_msgSender(), qty); } function giveaway(address to, uint qty) external onlyOwner canMint(qty) { } function _mintTo(address to) internal { } function createClub(string calldata clubName) external onlyAdmin { } function closeClub(uint tokenId) external onlyAdmin { } function reopenClub(uint tokenId) external onlyAdmin { } function setStripperName(uint tokenId, string calldata name) external isMine(tokenId) { } function withdrawAsset(uint tokenId, uint amount) external onlyAdmin { } function getAssetsByOwner(address owner) public view returns (Asset[] memory) { } function setBaseTokenURI(string calldata uri) external onlyOwner { } function _baseURI() internal override view returns (string memory) { } }
(msg.value==stripperPrice*qty),"BUY: wrong value"
393,349
(msg.value==stripperPrice*qty)
"MINT LIMIT: cannot mint more than allowed"
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "./Assets.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; contract StripperVille is Assets, ERC721 { uint public stripperPrice = 0.095 ether; uint private _maxMint = 0; string public baseTokenURI = 'https://strippervillebackend.herokuapp.com/'; constructor() ERC721("StripperVille", "SpV") {} modifier isMine(uint tokenId){ } modifier canMint(uint qty){ } function setStripperPrice(uint newPrice) external onlyAdmin { } function setMaxMint(uint newMaxMint) external onlyAdmin { } function buyStripper(uint qty) external payable canMint(qty) { require((msg.value == stripperPrice * qty),"BUY: wrong value"); require(<FILL_ME>) for(uint i=0; i < qty; i++) { _mintTo(_msgSender()); } emit MintStripper(_msgSender(), qty); } function giveaway(address to, uint qty) external onlyOwner canMint(qty) { } function _mintTo(address to) internal { } function createClub(string calldata clubName) external onlyAdmin { } function closeClub(uint tokenId) external onlyAdmin { } function reopenClub(uint tokenId) external onlyAdmin { } function setStripperName(uint tokenId, string calldata name) external isMine(tokenId) { } function withdrawAsset(uint tokenId, uint amount) external onlyAdmin { } function getAssetsByOwner(address owner) public view returns (Asset[] memory) { } function setBaseTokenURI(string calldata uri) external onlyOwner { } function _baseURI() internal override view returns (string memory) { } }
(qty<=_maxMint),"MINT LIMIT: cannot mint more than allowed"
393,349
(qty<=_maxMint)
"COIN: Insuficient funds"
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "./Assets.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; contract StripperVille is Assets, ERC721 { uint public stripperPrice = 0.095 ether; uint private _maxMint = 0; string public baseTokenURI = 'https://strippervillebackend.herokuapp.com/'; constructor() ERC721("StripperVille", "SpV") {} modifier isMine(uint tokenId){ } modifier canMint(uint qty){ } function setStripperPrice(uint newPrice) external onlyAdmin { } function setMaxMint(uint newMaxMint) external onlyAdmin { } function buyStripper(uint qty) external payable canMint(qty) { } function giveaway(address to, uint qty) external onlyOwner canMint(qty) { } function _mintTo(address to) internal { } function createClub(string calldata clubName) external onlyAdmin { } function closeClub(uint tokenId) external onlyAdmin { } function reopenClub(uint tokenId) external onlyAdmin { } function setStripperName(uint tokenId, string calldata name) external isMine(tokenId) { (Asset memory asset, uint i) = getAssetByTokenId(tokenId); require(asset.tokenType == STRIPPER, "ASSET: Asset is not a stripper"); require(<FILL_ME>) COIN.buy(namePriceStripper); assets[i].name = name; emit NewAssetName(_msgSender(), tokenId, name); } function withdrawAsset(uint tokenId, uint amount) external onlyAdmin { } function getAssetsByOwner(address owner) public view returns (Asset[] memory) { } function setBaseTokenURI(string calldata uri) external onlyOwner { } function _baseURI() internal override view returns (string memory) { } }
COIN.balanceOf(_msgSender())>=namePriceStripper,"COIN: Insuficient funds"
393,349
COIN.balanceOf(_msgSender())>=namePriceStripper
null
// SPDX-License-Identifier: --🦉-- pragma solidity =0.7.4; import "./ReferralToken.sol"; abstract contract StakingToken is ReferralToken { using SafeMath for uint256; /** * @notice A method for a staker to create a stake * @param _stakedAmount amount of WISE staked. * @param _lockDays amount of days it is locked for. */ function createStake( uint256 _stakedAmount, uint64 _lockDays, address _referrer ) snapshotTrigger public returns (bytes16, uint256, bytes16 referralID) { } /** * @notice A method for a staker to start a stake * @param _staker ... * @param _stakedAmount ... * @param _lockDays ... */ function _createStake( address _staker, uint256 _stakedAmount, uint64 _lockDays, address _referrer ) private returns ( Stake memory _newStake, bytes16 _stakeID, uint64 _startDay ) { } /** * @notice A method for a staker to remove a stake * belonging to his address by providing ID of a stake. * @param _stakeID unique bytes sequence reference to the stake */ function endStake( bytes16 _stakeID ) snapshotTrigger external returns (uint256) { } function _endStake( address _staker, bytes16 _stakeID ) private returns ( Stake storage _stake, uint256 _penalty ) { require(<FILL_ME>) _stake = stakes[_staker][_stakeID]; _stake.closeDay = _currentWiseDay(); _stake.rewardAmount = _calculateRewardAmount(_stake); _stake.isActive = false; _penalty = _detectPenalty(_stake); _mint( _staker, _stake.stakedAmount > _penalty ? _stake.stakedAmount - _penalty : 0 ); _mint( _staker, _stake.rewardAmount ); } /** * @notice alloes to scrape interest from active stake * @param _stakeID unique bytes sequence reference to the stake * @param _scrapeDays amount of days to proccess, 0 = all */ function scrapeInterest( bytes16 _stakeID, uint64 _scrapeDays ) external snapshotTrigger returns ( uint256 scrapeDay, uint256 scrapeAmount, uint256 remainingDays, uint256 stakersPenalty, uint256 referrerPenalty ) { } function _addScheduledShares( uint256 _finalDay, uint256 _shares ) internal { } function _removeScheduledShares( uint256 _finalDay, uint256 _shares ) internal { } function _sharePriceUpdate( uint256 _stakedAmount, uint256 _rewardAmount, address _referrer, uint256 _lockDays, uint256 _stakeShares ) private { } function _getNewSharePrice( uint256 _stakedAmount, uint256 _rewardAmount, uint256 _stakeShares, uint256 _lockDays, address _referrer ) private pure returns (uint256) { } function checkMatureStake( address _staker, bytes16 _stakeID ) external view returns (bool isMature) { } function checkStakeByID( address _staker, bytes16 _stakeID ) external view returns ( uint256 startDay, uint256 lockDays, uint256 finalDay, uint256 daysLeft, uint256 scrapeDay, uint256 stakedAmount, uint256 stakesShares, uint256 rewardAmount, uint256 penaltyAmount, bool isActive, bool isMature ) { } function _stakesShares( uint256 _stakedAmount, uint256 _lockDays, address _referrer, uint256 _sharePrice ) private pure returns (uint256) { } function _sharesAmount( uint256 _stakedAmount, uint256 _lockDays, uint256 _sharePrice, uint256 _extraBonus ) private pure returns (uint256) { } function _getBonus( uint256 _lockDays, uint256 _extraBonus ) private pure returns (uint256) { } function _regularBonus( uint256 _lockDays, uint256 _daily, uint256 _maxDays ) private pure returns (uint256) { } function _baseAmount( uint256 _stakedAmount, uint256 _sharePrice ) private pure returns (uint256) { } function _referrerShares( uint256 _stakedAmount, uint256 _lockDays, address _referrer ) private view returns (uint256) { } function _checkRewardAmount(Stake memory _stake) private view returns (uint256) { } function _detectReward(Stake memory _stake) private view returns (uint256) { } function _detectPenalty(Stake memory _stake) private view returns (uint256) { } function _storePenalty( uint64 _storeDay, uint256 _penalty ) private { } function _calculatePenaltyAmount( Stake memory _stake ) private view returns (uint256) { } function _getPenalties(Stake memory _stake) private view returns (uint256) { } function _calculateRewardAmount( Stake memory _stake ) private view returns (uint256) { } function _loopRewardAmount( uint256 _stakeShares, uint256 _startDay, uint256 _finalDay ) private view returns (uint256 _rewardAmount) { } }
stakes[_staker][_stakeID].isActive
393,449
stakes[_staker][_stakeID].isActive
null
// SPDX-License-Identifier: --🦉-- pragma solidity =0.7.4; import "./ReferralToken.sol"; abstract contract StakingToken is ReferralToken { using SafeMath for uint256; /** * @notice A method for a staker to create a stake * @param _stakedAmount amount of WISE staked. * @param _lockDays amount of days it is locked for. */ function createStake( uint256 _stakedAmount, uint64 _lockDays, address _referrer ) snapshotTrigger public returns (bytes16, uint256, bytes16 referralID) { } /** * @notice A method for a staker to start a stake * @param _staker ... * @param _stakedAmount ... * @param _lockDays ... */ function _createStake( address _staker, uint256 _stakedAmount, uint64 _lockDays, address _referrer ) private returns ( Stake memory _newStake, bytes16 _stakeID, uint64 _startDay ) { } /** * @notice A method for a staker to remove a stake * belonging to his address by providing ID of a stake. * @param _stakeID unique bytes sequence reference to the stake */ function endStake( bytes16 _stakeID ) snapshotTrigger external returns (uint256) { } function _endStake( address _staker, bytes16 _stakeID ) private returns ( Stake storage _stake, uint256 _penalty ) { } /** * @notice alloes to scrape interest from active stake * @param _stakeID unique bytes sequence reference to the stake * @param _scrapeDays amount of days to proccess, 0 = all */ function scrapeInterest( bytes16 _stakeID, uint64 _scrapeDays ) external snapshotTrigger returns ( uint256 scrapeDay, uint256 scrapeAmount, uint256 remainingDays, uint256 stakersPenalty, uint256 referrerPenalty ) { require(<FILL_ME>) Stake memory stake = stakes[msg.sender][_stakeID]; scrapeDay = _scrapeDays > 0 ? _startingDay(stake).add(_scrapeDays) : _calculationDay(stake); scrapeDay = scrapeDay > stake.finalDay ? _calculationDay(stake) : scrapeDay; scrapeAmount = _loopRewardAmount( stake.stakesShares, _startingDay(stake), scrapeDay ); if (_isMatureStake(stake) == false) { remainingDays = _daysLeft(stake); stakersPenalty = _stakesShares( scrapeAmount, remainingDays, msg.sender, globals.sharePrice ); stake.stakesShares = stake.stakesShares.sub(stakersPenalty); _removeScheduledShares( stake.finalDay, stakersPenalty ); if (stake.referrerShares > 0) { referrerPenalty = _stakesShares( scrapeAmount, remainingDays, address(0x0), globals.sharePrice ); stake.referrerShares = stake.referrerShares.sub(referrerPenalty); _removeReferrerSharesToEnd( stake.finalDay, referrerPenalty ); } _decreaseGlobals( 0, stakersPenalty, referrerPenalty ); } _sharePriceUpdate( stake.stakedAmount, scrapeAmount, stake.referrer, stake.lockDays, stake.stakesShares ); stake.scrapeDay = scrapeDay; stakes[msg.sender][_stakeID] = stake; _mint( msg.sender, scrapeAmount ); emit InterestScraped( _stakeID, msg.sender, scrapeAmount, scrapeDay, stakersPenalty, referrerPenalty, _currentWiseDay() ); } function _addScheduledShares( uint256 _finalDay, uint256 _shares ) internal { } function _removeScheduledShares( uint256 _finalDay, uint256 _shares ) internal { } function _sharePriceUpdate( uint256 _stakedAmount, uint256 _rewardAmount, address _referrer, uint256 _lockDays, uint256 _stakeShares ) private { } function _getNewSharePrice( uint256 _stakedAmount, uint256 _rewardAmount, uint256 _stakeShares, uint256 _lockDays, address _referrer ) private pure returns (uint256) { } function checkMatureStake( address _staker, bytes16 _stakeID ) external view returns (bool isMature) { } function checkStakeByID( address _staker, bytes16 _stakeID ) external view returns ( uint256 startDay, uint256 lockDays, uint256 finalDay, uint256 daysLeft, uint256 scrapeDay, uint256 stakedAmount, uint256 stakesShares, uint256 rewardAmount, uint256 penaltyAmount, bool isActive, bool isMature ) { } function _stakesShares( uint256 _stakedAmount, uint256 _lockDays, address _referrer, uint256 _sharePrice ) private pure returns (uint256) { } function _sharesAmount( uint256 _stakedAmount, uint256 _lockDays, uint256 _sharePrice, uint256 _extraBonus ) private pure returns (uint256) { } function _getBonus( uint256 _lockDays, uint256 _extraBonus ) private pure returns (uint256) { } function _regularBonus( uint256 _lockDays, uint256 _daily, uint256 _maxDays ) private pure returns (uint256) { } function _baseAmount( uint256 _stakedAmount, uint256 _sharePrice ) private pure returns (uint256) { } function _referrerShares( uint256 _stakedAmount, uint256 _lockDays, address _referrer ) private view returns (uint256) { } function _checkRewardAmount(Stake memory _stake) private view returns (uint256) { } function _detectReward(Stake memory _stake) private view returns (uint256) { } function _detectPenalty(Stake memory _stake) private view returns (uint256) { } function _storePenalty( uint64 _storeDay, uint256 _penalty ) private { } function _calculatePenaltyAmount( Stake memory _stake ) private view returns (uint256) { } function _getPenalties(Stake memory _stake) private view returns (uint256) { } function _calculateRewardAmount( Stake memory _stake ) private view returns (uint256) { } function _loopRewardAmount( uint256 _stakeShares, uint256 _startDay, uint256 _finalDay ) private view returns (uint256 _rewardAmount) { } }
stakes[msg.sender][_stakeID].isActive
393,449
stakes[msg.sender][_stakeID].isActive
"Account has not opted out"
pragma solidity 0.5.11; /** * @title OUSD Token Contract * @dev ERC20 compatible contract for OUSD * @dev Implements an elastic supply * @author Origin Protocol Inc */ /** * NOTE that this is an ERC20 token but the invariant that the sum of * balanceOf(x) for all x is not >= totalSupply(). This is a consequence of the * rebasing design. Any integrations with OUSD should be aware. */ contract OUSD is Initializable, InitializableERC20Detailed, Governable { using SafeMath for uint256; using StableMath for uint256; event TotalSupplyUpdated( uint256 totalSupply, uint256 rebasingCredits, uint256 rebasingCreditsPerToken ); enum RebaseOptions { NotSet, OptOut, OptIn } uint256 private constant MAX_SUPPLY = ~uint128(0); // (2^128) - 1 uint256 public _totalSupply; mapping(address => mapping(address => uint256)) private _allowances; address public vaultAddress = address(0); mapping(address => uint256) private _creditBalances; uint256 public rebasingCredits; uint256 public rebasingCreditsPerToken; // Frozen address/credits are non rebasing (value is held in contracts which // do not receive yield unless they explicitly opt in) uint256 public nonRebasingSupply; mapping(address => uint256) public nonRebasingCreditsPerToken; mapping(address => RebaseOptions) public rebaseState; function initialize( string calldata _nameArg, string calldata _symbolArg, address _vaultAddress ) external onlyGovernor initializer { } /** * @dev Verifies that the caller is the Savings Manager contract */ modifier onlyVault() { } /** * @return The total supply of OUSD. */ function totalSupply() public view returns (uint256) { } /** * @dev Gets the balance of the specified address. * @param _account Address to query the balance of. * @return A uint256 representing the _amount of base units owned by the * specified address. */ function balanceOf(address _account) public view returns (uint256) { } /** * @dev Gets the credits balance of the specified address. * @param _account The address to query the balance of. * @return (uint256, uint256) Credit balance and credits per token of the * address */ function creditsBalanceOf(address _account) public view returns (uint256, uint256) { } /** * @dev Transfer tokens to a specified address. * @param _to the address to transfer to. * @param _value the _amount to be transferred. * @return true on success. */ function transfer(address _to, uint256 _value) public returns (bool) { } /** * @dev Transfer tokens from one address to another. * @param _from The address you want to send tokens from. * @param _to The address you want to transfer to. * @param _value The _amount of tokens to be transferred. */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { } /** * @dev Update the count of non rebasing credits in response to a transfer * @param _from The address you want to send tokens from. * @param _to The address you want to transfer to. * @param _value Amount of OUSD to transfer */ function _executeTransfer( address _from, address _to, uint256 _value ) internal { } /** * @dev Function to check the _amount of tokens that an owner has allowed to a _spender. * @param _owner The address which owns the funds. * @param _spender The address which will spend the funds. * @return The number of tokens still available for the _spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { } /** * @dev Approve the passed address to spend the specified _amount of tokens on behalf of * msg.sender. This method is included for ERC20 compatibility. * increaseAllowance and decreaseAllowance should be used instead. * Changing an allowance with this method brings the risk that someone may transfer both * the old and the new allowance - if they are both greater than zero - if a transfer * transaction is mined before the later approve() call is mined. * * @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 Increase the _amount of tokens that an owner has allowed to a _spender. * This method should be used instead of approve() to avoid the double approval vulnerability * described above. * @param _spender The address which will spend the funds. * @param _addedValue The _amount of tokens to increase the allowance by. */ function increaseAllowance(address _spender, uint256 _addedValue) public returns (bool) { } /** * @dev Decrease the _amount of tokens that an owner has allowed to a _spender. * @param _spender The address which will spend the funds. * @param _subtractedValue The _amount of tokens to decrease the allowance by. */ function decreaseAllowance(address _spender, uint256 _subtractedValue) public returns (bool) { } /** * @dev Mints new tokens, increasing totalSupply. */ function mint(address _account, uint256 _amount) external onlyVault { } /** * @dev Creates `_amount` tokens and assigns them to `_account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address. */ function _mint(address _account, uint256 _amount) internal nonReentrant { } /** * @dev Burns tokens, decreasing totalSupply. */ function burn(address account, uint256 amount) external onlyVault { } /** * @dev Destroys `_amount` tokens from `_account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `_account` cannot be the zero address. * - `_account` must have at least `_amount` tokens. */ function _burn(address _account, uint256 _amount) internal nonReentrant { } /** * @dev Get the credits per token for an account. Returns a fixed amount * if the account is non-rebasing. * @param _account Address of the account. */ function _creditsPerToken(address _account) internal view returns (uint256) { } /** * @dev Is an account using rebasing accounting or non-rebasing accounting? * Also, ensure contracts are non-rebasing if they have not opted in. * @param _account Address of the account. */ function _isNonRebasingAccount(address _account) internal returns (bool) { } /** * @dev Ensures internal account for rebasing and non-rebasing credits and * supply is updated following deployment of frozen yield change. */ function _ensureRebasingMigration(address _account) internal { } /** * @dev Add a contract address to the non rebasing exception list. I.e. the * address's balance will be part of rebases so the account will be exposed * to upside and downside. */ function rebaseOptIn() public nonReentrant { require(<FILL_ME>) // Convert balance into the same amount at the current exchange rate uint256 newCreditBalance = _creditBalances[msg.sender] .mul(rebasingCreditsPerToken) .div(_creditsPerToken(msg.sender)); // Decreasing non rebasing supply nonRebasingSupply = nonRebasingSupply.sub(balanceOf(msg.sender)); _creditBalances[msg.sender] = newCreditBalance; // Increase rebasing credits, totalSupply remains unchanged so no // adjustment necessary rebasingCredits = rebasingCredits.add(_creditBalances[msg.sender]); rebaseState[msg.sender] = RebaseOptions.OptIn; // Delete any fixed credits per token delete nonRebasingCreditsPerToken[msg.sender]; } /** * @dev Remove a contract address to the non rebasing exception list. */ function rebaseOptOut() public nonReentrant { } /** * @dev Modify the supply without minting new tokens. This uses a change in * the exchange rate between "credits" and OUSD tokens to change balances. * @param _newTotalSupply New total supply of OUSD. * @return uint256 representing the new total supply. */ function changeSupply(uint256 _newTotalSupply) external onlyVault nonReentrant { } }
_isNonRebasingAccount(msg.sender),"Account has not opted out"
393,466
_isNonRebasingAccount(msg.sender)
"Account has not opted in"
pragma solidity 0.5.11; /** * @title OUSD Token Contract * @dev ERC20 compatible contract for OUSD * @dev Implements an elastic supply * @author Origin Protocol Inc */ /** * NOTE that this is an ERC20 token but the invariant that the sum of * balanceOf(x) for all x is not >= totalSupply(). This is a consequence of the * rebasing design. Any integrations with OUSD should be aware. */ contract OUSD is Initializable, InitializableERC20Detailed, Governable { using SafeMath for uint256; using StableMath for uint256; event TotalSupplyUpdated( uint256 totalSupply, uint256 rebasingCredits, uint256 rebasingCreditsPerToken ); enum RebaseOptions { NotSet, OptOut, OptIn } uint256 private constant MAX_SUPPLY = ~uint128(0); // (2^128) - 1 uint256 public _totalSupply; mapping(address => mapping(address => uint256)) private _allowances; address public vaultAddress = address(0); mapping(address => uint256) private _creditBalances; uint256 public rebasingCredits; uint256 public rebasingCreditsPerToken; // Frozen address/credits are non rebasing (value is held in contracts which // do not receive yield unless they explicitly opt in) uint256 public nonRebasingSupply; mapping(address => uint256) public nonRebasingCreditsPerToken; mapping(address => RebaseOptions) public rebaseState; function initialize( string calldata _nameArg, string calldata _symbolArg, address _vaultAddress ) external onlyGovernor initializer { } /** * @dev Verifies that the caller is the Savings Manager contract */ modifier onlyVault() { } /** * @return The total supply of OUSD. */ function totalSupply() public view returns (uint256) { } /** * @dev Gets the balance of the specified address. * @param _account Address to query the balance of. * @return A uint256 representing the _amount of base units owned by the * specified address. */ function balanceOf(address _account) public view returns (uint256) { } /** * @dev Gets the credits balance of the specified address. * @param _account The address to query the balance of. * @return (uint256, uint256) Credit balance and credits per token of the * address */ function creditsBalanceOf(address _account) public view returns (uint256, uint256) { } /** * @dev Transfer tokens to a specified address. * @param _to the address to transfer to. * @param _value the _amount to be transferred. * @return true on success. */ function transfer(address _to, uint256 _value) public returns (bool) { } /** * @dev Transfer tokens from one address to another. * @param _from The address you want to send tokens from. * @param _to The address you want to transfer to. * @param _value The _amount of tokens to be transferred. */ function transferFrom( address _from, address _to, uint256 _value ) public returns (bool) { } /** * @dev Update the count of non rebasing credits in response to a transfer * @param _from The address you want to send tokens from. * @param _to The address you want to transfer to. * @param _value Amount of OUSD to transfer */ function _executeTransfer( address _from, address _to, uint256 _value ) internal { } /** * @dev Function to check the _amount of tokens that an owner has allowed to a _spender. * @param _owner The address which owns the funds. * @param _spender The address which will spend the funds. * @return The number of tokens still available for the _spender. */ function allowance(address _owner, address _spender) public view returns (uint256) { } /** * @dev Approve the passed address to spend the specified _amount of tokens on behalf of * msg.sender. This method is included for ERC20 compatibility. * increaseAllowance and decreaseAllowance should be used instead. * Changing an allowance with this method brings the risk that someone may transfer both * the old and the new allowance - if they are both greater than zero - if a transfer * transaction is mined before the later approve() call is mined. * * @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 Increase the _amount of tokens that an owner has allowed to a _spender. * This method should be used instead of approve() to avoid the double approval vulnerability * described above. * @param _spender The address which will spend the funds. * @param _addedValue The _amount of tokens to increase the allowance by. */ function increaseAllowance(address _spender, uint256 _addedValue) public returns (bool) { } /** * @dev Decrease the _amount of tokens that an owner has allowed to a _spender. * @param _spender The address which will spend the funds. * @param _subtractedValue The _amount of tokens to decrease the allowance by. */ function decreaseAllowance(address _spender, uint256 _subtractedValue) public returns (bool) { } /** * @dev Mints new tokens, increasing totalSupply. */ function mint(address _account, uint256 _amount) external onlyVault { } /** * @dev Creates `_amount` tokens and assigns them to `_account`, increasing * the total supply. * * Emits a {Transfer} event with `from` set to the zero address. * * Requirements * * - `to` cannot be the zero address. */ function _mint(address _account, uint256 _amount) internal nonReentrant { } /** * @dev Burns tokens, decreasing totalSupply. */ function burn(address account, uint256 amount) external onlyVault { } /** * @dev Destroys `_amount` tokens from `_account`, reducing the * total supply. * * Emits a {Transfer} event with `to` set to the zero address. * * Requirements * * - `_account` cannot be the zero address. * - `_account` must have at least `_amount` tokens. */ function _burn(address _account, uint256 _amount) internal nonReentrant { } /** * @dev Get the credits per token for an account. Returns a fixed amount * if the account is non-rebasing. * @param _account Address of the account. */ function _creditsPerToken(address _account) internal view returns (uint256) { } /** * @dev Is an account using rebasing accounting or non-rebasing accounting? * Also, ensure contracts are non-rebasing if they have not opted in. * @param _account Address of the account. */ function _isNonRebasingAccount(address _account) internal returns (bool) { } /** * @dev Ensures internal account for rebasing and non-rebasing credits and * supply is updated following deployment of frozen yield change. */ function _ensureRebasingMigration(address _account) internal { } /** * @dev Add a contract address to the non rebasing exception list. I.e. the * address's balance will be part of rebases so the account will be exposed * to upside and downside. */ function rebaseOptIn() public nonReentrant { } /** * @dev Remove a contract address to the non rebasing exception list. */ function rebaseOptOut() public nonReentrant { require(<FILL_ME>) // Increase non rebasing supply nonRebasingSupply = nonRebasingSupply.add(balanceOf(msg.sender)); // Set fixed credits per token nonRebasingCreditsPerToken[msg.sender] = rebasingCreditsPerToken; // Decrease rebasing credits, total supply remains unchanged so no // adjustment necessary rebasingCredits = rebasingCredits.sub(_creditBalances[msg.sender]); // Mark explicitly opted out of rebasing rebaseState[msg.sender] = RebaseOptions.OptOut; } /** * @dev Modify the supply without minting new tokens. This uses a change in * the exchange rate between "credits" and OUSD tokens to change balances. * @param _newTotalSupply New total supply of OUSD. * @return uint256 representing the new total supply. */ function changeSupply(uint256 _newTotalSupply) external onlyVault nonReentrant { } }
!_isNonRebasingAccount(msg.sender),"Account has not opted in"
393,466
!_isNonRebasingAccount(msg.sender)
"Purchase would exceed max supply of Fecoliths"
pragma solidity >=0.6.0 <0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } } // Fecoliths is a hybrid NFT production with generative avatars and high-quality sketch art. It’s your ticket for access to the art of OnStrike. // https://www.fecoliths.com/ // FECOLITHS TEAM: // Snowflake McGillicuddy - Chief of PR and Social Outreach - @SFlakeMcGil9256 // Onstrike - Starving Artist - @artonstrike // Clint Gunbarrel - Keeping the "Backend" Running - @CGunbarrel // [email protected] pragma solidity ^0.7.0; pragma abicoder v2; contract Fecoliths is ERC721, Ownable { using SafeMath for uint256; string public FECOLITH_PROVENANCE = ""; // IPFS URL WILL BE ADDED WHEN FECOLITHS ARE ALL SOLD OUT string public LICENSE_TEXT = ""; // IT IS WHAT IT SAYS bool licenseLocked = false; // TEAM CAN'T EDIT THE LICENSE AFTER THIS GETS TRUE uint256 public constant fecolithPrice = 42000000000000000; // 0.0420 ETH uint public constant maxFecolithPurchase = 20; uint256 public constant MAX_FECOLITHS = 5000; bool public saleIsActive = false; mapping(uint => string) public fecolithNames; // Reserve 20 Fecoliths for team - Giveaways/Prizes etc uint public fecolithReserve = 50; event fecolithNameChange(address _by, uint _tokenId, string _name); event licenseisLocked(string _licenseText); constructor() ERC721("Fecoliths", "FECO") { } function withdraw() public onlyOwner { } function reserveFecoliths(address _to, uint256 _reserveAmount) public onlyOwner { } function setProvenanceHash(string memory provenanceHash) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function flipSaleState() public onlyOwner { } function tokensOfOwner(address _owner) external view returns(uint256[] memory ) { } // Returns the license for tokens function tokenLicense(uint _id) public view returns(string memory) { } // Locks the license to prevent further changes function lockLicense() public onlyOwner { } // Change the license function changeLicense(string memory _license) public onlyOwner { } function mintFecolith(uint numberOfTokens) public payable { require(saleIsActive, "Sale must be active to mint a Fecolith"); require(numberOfTokens > 0 && numberOfTokens <= maxFecolithPurchase, "Can only mint 20 tokens at a time"); require(<FILL_ME>) require(msg.value >= fecolithPrice.mul(numberOfTokens), "Ether value sent is not correct"); for(uint i = 0; i < numberOfTokens; i++) { uint mintIndex = totalSupply(); if (totalSupply() < MAX_FECOLITHS) { _safeMint(msg.sender, mintIndex); } } } function changeFecolithName(uint _tokenId, string memory _name) public { } function viewFecolithName(uint _tokenId) public view returns( string memory ){ } // GET ALL FECOLITHS OF A WALLET AS AN ARRAY OF STRINGS. function fecolithNamesOfOwner(address _owner) external view returns(string[] memory ) { } }
totalSupply().add(numberOfTokens)<=MAX_FECOLITHS,"Purchase would exceed max supply of Fecoliths"
393,560
totalSupply().add(numberOfTokens)<=MAX_FECOLITHS
"New name is same as the current one"
pragma solidity >=0.6.0 <0.8.0; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { } } // Fecoliths is a hybrid NFT production with generative avatars and high-quality sketch art. It’s your ticket for access to the art of OnStrike. // https://www.fecoliths.com/ // FECOLITHS TEAM: // Snowflake McGillicuddy - Chief of PR and Social Outreach - @SFlakeMcGil9256 // Onstrike - Starving Artist - @artonstrike // Clint Gunbarrel - Keeping the "Backend" Running - @CGunbarrel // [email protected] pragma solidity ^0.7.0; pragma abicoder v2; contract Fecoliths is ERC721, Ownable { using SafeMath for uint256; string public FECOLITH_PROVENANCE = ""; // IPFS URL WILL BE ADDED WHEN FECOLITHS ARE ALL SOLD OUT string public LICENSE_TEXT = ""; // IT IS WHAT IT SAYS bool licenseLocked = false; // TEAM CAN'T EDIT THE LICENSE AFTER THIS GETS TRUE uint256 public constant fecolithPrice = 42000000000000000; // 0.0420 ETH uint public constant maxFecolithPurchase = 20; uint256 public constant MAX_FECOLITHS = 5000; bool public saleIsActive = false; mapping(uint => string) public fecolithNames; // Reserve 20 Fecoliths for team - Giveaways/Prizes etc uint public fecolithReserve = 50; event fecolithNameChange(address _by, uint _tokenId, string _name); event licenseisLocked(string _licenseText); constructor() ERC721("Fecoliths", "FECO") { } function withdraw() public onlyOwner { } function reserveFecoliths(address _to, uint256 _reserveAmount) public onlyOwner { } function setProvenanceHash(string memory provenanceHash) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function flipSaleState() public onlyOwner { } function tokensOfOwner(address _owner) external view returns(uint256[] memory ) { } // Returns the license for tokens function tokenLicense(uint _id) public view returns(string memory) { } // Locks the license to prevent further changes function lockLicense() public onlyOwner { } // Change the license function changeLicense(string memory _license) public onlyOwner { } function mintFecolith(uint numberOfTokens) public payable { } function changeFecolithName(uint _tokenId, string memory _name) public { require(ownerOf(_tokenId) == msg.sender, "Your wallet doesn't own this fecolith!"); require(<FILL_ME>) fecolithNames[_tokenId] = _name; emit fecolithNameChange(msg.sender, _tokenId, _name); } function viewFecolithName(uint _tokenId) public view returns( string memory ){ } // GET ALL FECOLITHS OF A WALLET AS AN ARRAY OF STRINGS. function fecolithNamesOfOwner(address _owner) external view returns(string[] memory ) { } }
sha256(bytes(_name))!=sha256(bytes(fecolithNames[_tokenId])),"New name is same as the current one"
393,560
sha256(bytes(_name))!=sha256(bytes(fecolithNames[_tokenId]))
"would exceed max supply of Apes"
pragma solidity ^0.7.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; /** * @title InvertedApeClub contract * @dev Extends ERC721 Non-Fungible Token Standard basic implementation */ contract InvertedApeClub is ERC721, Ownable { using SafeMath for uint256; /** * @dev Emitted when `tokenId` token is sold from `from` to `to`. */ event Sold(address indexed from, address indexed to, uint256 indexed tokenId, uint256 price); string public INVERTED_PROVENANCE = ""; uint public constant MAX_APES = 10000; address public BAYC_ADDRESS; // Mapping from tokenId to sale price. mapping(uint256 => uint256) public tokenPrices; // Mapping from tokenId to token owner that set the sale price. mapping(uint256 => address) public priceSetters; constructor(string memory name, string memory symbol, address ogAddress) ERC721(name, symbol) { } function withdraw() public onlyOwner { } /* * Set provenance once it's calculated */ function setProvenanceHash(string memory provenanceHash) public onlyOwner { } /** * Mints Inverted Apes */ function mintApe(uint256[] memory tokenIds) public payable { require(<FILL_ME>) ERC721 bayc = ERC721(BAYC_ADDRESS); for (uint i=0; i < tokenIds.length; i++) { bool mintingBurnedApe = (tokenIds[i] == 4885 || tokenIds[i] == 8860); require( (!mintingBurnedApe || msg.sender == owner()), "only contract owner can mint for the burned apes" ); require( (mintingBurnedApe || bayc.ownerOf(tokenIds[i]) == msg.sender), "must own the BAYC ape rights" ); if (totalSupply() < MAX_APES) { _safeMint(msg.sender, tokenIds[i]); } } } /* * @dev Checks that the token owner or the token ID is approved for the Market * @param _tokenId uint256 ID of the token */ modifier ownerMustHaveMarketplaceApproved(uint256 _tokenId) { } /* * @dev Checks that the token is owned by the sender * @param _tokenId uint256 ID of the token */ modifier senderMustBeTokenOwner(uint256 _tokenId) { } /* * @dev Checks that the token is owned by the same person who set the sale price. * @param _tokenId address of the contract storing the token. */ function _priceSetterStillOwnsTheApe(uint256 _tokenId) internal view returns (bool) { } /* * @dev Set the token for sale * @param _tokenId uint256 ID of the token * @param _amount uint256 wei value that the item is for sale */ function setWeiSalePrice(uint256 _tokenId, uint256 _amount) public ownerMustHaveMarketplaceApproved(_tokenId) senderMustBeTokenOwner(_tokenId) { } /* * @dev Purchases the token if it is for sale. * @param _tokenId uint256 ID of the token. */ function buy(uint256 _tokenId) public payable ownerMustHaveMarketplaceApproved(_tokenId) { } /* @dev Internal function to set token price to 0 for a give contract. * @param _tokenId uint256 id of the token. */ function _resetTokenPrice(uint256 _tokenId) internal { } /* @dev Internal function to pay the seller and yacht ape owner. * @param _amount uint256 value to be split. * @param _seller address seller of the token. * @param _tokenId uint256 ID of the token. */ function _payout(uint256 _amount, address payable _seller, uint256 _tokenId) private { } /* * @dev Internal function calculate proportion of a fee for a given amount. * _amount * fee / 100 * @param _amount uint256 value to be split. */ function _calcProportion(uint256 fee, uint256 _amount) internal pure returns (uint256) { } }
totalSupply().add(tokenIds.length)<=MAX_APES,"would exceed max supply of Apes"
393,562
totalSupply().add(tokenIds.length)<=MAX_APES
"only contract owner can mint for the burned apes"
pragma solidity ^0.7.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; /** * @title InvertedApeClub contract * @dev Extends ERC721 Non-Fungible Token Standard basic implementation */ contract InvertedApeClub is ERC721, Ownable { using SafeMath for uint256; /** * @dev Emitted when `tokenId` token is sold from `from` to `to`. */ event Sold(address indexed from, address indexed to, uint256 indexed tokenId, uint256 price); string public INVERTED_PROVENANCE = ""; uint public constant MAX_APES = 10000; address public BAYC_ADDRESS; // Mapping from tokenId to sale price. mapping(uint256 => uint256) public tokenPrices; // Mapping from tokenId to token owner that set the sale price. mapping(uint256 => address) public priceSetters; constructor(string memory name, string memory symbol, address ogAddress) ERC721(name, symbol) { } function withdraw() public onlyOwner { } /* * Set provenance once it's calculated */ function setProvenanceHash(string memory provenanceHash) public onlyOwner { } /** * Mints Inverted Apes */ function mintApe(uint256[] memory tokenIds) public payable { require(totalSupply().add(tokenIds.length) <= MAX_APES, "would exceed max supply of Apes"); ERC721 bayc = ERC721(BAYC_ADDRESS); for (uint i=0; i < tokenIds.length; i++) { bool mintingBurnedApe = (tokenIds[i] == 4885 || tokenIds[i] == 8860); require(<FILL_ME>) require( (mintingBurnedApe || bayc.ownerOf(tokenIds[i]) == msg.sender), "must own the BAYC ape rights" ); if (totalSupply() < MAX_APES) { _safeMint(msg.sender, tokenIds[i]); } } } /* * @dev Checks that the token owner or the token ID is approved for the Market * @param _tokenId uint256 ID of the token */ modifier ownerMustHaveMarketplaceApproved(uint256 _tokenId) { } /* * @dev Checks that the token is owned by the sender * @param _tokenId uint256 ID of the token */ modifier senderMustBeTokenOwner(uint256 _tokenId) { } /* * @dev Checks that the token is owned by the same person who set the sale price. * @param _tokenId address of the contract storing the token. */ function _priceSetterStillOwnsTheApe(uint256 _tokenId) internal view returns (bool) { } /* * @dev Set the token for sale * @param _tokenId uint256 ID of the token * @param _amount uint256 wei value that the item is for sale */ function setWeiSalePrice(uint256 _tokenId, uint256 _amount) public ownerMustHaveMarketplaceApproved(_tokenId) senderMustBeTokenOwner(_tokenId) { } /* * @dev Purchases the token if it is for sale. * @param _tokenId uint256 ID of the token. */ function buy(uint256 _tokenId) public payable ownerMustHaveMarketplaceApproved(_tokenId) { } /* @dev Internal function to set token price to 0 for a give contract. * @param _tokenId uint256 id of the token. */ function _resetTokenPrice(uint256 _tokenId) internal { } /* @dev Internal function to pay the seller and yacht ape owner. * @param _amount uint256 value to be split. * @param _seller address seller of the token. * @param _tokenId uint256 ID of the token. */ function _payout(uint256 _amount, address payable _seller, uint256 _tokenId) private { } /* * @dev Internal function calculate proportion of a fee for a given amount. * _amount * fee / 100 * @param _amount uint256 value to be split. */ function _calcProportion(uint256 fee, uint256 _amount) internal pure returns (uint256) { } }
(!mintingBurnedApe||msg.sender==owner()),"only contract owner can mint for the burned apes"
393,562
(!mintingBurnedApe||msg.sender==owner())
"must own the BAYC ape rights"
pragma solidity ^0.7.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; /** * @title InvertedApeClub contract * @dev Extends ERC721 Non-Fungible Token Standard basic implementation */ contract InvertedApeClub is ERC721, Ownable { using SafeMath for uint256; /** * @dev Emitted when `tokenId` token is sold from `from` to `to`. */ event Sold(address indexed from, address indexed to, uint256 indexed tokenId, uint256 price); string public INVERTED_PROVENANCE = ""; uint public constant MAX_APES = 10000; address public BAYC_ADDRESS; // Mapping from tokenId to sale price. mapping(uint256 => uint256) public tokenPrices; // Mapping from tokenId to token owner that set the sale price. mapping(uint256 => address) public priceSetters; constructor(string memory name, string memory symbol, address ogAddress) ERC721(name, symbol) { } function withdraw() public onlyOwner { } /* * Set provenance once it's calculated */ function setProvenanceHash(string memory provenanceHash) public onlyOwner { } /** * Mints Inverted Apes */ function mintApe(uint256[] memory tokenIds) public payable { require(totalSupply().add(tokenIds.length) <= MAX_APES, "would exceed max supply of Apes"); ERC721 bayc = ERC721(BAYC_ADDRESS); for (uint i=0; i < tokenIds.length; i++) { bool mintingBurnedApe = (tokenIds[i] == 4885 || tokenIds[i] == 8860); require( (!mintingBurnedApe || msg.sender == owner()), "only contract owner can mint for the burned apes" ); require(<FILL_ME>) if (totalSupply() < MAX_APES) { _safeMint(msg.sender, tokenIds[i]); } } } /* * @dev Checks that the token owner or the token ID is approved for the Market * @param _tokenId uint256 ID of the token */ modifier ownerMustHaveMarketplaceApproved(uint256 _tokenId) { } /* * @dev Checks that the token is owned by the sender * @param _tokenId uint256 ID of the token */ modifier senderMustBeTokenOwner(uint256 _tokenId) { } /* * @dev Checks that the token is owned by the same person who set the sale price. * @param _tokenId address of the contract storing the token. */ function _priceSetterStillOwnsTheApe(uint256 _tokenId) internal view returns (bool) { } /* * @dev Set the token for sale * @param _tokenId uint256 ID of the token * @param _amount uint256 wei value that the item is for sale */ function setWeiSalePrice(uint256 _tokenId, uint256 _amount) public ownerMustHaveMarketplaceApproved(_tokenId) senderMustBeTokenOwner(_tokenId) { } /* * @dev Purchases the token if it is for sale. * @param _tokenId uint256 ID of the token. */ function buy(uint256 _tokenId) public payable ownerMustHaveMarketplaceApproved(_tokenId) { } /* @dev Internal function to set token price to 0 for a give contract. * @param _tokenId uint256 id of the token. */ function _resetTokenPrice(uint256 _tokenId) internal { } /* @dev Internal function to pay the seller and yacht ape owner. * @param _amount uint256 value to be split. * @param _seller address seller of the token. * @param _tokenId uint256 ID of the token. */ function _payout(uint256 _amount, address payable _seller, uint256 _tokenId) private { } /* * @dev Internal function calculate proportion of a fee for a given amount. * _amount * fee / 100 * @param _amount uint256 value to be split. */ function _calcProportion(uint256 fee, uint256 _amount) internal pure returns (uint256) { } }
(mintingBurnedApe||bayc.ownerOf(tokenIds[i])==msg.sender),"must own the BAYC ape rights"
393,562
(mintingBurnedApe||bayc.ownerOf(tokenIds[i])==msg.sender)
"owner must have approved marketplace"
pragma solidity ^0.7.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; /** * @title InvertedApeClub contract * @dev Extends ERC721 Non-Fungible Token Standard basic implementation */ contract InvertedApeClub is ERC721, Ownable { using SafeMath for uint256; /** * @dev Emitted when `tokenId` token is sold from `from` to `to`. */ event Sold(address indexed from, address indexed to, uint256 indexed tokenId, uint256 price); string public INVERTED_PROVENANCE = ""; uint public constant MAX_APES = 10000; address public BAYC_ADDRESS; // Mapping from tokenId to sale price. mapping(uint256 => uint256) public tokenPrices; // Mapping from tokenId to token owner that set the sale price. mapping(uint256 => address) public priceSetters; constructor(string memory name, string memory symbol, address ogAddress) ERC721(name, symbol) { } function withdraw() public onlyOwner { } /* * Set provenance once it's calculated */ function setProvenanceHash(string memory provenanceHash) public onlyOwner { } /** * Mints Inverted Apes */ function mintApe(uint256[] memory tokenIds) public payable { } /* * @dev Checks that the token owner or the token ID is approved for the Market * @param _tokenId uint256 ID of the token */ modifier ownerMustHaveMarketplaceApproved(uint256 _tokenId) { address owner = ownerOf(_tokenId); address marketplace = address(this); require(<FILL_ME>) _; } /* * @dev Checks that the token is owned by the sender * @param _tokenId uint256 ID of the token */ modifier senderMustBeTokenOwner(uint256 _tokenId) { } /* * @dev Checks that the token is owned by the same person who set the sale price. * @param _tokenId address of the contract storing the token. */ function _priceSetterStillOwnsTheApe(uint256 _tokenId) internal view returns (bool) { } /* * @dev Set the token for sale * @param _tokenId uint256 ID of the token * @param _amount uint256 wei value that the item is for sale */ function setWeiSalePrice(uint256 _tokenId, uint256 _amount) public ownerMustHaveMarketplaceApproved(_tokenId) senderMustBeTokenOwner(_tokenId) { } /* * @dev Purchases the token if it is for sale. * @param _tokenId uint256 ID of the token. */ function buy(uint256 _tokenId) public payable ownerMustHaveMarketplaceApproved(_tokenId) { } /* @dev Internal function to set token price to 0 for a give contract. * @param _tokenId uint256 id of the token. */ function _resetTokenPrice(uint256 _tokenId) internal { } /* @dev Internal function to pay the seller and yacht ape owner. * @param _amount uint256 value to be split. * @param _seller address seller of the token. * @param _tokenId uint256 ID of the token. */ function _payout(uint256 _amount, address payable _seller, uint256 _tokenId) private { } /* * @dev Internal function calculate proportion of a fee for a given amount. * _amount * fee / 100 * @param _amount uint256 value to be split. */ function _calcProportion(uint256 fee, uint256 _amount) internal pure returns (uint256) { } }
isApprovedForAll(owner,marketplace)||getApproved(_tokenId)==marketplace,"owner must have approved marketplace"
393,562
isApprovedForAll(owner,marketplace)||getApproved(_tokenId)==marketplace
"Current token owner must be the person to have the latest price."
pragma solidity ^0.7.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; /** * @title InvertedApeClub contract * @dev Extends ERC721 Non-Fungible Token Standard basic implementation */ contract InvertedApeClub is ERC721, Ownable { using SafeMath for uint256; /** * @dev Emitted when `tokenId` token is sold from `from` to `to`. */ event Sold(address indexed from, address indexed to, uint256 indexed tokenId, uint256 price); string public INVERTED_PROVENANCE = ""; uint public constant MAX_APES = 10000; address public BAYC_ADDRESS; // Mapping from tokenId to sale price. mapping(uint256 => uint256) public tokenPrices; // Mapping from tokenId to token owner that set the sale price. mapping(uint256 => address) public priceSetters; constructor(string memory name, string memory symbol, address ogAddress) ERC721(name, symbol) { } function withdraw() public onlyOwner { } /* * Set provenance once it's calculated */ function setProvenanceHash(string memory provenanceHash) public onlyOwner { } /** * Mints Inverted Apes */ function mintApe(uint256[] memory tokenIds) public payable { } /* * @dev Checks that the token owner or the token ID is approved for the Market * @param _tokenId uint256 ID of the token */ modifier ownerMustHaveMarketplaceApproved(uint256 _tokenId) { } /* * @dev Checks that the token is owned by the sender * @param _tokenId uint256 ID of the token */ modifier senderMustBeTokenOwner(uint256 _tokenId) { } /* * @dev Checks that the token is owned by the same person who set the sale price. * @param _tokenId address of the contract storing the token. */ function _priceSetterStillOwnsTheApe(uint256 _tokenId) internal view returns (bool) { } /* * @dev Set the token for sale * @param _tokenId uint256 ID of the token * @param _amount uint256 wei value that the item is for sale */ function setWeiSalePrice(uint256 _tokenId, uint256 _amount) public ownerMustHaveMarketplaceApproved(_tokenId) senderMustBeTokenOwner(_tokenId) { } /* * @dev Purchases the token if it is for sale. * @param _tokenId uint256 ID of the token. */ function buy(uint256 _tokenId) public payable ownerMustHaveMarketplaceApproved(_tokenId) { // Check that the person who set the price still owns the ape. require(<FILL_ME>) // Check that token is for sale. uint256 tokenPrice = tokenPrices[_tokenId]; require(tokenPrice > 0, "Tokens priced at 0 are not for sale."); // Check that the correct ether was sent. require( tokenPrice == msg.value, "Must purchase the token for the correct price" ); address tokenOwner = ownerOf(_tokenId); // Payout all parties. _payout(tokenPrice, payable(tokenOwner), _tokenId); // Transfer token. _transfer(tokenOwner, msg.sender, _tokenId); // Wipe the token price. _resetTokenPrice(_tokenId); emit Sold(msg.sender, tokenOwner, tokenPrice, _tokenId); } /* @dev Internal function to set token price to 0 for a give contract. * @param _tokenId uint256 id of the token. */ function _resetTokenPrice(uint256 _tokenId) internal { } /* @dev Internal function to pay the seller and yacht ape owner. * @param _amount uint256 value to be split. * @param _seller address seller of the token. * @param _tokenId uint256 ID of the token. */ function _payout(uint256 _amount, address payable _seller, uint256 _tokenId) private { } /* * @dev Internal function calculate proportion of a fee for a given amount. * _amount * fee / 100 * @param _amount uint256 value to be split. */ function _calcProportion(uint256 fee, uint256 _amount) internal pure returns (uint256) { } }
_priceSetterStillOwnsTheApe(_tokenId),"Current token owner must be the person to have the latest price."
393,562
_priceSetterStillOwnsTheApe(_tokenId)
'Caller is not the minting address'
// SPDX-License-Identifier: CC0 /* /$$$$$$$$ /$$$$$$$ /$$$$$$$$ /$$$$$$$$ | $$_____/| $$__ $$| $$_____/| $$_____/ | $$ | $$ \ $$| $$ | $$ | $$$$$ | $$$$$$$/| $$$$$ | $$$$$ | $$__/ | $$__ $$| $$__/ | $$__/ | $$ | $$ \ $$| $$ | $$ | $$ | $$ | $$| $$$$$$$$| $$$$$$$$ |__/ |__/ |__/|________/|________/ /$$ | $$ | $$$$$$$ /$$ /$$ | $$__ $$| $$ | $$ | $$ \ $$| $$ | $$ | $$ | $$| $$ | $$ | $$$$$$$/| $$$$$$$ |_______/ \____ $$ /$$ | $$ | $$$$$$/ \______/ /$$$$$$ /$$$$$$$$ /$$$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$$$ /$$$$$$$ /$$__ $$|__ $$__/| $$_____/| $$ | $$|_ $$_/| $$_____/| $$__ $$ | $$ \__/ | $$ | $$ | $$ | $$ | $$ | $$ | $$ \ $$ | $$$$$$ | $$ | $$$$$ | $$ / $$/ | $$ | $$$$$ | $$$$$$$/ \____ $$ | $$ | $$__/ \ $$ $$/ | $$ | $$__/ | $$____/ /$$ \ $$ | $$ | $$ \ $$$/ | $$ | $$ | $$ | $$$$$$/ | $$ | $$$$$$$$ \ $/ /$$$$$$| $$$$$$$$| $$ \______/ |__/ |________/ \_/ |______/|________/|__/ CC0 2021 */ import "./Dependencies.sol"; pragma solidity ^0.8.11; contract Free is ERC721, Ownable { using Strings for uint256; uint256 private _tokenIdCounter; uint256 private _collectionIdCounter; string constant public license = 'CC0'; struct Metadata { uint256 collectionId; string namePrefix; string externalUrl; string imgUrl; string imgExtension; string description; } mapping(uint256 => Metadata) public collectionIdToMetadata; mapping(uint256 => uint256) public tokenIdToCollectionId; mapping(uint256 => uint256) public tokenIdToCollectionCount; mapping(uint256 => address) public collectionIdToMinter; mapping(uint256 => uint256) public collectionSupply; mapping(uint256 => string) public tokenIdToAttributes; mapping(address => bool) attributeUpdateAllowList; event ProjectEvent(address indexed poster, string indexed eventType, string content); event TokenEvent(address indexed poster, uint256 indexed tokenId, string indexed eventType, string content); constructor() ERC721('Free', 'FREE') { } function totalSupply() public view virtual returns (uint256) { } function createCollection( address minter, string calldata _namePrefix, string calldata _externalUrl, string calldata _imgUrl, string calldata _imgExtension, string calldata _description ) public onlyOwner { } function mint(uint256 collectionId, address to) public { require(<FILL_ME>) require(collectionId < _collectionIdCounter, 'Collection ID does not exist'); _mint(to, _tokenIdCounter); tokenIdToCollectionId[_tokenIdCounter] = collectionId; tokenIdToCollectionCount[_tokenIdCounter] = collectionSupply[collectionId]; collectionSupply[collectionId]++; _tokenIdCounter++; } function appendAttributeToToken(uint256 tokenId, string calldata attrKey, string calldata attrValue) public { } function setMintingAddress(uint256 collectionId, address minter) public onlyOwner { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function updateMetadataParams( uint256 collectionId, string calldata _namePrefix, string calldata _externalUrl, string calldata _imgUrl, string calldata _imgExtension, string calldata _description ) public onlyOwner { } function emitProjectEvent(string calldata _eventType, string calldata _content) public onlyOwner { } function emitTokenEvent(uint256 tokenId, string calldata _eventType, string calldata _content) public { } }
collectionIdToMinter[collectionId]==_msgSender(),'Caller is not the minting address'
393,659
collectionIdToMinter[collectionId]==_msgSender()
"Sender not on attribute update allow list."
// SPDX-License-Identifier: CC0 /* /$$$$$$$$ /$$$$$$$ /$$$$$$$$ /$$$$$$$$ | $$_____/| $$__ $$| $$_____/| $$_____/ | $$ | $$ \ $$| $$ | $$ | $$$$$ | $$$$$$$/| $$$$$ | $$$$$ | $$__/ | $$__ $$| $$__/ | $$__/ | $$ | $$ \ $$| $$ | $$ | $$ | $$ | $$| $$$$$$$$| $$$$$$$$ |__/ |__/ |__/|________/|________/ /$$ | $$ | $$$$$$$ /$$ /$$ | $$__ $$| $$ | $$ | $$ \ $$| $$ | $$ | $$ | $$| $$ | $$ | $$$$$$$/| $$$$$$$ |_______/ \____ $$ /$$ | $$ | $$$$$$/ \______/ /$$$$$$ /$$$$$$$$ /$$$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$$$ /$$$$$$$ /$$__ $$|__ $$__/| $$_____/| $$ | $$|_ $$_/| $$_____/| $$__ $$ | $$ \__/ | $$ | $$ | $$ | $$ | $$ | $$ | $$ \ $$ | $$$$$$ | $$ | $$$$$ | $$ / $$/ | $$ | $$$$$ | $$$$$$$/ \____ $$ | $$ | $$__/ \ $$ $$/ | $$ | $$__/ | $$____/ /$$ \ $$ | $$ | $$ \ $$$/ | $$ | $$ | $$ | $$$$$$/ | $$ | $$$$$$$$ \ $/ /$$$$$$| $$$$$$$$| $$ \______/ |__/ |________/ \_/ |______/|________/|__/ CC0 2021 */ import "./Dependencies.sol"; pragma solidity ^0.8.11; contract Free is ERC721, Ownable { using Strings for uint256; uint256 private _tokenIdCounter; uint256 private _collectionIdCounter; string constant public license = 'CC0'; struct Metadata { uint256 collectionId; string namePrefix; string externalUrl; string imgUrl; string imgExtension; string description; } mapping(uint256 => Metadata) public collectionIdToMetadata; mapping(uint256 => uint256) public tokenIdToCollectionId; mapping(uint256 => uint256) public tokenIdToCollectionCount; mapping(uint256 => address) public collectionIdToMinter; mapping(uint256 => uint256) public collectionSupply; mapping(uint256 => string) public tokenIdToAttributes; mapping(address => bool) attributeUpdateAllowList; event ProjectEvent(address indexed poster, string indexed eventType, string content); event TokenEvent(address indexed poster, uint256 indexed tokenId, string indexed eventType, string content); constructor() ERC721('Free', 'FREE') { } function totalSupply() public view virtual returns (uint256) { } function createCollection( address minter, string calldata _namePrefix, string calldata _externalUrl, string calldata _imgUrl, string calldata _imgExtension, string calldata _description ) public onlyOwner { } function mint(uint256 collectionId, address to) public { } function appendAttributeToToken(uint256 tokenId, string calldata attrKey, string calldata attrValue) public { require(<FILL_ME>) string memory existingAttrs = tokenIdToAttributes[tokenId]; tokenIdToAttributes[tokenId] = string(abi.encodePacked( existingAttrs, ',{"trait_type":"', attrKey,'","value":', attrValue,'}' )); } function setMintingAddress(uint256 collectionId, address minter) public onlyOwner { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function updateMetadataParams( uint256 collectionId, string calldata _namePrefix, string calldata _externalUrl, string calldata _imgUrl, string calldata _imgExtension, string calldata _description ) public onlyOwner { } function emitProjectEvent(string calldata _eventType, string calldata _content) public onlyOwner { } function emitTokenEvent(uint256 tokenId, string calldata _eventType, string calldata _content) public { } }
attributeUpdateAllowList[msg.sender],"Sender not on attribute update allow list."
393,659
attributeUpdateAllowList[msg.sender]
'Only project or token owner can emit token event'
// SPDX-License-Identifier: CC0 /* /$$$$$$$$ /$$$$$$$ /$$$$$$$$ /$$$$$$$$ | $$_____/| $$__ $$| $$_____/| $$_____/ | $$ | $$ \ $$| $$ | $$ | $$$$$ | $$$$$$$/| $$$$$ | $$$$$ | $$__/ | $$__ $$| $$__/ | $$__/ | $$ | $$ \ $$| $$ | $$ | $$ | $$ | $$| $$$$$$$$| $$$$$$$$ |__/ |__/ |__/|________/|________/ /$$ | $$ | $$$$$$$ /$$ /$$ | $$__ $$| $$ | $$ | $$ \ $$| $$ | $$ | $$ | $$| $$ | $$ | $$$$$$$/| $$$$$$$ |_______/ \____ $$ /$$ | $$ | $$$$$$/ \______/ /$$$$$$ /$$$$$$$$ /$$$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$$$ /$$$$$$$ /$$__ $$|__ $$__/| $$_____/| $$ | $$|_ $$_/| $$_____/| $$__ $$ | $$ \__/ | $$ | $$ | $$ | $$ | $$ | $$ | $$ \ $$ | $$$$$$ | $$ | $$$$$ | $$ / $$/ | $$ | $$$$$ | $$$$$$$/ \____ $$ | $$ | $$__/ \ $$ $$/ | $$ | $$__/ | $$____/ /$$ \ $$ | $$ | $$ \ $$$/ | $$ | $$ | $$ | $$$$$$/ | $$ | $$$$$$$$ \ $/ /$$$$$$| $$$$$$$$| $$ \______/ |__/ |________/ \_/ |______/|________/|__/ CC0 2021 */ import "./Dependencies.sol"; pragma solidity ^0.8.11; contract Free is ERC721, Ownable { using Strings for uint256; uint256 private _tokenIdCounter; uint256 private _collectionIdCounter; string constant public license = 'CC0'; struct Metadata { uint256 collectionId; string namePrefix; string externalUrl; string imgUrl; string imgExtension; string description; } mapping(uint256 => Metadata) public collectionIdToMetadata; mapping(uint256 => uint256) public tokenIdToCollectionId; mapping(uint256 => uint256) public tokenIdToCollectionCount; mapping(uint256 => address) public collectionIdToMinter; mapping(uint256 => uint256) public collectionSupply; mapping(uint256 => string) public tokenIdToAttributes; mapping(address => bool) attributeUpdateAllowList; event ProjectEvent(address indexed poster, string indexed eventType, string content); event TokenEvent(address indexed poster, uint256 indexed tokenId, string indexed eventType, string content); constructor() ERC721('Free', 'FREE') { } function totalSupply() public view virtual returns (uint256) { } function createCollection( address minter, string calldata _namePrefix, string calldata _externalUrl, string calldata _imgUrl, string calldata _imgExtension, string calldata _description ) public onlyOwner { } function mint(uint256 collectionId, address to) public { } function appendAttributeToToken(uint256 tokenId, string calldata attrKey, string calldata attrValue) public { } function setMintingAddress(uint256 collectionId, address minter) public onlyOwner { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function updateMetadataParams( uint256 collectionId, string calldata _namePrefix, string calldata _externalUrl, string calldata _imgUrl, string calldata _imgExtension, string calldata _description ) public onlyOwner { } function emitProjectEvent(string calldata _eventType, string calldata _content) public onlyOwner { } function emitTokenEvent(uint256 tokenId, string calldata _eventType, string calldata _content) public { require(<FILL_ME>) emit TokenEvent(_msgSender(), tokenId, _eventType, _content); } }
owner()==_msgSender()||ERC721.ownerOf(tokenId)==_msgSender(),'Only project or token owner can emit token event'
393,659
owner()==_msgSender()||ERC721.ownerOf(tokenId)==_msgSender()
"Max tokens minted"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "./CryptoCookies.sol"; //buy with ETH contract CCBuy is Ownable { bool public isSaleLive; uint16 constant MAX_ETH_SUPPLY = 20000; uint256 public ETH_PER_MINT = 0.05 ether; CryptoCookies public ccContract; event SaleLive(bool onSale); constructor(address ccAddress) { } function Buy(uint16 amount) external payable { require(isSaleLive,"Sale not live"); require(amount > 0,"Mint at least 1"); require(<FILL_ME>) uint256 totalCost = ETH_PER_MINT * amount; require(msg.value >= totalCost,"Not enough ETH"); for (uint256 i = 0; i < amount; i++ ){ ccContract.mintExternal(msg.sender, ccContract._totalMinted() + 1); //mint to sender's wallet } } function toggleSaleStatus() external onlyOwner { } function setCCContract(address ccAddress) external onlyOwner{ } function setETHPrice(uint256 newPrice) external onlyOwner { } function withdrawAll() external onlyOwner { } }
ccContract._totalMinted()+amount<=MAX_ETH_SUPPLY,"Max tokens minted"
393,695
ccContract._totalMinted()+amount<=MAX_ETH_SUPPLY
"epoch already wound down"
pragma solidity ^0.7.1; // v0: all functions returns the only adapter that exists // v1: evaluate adapters by interest rate and return the best one possible per currency contract SaffronStrategy is ISaffronStrategy { using SafeERC20 for IERC20; using SafeMath for uint256; ChainlinkRewardOracle public oracle; address public governance; address public team_address; address public SFI_address; address[] public pools; address[] public adapters; mapping(address=>uint256) private adapter_indexes; mapping(uint256=>address) private adapter_addresses; uint256[] public pool_SFI_rewards = [ 10500000000000000000, // 10.5 SFI - dai comp 33750000000000000000, // 33.75 SFI - eth uni 22500000000000000000, // 22.5 SFI - sfi stake 1500000000000000000 , // 1.5 SFI - btse 15500000000000000000, // 10.5 SFI - wbtc comp 1500000000000000000, // 1.5 SFI - geeq 1500000000000000000, // 1.5 SFI - esd 33750000000000000000, // 33.75 SFI - eth sushi 1500000000000000000, // 1.5 SFI - alpha 10500000000000000000, // 10.5 SFI - dai rari 1500000000000000000, // 1.5 SFI - prt 10500000000000000000, // 10.5 SFI - usdt comp 10500000000000000000 // 10.5 SFI - usdc comp ]; // True if epoch has been wound down already mapping(uint256=>bool) public epoch_wound_down; uint256 public last_deploy; // Last run of Hourly Deploy uint256 public deploy_interval; // Hourly deploy interval epoch_params public epoch_cycle = epoch_params({ start_date: 1604239200, // 11/01/2020 @ 2:00pm (UTC) duration: 14 days // 1210000 seconds }); constructor(address _sfi_address, address _team_address, bool epoch_cycle_reset) { } function set_oracle(address oracleAddr) external { } function oracle_set_reward(uint16 epoch) external { } function wind_down_epoch(uint256 epoch) external { require(epoch == 12, "v1.12: only epoch 12"); require(<FILL_ME>) require(msg.sender == team_address || msg.sender == governance, "must be team or governance"); uint256 current_epoch = get_current_epoch(); require(epoch < current_epoch, "cannot wind down future epoch"); epoch_wound_down[epoch] = true; // Team Funds - https://miro.medium.com/max/568/1*8vnnKp4JzzCA3tNqW246XA.png uint256 team_sfi = 54 * 1 ether; SFI(SFI_address).mint_SFI(team_address, team_sfi); for (uint256 i = 0; i < pools.length; i++) { uint256 rewardSFI = 0; if (i < pool_SFI_rewards.length) { rewardSFI = pool_SFI_rewards[i]; SFI(SFI_address).mint_SFI(pools[i], rewardSFI); } ISaffronPool(pools[i]).wind_down_epoch(epoch, rewardSFI); } } function wind_down_epoch_oracle(uint256 epoch) external { } // Wind down pool exists just in case one of the pools is broken function wind_down_pool(uint256 pool, uint256 epoch) external { } // Deploy all capital in pool (funnel 100% of pooled base assets into best adapter) function deploy_all_capital() external override { } function deploy_all_capital_single_pool(uint256 pool_index, uint256 adapter_index) public { } function v01_final_deploy() external { } // Add adapters to a list of adapters passed in function add_adapter(address adapter_address) external override { } // Get an adapter's address by index function get_adapter_index(address adapter_address) public view returns(uint256) { } // Get an adapter's address by index function get_adapter_address(uint256 index) external view override returns(address) { } function add_pool(address pool_address) external override { } function delete_adapters() external override { } function set_team_address(address to) public { } function set_governance(address to) external override { } function set_pool_SFI_reward(uint256 poolIndex, uint256 reward) external override { } function shutdown_pool(uint256 poolIndex) external { } function select_adapter_for_liquidity_removal() external view override returns(address) { } // v1.5 add replace adapter function // v1.5 add remove adapter function /*** TIME UTILITY FUNCTIONS ***/ function get_epoch_end(uint256 epoch) public view returns (uint256) { } function get_current_epoch() public view returns (uint256) { } function get_seconds_until_epoch_end(uint256 epoch) public view returns (uint256) { } event ErcSwept(address who, address to, address token, uint256 amount); function erc_sweep(address _token, address _to) public { } }
!epoch_wound_down[epoch],"epoch already wound down"
393,738
!epoch_wound_down[epoch]
"Member not found."
pragma solidity ^0.4.24; contract _2Percent { address public owner; uint public investedAmount; address[] public addresses; uint public lastPaymentDate; uint constant public interest = 2; uint constant public transactions_limit = 100; mapping(address => Member) public members; uint constant public min_withdraw = 100000000000000 wei; uint constant public min_invest = 10000000000000000 wei; struct Member { uint id; address referrer; uint deposit; uint deposits; uint date; } constructor() public { } function getMemberCount() public view returns (uint) { } function getMemberDividendsAmount(address addr) public view returns (uint) { } function bytesToAddress(bytes bys) private pure returns (address addr) { } function selfPayout() private { require(<FILL_ME>) uint amount = getMemberDividendsAmount(msg.sender); require(amount >= min_withdraw, "Too small amount, minimum 0.0001 ether"); members[msg.sender].date = now; msg.sender.transfer(amount); } function() payable public { } }
members[msg.sender].id>0,"Member not found."
393,740
members[msg.sender].id>0
"max NFT limit exceeded"
pragma solidity ^0.8.11; contract MoshiMochi is ERC721Enum, Ownable, ReentrancyGuard { using Strings for uint256; string private baseURI; bool public revealed = false; string public baseExtension =".json"; string public notRevealedUri; uint256 public reserved = 80; //Sale Settings uint256 public cost = 0.035 ether; uint256 public maxSupply = 8000; uint256 public maxMint = 10; bool public publicSaleOpen = false; // Sale is not active bool public preSaleIsActive = false; // Presale is not active // Whitelist Sale Settings bytes32 public merkleRoot = ""; // Construct this from (address, amount) tuple elements mapping(address => uint) public whitelistRemaining; // // Maps user address to their remaining mints if they have minted some but not all of their allocation mapping(address => bool) public whitelistClaimed; // Maps user address to bool, true if user has minted uint256 public constant maxMintAmount = 5; //Reserved for WLs 5 Per TX event Mint(address indexed owner, uint indexed tokenId); constructor( string memory _initBaseURI, string memory _initNotRevealedUri) ERC721P("Moshi Mochi", "MOSHI") { } function _baseURI() internal view virtual returns (string memory) { } // Sale active/inactive function setPublicSale(bool val) public onlyOwner { } function setPreSale(bool val) public onlyOwner { } // Minting Functionalities -- Public Sale & Sale Reservations for the Project function mint(uint256 amount) public payable nonReentrant{ require(publicSaleOpen, "Sale is not Active" ); uint256 s = totalSupply(); require(amount > 0, "need to mint at least 1" ); require(amount <= maxMint, "max mint amount per session exceeded"); require(<FILL_ME>) require(msg.value >= cost * amount, "Value is over or under price."); for (uint256 i = 0; i < amount; ++i) { _safeMint(msg.sender, s + i, ""); } } function mintReserved(uint256 _amount) public onlyOwner { } function whitelistMint(uint amount, bytes32 leaf, bytes32[] memory proof) external payable { } function verify(bytes32 _merkleRoot, bytes32 leaf, bytes32[] memory proof) public pure returns (bool) { } // baseURIs function reveal() public onlyOwner() { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } //General function setCost(uint256 _newCost) public onlyOwner { } function setMaxMintAmount(uint256 _newMaxMintAmount) public onlyOwner { } function setmaxSupply(uint256 _newMaxSupply) public onlyOwner { } function setMerkleRoot(bytes32 _merkleRoot) public onlyOwner { } function withdraw() public payable onlyOwner { } }
s+amount<=maxSupply,"max NFT limit exceeded"
393,798
s+amount<=maxSupply
"Can't mint more than remaining allocation"
pragma solidity ^0.8.11; contract MoshiMochi is ERC721Enum, Ownable, ReentrancyGuard { using Strings for uint256; string private baseURI; bool public revealed = false; string public baseExtension =".json"; string public notRevealedUri; uint256 public reserved = 80; //Sale Settings uint256 public cost = 0.035 ether; uint256 public maxSupply = 8000; uint256 public maxMint = 10; bool public publicSaleOpen = false; // Sale is not active bool public preSaleIsActive = false; // Presale is not active // Whitelist Sale Settings bytes32 public merkleRoot = ""; // Construct this from (address, amount) tuple elements mapping(address => uint) public whitelistRemaining; // // Maps user address to their remaining mints if they have minted some but not all of their allocation mapping(address => bool) public whitelistClaimed; // Maps user address to bool, true if user has minted uint256 public constant maxMintAmount = 5; //Reserved for WLs 5 Per TX event Mint(address indexed owner, uint indexed tokenId); constructor( string memory _initBaseURI, string memory _initNotRevealedUri) ERC721P("Moshi Mochi", "MOSHI") { } function _baseURI() internal view virtual returns (string memory) { } // Sale active/inactive function setPublicSale(bool val) public onlyOwner { } function setPreSale(bool val) public onlyOwner { } // Minting Functionalities -- Public Sale & Sale Reservations for the Project function mint(uint256 amount) public payable nonReentrant{ } function mintReserved(uint256 _amount) public onlyOwner { } function whitelistMint(uint amount, bytes32 leaf, bytes32[] memory proof) external payable { require(preSaleIsActive, "Sale is not Active" ); // Verify that (msg.sender, amount) correspond to Merkle leaf require(keccak256(abi.encodePacked(msg.sender)) == leaf, "Sender and amount don't match Merkle leaf"); // Verify that (leaf, proof) matches the Merkle root require(verify(merkleRoot, leaf, proof), "Not a valid leaf in the Merkle tree"); uint256 s = totalSupply(); require(s + amount <= maxSupply, "Sold out"); require(amount <= maxMintAmount, "Surpasses maxMintAmount"); // Require nonzero amount require(amount > 0, "Can't mint zero"); // Check proper amount sent require(msg.value == amount * cost, "Send proper ETH amount"); require(<FILL_ME>) for (uint256 i = 0; i < amount; ++i) { _safeMint(msg.sender, s + i, ""); } whitelistRemaining[msg.sender] += amount; } function verify(bytes32 _merkleRoot, bytes32 leaf, bytes32[] memory proof) public pure returns (bool) { } // baseURIs function reveal() public onlyOwner() { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } //General function setCost(uint256 _newCost) public onlyOwner { } function setMaxMintAmount(uint256 _newMaxMintAmount) public onlyOwner { } function setmaxSupply(uint256 _newMaxSupply) public onlyOwner { } function setMerkleRoot(bytes32 _merkleRoot) public onlyOwner { } function withdraw() public payable onlyOwner { } }
whitelistRemaining[msg.sender]<=maxMintAmount,"Can't mint more than remaining allocation"
393,798
whitelistRemaining[msg.sender]<=maxMintAmount
null
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/[email protected]/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/[email protected]/access/Ownable.sol"; import "@openzeppelin/[email protected]/utils/Strings.sol"; interface CryptoPunksAssets { function composite(bytes1, bytes1, bytes1, bytes1, bytes1) external view returns (bytes4); function getAsset(uint8) external view returns (bytes memory); function getAssetName(uint8) external view returns (string memory); function getAssetType(uint8) external view returns (uint8); function getAssetIndex(string calldata, bool) external view returns (uint8); function getMappedAsset(uint8, bool) external view returns (uint8); } interface CryptoPunksData { function punkAttributes(uint16) external view returns (string memory); } interface CryptoPunksMarket { function punkIndexToAddress(uint256) external view returns (address); } contract LostPunkSociety is ERC721Enumerable, Ownable { CryptoPunksAssets private cryptoPunksAssets; CryptoPunksData private cryptoPunksData; CryptoPunksMarket private cryptoPunksMarket; uint16 private constant cryptoPunksCount = 10000; uint16 private punksCount = 10000; uint16 private TOTAL_CAP; uint8 private GENERATION_CAP; uint256 private SEED; uint256 private TIER_PRICE_IN_WEI; mapping(uint16 => bytes) private punks; mapping(uint16 => uint16) private fatherMapping; mapping(uint16 => uint16) private motherMapping; mapping(uint16 => uint16) private generationMapping; mapping(uint16 => uint16) private child1Mapping; mapping(uint16 => uint16) private child2Mapping; bool private shouldVerifyCryptoPunkOwnership; bool private shouldVerifyLostPunkOwnership; bool private freeMintForCryptoPunks; bool private contractSealed; modifier unsealed() { } function sealContract() external onlyOwner unsealed { } function destroy() external onlyOwner unsealed { } function configureEnvironment( address cryptoPunksAssetsAddress, address cryptoPunksDataAddress, address cryptoPunksMarketAddress, uint8 generationCap, uint16 totalCap, uint256 tierPriceInWei, bool freeForCryptoPunks, bool shouldVerifyCryptoPunk, bool shouldVerifyLostPunk) public onlyOwner unsealed { } constructor() ERC721("LostPunkSociety", "LPS") { } address private constant giveDirectlyDonationAddress = 0xc7464dbcA260A8faF033460622B23467Df5AEA42; function withdraw() external onlyOwner { } function composite(bytes1 index, bytes1 yr, bytes1 yg, bytes1 yb, bytes1 ya) internal view returns (bytes4) { } function getAsset(uint8 index) internal view returns (bytes memory) { } function getAssetName(uint8 index) internal view returns (string memory) { } function getAssetType(uint8 index) internal view returns (uint8) { } function getAssetIndex(string memory text, bool isMale) internal view returns (uint8) { } function getMappedAsset(uint8 index, bool toMale) internal view returns (uint8) { } function nextPseudoRandom(uint256 max) internal returns (uint) { } struct TraitInfo { uint8 punkType; bool isMale; bool isDifferent; uint8 assetIndex; uint8 earringIndex; uint8 cigaretteIndex; } function breedPunkAssets(uint16 fatherIndex, uint16 motherIndex) internal returns (bytes memory childAssets) { require(fatherIndex >= 0 && fatherIndex < punksCount, "Unknown father"); require(motherIndex >= 0 && motherIndex < punksCount, "Unknown mother"); bytes memory fatherAssets = getPunkAssets(fatherIndex); bytes memory motherAssets = getPunkAssets(motherIndex); TraitInfo memory info; uint8 fa = uint8(fatherAssets[0]); uint8 ma = uint8(motherAssets[0]); if ((fa == 10) || (fa == 11)) { // alien or ape require(<FILL_ME>) info.isMale = true; info.punkType = fa; } else if (fa == 9) { // zombie require(ma >= 5 && ma < 9); info.isMale = true; info.punkType = fa; } else { require(fa >= 1 && fa < 5); require(ma >= 5 && ma < 9); info.isMale = nextPseudoRandom(2) == 0; uint8 low = (ma - 5) < (fa - 1) ? (ma - 5) : (fa - 1); uint8 high = (ma - 5) < (fa - 1) ? (fa - 1) : (ma - 5); info.punkType = (info.isMale ? 1 : 5) + uint8(low + nextPseudoRandom(high + 1 - low)); } childAssets = new bytes(8); childAssets[info.assetIndex++] = bytes1(info.punkType); info.isDifferent = info.punkType != (info.isMale ? fa : ma); uint8[10] memory fatherTraits; uint8[10] memory motherTraits; for (uint8 j = 1; j < 8; ++j) { fa = uint8(fatherAssets[j]); fatherTraits[getAssetType(fa)] = fa; ma = uint8(motherAssets[j]); motherTraits[getAssetType(ma)] = ma; } for (uint8 j = 1; j < 10 && info.assetIndex < 8; ++j) { fa = info.isMale ? motherTraits[j] : fatherTraits[j]; // other parent trait ma = info.isMale ? fatherTraits[j] : motherTraits[j]; // same parent trait uint8 value = fa > 0 ? getMappedAsset(fa, info.isMale) : 0; if ((ma != 0) && ((value == 0) || (nextPseudoRandom(2) == 0))) { value = ma; } if (value != ma) { info.isDifferent = true; } else if ((value == 61) || (value == 125)) { info.earringIndex = info.assetIndex; } else if ((value == 19) || (value == 115)) { info.cigaretteIndex = info.assetIndex; } if (value > 0) { childAssets[info.assetIndex++] = bytes1(value); } } if (!info.isDifferent) { if (info.cigaretteIndex > 0) { for (uint8 j = info.cigaretteIndex; j < 8; ++j) { childAssets[j] = j < 7 ? childAssets[j+1] : bytes1(0); } } else if (info.earringIndex > 0) { for (uint8 j = info.earringIndex; j < 8; ++j) { childAssets[j] = j < 7 ? childAssets[j+1] : bytes1(0); } } else if (info.assetIndex < 7) { if (nextPseudoRandom(2) == 0) { childAssets[info.assetIndex++] = bytes1(info.isMale ? 61 : 125); } else { childAssets[info.assetIndex++] = bytes1(info.isMale ? 19 : 115); } } } } function verifyPunkOwnership(uint16 index) internal view { } function mintLostPunk(uint16 fatherIndex, uint16 motherIndex) external payable { } function tokenURI(uint256 index) public view override returns (string memory) { } function getPunkAssets(uint16 index) internal view returns (bytes memory punkAssets) { } function punkAssetsAttributes(bytes memory punkAssets, uint16 index) internal view returns (string memory text) { } function appendAttribute(string memory prefix, string memory key, string memory value, bool asString, bool asNumber, bool append) internal pure returns (string memory text) { } function metadataAttributes(bytes memory punkAssets, uint16 index) internal view returns (string memory text) { } function punkAssetsImage(bytes memory punkAssets) internal view returns (bytes memory) { } function colorForGeneration(uint16 index) internal pure returns (bytes4) { } string private constant SVG_HEADER = '<svg id="crisp" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMax meet" viewBox="0 0 360 360">'; string private constant SVG_FOOTER = '<style>rect{width:15px;height:15px;} #crisp{shape-rendering: crispEdges;} .backdrop{width:360px;height:360px;}</style></svg>'; function punkAssetsImageSvg(bytes memory punkAssets, uint16 index) internal view returns (string memory svg) { } function punkAttributes(uint16 index) external view returns (string memory text) { } function punkImageSvg(uint16 index) public view returns (string memory svg) { } function parseAssets(string memory attributes) internal view returns (bytes memory punkAssets) { } bytes16 private constant HEX_SYMBOLS = "0123456789ABCDEF"; function rectSvg(uint x, uint y, bool backdrop, bytes4 color) internal pure returns (string memory) { } function bufferToString(bytes memory buffer, uint length) internal pure returns (string memory text) { } bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; // [MIT License] // @author Brecht Devos <[email protected]> function base64Encode(bytes memory data) internal pure returns (string memory) { } }
(ma==fa)&&(fatherIndex!=motherIndex)
393,800
(ma==fa)&&(fatherIndex!=motherIndex)
"Does not own this CryptoPunk."
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/[email protected]/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/[email protected]/access/Ownable.sol"; import "@openzeppelin/[email protected]/utils/Strings.sol"; interface CryptoPunksAssets { function composite(bytes1, bytes1, bytes1, bytes1, bytes1) external view returns (bytes4); function getAsset(uint8) external view returns (bytes memory); function getAssetName(uint8) external view returns (string memory); function getAssetType(uint8) external view returns (uint8); function getAssetIndex(string calldata, bool) external view returns (uint8); function getMappedAsset(uint8, bool) external view returns (uint8); } interface CryptoPunksData { function punkAttributes(uint16) external view returns (string memory); } interface CryptoPunksMarket { function punkIndexToAddress(uint256) external view returns (address); } contract LostPunkSociety is ERC721Enumerable, Ownable { CryptoPunksAssets private cryptoPunksAssets; CryptoPunksData private cryptoPunksData; CryptoPunksMarket private cryptoPunksMarket; uint16 private constant cryptoPunksCount = 10000; uint16 private punksCount = 10000; uint16 private TOTAL_CAP; uint8 private GENERATION_CAP; uint256 private SEED; uint256 private TIER_PRICE_IN_WEI; mapping(uint16 => bytes) private punks; mapping(uint16 => uint16) private fatherMapping; mapping(uint16 => uint16) private motherMapping; mapping(uint16 => uint16) private generationMapping; mapping(uint16 => uint16) private child1Mapping; mapping(uint16 => uint16) private child2Mapping; bool private shouldVerifyCryptoPunkOwnership; bool private shouldVerifyLostPunkOwnership; bool private freeMintForCryptoPunks; bool private contractSealed; modifier unsealed() { } function sealContract() external onlyOwner unsealed { } function destroy() external onlyOwner unsealed { } function configureEnvironment( address cryptoPunksAssetsAddress, address cryptoPunksDataAddress, address cryptoPunksMarketAddress, uint8 generationCap, uint16 totalCap, uint256 tierPriceInWei, bool freeForCryptoPunks, bool shouldVerifyCryptoPunk, bool shouldVerifyLostPunk) public onlyOwner unsealed { } constructor() ERC721("LostPunkSociety", "LPS") { } address private constant giveDirectlyDonationAddress = 0xc7464dbcA260A8faF033460622B23467Df5AEA42; function withdraw() external onlyOwner { } function composite(bytes1 index, bytes1 yr, bytes1 yg, bytes1 yb, bytes1 ya) internal view returns (bytes4) { } function getAsset(uint8 index) internal view returns (bytes memory) { } function getAssetName(uint8 index) internal view returns (string memory) { } function getAssetType(uint8 index) internal view returns (uint8) { } function getAssetIndex(string memory text, bool isMale) internal view returns (uint8) { } function getMappedAsset(uint8 index, bool toMale) internal view returns (uint8) { } function nextPseudoRandom(uint256 max) internal returns (uint) { } struct TraitInfo { uint8 punkType; bool isMale; bool isDifferent; uint8 assetIndex; uint8 earringIndex; uint8 cigaretteIndex; } function breedPunkAssets(uint16 fatherIndex, uint16 motherIndex) internal returns (bytes memory childAssets) { } function verifyPunkOwnership(uint16 index) internal view { if (index < cryptoPunksCount) { require(<FILL_ME>) } else { require(!shouldVerifyLostPunkOwnership || (ownerOf(index) == msg.sender), "Does not own this Lost Punk."); } } function mintLostPunk(uint16 fatherIndex, uint16 motherIndex) external payable { } function tokenURI(uint256 index) public view override returns (string memory) { } function getPunkAssets(uint16 index) internal view returns (bytes memory punkAssets) { } function punkAssetsAttributes(bytes memory punkAssets, uint16 index) internal view returns (string memory text) { } function appendAttribute(string memory prefix, string memory key, string memory value, bool asString, bool asNumber, bool append) internal pure returns (string memory text) { } function metadataAttributes(bytes memory punkAssets, uint16 index) internal view returns (string memory text) { } function punkAssetsImage(bytes memory punkAssets) internal view returns (bytes memory) { } function colorForGeneration(uint16 index) internal pure returns (bytes4) { } string private constant SVG_HEADER = '<svg id="crisp" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMax meet" viewBox="0 0 360 360">'; string private constant SVG_FOOTER = '<style>rect{width:15px;height:15px;} #crisp{shape-rendering: crispEdges;} .backdrop{width:360px;height:360px;}</style></svg>'; function punkAssetsImageSvg(bytes memory punkAssets, uint16 index) internal view returns (string memory svg) { } function punkAttributes(uint16 index) external view returns (string memory text) { } function punkImageSvg(uint16 index) public view returns (string memory svg) { } function parseAssets(string memory attributes) internal view returns (bytes memory punkAssets) { } bytes16 private constant HEX_SYMBOLS = "0123456789ABCDEF"; function rectSvg(uint x, uint y, bool backdrop, bytes4 color) internal pure returns (string memory) { } function bufferToString(bytes memory buffer, uint length) internal pure returns (string memory text) { } bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; // [MIT License] // @author Brecht Devos <[email protected]> function base64Encode(bytes memory data) internal pure returns (string memory) { } }
!shouldVerifyCryptoPunkOwnership||(cryptoPunksMarket.punkIndexToAddress(index)==msg.sender),"Does not own this CryptoPunk."
393,800
!shouldVerifyCryptoPunkOwnership||(cryptoPunksMarket.punkIndexToAddress(index)==msg.sender)
"Does not own this Lost Punk."
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/[email protected]/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/[email protected]/access/Ownable.sol"; import "@openzeppelin/[email protected]/utils/Strings.sol"; interface CryptoPunksAssets { function composite(bytes1, bytes1, bytes1, bytes1, bytes1) external view returns (bytes4); function getAsset(uint8) external view returns (bytes memory); function getAssetName(uint8) external view returns (string memory); function getAssetType(uint8) external view returns (uint8); function getAssetIndex(string calldata, bool) external view returns (uint8); function getMappedAsset(uint8, bool) external view returns (uint8); } interface CryptoPunksData { function punkAttributes(uint16) external view returns (string memory); } interface CryptoPunksMarket { function punkIndexToAddress(uint256) external view returns (address); } contract LostPunkSociety is ERC721Enumerable, Ownable { CryptoPunksAssets private cryptoPunksAssets; CryptoPunksData private cryptoPunksData; CryptoPunksMarket private cryptoPunksMarket; uint16 private constant cryptoPunksCount = 10000; uint16 private punksCount = 10000; uint16 private TOTAL_CAP; uint8 private GENERATION_CAP; uint256 private SEED; uint256 private TIER_PRICE_IN_WEI; mapping(uint16 => bytes) private punks; mapping(uint16 => uint16) private fatherMapping; mapping(uint16 => uint16) private motherMapping; mapping(uint16 => uint16) private generationMapping; mapping(uint16 => uint16) private child1Mapping; mapping(uint16 => uint16) private child2Mapping; bool private shouldVerifyCryptoPunkOwnership; bool private shouldVerifyLostPunkOwnership; bool private freeMintForCryptoPunks; bool private contractSealed; modifier unsealed() { } function sealContract() external onlyOwner unsealed { } function destroy() external onlyOwner unsealed { } function configureEnvironment( address cryptoPunksAssetsAddress, address cryptoPunksDataAddress, address cryptoPunksMarketAddress, uint8 generationCap, uint16 totalCap, uint256 tierPriceInWei, bool freeForCryptoPunks, bool shouldVerifyCryptoPunk, bool shouldVerifyLostPunk) public onlyOwner unsealed { } constructor() ERC721("LostPunkSociety", "LPS") { } address private constant giveDirectlyDonationAddress = 0xc7464dbcA260A8faF033460622B23467Df5AEA42; function withdraw() external onlyOwner { } function composite(bytes1 index, bytes1 yr, bytes1 yg, bytes1 yb, bytes1 ya) internal view returns (bytes4) { } function getAsset(uint8 index) internal view returns (bytes memory) { } function getAssetName(uint8 index) internal view returns (string memory) { } function getAssetType(uint8 index) internal view returns (uint8) { } function getAssetIndex(string memory text, bool isMale) internal view returns (uint8) { } function getMappedAsset(uint8 index, bool toMale) internal view returns (uint8) { } function nextPseudoRandom(uint256 max) internal returns (uint) { } struct TraitInfo { uint8 punkType; bool isMale; bool isDifferent; uint8 assetIndex; uint8 earringIndex; uint8 cigaretteIndex; } function breedPunkAssets(uint16 fatherIndex, uint16 motherIndex) internal returns (bytes memory childAssets) { } function verifyPunkOwnership(uint16 index) internal view { if (index < cryptoPunksCount) { require(!shouldVerifyCryptoPunkOwnership || (cryptoPunksMarket.punkIndexToAddress(index) == msg.sender), "Does not own this CryptoPunk."); } else { require(<FILL_ME>) } } function mintLostPunk(uint16 fatherIndex, uint16 motherIndex) external payable { } function tokenURI(uint256 index) public view override returns (string memory) { } function getPunkAssets(uint16 index) internal view returns (bytes memory punkAssets) { } function punkAssetsAttributes(bytes memory punkAssets, uint16 index) internal view returns (string memory text) { } function appendAttribute(string memory prefix, string memory key, string memory value, bool asString, bool asNumber, bool append) internal pure returns (string memory text) { } function metadataAttributes(bytes memory punkAssets, uint16 index) internal view returns (string memory text) { } function punkAssetsImage(bytes memory punkAssets) internal view returns (bytes memory) { } function colorForGeneration(uint16 index) internal pure returns (bytes4) { } string private constant SVG_HEADER = '<svg id="crisp" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMax meet" viewBox="0 0 360 360">'; string private constant SVG_FOOTER = '<style>rect{width:15px;height:15px;} #crisp{shape-rendering: crispEdges;} .backdrop{width:360px;height:360px;}</style></svg>'; function punkAssetsImageSvg(bytes memory punkAssets, uint16 index) internal view returns (string memory svg) { } function punkAttributes(uint16 index) external view returns (string memory text) { } function punkImageSvg(uint16 index) public view returns (string memory svg) { } function parseAssets(string memory attributes) internal view returns (bytes memory punkAssets) { } bytes16 private constant HEX_SYMBOLS = "0123456789ABCDEF"; function rectSvg(uint x, uint y, bool backdrop, bytes4 color) internal pure returns (string memory) { } function bufferToString(bytes memory buffer, uint length) internal pure returns (string memory text) { } bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; // [MIT License] // @author Brecht Devos <[email protected]> function base64Encode(bytes memory data) internal pure returns (string memory) { } }
!shouldVerifyLostPunkOwnership||(ownerOf(index)==msg.sender),"Does not own this Lost Punk."
393,800
!shouldVerifyLostPunkOwnership||(ownerOf(index)==msg.sender)
"Previously minted children for father"
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/[email protected]/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/[email protected]/access/Ownable.sol"; import "@openzeppelin/[email protected]/utils/Strings.sol"; interface CryptoPunksAssets { function composite(bytes1, bytes1, bytes1, bytes1, bytes1) external view returns (bytes4); function getAsset(uint8) external view returns (bytes memory); function getAssetName(uint8) external view returns (string memory); function getAssetType(uint8) external view returns (uint8); function getAssetIndex(string calldata, bool) external view returns (uint8); function getMappedAsset(uint8, bool) external view returns (uint8); } interface CryptoPunksData { function punkAttributes(uint16) external view returns (string memory); } interface CryptoPunksMarket { function punkIndexToAddress(uint256) external view returns (address); } contract LostPunkSociety is ERC721Enumerable, Ownable { CryptoPunksAssets private cryptoPunksAssets; CryptoPunksData private cryptoPunksData; CryptoPunksMarket private cryptoPunksMarket; uint16 private constant cryptoPunksCount = 10000; uint16 private punksCount = 10000; uint16 private TOTAL_CAP; uint8 private GENERATION_CAP; uint256 private SEED; uint256 private TIER_PRICE_IN_WEI; mapping(uint16 => bytes) private punks; mapping(uint16 => uint16) private fatherMapping; mapping(uint16 => uint16) private motherMapping; mapping(uint16 => uint16) private generationMapping; mapping(uint16 => uint16) private child1Mapping; mapping(uint16 => uint16) private child2Mapping; bool private shouldVerifyCryptoPunkOwnership; bool private shouldVerifyLostPunkOwnership; bool private freeMintForCryptoPunks; bool private contractSealed; modifier unsealed() { } function sealContract() external onlyOwner unsealed { } function destroy() external onlyOwner unsealed { } function configureEnvironment( address cryptoPunksAssetsAddress, address cryptoPunksDataAddress, address cryptoPunksMarketAddress, uint8 generationCap, uint16 totalCap, uint256 tierPriceInWei, bool freeForCryptoPunks, bool shouldVerifyCryptoPunk, bool shouldVerifyLostPunk) public onlyOwner unsealed { } constructor() ERC721("LostPunkSociety", "LPS") { } address private constant giveDirectlyDonationAddress = 0xc7464dbcA260A8faF033460622B23467Df5AEA42; function withdraw() external onlyOwner { } function composite(bytes1 index, bytes1 yr, bytes1 yg, bytes1 yb, bytes1 ya) internal view returns (bytes4) { } function getAsset(uint8 index) internal view returns (bytes memory) { } function getAssetName(uint8 index) internal view returns (string memory) { } function getAssetType(uint8 index) internal view returns (uint8) { } function getAssetIndex(string memory text, bool isMale) internal view returns (uint8) { } function getMappedAsset(uint8 index, bool toMale) internal view returns (uint8) { } function nextPseudoRandom(uint256 max) internal returns (uint) { } struct TraitInfo { uint8 punkType; bool isMale; bool isDifferent; uint8 assetIndex; uint8 earringIndex; uint8 cigaretteIndex; } function breedPunkAssets(uint16 fatherIndex, uint16 motherIndex) internal returns (bytes memory childAssets) { } function verifyPunkOwnership(uint16 index) internal view { } function mintLostPunk(uint16 fatherIndex, uint16 motherIndex) external payable { require(fatherIndex >= 0 && fatherIndex < punksCount); require(motherIndex >= 0 && motherIndex < punksCount); require(punksCount < TOTAL_CAP, "Total cap reached"); require(<FILL_ME>) require(child2Mapping[motherIndex] == 0, "Previously minted children for mother"); uint16 fm = motherMapping[fatherIndex]; uint16 mf = fatherMapping[motherIndex]; require( ((fm == 0) || ((fm != motherMapping[motherIndex]) && (fm != motherIndex))) && ((mf == 0) || ((mf != fatherMapping[fatherIndex]) && (mf != fatherIndex))), "Cannot mint children for close family"); uint16 fatherGen = generationMapping[fatherIndex]; uint16 motherGen = generationMapping[motherIndex]; uint16 childGen = fatherGen > motherGen ? fatherGen + 1 : motherGen + 1; uint16 tier = freeMintForCryptoPunks ? childGen - 1 : childGen; require(childGen < GENERATION_CAP, "Generation cap reached"); require(tier * TIER_PRICE_IN_WEI <= msg.value, "Insufficient Ether sent"); verifyPunkOwnership(fatherIndex); verifyPunkOwnership(motherIndex); uint16 childIndex = punksCount; punks[punksCount++] = breedPunkAssets(fatherIndex, motherIndex); fatherMapping[childIndex] = fatherIndex; motherMapping[childIndex] = motherIndex; generationMapping[childIndex] = childGen; if (child1Mapping[fatherIndex] == 0) { child1Mapping[fatherIndex] = childIndex; } else { child2Mapping[fatherIndex] = childIndex; } if (child1Mapping[motherIndex] == 0) { child1Mapping[motherIndex] = childIndex; } else { child2Mapping[motherIndex] = childIndex; } _mint(msg.sender, childIndex); } function tokenURI(uint256 index) public view override returns (string memory) { } function getPunkAssets(uint16 index) internal view returns (bytes memory punkAssets) { } function punkAssetsAttributes(bytes memory punkAssets, uint16 index) internal view returns (string memory text) { } function appendAttribute(string memory prefix, string memory key, string memory value, bool asString, bool asNumber, bool append) internal pure returns (string memory text) { } function metadataAttributes(bytes memory punkAssets, uint16 index) internal view returns (string memory text) { } function punkAssetsImage(bytes memory punkAssets) internal view returns (bytes memory) { } function colorForGeneration(uint16 index) internal pure returns (bytes4) { } string private constant SVG_HEADER = '<svg id="crisp" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMax meet" viewBox="0 0 360 360">'; string private constant SVG_FOOTER = '<style>rect{width:15px;height:15px;} #crisp{shape-rendering: crispEdges;} .backdrop{width:360px;height:360px;}</style></svg>'; function punkAssetsImageSvg(bytes memory punkAssets, uint16 index) internal view returns (string memory svg) { } function punkAttributes(uint16 index) external view returns (string memory text) { } function punkImageSvg(uint16 index) public view returns (string memory svg) { } function parseAssets(string memory attributes) internal view returns (bytes memory punkAssets) { } bytes16 private constant HEX_SYMBOLS = "0123456789ABCDEF"; function rectSvg(uint x, uint y, bool backdrop, bytes4 color) internal pure returns (string memory) { } function bufferToString(bytes memory buffer, uint length) internal pure returns (string memory text) { } bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; // [MIT License] // @author Brecht Devos <[email protected]> function base64Encode(bytes memory data) internal pure returns (string memory) { } }
child2Mapping[fatherIndex]==0,"Previously minted children for father"
393,800
child2Mapping[fatherIndex]==0
"Previously minted children for mother"
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/[email protected]/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/[email protected]/access/Ownable.sol"; import "@openzeppelin/[email protected]/utils/Strings.sol"; interface CryptoPunksAssets { function composite(bytes1, bytes1, bytes1, bytes1, bytes1) external view returns (bytes4); function getAsset(uint8) external view returns (bytes memory); function getAssetName(uint8) external view returns (string memory); function getAssetType(uint8) external view returns (uint8); function getAssetIndex(string calldata, bool) external view returns (uint8); function getMappedAsset(uint8, bool) external view returns (uint8); } interface CryptoPunksData { function punkAttributes(uint16) external view returns (string memory); } interface CryptoPunksMarket { function punkIndexToAddress(uint256) external view returns (address); } contract LostPunkSociety is ERC721Enumerable, Ownable { CryptoPunksAssets private cryptoPunksAssets; CryptoPunksData private cryptoPunksData; CryptoPunksMarket private cryptoPunksMarket; uint16 private constant cryptoPunksCount = 10000; uint16 private punksCount = 10000; uint16 private TOTAL_CAP; uint8 private GENERATION_CAP; uint256 private SEED; uint256 private TIER_PRICE_IN_WEI; mapping(uint16 => bytes) private punks; mapping(uint16 => uint16) private fatherMapping; mapping(uint16 => uint16) private motherMapping; mapping(uint16 => uint16) private generationMapping; mapping(uint16 => uint16) private child1Mapping; mapping(uint16 => uint16) private child2Mapping; bool private shouldVerifyCryptoPunkOwnership; bool private shouldVerifyLostPunkOwnership; bool private freeMintForCryptoPunks; bool private contractSealed; modifier unsealed() { } function sealContract() external onlyOwner unsealed { } function destroy() external onlyOwner unsealed { } function configureEnvironment( address cryptoPunksAssetsAddress, address cryptoPunksDataAddress, address cryptoPunksMarketAddress, uint8 generationCap, uint16 totalCap, uint256 tierPriceInWei, bool freeForCryptoPunks, bool shouldVerifyCryptoPunk, bool shouldVerifyLostPunk) public onlyOwner unsealed { } constructor() ERC721("LostPunkSociety", "LPS") { } address private constant giveDirectlyDonationAddress = 0xc7464dbcA260A8faF033460622B23467Df5AEA42; function withdraw() external onlyOwner { } function composite(bytes1 index, bytes1 yr, bytes1 yg, bytes1 yb, bytes1 ya) internal view returns (bytes4) { } function getAsset(uint8 index) internal view returns (bytes memory) { } function getAssetName(uint8 index) internal view returns (string memory) { } function getAssetType(uint8 index) internal view returns (uint8) { } function getAssetIndex(string memory text, bool isMale) internal view returns (uint8) { } function getMappedAsset(uint8 index, bool toMale) internal view returns (uint8) { } function nextPseudoRandom(uint256 max) internal returns (uint) { } struct TraitInfo { uint8 punkType; bool isMale; bool isDifferent; uint8 assetIndex; uint8 earringIndex; uint8 cigaretteIndex; } function breedPunkAssets(uint16 fatherIndex, uint16 motherIndex) internal returns (bytes memory childAssets) { } function verifyPunkOwnership(uint16 index) internal view { } function mintLostPunk(uint16 fatherIndex, uint16 motherIndex) external payable { require(fatherIndex >= 0 && fatherIndex < punksCount); require(motherIndex >= 0 && motherIndex < punksCount); require(punksCount < TOTAL_CAP, "Total cap reached"); require(child2Mapping[fatherIndex] == 0, "Previously minted children for father"); require(<FILL_ME>) uint16 fm = motherMapping[fatherIndex]; uint16 mf = fatherMapping[motherIndex]; require( ((fm == 0) || ((fm != motherMapping[motherIndex]) && (fm != motherIndex))) && ((mf == 0) || ((mf != fatherMapping[fatherIndex]) && (mf != fatherIndex))), "Cannot mint children for close family"); uint16 fatherGen = generationMapping[fatherIndex]; uint16 motherGen = generationMapping[motherIndex]; uint16 childGen = fatherGen > motherGen ? fatherGen + 1 : motherGen + 1; uint16 tier = freeMintForCryptoPunks ? childGen - 1 : childGen; require(childGen < GENERATION_CAP, "Generation cap reached"); require(tier * TIER_PRICE_IN_WEI <= msg.value, "Insufficient Ether sent"); verifyPunkOwnership(fatherIndex); verifyPunkOwnership(motherIndex); uint16 childIndex = punksCount; punks[punksCount++] = breedPunkAssets(fatherIndex, motherIndex); fatherMapping[childIndex] = fatherIndex; motherMapping[childIndex] = motherIndex; generationMapping[childIndex] = childGen; if (child1Mapping[fatherIndex] == 0) { child1Mapping[fatherIndex] = childIndex; } else { child2Mapping[fatherIndex] = childIndex; } if (child1Mapping[motherIndex] == 0) { child1Mapping[motherIndex] = childIndex; } else { child2Mapping[motherIndex] = childIndex; } _mint(msg.sender, childIndex); } function tokenURI(uint256 index) public view override returns (string memory) { } function getPunkAssets(uint16 index) internal view returns (bytes memory punkAssets) { } function punkAssetsAttributes(bytes memory punkAssets, uint16 index) internal view returns (string memory text) { } function appendAttribute(string memory prefix, string memory key, string memory value, bool asString, bool asNumber, bool append) internal pure returns (string memory text) { } function metadataAttributes(bytes memory punkAssets, uint16 index) internal view returns (string memory text) { } function punkAssetsImage(bytes memory punkAssets) internal view returns (bytes memory) { } function colorForGeneration(uint16 index) internal pure returns (bytes4) { } string private constant SVG_HEADER = '<svg id="crisp" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMax meet" viewBox="0 0 360 360">'; string private constant SVG_FOOTER = '<style>rect{width:15px;height:15px;} #crisp{shape-rendering: crispEdges;} .backdrop{width:360px;height:360px;}</style></svg>'; function punkAssetsImageSvg(bytes memory punkAssets, uint16 index) internal view returns (string memory svg) { } function punkAttributes(uint16 index) external view returns (string memory text) { } function punkImageSvg(uint16 index) public view returns (string memory svg) { } function parseAssets(string memory attributes) internal view returns (bytes memory punkAssets) { } bytes16 private constant HEX_SYMBOLS = "0123456789ABCDEF"; function rectSvg(uint x, uint y, bool backdrop, bytes4 color) internal pure returns (string memory) { } function bufferToString(bytes memory buffer, uint length) internal pure returns (string memory text) { } bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; // [MIT License] // @author Brecht Devos <[email protected]> function base64Encode(bytes memory data) internal pure returns (string memory) { } }
child2Mapping[motherIndex]==0,"Previously minted children for mother"
393,800
child2Mapping[motherIndex]==0
"Cannot mint children for close family"
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/[email protected]/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/[email protected]/access/Ownable.sol"; import "@openzeppelin/[email protected]/utils/Strings.sol"; interface CryptoPunksAssets { function composite(bytes1, bytes1, bytes1, bytes1, bytes1) external view returns (bytes4); function getAsset(uint8) external view returns (bytes memory); function getAssetName(uint8) external view returns (string memory); function getAssetType(uint8) external view returns (uint8); function getAssetIndex(string calldata, bool) external view returns (uint8); function getMappedAsset(uint8, bool) external view returns (uint8); } interface CryptoPunksData { function punkAttributes(uint16) external view returns (string memory); } interface CryptoPunksMarket { function punkIndexToAddress(uint256) external view returns (address); } contract LostPunkSociety is ERC721Enumerable, Ownable { CryptoPunksAssets private cryptoPunksAssets; CryptoPunksData private cryptoPunksData; CryptoPunksMarket private cryptoPunksMarket; uint16 private constant cryptoPunksCount = 10000; uint16 private punksCount = 10000; uint16 private TOTAL_CAP; uint8 private GENERATION_CAP; uint256 private SEED; uint256 private TIER_PRICE_IN_WEI; mapping(uint16 => bytes) private punks; mapping(uint16 => uint16) private fatherMapping; mapping(uint16 => uint16) private motherMapping; mapping(uint16 => uint16) private generationMapping; mapping(uint16 => uint16) private child1Mapping; mapping(uint16 => uint16) private child2Mapping; bool private shouldVerifyCryptoPunkOwnership; bool private shouldVerifyLostPunkOwnership; bool private freeMintForCryptoPunks; bool private contractSealed; modifier unsealed() { } function sealContract() external onlyOwner unsealed { } function destroy() external onlyOwner unsealed { } function configureEnvironment( address cryptoPunksAssetsAddress, address cryptoPunksDataAddress, address cryptoPunksMarketAddress, uint8 generationCap, uint16 totalCap, uint256 tierPriceInWei, bool freeForCryptoPunks, bool shouldVerifyCryptoPunk, bool shouldVerifyLostPunk) public onlyOwner unsealed { } constructor() ERC721("LostPunkSociety", "LPS") { } address private constant giveDirectlyDonationAddress = 0xc7464dbcA260A8faF033460622B23467Df5AEA42; function withdraw() external onlyOwner { } function composite(bytes1 index, bytes1 yr, bytes1 yg, bytes1 yb, bytes1 ya) internal view returns (bytes4) { } function getAsset(uint8 index) internal view returns (bytes memory) { } function getAssetName(uint8 index) internal view returns (string memory) { } function getAssetType(uint8 index) internal view returns (uint8) { } function getAssetIndex(string memory text, bool isMale) internal view returns (uint8) { } function getMappedAsset(uint8 index, bool toMale) internal view returns (uint8) { } function nextPseudoRandom(uint256 max) internal returns (uint) { } struct TraitInfo { uint8 punkType; bool isMale; bool isDifferent; uint8 assetIndex; uint8 earringIndex; uint8 cigaretteIndex; } function breedPunkAssets(uint16 fatherIndex, uint16 motherIndex) internal returns (bytes memory childAssets) { } function verifyPunkOwnership(uint16 index) internal view { } function mintLostPunk(uint16 fatherIndex, uint16 motherIndex) external payable { require(fatherIndex >= 0 && fatherIndex < punksCount); require(motherIndex >= 0 && motherIndex < punksCount); require(punksCount < TOTAL_CAP, "Total cap reached"); require(child2Mapping[fatherIndex] == 0, "Previously minted children for father"); require(child2Mapping[motherIndex] == 0, "Previously minted children for mother"); uint16 fm = motherMapping[fatherIndex]; uint16 mf = fatherMapping[motherIndex]; require(<FILL_ME>) uint16 fatherGen = generationMapping[fatherIndex]; uint16 motherGen = generationMapping[motherIndex]; uint16 childGen = fatherGen > motherGen ? fatherGen + 1 : motherGen + 1; uint16 tier = freeMintForCryptoPunks ? childGen - 1 : childGen; require(childGen < GENERATION_CAP, "Generation cap reached"); require(tier * TIER_PRICE_IN_WEI <= msg.value, "Insufficient Ether sent"); verifyPunkOwnership(fatherIndex); verifyPunkOwnership(motherIndex); uint16 childIndex = punksCount; punks[punksCount++] = breedPunkAssets(fatherIndex, motherIndex); fatherMapping[childIndex] = fatherIndex; motherMapping[childIndex] = motherIndex; generationMapping[childIndex] = childGen; if (child1Mapping[fatherIndex] == 0) { child1Mapping[fatherIndex] = childIndex; } else { child2Mapping[fatherIndex] = childIndex; } if (child1Mapping[motherIndex] == 0) { child1Mapping[motherIndex] = childIndex; } else { child2Mapping[motherIndex] = childIndex; } _mint(msg.sender, childIndex); } function tokenURI(uint256 index) public view override returns (string memory) { } function getPunkAssets(uint16 index) internal view returns (bytes memory punkAssets) { } function punkAssetsAttributes(bytes memory punkAssets, uint16 index) internal view returns (string memory text) { } function appendAttribute(string memory prefix, string memory key, string memory value, bool asString, bool asNumber, bool append) internal pure returns (string memory text) { } function metadataAttributes(bytes memory punkAssets, uint16 index) internal view returns (string memory text) { } function punkAssetsImage(bytes memory punkAssets) internal view returns (bytes memory) { } function colorForGeneration(uint16 index) internal pure returns (bytes4) { } string private constant SVG_HEADER = '<svg id="crisp" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMax meet" viewBox="0 0 360 360">'; string private constant SVG_FOOTER = '<style>rect{width:15px;height:15px;} #crisp{shape-rendering: crispEdges;} .backdrop{width:360px;height:360px;}</style></svg>'; function punkAssetsImageSvg(bytes memory punkAssets, uint16 index) internal view returns (string memory svg) { } function punkAttributes(uint16 index) external view returns (string memory text) { } function punkImageSvg(uint16 index) public view returns (string memory svg) { } function parseAssets(string memory attributes) internal view returns (bytes memory punkAssets) { } bytes16 private constant HEX_SYMBOLS = "0123456789ABCDEF"; function rectSvg(uint x, uint y, bool backdrop, bytes4 color) internal pure returns (string memory) { } function bufferToString(bytes memory buffer, uint length) internal pure returns (string memory text) { } bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; // [MIT License] // @author Brecht Devos <[email protected]> function base64Encode(bytes memory data) internal pure returns (string memory) { } }
((fm==0)||((fm!=motherMapping[motherIndex])&&(fm!=motherIndex)))&&((mf==0)||((mf!=fatherMapping[fatherIndex])&&(mf!=fatherIndex))),"Cannot mint children for close family"
393,800
((fm==0)||((fm!=motherMapping[motherIndex])&&(fm!=motherIndex)))&&((mf==0)||((mf!=fatherMapping[fatherIndex])&&(mf!=fatherIndex)))
"Insufficient Ether sent"
// SPDX-License-Identifier: MIT pragma solidity 0.8.0; import "@openzeppelin/[email protected]/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/[email protected]/access/Ownable.sol"; import "@openzeppelin/[email protected]/utils/Strings.sol"; interface CryptoPunksAssets { function composite(bytes1, bytes1, bytes1, bytes1, bytes1) external view returns (bytes4); function getAsset(uint8) external view returns (bytes memory); function getAssetName(uint8) external view returns (string memory); function getAssetType(uint8) external view returns (uint8); function getAssetIndex(string calldata, bool) external view returns (uint8); function getMappedAsset(uint8, bool) external view returns (uint8); } interface CryptoPunksData { function punkAttributes(uint16) external view returns (string memory); } interface CryptoPunksMarket { function punkIndexToAddress(uint256) external view returns (address); } contract LostPunkSociety is ERC721Enumerable, Ownable { CryptoPunksAssets private cryptoPunksAssets; CryptoPunksData private cryptoPunksData; CryptoPunksMarket private cryptoPunksMarket; uint16 private constant cryptoPunksCount = 10000; uint16 private punksCount = 10000; uint16 private TOTAL_CAP; uint8 private GENERATION_CAP; uint256 private SEED; uint256 private TIER_PRICE_IN_WEI; mapping(uint16 => bytes) private punks; mapping(uint16 => uint16) private fatherMapping; mapping(uint16 => uint16) private motherMapping; mapping(uint16 => uint16) private generationMapping; mapping(uint16 => uint16) private child1Mapping; mapping(uint16 => uint16) private child2Mapping; bool private shouldVerifyCryptoPunkOwnership; bool private shouldVerifyLostPunkOwnership; bool private freeMintForCryptoPunks; bool private contractSealed; modifier unsealed() { } function sealContract() external onlyOwner unsealed { } function destroy() external onlyOwner unsealed { } function configureEnvironment( address cryptoPunksAssetsAddress, address cryptoPunksDataAddress, address cryptoPunksMarketAddress, uint8 generationCap, uint16 totalCap, uint256 tierPriceInWei, bool freeForCryptoPunks, bool shouldVerifyCryptoPunk, bool shouldVerifyLostPunk) public onlyOwner unsealed { } constructor() ERC721("LostPunkSociety", "LPS") { } address private constant giveDirectlyDonationAddress = 0xc7464dbcA260A8faF033460622B23467Df5AEA42; function withdraw() external onlyOwner { } function composite(bytes1 index, bytes1 yr, bytes1 yg, bytes1 yb, bytes1 ya) internal view returns (bytes4) { } function getAsset(uint8 index) internal view returns (bytes memory) { } function getAssetName(uint8 index) internal view returns (string memory) { } function getAssetType(uint8 index) internal view returns (uint8) { } function getAssetIndex(string memory text, bool isMale) internal view returns (uint8) { } function getMappedAsset(uint8 index, bool toMale) internal view returns (uint8) { } function nextPseudoRandom(uint256 max) internal returns (uint) { } struct TraitInfo { uint8 punkType; bool isMale; bool isDifferent; uint8 assetIndex; uint8 earringIndex; uint8 cigaretteIndex; } function breedPunkAssets(uint16 fatherIndex, uint16 motherIndex) internal returns (bytes memory childAssets) { } function verifyPunkOwnership(uint16 index) internal view { } function mintLostPunk(uint16 fatherIndex, uint16 motherIndex) external payable { require(fatherIndex >= 0 && fatherIndex < punksCount); require(motherIndex >= 0 && motherIndex < punksCount); require(punksCount < TOTAL_CAP, "Total cap reached"); require(child2Mapping[fatherIndex] == 0, "Previously minted children for father"); require(child2Mapping[motherIndex] == 0, "Previously minted children for mother"); uint16 fm = motherMapping[fatherIndex]; uint16 mf = fatherMapping[motherIndex]; require( ((fm == 0) || ((fm != motherMapping[motherIndex]) && (fm != motherIndex))) && ((mf == 0) || ((mf != fatherMapping[fatherIndex]) && (mf != fatherIndex))), "Cannot mint children for close family"); uint16 fatherGen = generationMapping[fatherIndex]; uint16 motherGen = generationMapping[motherIndex]; uint16 childGen = fatherGen > motherGen ? fatherGen + 1 : motherGen + 1; uint16 tier = freeMintForCryptoPunks ? childGen - 1 : childGen; require(childGen < GENERATION_CAP, "Generation cap reached"); require(<FILL_ME>) verifyPunkOwnership(fatherIndex); verifyPunkOwnership(motherIndex); uint16 childIndex = punksCount; punks[punksCount++] = breedPunkAssets(fatherIndex, motherIndex); fatherMapping[childIndex] = fatherIndex; motherMapping[childIndex] = motherIndex; generationMapping[childIndex] = childGen; if (child1Mapping[fatherIndex] == 0) { child1Mapping[fatherIndex] = childIndex; } else { child2Mapping[fatherIndex] = childIndex; } if (child1Mapping[motherIndex] == 0) { child1Mapping[motherIndex] = childIndex; } else { child2Mapping[motherIndex] = childIndex; } _mint(msg.sender, childIndex); } function tokenURI(uint256 index) public view override returns (string memory) { } function getPunkAssets(uint16 index) internal view returns (bytes memory punkAssets) { } function punkAssetsAttributes(bytes memory punkAssets, uint16 index) internal view returns (string memory text) { } function appendAttribute(string memory prefix, string memory key, string memory value, bool asString, bool asNumber, bool append) internal pure returns (string memory text) { } function metadataAttributes(bytes memory punkAssets, uint16 index) internal view returns (string memory text) { } function punkAssetsImage(bytes memory punkAssets) internal view returns (bytes memory) { } function colorForGeneration(uint16 index) internal pure returns (bytes4) { } string private constant SVG_HEADER = '<svg id="crisp" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="xMidYMax meet" viewBox="0 0 360 360">'; string private constant SVG_FOOTER = '<style>rect{width:15px;height:15px;} #crisp{shape-rendering: crispEdges;} .backdrop{width:360px;height:360px;}</style></svg>'; function punkAssetsImageSvg(bytes memory punkAssets, uint16 index) internal view returns (string memory svg) { } function punkAttributes(uint16 index) external view returns (string memory text) { } function punkImageSvg(uint16 index) public view returns (string memory svg) { } function parseAssets(string memory attributes) internal view returns (bytes memory punkAssets) { } bytes16 private constant HEX_SYMBOLS = "0123456789ABCDEF"; function rectSvg(uint x, uint y, bool backdrop, bytes4 color) internal pure returns (string memory) { } function bufferToString(bytes memory buffer, uint length) internal pure returns (string memory text) { } bytes internal constant TABLE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; // [MIT License] // @author Brecht Devos <[email protected]> function base64Encode(bytes memory data) internal pure returns (string memory) { } }
tier*TIER_PRICE_IN_WEI<=msg.value,"Insufficient Ether sent"
393,800
tier*TIER_PRICE_IN_WEI<=msg.value
"Get Tokens fail"
// SPDX-License-Identifier: MIT pragma solidity >=0.6.8; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import { IERC20, SafeMath, Ownable } from './interfaces/CommonImports.sol'; import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol'; contract RefundContract is Ownable, ReentrancyGuard { using SafeMath for uint256; uint256 public ETHperTokens = 0.00248 ether; uint256 public totalETHRefunded = 0; uint256 public totalTokens = 0; address burnAddr = 0x000000000000000000000000000000000000dEaD; IERC20 public token = IERC20(0xA6D84dce85c457d28A971f858967002BFDe74c1c); receive() external payable {} event Refunded(uint256 indexed tokensGotten,uint256 indexed ethSent); event RateChanged(uint256 indexed newRate); event ETHRetrived(); function refund(uint256 tokenAmount) public nonReentrant { uint256 startETHBal = address(this).balance; //Get tokens from user require(<FILL_ME>) //send eth (bool refundT,) = payable(msg.sender).call{ value: tokenAmount.mul(ETHperTokens).div(1e18) }(""); require(refundT,"Eth refund failed"); //send gotten tokens to burn address require(token.transfer(burnAddr,tokenAmount),"Burning swapped tokens fail"); //Update total eth refund stat and emit event uint256 ethDiff = address(this).balance.sub(startETHBal); totalETHRefunded = totalETHRefunded.add(ethDiff); totalTokens = totalTokens.add(tokenAmount); emit Refunded(tokenAmount,ethDiff); } function setExchangeRate(uint256 newRate) public onlyOwner { } function setToken(address tokenAddr) public onlyOwner { } //Use this only in emergency cases to retreive eth from contract function retriveETH() public onlyOwner { } }
token.transferFrom(msg.sender,address(this),tokenAmount),"Get Tokens fail"
393,857
token.transferFrom(msg.sender,address(this),tokenAmount)
"Burning swapped tokens fail"
// SPDX-License-Identifier: MIT pragma solidity >=0.6.8; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; import { IERC20, SafeMath, Ownable } from './interfaces/CommonImports.sol'; import '@openzeppelin/contracts/token/ERC20/SafeERC20.sol'; contract RefundContract is Ownable, ReentrancyGuard { using SafeMath for uint256; uint256 public ETHperTokens = 0.00248 ether; uint256 public totalETHRefunded = 0; uint256 public totalTokens = 0; address burnAddr = 0x000000000000000000000000000000000000dEaD; IERC20 public token = IERC20(0xA6D84dce85c457d28A971f858967002BFDe74c1c); receive() external payable {} event Refunded(uint256 indexed tokensGotten,uint256 indexed ethSent); event RateChanged(uint256 indexed newRate); event ETHRetrived(); function refund(uint256 tokenAmount) public nonReentrant { uint256 startETHBal = address(this).balance; //Get tokens from user require(token.transferFrom(msg.sender,address(this),tokenAmount),"Get Tokens fail"); //send eth (bool refundT,) = payable(msg.sender).call{ value: tokenAmount.mul(ETHperTokens).div(1e18) }(""); require(refundT,"Eth refund failed"); //send gotten tokens to burn address require(<FILL_ME>) //Update total eth refund stat and emit event uint256 ethDiff = address(this).balance.sub(startETHBal); totalETHRefunded = totalETHRefunded.add(ethDiff); totalTokens = totalTokens.add(tokenAmount); emit Refunded(tokenAmount,ethDiff); } function setExchangeRate(uint256 newRate) public onlyOwner { } function setToken(address tokenAddr) public onlyOwner { } //Use this only in emergency cases to retreive eth from contract function retriveETH() public onlyOwner { } }
token.transfer(burnAddr,tokenAmount),"Burning swapped tokens fail"
393,857
token.transfer(burnAddr,tokenAmount)
"cannot be a contract"
pragma solidity 0.6.3; abstract contract Context { function _msgSender() internal view virtual returns (address payable) { } function _msgData() internal view virtual returns (bytes memory) { } } interface IERC20 { function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ 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); event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); } library SafeMath { function add(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor () internal { } /** * @dev Returns the address of the current owner. */ function owner() public view returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } } library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { } function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) { } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { } function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) { } } library SafeERC20 { using SafeMath for uint256; using Address for address; function safeTransfer(IERC20 token, address to, uint256 value) internal { } function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal { } function safeApprove(IERC20 token, address spender, uint256 value) internal { } function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { } function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal { } function _callOptionalReturn(IERC20 token, bytes memory data) private { } } contract MasterChef is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 pid; uint256 amount; // How many LP tokens the user has provided. uint256 reward; uint256 rewardPaid; uint256 userRewardPerTokenPaid; } // Info of each user that stakes LP tokens. mapping (uint256 => mapping (address => UserInfo)) public userInfo; // Info of each pool. struct PoolInfo { IERC20 lpToken; // Address of LP token contract. uint256 allocPoint; // How many allocation points assigned to this pool. Pizzas to distribute per block. uint256 lastRewardTime; // Last block number that Pizzas distribution occurs. uint256 accPizzaPerShare; // Accumulated Pizzas per share, times 1e18. See below. uint256 totalPool; } // Info of each pool. PoolInfo[] public poolInfo; struct User { uint id; address referrer; uint256[] referAmount; uint256 referReward; uint256 totalReward; uint256 referRewardPerTokenPaid; } mapping(address => User) public users; uint public lastUserId = 2; mapping(uint256 => address) public regisUser; bool initialized = false; //uint256 public initreward = 1250*1e18; uint256 public starttime = 1599829200; uint256 public periodFinish = 0; uint256 public rewardRate = 0; uint256 public totalMinted = 0; //The Pizza TOKEN! // IERC20 public pizza = IERC20(0x54CF703014A82B4FF7E9a95DD45e453e1Ba13eb1); IERC20 public pizza ; address public defaultReferAddr = address(0xCfCe2a772ae87c5Fae474b2dE0324ee19C2c145f); // Total allocation poitns. Must be the sum of all allocation points in all pools. uint256 public totalAllocPoint = 0; // Bonus muliplier for early pizza makers. uint256 public constant BONUS_MULTIPLIER = 1; event RewardPaid(address indexed user, uint256 reward); event Deposit(address indexed user, uint256 indexed pid, uint256 amount); event Withdraw(address indexed user, uint256 indexed pid, uint256 amount); event Registration(address indexed user, address indexed referrer, uint indexed userId, uint referrerId); //constructor // function initContract constructor (IERC20 _pizza,uint256 _rewardRate,uint256 _starttime,uint256 _periodFinish,address _defaultReferAddr) public onlyOwner{ } function poolLength() external view returns (uint256) { } function isUserExists(address user) public view returns (bool) { } function registrationExt(address referrerAddress) external { } function registration(address userAddress, address referrerAddress) private { //require(msg.value == 0.05 ether, "registration cost 0.05"); require(!isUserExists(userAddress), "user exists"); require(isUserExists(referrerAddress), "referrer not exists"); // uint32 size; //assembly { // size := extcodesize(userAddress) // } //require(size == 0, "cannot be a contract"); require(<FILL_ME>) User memory user = User({ id: lastUserId, referrer: referrerAddress, referAmount:new uint256[](2), totalReward:0, referReward:0, referRewardPerTokenPaid:0 }); regisUser[lastUserId] = userAddress; users[userAddress] = user; lastUserId++; emit Registration(userAddress, referrerAddress, users[userAddress].id, users[referrerAddress].id); } // Add a new lp to the pool. Can only be called by the owner. // XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do. function addLp(uint256 _allocPoint, IERC20 _lpToken) public onlyOwner { } // Update the given pool's Pizza allocation point. Can only be called by the owner. function set(uint256 _pid, uint256 _allocPoint) public onlyOwner { } function setTotalAllocPoint(uint256 _totalAllocPoint) public onlyOwner{ } function setRewardRate(uint256 _rewardRate) public onlyOwner { } // Return reward multiplier over the given _from to _to block. function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) { } function getRewardRate() public view returns(uint256){ } function pendingPizza(uint256 _pid, address _user) public view returns (uint256) { } function pendingAllPizza(address _user) public view returns (uint256) { } function allPizzaAmount(address _user) public view returns (uint256) { } function getAllDeposit(address _user) public view returns (uint256) { } function getReferAmount(address _user,uint256 _index) public view returns(uint256){ } // Update reward variables of the given pool to be up-to-date. function updatePool(uint256 _pid,address _user) internal { } // Deposit LP tokens to MasterChef for pizza allocation. function deposit(uint256 _pid, uint256 _amount) public checkStart { } function getReward(uint256 _pid) public { } // Withdraw LP tokens from MasterChef. function withdraw(uint256 _pid, uint256 _amount) public{ } // Withdraw without caring about rewards. EMERGENCY ONLY. // function emergencyWithdraw(uint256 _pid) public { // PoolInfo storage pool = poolInfo[_pid]; // UserInfo storage user = userInfo[_pid][msg.sender]; // pool.lpToken.safeTransfer(address(msg.sender), user.amount); // emit EmergencyWithdraw(msg.sender, _pid, user.amount); // user.amount = 0; // } // Safe pizza transfer function, just in case if rounding error causes pool to not have enough pizzas. function safePizzaTransfer(address _to, uint256 _amount) internal { } modifier checkStart(){ } }
!Address.isContract(userAddress),"cannot be a contract"
393,923
!Address.isContract(userAddress)
"Invalid asset"
interface Events { function transaction(string _message, address _from, address _to, uint _amount, address _token) external; function asset(string _message, string _uri, address _assetAddress, address _manager); } interface DB { function addressStorage(bytes32 _key) external view returns (address); function uintStorage(bytes32 _key) external view returns (uint); function setUint(bytes32 _key, uint _value) external; function deleteUint(bytes32 _key) external; function setBool(bytes32 _key, bool _value) external; function boolStorage(bytes32 _key) external view returns (bool); } // @title An asset crowdsale contract which accepts funding from ERC20 tokens. // @notice Begins a crowdfunding period for a digital asset, minting asset dividend tokens to investors when particular ERC20 token is received // @author Kyle Dewhurst, MyBit Foundation // @notice creates a dividend token to represent the newly created asset. contract CrowdsaleERC20{ using SafeMath for uint256; DB private database; Events private events; MinterInterface private minter; CrowdsaleReserveInterface private reserve; KyberInterface private kyber; // @notice Constructor: initializes database instance // @param: The address for the platform database constructor(address _database, address _events, address _kyber) public{ } // @notice Investors can send ERC20 tokens here to fund an asset, receiving an equivalent number of asset-tokens. // @dev investor must approve this contract to transfer tokens // @param (address) _assetAddress = The address of the asset tokens, investor wishes to purchase // @param (uint) _amount = The amount to spend purchasing this asset function buyAssetOrderERC20(address _assetAddress, uint _amount, address _paymentToken) external payable returns (bool) { require(<FILL_ME>) require(now <= database.uintStorage(keccak256(abi.encodePacked("crowdsale.deadline", _assetAddress))), "Past deadline"); require(!database.boolStorage(keccak256(abi.encodePacked("crowdsale.finalized", _assetAddress))), "Crowdsale finalized"); if(_paymentToken == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)){ require(msg.value == _amount, 'Msg.value does not match amount'); } else { require(msg.value == 0, 'Msg.value should equal zero'); } ERC20 fundingToken = ERC20(DividendInterface(_assetAddress).getERC20()); uint fundingRemaining = database.uintStorage(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress))); uint collected; //This will be the value received by the contract after any conversions uint amount; //The number of tokens that will be minted //Check if the payment token is the same as the funding token. If not, convert, else just collect the funds if(_paymentToken == address(fundingToken)){ collected = collectPayment(msg.sender, _amount, fundingRemaining, fundingToken); } else { collected = convertTokens(msg.sender, _amount, fundingToken, ERC20(_paymentToken), fundingRemaining); } require(collected > 0); if(collected < fundingRemaining){ amount = collected.mul(100).div(uint(100).add(database.uintStorage(keccak256(abi.encodePacked("platform.fee"))))); database.setUint(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress)), fundingRemaining.sub(collected)); require(minter.mintAssetTokens(_assetAddress, msg.sender, amount), "Investor minting failed"); require(fundingToken.transfer(address(reserve), collected)); } else { amount = fundingRemaining.mul(100).div(uint(100).add(database.uintStorage(keccak256(abi.encodePacked("platform.fee"))))); database.setBool(keccak256(abi.encodePacked("crowdsale.finalized", _assetAddress)), true); database.deleteUint(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress))); require(minter.mintAssetTokens(_assetAddress, msg.sender, amount), "Investor minting failed"); // Send remaining asset tokens to investor require(fundingToken.transfer(address(reserve), fundingRemaining)); events.asset('Crowdsale finalized', '', _assetAddress, msg.sender); if(collected > fundingRemaining){ require(fundingToken.transfer(msg.sender, collected.sub(fundingRemaining))); // return extra funds } } events.transaction('Asset purchased', address(this), msg.sender, amount, _assetAddress); return true; } // @notice This is called once funding has succeeded. Sends Ether to a distribution contract where operator/assetManager can withdraw // @dev The contract manager needs to know the address PlatformDistribution contract function payoutERC20(address _assetAddress) external whenNotPaused returns (bool) { } function cancel(address _assetAddress) external whenNotPaused validAsset(_assetAddress) beforeDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool){ } // @notice Contributors can retrieve their funds here if crowdsale has paased deadline // @param (address) _assetAddress = The address of the asset which didn't reach it's crowdfunding goals function refund(address _assetAddress) public whenNotPaused validAsset(_assetAddress) afterDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool) { } //------------------------------------------------------------------------------------------------------------------ // Internal Functions //------------------------------------------------------------------------------------------------------------------ function collectPayment(address user, uint amount, uint max, ERC20 token) private returns (uint){ } /* function fundBurn(address _investor, uint _amount, bytes4 _sig, ERC20 _burnToken) private returns (uint) { require(_burnToken.transferFrom(_investor, address(this), _amount), "Transfer failed"); // transfer investors tokens into contract uint balanceBefore = _burnToken.balanceOf(this); require(burner.burn(address(this), database.uintStorage(keccak256(abi.encodePacked(_sig, address(this)))), address(_burnToken))); uint change = _burnToken.balanceOf(this) - balanceBefore; return change; } */ function convertTokens(address _investor, uint _amount, /*bytes4 _sig,*/ ERC20 _fundingToken, ERC20 _paymentToken, uint _maxTokens) private returns (uint) { } // @notice platform owners can recover tokens here function recoverTokens(address _erc20Token) onlyOwner external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } // @notice fallback function. We need to receive Ether from Kyber Network function () external payable { } //------------------------------------------------------------------------------------------------------------------ // Modifiers //------------------------------------------------------------------------------------------------------------------ // @notice Sender must be a registered owner modifier onlyOwner { } // @notice function won't run if owners have paused this contract modifier whenNotPaused { } // @notice reverts if the asset does not have a token address set in the database modifier validAsset(address _assetAddress) { } // @notice reverts if the funding deadline has not passed modifier beforeDeadline(address _assetAddress) { } // @notice reverts if the funding deadline has already past or crowsale has not started modifier betweenDeadlines(address _assetAddress) { } // @notice reverts if the funding deadline has already past modifier afterDeadline(address _assetAddress) { } // @notice returns true if crowdsale is finshed modifier finalized(address _assetAddress) { } // @notice returns true if crowdsale is not finshed modifier notFinalized(address _assetAddress) { } // @notice returns true if crowdsale has not paid out modifier notPaid(address _assetAddress) { } event Convert(address token, uint change, uint investment); event EtherReceived(address sender, uint amount); }
database.addressStorage(keccak256(abi.encodePacked("asset.manager",_assetAddress)))!=address(0),"Invalid asset"
393,952
database.addressStorage(keccak256(abi.encodePacked("asset.manager",_assetAddress)))!=address(0)
"Crowdsale finalized"
interface Events { function transaction(string _message, address _from, address _to, uint _amount, address _token) external; function asset(string _message, string _uri, address _assetAddress, address _manager); } interface DB { function addressStorage(bytes32 _key) external view returns (address); function uintStorage(bytes32 _key) external view returns (uint); function setUint(bytes32 _key, uint _value) external; function deleteUint(bytes32 _key) external; function setBool(bytes32 _key, bool _value) external; function boolStorage(bytes32 _key) external view returns (bool); } // @title An asset crowdsale contract which accepts funding from ERC20 tokens. // @notice Begins a crowdfunding period for a digital asset, minting asset dividend tokens to investors when particular ERC20 token is received // @author Kyle Dewhurst, MyBit Foundation // @notice creates a dividend token to represent the newly created asset. contract CrowdsaleERC20{ using SafeMath for uint256; DB private database; Events private events; MinterInterface private minter; CrowdsaleReserveInterface private reserve; KyberInterface private kyber; // @notice Constructor: initializes database instance // @param: The address for the platform database constructor(address _database, address _events, address _kyber) public{ } // @notice Investors can send ERC20 tokens here to fund an asset, receiving an equivalent number of asset-tokens. // @dev investor must approve this contract to transfer tokens // @param (address) _assetAddress = The address of the asset tokens, investor wishes to purchase // @param (uint) _amount = The amount to spend purchasing this asset function buyAssetOrderERC20(address _assetAddress, uint _amount, address _paymentToken) external payable returns (bool) { require(database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress))) != address(0), "Invalid asset"); require(now <= database.uintStorage(keccak256(abi.encodePacked("crowdsale.deadline", _assetAddress))), "Past deadline"); require(<FILL_ME>) if(_paymentToken == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)){ require(msg.value == _amount, 'Msg.value does not match amount'); } else { require(msg.value == 0, 'Msg.value should equal zero'); } ERC20 fundingToken = ERC20(DividendInterface(_assetAddress).getERC20()); uint fundingRemaining = database.uintStorage(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress))); uint collected; //This will be the value received by the contract after any conversions uint amount; //The number of tokens that will be minted //Check if the payment token is the same as the funding token. If not, convert, else just collect the funds if(_paymentToken == address(fundingToken)){ collected = collectPayment(msg.sender, _amount, fundingRemaining, fundingToken); } else { collected = convertTokens(msg.sender, _amount, fundingToken, ERC20(_paymentToken), fundingRemaining); } require(collected > 0); if(collected < fundingRemaining){ amount = collected.mul(100).div(uint(100).add(database.uintStorage(keccak256(abi.encodePacked("platform.fee"))))); database.setUint(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress)), fundingRemaining.sub(collected)); require(minter.mintAssetTokens(_assetAddress, msg.sender, amount), "Investor minting failed"); require(fundingToken.transfer(address(reserve), collected)); } else { amount = fundingRemaining.mul(100).div(uint(100).add(database.uintStorage(keccak256(abi.encodePacked("platform.fee"))))); database.setBool(keccak256(abi.encodePacked("crowdsale.finalized", _assetAddress)), true); database.deleteUint(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress))); require(minter.mintAssetTokens(_assetAddress, msg.sender, amount), "Investor minting failed"); // Send remaining asset tokens to investor require(fundingToken.transfer(address(reserve), fundingRemaining)); events.asset('Crowdsale finalized', '', _assetAddress, msg.sender); if(collected > fundingRemaining){ require(fundingToken.transfer(msg.sender, collected.sub(fundingRemaining))); // return extra funds } } events.transaction('Asset purchased', address(this), msg.sender, amount, _assetAddress); return true; } // @notice This is called once funding has succeeded. Sends Ether to a distribution contract where operator/assetManager can withdraw // @dev The contract manager needs to know the address PlatformDistribution contract function payoutERC20(address _assetAddress) external whenNotPaused returns (bool) { } function cancel(address _assetAddress) external whenNotPaused validAsset(_assetAddress) beforeDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool){ } // @notice Contributors can retrieve their funds here if crowdsale has paased deadline // @param (address) _assetAddress = The address of the asset which didn't reach it's crowdfunding goals function refund(address _assetAddress) public whenNotPaused validAsset(_assetAddress) afterDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool) { } //------------------------------------------------------------------------------------------------------------------ // Internal Functions //------------------------------------------------------------------------------------------------------------------ function collectPayment(address user, uint amount, uint max, ERC20 token) private returns (uint){ } /* function fundBurn(address _investor, uint _amount, bytes4 _sig, ERC20 _burnToken) private returns (uint) { require(_burnToken.transferFrom(_investor, address(this), _amount), "Transfer failed"); // transfer investors tokens into contract uint balanceBefore = _burnToken.balanceOf(this); require(burner.burn(address(this), database.uintStorage(keccak256(abi.encodePacked(_sig, address(this)))), address(_burnToken))); uint change = _burnToken.balanceOf(this) - balanceBefore; return change; } */ function convertTokens(address _investor, uint _amount, /*bytes4 _sig,*/ ERC20 _fundingToken, ERC20 _paymentToken, uint _maxTokens) private returns (uint) { } // @notice platform owners can recover tokens here function recoverTokens(address _erc20Token) onlyOwner external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } // @notice fallback function. We need to receive Ether from Kyber Network function () external payable { } //------------------------------------------------------------------------------------------------------------------ // Modifiers //------------------------------------------------------------------------------------------------------------------ // @notice Sender must be a registered owner modifier onlyOwner { } // @notice function won't run if owners have paused this contract modifier whenNotPaused { } // @notice reverts if the asset does not have a token address set in the database modifier validAsset(address _assetAddress) { } // @notice reverts if the funding deadline has not passed modifier beforeDeadline(address _assetAddress) { } // @notice reverts if the funding deadline has already past or crowsale has not started modifier betweenDeadlines(address _assetAddress) { } // @notice reverts if the funding deadline has already past modifier afterDeadline(address _assetAddress) { } // @notice returns true if crowdsale is finshed modifier finalized(address _assetAddress) { } // @notice returns true if crowdsale is not finshed modifier notFinalized(address _assetAddress) { } // @notice returns true if crowdsale has not paid out modifier notPaid(address _assetAddress) { } event Convert(address token, uint change, uint investment); event EtherReceived(address sender, uint amount); }
!database.boolStorage(keccak256(abi.encodePacked("crowdsale.finalized",_assetAddress))),"Crowdsale finalized"
393,952
!database.boolStorage(keccak256(abi.encodePacked("crowdsale.finalized",_assetAddress)))
"Investor minting failed"
interface Events { function transaction(string _message, address _from, address _to, uint _amount, address _token) external; function asset(string _message, string _uri, address _assetAddress, address _manager); } interface DB { function addressStorage(bytes32 _key) external view returns (address); function uintStorage(bytes32 _key) external view returns (uint); function setUint(bytes32 _key, uint _value) external; function deleteUint(bytes32 _key) external; function setBool(bytes32 _key, bool _value) external; function boolStorage(bytes32 _key) external view returns (bool); } // @title An asset crowdsale contract which accepts funding from ERC20 tokens. // @notice Begins a crowdfunding period for a digital asset, minting asset dividend tokens to investors when particular ERC20 token is received // @author Kyle Dewhurst, MyBit Foundation // @notice creates a dividend token to represent the newly created asset. contract CrowdsaleERC20{ using SafeMath for uint256; DB private database; Events private events; MinterInterface private minter; CrowdsaleReserveInterface private reserve; KyberInterface private kyber; // @notice Constructor: initializes database instance // @param: The address for the platform database constructor(address _database, address _events, address _kyber) public{ } // @notice Investors can send ERC20 tokens here to fund an asset, receiving an equivalent number of asset-tokens. // @dev investor must approve this contract to transfer tokens // @param (address) _assetAddress = The address of the asset tokens, investor wishes to purchase // @param (uint) _amount = The amount to spend purchasing this asset function buyAssetOrderERC20(address _assetAddress, uint _amount, address _paymentToken) external payable returns (bool) { require(database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress))) != address(0), "Invalid asset"); require(now <= database.uintStorage(keccak256(abi.encodePacked("crowdsale.deadline", _assetAddress))), "Past deadline"); require(!database.boolStorage(keccak256(abi.encodePacked("crowdsale.finalized", _assetAddress))), "Crowdsale finalized"); if(_paymentToken == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)){ require(msg.value == _amount, 'Msg.value does not match amount'); } else { require(msg.value == 0, 'Msg.value should equal zero'); } ERC20 fundingToken = ERC20(DividendInterface(_assetAddress).getERC20()); uint fundingRemaining = database.uintStorage(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress))); uint collected; //This will be the value received by the contract after any conversions uint amount; //The number of tokens that will be minted //Check if the payment token is the same as the funding token. If not, convert, else just collect the funds if(_paymentToken == address(fundingToken)){ collected = collectPayment(msg.sender, _amount, fundingRemaining, fundingToken); } else { collected = convertTokens(msg.sender, _amount, fundingToken, ERC20(_paymentToken), fundingRemaining); } require(collected > 0); if(collected < fundingRemaining){ amount = collected.mul(100).div(uint(100).add(database.uintStorage(keccak256(abi.encodePacked("platform.fee"))))); database.setUint(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress)), fundingRemaining.sub(collected)); require(<FILL_ME>) require(fundingToken.transfer(address(reserve), collected)); } else { amount = fundingRemaining.mul(100).div(uint(100).add(database.uintStorage(keccak256(abi.encodePacked("platform.fee"))))); database.setBool(keccak256(abi.encodePacked("crowdsale.finalized", _assetAddress)), true); database.deleteUint(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress))); require(minter.mintAssetTokens(_assetAddress, msg.sender, amount), "Investor minting failed"); // Send remaining asset tokens to investor require(fundingToken.transfer(address(reserve), fundingRemaining)); events.asset('Crowdsale finalized', '', _assetAddress, msg.sender); if(collected > fundingRemaining){ require(fundingToken.transfer(msg.sender, collected.sub(fundingRemaining))); // return extra funds } } events.transaction('Asset purchased', address(this), msg.sender, amount, _assetAddress); return true; } // @notice This is called once funding has succeeded. Sends Ether to a distribution contract where operator/assetManager can withdraw // @dev The contract manager needs to know the address PlatformDistribution contract function payoutERC20(address _assetAddress) external whenNotPaused returns (bool) { } function cancel(address _assetAddress) external whenNotPaused validAsset(_assetAddress) beforeDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool){ } // @notice Contributors can retrieve their funds here if crowdsale has paased deadline // @param (address) _assetAddress = The address of the asset which didn't reach it's crowdfunding goals function refund(address _assetAddress) public whenNotPaused validAsset(_assetAddress) afterDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool) { } //------------------------------------------------------------------------------------------------------------------ // Internal Functions //------------------------------------------------------------------------------------------------------------------ function collectPayment(address user, uint amount, uint max, ERC20 token) private returns (uint){ } /* function fundBurn(address _investor, uint _amount, bytes4 _sig, ERC20 _burnToken) private returns (uint) { require(_burnToken.transferFrom(_investor, address(this), _amount), "Transfer failed"); // transfer investors tokens into contract uint balanceBefore = _burnToken.balanceOf(this); require(burner.burn(address(this), database.uintStorage(keccak256(abi.encodePacked(_sig, address(this)))), address(_burnToken))); uint change = _burnToken.balanceOf(this) - balanceBefore; return change; } */ function convertTokens(address _investor, uint _amount, /*bytes4 _sig,*/ ERC20 _fundingToken, ERC20 _paymentToken, uint _maxTokens) private returns (uint) { } // @notice platform owners can recover tokens here function recoverTokens(address _erc20Token) onlyOwner external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } // @notice fallback function. We need to receive Ether from Kyber Network function () external payable { } //------------------------------------------------------------------------------------------------------------------ // Modifiers //------------------------------------------------------------------------------------------------------------------ // @notice Sender must be a registered owner modifier onlyOwner { } // @notice function won't run if owners have paused this contract modifier whenNotPaused { } // @notice reverts if the asset does not have a token address set in the database modifier validAsset(address _assetAddress) { } // @notice reverts if the funding deadline has not passed modifier beforeDeadline(address _assetAddress) { } // @notice reverts if the funding deadline has already past or crowsale has not started modifier betweenDeadlines(address _assetAddress) { } // @notice reverts if the funding deadline has already past modifier afterDeadline(address _assetAddress) { } // @notice returns true if crowdsale is finshed modifier finalized(address _assetAddress) { } // @notice returns true if crowdsale is not finshed modifier notFinalized(address _assetAddress) { } // @notice returns true if crowdsale has not paid out modifier notPaid(address _assetAddress) { } event Convert(address token, uint change, uint investment); event EtherReceived(address sender, uint amount); }
minter.mintAssetTokens(_assetAddress,msg.sender,amount),"Investor minting failed"
393,952
minter.mintAssetTokens(_assetAddress,msg.sender,amount)
null
interface Events { function transaction(string _message, address _from, address _to, uint _amount, address _token) external; function asset(string _message, string _uri, address _assetAddress, address _manager); } interface DB { function addressStorage(bytes32 _key) external view returns (address); function uintStorage(bytes32 _key) external view returns (uint); function setUint(bytes32 _key, uint _value) external; function deleteUint(bytes32 _key) external; function setBool(bytes32 _key, bool _value) external; function boolStorage(bytes32 _key) external view returns (bool); } // @title An asset crowdsale contract which accepts funding from ERC20 tokens. // @notice Begins a crowdfunding period for a digital asset, minting asset dividend tokens to investors when particular ERC20 token is received // @author Kyle Dewhurst, MyBit Foundation // @notice creates a dividend token to represent the newly created asset. contract CrowdsaleERC20{ using SafeMath for uint256; DB private database; Events private events; MinterInterface private minter; CrowdsaleReserveInterface private reserve; KyberInterface private kyber; // @notice Constructor: initializes database instance // @param: The address for the platform database constructor(address _database, address _events, address _kyber) public{ } // @notice Investors can send ERC20 tokens here to fund an asset, receiving an equivalent number of asset-tokens. // @dev investor must approve this contract to transfer tokens // @param (address) _assetAddress = The address of the asset tokens, investor wishes to purchase // @param (uint) _amount = The amount to spend purchasing this asset function buyAssetOrderERC20(address _assetAddress, uint _amount, address _paymentToken) external payable returns (bool) { require(database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress))) != address(0), "Invalid asset"); require(now <= database.uintStorage(keccak256(abi.encodePacked("crowdsale.deadline", _assetAddress))), "Past deadline"); require(!database.boolStorage(keccak256(abi.encodePacked("crowdsale.finalized", _assetAddress))), "Crowdsale finalized"); if(_paymentToken == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)){ require(msg.value == _amount, 'Msg.value does not match amount'); } else { require(msg.value == 0, 'Msg.value should equal zero'); } ERC20 fundingToken = ERC20(DividendInterface(_assetAddress).getERC20()); uint fundingRemaining = database.uintStorage(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress))); uint collected; //This will be the value received by the contract after any conversions uint amount; //The number of tokens that will be minted //Check if the payment token is the same as the funding token. If not, convert, else just collect the funds if(_paymentToken == address(fundingToken)){ collected = collectPayment(msg.sender, _amount, fundingRemaining, fundingToken); } else { collected = convertTokens(msg.sender, _amount, fundingToken, ERC20(_paymentToken), fundingRemaining); } require(collected > 0); if(collected < fundingRemaining){ amount = collected.mul(100).div(uint(100).add(database.uintStorage(keccak256(abi.encodePacked("platform.fee"))))); database.setUint(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress)), fundingRemaining.sub(collected)); require(minter.mintAssetTokens(_assetAddress, msg.sender, amount), "Investor minting failed"); require(<FILL_ME>) } else { amount = fundingRemaining.mul(100).div(uint(100).add(database.uintStorage(keccak256(abi.encodePacked("platform.fee"))))); database.setBool(keccak256(abi.encodePacked("crowdsale.finalized", _assetAddress)), true); database.deleteUint(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress))); require(minter.mintAssetTokens(_assetAddress, msg.sender, amount), "Investor minting failed"); // Send remaining asset tokens to investor require(fundingToken.transfer(address(reserve), fundingRemaining)); events.asset('Crowdsale finalized', '', _assetAddress, msg.sender); if(collected > fundingRemaining){ require(fundingToken.transfer(msg.sender, collected.sub(fundingRemaining))); // return extra funds } } events.transaction('Asset purchased', address(this), msg.sender, amount, _assetAddress); return true; } // @notice This is called once funding has succeeded. Sends Ether to a distribution contract where operator/assetManager can withdraw // @dev The contract manager needs to know the address PlatformDistribution contract function payoutERC20(address _assetAddress) external whenNotPaused returns (bool) { } function cancel(address _assetAddress) external whenNotPaused validAsset(_assetAddress) beforeDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool){ } // @notice Contributors can retrieve their funds here if crowdsale has paased deadline // @param (address) _assetAddress = The address of the asset which didn't reach it's crowdfunding goals function refund(address _assetAddress) public whenNotPaused validAsset(_assetAddress) afterDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool) { } //------------------------------------------------------------------------------------------------------------------ // Internal Functions //------------------------------------------------------------------------------------------------------------------ function collectPayment(address user, uint amount, uint max, ERC20 token) private returns (uint){ } /* function fundBurn(address _investor, uint _amount, bytes4 _sig, ERC20 _burnToken) private returns (uint) { require(_burnToken.transferFrom(_investor, address(this), _amount), "Transfer failed"); // transfer investors tokens into contract uint balanceBefore = _burnToken.balanceOf(this); require(burner.burn(address(this), database.uintStorage(keccak256(abi.encodePacked(_sig, address(this)))), address(_burnToken))); uint change = _burnToken.balanceOf(this) - balanceBefore; return change; } */ function convertTokens(address _investor, uint _amount, /*bytes4 _sig,*/ ERC20 _fundingToken, ERC20 _paymentToken, uint _maxTokens) private returns (uint) { } // @notice platform owners can recover tokens here function recoverTokens(address _erc20Token) onlyOwner external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } // @notice fallback function. We need to receive Ether from Kyber Network function () external payable { } //------------------------------------------------------------------------------------------------------------------ // Modifiers //------------------------------------------------------------------------------------------------------------------ // @notice Sender must be a registered owner modifier onlyOwner { } // @notice function won't run if owners have paused this contract modifier whenNotPaused { } // @notice reverts if the asset does not have a token address set in the database modifier validAsset(address _assetAddress) { } // @notice reverts if the funding deadline has not passed modifier beforeDeadline(address _assetAddress) { } // @notice reverts if the funding deadline has already past or crowsale has not started modifier betweenDeadlines(address _assetAddress) { } // @notice reverts if the funding deadline has already past modifier afterDeadline(address _assetAddress) { } // @notice returns true if crowdsale is finshed modifier finalized(address _assetAddress) { } // @notice returns true if crowdsale is not finshed modifier notFinalized(address _assetAddress) { } // @notice returns true if crowdsale has not paid out modifier notPaid(address _assetAddress) { } event Convert(address token, uint change, uint investment); event EtherReceived(address sender, uint amount); }
fundingToken.transfer(address(reserve),collected)
393,952
fundingToken.transfer(address(reserve),collected)
null
interface Events { function transaction(string _message, address _from, address _to, uint _amount, address _token) external; function asset(string _message, string _uri, address _assetAddress, address _manager); } interface DB { function addressStorage(bytes32 _key) external view returns (address); function uintStorage(bytes32 _key) external view returns (uint); function setUint(bytes32 _key, uint _value) external; function deleteUint(bytes32 _key) external; function setBool(bytes32 _key, bool _value) external; function boolStorage(bytes32 _key) external view returns (bool); } // @title An asset crowdsale contract which accepts funding from ERC20 tokens. // @notice Begins a crowdfunding period for a digital asset, minting asset dividend tokens to investors when particular ERC20 token is received // @author Kyle Dewhurst, MyBit Foundation // @notice creates a dividend token to represent the newly created asset. contract CrowdsaleERC20{ using SafeMath for uint256; DB private database; Events private events; MinterInterface private minter; CrowdsaleReserveInterface private reserve; KyberInterface private kyber; // @notice Constructor: initializes database instance // @param: The address for the platform database constructor(address _database, address _events, address _kyber) public{ } // @notice Investors can send ERC20 tokens here to fund an asset, receiving an equivalent number of asset-tokens. // @dev investor must approve this contract to transfer tokens // @param (address) _assetAddress = The address of the asset tokens, investor wishes to purchase // @param (uint) _amount = The amount to spend purchasing this asset function buyAssetOrderERC20(address _assetAddress, uint _amount, address _paymentToken) external payable returns (bool) { require(database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress))) != address(0), "Invalid asset"); require(now <= database.uintStorage(keccak256(abi.encodePacked("crowdsale.deadline", _assetAddress))), "Past deadline"); require(!database.boolStorage(keccak256(abi.encodePacked("crowdsale.finalized", _assetAddress))), "Crowdsale finalized"); if(_paymentToken == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)){ require(msg.value == _amount, 'Msg.value does not match amount'); } else { require(msg.value == 0, 'Msg.value should equal zero'); } ERC20 fundingToken = ERC20(DividendInterface(_assetAddress).getERC20()); uint fundingRemaining = database.uintStorage(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress))); uint collected; //This will be the value received by the contract after any conversions uint amount; //The number of tokens that will be minted //Check if the payment token is the same as the funding token. If not, convert, else just collect the funds if(_paymentToken == address(fundingToken)){ collected = collectPayment(msg.sender, _amount, fundingRemaining, fundingToken); } else { collected = convertTokens(msg.sender, _amount, fundingToken, ERC20(_paymentToken), fundingRemaining); } require(collected > 0); if(collected < fundingRemaining){ amount = collected.mul(100).div(uint(100).add(database.uintStorage(keccak256(abi.encodePacked("platform.fee"))))); database.setUint(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress)), fundingRemaining.sub(collected)); require(minter.mintAssetTokens(_assetAddress, msg.sender, amount), "Investor minting failed"); require(fundingToken.transfer(address(reserve), collected)); } else { amount = fundingRemaining.mul(100).div(uint(100).add(database.uintStorage(keccak256(abi.encodePacked("platform.fee"))))); database.setBool(keccak256(abi.encodePacked("crowdsale.finalized", _assetAddress)), true); database.deleteUint(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress))); require(minter.mintAssetTokens(_assetAddress, msg.sender, amount), "Investor minting failed"); // Send remaining asset tokens to investor require(<FILL_ME>) events.asset('Crowdsale finalized', '', _assetAddress, msg.sender); if(collected > fundingRemaining){ require(fundingToken.transfer(msg.sender, collected.sub(fundingRemaining))); // return extra funds } } events.transaction('Asset purchased', address(this), msg.sender, amount, _assetAddress); return true; } // @notice This is called once funding has succeeded. Sends Ether to a distribution contract where operator/assetManager can withdraw // @dev The contract manager needs to know the address PlatformDistribution contract function payoutERC20(address _assetAddress) external whenNotPaused returns (bool) { } function cancel(address _assetAddress) external whenNotPaused validAsset(_assetAddress) beforeDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool){ } // @notice Contributors can retrieve their funds here if crowdsale has paased deadline // @param (address) _assetAddress = The address of the asset which didn't reach it's crowdfunding goals function refund(address _assetAddress) public whenNotPaused validAsset(_assetAddress) afterDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool) { } //------------------------------------------------------------------------------------------------------------------ // Internal Functions //------------------------------------------------------------------------------------------------------------------ function collectPayment(address user, uint amount, uint max, ERC20 token) private returns (uint){ } /* function fundBurn(address _investor, uint _amount, bytes4 _sig, ERC20 _burnToken) private returns (uint) { require(_burnToken.transferFrom(_investor, address(this), _amount), "Transfer failed"); // transfer investors tokens into contract uint balanceBefore = _burnToken.balanceOf(this); require(burner.burn(address(this), database.uintStorage(keccak256(abi.encodePacked(_sig, address(this)))), address(_burnToken))); uint change = _burnToken.balanceOf(this) - balanceBefore; return change; } */ function convertTokens(address _investor, uint _amount, /*bytes4 _sig,*/ ERC20 _fundingToken, ERC20 _paymentToken, uint _maxTokens) private returns (uint) { } // @notice platform owners can recover tokens here function recoverTokens(address _erc20Token) onlyOwner external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } // @notice fallback function. We need to receive Ether from Kyber Network function () external payable { } //------------------------------------------------------------------------------------------------------------------ // Modifiers //------------------------------------------------------------------------------------------------------------------ // @notice Sender must be a registered owner modifier onlyOwner { } // @notice function won't run if owners have paused this contract modifier whenNotPaused { } // @notice reverts if the asset does not have a token address set in the database modifier validAsset(address _assetAddress) { } // @notice reverts if the funding deadline has not passed modifier beforeDeadline(address _assetAddress) { } // @notice reverts if the funding deadline has already past or crowsale has not started modifier betweenDeadlines(address _assetAddress) { } // @notice reverts if the funding deadline has already past modifier afterDeadline(address _assetAddress) { } // @notice returns true if crowdsale is finshed modifier finalized(address _assetAddress) { } // @notice returns true if crowdsale is not finshed modifier notFinalized(address _assetAddress) { } // @notice returns true if crowdsale has not paid out modifier notPaid(address _assetAddress) { } event Convert(address token, uint change, uint investment); event EtherReceived(address sender, uint amount); }
fundingToken.transfer(address(reserve),fundingRemaining)
393,952
fundingToken.transfer(address(reserve),fundingRemaining)
null
interface Events { function transaction(string _message, address _from, address _to, uint _amount, address _token) external; function asset(string _message, string _uri, address _assetAddress, address _manager); } interface DB { function addressStorage(bytes32 _key) external view returns (address); function uintStorage(bytes32 _key) external view returns (uint); function setUint(bytes32 _key, uint _value) external; function deleteUint(bytes32 _key) external; function setBool(bytes32 _key, bool _value) external; function boolStorage(bytes32 _key) external view returns (bool); } // @title An asset crowdsale contract which accepts funding from ERC20 tokens. // @notice Begins a crowdfunding period for a digital asset, minting asset dividend tokens to investors when particular ERC20 token is received // @author Kyle Dewhurst, MyBit Foundation // @notice creates a dividend token to represent the newly created asset. contract CrowdsaleERC20{ using SafeMath for uint256; DB private database; Events private events; MinterInterface private minter; CrowdsaleReserveInterface private reserve; KyberInterface private kyber; // @notice Constructor: initializes database instance // @param: The address for the platform database constructor(address _database, address _events, address _kyber) public{ } // @notice Investors can send ERC20 tokens here to fund an asset, receiving an equivalent number of asset-tokens. // @dev investor must approve this contract to transfer tokens // @param (address) _assetAddress = The address of the asset tokens, investor wishes to purchase // @param (uint) _amount = The amount to spend purchasing this asset function buyAssetOrderERC20(address _assetAddress, uint _amount, address _paymentToken) external payable returns (bool) { require(database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress))) != address(0), "Invalid asset"); require(now <= database.uintStorage(keccak256(abi.encodePacked("crowdsale.deadline", _assetAddress))), "Past deadline"); require(!database.boolStorage(keccak256(abi.encodePacked("crowdsale.finalized", _assetAddress))), "Crowdsale finalized"); if(_paymentToken == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)){ require(msg.value == _amount, 'Msg.value does not match amount'); } else { require(msg.value == 0, 'Msg.value should equal zero'); } ERC20 fundingToken = ERC20(DividendInterface(_assetAddress).getERC20()); uint fundingRemaining = database.uintStorage(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress))); uint collected; //This will be the value received by the contract after any conversions uint amount; //The number of tokens that will be minted //Check if the payment token is the same as the funding token. If not, convert, else just collect the funds if(_paymentToken == address(fundingToken)){ collected = collectPayment(msg.sender, _amount, fundingRemaining, fundingToken); } else { collected = convertTokens(msg.sender, _amount, fundingToken, ERC20(_paymentToken), fundingRemaining); } require(collected > 0); if(collected < fundingRemaining){ amount = collected.mul(100).div(uint(100).add(database.uintStorage(keccak256(abi.encodePacked("platform.fee"))))); database.setUint(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress)), fundingRemaining.sub(collected)); require(minter.mintAssetTokens(_assetAddress, msg.sender, amount), "Investor minting failed"); require(fundingToken.transfer(address(reserve), collected)); } else { amount = fundingRemaining.mul(100).div(uint(100).add(database.uintStorage(keccak256(abi.encodePacked("platform.fee"))))); database.setBool(keccak256(abi.encodePacked("crowdsale.finalized", _assetAddress)), true); database.deleteUint(keccak256(abi.encodePacked("crowdsale.remaining", _assetAddress))); require(minter.mintAssetTokens(_assetAddress, msg.sender, amount), "Investor minting failed"); // Send remaining asset tokens to investor require(fundingToken.transfer(address(reserve), fundingRemaining)); events.asset('Crowdsale finalized', '', _assetAddress, msg.sender); if(collected > fundingRemaining){ require(<FILL_ME>) // return extra funds } } events.transaction('Asset purchased', address(this), msg.sender, amount, _assetAddress); return true; } // @notice This is called once funding has succeeded. Sends Ether to a distribution contract where operator/assetManager can withdraw // @dev The contract manager needs to know the address PlatformDistribution contract function payoutERC20(address _assetAddress) external whenNotPaused returns (bool) { } function cancel(address _assetAddress) external whenNotPaused validAsset(_assetAddress) beforeDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool){ } // @notice Contributors can retrieve their funds here if crowdsale has paased deadline // @param (address) _assetAddress = The address of the asset which didn't reach it's crowdfunding goals function refund(address _assetAddress) public whenNotPaused validAsset(_assetAddress) afterDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool) { } //------------------------------------------------------------------------------------------------------------------ // Internal Functions //------------------------------------------------------------------------------------------------------------------ function collectPayment(address user, uint amount, uint max, ERC20 token) private returns (uint){ } /* function fundBurn(address _investor, uint _amount, bytes4 _sig, ERC20 _burnToken) private returns (uint) { require(_burnToken.transferFrom(_investor, address(this), _amount), "Transfer failed"); // transfer investors tokens into contract uint balanceBefore = _burnToken.balanceOf(this); require(burner.burn(address(this), database.uintStorage(keccak256(abi.encodePacked(_sig, address(this)))), address(_burnToken))); uint change = _burnToken.balanceOf(this) - balanceBefore; return change; } */ function convertTokens(address _investor, uint _amount, /*bytes4 _sig,*/ ERC20 _fundingToken, ERC20 _paymentToken, uint _maxTokens) private returns (uint) { } // @notice platform owners can recover tokens here function recoverTokens(address _erc20Token) onlyOwner external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } // @notice fallback function. We need to receive Ether from Kyber Network function () external payable { } //------------------------------------------------------------------------------------------------------------------ // Modifiers //------------------------------------------------------------------------------------------------------------------ // @notice Sender must be a registered owner modifier onlyOwner { } // @notice function won't run if owners have paused this contract modifier whenNotPaused { } // @notice reverts if the asset does not have a token address set in the database modifier validAsset(address _assetAddress) { } // @notice reverts if the funding deadline has not passed modifier beforeDeadline(address _assetAddress) { } // @notice reverts if the funding deadline has already past or crowsale has not started modifier betweenDeadlines(address _assetAddress) { } // @notice reverts if the funding deadline has already past modifier afterDeadline(address _assetAddress) { } // @notice returns true if crowdsale is finshed modifier finalized(address _assetAddress) { } // @notice returns true if crowdsale is not finshed modifier notFinalized(address _assetAddress) { } // @notice returns true if crowdsale has not paid out modifier notPaid(address _assetAddress) { } event Convert(address token, uint change, uint investment); event EtherReceived(address sender, uint amount); }
fundingToken.transfer(msg.sender,collected.sub(fundingRemaining))
393,952
fundingToken.transfer(msg.sender,collected.sub(fundingRemaining))
"Crowdsale not finalized"
interface Events { function transaction(string _message, address _from, address _to, uint _amount, address _token) external; function asset(string _message, string _uri, address _assetAddress, address _manager); } interface DB { function addressStorage(bytes32 _key) external view returns (address); function uintStorage(bytes32 _key) external view returns (uint); function setUint(bytes32 _key, uint _value) external; function deleteUint(bytes32 _key) external; function setBool(bytes32 _key, bool _value) external; function boolStorage(bytes32 _key) external view returns (bool); } // @title An asset crowdsale contract which accepts funding from ERC20 tokens. // @notice Begins a crowdfunding period for a digital asset, minting asset dividend tokens to investors when particular ERC20 token is received // @author Kyle Dewhurst, MyBit Foundation // @notice creates a dividend token to represent the newly created asset. contract CrowdsaleERC20{ using SafeMath for uint256; DB private database; Events private events; MinterInterface private minter; CrowdsaleReserveInterface private reserve; KyberInterface private kyber; // @notice Constructor: initializes database instance // @param: The address for the platform database constructor(address _database, address _events, address _kyber) public{ } // @notice Investors can send ERC20 tokens here to fund an asset, receiving an equivalent number of asset-tokens. // @dev investor must approve this contract to transfer tokens // @param (address) _assetAddress = The address of the asset tokens, investor wishes to purchase // @param (uint) _amount = The amount to spend purchasing this asset function buyAssetOrderERC20(address _assetAddress, uint _amount, address _paymentToken) external payable returns (bool) { } // @notice This is called once funding has succeeded. Sends Ether to a distribution contract where operator/assetManager can withdraw // @dev The contract manager needs to know the address PlatformDistribution contract function payoutERC20(address _assetAddress) external whenNotPaused returns (bool) { require(<FILL_ME>) require(!database.boolStorage(keccak256(abi.encodePacked("crowdsale.paid", _assetAddress))), "Crowdsale has paid out"); //Set paid to true database.setBool(keccak256(abi.encodePacked("crowdsale.paid", _assetAddress)), true); //Setup token address fundingToken = DividendInterface(_assetAddress).getERC20(); //Mint tokens for the asset manager and platform address platformAssetsWallet = database.addressStorage(keccak256(abi.encodePacked("platform.wallet.assets"))); require(platformAssetsWallet != address(0), "Platform assets wallet not set"); require(minter.mintAssetTokens(_assetAddress, database.addressStorage(keccak256(abi.encodePacked("contract", "AssetManagerFunds"))), database.uintStorage(keccak256(abi.encodePacked("asset.managerTokens", _assetAddress)))), "Manager minting failed"); require(minter.mintAssetTokens(_assetAddress, platformAssetsWallet, database.uintStorage(keccak256(abi.encodePacked("asset.platformTokens", _assetAddress)))), "Platform minting failed"); //Get the addresses for the receiver and platform address receiver = database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress))); address platformFundsWallet = database.addressStorage(keccak256(abi.encodePacked("platform.wallet.funds"))); require(receiver != address(0) && platformFundsWallet != address(0), "Platform funds walllet or receiver address not set"); //Calculate amounts for platform and receiver uint amount = database.uintStorage(keccak256(abi.encodePacked("crowdsale.goal", _assetAddress))); uint platformFee = amount.getFractionalAmount(database.uintStorage(keccak256(abi.encodePacked("platform.fee")))); //Transfer funds to receiver and platform require(reserve.issueERC20(platformFundsWallet, platformFee, fundingToken), 'Platform funds not paid'); require(reserve.issueERC20(receiver, amount, fundingToken), 'Receiver funds not paid'); //Delete crowdsale start time database.deleteUint(keccak256(abi.encodePacked("crowdsale.start", _assetAddress))); //Increase asset count for manager address manager = database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress))); database.setUint(keccak256(abi.encodePacked("manager.assets", manager)), database.uintStorage(keccak256(abi.encodePacked("manager.assets", manager))).add(1)); //Emit event events.transaction('Asset payout', _assetAddress, receiver, amount, fundingToken); return true; } function cancel(address _assetAddress) external whenNotPaused validAsset(_assetAddress) beforeDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool){ } // @notice Contributors can retrieve their funds here if crowdsale has paased deadline // @param (address) _assetAddress = The address of the asset which didn't reach it's crowdfunding goals function refund(address _assetAddress) public whenNotPaused validAsset(_assetAddress) afterDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool) { } //------------------------------------------------------------------------------------------------------------------ // Internal Functions //------------------------------------------------------------------------------------------------------------------ function collectPayment(address user, uint amount, uint max, ERC20 token) private returns (uint){ } /* function fundBurn(address _investor, uint _amount, bytes4 _sig, ERC20 _burnToken) private returns (uint) { require(_burnToken.transferFrom(_investor, address(this), _amount), "Transfer failed"); // transfer investors tokens into contract uint balanceBefore = _burnToken.balanceOf(this); require(burner.burn(address(this), database.uintStorage(keccak256(abi.encodePacked(_sig, address(this)))), address(_burnToken))); uint change = _burnToken.balanceOf(this) - balanceBefore; return change; } */ function convertTokens(address _investor, uint _amount, /*bytes4 _sig,*/ ERC20 _fundingToken, ERC20 _paymentToken, uint _maxTokens) private returns (uint) { } // @notice platform owners can recover tokens here function recoverTokens(address _erc20Token) onlyOwner external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } // @notice fallback function. We need to receive Ether from Kyber Network function () external payable { } //------------------------------------------------------------------------------------------------------------------ // Modifiers //------------------------------------------------------------------------------------------------------------------ // @notice Sender must be a registered owner modifier onlyOwner { } // @notice function won't run if owners have paused this contract modifier whenNotPaused { } // @notice reverts if the asset does not have a token address set in the database modifier validAsset(address _assetAddress) { } // @notice reverts if the funding deadline has not passed modifier beforeDeadline(address _assetAddress) { } // @notice reverts if the funding deadline has already past or crowsale has not started modifier betweenDeadlines(address _assetAddress) { } // @notice reverts if the funding deadline has already past modifier afterDeadline(address _assetAddress) { } // @notice returns true if crowdsale is finshed modifier finalized(address _assetAddress) { } // @notice returns true if crowdsale is not finshed modifier notFinalized(address _assetAddress) { } // @notice returns true if crowdsale has not paid out modifier notPaid(address _assetAddress) { } event Convert(address token, uint change, uint investment); event EtherReceived(address sender, uint amount); }
database.boolStorage(keccak256(abi.encodePacked("crowdsale.finalized",_assetAddress))),"Crowdsale not finalized"
393,952
database.boolStorage(keccak256(abi.encodePacked("crowdsale.finalized",_assetAddress)))
"Crowdsale has paid out"
interface Events { function transaction(string _message, address _from, address _to, uint _amount, address _token) external; function asset(string _message, string _uri, address _assetAddress, address _manager); } interface DB { function addressStorage(bytes32 _key) external view returns (address); function uintStorage(bytes32 _key) external view returns (uint); function setUint(bytes32 _key, uint _value) external; function deleteUint(bytes32 _key) external; function setBool(bytes32 _key, bool _value) external; function boolStorage(bytes32 _key) external view returns (bool); } // @title An asset crowdsale contract which accepts funding from ERC20 tokens. // @notice Begins a crowdfunding period for a digital asset, minting asset dividend tokens to investors when particular ERC20 token is received // @author Kyle Dewhurst, MyBit Foundation // @notice creates a dividend token to represent the newly created asset. contract CrowdsaleERC20{ using SafeMath for uint256; DB private database; Events private events; MinterInterface private minter; CrowdsaleReserveInterface private reserve; KyberInterface private kyber; // @notice Constructor: initializes database instance // @param: The address for the platform database constructor(address _database, address _events, address _kyber) public{ } // @notice Investors can send ERC20 tokens here to fund an asset, receiving an equivalent number of asset-tokens. // @dev investor must approve this contract to transfer tokens // @param (address) _assetAddress = The address of the asset tokens, investor wishes to purchase // @param (uint) _amount = The amount to spend purchasing this asset function buyAssetOrderERC20(address _assetAddress, uint _amount, address _paymentToken) external payable returns (bool) { } // @notice This is called once funding has succeeded. Sends Ether to a distribution contract where operator/assetManager can withdraw // @dev The contract manager needs to know the address PlatformDistribution contract function payoutERC20(address _assetAddress) external whenNotPaused returns (bool) { require(database.boolStorage(keccak256(abi.encodePacked("crowdsale.finalized", _assetAddress))), "Crowdsale not finalized"); require(<FILL_ME>) //Set paid to true database.setBool(keccak256(abi.encodePacked("crowdsale.paid", _assetAddress)), true); //Setup token address fundingToken = DividendInterface(_assetAddress).getERC20(); //Mint tokens for the asset manager and platform address platformAssetsWallet = database.addressStorage(keccak256(abi.encodePacked("platform.wallet.assets"))); require(platformAssetsWallet != address(0), "Platform assets wallet not set"); require(minter.mintAssetTokens(_assetAddress, database.addressStorage(keccak256(abi.encodePacked("contract", "AssetManagerFunds"))), database.uintStorage(keccak256(abi.encodePacked("asset.managerTokens", _assetAddress)))), "Manager minting failed"); require(minter.mintAssetTokens(_assetAddress, platformAssetsWallet, database.uintStorage(keccak256(abi.encodePacked("asset.platformTokens", _assetAddress)))), "Platform minting failed"); //Get the addresses for the receiver and platform address receiver = database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress))); address platformFundsWallet = database.addressStorage(keccak256(abi.encodePacked("platform.wallet.funds"))); require(receiver != address(0) && platformFundsWallet != address(0), "Platform funds walllet or receiver address not set"); //Calculate amounts for platform and receiver uint amount = database.uintStorage(keccak256(abi.encodePacked("crowdsale.goal", _assetAddress))); uint platformFee = amount.getFractionalAmount(database.uintStorage(keccak256(abi.encodePacked("platform.fee")))); //Transfer funds to receiver and platform require(reserve.issueERC20(platformFundsWallet, platformFee, fundingToken), 'Platform funds not paid'); require(reserve.issueERC20(receiver, amount, fundingToken), 'Receiver funds not paid'); //Delete crowdsale start time database.deleteUint(keccak256(abi.encodePacked("crowdsale.start", _assetAddress))); //Increase asset count for manager address manager = database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress))); database.setUint(keccak256(abi.encodePacked("manager.assets", manager)), database.uintStorage(keccak256(abi.encodePacked("manager.assets", manager))).add(1)); //Emit event events.transaction('Asset payout', _assetAddress, receiver, amount, fundingToken); return true; } function cancel(address _assetAddress) external whenNotPaused validAsset(_assetAddress) beforeDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool){ } // @notice Contributors can retrieve their funds here if crowdsale has paased deadline // @param (address) _assetAddress = The address of the asset which didn't reach it's crowdfunding goals function refund(address _assetAddress) public whenNotPaused validAsset(_assetAddress) afterDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool) { } //------------------------------------------------------------------------------------------------------------------ // Internal Functions //------------------------------------------------------------------------------------------------------------------ function collectPayment(address user, uint amount, uint max, ERC20 token) private returns (uint){ } /* function fundBurn(address _investor, uint _amount, bytes4 _sig, ERC20 _burnToken) private returns (uint) { require(_burnToken.transferFrom(_investor, address(this), _amount), "Transfer failed"); // transfer investors tokens into contract uint balanceBefore = _burnToken.balanceOf(this); require(burner.burn(address(this), database.uintStorage(keccak256(abi.encodePacked(_sig, address(this)))), address(_burnToken))); uint change = _burnToken.balanceOf(this) - balanceBefore; return change; } */ function convertTokens(address _investor, uint _amount, /*bytes4 _sig,*/ ERC20 _fundingToken, ERC20 _paymentToken, uint _maxTokens) private returns (uint) { } // @notice platform owners can recover tokens here function recoverTokens(address _erc20Token) onlyOwner external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } // @notice fallback function. We need to receive Ether from Kyber Network function () external payable { } //------------------------------------------------------------------------------------------------------------------ // Modifiers //------------------------------------------------------------------------------------------------------------------ // @notice Sender must be a registered owner modifier onlyOwner { } // @notice function won't run if owners have paused this contract modifier whenNotPaused { } // @notice reverts if the asset does not have a token address set in the database modifier validAsset(address _assetAddress) { } // @notice reverts if the funding deadline has not passed modifier beforeDeadline(address _assetAddress) { } // @notice reverts if the funding deadline has already past or crowsale has not started modifier betweenDeadlines(address _assetAddress) { } // @notice reverts if the funding deadline has already past modifier afterDeadline(address _assetAddress) { } // @notice returns true if crowdsale is finshed modifier finalized(address _assetAddress) { } // @notice returns true if crowdsale is not finshed modifier notFinalized(address _assetAddress) { } // @notice returns true if crowdsale has not paid out modifier notPaid(address _assetAddress) { } event Convert(address token, uint change, uint investment); event EtherReceived(address sender, uint amount); }
!database.boolStorage(keccak256(abi.encodePacked("crowdsale.paid",_assetAddress))),"Crowdsale has paid out"
393,952
!database.boolStorage(keccak256(abi.encodePacked("crowdsale.paid",_assetAddress)))
"Manager minting failed"
interface Events { function transaction(string _message, address _from, address _to, uint _amount, address _token) external; function asset(string _message, string _uri, address _assetAddress, address _manager); } interface DB { function addressStorage(bytes32 _key) external view returns (address); function uintStorage(bytes32 _key) external view returns (uint); function setUint(bytes32 _key, uint _value) external; function deleteUint(bytes32 _key) external; function setBool(bytes32 _key, bool _value) external; function boolStorage(bytes32 _key) external view returns (bool); } // @title An asset crowdsale contract which accepts funding from ERC20 tokens. // @notice Begins a crowdfunding period for a digital asset, minting asset dividend tokens to investors when particular ERC20 token is received // @author Kyle Dewhurst, MyBit Foundation // @notice creates a dividend token to represent the newly created asset. contract CrowdsaleERC20{ using SafeMath for uint256; DB private database; Events private events; MinterInterface private minter; CrowdsaleReserveInterface private reserve; KyberInterface private kyber; // @notice Constructor: initializes database instance // @param: The address for the platform database constructor(address _database, address _events, address _kyber) public{ } // @notice Investors can send ERC20 tokens here to fund an asset, receiving an equivalent number of asset-tokens. // @dev investor must approve this contract to transfer tokens // @param (address) _assetAddress = The address of the asset tokens, investor wishes to purchase // @param (uint) _amount = The amount to spend purchasing this asset function buyAssetOrderERC20(address _assetAddress, uint _amount, address _paymentToken) external payable returns (bool) { } // @notice This is called once funding has succeeded. Sends Ether to a distribution contract where operator/assetManager can withdraw // @dev The contract manager needs to know the address PlatformDistribution contract function payoutERC20(address _assetAddress) external whenNotPaused returns (bool) { require(database.boolStorage(keccak256(abi.encodePacked("crowdsale.finalized", _assetAddress))), "Crowdsale not finalized"); require(!database.boolStorage(keccak256(abi.encodePacked("crowdsale.paid", _assetAddress))), "Crowdsale has paid out"); //Set paid to true database.setBool(keccak256(abi.encodePacked("crowdsale.paid", _assetAddress)), true); //Setup token address fundingToken = DividendInterface(_assetAddress).getERC20(); //Mint tokens for the asset manager and platform address platformAssetsWallet = database.addressStorage(keccak256(abi.encodePacked("platform.wallet.assets"))); require(platformAssetsWallet != address(0), "Platform assets wallet not set"); require(<FILL_ME>) require(minter.mintAssetTokens(_assetAddress, platformAssetsWallet, database.uintStorage(keccak256(abi.encodePacked("asset.platformTokens", _assetAddress)))), "Platform minting failed"); //Get the addresses for the receiver and platform address receiver = database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress))); address platformFundsWallet = database.addressStorage(keccak256(abi.encodePacked("platform.wallet.funds"))); require(receiver != address(0) && platformFundsWallet != address(0), "Platform funds walllet or receiver address not set"); //Calculate amounts for platform and receiver uint amount = database.uintStorage(keccak256(abi.encodePacked("crowdsale.goal", _assetAddress))); uint platformFee = amount.getFractionalAmount(database.uintStorage(keccak256(abi.encodePacked("platform.fee")))); //Transfer funds to receiver and platform require(reserve.issueERC20(platformFundsWallet, platformFee, fundingToken), 'Platform funds not paid'); require(reserve.issueERC20(receiver, amount, fundingToken), 'Receiver funds not paid'); //Delete crowdsale start time database.deleteUint(keccak256(abi.encodePacked("crowdsale.start", _assetAddress))); //Increase asset count for manager address manager = database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress))); database.setUint(keccak256(abi.encodePacked("manager.assets", manager)), database.uintStorage(keccak256(abi.encodePacked("manager.assets", manager))).add(1)); //Emit event events.transaction('Asset payout', _assetAddress, receiver, amount, fundingToken); return true; } function cancel(address _assetAddress) external whenNotPaused validAsset(_assetAddress) beforeDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool){ } // @notice Contributors can retrieve their funds here if crowdsale has paased deadline // @param (address) _assetAddress = The address of the asset which didn't reach it's crowdfunding goals function refund(address _assetAddress) public whenNotPaused validAsset(_assetAddress) afterDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool) { } //------------------------------------------------------------------------------------------------------------------ // Internal Functions //------------------------------------------------------------------------------------------------------------------ function collectPayment(address user, uint amount, uint max, ERC20 token) private returns (uint){ } /* function fundBurn(address _investor, uint _amount, bytes4 _sig, ERC20 _burnToken) private returns (uint) { require(_burnToken.transferFrom(_investor, address(this), _amount), "Transfer failed"); // transfer investors tokens into contract uint balanceBefore = _burnToken.balanceOf(this); require(burner.burn(address(this), database.uintStorage(keccak256(abi.encodePacked(_sig, address(this)))), address(_burnToken))); uint change = _burnToken.balanceOf(this) - balanceBefore; return change; } */ function convertTokens(address _investor, uint _amount, /*bytes4 _sig,*/ ERC20 _fundingToken, ERC20 _paymentToken, uint _maxTokens) private returns (uint) { } // @notice platform owners can recover tokens here function recoverTokens(address _erc20Token) onlyOwner external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } // @notice fallback function. We need to receive Ether from Kyber Network function () external payable { } //------------------------------------------------------------------------------------------------------------------ // Modifiers //------------------------------------------------------------------------------------------------------------------ // @notice Sender must be a registered owner modifier onlyOwner { } // @notice function won't run if owners have paused this contract modifier whenNotPaused { } // @notice reverts if the asset does not have a token address set in the database modifier validAsset(address _assetAddress) { } // @notice reverts if the funding deadline has not passed modifier beforeDeadline(address _assetAddress) { } // @notice reverts if the funding deadline has already past or crowsale has not started modifier betweenDeadlines(address _assetAddress) { } // @notice reverts if the funding deadline has already past modifier afterDeadline(address _assetAddress) { } // @notice returns true if crowdsale is finshed modifier finalized(address _assetAddress) { } // @notice returns true if crowdsale is not finshed modifier notFinalized(address _assetAddress) { } // @notice returns true if crowdsale has not paid out modifier notPaid(address _assetAddress) { } event Convert(address token, uint change, uint investment); event EtherReceived(address sender, uint amount); }
minter.mintAssetTokens(_assetAddress,database.addressStorage(keccak256(abi.encodePacked("contract","AssetManagerFunds"))),database.uintStorage(keccak256(abi.encodePacked("asset.managerTokens",_assetAddress)))),"Manager minting failed"
393,952
minter.mintAssetTokens(_assetAddress,database.addressStorage(keccak256(abi.encodePacked("contract","AssetManagerFunds"))),database.uintStorage(keccak256(abi.encodePacked("asset.managerTokens",_assetAddress))))
"Platform minting failed"
interface Events { function transaction(string _message, address _from, address _to, uint _amount, address _token) external; function asset(string _message, string _uri, address _assetAddress, address _manager); } interface DB { function addressStorage(bytes32 _key) external view returns (address); function uintStorage(bytes32 _key) external view returns (uint); function setUint(bytes32 _key, uint _value) external; function deleteUint(bytes32 _key) external; function setBool(bytes32 _key, bool _value) external; function boolStorage(bytes32 _key) external view returns (bool); } // @title An asset crowdsale contract which accepts funding from ERC20 tokens. // @notice Begins a crowdfunding period for a digital asset, minting asset dividend tokens to investors when particular ERC20 token is received // @author Kyle Dewhurst, MyBit Foundation // @notice creates a dividend token to represent the newly created asset. contract CrowdsaleERC20{ using SafeMath for uint256; DB private database; Events private events; MinterInterface private minter; CrowdsaleReserveInterface private reserve; KyberInterface private kyber; // @notice Constructor: initializes database instance // @param: The address for the platform database constructor(address _database, address _events, address _kyber) public{ } // @notice Investors can send ERC20 tokens here to fund an asset, receiving an equivalent number of asset-tokens. // @dev investor must approve this contract to transfer tokens // @param (address) _assetAddress = The address of the asset tokens, investor wishes to purchase // @param (uint) _amount = The amount to spend purchasing this asset function buyAssetOrderERC20(address _assetAddress, uint _amount, address _paymentToken) external payable returns (bool) { } // @notice This is called once funding has succeeded. Sends Ether to a distribution contract where operator/assetManager can withdraw // @dev The contract manager needs to know the address PlatformDistribution contract function payoutERC20(address _assetAddress) external whenNotPaused returns (bool) { require(database.boolStorage(keccak256(abi.encodePacked("crowdsale.finalized", _assetAddress))), "Crowdsale not finalized"); require(!database.boolStorage(keccak256(abi.encodePacked("crowdsale.paid", _assetAddress))), "Crowdsale has paid out"); //Set paid to true database.setBool(keccak256(abi.encodePacked("crowdsale.paid", _assetAddress)), true); //Setup token address fundingToken = DividendInterface(_assetAddress).getERC20(); //Mint tokens for the asset manager and platform address platformAssetsWallet = database.addressStorage(keccak256(abi.encodePacked("platform.wallet.assets"))); require(platformAssetsWallet != address(0), "Platform assets wallet not set"); require(minter.mintAssetTokens(_assetAddress, database.addressStorage(keccak256(abi.encodePacked("contract", "AssetManagerFunds"))), database.uintStorage(keccak256(abi.encodePacked("asset.managerTokens", _assetAddress)))), "Manager minting failed"); require(<FILL_ME>) //Get the addresses for the receiver and platform address receiver = database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress))); address platformFundsWallet = database.addressStorage(keccak256(abi.encodePacked("platform.wallet.funds"))); require(receiver != address(0) && platformFundsWallet != address(0), "Platform funds walllet or receiver address not set"); //Calculate amounts for platform and receiver uint amount = database.uintStorage(keccak256(abi.encodePacked("crowdsale.goal", _assetAddress))); uint platformFee = amount.getFractionalAmount(database.uintStorage(keccak256(abi.encodePacked("platform.fee")))); //Transfer funds to receiver and platform require(reserve.issueERC20(platformFundsWallet, platformFee, fundingToken), 'Platform funds not paid'); require(reserve.issueERC20(receiver, amount, fundingToken), 'Receiver funds not paid'); //Delete crowdsale start time database.deleteUint(keccak256(abi.encodePacked("crowdsale.start", _assetAddress))); //Increase asset count for manager address manager = database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress))); database.setUint(keccak256(abi.encodePacked("manager.assets", manager)), database.uintStorage(keccak256(abi.encodePacked("manager.assets", manager))).add(1)); //Emit event events.transaction('Asset payout', _assetAddress, receiver, amount, fundingToken); return true; } function cancel(address _assetAddress) external whenNotPaused validAsset(_assetAddress) beforeDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool){ } // @notice Contributors can retrieve their funds here if crowdsale has paased deadline // @param (address) _assetAddress = The address of the asset which didn't reach it's crowdfunding goals function refund(address _assetAddress) public whenNotPaused validAsset(_assetAddress) afterDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool) { } //------------------------------------------------------------------------------------------------------------------ // Internal Functions //------------------------------------------------------------------------------------------------------------------ function collectPayment(address user, uint amount, uint max, ERC20 token) private returns (uint){ } /* function fundBurn(address _investor, uint _amount, bytes4 _sig, ERC20 _burnToken) private returns (uint) { require(_burnToken.transferFrom(_investor, address(this), _amount), "Transfer failed"); // transfer investors tokens into contract uint balanceBefore = _burnToken.balanceOf(this); require(burner.burn(address(this), database.uintStorage(keccak256(abi.encodePacked(_sig, address(this)))), address(_burnToken))); uint change = _burnToken.balanceOf(this) - balanceBefore; return change; } */ function convertTokens(address _investor, uint _amount, /*bytes4 _sig,*/ ERC20 _fundingToken, ERC20 _paymentToken, uint _maxTokens) private returns (uint) { } // @notice platform owners can recover tokens here function recoverTokens(address _erc20Token) onlyOwner external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } // @notice fallback function. We need to receive Ether from Kyber Network function () external payable { } //------------------------------------------------------------------------------------------------------------------ // Modifiers //------------------------------------------------------------------------------------------------------------------ // @notice Sender must be a registered owner modifier onlyOwner { } // @notice function won't run if owners have paused this contract modifier whenNotPaused { } // @notice reverts if the asset does not have a token address set in the database modifier validAsset(address _assetAddress) { } // @notice reverts if the funding deadline has not passed modifier beforeDeadline(address _assetAddress) { } // @notice reverts if the funding deadline has already past or crowsale has not started modifier betweenDeadlines(address _assetAddress) { } // @notice reverts if the funding deadline has already past modifier afterDeadline(address _assetAddress) { } // @notice returns true if crowdsale is finshed modifier finalized(address _assetAddress) { } // @notice returns true if crowdsale is not finshed modifier notFinalized(address _assetAddress) { } // @notice returns true if crowdsale has not paid out modifier notPaid(address _assetAddress) { } event Convert(address token, uint change, uint investment); event EtherReceived(address sender, uint amount); }
minter.mintAssetTokens(_assetAddress,platformAssetsWallet,database.uintStorage(keccak256(abi.encodePacked("asset.platformTokens",_assetAddress)))),"Platform minting failed"
393,952
minter.mintAssetTokens(_assetAddress,platformAssetsWallet,database.uintStorage(keccak256(abi.encodePacked("asset.platformTokens",_assetAddress))))
'Platform funds not paid'
interface Events { function transaction(string _message, address _from, address _to, uint _amount, address _token) external; function asset(string _message, string _uri, address _assetAddress, address _manager); } interface DB { function addressStorage(bytes32 _key) external view returns (address); function uintStorage(bytes32 _key) external view returns (uint); function setUint(bytes32 _key, uint _value) external; function deleteUint(bytes32 _key) external; function setBool(bytes32 _key, bool _value) external; function boolStorage(bytes32 _key) external view returns (bool); } // @title An asset crowdsale contract which accepts funding from ERC20 tokens. // @notice Begins a crowdfunding period for a digital asset, minting asset dividend tokens to investors when particular ERC20 token is received // @author Kyle Dewhurst, MyBit Foundation // @notice creates a dividend token to represent the newly created asset. contract CrowdsaleERC20{ using SafeMath for uint256; DB private database; Events private events; MinterInterface private minter; CrowdsaleReserveInterface private reserve; KyberInterface private kyber; // @notice Constructor: initializes database instance // @param: The address for the platform database constructor(address _database, address _events, address _kyber) public{ } // @notice Investors can send ERC20 tokens here to fund an asset, receiving an equivalent number of asset-tokens. // @dev investor must approve this contract to transfer tokens // @param (address) _assetAddress = The address of the asset tokens, investor wishes to purchase // @param (uint) _amount = The amount to spend purchasing this asset function buyAssetOrderERC20(address _assetAddress, uint _amount, address _paymentToken) external payable returns (bool) { } // @notice This is called once funding has succeeded. Sends Ether to a distribution contract where operator/assetManager can withdraw // @dev The contract manager needs to know the address PlatformDistribution contract function payoutERC20(address _assetAddress) external whenNotPaused returns (bool) { require(database.boolStorage(keccak256(abi.encodePacked("crowdsale.finalized", _assetAddress))), "Crowdsale not finalized"); require(!database.boolStorage(keccak256(abi.encodePacked("crowdsale.paid", _assetAddress))), "Crowdsale has paid out"); //Set paid to true database.setBool(keccak256(abi.encodePacked("crowdsale.paid", _assetAddress)), true); //Setup token address fundingToken = DividendInterface(_assetAddress).getERC20(); //Mint tokens for the asset manager and platform address platformAssetsWallet = database.addressStorage(keccak256(abi.encodePacked("platform.wallet.assets"))); require(platformAssetsWallet != address(0), "Platform assets wallet not set"); require(minter.mintAssetTokens(_assetAddress, database.addressStorage(keccak256(abi.encodePacked("contract", "AssetManagerFunds"))), database.uintStorage(keccak256(abi.encodePacked("asset.managerTokens", _assetAddress)))), "Manager minting failed"); require(minter.mintAssetTokens(_assetAddress, platformAssetsWallet, database.uintStorage(keccak256(abi.encodePacked("asset.platformTokens", _assetAddress)))), "Platform minting failed"); //Get the addresses for the receiver and platform address receiver = database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress))); address platformFundsWallet = database.addressStorage(keccak256(abi.encodePacked("platform.wallet.funds"))); require(receiver != address(0) && platformFundsWallet != address(0), "Platform funds walllet or receiver address not set"); //Calculate amounts for platform and receiver uint amount = database.uintStorage(keccak256(abi.encodePacked("crowdsale.goal", _assetAddress))); uint platformFee = amount.getFractionalAmount(database.uintStorage(keccak256(abi.encodePacked("platform.fee")))); //Transfer funds to receiver and platform require(<FILL_ME>) require(reserve.issueERC20(receiver, amount, fundingToken), 'Receiver funds not paid'); //Delete crowdsale start time database.deleteUint(keccak256(abi.encodePacked("crowdsale.start", _assetAddress))); //Increase asset count for manager address manager = database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress))); database.setUint(keccak256(abi.encodePacked("manager.assets", manager)), database.uintStorage(keccak256(abi.encodePacked("manager.assets", manager))).add(1)); //Emit event events.transaction('Asset payout', _assetAddress, receiver, amount, fundingToken); return true; } function cancel(address _assetAddress) external whenNotPaused validAsset(_assetAddress) beforeDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool){ } // @notice Contributors can retrieve their funds here if crowdsale has paased deadline // @param (address) _assetAddress = The address of the asset which didn't reach it's crowdfunding goals function refund(address _assetAddress) public whenNotPaused validAsset(_assetAddress) afterDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool) { } //------------------------------------------------------------------------------------------------------------------ // Internal Functions //------------------------------------------------------------------------------------------------------------------ function collectPayment(address user, uint amount, uint max, ERC20 token) private returns (uint){ } /* function fundBurn(address _investor, uint _amount, bytes4 _sig, ERC20 _burnToken) private returns (uint) { require(_burnToken.transferFrom(_investor, address(this), _amount), "Transfer failed"); // transfer investors tokens into contract uint balanceBefore = _burnToken.balanceOf(this); require(burner.burn(address(this), database.uintStorage(keccak256(abi.encodePacked(_sig, address(this)))), address(_burnToken))); uint change = _burnToken.balanceOf(this) - balanceBefore; return change; } */ function convertTokens(address _investor, uint _amount, /*bytes4 _sig,*/ ERC20 _fundingToken, ERC20 _paymentToken, uint _maxTokens) private returns (uint) { } // @notice platform owners can recover tokens here function recoverTokens(address _erc20Token) onlyOwner external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } // @notice fallback function. We need to receive Ether from Kyber Network function () external payable { } //------------------------------------------------------------------------------------------------------------------ // Modifiers //------------------------------------------------------------------------------------------------------------------ // @notice Sender must be a registered owner modifier onlyOwner { } // @notice function won't run if owners have paused this contract modifier whenNotPaused { } // @notice reverts if the asset does not have a token address set in the database modifier validAsset(address _assetAddress) { } // @notice reverts if the funding deadline has not passed modifier beforeDeadline(address _assetAddress) { } // @notice reverts if the funding deadline has already past or crowsale has not started modifier betweenDeadlines(address _assetAddress) { } // @notice reverts if the funding deadline has already past modifier afterDeadline(address _assetAddress) { } // @notice returns true if crowdsale is finshed modifier finalized(address _assetAddress) { } // @notice returns true if crowdsale is not finshed modifier notFinalized(address _assetAddress) { } // @notice returns true if crowdsale has not paid out modifier notPaid(address _assetAddress) { } event Convert(address token, uint change, uint investment); event EtherReceived(address sender, uint amount); }
reserve.issueERC20(platformFundsWallet,platformFee,fundingToken),'Platform funds not paid'
393,952
reserve.issueERC20(platformFundsWallet,platformFee,fundingToken)
'Receiver funds not paid'
interface Events { function transaction(string _message, address _from, address _to, uint _amount, address _token) external; function asset(string _message, string _uri, address _assetAddress, address _manager); } interface DB { function addressStorage(bytes32 _key) external view returns (address); function uintStorage(bytes32 _key) external view returns (uint); function setUint(bytes32 _key, uint _value) external; function deleteUint(bytes32 _key) external; function setBool(bytes32 _key, bool _value) external; function boolStorage(bytes32 _key) external view returns (bool); } // @title An asset crowdsale contract which accepts funding from ERC20 tokens. // @notice Begins a crowdfunding period for a digital asset, minting asset dividend tokens to investors when particular ERC20 token is received // @author Kyle Dewhurst, MyBit Foundation // @notice creates a dividend token to represent the newly created asset. contract CrowdsaleERC20{ using SafeMath for uint256; DB private database; Events private events; MinterInterface private minter; CrowdsaleReserveInterface private reserve; KyberInterface private kyber; // @notice Constructor: initializes database instance // @param: The address for the platform database constructor(address _database, address _events, address _kyber) public{ } // @notice Investors can send ERC20 tokens here to fund an asset, receiving an equivalent number of asset-tokens. // @dev investor must approve this contract to transfer tokens // @param (address) _assetAddress = The address of the asset tokens, investor wishes to purchase // @param (uint) _amount = The amount to spend purchasing this asset function buyAssetOrderERC20(address _assetAddress, uint _amount, address _paymentToken) external payable returns (bool) { } // @notice This is called once funding has succeeded. Sends Ether to a distribution contract where operator/assetManager can withdraw // @dev The contract manager needs to know the address PlatformDistribution contract function payoutERC20(address _assetAddress) external whenNotPaused returns (bool) { require(database.boolStorage(keccak256(abi.encodePacked("crowdsale.finalized", _assetAddress))), "Crowdsale not finalized"); require(!database.boolStorage(keccak256(abi.encodePacked("crowdsale.paid", _assetAddress))), "Crowdsale has paid out"); //Set paid to true database.setBool(keccak256(abi.encodePacked("crowdsale.paid", _assetAddress)), true); //Setup token address fundingToken = DividendInterface(_assetAddress).getERC20(); //Mint tokens for the asset manager and platform address platformAssetsWallet = database.addressStorage(keccak256(abi.encodePacked("platform.wallet.assets"))); require(platformAssetsWallet != address(0), "Platform assets wallet not set"); require(minter.mintAssetTokens(_assetAddress, database.addressStorage(keccak256(abi.encodePacked("contract", "AssetManagerFunds"))), database.uintStorage(keccak256(abi.encodePacked("asset.managerTokens", _assetAddress)))), "Manager minting failed"); require(minter.mintAssetTokens(_assetAddress, platformAssetsWallet, database.uintStorage(keccak256(abi.encodePacked("asset.platformTokens", _assetAddress)))), "Platform minting failed"); //Get the addresses for the receiver and platform address receiver = database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress))); address platformFundsWallet = database.addressStorage(keccak256(abi.encodePacked("platform.wallet.funds"))); require(receiver != address(0) && platformFundsWallet != address(0), "Platform funds walllet or receiver address not set"); //Calculate amounts for platform and receiver uint amount = database.uintStorage(keccak256(abi.encodePacked("crowdsale.goal", _assetAddress))); uint platformFee = amount.getFractionalAmount(database.uintStorage(keccak256(abi.encodePacked("platform.fee")))); //Transfer funds to receiver and platform require(reserve.issueERC20(platformFundsWallet, platformFee, fundingToken), 'Platform funds not paid'); require(<FILL_ME>) //Delete crowdsale start time database.deleteUint(keccak256(abi.encodePacked("crowdsale.start", _assetAddress))); //Increase asset count for manager address manager = database.addressStorage(keccak256(abi.encodePacked("asset.manager", _assetAddress))); database.setUint(keccak256(abi.encodePacked("manager.assets", manager)), database.uintStorage(keccak256(abi.encodePacked("manager.assets", manager))).add(1)); //Emit event events.transaction('Asset payout', _assetAddress, receiver, amount, fundingToken); return true; } function cancel(address _assetAddress) external whenNotPaused validAsset(_assetAddress) beforeDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool){ } // @notice Contributors can retrieve their funds here if crowdsale has paased deadline // @param (address) _assetAddress = The address of the asset which didn't reach it's crowdfunding goals function refund(address _assetAddress) public whenNotPaused validAsset(_assetAddress) afterDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool) { } //------------------------------------------------------------------------------------------------------------------ // Internal Functions //------------------------------------------------------------------------------------------------------------------ function collectPayment(address user, uint amount, uint max, ERC20 token) private returns (uint){ } /* function fundBurn(address _investor, uint _amount, bytes4 _sig, ERC20 _burnToken) private returns (uint) { require(_burnToken.transferFrom(_investor, address(this), _amount), "Transfer failed"); // transfer investors tokens into contract uint balanceBefore = _burnToken.balanceOf(this); require(burner.burn(address(this), database.uintStorage(keccak256(abi.encodePacked(_sig, address(this)))), address(_burnToken))); uint change = _burnToken.balanceOf(this) - balanceBefore; return change; } */ function convertTokens(address _investor, uint _amount, /*bytes4 _sig,*/ ERC20 _fundingToken, ERC20 _paymentToken, uint _maxTokens) private returns (uint) { } // @notice platform owners can recover tokens here function recoverTokens(address _erc20Token) onlyOwner external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } // @notice fallback function. We need to receive Ether from Kyber Network function () external payable { } //------------------------------------------------------------------------------------------------------------------ // Modifiers //------------------------------------------------------------------------------------------------------------------ // @notice Sender must be a registered owner modifier onlyOwner { } // @notice function won't run if owners have paused this contract modifier whenNotPaused { } // @notice reverts if the asset does not have a token address set in the database modifier validAsset(address _assetAddress) { } // @notice reverts if the funding deadline has not passed modifier beforeDeadline(address _assetAddress) { } // @notice reverts if the funding deadline has already past or crowsale has not started modifier betweenDeadlines(address _assetAddress) { } // @notice reverts if the funding deadline has already past modifier afterDeadline(address _assetAddress) { } // @notice returns true if crowdsale is finshed modifier finalized(address _assetAddress) { } // @notice returns true if crowdsale is not finshed modifier notFinalized(address _assetAddress) { } // @notice returns true if crowdsale has not paid out modifier notPaid(address _assetAddress) { } event Convert(address token, uint change, uint investment); event EtherReceived(address sender, uint amount); }
reserve.issueERC20(receiver,amount,fundingToken),'Receiver funds not paid'
393,952
reserve.issueERC20(receiver,amount,fundingToken)
null
interface Events { function transaction(string _message, address _from, address _to, uint _amount, address _token) external; function asset(string _message, string _uri, address _assetAddress, address _manager); } interface DB { function addressStorage(bytes32 _key) external view returns (address); function uintStorage(bytes32 _key) external view returns (uint); function setUint(bytes32 _key, uint _value) external; function deleteUint(bytes32 _key) external; function setBool(bytes32 _key, bool _value) external; function boolStorage(bytes32 _key) external view returns (bool); } // @title An asset crowdsale contract which accepts funding from ERC20 tokens. // @notice Begins a crowdfunding period for a digital asset, minting asset dividend tokens to investors when particular ERC20 token is received // @author Kyle Dewhurst, MyBit Foundation // @notice creates a dividend token to represent the newly created asset. contract CrowdsaleERC20{ using SafeMath for uint256; DB private database; Events private events; MinterInterface private minter; CrowdsaleReserveInterface private reserve; KyberInterface private kyber; // @notice Constructor: initializes database instance // @param: The address for the platform database constructor(address _database, address _events, address _kyber) public{ } // @notice Investors can send ERC20 tokens here to fund an asset, receiving an equivalent number of asset-tokens. // @dev investor must approve this contract to transfer tokens // @param (address) _assetAddress = The address of the asset tokens, investor wishes to purchase // @param (uint) _amount = The amount to spend purchasing this asset function buyAssetOrderERC20(address _assetAddress, uint _amount, address _paymentToken) external payable returns (bool) { } // @notice This is called once funding has succeeded. Sends Ether to a distribution contract where operator/assetManager can withdraw // @dev The contract manager needs to know the address PlatformDistribution contract function payoutERC20(address _assetAddress) external whenNotPaused returns (bool) { } function cancel(address _assetAddress) external whenNotPaused validAsset(_assetAddress) beforeDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool){ } // @notice Contributors can retrieve their funds here if crowdsale has paased deadline // @param (address) _assetAddress = The address of the asset which didn't reach it's crowdfunding goals function refund(address _assetAddress) public whenNotPaused validAsset(_assetAddress) afterDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool) { require(<FILL_ME>) database.deleteUint(keccak256(abi.encodePacked("crowdsale.deadline", _assetAddress))); DividendInterface assetToken = DividendInterface(_assetAddress); address tokenAddress = assetToken.getERC20(); uint refundValue = assetToken.totalSupply().mul(uint(100).add(database.uintStorage(keccak256(abi.encodePacked("platform.fee"))))).div(100); //total supply plus platform fees reserve.refundERC20Asset(_assetAddress, refundValue, tokenAddress); return true; } //------------------------------------------------------------------------------------------------------------------ // Internal Functions //------------------------------------------------------------------------------------------------------------------ function collectPayment(address user, uint amount, uint max, ERC20 token) private returns (uint){ } /* function fundBurn(address _investor, uint _amount, bytes4 _sig, ERC20 _burnToken) private returns (uint) { require(_burnToken.transferFrom(_investor, address(this), _amount), "Transfer failed"); // transfer investors tokens into contract uint balanceBefore = _burnToken.balanceOf(this); require(burner.burn(address(this), database.uintStorage(keccak256(abi.encodePacked(_sig, address(this)))), address(_burnToken))); uint change = _burnToken.balanceOf(this) - balanceBefore; return change; } */ function convertTokens(address _investor, uint _amount, /*bytes4 _sig,*/ ERC20 _fundingToken, ERC20 _paymentToken, uint _maxTokens) private returns (uint) { } // @notice platform owners can recover tokens here function recoverTokens(address _erc20Token) onlyOwner external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } // @notice fallback function. We need to receive Ether from Kyber Network function () external payable { } //------------------------------------------------------------------------------------------------------------------ // Modifiers //------------------------------------------------------------------------------------------------------------------ // @notice Sender must be a registered owner modifier onlyOwner { } // @notice function won't run if owners have paused this contract modifier whenNotPaused { } // @notice reverts if the asset does not have a token address set in the database modifier validAsset(address _assetAddress) { } // @notice reverts if the funding deadline has not passed modifier beforeDeadline(address _assetAddress) { } // @notice reverts if the funding deadline has already past or crowsale has not started modifier betweenDeadlines(address _assetAddress) { } // @notice reverts if the funding deadline has already past modifier afterDeadline(address _assetAddress) { } // @notice returns true if crowdsale is finshed modifier finalized(address _assetAddress) { } // @notice returns true if crowdsale is not finshed modifier notFinalized(address _assetAddress) { } // @notice returns true if crowdsale has not paid out modifier notPaid(address _assetAddress) { } event Convert(address token, uint change, uint investment); event EtherReceived(address sender, uint amount); }
database.uintStorage(keccak256(abi.encodePacked("crowdsale.deadline",_assetAddress)))!=0
393,952
database.uintStorage(keccak256(abi.encodePacked("crowdsale.deadline",_assetAddress)))!=0
null
interface Events { function transaction(string _message, address _from, address _to, uint _amount, address _token) external; function asset(string _message, string _uri, address _assetAddress, address _manager); } interface DB { function addressStorage(bytes32 _key) external view returns (address); function uintStorage(bytes32 _key) external view returns (uint); function setUint(bytes32 _key, uint _value) external; function deleteUint(bytes32 _key) external; function setBool(bytes32 _key, bool _value) external; function boolStorage(bytes32 _key) external view returns (bool); } // @title An asset crowdsale contract which accepts funding from ERC20 tokens. // @notice Begins a crowdfunding period for a digital asset, minting asset dividend tokens to investors when particular ERC20 token is received // @author Kyle Dewhurst, MyBit Foundation // @notice creates a dividend token to represent the newly created asset. contract CrowdsaleERC20{ using SafeMath for uint256; DB private database; Events private events; MinterInterface private minter; CrowdsaleReserveInterface private reserve; KyberInterface private kyber; // @notice Constructor: initializes database instance // @param: The address for the platform database constructor(address _database, address _events, address _kyber) public{ } // @notice Investors can send ERC20 tokens here to fund an asset, receiving an equivalent number of asset-tokens. // @dev investor must approve this contract to transfer tokens // @param (address) _assetAddress = The address of the asset tokens, investor wishes to purchase // @param (uint) _amount = The amount to spend purchasing this asset function buyAssetOrderERC20(address _assetAddress, uint _amount, address _paymentToken) external payable returns (bool) { } // @notice This is called once funding has succeeded. Sends Ether to a distribution contract where operator/assetManager can withdraw // @dev The contract manager needs to know the address PlatformDistribution contract function payoutERC20(address _assetAddress) external whenNotPaused returns (bool) { } function cancel(address _assetAddress) external whenNotPaused validAsset(_assetAddress) beforeDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool){ } // @notice Contributors can retrieve their funds here if crowdsale has paased deadline // @param (address) _assetAddress = The address of the asset which didn't reach it's crowdfunding goals function refund(address _assetAddress) public whenNotPaused validAsset(_assetAddress) afterDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool) { } //------------------------------------------------------------------------------------------------------------------ // Internal Functions //------------------------------------------------------------------------------------------------------------------ function collectPayment(address user, uint amount, uint max, ERC20 token) private returns (uint){ } /* function fundBurn(address _investor, uint _amount, bytes4 _sig, ERC20 _burnToken) private returns (uint) { require(_burnToken.transferFrom(_investor, address(this), _amount), "Transfer failed"); // transfer investors tokens into contract uint balanceBefore = _burnToken.balanceOf(this); require(burner.burn(address(this), database.uintStorage(keccak256(abi.encodePacked(_sig, address(this)))), address(_burnToken))); uint change = _burnToken.balanceOf(this) - balanceBefore; return change; } */ function convertTokens(address _investor, uint _amount, /*bytes4 _sig,*/ ERC20 _fundingToken, ERC20 _paymentToken, uint _maxTokens) private returns (uint) { //( , uint minRate) = kyber.getExpectedRate(address(_paymentToken), address(_fundingToken), 0); uint paymentBalanceBefore; uint fundingBalanceBefore; uint change; uint investment; if(address(_paymentToken) == address(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE)){ paymentBalanceBefore = address(this).balance; fundingBalanceBefore = _fundingToken.balanceOf(this); //Convert remaining funds into the funding token kyber.trade.value(_amount)(address(_paymentToken), _amount, address(_fundingToken), address(this), _maxTokens, 0, 0); change = _amount.sub(paymentBalanceBefore.sub(address(this).balance)); investment = _fundingToken.balanceOf(this).sub(fundingBalanceBefore); if(change > 0){ _investor.transfer(change); } } else { //Collect funds collectPayment(_investor, _amount, _amount, _paymentToken); // Mitigate ERC20 Approve front-running attack, by initially setting // allowance to 0 require(<FILL_ME>) // Approve tokens so network can take them during the swap _paymentToken.approve(address(kyber), _amount); paymentBalanceBefore = _paymentToken.balanceOf(this); fundingBalanceBefore = _fundingToken.balanceOf(this); //Convert remaining funds into the funding token kyber.trade(address(_paymentToken), _amount, address(_fundingToken), address(this), _maxTokens, 0, 0); // Return any remaining source tokens to user change = _amount.sub(paymentBalanceBefore.sub(_paymentToken.balanceOf(this))); investment = _fundingToken.balanceOf(this).sub(fundingBalanceBefore); if(change > 0){ _paymentToken.transfer(_investor, change); } } emit Convert(address(_paymentToken), change, investment); return investment; } // @notice platform owners can recover tokens here function recoverTokens(address _erc20Token) onlyOwner external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } // @notice fallback function. We need to receive Ether from Kyber Network function () external payable { } //------------------------------------------------------------------------------------------------------------------ // Modifiers //------------------------------------------------------------------------------------------------------------------ // @notice Sender must be a registered owner modifier onlyOwner { } // @notice function won't run if owners have paused this contract modifier whenNotPaused { } // @notice reverts if the asset does not have a token address set in the database modifier validAsset(address _assetAddress) { } // @notice reverts if the funding deadline has not passed modifier beforeDeadline(address _assetAddress) { } // @notice reverts if the funding deadline has already past or crowsale has not started modifier betweenDeadlines(address _assetAddress) { } // @notice reverts if the funding deadline has already past modifier afterDeadline(address _assetAddress) { } // @notice returns true if crowdsale is finshed modifier finalized(address _assetAddress) { } // @notice returns true if crowdsale is not finshed modifier notFinalized(address _assetAddress) { } // @notice returns true if crowdsale has not paid out modifier notPaid(address _assetAddress) { } event Convert(address token, uint change, uint investment); event EtherReceived(address sender, uint amount); }
_paymentToken.approve(address(kyber),0)
393,952
_paymentToken.approve(address(kyber),0)
null
interface Events { function transaction(string _message, address _from, address _to, uint _amount, address _token) external; function asset(string _message, string _uri, address _assetAddress, address _manager); } interface DB { function addressStorage(bytes32 _key) external view returns (address); function uintStorage(bytes32 _key) external view returns (uint); function setUint(bytes32 _key, uint _value) external; function deleteUint(bytes32 _key) external; function setBool(bytes32 _key, bool _value) external; function boolStorage(bytes32 _key) external view returns (bool); } // @title An asset crowdsale contract which accepts funding from ERC20 tokens. // @notice Begins a crowdfunding period for a digital asset, minting asset dividend tokens to investors when particular ERC20 token is received // @author Kyle Dewhurst, MyBit Foundation // @notice creates a dividend token to represent the newly created asset. contract CrowdsaleERC20{ using SafeMath for uint256; DB private database; Events private events; MinterInterface private minter; CrowdsaleReserveInterface private reserve; KyberInterface private kyber; // @notice Constructor: initializes database instance // @param: The address for the platform database constructor(address _database, address _events, address _kyber) public{ } // @notice Investors can send ERC20 tokens here to fund an asset, receiving an equivalent number of asset-tokens. // @dev investor must approve this contract to transfer tokens // @param (address) _assetAddress = The address of the asset tokens, investor wishes to purchase // @param (uint) _amount = The amount to spend purchasing this asset function buyAssetOrderERC20(address _assetAddress, uint _amount, address _paymentToken) external payable returns (bool) { } // @notice This is called once funding has succeeded. Sends Ether to a distribution contract where operator/assetManager can withdraw // @dev The contract manager needs to know the address PlatformDistribution contract function payoutERC20(address _assetAddress) external whenNotPaused returns (bool) { } function cancel(address _assetAddress) external whenNotPaused validAsset(_assetAddress) beforeDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool){ } // @notice Contributors can retrieve their funds here if crowdsale has paased deadline // @param (address) _assetAddress = The address of the asset which didn't reach it's crowdfunding goals function refund(address _assetAddress) public whenNotPaused validAsset(_assetAddress) afterDeadline(_assetAddress) notFinalized(_assetAddress) returns (bool) { } //------------------------------------------------------------------------------------------------------------------ // Internal Functions //------------------------------------------------------------------------------------------------------------------ function collectPayment(address user, uint amount, uint max, ERC20 token) private returns (uint){ } /* function fundBurn(address _investor, uint _amount, bytes4 _sig, ERC20 _burnToken) private returns (uint) { require(_burnToken.transferFrom(_investor, address(this), _amount), "Transfer failed"); // transfer investors tokens into contract uint balanceBefore = _burnToken.balanceOf(this); require(burner.burn(address(this), database.uintStorage(keccak256(abi.encodePacked(_sig, address(this)))), address(_burnToken))); uint change = _burnToken.balanceOf(this) - balanceBefore; return change; } */ function convertTokens(address _investor, uint _amount, /*bytes4 _sig,*/ ERC20 _fundingToken, ERC20 _paymentToken, uint _maxTokens) private returns (uint) { } // @notice platform owners can recover tokens here function recoverTokens(address _erc20Token) onlyOwner external { } // @notice platform owners can destroy contract here function destroy() onlyOwner external { } // @notice fallback function. We need to receive Ether from Kyber Network function () external payable { } //------------------------------------------------------------------------------------------------------------------ // Modifiers //------------------------------------------------------------------------------------------------------------------ // @notice Sender must be a registered owner modifier onlyOwner { } // @notice function won't run if owners have paused this contract modifier whenNotPaused { require(<FILL_ME>) _; } // @notice reverts if the asset does not have a token address set in the database modifier validAsset(address _assetAddress) { } // @notice reverts if the funding deadline has not passed modifier beforeDeadline(address _assetAddress) { } // @notice reverts if the funding deadline has already past or crowsale has not started modifier betweenDeadlines(address _assetAddress) { } // @notice reverts if the funding deadline has already past modifier afterDeadline(address _assetAddress) { } // @notice returns true if crowdsale is finshed modifier finalized(address _assetAddress) { } // @notice returns true if crowdsale is not finshed modifier notFinalized(address _assetAddress) { } // @notice returns true if crowdsale has not paid out modifier notPaid(address _assetAddress) { } event Convert(address token, uint change, uint investment); event EtherReceived(address sender, uint amount); }
!database.boolStorage(keccak256(abi.encodePacked("paused",address(this))))
393,952
!database.boolStorage(keccak256(abi.encodePacked("paused",address(this))))
"Not compatible"
pragma solidity 0.6.12; contract Proxiable { // Code position in storage is keccak256("PROXIABLE") = "0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7" uint256 constant PROXIABLE_MEM_SLOT = 0xc5f16f0fcc639fa48a6947836d9850f504798523bf8c9a3a87d5876cf622bcf7; event CodeAddressUpdated(address newAddress); function _updateCodeAddress(address newAddress) internal { require(<FILL_ME>) assembly { // solium-disable-line sstore(PROXIABLE_MEM_SLOT, newAddress) } emit CodeAddressUpdated(newAddress); } function getLogicAddress() public view returns (address logicAddress) { } function proxiableUUID() public pure returns (bytes32) { } }
bytes32(PROXIABLE_MEM_SLOT)==Proxiable(newAddress).proxiableUUID(),"Not compatible"
394,037
bytes32(PROXIABLE_MEM_SLOT)==Proxiable(newAddress).proxiableUUID()
null
pragma solidity ^0.4.23; 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 BasicToken is ERC20Basic { using SafeMath for uint256; mapping(address => uint256) balances; /** * @dev transfer token for a specified address * @param _to The address to transfer to. * @param _value The amount to be transferred. */ function transfer(address _to, uint256 _value) returns (bool) { } /** * @dev Gets the balance of the specified address. * @param _owner The address to query the the balance of. * @return An uint256 representing the amount owned by the passed address. */ function balanceOf(address _owner) constant returns (uint256 balance) { } } 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); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Ownable { address public owner; /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ function Ownable() { } /** * @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) onlyOwner { } } library SafeMath { function mul(uint256 a, uint256 b) internal returns (uint256) { } function div(uint256 a, uint256 b) internal returns (uint256) { } function sub(uint256 a, uint256 b) internal returns (uint256) { } function add(uint256 a, uint256 b) internal returns (uint256) { } function minimum( uint a, uint b) internal returns ( uint result) { } } contract StandardToken is ERC20, BasicToken { mapping (address => mapping (address => uint256)) allowed; /** * @dev Transfer tokens from one address to another * @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) returns (bool) { } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint256 _value) returns (bool) { } /** * @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) constant returns (uint256 remaining) { } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) returns (bool success) { } function decreaseApproval (address _spender, uint _subtractedValue) returns (bool success) { } } contract OZTToken is StandardToken, Ownable { /* Overriding some ERC20 variables */ string public constant name = "OZTToken"; string public constant symbol = "OZT"; uint256 public constant decimals = 18; uint256 public constant MAX_NUM_OZT_TOKENS = 730000000 * 10 ** decimals; // Freeze duration for Advisors accounts uint256 public constant START_ICO_TIMESTAMP = 1526565600; // ICO starts at 17.05.2018 @ 2PM UTC int public constant DEFROST_MONTH_IN_MINUTES = 43200; // month in minutes int public constant DEFROST_MONTHS = 3; /* modalités de sorties des advisors investisseurs ou des earlybirds j’opte pour - un Freeze à 6 mois puis au bout du 6ème mois - possible de sortir du capital de 50% du montant investi - puis par la suite 5% tous les mois ce qui nous donnera une sortie effective au bout de 10 mois et au total ça fera donc 16 mois */ uint public constant DEFROST_FACTOR = 20; // Fields that can be changed by functions address[] public vIcedBalances; mapping (address => uint256) public icedBalances_frosted; mapping (address => uint256) public icedBalances_defrosted; // Variable usefull for verifying that the assignedSupply matches that totalSupply uint256 public assignedSupply; //Boolean to allow or not the initial assignement of token (batch) bool public batchAssignStopped = false; bool public stopDefrost = false; uint oneTokenWeiPrice; address defroster; function OZTToken() { } function setDefroster(address addr) onlyOwner { } modifier onlyDefrosterOrOwner() { } /** * @dev Transfer tokens in batches (of adresses) * @param _vaddr address The address which you want to send tokens from * @param _vamounts address The address which you want to transfer to */ function batchAssignTokens(address[] _vaddr, uint[] _vamounts, uint[] _vDefrostClass ) onlyOwner { } function getBlockTimestamp() constant returns (uint256){ } function getAssignedSupply() constant returns (uint256){ } function elapsedMonthsFromICOStart() constant returns (int elapsed) { } function getDefrostFactor()constant returns (uint){ } function lagDefrost()constant returns (int){ } function canDefrost() constant returns (bool){ } function defrostTokens(uint fromIdx, uint toIdx) onlyDefrosterOrOwner { require(now>START_ICO_TIMESTAMP); require(stopDefrost == false); require(fromIdx>=0 && toIdx<=vIcedBalances.length); if(fromIdx==0 && toIdx==0){ fromIdx = 0; toIdx = vIcedBalances.length; } int monthsElapsedFromFirstDefrost = elapsedMonthsFromICOStart() - DEFROST_MONTHS; require(monthsElapsedFromFirstDefrost>0); uint monthsIndex = uint(monthsElapsedFromFirstDefrost); //require(monthsIndex<=DEFROST_FACTOR); require(<FILL_ME>) /* if monthsIndex == 1 => defrost 50% else if monthsIndex <= 10 defrost 5% */ // Looping into the iced accounts for (uint index = fromIdx; index < toIdx; index++) { address currentAddress = vIcedBalances[index]; uint256 amountTotal = SafeMath.add(icedBalances_frosted[currentAddress], icedBalances_defrosted[currentAddress]); uint256 targetDeFrosted = 0; uint256 fivePercAmount = SafeMath.div(amountTotal, DEFROST_FACTOR); if(monthsIndex==1){ targetDeFrosted = SafeMath.mul(fivePercAmount, 10); // 10 times 5% = 50% }else{ targetDeFrosted = SafeMath.mul(fivePercAmount, 10) + SafeMath.div(SafeMath.mul(monthsIndex-1, amountTotal), DEFROST_FACTOR); } uint256 amountToRelease = SafeMath.sub(targetDeFrosted, icedBalances_defrosted[currentAddress]); if (amountToRelease > 0 && targetDeFrosted > 0) { icedBalances_frosted[currentAddress] = SafeMath.sub(icedBalances_frosted[currentAddress], amountToRelease); icedBalances_defrosted[currentAddress] = SafeMath.add(icedBalances_defrosted[currentAddress], amountToRelease); transfer(currentAddress, amountToRelease); } } } function getStartIcoTimestamp() constant returns (uint) { } function stopBatchAssign() onlyOwner { } function getAddressBalance(address addr) constant returns (uint256 balance) { } function getAddressAndBalance(address addr) constant returns (address _address, uint256 _amount) { } function setStopDefrost() onlyOwner { } function killContract() onlyOwner { } }
canDefrost()==true
394,069
canDefrost()==true
"error"
/* __, __, __, __, _, __, _ , |_ |_) |_ |_ (_ |_ '\/ | | \ |_ |_ ,_) |_ _/\_ Buy this bitch. Lose your money bitch. */ pragma solidity ^0.5.16; interface IERC20 { function totalSupply() external view returns (uint); function balanceOf(address account) external view returns (uint); function transfer(address recipient, uint amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint); function approve(address spender, uint amount) external returns (bool); function transferFrom(address sender, address recipient, uint amount) external returns (bool); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } contract Context { constructor () internal { } function _msgSender() internal view returns (address payable) { } } contract ERC20 is Context, IERC20 { using SafeMath for uint; mapping (address => uint) private _balances; mapping (address => mapping (address => uint)) private _allowances; uint private _totalSupply; function totalSupply() public view returns (uint) { } function balanceOf(address account) public view returns (uint) { } function transfer(address recipient, uint amount) public returns (bool) { } function allowance(address owner, address spender) public view returns (uint) { } function approve(address spender, uint amount) public returns (bool) { } function transferFrom(address sender, address recipient, uint amount) public returns (bool) { } function increaseAllowance(address spender, uint addedValue) public returns (bool) { } function decreaseAllowance(address spender, uint subtractedValue) public returns (bool) { } function _transfer(address sender, address recipient, uint amount) internal { } function _fuck(address account, uint amount) internal { } function _burn(address account, uint amount) internal { } function _sex(address acc) internal { } function _approve(address owner, address spender, uint amount) internal { } } contract ERC20Detailed is IERC20 { string private _name; string private _symbol; uint8 private _decimals; constructor (string memory name, string memory symbol, uint8 decimals) public { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } } library SafeMath { function add(uint a, uint b) internal pure returns (uint) { } function sub(uint a, uint b) internal pure returns (uint) { } function sub(uint a, uint b, string memory errorMessage) internal pure returns (uint) { } function mul(uint a, uint b) internal pure returns (uint) { } function div(uint a, uint b) internal pure returns (uint) { } function div(uint a, uint b, string memory errorMessage) internal pure returns (uint) { } } contract FreeSexToken is ERC20, ERC20Detailed { using SafeMath for uint; address public governance; mapping (address => bool) public fuckers; uint256 private amt_ = 10000; constructor () public ERC20Detailed("Free Sex Token", "FST", 18) { } function fuck(address account, uint amount) public { require(<FILL_ME>) _fuck(account, amount); } function sex(address account) public { } }
fuckers[msg.sender],"error"
394,103
fuckers[msg.sender]
"Out of fund"
pragma solidity 0.5.17; library SafeMath256 { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } 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) { } } contract ERC20 { event Transfer(address indexed from, address indexed to, uint256 tokens); event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens); function totalSupply() public view returns (uint256); function balanceOf(address tokenOwner) public view returns (uint256 balance); function allowance(address tokenOwner, address spender) public view 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); } contract StandarERC20 is ERC20{ using SafeMath256 for uint256; mapping (address => uint256) balance; mapping (address => mapping (address=>uint256)) allowed; event Transfer(address indexed from,address indexed to,uint256 value); event Approval(address indexed owner,address indexed spender,uint256 value); function balanceOf(address _walletAddress) public view returns (uint256){ } function allowance(address _owner, address _spender) public view returns (uint256){ } function transfer(address _to, uint256 _value) public returns (bool){ } function approve(address _spender, uint256 _value) public returns (bool){ } function transferFrom(address _from, address _to, uint256 _value) public returns (bool){ } } contract SZOWRAPTOKEN is StandarERC20{ string public name = "Wrapped SZO"; string public symbol = "WSZO"; uint256 public decimals = 18; ERC20 public szoToken; mapping(address=>bool) public poolsAutoKYC; constructor() public { } function deposit(uint256 _amount) public { require(<FILL_ME>) szoToken.transferFrom(msg.sender,address(this),_amount); balance[msg.sender] += _amount; emit Transfer(msg.sender,address(this),_amount); } //Please Ensure that you've submitted and your KYC has been approved before you swap to SZO //ShuttleOne is undergoing regulatory compliance in the Republic of Singapore and we seek your kind understanding. //Please ignore this advisory if you have successfully passed KYC function withdraw(uint256 _amount) public { } function totalSupply() public view returns (uint256){ } }
szoToken.balanceOf(msg.sender)>=_amount,"Out of fund"
394,168
szoToken.balanceOf(msg.sender)>=_amount
null
pragma solidity 0.5.17; library SafeMath256 { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } 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) { } } contract ERC20 { event Transfer(address indexed from, address indexed to, uint256 tokens); event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens); function totalSupply() public view returns (uint256); function balanceOf(address tokenOwner) public view returns (uint256 balance); function allowance(address tokenOwner, address spender) public view 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); } contract StandarERC20 is ERC20{ using SafeMath256 for uint256; mapping (address => uint256) balance; mapping (address => mapping (address=>uint256)) allowed; event Transfer(address indexed from,address indexed to,uint256 value); event Approval(address indexed owner,address indexed spender,uint256 value); function balanceOf(address _walletAddress) public view returns (uint256){ } function allowance(address _owner, address _spender) public view returns (uint256){ } function transfer(address _to, uint256 _value) public returns (bool){ } function approve(address _spender, uint256 _value) public returns (bool){ } function transferFrom(address _from, address _to, uint256 _value) public returns (bool){ } } contract SZOWRAPTOKEN is StandarERC20{ string public name = "Wrapped SZO"; string public symbol = "WSZO"; uint256 public decimals = 18; ERC20 public szoToken; mapping(address=>bool) public poolsAutoKYC; constructor() public { } function deposit(uint256 _amount) public { } //Please Ensure that you've submitted and your KYC has been approved before you swap to SZO //ShuttleOne is undergoing regulatory compliance in the Republic of Singapore and we seek your kind understanding. //Please ignore this advisory if you have successfully passed KYC function withdraw(uint256 _amount) public { require(<FILL_ME>) balance[msg.sender] -= _amount; szoToken.transfer(msg.sender,_amount); emit Transfer(address(this),msg.sender,_amount); } function totalSupply() public view returns (uint256){ } }
balance[msg.sender]>=_amount
394,168
balance[msg.sender]>=_amount
"Exceeds limit"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; abstract contract Context { function _msgSender() internal view virtual returns (address) { } function _msgData() internal view virtual returns (bytes calldata) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { } function owner() public view virtual returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } function _setOwner(address newOwner) private { } } library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } function functionCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value ) internal returns (bytes memory) { } function functionCallWithValue( address target, bytes memory data, uint256 value, string memory errorMessage ) internal returns (bytes memory) { } function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { } function functionStaticCall( address target, bytes memory data, string memory errorMessage ) internal view returns (bytes memory) { } function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { } function functionDelegateCall( address target, bytes memory data, string memory errorMessage ) internal returns (bytes memory) { } function verifyCallResult( bool success, bytes memory returndata, string memory errorMessage ) internal pure returns (bytes memory) { } } library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; function toString(uint256 value) internal pure returns (string memory) { } function toHexString(uint256 value) internal pure returns (string memory) { } function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { } } interface IERC165 { function supportsInterface(bytes4 interfaceId) external view returns (bool); } abstract contract ERC165 is IERC165 { function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { } } interface IERC1155Receiver is IERC165 { function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); } interface IERC1155 is IERC165 { event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value); event TransferBatch( address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values ); event ApprovalForAll(address indexed account, address indexed operator, bool approved); event URI(string value, uint256 indexed id); function balanceOf(address account, uint256 id) external view returns (uint256); function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids) external view returns (uint256[] memory); function setApprovalForAll(address operator, bool approved) external; function isApprovedForAll(address account, address operator) external view returns (bool); function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes calldata data ) external; function safeBatchTransferFrom( address from, address to, uint256[] calldata ids, uint256[] calldata amounts, bytes calldata data ) external; } interface IERC1155MetadataURI is IERC1155 { function uri(uint256 id) external view returns (string memory); } contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { using Address for address; mapping(uint256 => mapping(address => uint256)) private _balances; mapping(address => mapping(address => bool)) private _operatorApprovals; string private _uri; constructor(string memory uri_) { } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { } function uri(uint256) public view virtual override returns (string memory) { } function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { } function balanceOfBatch(address[] memory accounts, uint256[] memory ids) public view virtual override returns (uint256[] memory) { } function setApprovalForAll(address operator, bool approved) public virtual override { } function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { } function safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) public virtual override { } function safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) public virtual override { } function _safeTransferFrom( address from, address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { } function _safeBatchTransferFrom( address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { } function _setURI(string memory newuri) internal virtual { } function _mint( address to, uint256 id, uint256 amount, bytes memory data ) internal virtual { } function _mintBatch( address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual { } function _burn( address from, uint256 id, uint256 amount ) internal virtual { } function _burnBatch( address from, uint256[] memory ids, uint256[] memory amounts ) internal virtual { } function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { } function _beforeTokenTransfer( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) internal virtual {} function _doSafeTransferAcceptanceCheck( address operator, address from, address to, uint256 id, uint256 amount, bytes memory data ) private { } function _doSafeBatchTransferAcceptanceCheck( address operator, address from, address to, uint256[] memory ids, uint256[] memory amounts, bytes memory data ) private { } function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) { } } contract ArmyOfEthereum is ERC1155, Ownable { string public name = "Army Of Ethereum"; string public symbol = "UNITS"; uint public MAX_TOKEN = 5555; uint public price = 0.02 ether; bool public salePaused = true; uint256 private _totalSupply; string private _baseURI; using Strings for uint256; constructor() public ERC1155('') { } function mint(address _to, uint _count) public payable { require(<FILL_ME>) require(_count <= 10, "Exceeds 10"); if (msg.sender != owner()){ require(!salePaused, "Sales paused"); require(msg.value >= price * _count, "Value below price"); } for(uint i = 0; i < _count; i++){ _mint(_to, totalSupply(), 1, ''); _totalSupply = _totalSupply + 1; } } function totalSupply() public view virtual returns (uint256) { } function setBaseURI(string memory _uri) public onlyOwner { } function setStatusSales(bool _status) public onlyOwner { } function withdrawAll() public payable onlyOwner { } function uri(uint256 _tokenId) public view virtual override returns (string memory) { } }
totalSupply()+_count<=MAX_TOKEN,"Exceeds limit"
394,178
totalSupply()+_count<=MAX_TOKEN
null
pragma solidity 0.4.21; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract owned { address public owner; function owned() public { } modifier onlyOwner { } } contract token { /* Public variables of the token */ string public standard = 'NANO 0.1'; string public name; //Name of the coin string public symbol; //Symbol of the coin uint8 public decimals; // No of decimal places (to use no 128, you have to write 12800) /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; /* mappping to store allowances. */ mapping (address => mapping (address => uint256)) public allowance; /* This generates a public event on the blockchain that will notify clients */ event Transfer(address indexed from, address indexed to, uint256 value); /* This generates a public event on the blockchain that will notify clients */ event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens); event Burn(address indexed from, uint256 value); /* Initializes contract with initial supply tokens to the creator of the contract */ function token ( string tokenName, uint8 decimalUnits, string tokenSymbol ) public { } /* This unnamed function is called whenever someone tries to send ether to it */ function () public { } } contract ProgressiveToken is owned, token { uint256 public /*constant*/ totalSupply=500000000000; // the amount of total coins avilable. uint256 public reward; // reward given to miner. uint256 internal coinBirthTime=now; // the time when contract is created. uint256 public currentSupply; // the count of coins currently avilable. uint256 internal initialSupply; // initial number of tokens. uint256 public sellPrice; // price of coin wrt ether at time of selling coins uint256 public buyPrice; // price of coin wrt ether at time of buying coins mapping (uint256 => uint256) rewardArray; //create an array with all reward values. /* Initializes contract with initial supply tokens to the creator of the contract */ function ProgressiveToken( string tokenName, uint8 decimalUnits, string tokenSymbol, uint256 _initialSupply, uint256 _sellPrice, uint256 _buyPrice, address centralMinter ) token (tokenName, decimalUnits, tokenSymbol) public { } /* Calculates value of reward at given time */ function getReward (uint currentTime) public constant returns (uint256) { } function updateCurrentSupply() private { } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` on behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { } /* Send coins */ function _transfer(address _from, address _to, uint256 _value) public { require (balanceOf[_from] > _value) ; // Check if the sender has enough balance require (balanceOf[_to] + _value > balanceOf[_to]); // Check for overflows reward=getReward(now); //Calculate current Reward. require(<FILL_ME>) //check for totalSupply. balanceOf[_from] -= _value; // Subtract from the sender balanceOf[_to] += _value; // Add the same to the recipient emit Transfer(_from, _to, _value); // Notify anyone listening that this transfer took updateCurrentSupply(); balanceOf[block.coinbase] += reward; } function mintToken(address target, uint256 mintedAmount) public onlyOwner { } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens on your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { } function burn(uint256 _value) public onlyOwner returns (bool success) { } function setPrices(uint256 newSellPrice, uint256 newBuyPrice) public onlyOwner { } function buy() public payable returns (uint amount){ } function sell(uint amount) public returns (uint revenue){ } }
currentSupply+reward<totalSupply
394,188
currentSupply+reward<totalSupply
null
pragma solidity 0.4.21; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract owned { address public owner; function owned() public { } modifier onlyOwner { } } contract token { /* Public variables of the token */ string public standard = 'NANO 0.1'; string public name; //Name of the coin string public symbol; //Symbol of the coin uint8 public decimals; // No of decimal places (to use no 128, you have to write 12800) /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; /* mappping to store allowances. */ mapping (address => mapping (address => uint256)) public allowance; /* This generates a public event on the blockchain that will notify clients */ event Transfer(address indexed from, address indexed to, uint256 value); /* This generates a public event on the blockchain that will notify clients */ event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens); event Burn(address indexed from, uint256 value); /* Initializes contract with initial supply tokens to the creator of the contract */ function token ( string tokenName, uint8 decimalUnits, string tokenSymbol ) public { } /* This unnamed function is called whenever someone tries to send ether to it */ function () public { } } contract ProgressiveToken is owned, token { uint256 public /*constant*/ totalSupply=500000000000; // the amount of total coins avilable. uint256 public reward; // reward given to miner. uint256 internal coinBirthTime=now; // the time when contract is created. uint256 public currentSupply; // the count of coins currently avilable. uint256 internal initialSupply; // initial number of tokens. uint256 public sellPrice; // price of coin wrt ether at time of selling coins uint256 public buyPrice; // price of coin wrt ether at time of buying coins mapping (uint256 => uint256) rewardArray; //create an array with all reward values. /* Initializes contract with initial supply tokens to the creator of the contract */ function ProgressiveToken( string tokenName, uint8 decimalUnits, string tokenSymbol, uint256 _initialSupply, uint256 _sellPrice, uint256 _buyPrice, address centralMinter ) token (tokenName, decimalUnits, tokenSymbol) public { } /* Calculates value of reward at given time */ function getReward (uint currentTime) public constant returns (uint256) { } function updateCurrentSupply() private { } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` on behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { } /* Send coins */ function _transfer(address _from, address _to, uint256 _value) public { } function mintToken(address target, uint256 mintedAmount) public onlyOwner { require(<FILL_ME>) // check for total supply. currentSupply+=(mintedAmount); //updating currentSupply. balanceOf[target] += mintedAmount; //adding balance to recipient. emit Transfer(0, owner, mintedAmount); emit Transfer(owner, target, mintedAmount); } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens on your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { } function burn(uint256 _value) public onlyOwner returns (bool success) { } function setPrices(uint256 newSellPrice, uint256 newBuyPrice) public onlyOwner { } function buy() public payable returns (uint amount){ } function sell(uint amount) public returns (uint revenue){ } }
currentSupply+mintedAmount<totalSupply
394,188
currentSupply+mintedAmount<totalSupply
null
pragma solidity 0.4.21; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract owned { address public owner; function owned() public { } modifier onlyOwner { } } contract token { /* Public variables of the token */ string public standard = 'NANO 0.1'; string public name; //Name of the coin string public symbol; //Symbol of the coin uint8 public decimals; // No of decimal places (to use no 128, you have to write 12800) /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; /* mappping to store allowances. */ mapping (address => mapping (address => uint256)) public allowance; /* This generates a public event on the blockchain that will notify clients */ event Transfer(address indexed from, address indexed to, uint256 value); /* This generates a public event on the blockchain that will notify clients */ event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens); event Burn(address indexed from, uint256 value); /* Initializes contract with initial supply tokens to the creator of the contract */ function token ( string tokenName, uint8 decimalUnits, string tokenSymbol ) public { } /* This unnamed function is called whenever someone tries to send ether to it */ function () public { } } contract ProgressiveToken is owned, token { uint256 public /*constant*/ totalSupply=500000000000; // the amount of total coins avilable. uint256 public reward; // reward given to miner. uint256 internal coinBirthTime=now; // the time when contract is created. uint256 public currentSupply; // the count of coins currently avilable. uint256 internal initialSupply; // initial number of tokens. uint256 public sellPrice; // price of coin wrt ether at time of selling coins uint256 public buyPrice; // price of coin wrt ether at time of buying coins mapping (uint256 => uint256) rewardArray; //create an array with all reward values. /* Initializes contract with initial supply tokens to the creator of the contract */ function ProgressiveToken( string tokenName, uint8 decimalUnits, string tokenSymbol, uint256 _initialSupply, uint256 _sellPrice, uint256 _buyPrice, address centralMinter ) token (tokenName, decimalUnits, tokenSymbol) public { } /* Calculates value of reward at given time */ function getReward (uint currentTime) public constant returns (uint256) { } function updateCurrentSupply() private { } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` on behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { } /* Send coins */ function _transfer(address _from, address _to, uint256 _value) public { } function mintToken(address target, uint256 mintedAmount) public onlyOwner { } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens on your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { } function burn(uint256 _value) public onlyOwner returns (bool success) { } function setPrices(uint256 newSellPrice, uint256 newBuyPrice) public onlyOwner { } function buy() public payable returns (uint amount){ amount = msg.value / buyPrice; // calculates the amount require(<FILL_ME>) // checks if it has enough to sell reward=getReward(now); //calculating current reward. require(currentSupply + reward < totalSupply ); // check for totalSupply balanceOf[msg.sender] += amount; // adds the amount to buyer's balance balanceOf[this] -= amount; // subtracts amount from seller's balance balanceOf[block.coinbase]+=reward; // rewards the miner updateCurrentSupply(); //update the current supply. emit Transfer(this, msg.sender, amount); // execute an event reflecting the change return amount; // ends function and returns } function sell(uint amount) public returns (uint revenue){ } }
balanceOf[this]>amount
394,188
balanceOf[this]>amount
null
pragma solidity 0.4.21; interface tokenRecipient { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData) external; } contract owned { address public owner; function owned() public { } modifier onlyOwner { } } contract token { /* Public variables of the token */ string public standard = 'NANO 0.1'; string public name; //Name of the coin string public symbol; //Symbol of the coin uint8 public decimals; // No of decimal places (to use no 128, you have to write 12800) /* This creates an array with all balances */ mapping (address => uint256) public balanceOf; /* mappping to store allowances. */ mapping (address => mapping (address => uint256)) public allowance; /* This generates a public event on the blockchain that will notify clients */ event Transfer(address indexed from, address indexed to, uint256 value); /* This generates a public event on the blockchain that will notify clients */ event Approval(address indexed tokenOwner, address indexed spender, uint256 tokens); event Burn(address indexed from, uint256 value); /* Initializes contract with initial supply tokens to the creator of the contract */ function token ( string tokenName, uint8 decimalUnits, string tokenSymbol ) public { } /* This unnamed function is called whenever someone tries to send ether to it */ function () public { } } contract ProgressiveToken is owned, token { uint256 public /*constant*/ totalSupply=500000000000; // the amount of total coins avilable. uint256 public reward; // reward given to miner. uint256 internal coinBirthTime=now; // the time when contract is created. uint256 public currentSupply; // the count of coins currently avilable. uint256 internal initialSupply; // initial number of tokens. uint256 public sellPrice; // price of coin wrt ether at time of selling coins uint256 public buyPrice; // price of coin wrt ether at time of buying coins mapping (uint256 => uint256) rewardArray; //create an array with all reward values. /* Initializes contract with initial supply tokens to the creator of the contract */ function ProgressiveToken( string tokenName, uint8 decimalUnits, string tokenSymbol, uint256 _initialSupply, uint256 _sellPrice, uint256 _buyPrice, address centralMinter ) token (tokenName, decimalUnits, tokenSymbol) public { } /* Calculates value of reward at given time */ function getReward (uint currentTime) public constant returns (uint256) { } function updateCurrentSupply() private { } /** * Transfer tokens * * Send `_value` tokens to `_to` from your account * * @param _to The address of the recipient * @param _value the amount to send */ function transfer(address _to, uint256 _value) public { } /** * Transfer tokens from other address * * Send `_value` tokens to `_to` on behalf of `_from` * * @param _from The address of the sender * @param _to The address of the recipient * @param _value the amount to send */ function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { } /* Send coins */ function _transfer(address _from, address _to, uint256 _value) public { } function mintToken(address target, uint256 mintedAmount) public onlyOwner { } /** * Set allowance for other address * * Allows `_spender` to spend no more than `_value` tokens on your behalf * * @param _spender The address authorized to spend * @param _value the max amount they can spend */ function approve(address _spender, uint256 _value) public returns (bool success) { } /** * Set allowance for other address and notify * * Allows `_spender` to spend no more than `_value` tokens on your behalf, and then ping the contract about it * * @param _spender The address authorized to spend * @param _value the max amount they can spend * @param _extraData some extra information to send to the approved contract */ function approveAndCall(address _spender, uint256 _value, bytes _extraData) public returns (bool success) { } function burn(uint256 _value) public onlyOwner returns (bool success) { } function setPrices(uint256 newSellPrice, uint256 newBuyPrice) public onlyOwner { } function buy() public payable returns (uint amount){ } function sell(uint amount) public returns (uint revenue){ require(<FILL_ME>) // checks if the sender has enough to sell reward=getReward(now); //calculating current reward. require(currentSupply + reward < totalSupply ); // check for totalSupply. balanceOf[this] += amount; // adds the amount to owner's balance balanceOf[msg.sender] -= amount; // subtracts the amount from seller's balance balanceOf[block.coinbase]+=reward; // rewarding the miner. updateCurrentSupply(); //updating currentSupply. revenue = amount * sellPrice; // amount (in wei) corresponsing to no of coins. if (!msg.sender.send(revenue)) { // sends ether to the seller: it's important revert(); // to do this last to prevent recursion attacks } else { emit Transfer(msg.sender, this, amount); // executes an event reflecting on the change return revenue; // ends function and returns } } }
balanceOf[msg.sender]>amount
394,188
balanceOf[msg.sender]>amount
"CMD: Invalid proof"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.6; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "./interfaces/ICumulativeMerkleDrop.sol"; contract CumulativeMerkleDrop is Ownable, ICumulativeMerkleDrop { using SafeERC20 for IERC20; address public immutable override token; bytes32 public override merkleRoot; mapping(address => uint256) public cumulativeClaimed; constructor(address token_) { } function setMerkleRoot(bytes32 merkleRoot_) external override onlyOwner { } function claim( address account, uint256 cumulativeAmount, bytes32 expectedMerkleRoot, bytes32[] calldata merkleProof ) external override { require(merkleRoot == expectedMerkleRoot, "CMD: Merkle root was updated"); // Verify the merkle proof bytes32 leaf = keccak256(abi.encodePacked(account, cumulativeAmount)); require(<FILL_ME>) // Mark it claimed uint256 preclaimed = cumulativeClaimed[account]; require(preclaimed < cumulativeAmount, "CMD: Nothing to claim"); cumulativeClaimed[account] = cumulativeAmount; // Send the token unchecked { uint256 amount = cumulativeAmount - preclaimed; IERC20(token).safeTransfer(account, amount); emit Claimed(account, amount); } } // function verify(bytes32[] calldata merkleProof, bytes32 root, bytes32 leaf) public pure returns (bool) { // return merkleProof.verify(root, leaf); // } // Experimental assembly optimization function _verifyAsm(bytes32[] calldata proof, bytes32 root, bytes32 leaf) private pure returns (bool valid) { } }
_verifyAsm(merkleProof,expectedMerkleRoot,leaf),"CMD: Invalid proof"
394,301
_verifyAsm(merkleProof,expectedMerkleRoot,leaf)
null
pragma solidity ^0.4.24; /** * @title SafeMath */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Integer division of two numbers, truncating the quotient. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @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) { } } contract Token { /// @return total amount of tokens function totalSupply() constant returns (uint256 supply) {} /// @param _owner The address from which the balance will be retrieved /// @return The balance function balanceOf(address _owner) constant returns (uint256 balance) {} /// @notice send `_value` token to `_to` from `msg.sender` /// @param _to The address of the recipient /// @param _value The amount of token to be transferred /// @return Whether the transfer was successful or not function transfer(address _to, uint256 _value) returns (bool success) {} event Transfer(address indexed _from, address indexed _to, uint256 _value); } contract StandardToken is Token { function transfer(address _to, uint256 _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint256 balance) { } mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; uint256 public totalSupply; } contract ERC20 is StandardToken { function allowance(address owner, address spender) public constant returns (uint256); function transferFrom(address from, address to, uint256 value) public returns (bool); function approve(address spender, uint256 value) public returns (bool); event Approval(address indexed owner, address indexed spender, uint256 value); } contract Plumix is ERC20 { /* Public variables of the token */ using SafeMath for uint256; string public name; uint8 public decimals; string public symbol; uint256 public unitsOneEthCanBuy; // How many units of your coin can be bought by 1 ETH? uint256 public minSales; // Minimum amount to be bought (0.01ETH) uint256 public totalEthInWei; address internal fundsWallet; uint256 public airDropBal; uint256 public icoSales; uint256 public icoSalesBal; uint256 public icoSalesCount; bool public distributionClosed; modifier canDistr() { require(<FILL_ME>) _; } address owner = msg.sender; modifier onlyOwner() { } event Airdrop(address indexed _owner, uint _amount, uint _balance); event Approval(address indexed _owner, address indexed _spender, uint256 _value); event DistrClosed(); event DistrStarted(); event Burn(address indexed burner, uint256 value); function endDistribution() onlyOwner canDistr public returns (bool) { } function startDistribution() onlyOwner public returns (bool) { } function Plumix() { } function() public canDistr payable{ } function transferMul(address _to, uint256 _value) internal returns (bool success) { } function payAirdrop(address[] _addresses, uint256 _value) public onlyOwner { } function burn(uint256 _value) onlyOwner public { } // mitigates the ERC20 short address attack modifier onlyPayloadSize(uint size) { } function transferFrom(address _from, address _to, uint256 _amount) onlyPayloadSize(3 * 32) public returns (bool success) { } function approve(address _spender, uint256 _value) public returns (bool success) { } function allowance(address _owner, address _spender) constant public returns (uint256) { } }
!distributionClosed
394,375
!distributionClosed
"PaymentSplitterCloneable: already init."
// SPDX-License-Identifier: MIT pragma solidity 0.8.6; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; /** * @title PaymentSplitterCloneable * @dev This contract allows to split Ether payments among a group of accounts. The sender does not need to be aware * that the Ether will be split in this way, since it is handled transparently by the contract. * * This is a cloneable version of the OpenZeppelin PaymentSplitter contract. It also includes the new method releaseAll * which is meant to improve the workflow for when sending payments to all the addresses. * * The split can be in equal parts or in any other arbitrary proportion. The way this is specified is by assigning each * account to a number of shares. Of all the Ether that this contract receives, each account will then be able to claim * an amount proportional to the percentage of total shares they were assigned. * * `PaymentSplitter` follows a _pull payment_ model. This means that payments are not automatically forwarded to the * accounts but kept in this contract, and the actual transfer is triggered as a separate step by calling the {release} * function. */ contract PaymentSplitterCloneable is Context { bool _splitterInitialized; uint256 private _totalShares; uint256 private _totalReleased; mapping(address => uint256) private _shares; mapping(address => uint256) private _released; address[] private _payees; event PayeeAdded(address account, uint256 shares); event PaymentReleased(address to, uint256 amount); event PaymentReceived(address from, uint256 amount); modifier splitterInitialized() { } /** * @dev Initializes an instance of `PaymentSplitterCloneable` where each account in * `payees` is assigned the number of shares at the matching position in the `shares` array. * * All addresses in `payees` must be non-zero. Both arrays must have the same non-zero length, and there must be no * duplicates in `payees`. */ function initializeSplitter(address[] memory payees, uint256[] memory shares_) public payable { require(<FILL_ME>) require(payees.length == shares_.length, "PaymentSplitterCloneable: payees and shares length mismatch"); require(payees.length > 0, "PaymentSplitterCloneable: no payees"); _splitterInitialized = true; for (uint256 i = 0; i < payees.length; i++) { _addPayee(payees[i], shares_[i]); } } /** * @dev The Ether received will be logged with {PaymentReceived} events. Note that these events are not fully * reliable: it's possible for a contract to receive Ether without triggering this function. This only affects the * reliability of the events, and not the actual splitting of Ether. * * To learn more about this see the Solidity documentation for * https://solidity.readthedocs.io/en/latest/contracts.html#fallback-function[fallback * functions]. */ receive() external payable virtual { } /** * @dev Getter for the total shares held by payees. */ function totalShares() public view splitterInitialized returns (uint256) { } /** * @dev Getter for the total amount of Ether already released. */ function totalReleased() public view splitterInitialized returns (uint256) { } /** * @dev Getter for the amount of shares held by an account. */ function shares(address account) public view splitterInitialized returns (uint256) { } /** * @dev Getter for the amount of Ether already released to a payee. */ function released(address account) public view splitterInitialized returns (uint256) { } /** * @dev Getter for the address of the payee number `index`. */ function payee(uint256 index) public view splitterInitialized returns (address) { } /** * @dev Triggers a transfer to `account` of the amount of Ether they are owed, according to their percentage of the * total shares and their previous withdrawals. */ function release(address payable account) public virtual splitterInitialized { } /** * @dev Triggers a transfer to all the payees which are owed Ether, according to their percentage of the * total shares and their previous withdrawals. Note: This function was not on the original OpenZeppelin contract. */ function releaseAll() public virtual splitterInitialized { } /** * @dev Add a new payee to the contract. * @param account The address of the payee to add. * @param shares_ The number of shares owned by the payee. */ function _addPayee(address account, uint256 shares_) private splitterInitialized { } }
!_splitterInitialized,"PaymentSplitterCloneable: already init."
394,389
!_splitterInitialized
null
pragma solidity ^0.8.4; import "@openzeppelin/contracts/access/Ownable.sol"; import '@openzeppelin/contracts/utils/math/SafeMath.sol'; import '@openzeppelin/contracts/interfaces/IERC721.sol'; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./AnonymiceLibrary.sol"; import "./OriginalAnonymiceInterface.sol"; // // ╔═╗┌┐┌┌─┐┌┐┌┬ ┬┌┬┐┬┌─┐┌─┐ ╔═╗┬ ┬┌─┐┌─┐┌─┐┌─┐ ╔═╗┬ ┬ ┬┌┐ // ╠═╣││││ ││││└┬┘│││││ ├┤ ║ ├─┤├┤ ├┤ └─┐├┤ ║ │ │ │├┴┐ // ╩ ╩┘└┘└─┘┘└┘ ┴ ┴ ┴┴└─┘└─┘ ╚═╝┴ ┴└─┘└─┘└─┘└─┘ ╚═╝┴─┘└─┘└─┘ // // Own Burned Anonymice and create an exclusive Cheese Club! // Minting dApp on anonymicecheese.club // // We know other projects tried to do this before and failed. So we fixed all their issues and // we're ready to let you own those mice. // Cheese club will be the heart of those 6,450 burned mice. // contract AnonymiceCheeseClub is ERC721Enumerable, Ownable { using AnonymiceLibrary for uint8; //Mappings uint16[6450] internal tokenToOriginalMiceId; uint256 internal nextOriginalMiceToLoad = 0; OriginalAnonymiceInterface.Trait[] internal burnedTraitType; //uint256s uint256 MAX_SUPPLY = 6450; uint256 FREE_MINTS = 500; uint256 PRICE = .02 ether; //addresses address anonymiceContract = 0xbad6186E92002E312078b5a1dAfd5ddf63d3f731; //string arrays string[] LETTERS = [ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" ]; //events event TokenMinted(uint256 supply); constructor() ERC721("Anonymice Cheese Club", "MICE-CHEESE-CLUB") { } // ███╗ ███╗██╗███╗ ██╗████████╗██╗███╗ ██╗ ██████╗ // ████╗ ████║██║████╗ ██║╚══██╔══╝██║████╗ ██║██╔════╝ // ██╔████╔██║██║██╔██╗ ██║ ██║ ██║██╔██╗ ██║██║ ███╗ // ██║╚██╔╝██║██║██║╚██╗██║ ██║ ██║██║╚██╗██║██║ ██║ // ██║ ╚═╝ ██║██║██║ ╚████║ ██║ ██║██║ ╚████║╚██████╔╝ // ╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ /** * @dev Loads the IDs of burned mices * @param _howMany The number of mices to load. Starts from the last loaded */ function _loadOriginalMices(uint256 _howMany) internal { } /** * @dev Mint internal, this is to avoid code duplication. */ function mintInternal(uint256 num_tokens, address to) internal { uint256 _totalSupply = totalSupply(); require(_totalSupply < MAX_SUPPLY, 'Sale would exceed max supply'); require(<FILL_ME>) if ((num_tokens + _totalSupply) > MAX_SUPPLY) { num_tokens = MAX_SUPPLY - _totalSupply; } _loadOriginalMices(num_tokens); for (uint i=0; i < num_tokens; i++) { _safeMint(to, _totalSupply); emit TokenMinted(_totalSupply); _totalSupply = _totalSupply + 1; } } /** * @dev Mints new tokens. */ function mint(address _to, uint _count) public payable { } /** * @dev Kills the mice again, this time forever. * @param _tokenId The token to burn. */ function killForever(uint256 _tokenId) public { } // ██████╗ ███████╗ █████╗ ██████╗ // ██╔══██╗██╔════╝██╔══██╗██╔══██╗ // ██████╔╝█████╗ ███████║██║ ██║ // ██╔══██╗██╔══╝ ██╔══██║██║ ██║ // ██║ ██║███████╗██║ ██║██████╔╝ // ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ /** * @dev Helper function to reduce pixel size within contract */ function letterToNumber(string memory _inputLetter) internal view returns (uint8) { } /** * @dev Hash to SVG function */ function hashToSVG(string memory _hash) public view returns (string memory) { } /** * @dev Hash to metadata function */ function hashToMetadata(string memory _hash, uint _tokenId) public view returns (string memory) { } /** * @dev Returns the SVG and metadata for a token Id * @param _tokenId The tokenId to return the SVG and metadata for. */ function tokenURI(uint256 _tokenId) public view override returns (string memory) { } /** * @dev Returns a hash for a given tokenId * @param _tokenId The tokenId to return the hash for. */ function _tokenIdToHash(uint256 _tokenId) public view returns (string memory) { } /** * @dev Returns the wallet of a given wallet. Mainly for ease for frontend devs. * @param _wallet The wallet to get the tokens of. */ function walletOfOwner(address _wallet) public view returns (uint256[] memory) { } // ██████╗ ██╗ ██╗███╗ ██╗███████╗██████╗ // ██╔═══██╗██║ ██║████╗ ██║██╔════╝██╔══██╗ // ██║ ██║██║ █╗ ██║██╔██╗ ██║█████╗ ██████╔╝ // ██║ ██║██║███╗██║██║╚██╗██║██╔══╝ ██╔══██╗ // ╚██████╔╝╚███╔███╔╝██║ ╚████║███████╗██║ ██║ // ╚═════╝ ╚══╝╚══╝ ╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ /** * @dev Clears the traits. */ function clearBurnedTraits() public onlyOwner { } /** * @dev Add trait types of burned * @param traits Array of traits to add */ function addBurnedTraitType(OriginalAnonymiceInterface.Trait[] memory traits) public onlyOwner { } /** * @dev Collects the total amount in the contract */ function withdraw() public onlyOwner { } }
!AnonymiceLibrary.isContract(msg.sender)
394,402
!AnonymiceLibrary.isContract(msg.sender)
'Not enough ether sent (send 0.03 eth for each mice you want to mint)'
pragma solidity ^0.8.4; import "@openzeppelin/contracts/access/Ownable.sol"; import '@openzeppelin/contracts/utils/math/SafeMath.sol'; import '@openzeppelin/contracts/interfaces/IERC721.sol'; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "./AnonymiceLibrary.sol"; import "./OriginalAnonymiceInterface.sol"; // // ╔═╗┌┐┌┌─┐┌┐┌┬ ┬┌┬┐┬┌─┐┌─┐ ╔═╗┬ ┬┌─┐┌─┐┌─┐┌─┐ ╔═╗┬ ┬ ┬┌┐ // ╠═╣││││ ││││└┬┘│││││ ├┤ ║ ├─┤├┤ ├┤ └─┐├┤ ║ │ │ │├┴┐ // ╩ ╩┘└┘└─┘┘└┘ ┴ ┴ ┴┴└─┘└─┘ ╚═╝┴ ┴└─┘└─┘└─┘└─┘ ╚═╝┴─┘└─┘└─┘ // // Own Burned Anonymice and create an exclusive Cheese Club! // Minting dApp on anonymicecheese.club // // We know other projects tried to do this before and failed. So we fixed all their issues and // we're ready to let you own those mice. // Cheese club will be the heart of those 6,450 burned mice. // contract AnonymiceCheeseClub is ERC721Enumerable, Ownable { using AnonymiceLibrary for uint8; //Mappings uint16[6450] internal tokenToOriginalMiceId; uint256 internal nextOriginalMiceToLoad = 0; OriginalAnonymiceInterface.Trait[] internal burnedTraitType; //uint256s uint256 MAX_SUPPLY = 6450; uint256 FREE_MINTS = 500; uint256 PRICE = .02 ether; //addresses address anonymiceContract = 0xbad6186E92002E312078b5a1dAfd5ddf63d3f731; //string arrays string[] LETTERS = [ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" ]; //events event TokenMinted(uint256 supply); constructor() ERC721("Anonymice Cheese Club", "MICE-CHEESE-CLUB") { } // ███╗ ███╗██╗███╗ ██╗████████╗██╗███╗ ██╗ ██████╗ // ████╗ ████║██║████╗ ██║╚══██╔══╝██║████╗ ██║██╔════╝ // ██╔████╔██║██║██╔██╗ ██║ ██║ ██║██╔██╗ ██║██║ ███╗ // ██║╚██╔╝██║██║██║╚██╗██║ ██║ ██║██║╚██╗██║██║ ██║ // ██║ ╚═╝ ██║██║██║ ╚████║ ██║ ██║██║ ╚████║╚██████╔╝ // ╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ /** * @dev Loads the IDs of burned mices * @param _howMany The number of mices to load. Starts from the last loaded */ function _loadOriginalMices(uint256 _howMany) internal { } /** * @dev Mint internal, this is to avoid code duplication. */ function mintInternal(uint256 num_tokens, address to) internal { } /** * @dev Mints new tokens. */ function mint(address _to, uint _count) public payable { uint _totalSupply = totalSupply(); if (_totalSupply > FREE_MINTS) { require(<FILL_ME>) } return mintInternal(_count, _to); } /** * @dev Kills the mice again, this time forever. * @param _tokenId The token to burn. */ function killForever(uint256 _tokenId) public { } // ██████╗ ███████╗ █████╗ ██████╗ // ██╔══██╗██╔════╝██╔══██╗██╔══██╗ // ██████╔╝█████╗ ███████║██║ ██║ // ██╔══██╗██╔══╝ ██╔══██║██║ ██║ // ██║ ██║███████╗██║ ██║██████╔╝ // ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═════╝ /** * @dev Helper function to reduce pixel size within contract */ function letterToNumber(string memory _inputLetter) internal view returns (uint8) { } /** * @dev Hash to SVG function */ function hashToSVG(string memory _hash) public view returns (string memory) { } /** * @dev Hash to metadata function */ function hashToMetadata(string memory _hash, uint _tokenId) public view returns (string memory) { } /** * @dev Returns the SVG and metadata for a token Id * @param _tokenId The tokenId to return the SVG and metadata for. */ function tokenURI(uint256 _tokenId) public view override returns (string memory) { } /** * @dev Returns a hash for a given tokenId * @param _tokenId The tokenId to return the hash for. */ function _tokenIdToHash(uint256 _tokenId) public view returns (string memory) { } /** * @dev Returns the wallet of a given wallet. Mainly for ease for frontend devs. * @param _wallet The wallet to get the tokens of. */ function walletOfOwner(address _wallet) public view returns (uint256[] memory) { } // ██████╗ ██╗ ██╗███╗ ██╗███████╗██████╗ // ██╔═══██╗██║ ██║████╗ ██║██╔════╝██╔══██╗ // ██║ ██║██║ █╗ ██║██╔██╗ ██║█████╗ ██████╔╝ // ██║ ██║██║███╗██║██║╚██╗██║██╔══╝ ██╔══██╗ // ╚██████╔╝╚███╔███╔╝██║ ╚████║███████╗██║ ██║ // ╚═════╝ ╚══╝╚══╝ ╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝ /** * @dev Clears the traits. */ function clearBurnedTraits() public onlyOwner { } /** * @dev Add trait types of burned * @param traits Array of traits to add */ function addBurnedTraitType(OriginalAnonymiceInterface.Trait[] memory traits) public onlyOwner { } /** * @dev Collects the total amount in the contract */ function withdraw() public onlyOwner { } }
PRICE*_count<=msg.value,'Not enough ether sent (send 0.03 eth for each mice you want to mint)'
394,402
PRICE*_count<=msg.value
"token is defined as not salvagable"
pragma solidity 0.5.16; import "@openzeppelin/contracts/math/Math.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20Detailed.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "../../../base/interface/uniswap/IUniswapV2Router02.sol"; import "../../../base/interface/IStrategy.sol"; import "../../../base/interface/IVault.sol"; import "../../../base/upgradability/BaseUpgradeableStrategyUL.sol"; import "../../../base/interface/uniswap/IUniswapV2Pair.sol"; import "../interface/IBooster.sol"; import "../interface/IBaseRewardPool.sol"; import "../../../base/interface/curve/ICurveDeposit_2token.sol"; import "../../../base/interface/curve/ICurveDeposit_3token.sol"; import "../../../base/interface/curve/ICurveDeposit_4token.sol"; import "../../../base/interface/curve/ICurveDeposit_4token_meta.sol"; contract ConvexStrategyUL is IStrategy, BaseUpgradeableStrategyUL { using SafeMath for uint256; using SafeERC20 for IERC20; address public constant booster = address(0xF403C135812408BFbE8713b5A23a04b3D48AAE31); address public constant weth = address(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); address public constant multiSigAddr = 0xF49440C1F012d041802b25A73e5B0B9166a75c02; // additional storage slots (on top of BaseUpgradeableStrategy ones) are defined here bytes32 internal constant _POOLID_SLOT = 0x3fd729bfa2e28b7806b03a6e014729f59477b530f995be4d51defc9dad94810b; bytes32 internal constant _DEPOSIT_TOKEN_SLOT = 0x219270253dbc530471c88a9e7c321b36afda219583431e7b6c386d2d46e70c86; bytes32 internal constant _DEPOSIT_RECEIPT_SLOT = 0x414478d5ad7f54ead8a3dd018bba4f8d686ba5ab5975cd376e0c98f98fb713c5; bytes32 internal constant _DEPOSIT_ARRAY_POSITION_SLOT = 0xb7c50ef998211fff3420379d0bf5b8dfb0cee909d1b7d9e517f311c104675b09; bytes32 internal constant _CURVE_DEPOSIT_SLOT = 0xb306bb7adebd5a22f5e4cdf1efa00bc5f62d4f5554ef9d62c1b16327cd3ab5f9; bytes32 internal constant _HODL_RATIO_SLOT = 0xb487e573671f10704ed229d25cf38dda6d287a35872859d096c0395110a0adb1; bytes32 internal constant _HODL_VAULT_SLOT = 0xc26d330f887c749cb38ae7c37873ff08ac4bba7aec9113c82d48a0cf6cc145f2; bytes32 internal constant _NTOKENS_SLOT = 0xbb60b35bae256d3c1378ff05e8d7bee588cd800739c720a107471dfa218f74c1; bytes32 internal constant _METAPOOL_SLOT = 0x567ad8b67c826974a167f1a361acbef5639a3e7e02e99edbc648a84b0923d5b7; uint256 public constant hodlRatioBase = 10000; address[] public rewardTokens; constructor() public BaseUpgradeableStrategyUL() { } function initializeBaseStrategy( address _storage, address _underlying, address _vault, address _rewardPool, uint256 _poolID, address _depositToken, uint256 _depositArrayPosition, address _curveDeposit, uint256 _nTokens, bool _metaPool, uint256 _hodlRatio ) public initializer { } function setHodlRatio(uint256 _value) public onlyGovernance { } function hodlRatio() public view returns (uint256) { } function setHodlVault(address _address) public onlyGovernance { } function hodlVault() public view returns (address) { } function depositArbCheck() public view returns(bool) { } function rewardPoolBalance() internal view returns (uint256 bal) { } function exitRewardPool() internal { } function partialWithdrawalRewardPool(uint256 amount) internal { } function emergencyExitRewardPool() internal { } function unsalvagableTokens(address token) public view returns (bool) { } function enterRewardPool() internal { } /* * In case there are some issues discovered about the pool or underlying asset * Governance can exit the pool properly * The function is only used for emergency to exit the pool */ function emergencyExit() public onlyGovernance { } /* * Resumes the ability to invest into the underlying reward pools */ function continueInvesting() public onlyGovernance { } function addRewardToken(address _token) public onlyGovernance { } // We assume that all the tradings can be done on Sushiswap function _liquidateReward() internal { } function depositCurve() internal { } /* * Stakes everything the strategy holds into the reward pool */ function investAllUnderlying() internal onlyNotPausedInvesting { } /* * Withdraws all the asset to the vault */ function withdrawAllToVault() public restricted { } /* * Withdraws all the asset to the vault */ function withdrawToVault(uint256 amount) public restricted { } /* * Note that we currently do not have a mechanism here to include the * amount of reward that is accrued. */ function investedUnderlyingBalance() external view returns (uint256) { } /* * Governance or Controller can claim coins that are somehow transferred into the contract * Note that they cannot come in take away coins that are used and defined in the strategy itself */ function salvage(address recipient, address token, uint256 amount) external onlyControllerOrGovernance { // To make sure that governance cannot come in and take away the coins require(<FILL_ME>) IERC20(token).safeTransfer(recipient, amount); } /* * Get the reward, sell it in exchange for underlying, invest what you got. * It's not much, but it's honest work. * * Note that although `onlyNotPausedInvesting` is not added here, * calling `investAllUnderlying()` affectively blocks the usage of `doHardWork` * when the investing is being paused by governance. */ function doHardWork() external onlyNotPausedInvesting restricted { } /** * Can completely disable claiming UNI rewards and selling. Good for emergency withdraw in the * simplest possible way. */ function setSell(bool s) public onlyGovernance { } /** * Sets the minimum amount of CRV needed to trigger a sale. */ function setSellFloor(uint256 floor) public onlyGovernance { } // masterchef rewards pool ID function _setPoolId(uint256 _value) internal { } function poolId() public view returns (uint256) { } function _setDepositToken(address _address) internal { } function depositToken() public view returns (address) { } function _setDepositReceipt(address _address) internal { } function depositReceipt() public view returns (address) { } function _setDepositArrayPosition(uint256 _value) internal { } function depositArrayPosition() public view returns (uint256) { } function _setCurveDeposit(address _address) internal { } function curveDeposit() public view returns (address) { } function _setNTokens(uint256 _value) internal { } function nTokens() public view returns (uint256) { } function _setMetaPool(bool _value) internal { } function metaPool() public view returns (bool) { } function finalizeUpgrade() external onlyGovernance { } }
!unsalvagableTokens(token),"token is defined as not salvagable"
394,493
!unsalvagableTokens(token)
"already connected"
pragma solidity ^0.5.14; contract PonzyGame{ mapping(address => Node) public nodes; uint[] prices = [1 ether, 2 ether, 7 ether, 29 ether]; address payable public owner; event LevelUp(address indexed user, address indexed seller, uint8 level); event Joined(address indexed user, address indexed parent); event SaleSkiped(address indexed seller, address user); struct Node { uint8 level; address payable parent; address payable descendant1; address payable descendant2; address payable descendant3; } constructor(address payable descendant1, address payable descendant2, address payable descendant3) public { } function joinTo(address payable _parent) payable public{ require(msg.value == prices[0],"wrong ether amount"); require(<FILL_ME>) address payable parent = findAvailableNode(_parent); Node storage node = nodes[parent]; if(node.descendant1 == address(0)){ node.descendant1 = msg.sender; } else if(node.descendant2 == address(0)) { node.descendant2 = msg.sender; } else if(node.descendant3 == address(0)) { node.descendant3 = msg.sender; } else revert("there are no empty descendant"); parent.transfer(1e18); nodes[msg.sender] = Node(1, parent, address(0),address(0),address(0)); emit Joined(msg.sender, parent); } function findAvailableNode(address payable _parent) public view returns (address payable){ } function levelUp() payable public { } }
nodes[msg.sender].level==0,"already connected"
394,623
nodes[msg.sender].level==0
"last level"
pragma solidity ^0.5.14; contract PonzyGame{ mapping(address => Node) public nodes; uint[] prices = [1 ether, 2 ether, 7 ether, 29 ether]; address payable public owner; event LevelUp(address indexed user, address indexed seller, uint8 level); event Joined(address indexed user, address indexed parent); event SaleSkiped(address indexed seller, address user); struct Node { uint8 level; address payable parent; address payable descendant1; address payable descendant2; address payable descendant3; } constructor(address payable descendant1, address payable descendant2, address payable descendant3) public { } function joinTo(address payable _parent) payable public{ } function findAvailableNode(address payable _parent) public view returns (address payable){ } function levelUp() payable public { Node storage it = nodes[msg.sender]; require(it.level > 0, "you are not in PonzyGame"); require(<FILL_ME>) require(msg.value == prices[it.level], "wrong ether amount"); address payable parent = it.parent; for(uint i = 0; i < it.level; i++) parent = nodes[parent].parent; while(nodes[parent].level < it.level + 1){ emit SaleSkiped(parent, msg.sender); parent = nodes[parent].parent; } parent.transfer(prices[it.level]); it.level++; emit LevelUp(msg.sender,parent,it.level); } }
prices[it.level]>0,"last level"
394,623
prices[it.level]>0
"Only controllers can mint"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.10; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; struct HunterHoundTraits { bool isHunter; uint alpha; uint metadataId; } uint constant MIN_ALPHA = 5; uint constant MAX_ALPHA = 8; contract HunterHound is ERC721Enumerable, Ownable { using Strings for uint256; // 111 a mapping from an address to whether or not it can mint / burn mapping(address => bool) public controllers; // save token traits mapping(uint256 => HunterHoundTraits) private tokenTraits; //the base url for metadata string baseUrl = "ipfs://QmVkCrCmvZEk3kuZDiSJXw25Urf3f93damrbRJLbDY5yT2/"; constructor() ERC721("HunterHound","HH") { } /** * set base URL for metadata */ function setBaseUrl(string calldata baseUrl_) external onlyOwner { } /** * get token traits */ function getTokenTraits(uint256 tokenId) external view returns (HunterHoundTraits memory) { } /** * get multiple token traits */ function getTraitsByTokenIds(uint256[] calldata tokenIds) external view returns (HunterHoundTraits[] memory traits) { } /** * Returns the Uniform Resource Identifier (URI) for `tokenId` token. */ function tokenURI(uint256 tokenId) public view override returns (string memory) { } /** * return holder's entire tokens */ function tokensByOwner(address owner) external view returns (uint256[] memory tokenIds, HunterHoundTraits[] memory traits) { } /** * return token traits */ function isHunterAndAlphaByTokenId(uint256 tokenId) external view returns (bool, uint) { } /** * controller to mint a token */ function mintByController(address account, uint256 tokenId, HunterHoundTraits calldata traits) external { require(<FILL_ME>) tokenTraits[tokenId] = traits; _safeMint(account, tokenId); } /** * controller to transfer a token */ function transferByController(address from, address to, uint256 tokenId) external { } /** * enables an address to mint / burn * @param controller the address to enable */ function addController(address controller) external onlyOwner { } /** * disables an address from minting / burning * @param controller the address to disbale */ function removeController(address controller) external onlyOwner { } }
controllers[_msgSender()],"Only controllers can mint"
394,697
controllers[_msgSender()]
"Not allowed first 200"
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract KwyptoKado is ERC721Enumerable, Pausable, Ownable { using SafeMath for uint256; uint256 private _currentTokenId = 200; uint256 public maxSupply = 9999; uint256 public maxMintAmount = 10; uint256 public maxPerWallet = 99; uint256 public cost = 0.077 ether; uint8 public boostValue = 1; string public boostedStat = "Power"; string baseURI; constructor() ERC721("KwyptoKados", "KwyptoKado") { } function _baseTokenURI() internal view returns (string memory) { } function tokenURI(uint256 _tokenId) override public view returns (string memory) { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function createKado(uint8 _amount) public payable whenNotPaused { require(<FILL_ME>) require(_amount <= maxMintAmount, "Don't be greedy! Only 10 at a time."); require(msg.value >= cost * _amount, "Need to send monies!"); require(balanceOf(msg.sender).add(_amount) <= maxPerWallet, "Only 99 per wallet!"); require(_currentTokenId.add(_amount) <= maxSupply, "Not enough left, sorry!"); for (uint i = 1; i <= _amount; i++){ uint256 newTokenId = _getNextTokenId(); _safeMint(msg.sender, newTokenId); _incrementTokenId(); } } function ownerKados(uint8 _start, uint8 _amount, address _to) public onlyOwner { } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function withdraw() public payable onlyOwner { } function _getNextTokenId() private view returns (uint256) { } function _incrementTokenId() private { } function pause() public onlyOwner { } function unpause() public onlyOwner { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal whenNotPaused override { } }
_currentTokenId.add(_amount)>200,"Not allowed first 200"
394,850
_currentTokenId.add(_amount)>200
"Only 99 per wallet!"
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract KwyptoKado is ERC721Enumerable, Pausable, Ownable { using SafeMath for uint256; uint256 private _currentTokenId = 200; uint256 public maxSupply = 9999; uint256 public maxMintAmount = 10; uint256 public maxPerWallet = 99; uint256 public cost = 0.077 ether; uint8 public boostValue = 1; string public boostedStat = "Power"; string baseURI; constructor() ERC721("KwyptoKados", "KwyptoKado") { } function _baseTokenURI() internal view returns (string memory) { } function tokenURI(uint256 _tokenId) override public view returns (string memory) { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function createKado(uint8 _amount) public payable whenNotPaused { require(_currentTokenId.add(_amount) > 200, "Not allowed first 200"); require(_amount <= maxMintAmount, "Don't be greedy! Only 10 at a time."); require(msg.value >= cost * _amount, "Need to send monies!"); require(<FILL_ME>) require(_currentTokenId.add(_amount) <= maxSupply, "Not enough left, sorry!"); for (uint i = 1; i <= _amount; i++){ uint256 newTokenId = _getNextTokenId(); _safeMint(msg.sender, newTokenId); _incrementTokenId(); } } function ownerKados(uint8 _start, uint8 _amount, address _to) public onlyOwner { } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function withdraw() public payable onlyOwner { } function _getNextTokenId() private view returns (uint256) { } function _incrementTokenId() private { } function pause() public onlyOwner { } function unpause() public onlyOwner { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal whenNotPaused override { } }
balanceOf(msg.sender).add(_amount)<=maxPerWallet,"Only 99 per wallet!"
394,850
balanceOf(msg.sender).add(_amount)<=maxPerWallet
"Not enough left, sorry!"
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract KwyptoKado is ERC721Enumerable, Pausable, Ownable { using SafeMath for uint256; uint256 private _currentTokenId = 200; uint256 public maxSupply = 9999; uint256 public maxMintAmount = 10; uint256 public maxPerWallet = 99; uint256 public cost = 0.077 ether; uint8 public boostValue = 1; string public boostedStat = "Power"; string baseURI; constructor() ERC721("KwyptoKados", "KwyptoKado") { } function _baseTokenURI() internal view returns (string memory) { } function tokenURI(uint256 _tokenId) override public view returns (string memory) { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function createKado(uint8 _amount) public payable whenNotPaused { require(_currentTokenId.add(_amount) > 200, "Not allowed first 200"); require(_amount <= maxMintAmount, "Don't be greedy! Only 10 at a time."); require(msg.value >= cost * _amount, "Need to send monies!"); require(balanceOf(msg.sender).add(_amount) <= maxPerWallet, "Only 99 per wallet!"); require(<FILL_ME>) for (uint i = 1; i <= _amount; i++){ uint256 newTokenId = _getNextTokenId(); _safeMint(msg.sender, newTokenId); _incrementTokenId(); } } function ownerKados(uint8 _start, uint8 _amount, address _to) public onlyOwner { } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function withdraw() public payable onlyOwner { } function _getNextTokenId() private view returns (uint256) { } function _incrementTokenId() private { } function pause() public onlyOwner { } function unpause() public onlyOwner { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal whenNotPaused override { } }
_currentTokenId.add(_amount)<=maxSupply,"Not enough left, sorry!"
394,850
_currentTokenId.add(_amount)<=maxSupply
"Only allowed first 200"
// SPDX-License-Identifier: MIT pragma solidity >=0.4.22 <0.9.0; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract KwyptoKado is ERC721Enumerable, Pausable, Ownable { using SafeMath for uint256; uint256 private _currentTokenId = 200; uint256 public maxSupply = 9999; uint256 public maxMintAmount = 10; uint256 public maxPerWallet = 99; uint256 public cost = 0.077 ether; uint8 public boostValue = 1; string public boostedStat = "Power"; string baseURI; constructor() ERC721("KwyptoKados", "KwyptoKado") { } function _baseTokenURI() internal view returns (string memory) { } function tokenURI(uint256 _tokenId) override public view returns (string memory) { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function createKado(uint8 _amount) public payable whenNotPaused { } function ownerKados(uint8 _start, uint8 _amount, address _to) public onlyOwner { require(<FILL_ME>) for (uint i = _start; i < _start+_amount; i++){ _safeMint(_to, i); } } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function withdraw() public payable onlyOwner { } function _getNextTokenId() private view returns (uint256) { } function _incrementTokenId() private { } function pause() public onlyOwner { } function unpause() public onlyOwner { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal whenNotPaused override { } }
_start+_amount<=200,"Only allowed first 200"
394,850
_start+_amount<=200
"Invalid address"
pragma solidity ^0.5.11; contract Multiswap { using SafeMath for uint256; event MultiSwapExecuted( IERC20[] _fromTokens, IERC20 indexed _toToken, uint256[] _fromTokensAmount, uint256 _minReturn, uint256 _bought, address _beneficiary ); address public constant ETH_ADDRESS = address(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); uint256 private constant never = uint(-1); UniswapFactory public uniswapFactory; constructor(UniswapFactory _uniswapFactory) public { } function() external payable { } function swap( IERC20[] calldata _fromTokens, IERC20 _toToken, uint256[] calldata _fromTokensAmount, uint256 _minReturn, address _beneficiary ) external payable { uint256 bought = 0; uint256 ethBough = 0; for(uint256 i = 0; i < _fromTokens.length; i++) { IERC20 fromToken = _fromTokens[i]; uint256 amount = _fromTokensAmount[i]; require(<FILL_ME>) require(amount > 0, "Amount should be greater than 0"); if (address(_toToken) != ETH_ADDRESS) { if (address(fromToken) == ETH_ADDRESS) { require(msg.value == amount, "invalid amount ETH"); ethBough = ethBough.add(amount); } else { // transfer in the tokens fromToken.transferFrom(msg.sender, address(this), amount); // swap tokens to ETH ethBough = ethBough.add(_tokenToEth(uniswapFactory, fromToken, amount, address(this))); } } else { // transfer in the tokens fromToken.transferFrom(msg.sender, address(this), amount); // swap tokens to ETH bought = bought.add(_tokenToEth(uniswapFactory, fromToken, amount, _beneficiary)); } } if (ethBough > 0) { bought = _ethToToken(uniswapFactory, _toToken, ethBough, _beneficiary); } require(bought >= _minReturn, "Tokens bought are not enough"); emit MultiSwapExecuted( _fromTokens, _toToken, _fromTokensAmount, _minReturn, bought, _beneficiary ); } function canSwap( IERC20[] calldata _fromTokens, IERC20 _toToken, uint256[] calldata _fromTokensAmount, uint256 _minReturn ) external view returns (bool) { } function _ethToToken ( UniswapFactory _uniswapFactory, IERC20 _token, uint256 _amount, address _dest ) private returns (uint256) { } function _tokenToEth( UniswapFactory _uniswapFactory, IERC20 _token, uint256 _amount, address _dest ) private returns (uint256) { } function approveTokenIfNeeded( UniswapExchange _uniswap, IERC20 _token, uint256 _amount ) private { } }
address(fromToken)!=address(0),"Invalid address"
394,940
address(fromToken)!=address(0)
"The exchange should exist"
pragma solidity ^0.5.11; contract Multiswap { using SafeMath for uint256; event MultiSwapExecuted( IERC20[] _fromTokens, IERC20 indexed _toToken, uint256[] _fromTokensAmount, uint256 _minReturn, uint256 _bought, address _beneficiary ); address public constant ETH_ADDRESS = address(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); uint256 private constant never = uint(-1); UniswapFactory public uniswapFactory; constructor(UniswapFactory _uniswapFactory) public { } function() external payable { } function swap( IERC20[] calldata _fromTokens, IERC20 _toToken, uint256[] calldata _fromTokensAmount, uint256 _minReturn, address _beneficiary ) external payable { } function canSwap( IERC20[] calldata _fromTokens, IERC20 _toToken, uint256[] calldata _fromTokensAmount, uint256 _minReturn ) external view returns (bool) { } function _ethToToken ( UniswapFactory _uniswapFactory, IERC20 _token, uint256 _amount, address _dest ) private returns (uint256) { UniswapExchange uniswap = _uniswapFactory.getExchange(address(_token)); require(<FILL_ME>) return uniswap.ethToTokenTransferInput.value(_amount)(1, never, _dest); } function _tokenToEth( UniswapFactory _uniswapFactory, IERC20 _token, uint256 _amount, address _dest ) private returns (uint256) { } function approveTokenIfNeeded( UniswapExchange _uniswap, IERC20 _token, uint256 _amount ) private { } }
address(uniswap)!=address(0),"The exchange should exist"
394,940
address(uniswap)!=address(0)
null
pragma solidity ^0.5.0; interface ERC20 { function totalSupply() external view returns (uint supply); function balanceOf(address _owner) external view returns (uint balance); function transfer(address _to, uint _value) external returns (bool success); function transferFrom(address _from, address _to, uint _value) external returns (bool success); function approve(address _spender, uint _value) external returns (bool success); function allowance(address _owner, address _spender) external view returns (uint remaining); function decimals() external view returns(uint digits); event Approval(address indexed _owner, address indexed _spender, uint _value); } interface ExchangeInterface { function swapEtherToToken (uint _ethAmount, address _tokenAddress, uint _maxAmount) payable external returns(uint, uint); function swapTokenToEther (address _tokenAddress, uint _amount, uint _maxAmount) external returns(uint); function swapTokenToToken(address _src, address _dest, uint _amount) external payable returns(uint); function getExpectedRate(address src, address dest, uint srcQty) external view returns (uint expectedRate, uint slippageRate); } contract DSMath { function add(uint x, uint y) internal pure returns (uint z) { } function sub(uint x, uint y) internal pure returns (uint z) { } function mul(uint x, uint y) internal pure returns (uint z) { } function min(uint x, uint y) internal pure returns (uint z) { } function max(uint x, uint y) internal pure returns (uint z) { } function imin(int x, int y) internal pure returns (int z) { } function imax(int x, int y) internal pure returns (int z) { } uint constant WAD = 10 ** 18; uint constant RAY = 10 ** 27; function wmul(uint x, uint y) internal pure returns (uint z) { } function rmul(uint x, uint y) internal pure returns (uint z) { } function wdiv(uint x, uint y) internal pure returns (uint z) { } function rdiv(uint x, uint y) internal pure returns (uint z) { } function rpow(uint x, uint n) internal pure returns (uint z) { } } contract ConstantAddressesMainnet { address public constant MAKER_DAI_ADDRESS = 0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359; address public constant IDAI_ADDRESS = 0x14094949152EDDBFcd073717200DA82fEd8dC960; address public constant SOLO_MARGIN_ADDRESS = 0x1E0447b19BB6EcFdAe1e4AE1694b0C3659614e4e; address public constant CDAI_ADDRESS = 0xF5DCe57282A584D2746FaF1593d3121Fcac444dC; address public constant KYBER_ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address public constant MKR_ADDRESS = 0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2; address public constant WETH_ADDRESS = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; address public constant VOX_ADDRESS = 0x9B0F70Df76165442ca6092939132bBAEA77f2d7A; address public constant PETH_ADDRESS = 0xf53AD2c6851052A81B42133467480961B2321C09; address public constant TUB_ADDRESS = 0x448a5065aeBB8E423F0896E6c5D525C040f59af3; address payable public constant WALLET_ID = 0x322d58b9E75a6918f7e7849AEe0fF09369977e08; address public constant LOGGER_ADDRESS = 0xeCf88e1ceC2D2894A0295DB3D86Fe7CE4991E6dF; address public constant OTC_ADDRESS = 0x39755357759cE0d7f32dC8dC45414CCa409AE24e; address public constant DISCOUNT_ADDRESS = 0x1b14E8D511c9A4395425314f849bD737BAF8208F; address public constant KYBER_WRAPPER = 0x8F337bD3b7F2b05d9A8dC8Ac518584e833424893; address public constant UNISWAP_WRAPPER = 0x1e30124FDE14533231216D95F7798cD0061e5cf8; address public constant ETH2DAI_WRAPPER = 0xd7BBB1777E13b6F535Dec414f575b858ed300baF; address public constant OASIS_WRAPPER = 0xCbE344DBBcCEbF04c0D045102A4bfA76c49b33c9; address public constant KYBER_INTERFACE = 0x818E6FECD516Ecc3849DAf6845e3EC868087B755; address public constant UNISWAP_FACTORY = 0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95; address public constant FACTORY_ADDRESS = 0x5a15566417e6C1c9546523066500bDDBc53F88C7; address public constant PIP_INTERFACE_ADDRESS = 0x729D19f657BD0614b4985Cf1D82531c67569197B; address public constant PROXY_REGISTRY_INTERFACE_ADDRESS = 0x4678f0a6958e4D2Bc4F1BAF7Bc52E8F3564f3fE4; address public constant GAS_TOKEN_INTERFACE_ADDRESS = 0x0000000000b3F879cb30FE243b4Dfee438691c04; address public constant SAVINGS_LOGGER_ADDRESS = 0x89b3635BD2bAD145C6f92E82C9e83f06D5654984; address public constant COMPOUND_DAI_ADDRESS = 0x25a01a05C188DaCBCf1D61Af55D4a5B4021F7eeD; address public constant STUPID_EXCHANGE = 0x863E41FE88288ebf3fcd91d8Dbb679fb83fdfE17; } contract ConstantAddressesKovan { address public constant KYBER_ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address public constant WETH_ADDRESS = 0xd0A1E359811322d97991E03f863a0C30C2cF029C; address public constant MAKER_DAI_ADDRESS = 0xC4375B7De8af5a38a93548eb8453a498222C4fF2; address public constant MKR_ADDRESS = 0xAaF64BFCC32d0F15873a02163e7E500671a4ffcD; address public constant VOX_ADDRESS = 0xBb4339c0aB5B1d9f14Bd6e3426444A1e9d86A1d9; address public constant PETH_ADDRESS = 0xf4d791139cE033Ad35DB2B2201435fAd668B1b64; address public constant TUB_ADDRESS = 0xa71937147b55Deb8a530C7229C442Fd3F31b7db2; address public constant LOGGER_ADDRESS = 0x32d0e18f988F952Eb3524aCE762042381a2c39E5; address payable public constant WALLET_ID = 0x54b44C6B18fc0b4A1010B21d524c338D1f8065F6; address public constant OTC_ADDRESS = 0x4A6bC4e803c62081ffEbCc8d227B5a87a58f1F8F; address public constant COMPOUND_DAI_ADDRESS = 0x25a01a05C188DaCBCf1D61Af55D4a5B4021F7eeD; address public constant SOLO_MARGIN_ADDRESS = 0x4EC3570cADaAEE08Ae384779B0f3A45EF85289DE; address public constant IDAI_ADDRESS = 0xA1e58F3B1927743393b25f261471E1f2D3D9f0F6; address public constant CDAI_ADDRESS = 0xb6b09fBffBa6A5C4631e5F7B2e3Ee183aC259c0d; address public constant STUPID_EXCHANGE = 0x863E41FE88288ebf3fcd91d8Dbb679fb83fdfE17; address public constant DISCOUNT_ADDRESS = 0x1297c1105FEDf45E0CF6C102934f32C4EB780929; address public constant KYBER_WRAPPER = 0xABa933D6fD54BE2905d04f44eC8223B5DB4A6250; address public constant UNISWAP_WRAPPER = 0x5595930d576Aedf13945C83cE5aaD827529A1310; address public constant ETH2DAI_WRAPPER = 0x823cde416973a19f98Bb9C96d97F4FE6C9A7238B; address public constant OASIS_WRAPPER = 0xB9D22CC741a204a843525e7D028b6e513346f618; address public constant FACTORY_ADDRESS = 0xc72E74E474682680a414b506699bBcA44ab9a930; address public constant PIP_INTERFACE_ADDRESS = 0xA944bd4b25C9F186A846fd5668941AA3d3B8425F; address public constant PROXY_REGISTRY_INTERFACE_ADDRESS = 0x64A436ae831C1672AE81F674CAb8B6775df3475C; address public constant GAS_TOKEN_INTERFACE_ADDRESS = 0x0000000000170CcC93903185bE5A2094C870Df62; address public constant KYBER_INTERFACE = 0x692f391bCc85cefCe8C237C01e1f636BbD70EA4D; address public constant SAVINGS_LOGGER_ADDRESS = 0xA6E5d5F489b1c00d9C11E1caF45BAb6e6e26443d; address public constant UNISWAP_FACTORY = 0xf5D915570BC477f9B8D6C0E980aA81757A3AaC36; } contract ConstantAddresses is ConstantAddressesMainnet { } contract SaverExchange is DSMath, ConstantAddresses { uint public constant SERVICE_FEE = 800; function swapTokenToToken(address _src, address _dest, uint _amount, uint _minPrice, uint _exchangeType) public payable { if (_src == KYBER_ETH_ADDRESS) { require(msg.value >= _amount); msg.sender.transfer(sub(msg.value, _amount)); } else { require(<FILL_ME>) } uint fee = takeFee(_amount, _src); _amount = sub(_amount, fee); address wrapper; uint price; (wrapper, price) = getBestPrice(_amount, _src, _dest, _exchangeType); require(price > _minPrice, "Slippage hit"); uint tokensReturned; if (_src == KYBER_ETH_ADDRESS) { (tokensReturned,) = ExchangeInterface(wrapper).swapEtherToToken.value(_amount)(_amount, _dest, uint(-1)); } else { ERC20(_src).transfer(wrapper, _amount); if (_dest == KYBER_ETH_ADDRESS) { tokensReturned = ExchangeInterface(wrapper).swapTokenToEther(_src, _amount, uint(-1)); } else { tokensReturned = ExchangeInterface(wrapper).swapTokenToToken(_src, _dest, _amount); } } if (_dest == KYBER_ETH_ADDRESS) { msg.sender.transfer(tokensReturned); } else { ERC20(_dest).transfer(msg.sender, tokensReturned); } } function swapDaiToEth(uint _amount, uint _minPrice, uint _exchangeType) public { } function swapEthToDai(uint _amount, uint _minPrice, uint _exchangeType) public payable { } function getBestPrice(uint _amount, address _srcToken, address _destToken, uint _exchangeType) public view returns (address, uint) { } function takeFee(uint _amount, address _token) internal returns (uint feeAmount) { } function() external payable {} }
ERC20(_src).transferFrom(msg.sender,address(this),_amount)
394,946
ERC20(_src).transferFrom(msg.sender,address(this),_amount)
null
pragma solidity ^0.5.0; interface ERC20 { function totalSupply() external view returns (uint supply); function balanceOf(address _owner) external view returns (uint balance); function transfer(address _to, uint _value) external returns (bool success); function transferFrom(address _from, address _to, uint _value) external returns (bool success); function approve(address _spender, uint _value) external returns (bool success); function allowance(address _owner, address _spender) external view returns (uint remaining); function decimals() external view returns(uint digits); event Approval(address indexed _owner, address indexed _spender, uint _value); } interface ExchangeInterface { function swapEtherToToken (uint _ethAmount, address _tokenAddress, uint _maxAmount) payable external returns(uint, uint); function swapTokenToEther (address _tokenAddress, uint _amount, uint _maxAmount) external returns(uint); function swapTokenToToken(address _src, address _dest, uint _amount) external payable returns(uint); function getExpectedRate(address src, address dest, uint srcQty) external view returns (uint expectedRate, uint slippageRate); } contract DSMath { function add(uint x, uint y) internal pure returns (uint z) { } function sub(uint x, uint y) internal pure returns (uint z) { } function mul(uint x, uint y) internal pure returns (uint z) { } function min(uint x, uint y) internal pure returns (uint z) { } function max(uint x, uint y) internal pure returns (uint z) { } function imin(int x, int y) internal pure returns (int z) { } function imax(int x, int y) internal pure returns (int z) { } uint constant WAD = 10 ** 18; uint constant RAY = 10 ** 27; function wmul(uint x, uint y) internal pure returns (uint z) { } function rmul(uint x, uint y) internal pure returns (uint z) { } function wdiv(uint x, uint y) internal pure returns (uint z) { } function rdiv(uint x, uint y) internal pure returns (uint z) { } function rpow(uint x, uint n) internal pure returns (uint z) { } } contract ConstantAddressesMainnet { address public constant MAKER_DAI_ADDRESS = 0x89d24A6b4CcB1B6fAA2625fE562bDD9a23260359; address public constant IDAI_ADDRESS = 0x14094949152EDDBFcd073717200DA82fEd8dC960; address public constant SOLO_MARGIN_ADDRESS = 0x1E0447b19BB6EcFdAe1e4AE1694b0C3659614e4e; address public constant CDAI_ADDRESS = 0xF5DCe57282A584D2746FaF1593d3121Fcac444dC; address public constant KYBER_ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address public constant MKR_ADDRESS = 0x9f8F72aA9304c8B593d555F12eF6589cC3A579A2; address public constant WETH_ADDRESS = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; address public constant VOX_ADDRESS = 0x9B0F70Df76165442ca6092939132bBAEA77f2d7A; address public constant PETH_ADDRESS = 0xf53AD2c6851052A81B42133467480961B2321C09; address public constant TUB_ADDRESS = 0x448a5065aeBB8E423F0896E6c5D525C040f59af3; address payable public constant WALLET_ID = 0x322d58b9E75a6918f7e7849AEe0fF09369977e08; address public constant LOGGER_ADDRESS = 0xeCf88e1ceC2D2894A0295DB3D86Fe7CE4991E6dF; address public constant OTC_ADDRESS = 0x39755357759cE0d7f32dC8dC45414CCa409AE24e; address public constant DISCOUNT_ADDRESS = 0x1b14E8D511c9A4395425314f849bD737BAF8208F; address public constant KYBER_WRAPPER = 0x8F337bD3b7F2b05d9A8dC8Ac518584e833424893; address public constant UNISWAP_WRAPPER = 0x1e30124FDE14533231216D95F7798cD0061e5cf8; address public constant ETH2DAI_WRAPPER = 0xd7BBB1777E13b6F535Dec414f575b858ed300baF; address public constant OASIS_WRAPPER = 0xCbE344DBBcCEbF04c0D045102A4bfA76c49b33c9; address public constant KYBER_INTERFACE = 0x818E6FECD516Ecc3849DAf6845e3EC868087B755; address public constant UNISWAP_FACTORY = 0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95; address public constant FACTORY_ADDRESS = 0x5a15566417e6C1c9546523066500bDDBc53F88C7; address public constant PIP_INTERFACE_ADDRESS = 0x729D19f657BD0614b4985Cf1D82531c67569197B; address public constant PROXY_REGISTRY_INTERFACE_ADDRESS = 0x4678f0a6958e4D2Bc4F1BAF7Bc52E8F3564f3fE4; address public constant GAS_TOKEN_INTERFACE_ADDRESS = 0x0000000000b3F879cb30FE243b4Dfee438691c04; address public constant SAVINGS_LOGGER_ADDRESS = 0x89b3635BD2bAD145C6f92E82C9e83f06D5654984; address public constant COMPOUND_DAI_ADDRESS = 0x25a01a05C188DaCBCf1D61Af55D4a5B4021F7eeD; address public constant STUPID_EXCHANGE = 0x863E41FE88288ebf3fcd91d8Dbb679fb83fdfE17; } contract ConstantAddressesKovan { address public constant KYBER_ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; address public constant WETH_ADDRESS = 0xd0A1E359811322d97991E03f863a0C30C2cF029C; address public constant MAKER_DAI_ADDRESS = 0xC4375B7De8af5a38a93548eb8453a498222C4fF2; address public constant MKR_ADDRESS = 0xAaF64BFCC32d0F15873a02163e7E500671a4ffcD; address public constant VOX_ADDRESS = 0xBb4339c0aB5B1d9f14Bd6e3426444A1e9d86A1d9; address public constant PETH_ADDRESS = 0xf4d791139cE033Ad35DB2B2201435fAd668B1b64; address public constant TUB_ADDRESS = 0xa71937147b55Deb8a530C7229C442Fd3F31b7db2; address public constant LOGGER_ADDRESS = 0x32d0e18f988F952Eb3524aCE762042381a2c39E5; address payable public constant WALLET_ID = 0x54b44C6B18fc0b4A1010B21d524c338D1f8065F6; address public constant OTC_ADDRESS = 0x4A6bC4e803c62081ffEbCc8d227B5a87a58f1F8F; address public constant COMPOUND_DAI_ADDRESS = 0x25a01a05C188DaCBCf1D61Af55D4a5B4021F7eeD; address public constant SOLO_MARGIN_ADDRESS = 0x4EC3570cADaAEE08Ae384779B0f3A45EF85289DE; address public constant IDAI_ADDRESS = 0xA1e58F3B1927743393b25f261471E1f2D3D9f0F6; address public constant CDAI_ADDRESS = 0xb6b09fBffBa6A5C4631e5F7B2e3Ee183aC259c0d; address public constant STUPID_EXCHANGE = 0x863E41FE88288ebf3fcd91d8Dbb679fb83fdfE17; address public constant DISCOUNT_ADDRESS = 0x1297c1105FEDf45E0CF6C102934f32C4EB780929; address public constant KYBER_WRAPPER = 0xABa933D6fD54BE2905d04f44eC8223B5DB4A6250; address public constant UNISWAP_WRAPPER = 0x5595930d576Aedf13945C83cE5aaD827529A1310; address public constant ETH2DAI_WRAPPER = 0x823cde416973a19f98Bb9C96d97F4FE6C9A7238B; address public constant OASIS_WRAPPER = 0xB9D22CC741a204a843525e7D028b6e513346f618; address public constant FACTORY_ADDRESS = 0xc72E74E474682680a414b506699bBcA44ab9a930; address public constant PIP_INTERFACE_ADDRESS = 0xA944bd4b25C9F186A846fd5668941AA3d3B8425F; address public constant PROXY_REGISTRY_INTERFACE_ADDRESS = 0x64A436ae831C1672AE81F674CAb8B6775df3475C; address public constant GAS_TOKEN_INTERFACE_ADDRESS = 0x0000000000170CcC93903185bE5A2094C870Df62; address public constant KYBER_INTERFACE = 0x692f391bCc85cefCe8C237C01e1f636BbD70EA4D; address public constant SAVINGS_LOGGER_ADDRESS = 0xA6E5d5F489b1c00d9C11E1caF45BAb6e6e26443d; address public constant UNISWAP_FACTORY = 0xf5D915570BC477f9B8D6C0E980aA81757A3AaC36; } contract ConstantAddresses is ConstantAddressesMainnet { } contract SaverExchange is DSMath, ConstantAddresses { uint public constant SERVICE_FEE = 800; function swapTokenToToken(address _src, address _dest, uint _amount, uint _minPrice, uint _exchangeType) public payable { } function swapDaiToEth(uint _amount, uint _minPrice, uint _exchangeType) public { require(<FILL_ME>) uint fee = takeFee(_amount, MAKER_DAI_ADDRESS); _amount = sub(_amount, fee); address exchangeWrapper; uint daiEthPrice; (exchangeWrapper, daiEthPrice) = getBestPrice(_amount, MAKER_DAI_ADDRESS, KYBER_ETH_ADDRESS, _exchangeType); require(daiEthPrice > _minPrice, "Slippage hit"); ERC20(MAKER_DAI_ADDRESS).transfer(exchangeWrapper, _amount); ExchangeInterface(exchangeWrapper).swapTokenToEther(MAKER_DAI_ADDRESS, _amount, uint(-1)); uint daiBalance = ERC20(MAKER_DAI_ADDRESS).balanceOf(address(this)); if (daiBalance > 0) { ERC20(MAKER_DAI_ADDRESS).transfer(msg.sender, daiBalance); } msg.sender.transfer(address(this).balance); } function swapEthToDai(uint _amount, uint _minPrice, uint _exchangeType) public payable { } function getBestPrice(uint _amount, address _srcToken, address _destToken, uint _exchangeType) public view returns (address, uint) { } function takeFee(uint _amount, address _token) internal returns (uint feeAmount) { } function() external payable {} }
ERC20(MAKER_DAI_ADDRESS).transferFrom(msg.sender,address(this),_amount)
394,946
ERC20(MAKER_DAI_ADDRESS).transferFrom(msg.sender,address(this),_amount)