comment
stringlengths
1
211
input
stringlengths
155
20k
label
stringlengths
4
1k
original_idx
int64
203
514k
predicate
stringlengths
1
1k
"CollateralMarket::buy: collateral depositary is not allowed"
// SPDX-License-Identifier: MIT pragma solidity ^0.6.0; import "@openzeppelin/contracts/math/SafeMath.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol"; import "@openzeppelin/contracts/utils/EnumerableSet.sol"; import "./utils/OwnablePausable.sol"; import "./Issuer.sol"; import "./Treasury.sol"; contract CollateralMarket is OwnablePausable { using SafeMath for uint256; using SafeERC20 for ERC20; using EnumerableSet for EnumerableSet.AddressSet; /// @notice Address of issuer contract. Issuer public issuer; /// @notice Address of treasury contract. Treasury public treasury; /// @notice Address of depositary contract. address public depositary; /// @dev Allowed tokens list. EnumerableSet.AddressSet private _allowedTokens; /// @notice An event emitted when token allowed. event TokenAllowed(address token); /// @notice An event emitted when token denied. event TokenDenied(address token); /// @notice An event thats emitted when an Issuer contract address changed. event IssuerChanged(address newIssuer); /// @notice An event thats emitted when an Treasury contract address changed. event TreasuryChanged(address newTreasury); /// @notice An event thats emitted when an Depositary contract address changed. event DepositaryChanged(address newDepositary); /// @notice An event thats emitted when an account buyed token. event Buy(address customer, address token, uint256 amount, uint256 buy); constructor( address _issuer, address payable _treasury, address _depositary ) public { } /** * @notice Allow token. * @param token Allowable token. */ function allowToken(address token) external onlyOwner { } /** * @notice Deny token. * @param token Denied token. */ function denyToken(address token) external onlyOwner { } /** * @return Allowed tokens list. */ function allowedTokens() external view returns (address[] memory) { } /** * @notice Change Issuer contract address. * @param _issuer New address Issuer contract. */ function changeIssuer(address _issuer) external onlyOwner { } /** * @notice Change Treasury contract address. * @param _treasury New address Treasury contract. */ function changeTreasury(address payable _treasury) external onlyOwner { } /** * @notice Change Depositary contract address. * @param _depositary New address Depositary contract. */ function changeDepositary(address _depositary) external onlyOwner { } /** * @notice Buy stable token with ERC20 payment token amount. * @param token Payment token. * @param amount Amount of payment token. */ function buy(ERC20 token, uint256 amount) external whenNotPaused { require(_allowedTokens.contains(address(token)), "CollateralMarket::buy: token is not allowed"); require(<FILL_ME>) token.safeTransferFrom(_msgSender(), address(this), amount); token.transfer(depositary, amount); ERC20 stableToken = ERC20(issuer.stableToken()); uint256 stableTokenDecimals = stableToken.decimals(); uint256 tokenDecimals = token.decimals(); uint256 reward = amount.mul(10**(stableTokenDecimals.sub(tokenDecimals))); issuer.rebalance(); treasury.transfer(address(stableToken), _msgSender(), reward); emit Buy(_msgSender(), address(token), amount, reward); } }
issuer.hasDepositary(depositary),"CollateralMarket::buy: collateral depositary is not allowed"
282,961
issuer.hasDepositary(depositary)
"Caller is not the owner, neither governance"
pragma solidity 0.7.1; // UniCatFarm is the master of MEOW. He can make MEOW and he is a fair cat. // // Note that it's ownable and the owner wields tremendous power. The owner will set // the governance contract and will burn its keys once MEOW is sufficiently // distributed. // // Have fun reading it. Hopefully it's bug-free. God bless. contract UniCatFarm is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // We do some fancy math here. Basically, any point in time, the amount of MEOWs // entitled to a user but is pending to be distributed is: // // pending reward = (user.amount * pool.accMEOWPerShare) - user.rewardDebt // // Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens: // 1. The pool's `accMEOWPerShare` (and `lastRewardBlock`) gets updated. // 2. User receives the pending reward sent to his/her address. // 3. User's `amount` gets updated. // 4. User's `rewardDebt` gets updated. } // Info of each pool. struct PoolInfo { IERC20 lpToken; // Address of LP token contract. uint256 allocPoint; // How many allocation points assigned to this pool. MEOWs to distribute per block. uint256 lastRewardBlock; // Last block number that MEOWs distribution occurs. uint256 accMEOWPerShare; // Accumulated MEOWs per share, times 1e12. See below. } // The MEOW TOKEN! UniCat public MEOW; // Dev address. address public devaddr; // Block number when bonus MEOW period ends. uint256 public bonusEndBlock; // MEOW tokens created per block. uint256 public MEOWPerBlock; // Bonus muliplier for early MEOW makers. uint256 public constant BONUS_MULTIPLIER = 10; // The governance contract; address public governance; // Info of each pool. PoolInfo[] public poolInfo; // Info of each user that stakes LP tokens. mapping (uint256 => mapping (address => UserInfo)) public userInfo; // Total allocation poitns. Must be the sum of all allocation points in all pools. uint256 public totalAllocPoint = 0; // The block number when MEOW mining starts. uint256 public startBlock; // The block number when MEOW mining ends. uint256 public endBlock; // The block number when dev can receive it's fee (1 year vesting) // Date and time (GMT): Monday, September 20, 2021 12:00:00 PM uint256 public devFeeUnlockTime = 1632139200; // If dev has requested its fee bool public devFeeDelivered; event Deposit(address indexed user, uint256 indexed pid, uint256 amount); event Withdraw(address indexed user, uint256 indexed pid, uint256 amount); event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount); constructor( UniCat _MEOW, address _devaddr, uint256 _MEOWPerBlock, // 100000000000000000000 uint256 _startBlock, // 10902300 , https://etherscan.io/block/countdown/10902300 uint256 _bonusEndBlock, //10930000, https://etherscan.io/block/countdown/10930000 uint256 _endBlock //11240000 (around 50 days of farming), https://etherscan.io/block/countdown/11240000 ) { } function poolLength() external view returns (uint256) { } modifier onlyOwnerOrGovernance() { require(<FILL_ME>) _; } // Add a new lp to the pool. Can only be called by the owner. // XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do. function add(uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate) public onlyOwnerOrGovernance { } // Update the given pool's MEOW allocation point. Can only be called by the owner or governance contract. function updateAllocPoint(uint256 _pid, uint256 _allocPoint, bool _withUpdate) public onlyOwnerOrGovernance { } // Set governance contract. Can only be called by the owner or governance contract. function setGovernance(address _governance, bytes memory _setupData) public onlyOwnerOrGovernance { } // Return reward multiplier over the given _from to _to block. function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) { } // View function to see pending MEOWs on frontend. function pendingMEOW(uint256 _pid, address _user) external view returns (uint256) { } // Update reward vairables for all pools. Be careful of gas spending! function massUpdatePools() public { } // Update reward variables of the given pool to be up-to-date. function updatePool(uint256 _pid) public { } // Deposit LP tokens to UniCatFarm for MEOW allocation. // You can harvest by calling deposit(_pid,0) function deposit(uint256 _pid, uint256 _amount) public { } // Withdraw LP tokens from UniCatFarm. function withdraw(uint256 _pid, uint256 _amount) public { } // Withdraw without caring about rewards. EMERGENCY ONLY. function emergencyWithdraw(uint256 _pid) public { } // Safe MEOW transfer function, just in case if rounding error causes pool to not have enough MEOWs. function safeMEOWTransfer(address _to, uint256 _amount) internal { } // Update dev address by the previous dev. function dev(address _devaddr) public { } // give dev team its fee. This can ony be called after one year, // it's 0.5% function devFee() public { } }
owner()==_msgSender()||governance==_msgSender(),"Caller is not the owner, neither governance"
283,001
owner()==_msgSender()||governance==_msgSender()
"devFee: can only be called once"
pragma solidity 0.7.1; // UniCatFarm is the master of MEOW. He can make MEOW and he is a fair cat. // // Note that it's ownable and the owner wields tremendous power. The owner will set // the governance contract and will burn its keys once MEOW is sufficiently // distributed. // // Have fun reading it. Hopefully it's bug-free. God bless. contract UniCatFarm is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; // Info of each user. struct UserInfo { uint256 amount; // How many LP tokens the user has provided. uint256 rewardDebt; // Reward debt. See explanation below. // // We do some fancy math here. Basically, any point in time, the amount of MEOWs // entitled to a user but is pending to be distributed is: // // pending reward = (user.amount * pool.accMEOWPerShare) - user.rewardDebt // // Whenever a user deposits or withdraws LP tokens to a pool. Here's what happens: // 1. The pool's `accMEOWPerShare` (and `lastRewardBlock`) gets updated. // 2. User receives the pending reward sent to his/her address. // 3. User's `amount` gets updated. // 4. User's `rewardDebt` gets updated. } // Info of each pool. struct PoolInfo { IERC20 lpToken; // Address of LP token contract. uint256 allocPoint; // How many allocation points assigned to this pool. MEOWs to distribute per block. uint256 lastRewardBlock; // Last block number that MEOWs distribution occurs. uint256 accMEOWPerShare; // Accumulated MEOWs per share, times 1e12. See below. } // The MEOW TOKEN! UniCat public MEOW; // Dev address. address public devaddr; // Block number when bonus MEOW period ends. uint256 public bonusEndBlock; // MEOW tokens created per block. uint256 public MEOWPerBlock; // Bonus muliplier for early MEOW makers. uint256 public constant BONUS_MULTIPLIER = 10; // The governance contract; address public governance; // Info of each pool. PoolInfo[] public poolInfo; // Info of each user that stakes LP tokens. mapping (uint256 => mapping (address => UserInfo)) public userInfo; // Total allocation poitns. Must be the sum of all allocation points in all pools. uint256 public totalAllocPoint = 0; // The block number when MEOW mining starts. uint256 public startBlock; // The block number when MEOW mining ends. uint256 public endBlock; // The block number when dev can receive it's fee (1 year vesting) // Date and time (GMT): Monday, September 20, 2021 12:00:00 PM uint256 public devFeeUnlockTime = 1632139200; // If dev has requested its fee bool public devFeeDelivered; event Deposit(address indexed user, uint256 indexed pid, uint256 amount); event Withdraw(address indexed user, uint256 indexed pid, uint256 amount); event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount); constructor( UniCat _MEOW, address _devaddr, uint256 _MEOWPerBlock, // 100000000000000000000 uint256 _startBlock, // 10902300 , https://etherscan.io/block/countdown/10902300 uint256 _bonusEndBlock, //10930000, https://etherscan.io/block/countdown/10930000 uint256 _endBlock //11240000 (around 50 days of farming), https://etherscan.io/block/countdown/11240000 ) { } function poolLength() external view returns (uint256) { } modifier onlyOwnerOrGovernance() { } // Add a new lp to the pool. Can only be called by the owner. // XXX DO NOT add the same LP token more than once. Rewards will be messed up if you do. function add(uint256 _allocPoint, IERC20 _lpToken, bool _withUpdate) public onlyOwnerOrGovernance { } // Update the given pool's MEOW allocation point. Can only be called by the owner or governance contract. function updateAllocPoint(uint256 _pid, uint256 _allocPoint, bool _withUpdate) public onlyOwnerOrGovernance { } // Set governance contract. Can only be called by the owner or governance contract. function setGovernance(address _governance, bytes memory _setupData) public onlyOwnerOrGovernance { } // Return reward multiplier over the given _from to _to block. function getMultiplier(uint256 _from, uint256 _to) public view returns (uint256) { } // View function to see pending MEOWs on frontend. function pendingMEOW(uint256 _pid, address _user) external view returns (uint256) { } // Update reward vairables for all pools. Be careful of gas spending! function massUpdatePools() public { } // Update reward variables of the given pool to be up-to-date. function updatePool(uint256 _pid) public { } // Deposit LP tokens to UniCatFarm for MEOW allocation. // You can harvest by calling deposit(_pid,0) function deposit(uint256 _pid, uint256 _amount) public { } // Withdraw LP tokens from UniCatFarm. function withdraw(uint256 _pid, uint256 _amount) public { } // Withdraw without caring about rewards. EMERGENCY ONLY. function emergencyWithdraw(uint256 _pid) public { } // Safe MEOW transfer function, just in case if rounding error causes pool to not have enough MEOWs. function safeMEOWTransfer(address _to, uint256 _amount) internal { } // Update dev address by the previous dev. function dev(address _devaddr) public { } // give dev team its fee. This can ony be called after one year, // it's 0.5% function devFee() public { require(block.timestamp >= devFeeUnlockTime, "devFee: wait until unlock time"); require(<FILL_ME>) MEOW.mint(devaddr, MEOW.totalSupply().div(200)); devFeeDelivered=true; } }
!devFeeDelivered,"devFee: can only be called once"
283,001
!devFeeDelivered
null
/* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity 0.4.21; /// @title Utility Functions for uint /// @author Daniel Wang - <[email protected]> library MathUint { function mul( uint a, uint b ) internal pure returns (uint c) { } function sub( uint a, uint b ) internal pure returns (uint) { } function add( uint a, uint b ) internal pure returns (uint c) { } function tolerantSub( uint a, uint b ) internal pure returns (uint c) { } /// @dev calculate the square of Coefficient of Variation (CV) /// https://en.wikipedia.org/wiki/Coefficient_of_variation function cvsquare( uint[] arr, uint scale ) internal pure returns (uint) { } } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @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. 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 ) onlyOwner public { } } /// @title Claimable /// @dev Extension for the Ownable contract, where the ownership needs /// to be claimed. This allows the new owner to accept the transfer. contract Claimable is Ownable { address public pendingOwner; /// @dev Modifier throws if called by any account other than the pendingOwner. modifier onlyPendingOwner() { } /// @dev Allows the current owner to set the pendingOwner address. /// @param newOwner The address to transfer ownership to. function transferOwnership( address newOwner ) onlyOwner public { } /// @dev Allows the pendingOwner address to finalize the transfer. function claimOwnership() onlyPendingOwner public { } } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @title ERC20 Token Interface /// @dev see https://github.com/ethereum/EIPs/issues/20 /// @author Daniel Wang - <[email protected]> contract ERC20 { function balanceOf( address who ) view public returns (uint256); function allowance( address owner, address spender ) view public returns (uint256); function transfer( address to, uint256 value ) public returns (bool); function transferFrom( address from, address to, uint256 value ) public returns (bool); function approve( address spender, uint256 value ) public returns (bool); } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @title TokenTransferDelegate /// @dev Acts as a middle man to transfer ERC20 tokens on behalf of different /// versions of Loopring protocol to avoid ERC20 re-authorization. /// @author Daniel Wang - <[email protected]>. contract TokenTransferDelegate { event AddressAuthorized( address indexed addr, uint32 number ); event AddressDeauthorized( address indexed addr, uint32 number ); // The following map is used to keep trace of order fill and cancellation // history. mapping (bytes32 => uint) public cancelledOrFilled; // This map is used to keep trace of order's cancellation history. mapping (bytes32 => uint) public cancelled; // A map from address to its cutoff timestamp. mapping (address => uint) public cutoffs; // A map from address to its trading-pair cutoff timestamp. mapping (address => mapping (bytes20 => uint)) public tradingPairCutoffs; /// @dev Add a Loopring protocol address. /// @param addr A loopring protocol address. function authorizeAddress( address addr ) external; /// @dev Remove a Loopring protocol address. /// @param addr A loopring protocol address. function deauthorizeAddress( address addr ) external; function getLatestAuthorizedAddresses( uint max ) external view returns (address[] addresses); /// @dev Invoke ERC20 transferFrom method. /// @param token Address of token to transfer. /// @param from Address to transfer token from. /// @param to Address to transfer token to. /// @param value Amount of token to transfer. function transferToken( address token, address from, address to, uint value ) external; function batchTransferToken( address lrcTokenAddress, address minerFeeRecipient, uint8 walletSplitPercentage, bytes32[] batch ) external; function isAddressAuthorized( address addr ) public view returns (bool); function addCancelled(bytes32 orderHash, uint cancelAmount) external; function addCancelledOrFilled(bytes32 orderHash, uint cancelOrFillAmount) public; function batchAddCancelledOrFilled(bytes32[] batch) public; function setCutoffs(uint t) external; function setTradingPairCutoffs(bytes20 tokenPair, uint t) external; function checkCutoffsBatch(address[] owners, bytes20[] tradingPairs, uint[] validSince) external view; function suspend() external; function resume() external; function kill() external; } /// @title An Implementation of TokenTransferDelegate. /// @author Daniel Wang - <[email protected]>. /// @author Kongliang Zhong - <[email protected]>. contract TokenTransferDelegateImpl is TokenTransferDelegate, Claimable { using MathUint for uint; bool public suspended = false; struct AddressInfo { address previous; uint32 index; bool authorized; } mapping(address => AddressInfo) public addressInfos; address public latestAddress; modifier onlyAuthorized() { require(<FILL_ME>) _; } modifier notSuspended() { } modifier isSuspended() { } /// @dev Disable default function. function () payable public { } function authorizeAddress( address addr ) onlyOwner external { } function deauthorizeAddress( address addr ) onlyOwner external { } function getLatestAuthorizedAddresses( uint max ) external view returns (address[] addresses) { } function transferToken( address token, address from, address to, uint value ) onlyAuthorized notSuspended external { } function batchTransferToken( address lrcTokenAddress, address minerFeeRecipient, uint8 walletSplitPercentage, bytes32[] batch ) onlyAuthorized notSuspended external { } function isAddressAuthorized( address addr ) public view returns (bool) { } function splitPayFee( ERC20 token, uint fee, address owner, address minerFeeRecipient, address walletFeeRecipient, uint walletSplitPercentage ) internal { } function addCancelled(bytes32 orderHash, uint cancelAmount) onlyAuthorized notSuspended external { } function addCancelledOrFilled(bytes32 orderHash, uint cancelOrFillAmount) onlyAuthorized notSuspended public { } function batchAddCancelledOrFilled(bytes32[] batch) onlyAuthorized notSuspended public { } function setCutoffs(uint t) onlyAuthorized notSuspended external { } function setTradingPairCutoffs(bytes20 tokenPair, uint t) onlyAuthorized notSuspended external { } function checkCutoffsBatch(address[] owners, bytes20[] tradingPairs, uint[] validSince) external view { } function suspend() onlyOwner notSuspended external { } function resume() onlyOwner isSuspended external { } /// owner must suspend delegate first before invoke kill method. function kill() onlyOwner isSuspended external { } }
addressInfos[msg.sender].authorized
283,044
addressInfos[msg.sender].authorized
null
/* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity 0.4.21; /// @title Utility Functions for uint /// @author Daniel Wang - <[email protected]> library MathUint { function mul( uint a, uint b ) internal pure returns (uint c) { } function sub( uint a, uint b ) internal pure returns (uint) { } function add( uint a, uint b ) internal pure returns (uint c) { } function tolerantSub( uint a, uint b ) internal pure returns (uint c) { } /// @dev calculate the square of Coefficient of Variation (CV) /// https://en.wikipedia.org/wiki/Coefficient_of_variation function cvsquare( uint[] arr, uint scale ) internal pure returns (uint) { } } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @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. 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 ) onlyOwner public { } } /// @title Claimable /// @dev Extension for the Ownable contract, where the ownership needs /// to be claimed. This allows the new owner to accept the transfer. contract Claimable is Ownable { address public pendingOwner; /// @dev Modifier throws if called by any account other than the pendingOwner. modifier onlyPendingOwner() { } /// @dev Allows the current owner to set the pendingOwner address. /// @param newOwner The address to transfer ownership to. function transferOwnership( address newOwner ) onlyOwner public { } /// @dev Allows the pendingOwner address to finalize the transfer. function claimOwnership() onlyPendingOwner public { } } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @title ERC20 Token Interface /// @dev see https://github.com/ethereum/EIPs/issues/20 /// @author Daniel Wang - <[email protected]> contract ERC20 { function balanceOf( address who ) view public returns (uint256); function allowance( address owner, address spender ) view public returns (uint256); function transfer( address to, uint256 value ) public returns (bool); function transferFrom( address from, address to, uint256 value ) public returns (bool); function approve( address spender, uint256 value ) public returns (bool); } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @title TokenTransferDelegate /// @dev Acts as a middle man to transfer ERC20 tokens on behalf of different /// versions of Loopring protocol to avoid ERC20 re-authorization. /// @author Daniel Wang - <[email protected]>. contract TokenTransferDelegate { event AddressAuthorized( address indexed addr, uint32 number ); event AddressDeauthorized( address indexed addr, uint32 number ); // The following map is used to keep trace of order fill and cancellation // history. mapping (bytes32 => uint) public cancelledOrFilled; // This map is used to keep trace of order's cancellation history. mapping (bytes32 => uint) public cancelled; // A map from address to its cutoff timestamp. mapping (address => uint) public cutoffs; // A map from address to its trading-pair cutoff timestamp. mapping (address => mapping (bytes20 => uint)) public tradingPairCutoffs; /// @dev Add a Loopring protocol address. /// @param addr A loopring protocol address. function authorizeAddress( address addr ) external; /// @dev Remove a Loopring protocol address. /// @param addr A loopring protocol address. function deauthorizeAddress( address addr ) external; function getLatestAuthorizedAddresses( uint max ) external view returns (address[] addresses); /// @dev Invoke ERC20 transferFrom method. /// @param token Address of token to transfer. /// @param from Address to transfer token from. /// @param to Address to transfer token to. /// @param value Amount of token to transfer. function transferToken( address token, address from, address to, uint value ) external; function batchTransferToken( address lrcTokenAddress, address minerFeeRecipient, uint8 walletSplitPercentage, bytes32[] batch ) external; function isAddressAuthorized( address addr ) public view returns (bool); function addCancelled(bytes32 orderHash, uint cancelAmount) external; function addCancelledOrFilled(bytes32 orderHash, uint cancelOrFillAmount) public; function batchAddCancelledOrFilled(bytes32[] batch) public; function setCutoffs(uint t) external; function setTradingPairCutoffs(bytes20 tokenPair, uint t) external; function checkCutoffsBatch(address[] owners, bytes20[] tradingPairs, uint[] validSince) external view; function suspend() external; function resume() external; function kill() external; } /// @title An Implementation of TokenTransferDelegate. /// @author Daniel Wang - <[email protected]>. /// @author Kongliang Zhong - <[email protected]>. contract TokenTransferDelegateImpl is TokenTransferDelegate, Claimable { using MathUint for uint; bool public suspended = false; struct AddressInfo { address previous; uint32 index; bool authorized; } mapping(address => AddressInfo) public addressInfos; address public latestAddress; modifier onlyAuthorized() { } modifier notSuspended() { require(<FILL_ME>) _; } modifier isSuspended() { } /// @dev Disable default function. function () payable public { } function authorizeAddress( address addr ) onlyOwner external { } function deauthorizeAddress( address addr ) onlyOwner external { } function getLatestAuthorizedAddresses( uint max ) external view returns (address[] addresses) { } function transferToken( address token, address from, address to, uint value ) onlyAuthorized notSuspended external { } function batchTransferToken( address lrcTokenAddress, address minerFeeRecipient, uint8 walletSplitPercentage, bytes32[] batch ) onlyAuthorized notSuspended external { } function isAddressAuthorized( address addr ) public view returns (bool) { } function splitPayFee( ERC20 token, uint fee, address owner, address minerFeeRecipient, address walletFeeRecipient, uint walletSplitPercentage ) internal { } function addCancelled(bytes32 orderHash, uint cancelAmount) onlyAuthorized notSuspended external { } function addCancelledOrFilled(bytes32 orderHash, uint cancelOrFillAmount) onlyAuthorized notSuspended public { } function batchAddCancelledOrFilled(bytes32[] batch) onlyAuthorized notSuspended public { } function setCutoffs(uint t) onlyAuthorized notSuspended external { } function setTradingPairCutoffs(bytes20 tokenPair, uint t) onlyAuthorized notSuspended external { } function checkCutoffsBatch(address[] owners, bytes20[] tradingPairs, uint[] validSince) external view { } function suspend() onlyOwner notSuspended external { } function resume() onlyOwner isSuspended external { } /// owner must suspend delegate first before invoke kill method. function kill() onlyOwner isSuspended external { } }
!suspended
283,044
!suspended
null
/* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity 0.4.21; /// @title Utility Functions for uint /// @author Daniel Wang - <[email protected]> library MathUint { function mul( uint a, uint b ) internal pure returns (uint c) { } function sub( uint a, uint b ) internal pure returns (uint) { } function add( uint a, uint b ) internal pure returns (uint c) { } function tolerantSub( uint a, uint b ) internal pure returns (uint c) { } /// @dev calculate the square of Coefficient of Variation (CV) /// https://en.wikipedia.org/wiki/Coefficient_of_variation function cvsquare( uint[] arr, uint scale ) internal pure returns (uint) { } } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @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. 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 ) onlyOwner public { } } /// @title Claimable /// @dev Extension for the Ownable contract, where the ownership needs /// to be claimed. This allows the new owner to accept the transfer. contract Claimable is Ownable { address public pendingOwner; /// @dev Modifier throws if called by any account other than the pendingOwner. modifier onlyPendingOwner() { } /// @dev Allows the current owner to set the pendingOwner address. /// @param newOwner The address to transfer ownership to. function transferOwnership( address newOwner ) onlyOwner public { } /// @dev Allows the pendingOwner address to finalize the transfer. function claimOwnership() onlyPendingOwner public { } } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @title ERC20 Token Interface /// @dev see https://github.com/ethereum/EIPs/issues/20 /// @author Daniel Wang - <[email protected]> contract ERC20 { function balanceOf( address who ) view public returns (uint256); function allowance( address owner, address spender ) view public returns (uint256); function transfer( address to, uint256 value ) public returns (bool); function transferFrom( address from, address to, uint256 value ) public returns (bool); function approve( address spender, uint256 value ) public returns (bool); } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @title TokenTransferDelegate /// @dev Acts as a middle man to transfer ERC20 tokens on behalf of different /// versions of Loopring protocol to avoid ERC20 re-authorization. /// @author Daniel Wang - <[email protected]>. contract TokenTransferDelegate { event AddressAuthorized( address indexed addr, uint32 number ); event AddressDeauthorized( address indexed addr, uint32 number ); // The following map is used to keep trace of order fill and cancellation // history. mapping (bytes32 => uint) public cancelledOrFilled; // This map is used to keep trace of order's cancellation history. mapping (bytes32 => uint) public cancelled; // A map from address to its cutoff timestamp. mapping (address => uint) public cutoffs; // A map from address to its trading-pair cutoff timestamp. mapping (address => mapping (bytes20 => uint)) public tradingPairCutoffs; /// @dev Add a Loopring protocol address. /// @param addr A loopring protocol address. function authorizeAddress( address addr ) external; /// @dev Remove a Loopring protocol address. /// @param addr A loopring protocol address. function deauthorizeAddress( address addr ) external; function getLatestAuthorizedAddresses( uint max ) external view returns (address[] addresses); /// @dev Invoke ERC20 transferFrom method. /// @param token Address of token to transfer. /// @param from Address to transfer token from. /// @param to Address to transfer token to. /// @param value Amount of token to transfer. function transferToken( address token, address from, address to, uint value ) external; function batchTransferToken( address lrcTokenAddress, address minerFeeRecipient, uint8 walletSplitPercentage, bytes32[] batch ) external; function isAddressAuthorized( address addr ) public view returns (bool); function addCancelled(bytes32 orderHash, uint cancelAmount) external; function addCancelledOrFilled(bytes32 orderHash, uint cancelOrFillAmount) public; function batchAddCancelledOrFilled(bytes32[] batch) public; function setCutoffs(uint t) external; function setTradingPairCutoffs(bytes20 tokenPair, uint t) external; function checkCutoffsBatch(address[] owners, bytes20[] tradingPairs, uint[] validSince) external view; function suspend() external; function resume() external; function kill() external; } /// @title An Implementation of TokenTransferDelegate. /// @author Daniel Wang - <[email protected]>. /// @author Kongliang Zhong - <[email protected]>. contract TokenTransferDelegateImpl is TokenTransferDelegate, Claimable { using MathUint for uint; bool public suspended = false; struct AddressInfo { address previous; uint32 index; bool authorized; } mapping(address => AddressInfo) public addressInfos; address public latestAddress; modifier onlyAuthorized() { } modifier notSuspended() { } modifier isSuspended() { } /// @dev Disable default function. function () payable public { } function authorizeAddress( address addr ) onlyOwner external { } function deauthorizeAddress( address addr ) onlyOwner external { } function getLatestAuthorizedAddresses( uint max ) external view returns (address[] addresses) { } function transferToken( address token, address from, address to, uint value ) onlyAuthorized notSuspended external { } function batchTransferToken( address lrcTokenAddress, address minerFeeRecipient, uint8 walletSplitPercentage, bytes32[] batch ) onlyAuthorized notSuspended external { uint len = batch.length; require(<FILL_ME>) require(walletSplitPercentage > 0 && walletSplitPercentage < 100); ERC20 lrc = ERC20(lrcTokenAddress); address prevOwner = address(batch[len - 7]); for (uint i = 0; i < len; i += 7) { address owner = address(batch[i]); // Pay token to previous order, or to miner as previous order's // margin split or/and this order's margin split. ERC20 token = ERC20(address(batch[i + 1])); // Here batch[i + 2] has been checked not to be 0. if (batch[i + 2] != 0x0 && owner != prevOwner) { require( token.transferFrom( owner, prevOwner, uint(batch[i + 2]) ) ); } // Miner pays LRx fee to order owner uint lrcReward = uint(batch[i + 4]); if (lrcReward != 0 && minerFeeRecipient != owner) { require( lrc.transferFrom( minerFeeRecipient, owner, lrcReward ) ); } // Split margin-split income between miner and wallet splitPayFee( token, uint(batch[i + 3]), owner, minerFeeRecipient, address(batch[i + 6]), walletSplitPercentage ); // Split LRx fee income between miner and wallet splitPayFee( lrc, uint(batch[i + 5]), owner, minerFeeRecipient, address(batch[i + 6]), walletSplitPercentage ); prevOwner = owner; } } function isAddressAuthorized( address addr ) public view returns (bool) { } function splitPayFee( ERC20 token, uint fee, address owner, address minerFeeRecipient, address walletFeeRecipient, uint walletSplitPercentage ) internal { } function addCancelled(bytes32 orderHash, uint cancelAmount) onlyAuthorized notSuspended external { } function addCancelledOrFilled(bytes32 orderHash, uint cancelOrFillAmount) onlyAuthorized notSuspended public { } function batchAddCancelledOrFilled(bytes32[] batch) onlyAuthorized notSuspended public { } function setCutoffs(uint t) onlyAuthorized notSuspended external { } function setTradingPairCutoffs(bytes20 tokenPair, uint t) onlyAuthorized notSuspended external { } function checkCutoffsBatch(address[] owners, bytes20[] tradingPairs, uint[] validSince) external view { } function suspend() onlyOwner notSuspended external { } function resume() onlyOwner isSuspended external { } /// owner must suspend delegate first before invoke kill method. function kill() onlyOwner isSuspended external { } }
len%7==0
283,044
len%7==0
null
/* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity 0.4.21; /// @title Utility Functions for uint /// @author Daniel Wang - <[email protected]> library MathUint { function mul( uint a, uint b ) internal pure returns (uint c) { } function sub( uint a, uint b ) internal pure returns (uint) { } function add( uint a, uint b ) internal pure returns (uint c) { } function tolerantSub( uint a, uint b ) internal pure returns (uint c) { } /// @dev calculate the square of Coefficient of Variation (CV) /// https://en.wikipedia.org/wiki/Coefficient_of_variation function cvsquare( uint[] arr, uint scale ) internal pure returns (uint) { } } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @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. 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 ) onlyOwner public { } } /// @title Claimable /// @dev Extension for the Ownable contract, where the ownership needs /// to be claimed. This allows the new owner to accept the transfer. contract Claimable is Ownable { address public pendingOwner; /// @dev Modifier throws if called by any account other than the pendingOwner. modifier onlyPendingOwner() { } /// @dev Allows the current owner to set the pendingOwner address. /// @param newOwner The address to transfer ownership to. function transferOwnership( address newOwner ) onlyOwner public { } /// @dev Allows the pendingOwner address to finalize the transfer. function claimOwnership() onlyPendingOwner public { } } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @title ERC20 Token Interface /// @dev see https://github.com/ethereum/EIPs/issues/20 /// @author Daniel Wang - <[email protected]> contract ERC20 { function balanceOf( address who ) view public returns (uint256); function allowance( address owner, address spender ) view public returns (uint256); function transfer( address to, uint256 value ) public returns (bool); function transferFrom( address from, address to, uint256 value ) public returns (bool); function approve( address spender, uint256 value ) public returns (bool); } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @title TokenTransferDelegate /// @dev Acts as a middle man to transfer ERC20 tokens on behalf of different /// versions of Loopring protocol to avoid ERC20 re-authorization. /// @author Daniel Wang - <[email protected]>. contract TokenTransferDelegate { event AddressAuthorized( address indexed addr, uint32 number ); event AddressDeauthorized( address indexed addr, uint32 number ); // The following map is used to keep trace of order fill and cancellation // history. mapping (bytes32 => uint) public cancelledOrFilled; // This map is used to keep trace of order's cancellation history. mapping (bytes32 => uint) public cancelled; // A map from address to its cutoff timestamp. mapping (address => uint) public cutoffs; // A map from address to its trading-pair cutoff timestamp. mapping (address => mapping (bytes20 => uint)) public tradingPairCutoffs; /// @dev Add a Loopring protocol address. /// @param addr A loopring protocol address. function authorizeAddress( address addr ) external; /// @dev Remove a Loopring protocol address. /// @param addr A loopring protocol address. function deauthorizeAddress( address addr ) external; function getLatestAuthorizedAddresses( uint max ) external view returns (address[] addresses); /// @dev Invoke ERC20 transferFrom method. /// @param token Address of token to transfer. /// @param from Address to transfer token from. /// @param to Address to transfer token to. /// @param value Amount of token to transfer. function transferToken( address token, address from, address to, uint value ) external; function batchTransferToken( address lrcTokenAddress, address minerFeeRecipient, uint8 walletSplitPercentage, bytes32[] batch ) external; function isAddressAuthorized( address addr ) public view returns (bool); function addCancelled(bytes32 orderHash, uint cancelAmount) external; function addCancelledOrFilled(bytes32 orderHash, uint cancelOrFillAmount) public; function batchAddCancelledOrFilled(bytes32[] batch) public; function setCutoffs(uint t) external; function setTradingPairCutoffs(bytes20 tokenPair, uint t) external; function checkCutoffsBatch(address[] owners, bytes20[] tradingPairs, uint[] validSince) external view; function suspend() external; function resume() external; function kill() external; } /// @title An Implementation of TokenTransferDelegate. /// @author Daniel Wang - <[email protected]>. /// @author Kongliang Zhong - <[email protected]>. contract TokenTransferDelegateImpl is TokenTransferDelegate, Claimable { using MathUint for uint; bool public suspended = false; struct AddressInfo { address previous; uint32 index; bool authorized; } mapping(address => AddressInfo) public addressInfos; address public latestAddress; modifier onlyAuthorized() { } modifier notSuspended() { } modifier isSuspended() { } /// @dev Disable default function. function () payable public { } function authorizeAddress( address addr ) onlyOwner external { } function deauthorizeAddress( address addr ) onlyOwner external { } function getLatestAuthorizedAddresses( uint max ) external view returns (address[] addresses) { } function transferToken( address token, address from, address to, uint value ) onlyAuthorized notSuspended external { } function batchTransferToken( address lrcTokenAddress, address minerFeeRecipient, uint8 walletSplitPercentage, bytes32[] batch ) onlyAuthorized notSuspended external { uint len = batch.length; require(len % 7 == 0); require(walletSplitPercentage > 0 && walletSplitPercentage < 100); ERC20 lrc = ERC20(lrcTokenAddress); address prevOwner = address(batch[len - 7]); for (uint i = 0; i < len; i += 7) { address owner = address(batch[i]); // Pay token to previous order, or to miner as previous order's // margin split or/and this order's margin split. ERC20 token = ERC20(address(batch[i + 1])); // Here batch[i + 2] has been checked not to be 0. if (batch[i + 2] != 0x0 && owner != prevOwner) { require(<FILL_ME>) } // Miner pays LRx fee to order owner uint lrcReward = uint(batch[i + 4]); if (lrcReward != 0 && minerFeeRecipient != owner) { require( lrc.transferFrom( minerFeeRecipient, owner, lrcReward ) ); } // Split margin-split income between miner and wallet splitPayFee( token, uint(batch[i + 3]), owner, minerFeeRecipient, address(batch[i + 6]), walletSplitPercentage ); // Split LRx fee income between miner and wallet splitPayFee( lrc, uint(batch[i + 5]), owner, minerFeeRecipient, address(batch[i + 6]), walletSplitPercentage ); prevOwner = owner; } } function isAddressAuthorized( address addr ) public view returns (bool) { } function splitPayFee( ERC20 token, uint fee, address owner, address minerFeeRecipient, address walletFeeRecipient, uint walletSplitPercentage ) internal { } function addCancelled(bytes32 orderHash, uint cancelAmount) onlyAuthorized notSuspended external { } function addCancelledOrFilled(bytes32 orderHash, uint cancelOrFillAmount) onlyAuthorized notSuspended public { } function batchAddCancelledOrFilled(bytes32[] batch) onlyAuthorized notSuspended public { } function setCutoffs(uint t) onlyAuthorized notSuspended external { } function setTradingPairCutoffs(bytes20 tokenPair, uint t) onlyAuthorized notSuspended external { } function checkCutoffsBatch(address[] owners, bytes20[] tradingPairs, uint[] validSince) external view { } function suspend() onlyOwner notSuspended external { } function resume() onlyOwner isSuspended external { } /// owner must suspend delegate first before invoke kill method. function kill() onlyOwner isSuspended external { } }
token.transferFrom(owner,prevOwner,uint(batch[i+2]))
283,044
token.transferFrom(owner,prevOwner,uint(batch[i+2]))
null
/* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity 0.4.21; /// @title Utility Functions for uint /// @author Daniel Wang - <[email protected]> library MathUint { function mul( uint a, uint b ) internal pure returns (uint c) { } function sub( uint a, uint b ) internal pure returns (uint) { } function add( uint a, uint b ) internal pure returns (uint c) { } function tolerantSub( uint a, uint b ) internal pure returns (uint c) { } /// @dev calculate the square of Coefficient of Variation (CV) /// https://en.wikipedia.org/wiki/Coefficient_of_variation function cvsquare( uint[] arr, uint scale ) internal pure returns (uint) { } } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @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. 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 ) onlyOwner public { } } /// @title Claimable /// @dev Extension for the Ownable contract, where the ownership needs /// to be claimed. This allows the new owner to accept the transfer. contract Claimable is Ownable { address public pendingOwner; /// @dev Modifier throws if called by any account other than the pendingOwner. modifier onlyPendingOwner() { } /// @dev Allows the current owner to set the pendingOwner address. /// @param newOwner The address to transfer ownership to. function transferOwnership( address newOwner ) onlyOwner public { } /// @dev Allows the pendingOwner address to finalize the transfer. function claimOwnership() onlyPendingOwner public { } } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @title ERC20 Token Interface /// @dev see https://github.com/ethereum/EIPs/issues/20 /// @author Daniel Wang - <[email protected]> contract ERC20 { function balanceOf( address who ) view public returns (uint256); function allowance( address owner, address spender ) view public returns (uint256); function transfer( address to, uint256 value ) public returns (bool); function transferFrom( address from, address to, uint256 value ) public returns (bool); function approve( address spender, uint256 value ) public returns (bool); } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @title TokenTransferDelegate /// @dev Acts as a middle man to transfer ERC20 tokens on behalf of different /// versions of Loopring protocol to avoid ERC20 re-authorization. /// @author Daniel Wang - <[email protected]>. contract TokenTransferDelegate { event AddressAuthorized( address indexed addr, uint32 number ); event AddressDeauthorized( address indexed addr, uint32 number ); // The following map is used to keep trace of order fill and cancellation // history. mapping (bytes32 => uint) public cancelledOrFilled; // This map is used to keep trace of order's cancellation history. mapping (bytes32 => uint) public cancelled; // A map from address to its cutoff timestamp. mapping (address => uint) public cutoffs; // A map from address to its trading-pair cutoff timestamp. mapping (address => mapping (bytes20 => uint)) public tradingPairCutoffs; /// @dev Add a Loopring protocol address. /// @param addr A loopring protocol address. function authorizeAddress( address addr ) external; /// @dev Remove a Loopring protocol address. /// @param addr A loopring protocol address. function deauthorizeAddress( address addr ) external; function getLatestAuthorizedAddresses( uint max ) external view returns (address[] addresses); /// @dev Invoke ERC20 transferFrom method. /// @param token Address of token to transfer. /// @param from Address to transfer token from. /// @param to Address to transfer token to. /// @param value Amount of token to transfer. function transferToken( address token, address from, address to, uint value ) external; function batchTransferToken( address lrcTokenAddress, address minerFeeRecipient, uint8 walletSplitPercentage, bytes32[] batch ) external; function isAddressAuthorized( address addr ) public view returns (bool); function addCancelled(bytes32 orderHash, uint cancelAmount) external; function addCancelledOrFilled(bytes32 orderHash, uint cancelOrFillAmount) public; function batchAddCancelledOrFilled(bytes32[] batch) public; function setCutoffs(uint t) external; function setTradingPairCutoffs(bytes20 tokenPair, uint t) external; function checkCutoffsBatch(address[] owners, bytes20[] tradingPairs, uint[] validSince) external view; function suspend() external; function resume() external; function kill() external; } /// @title An Implementation of TokenTransferDelegate. /// @author Daniel Wang - <[email protected]>. /// @author Kongliang Zhong - <[email protected]>. contract TokenTransferDelegateImpl is TokenTransferDelegate, Claimable { using MathUint for uint; bool public suspended = false; struct AddressInfo { address previous; uint32 index; bool authorized; } mapping(address => AddressInfo) public addressInfos; address public latestAddress; modifier onlyAuthorized() { } modifier notSuspended() { } modifier isSuspended() { } /// @dev Disable default function. function () payable public { } function authorizeAddress( address addr ) onlyOwner external { } function deauthorizeAddress( address addr ) onlyOwner external { } function getLatestAuthorizedAddresses( uint max ) external view returns (address[] addresses) { } function transferToken( address token, address from, address to, uint value ) onlyAuthorized notSuspended external { } function batchTransferToken( address lrcTokenAddress, address minerFeeRecipient, uint8 walletSplitPercentage, bytes32[] batch ) onlyAuthorized notSuspended external { uint len = batch.length; require(len % 7 == 0); require(walletSplitPercentage > 0 && walletSplitPercentage < 100); ERC20 lrc = ERC20(lrcTokenAddress); address prevOwner = address(batch[len - 7]); for (uint i = 0; i < len; i += 7) { address owner = address(batch[i]); // Pay token to previous order, or to miner as previous order's // margin split or/and this order's margin split. ERC20 token = ERC20(address(batch[i + 1])); // Here batch[i + 2] has been checked not to be 0. if (batch[i + 2] != 0x0 && owner != prevOwner) { require( token.transferFrom( owner, prevOwner, uint(batch[i + 2]) ) ); } // Miner pays LRx fee to order owner uint lrcReward = uint(batch[i + 4]); if (lrcReward != 0 && minerFeeRecipient != owner) { require(<FILL_ME>) } // Split margin-split income between miner and wallet splitPayFee( token, uint(batch[i + 3]), owner, minerFeeRecipient, address(batch[i + 6]), walletSplitPercentage ); // Split LRx fee income between miner and wallet splitPayFee( lrc, uint(batch[i + 5]), owner, minerFeeRecipient, address(batch[i + 6]), walletSplitPercentage ); prevOwner = owner; } } function isAddressAuthorized( address addr ) public view returns (bool) { } function splitPayFee( ERC20 token, uint fee, address owner, address minerFeeRecipient, address walletFeeRecipient, uint walletSplitPercentage ) internal { } function addCancelled(bytes32 orderHash, uint cancelAmount) onlyAuthorized notSuspended external { } function addCancelledOrFilled(bytes32 orderHash, uint cancelOrFillAmount) onlyAuthorized notSuspended public { } function batchAddCancelledOrFilled(bytes32[] batch) onlyAuthorized notSuspended public { } function setCutoffs(uint t) onlyAuthorized notSuspended external { } function setTradingPairCutoffs(bytes20 tokenPair, uint t) onlyAuthorized notSuspended external { } function checkCutoffsBatch(address[] owners, bytes20[] tradingPairs, uint[] validSince) external view { } function suspend() onlyOwner notSuspended external { } function resume() onlyOwner isSuspended external { } /// owner must suspend delegate first before invoke kill method. function kill() onlyOwner isSuspended external { } }
lrc.transferFrom(minerFeeRecipient,owner,lrcReward)
283,044
lrc.transferFrom(minerFeeRecipient,owner,lrcReward)
null
/* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity 0.4.21; /// @title Utility Functions for uint /// @author Daniel Wang - <[email protected]> library MathUint { function mul( uint a, uint b ) internal pure returns (uint c) { } function sub( uint a, uint b ) internal pure returns (uint) { } function add( uint a, uint b ) internal pure returns (uint c) { } function tolerantSub( uint a, uint b ) internal pure returns (uint c) { } /// @dev calculate the square of Coefficient of Variation (CV) /// https://en.wikipedia.org/wiki/Coefficient_of_variation function cvsquare( uint[] arr, uint scale ) internal pure returns (uint) { } } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @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. 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 ) onlyOwner public { } } /// @title Claimable /// @dev Extension for the Ownable contract, where the ownership needs /// to be claimed. This allows the new owner to accept the transfer. contract Claimable is Ownable { address public pendingOwner; /// @dev Modifier throws if called by any account other than the pendingOwner. modifier onlyPendingOwner() { } /// @dev Allows the current owner to set the pendingOwner address. /// @param newOwner The address to transfer ownership to. function transferOwnership( address newOwner ) onlyOwner public { } /// @dev Allows the pendingOwner address to finalize the transfer. function claimOwnership() onlyPendingOwner public { } } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @title ERC20 Token Interface /// @dev see https://github.com/ethereum/EIPs/issues/20 /// @author Daniel Wang - <[email protected]> contract ERC20 { function balanceOf( address who ) view public returns (uint256); function allowance( address owner, address spender ) view public returns (uint256); function transfer( address to, uint256 value ) public returns (bool); function transferFrom( address from, address to, uint256 value ) public returns (bool); function approve( address spender, uint256 value ) public returns (bool); } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @title TokenTransferDelegate /// @dev Acts as a middle man to transfer ERC20 tokens on behalf of different /// versions of Loopring protocol to avoid ERC20 re-authorization. /// @author Daniel Wang - <[email protected]>. contract TokenTransferDelegate { event AddressAuthorized( address indexed addr, uint32 number ); event AddressDeauthorized( address indexed addr, uint32 number ); // The following map is used to keep trace of order fill and cancellation // history. mapping (bytes32 => uint) public cancelledOrFilled; // This map is used to keep trace of order's cancellation history. mapping (bytes32 => uint) public cancelled; // A map from address to its cutoff timestamp. mapping (address => uint) public cutoffs; // A map from address to its trading-pair cutoff timestamp. mapping (address => mapping (bytes20 => uint)) public tradingPairCutoffs; /// @dev Add a Loopring protocol address. /// @param addr A loopring protocol address. function authorizeAddress( address addr ) external; /// @dev Remove a Loopring protocol address. /// @param addr A loopring protocol address. function deauthorizeAddress( address addr ) external; function getLatestAuthorizedAddresses( uint max ) external view returns (address[] addresses); /// @dev Invoke ERC20 transferFrom method. /// @param token Address of token to transfer. /// @param from Address to transfer token from. /// @param to Address to transfer token to. /// @param value Amount of token to transfer. function transferToken( address token, address from, address to, uint value ) external; function batchTransferToken( address lrcTokenAddress, address minerFeeRecipient, uint8 walletSplitPercentage, bytes32[] batch ) external; function isAddressAuthorized( address addr ) public view returns (bool); function addCancelled(bytes32 orderHash, uint cancelAmount) external; function addCancelledOrFilled(bytes32 orderHash, uint cancelOrFillAmount) public; function batchAddCancelledOrFilled(bytes32[] batch) public; function setCutoffs(uint t) external; function setTradingPairCutoffs(bytes20 tokenPair, uint t) external; function checkCutoffsBatch(address[] owners, bytes20[] tradingPairs, uint[] validSince) external view; function suspend() external; function resume() external; function kill() external; } /// @title An Implementation of TokenTransferDelegate. /// @author Daniel Wang - <[email protected]>. /// @author Kongliang Zhong - <[email protected]>. contract TokenTransferDelegateImpl is TokenTransferDelegate, Claimable { using MathUint for uint; bool public suspended = false; struct AddressInfo { address previous; uint32 index; bool authorized; } mapping(address => AddressInfo) public addressInfos; address public latestAddress; modifier onlyAuthorized() { } modifier notSuspended() { } modifier isSuspended() { } /// @dev Disable default function. function () payable public { } function authorizeAddress( address addr ) onlyOwner external { } function deauthorizeAddress( address addr ) onlyOwner external { } function getLatestAuthorizedAddresses( uint max ) external view returns (address[] addresses) { } function transferToken( address token, address from, address to, uint value ) onlyAuthorized notSuspended external { } function batchTransferToken( address lrcTokenAddress, address minerFeeRecipient, uint8 walletSplitPercentage, bytes32[] batch ) onlyAuthorized notSuspended external { } function isAddressAuthorized( address addr ) public view returns (bool) { } function splitPayFee( ERC20 token, uint fee, address owner, address minerFeeRecipient, address walletFeeRecipient, uint walletSplitPercentage ) internal { if (fee == 0) { return; } uint walletFee = (walletFeeRecipient == 0x0) ? 0 : fee.mul(walletSplitPercentage) / 100; uint minerFee = fee.sub(walletFee); if (walletFee > 0 && walletFeeRecipient != owner) { require(<FILL_ME>) } if (minerFee > 0 && minerFeeRecipient != 0x0 && minerFeeRecipient != owner) { require( token.transferFrom( owner, minerFeeRecipient, minerFee ) ); } } function addCancelled(bytes32 orderHash, uint cancelAmount) onlyAuthorized notSuspended external { } function addCancelledOrFilled(bytes32 orderHash, uint cancelOrFillAmount) onlyAuthorized notSuspended public { } function batchAddCancelledOrFilled(bytes32[] batch) onlyAuthorized notSuspended public { } function setCutoffs(uint t) onlyAuthorized notSuspended external { } function setTradingPairCutoffs(bytes20 tokenPair, uint t) onlyAuthorized notSuspended external { } function checkCutoffsBatch(address[] owners, bytes20[] tradingPairs, uint[] validSince) external view { } function suspend() onlyOwner notSuspended external { } function resume() onlyOwner isSuspended external { } /// owner must suspend delegate first before invoke kill method. function kill() onlyOwner isSuspended external { } }
token.transferFrom(owner,walletFeeRecipient,walletFee)
283,044
token.transferFrom(owner,walletFeeRecipient,walletFee)
null
/* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity 0.4.21; /// @title Utility Functions for uint /// @author Daniel Wang - <[email protected]> library MathUint { function mul( uint a, uint b ) internal pure returns (uint c) { } function sub( uint a, uint b ) internal pure returns (uint) { } function add( uint a, uint b ) internal pure returns (uint c) { } function tolerantSub( uint a, uint b ) internal pure returns (uint c) { } /// @dev calculate the square of Coefficient of Variation (CV) /// https://en.wikipedia.org/wiki/Coefficient_of_variation function cvsquare( uint[] arr, uint scale ) internal pure returns (uint) { } } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @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. 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 ) onlyOwner public { } } /// @title Claimable /// @dev Extension for the Ownable contract, where the ownership needs /// to be claimed. This allows the new owner to accept the transfer. contract Claimable is Ownable { address public pendingOwner; /// @dev Modifier throws if called by any account other than the pendingOwner. modifier onlyPendingOwner() { } /// @dev Allows the current owner to set the pendingOwner address. /// @param newOwner The address to transfer ownership to. function transferOwnership( address newOwner ) onlyOwner public { } /// @dev Allows the pendingOwner address to finalize the transfer. function claimOwnership() onlyPendingOwner public { } } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @title ERC20 Token Interface /// @dev see https://github.com/ethereum/EIPs/issues/20 /// @author Daniel Wang - <[email protected]> contract ERC20 { function balanceOf( address who ) view public returns (uint256); function allowance( address owner, address spender ) view public returns (uint256); function transfer( address to, uint256 value ) public returns (bool); function transferFrom( address from, address to, uint256 value ) public returns (bool); function approve( address spender, uint256 value ) public returns (bool); } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @title TokenTransferDelegate /// @dev Acts as a middle man to transfer ERC20 tokens on behalf of different /// versions of Loopring protocol to avoid ERC20 re-authorization. /// @author Daniel Wang - <[email protected]>. contract TokenTransferDelegate { event AddressAuthorized( address indexed addr, uint32 number ); event AddressDeauthorized( address indexed addr, uint32 number ); // The following map is used to keep trace of order fill and cancellation // history. mapping (bytes32 => uint) public cancelledOrFilled; // This map is used to keep trace of order's cancellation history. mapping (bytes32 => uint) public cancelled; // A map from address to its cutoff timestamp. mapping (address => uint) public cutoffs; // A map from address to its trading-pair cutoff timestamp. mapping (address => mapping (bytes20 => uint)) public tradingPairCutoffs; /// @dev Add a Loopring protocol address. /// @param addr A loopring protocol address. function authorizeAddress( address addr ) external; /// @dev Remove a Loopring protocol address. /// @param addr A loopring protocol address. function deauthorizeAddress( address addr ) external; function getLatestAuthorizedAddresses( uint max ) external view returns (address[] addresses); /// @dev Invoke ERC20 transferFrom method. /// @param token Address of token to transfer. /// @param from Address to transfer token from. /// @param to Address to transfer token to. /// @param value Amount of token to transfer. function transferToken( address token, address from, address to, uint value ) external; function batchTransferToken( address lrcTokenAddress, address minerFeeRecipient, uint8 walletSplitPercentage, bytes32[] batch ) external; function isAddressAuthorized( address addr ) public view returns (bool); function addCancelled(bytes32 orderHash, uint cancelAmount) external; function addCancelledOrFilled(bytes32 orderHash, uint cancelOrFillAmount) public; function batchAddCancelledOrFilled(bytes32[] batch) public; function setCutoffs(uint t) external; function setTradingPairCutoffs(bytes20 tokenPair, uint t) external; function checkCutoffsBatch(address[] owners, bytes20[] tradingPairs, uint[] validSince) external view; function suspend() external; function resume() external; function kill() external; } /// @title An Implementation of TokenTransferDelegate. /// @author Daniel Wang - <[email protected]>. /// @author Kongliang Zhong - <[email protected]>. contract TokenTransferDelegateImpl is TokenTransferDelegate, Claimable { using MathUint for uint; bool public suspended = false; struct AddressInfo { address previous; uint32 index; bool authorized; } mapping(address => AddressInfo) public addressInfos; address public latestAddress; modifier onlyAuthorized() { } modifier notSuspended() { } modifier isSuspended() { } /// @dev Disable default function. function () payable public { } function authorizeAddress( address addr ) onlyOwner external { } function deauthorizeAddress( address addr ) onlyOwner external { } function getLatestAuthorizedAddresses( uint max ) external view returns (address[] addresses) { } function transferToken( address token, address from, address to, uint value ) onlyAuthorized notSuspended external { } function batchTransferToken( address lrcTokenAddress, address minerFeeRecipient, uint8 walletSplitPercentage, bytes32[] batch ) onlyAuthorized notSuspended external { } function isAddressAuthorized( address addr ) public view returns (bool) { } function splitPayFee( ERC20 token, uint fee, address owner, address minerFeeRecipient, address walletFeeRecipient, uint walletSplitPercentage ) internal { if (fee == 0) { return; } uint walletFee = (walletFeeRecipient == 0x0) ? 0 : fee.mul(walletSplitPercentage) / 100; uint minerFee = fee.sub(walletFee); if (walletFee > 0 && walletFeeRecipient != owner) { require( token.transferFrom( owner, walletFeeRecipient, walletFee ) ); } if (minerFee > 0 && minerFeeRecipient != 0x0 && minerFeeRecipient != owner) { require(<FILL_ME>) } } function addCancelled(bytes32 orderHash, uint cancelAmount) onlyAuthorized notSuspended external { } function addCancelledOrFilled(bytes32 orderHash, uint cancelOrFillAmount) onlyAuthorized notSuspended public { } function batchAddCancelledOrFilled(bytes32[] batch) onlyAuthorized notSuspended public { } function setCutoffs(uint t) onlyAuthorized notSuspended external { } function setTradingPairCutoffs(bytes20 tokenPair, uint t) onlyAuthorized notSuspended external { } function checkCutoffsBatch(address[] owners, bytes20[] tradingPairs, uint[] validSince) external view { } function suspend() onlyOwner notSuspended external { } function resume() onlyOwner isSuspended external { } /// owner must suspend delegate first before invoke kill method. function kill() onlyOwner isSuspended external { } }
token.transferFrom(owner,minerFeeRecipient,minerFee)
283,044
token.transferFrom(owner,minerFeeRecipient,minerFee)
null
/* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity 0.4.21; /// @title Utility Functions for uint /// @author Daniel Wang - <[email protected]> library MathUint { function mul( uint a, uint b ) internal pure returns (uint c) { } function sub( uint a, uint b ) internal pure returns (uint) { } function add( uint a, uint b ) internal pure returns (uint c) { } function tolerantSub( uint a, uint b ) internal pure returns (uint c) { } /// @dev calculate the square of Coefficient of Variation (CV) /// https://en.wikipedia.org/wiki/Coefficient_of_variation function cvsquare( uint[] arr, uint scale ) internal pure returns (uint) { } } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @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. 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 ) onlyOwner public { } } /// @title Claimable /// @dev Extension for the Ownable contract, where the ownership needs /// to be claimed. This allows the new owner to accept the transfer. contract Claimable is Ownable { address public pendingOwner; /// @dev Modifier throws if called by any account other than the pendingOwner. modifier onlyPendingOwner() { } /// @dev Allows the current owner to set the pendingOwner address. /// @param newOwner The address to transfer ownership to. function transferOwnership( address newOwner ) onlyOwner public { } /// @dev Allows the pendingOwner address to finalize the transfer. function claimOwnership() onlyPendingOwner public { } } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @title ERC20 Token Interface /// @dev see https://github.com/ethereum/EIPs/issues/20 /// @author Daniel Wang - <[email protected]> contract ERC20 { function balanceOf( address who ) view public returns (uint256); function allowance( address owner, address spender ) view public returns (uint256); function transfer( address to, uint256 value ) public returns (bool); function transferFrom( address from, address to, uint256 value ) public returns (bool); function approve( address spender, uint256 value ) public returns (bool); } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @title TokenTransferDelegate /// @dev Acts as a middle man to transfer ERC20 tokens on behalf of different /// versions of Loopring protocol to avoid ERC20 re-authorization. /// @author Daniel Wang - <[email protected]>. contract TokenTransferDelegate { event AddressAuthorized( address indexed addr, uint32 number ); event AddressDeauthorized( address indexed addr, uint32 number ); // The following map is used to keep trace of order fill and cancellation // history. mapping (bytes32 => uint) public cancelledOrFilled; // This map is used to keep trace of order's cancellation history. mapping (bytes32 => uint) public cancelled; // A map from address to its cutoff timestamp. mapping (address => uint) public cutoffs; // A map from address to its trading-pair cutoff timestamp. mapping (address => mapping (bytes20 => uint)) public tradingPairCutoffs; /// @dev Add a Loopring protocol address. /// @param addr A loopring protocol address. function authorizeAddress( address addr ) external; /// @dev Remove a Loopring protocol address. /// @param addr A loopring protocol address. function deauthorizeAddress( address addr ) external; function getLatestAuthorizedAddresses( uint max ) external view returns (address[] addresses); /// @dev Invoke ERC20 transferFrom method. /// @param token Address of token to transfer. /// @param from Address to transfer token from. /// @param to Address to transfer token to. /// @param value Amount of token to transfer. function transferToken( address token, address from, address to, uint value ) external; function batchTransferToken( address lrcTokenAddress, address minerFeeRecipient, uint8 walletSplitPercentage, bytes32[] batch ) external; function isAddressAuthorized( address addr ) public view returns (bool); function addCancelled(bytes32 orderHash, uint cancelAmount) external; function addCancelledOrFilled(bytes32 orderHash, uint cancelOrFillAmount) public; function batchAddCancelledOrFilled(bytes32[] batch) public; function setCutoffs(uint t) external; function setTradingPairCutoffs(bytes20 tokenPair, uint t) external; function checkCutoffsBatch(address[] owners, bytes20[] tradingPairs, uint[] validSince) external view; function suspend() external; function resume() external; function kill() external; } /// @title An Implementation of TokenTransferDelegate. /// @author Daniel Wang - <[email protected]>. /// @author Kongliang Zhong - <[email protected]>. contract TokenTransferDelegateImpl is TokenTransferDelegate, Claimable { using MathUint for uint; bool public suspended = false; struct AddressInfo { address previous; uint32 index; bool authorized; } mapping(address => AddressInfo) public addressInfos; address public latestAddress; modifier onlyAuthorized() { } modifier notSuspended() { } modifier isSuspended() { } /// @dev Disable default function. function () payable public { } function authorizeAddress( address addr ) onlyOwner external { } function deauthorizeAddress( address addr ) onlyOwner external { } function getLatestAuthorizedAddresses( uint max ) external view returns (address[] addresses) { } function transferToken( address token, address from, address to, uint value ) onlyAuthorized notSuspended external { } function batchTransferToken( address lrcTokenAddress, address minerFeeRecipient, uint8 walletSplitPercentage, bytes32[] batch ) onlyAuthorized notSuspended external { } function isAddressAuthorized( address addr ) public view returns (bool) { } function splitPayFee( ERC20 token, uint fee, address owner, address minerFeeRecipient, address walletFeeRecipient, uint walletSplitPercentage ) internal { } function addCancelled(bytes32 orderHash, uint cancelAmount) onlyAuthorized notSuspended external { } function addCancelledOrFilled(bytes32 orderHash, uint cancelOrFillAmount) onlyAuthorized notSuspended public { } function batchAddCancelledOrFilled(bytes32[] batch) onlyAuthorized notSuspended public { require(<FILL_ME>) for (uint i = 0; i < batch.length / 2; i++) { cancelledOrFilled[batch[i * 2]] = cancelledOrFilled[batch[i * 2]] .add(uint(batch[i * 2 + 1])); } } function setCutoffs(uint t) onlyAuthorized notSuspended external { } function setTradingPairCutoffs(bytes20 tokenPair, uint t) onlyAuthorized notSuspended external { } function checkCutoffsBatch(address[] owners, bytes20[] tradingPairs, uint[] validSince) external view { } function suspend() onlyOwner notSuspended external { } function resume() onlyOwner isSuspended external { } /// owner must suspend delegate first before invoke kill method. function kill() onlyOwner isSuspended external { } }
batch.length%2==0
283,044
batch.length%2==0
null
/* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity 0.4.21; /// @title Utility Functions for uint /// @author Daniel Wang - <[email protected]> library MathUint { function mul( uint a, uint b ) internal pure returns (uint c) { } function sub( uint a, uint b ) internal pure returns (uint) { } function add( uint a, uint b ) internal pure returns (uint c) { } function tolerantSub( uint a, uint b ) internal pure returns (uint c) { } /// @dev calculate the square of Coefficient of Variation (CV) /// https://en.wikipedia.org/wiki/Coefficient_of_variation function cvsquare( uint[] arr, uint scale ) internal pure returns (uint) { } } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @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. 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 ) onlyOwner public { } } /// @title Claimable /// @dev Extension for the Ownable contract, where the ownership needs /// to be claimed. This allows the new owner to accept the transfer. contract Claimable is Ownable { address public pendingOwner; /// @dev Modifier throws if called by any account other than the pendingOwner. modifier onlyPendingOwner() { } /// @dev Allows the current owner to set the pendingOwner address. /// @param newOwner The address to transfer ownership to. function transferOwnership( address newOwner ) onlyOwner public { } /// @dev Allows the pendingOwner address to finalize the transfer. function claimOwnership() onlyPendingOwner public { } } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @title ERC20 Token Interface /// @dev see https://github.com/ethereum/EIPs/issues/20 /// @author Daniel Wang - <[email protected]> contract ERC20 { function balanceOf( address who ) view public returns (uint256); function allowance( address owner, address spender ) view public returns (uint256); function transfer( address to, uint256 value ) public returns (bool); function transferFrom( address from, address to, uint256 value ) public returns (bool); function approve( address spender, uint256 value ) public returns (bool); } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @title TokenTransferDelegate /// @dev Acts as a middle man to transfer ERC20 tokens on behalf of different /// versions of Loopring protocol to avoid ERC20 re-authorization. /// @author Daniel Wang - <[email protected]>. contract TokenTransferDelegate { event AddressAuthorized( address indexed addr, uint32 number ); event AddressDeauthorized( address indexed addr, uint32 number ); // The following map is used to keep trace of order fill and cancellation // history. mapping (bytes32 => uint) public cancelledOrFilled; // This map is used to keep trace of order's cancellation history. mapping (bytes32 => uint) public cancelled; // A map from address to its cutoff timestamp. mapping (address => uint) public cutoffs; // A map from address to its trading-pair cutoff timestamp. mapping (address => mapping (bytes20 => uint)) public tradingPairCutoffs; /// @dev Add a Loopring protocol address. /// @param addr A loopring protocol address. function authorizeAddress( address addr ) external; /// @dev Remove a Loopring protocol address. /// @param addr A loopring protocol address. function deauthorizeAddress( address addr ) external; function getLatestAuthorizedAddresses( uint max ) external view returns (address[] addresses); /// @dev Invoke ERC20 transferFrom method. /// @param token Address of token to transfer. /// @param from Address to transfer token from. /// @param to Address to transfer token to. /// @param value Amount of token to transfer. function transferToken( address token, address from, address to, uint value ) external; function batchTransferToken( address lrcTokenAddress, address minerFeeRecipient, uint8 walletSplitPercentage, bytes32[] batch ) external; function isAddressAuthorized( address addr ) public view returns (bool); function addCancelled(bytes32 orderHash, uint cancelAmount) external; function addCancelledOrFilled(bytes32 orderHash, uint cancelOrFillAmount) public; function batchAddCancelledOrFilled(bytes32[] batch) public; function setCutoffs(uint t) external; function setTradingPairCutoffs(bytes20 tokenPair, uint t) external; function checkCutoffsBatch(address[] owners, bytes20[] tradingPairs, uint[] validSince) external view; function suspend() external; function resume() external; function kill() external; } /// @title An Implementation of TokenTransferDelegate. /// @author Daniel Wang - <[email protected]>. /// @author Kongliang Zhong - <[email protected]>. contract TokenTransferDelegateImpl is TokenTransferDelegate, Claimable { using MathUint for uint; bool public suspended = false; struct AddressInfo { address previous; uint32 index; bool authorized; } mapping(address => AddressInfo) public addressInfos; address public latestAddress; modifier onlyAuthorized() { } modifier notSuspended() { } modifier isSuspended() { } /// @dev Disable default function. function () payable public { } function authorizeAddress( address addr ) onlyOwner external { } function deauthorizeAddress( address addr ) onlyOwner external { } function getLatestAuthorizedAddresses( uint max ) external view returns (address[] addresses) { } function transferToken( address token, address from, address to, uint value ) onlyAuthorized notSuspended external { } function batchTransferToken( address lrcTokenAddress, address minerFeeRecipient, uint8 walletSplitPercentage, bytes32[] batch ) onlyAuthorized notSuspended external { } function isAddressAuthorized( address addr ) public view returns (bool) { } function splitPayFee( ERC20 token, uint fee, address owner, address minerFeeRecipient, address walletFeeRecipient, uint walletSplitPercentage ) internal { } function addCancelled(bytes32 orderHash, uint cancelAmount) onlyAuthorized notSuspended external { } function addCancelledOrFilled(bytes32 orderHash, uint cancelOrFillAmount) onlyAuthorized notSuspended public { } function batchAddCancelledOrFilled(bytes32[] batch) onlyAuthorized notSuspended public { } function setCutoffs(uint t) onlyAuthorized notSuspended external { } function setTradingPairCutoffs(bytes20 tokenPair, uint t) onlyAuthorized notSuspended external { } function checkCutoffsBatch(address[] owners, bytes20[] tradingPairs, uint[] validSince) external view { uint len = owners.length; require(len == tradingPairs.length); require(len == validSince.length); for(uint i = 0; i < len; i++) { require(<FILL_ME>) // order trading pair is cut off require(validSince[i] > cutoffs[owners[i]]); // order is cut off } } function suspend() onlyOwner notSuspended external { } function resume() onlyOwner isSuspended external { } /// owner must suspend delegate first before invoke kill method. function kill() onlyOwner isSuspended external { } }
validSince[i]>tradingPairCutoffs[owners[i]][tradingPairs[i]]
283,044
validSince[i]>tradingPairCutoffs[owners[i]][tradingPairs[i]]
null
/* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity 0.4.21; /// @title Utility Functions for uint /// @author Daniel Wang - <[email protected]> library MathUint { function mul( uint a, uint b ) internal pure returns (uint c) { } function sub( uint a, uint b ) internal pure returns (uint) { } function add( uint a, uint b ) internal pure returns (uint c) { } function tolerantSub( uint a, uint b ) internal pure returns (uint c) { } /// @dev calculate the square of Coefficient of Variation (CV) /// https://en.wikipedia.org/wiki/Coefficient_of_variation function cvsquare( uint[] arr, uint scale ) internal pure returns (uint) { } } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @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. 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 ) onlyOwner public { } } /// @title Claimable /// @dev Extension for the Ownable contract, where the ownership needs /// to be claimed. This allows the new owner to accept the transfer. contract Claimable is Ownable { address public pendingOwner; /// @dev Modifier throws if called by any account other than the pendingOwner. modifier onlyPendingOwner() { } /// @dev Allows the current owner to set the pendingOwner address. /// @param newOwner The address to transfer ownership to. function transferOwnership( address newOwner ) onlyOwner public { } /// @dev Allows the pendingOwner address to finalize the transfer. function claimOwnership() onlyPendingOwner public { } } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @title ERC20 Token Interface /// @dev see https://github.com/ethereum/EIPs/issues/20 /// @author Daniel Wang - <[email protected]> contract ERC20 { function balanceOf( address who ) view public returns (uint256); function allowance( address owner, address spender ) view public returns (uint256); function transfer( address to, uint256 value ) public returns (bool); function transferFrom( address from, address to, uint256 value ) public returns (bool); function approve( address spender, uint256 value ) public returns (bool); } /* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ /// @title TokenTransferDelegate /// @dev Acts as a middle man to transfer ERC20 tokens on behalf of different /// versions of Loopring protocol to avoid ERC20 re-authorization. /// @author Daniel Wang - <[email protected]>. contract TokenTransferDelegate { event AddressAuthorized( address indexed addr, uint32 number ); event AddressDeauthorized( address indexed addr, uint32 number ); // The following map is used to keep trace of order fill and cancellation // history. mapping (bytes32 => uint) public cancelledOrFilled; // This map is used to keep trace of order's cancellation history. mapping (bytes32 => uint) public cancelled; // A map from address to its cutoff timestamp. mapping (address => uint) public cutoffs; // A map from address to its trading-pair cutoff timestamp. mapping (address => mapping (bytes20 => uint)) public tradingPairCutoffs; /// @dev Add a Loopring protocol address. /// @param addr A loopring protocol address. function authorizeAddress( address addr ) external; /// @dev Remove a Loopring protocol address. /// @param addr A loopring protocol address. function deauthorizeAddress( address addr ) external; function getLatestAuthorizedAddresses( uint max ) external view returns (address[] addresses); /// @dev Invoke ERC20 transferFrom method. /// @param token Address of token to transfer. /// @param from Address to transfer token from. /// @param to Address to transfer token to. /// @param value Amount of token to transfer. function transferToken( address token, address from, address to, uint value ) external; function batchTransferToken( address lrcTokenAddress, address minerFeeRecipient, uint8 walletSplitPercentage, bytes32[] batch ) external; function isAddressAuthorized( address addr ) public view returns (bool); function addCancelled(bytes32 orderHash, uint cancelAmount) external; function addCancelledOrFilled(bytes32 orderHash, uint cancelOrFillAmount) public; function batchAddCancelledOrFilled(bytes32[] batch) public; function setCutoffs(uint t) external; function setTradingPairCutoffs(bytes20 tokenPair, uint t) external; function checkCutoffsBatch(address[] owners, bytes20[] tradingPairs, uint[] validSince) external view; function suspend() external; function resume() external; function kill() external; } /// @title An Implementation of TokenTransferDelegate. /// @author Daniel Wang - <[email protected]>. /// @author Kongliang Zhong - <[email protected]>. contract TokenTransferDelegateImpl is TokenTransferDelegate, Claimable { using MathUint for uint; bool public suspended = false; struct AddressInfo { address previous; uint32 index; bool authorized; } mapping(address => AddressInfo) public addressInfos; address public latestAddress; modifier onlyAuthorized() { } modifier notSuspended() { } modifier isSuspended() { } /// @dev Disable default function. function () payable public { } function authorizeAddress( address addr ) onlyOwner external { } function deauthorizeAddress( address addr ) onlyOwner external { } function getLatestAuthorizedAddresses( uint max ) external view returns (address[] addresses) { } function transferToken( address token, address from, address to, uint value ) onlyAuthorized notSuspended external { } function batchTransferToken( address lrcTokenAddress, address minerFeeRecipient, uint8 walletSplitPercentage, bytes32[] batch ) onlyAuthorized notSuspended external { } function isAddressAuthorized( address addr ) public view returns (bool) { } function splitPayFee( ERC20 token, uint fee, address owner, address minerFeeRecipient, address walletFeeRecipient, uint walletSplitPercentage ) internal { } function addCancelled(bytes32 orderHash, uint cancelAmount) onlyAuthorized notSuspended external { } function addCancelledOrFilled(bytes32 orderHash, uint cancelOrFillAmount) onlyAuthorized notSuspended public { } function batchAddCancelledOrFilled(bytes32[] batch) onlyAuthorized notSuspended public { } function setCutoffs(uint t) onlyAuthorized notSuspended external { } function setTradingPairCutoffs(bytes20 tokenPair, uint t) onlyAuthorized notSuspended external { } function checkCutoffsBatch(address[] owners, bytes20[] tradingPairs, uint[] validSince) external view { uint len = owners.length; require(len == tradingPairs.length); require(len == validSince.length); for(uint i = 0; i < len; i++) { require(validSince[i] > tradingPairCutoffs[owners[i]][tradingPairs[i]]); // order trading pair is cut off require(<FILL_ME>) // order is cut off } } function suspend() onlyOwner notSuspended external { } function resume() onlyOwner isSuspended external { } /// owner must suspend delegate first before invoke kill method. function kill() onlyOwner isSuspended external { } }
validSince[i]>cutoffs[owners[i]]
283,044
validSince[i]>cutoffs[owners[i]]
"Exceeds Max Supply"
pragma solidity ^0.8.7; contract ARABMETA is ERC721Enumerable, Ownable { using Counters for Counters.Counter; using Strings for uint256; //Counters Counters.Counter internal _airdrops; string public baseURI; string public notRevealedUri; bytes32 private whitelistRoot; //Inventory uint16 public maxMintAmountPerTransaction = 20; uint16 public maxMintAmountPerWalletWL = 10; uint256 public maxSupply = 5555; //Prices uint256 public cost = 0.4 ether; uint256 public whitelistCost = 0.1 ether; //Utility bool public paused = true; bool public revealed = false; bool public whiteListingSale = true; struct MintTracker{ bool _ISEXIST; uint256 _AMOUNT; } modifier onlyEOA() { } //mapping mapping(address => bool) private whitelistedMints; mapping(address => MintTracker) public WHITELISTTRACKER; constructor(string memory _notRevealedUrl) ERC721("ARAB META", "AMSC") { } function setWhitelistingRoot(bytes32 _root) public onlyOwner { } // Verify that a given leaf is in the tree. function _verify(bytes32 _leafNode, bytes32[] memory proof) internal view returns (bool) { } // Generate the leaf node (just the hash of tokenID concatenated with the account address) function _leaf(address account) internal pure returns (bytes32) { } //whitelist mint function mintWhitelist(uint256 mintAmount,bytes32[] calldata proof) public payable onlyEOA(){ uint256 supply = totalSupply(); require(<FILL_ME>) if (msg.sender != owner()) { require(!paused); require(whiteListingSale, "Whitelisting not enabled"); require(_verify(_leaf(msg.sender), proof), "Invalid proof"); require(msg.value >= whitelistCost * mintAmount, "Insufficent funds"); if(WHITELISTTRACKER[msg.sender]._ISEXIST){ require((WHITELISTTRACKER[msg.sender]._AMOUNT + mintAmount) <= maxMintAmountPerWalletWL, "Sorry you cant mint any more"); } else{ require(mintAmount <= maxMintAmountPerWalletWL, "Sorry you cant mint more"); } } for (uint256 i = 1; i <= mintAmount; i++) { _safeMint(msg.sender, supply + i); WHITELISTTRACKER[msg.sender]._AMOUNT+=1; } WHITELISTTRACKER[msg.sender]._ISEXIST = true; } // public function mint(uint256 _mintAmount) public payable onlyEOA(){ } function gift(address _to, uint256 _mintAmount) public onlyOwner { } function totalAirdrops() public view returns (uint256) { } function airdrop(address[] memory _airdropAddresses) public onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function getTotalMints() public view returns (uint256) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function toggleReveal() public onlyOwner { } function setCost(uint256 _newCost) public onlyOwner { } function setWhitelistingCost(uint256 _newCost) public onlyOwner { } function setmaxMintAmountPerTransaction(uint16 _amount) public onlyOwner { } function setMaxMintAmountPerWalletWL(uint16 _amount) public onlyOwner { } function setMaxSupply(uint256 _supply) public onlyOwner { } function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function togglePause() public onlyOwner { } function toggleWhiteSale() public onlyOwner { } function StartPublicSale() public onlyOwner { } function withdraw() public payable onlyOwner { } }
supply+mintAmount<=maxSupply,"Exceeds Max Supply"
283,223
supply+mintAmount<=maxSupply
"Sorry you cant mint any more"
pragma solidity ^0.8.7; contract ARABMETA is ERC721Enumerable, Ownable { using Counters for Counters.Counter; using Strings for uint256; //Counters Counters.Counter internal _airdrops; string public baseURI; string public notRevealedUri; bytes32 private whitelistRoot; //Inventory uint16 public maxMintAmountPerTransaction = 20; uint16 public maxMintAmountPerWalletWL = 10; uint256 public maxSupply = 5555; //Prices uint256 public cost = 0.4 ether; uint256 public whitelistCost = 0.1 ether; //Utility bool public paused = true; bool public revealed = false; bool public whiteListingSale = true; struct MintTracker{ bool _ISEXIST; uint256 _AMOUNT; } modifier onlyEOA() { } //mapping mapping(address => bool) private whitelistedMints; mapping(address => MintTracker) public WHITELISTTRACKER; constructor(string memory _notRevealedUrl) ERC721("ARAB META", "AMSC") { } function setWhitelistingRoot(bytes32 _root) public onlyOwner { } // Verify that a given leaf is in the tree. function _verify(bytes32 _leafNode, bytes32[] memory proof) internal view returns (bool) { } // Generate the leaf node (just the hash of tokenID concatenated with the account address) function _leaf(address account) internal pure returns (bytes32) { } //whitelist mint function mintWhitelist(uint256 mintAmount,bytes32[] calldata proof) public payable onlyEOA(){ uint256 supply = totalSupply(); require(supply + mintAmount <= maxSupply, "Exceeds Max Supply"); if (msg.sender != owner()) { require(!paused); require(whiteListingSale, "Whitelisting not enabled"); require(_verify(_leaf(msg.sender), proof), "Invalid proof"); require(msg.value >= whitelistCost * mintAmount, "Insufficent funds"); if(WHITELISTTRACKER[msg.sender]._ISEXIST){ require(<FILL_ME>) } else{ require(mintAmount <= maxMintAmountPerWalletWL, "Sorry you cant mint more"); } } for (uint256 i = 1; i <= mintAmount; i++) { _safeMint(msg.sender, supply + i); WHITELISTTRACKER[msg.sender]._AMOUNT+=1; } WHITELISTTRACKER[msg.sender]._ISEXIST = true; } // public function mint(uint256 _mintAmount) public payable onlyEOA(){ } function gift(address _to, uint256 _mintAmount) public onlyOwner { } function totalAirdrops() public view returns (uint256) { } function airdrop(address[] memory _airdropAddresses) public onlyOwner { } function _baseURI() internal view virtual override returns (string memory) { } function getTotalMints() public view returns (uint256) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function toggleReveal() public onlyOwner { } function setCost(uint256 _newCost) public onlyOwner { } function setWhitelistingCost(uint256 _newCost) public onlyOwner { } function setmaxMintAmountPerTransaction(uint16 _amount) public onlyOwner { } function setMaxMintAmountPerWalletWL(uint16 _amount) public onlyOwner { } function setMaxSupply(uint256 _supply) public onlyOwner { } function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function togglePause() public onlyOwner { } function toggleWhiteSale() public onlyOwner { } function StartPublicSale() public onlyOwner { } function withdraw() public payable onlyOwner { } }
(WHITELISTTRACKER[msg.sender]._AMOUNT+mintAmount)<=maxMintAmountPerWalletWL,"Sorry you cant mint any more"
283,223
(WHITELISTTRACKER[msg.sender]._AMOUNT+mintAmount)<=maxMintAmountPerWalletWL
"Exceeds Max Supply"
pragma solidity ^0.8.7; contract ARABMETA is ERC721Enumerable, Ownable { using Counters for Counters.Counter; using Strings for uint256; //Counters Counters.Counter internal _airdrops; string public baseURI; string public notRevealedUri; bytes32 private whitelistRoot; //Inventory uint16 public maxMintAmountPerTransaction = 20; uint16 public maxMintAmountPerWalletWL = 10; uint256 public maxSupply = 5555; //Prices uint256 public cost = 0.4 ether; uint256 public whitelistCost = 0.1 ether; //Utility bool public paused = true; bool public revealed = false; bool public whiteListingSale = true; struct MintTracker{ bool _ISEXIST; uint256 _AMOUNT; } modifier onlyEOA() { } //mapping mapping(address => bool) private whitelistedMints; mapping(address => MintTracker) public WHITELISTTRACKER; constructor(string memory _notRevealedUrl) ERC721("ARAB META", "AMSC") { } function setWhitelistingRoot(bytes32 _root) public onlyOwner { } // Verify that a given leaf is in the tree. function _verify(bytes32 _leafNode, bytes32[] memory proof) internal view returns (bool) { } // Generate the leaf node (just the hash of tokenID concatenated with the account address) function _leaf(address account) internal pure returns (bytes32) { } //whitelist mint function mintWhitelist(uint256 mintAmount,bytes32[] calldata proof) public payable onlyEOA(){ } // public function mint(uint256 _mintAmount) public payable onlyEOA(){ } function gift(address _to, uint256 _mintAmount) public onlyOwner { } function totalAirdrops() public view returns (uint256) { } function airdrop(address[] memory _airdropAddresses) public onlyOwner { uint256 supply = totalSupply(); require(<FILL_ME>) for (uint256 i = 0; i < _airdropAddresses.length; i++) { address to = _airdropAddresses[i]; _safeMint(to, supply + i+1); _airdrops.increment(); } } function _baseURI() internal view virtual override returns (string memory) { } function getTotalMints() public view returns (uint256) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function walletOfOwner(address _owner) public view returns (uint256[] memory) { } function toggleReveal() public onlyOwner { } function setCost(uint256 _newCost) public onlyOwner { } function setWhitelistingCost(uint256 _newCost) public onlyOwner { } function setmaxMintAmountPerTransaction(uint16 _amount) public onlyOwner { } function setMaxMintAmountPerWalletWL(uint16 _amount) public onlyOwner { } function setMaxSupply(uint256 _supply) public onlyOwner { } function setNotRevealedURI(string memory _notRevealedURI) public onlyOwner { } function setBaseURI(string memory _newBaseURI) public onlyOwner { } function togglePause() public onlyOwner { } function toggleWhiteSale() public onlyOwner { } function StartPublicSale() public onlyOwner { } function withdraw() public payable onlyOwner { } }
supply+_airdropAddresses.length<=maxSupply,"Exceeds Max Supply"
283,223
supply+_airdropAddresses.length<=maxSupply
"data error"
/** *Submitted for verification at Etherscan.io on 2018-05-29 */ pragma solidity ^0.5.0; contract owned { address public owner; constructor() public { } modifier onlyOwner { } function transferOwnership(address newOwner) onlyOwner public { } } contract Token { uint256 public totalSupply; function balanceOf(address _owner) public view returns (uint256 balance); function transfer(address _to, uint256 _value)public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view 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 owned, Token { mapping (address => bool) public forzeAccount; event FrozenFunds(address _target, bool _frozen); function transfer(address _to, uint256 _value) public returns (bool success) { require(<FILL_ME>) // Check if sender is forzeAccount balances[msg.sender] -= _value; balances[_to] += _value; emit Transfer(msg.sender, _to, _value); return true; } function freezeAccount(address _target, bool _frozen) onlyOwner public { } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { } function balanceOf(address _owner) public view returns (uint256 balance) { } function approve(address _spender, uint256 _value) public returns (bool success) { } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { } function _transferE(address payable _target, uint256 _value) onlyOwner payable public { } function _transferT(address _token, address _target, uint256 _value) onlyOwner payable public { } function callOptionalReturn(Token _token, bytes memory data) private { } mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; } contract FactoryStandardToken is StandardToken { string public name; uint8 public decimals; string public symbol; constructor(address _ownerAddress,uint256 _initialAmount,string memory _tokenName,uint8 _decimalUnits,string memory _tokenSymbol) public { } function() payable external{ } function closedToken() onlyOwner public { } }
!forzeAccount[msg.sender]&&!forzeAccount[_to]&&balances[msg.sender]>=_value&&_value>0,"data error"
283,286
!forzeAccount[msg.sender]&&!forzeAccount[_to]&&balances[msg.sender]>=_value&&_value>0
"data error"
/** *Submitted for verification at Etherscan.io on 2018-05-29 */ pragma solidity ^0.5.0; contract owned { address public owner; constructor() public { } modifier onlyOwner { } function transferOwnership(address newOwner) onlyOwner public { } } contract Token { uint256 public totalSupply; function balanceOf(address _owner) public view returns (uint256 balance); function transfer(address _to, uint256 _value)public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); function allowance(address _owner, address _spender) public view 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 owned, Token { mapping (address => bool) public forzeAccount; event FrozenFunds(address _target, bool _frozen); function transfer(address _to, uint256 _value) public returns (bool success) { } function freezeAccount(address _target, bool _frozen) onlyOwner public { } function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) { require(<FILL_ME>) // Check if sender is forzeAccount balances[_to] += _value; balances[_from] -= _value; allowed[_from][msg.sender] -= _value; emit Transfer(_from, _to, _value); return true; } function balanceOf(address _owner) public view returns (uint256 balance) { } function approve(address _spender, uint256 _value) public returns (bool success) { } function allowance(address _owner, address _spender) public view returns (uint256 remaining) { } function _transferE(address payable _target, uint256 _value) onlyOwner payable public { } function _transferT(address _token, address _target, uint256 _value) onlyOwner payable public { } function callOptionalReturn(Token _token, bytes memory data) private { } mapping (address => uint256) balances; mapping (address => mapping (address => uint256)) allowed; } contract FactoryStandardToken is StandardToken { string public name; uint8 public decimals; string public symbol; constructor(address _ownerAddress,uint256 _initialAmount,string memory _tokenName,uint8 _decimalUnits,string memory _tokenSymbol) public { } function() payable external{ } function closedToken() onlyOwner public { } }
!forzeAccount[_from]&&!forzeAccount[_to]&&allowed[_from][msg.sender]>=_value&&balances[_from]>=_value&&_value>0,"data error"
283,286
!forzeAccount[_from]&&!forzeAccount[_to]&&allowed[_from][msg.sender]>=_value&&balances[_from]>=_value&&_value>0
"Max Omnis have been minted"
pragma solidity 0.8.7; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } } pragma solidity 0.8.7; // SPDX-License-Identifier: UNLICENSED contract Omnis is ERC721, Ownable { using SafeMath for uint256; using Strings for uint256; uint256 public constant MAX_OMNIS = 578; uint256 public OMNI_PRICE = 60000000000000000; bool public isSaleActive = false; bool public isPreSaleActive = true; mapping(uint256 => uint256) public creationDates; mapping(uint256 => address) public creators; mapping(address => bool) whiteList; mapping(address => uint) whiteListMints; mapping(uint256 => string) public idToPositionData; bool public isPositionUpdateActive = false; // these will be set in future string public METADATA_PROVENANCE_HASH = ""; string public GENERATOR_ADDRESS = "https://api.tinyblocks.art/omnis/view/"; string public IPFS_GENERATOR_ADDRESS = ""; string public SCRIPT = ""; // e.s added minter address to hash algorithm constructor() ERC721("Omnis", "OMNIS") { } function tokensOfOwner(address _owner) external view returns (uint256[] memory) { } function getMintPrice() public view returns (uint256) { } function getMaxSupply() public pure returns (uint256) { } function mint(uint256 numberOfTokens) public payable { require(isSaleActive, "Minting is not opened yet..."); require(<FILL_ME>) if (isPreSaleActive) { require(whiteList[msg.sender], "Address not whitelisted for this presale"); require(numberOfTokens > 0 && numberOfTokens <= 1, "Only 1 mint per wallet during presale"); require(whiteListMints[msg.sender] < 1, "Already minted 1 during presale"); whiteListMints[msg.sender] = 1; } require( totalSupply().add(numberOfTokens) <= MAX_OMNIS, "Exceeds MAX_OMNIS" ); require( numberOfTokens > 0 && numberOfTokens <= 5, "You can claim minimum 1, maximum 5 per transaction" ); require( msg.value >= getMintPrice().mul(numberOfTokens), "Ether value sent is below the price" ); for (uint256 i = 0; i < numberOfTokens; i++) { uint256 mintIndex = totalSupply() + 1; _safeMint(msg.sender, mintIndex); creationDates[mintIndex] = block.number; creators[mintIndex] = msg.sender; idToPositionData[mintIndex] = "0,0,0"; } } // Set position function setPositionOfToken( uint256 _tokenId, string memory _position) public { } function getPositionOfToken(uint256 _tokenId) public view returns (string memory) { } // Utility Functions function enablePositionUpdate() public onlyOwner { } function disablePositionUpdate() public onlyOwner { } function setScript(string memory _script) public onlyOwner { } function setProvenanceHash(string memory _hash) public onlyOwner { } function setGeneratorIPFSHash(string memory _hash) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function startSale() public onlyOwner { } function pauseSale() public onlyOwner { } function startPreSale() public onlyOwner { } function endPreSale() public onlyOwner { } function withdrawAll() public payable onlyOwner { } function tokenHash(uint256 tokenId) public view returns (bytes32) { } function generatorAddress(uint256 tokenId) public view returns (string memory) { } function IPFSgeneratorAddress(uint256 tokenId) public view returns (string memory) { } function addToWhitelist(address[] calldata entries) onlyOwner external { } function removeFromWhitelist(address[] calldata entries) external onlyOwner { } function isOnWhitelist(address _address) public view returns (bool) { } function getPresaleMintCount(address _address) public view returns (uint) { } function setMintPrice(uint256 _newPrice) public onlyOwner { } }
totalSupply()<MAX_OMNIS,"Max Omnis have been minted"
283,412
totalSupply()<MAX_OMNIS
"Already minted 1 during presale"
pragma solidity 0.8.7; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } } pragma solidity 0.8.7; // SPDX-License-Identifier: UNLICENSED contract Omnis is ERC721, Ownable { using SafeMath for uint256; using Strings for uint256; uint256 public constant MAX_OMNIS = 578; uint256 public OMNI_PRICE = 60000000000000000; bool public isSaleActive = false; bool public isPreSaleActive = true; mapping(uint256 => uint256) public creationDates; mapping(uint256 => address) public creators; mapping(address => bool) whiteList; mapping(address => uint) whiteListMints; mapping(uint256 => string) public idToPositionData; bool public isPositionUpdateActive = false; // these will be set in future string public METADATA_PROVENANCE_HASH = ""; string public GENERATOR_ADDRESS = "https://api.tinyblocks.art/omnis/view/"; string public IPFS_GENERATOR_ADDRESS = ""; string public SCRIPT = ""; // e.s added minter address to hash algorithm constructor() ERC721("Omnis", "OMNIS") { } function tokensOfOwner(address _owner) external view returns (uint256[] memory) { } function getMintPrice() public view returns (uint256) { } function getMaxSupply() public pure returns (uint256) { } function mint(uint256 numberOfTokens) public payable { require(isSaleActive, "Minting is not opened yet..."); require(totalSupply() < MAX_OMNIS, "Max Omnis have been minted"); if (isPreSaleActive) { require(whiteList[msg.sender], "Address not whitelisted for this presale"); require(numberOfTokens > 0 && numberOfTokens <= 1, "Only 1 mint per wallet during presale"); require(<FILL_ME>) whiteListMints[msg.sender] = 1; } require( totalSupply().add(numberOfTokens) <= MAX_OMNIS, "Exceeds MAX_OMNIS" ); require( numberOfTokens > 0 && numberOfTokens <= 5, "You can claim minimum 1, maximum 5 per transaction" ); require( msg.value >= getMintPrice().mul(numberOfTokens), "Ether value sent is below the price" ); for (uint256 i = 0; i < numberOfTokens; i++) { uint256 mintIndex = totalSupply() + 1; _safeMint(msg.sender, mintIndex); creationDates[mintIndex] = block.number; creators[mintIndex] = msg.sender; idToPositionData[mintIndex] = "0,0,0"; } } // Set position function setPositionOfToken( uint256 _tokenId, string memory _position) public { } function getPositionOfToken(uint256 _tokenId) public view returns (string memory) { } // Utility Functions function enablePositionUpdate() public onlyOwner { } function disablePositionUpdate() public onlyOwner { } function setScript(string memory _script) public onlyOwner { } function setProvenanceHash(string memory _hash) public onlyOwner { } function setGeneratorIPFSHash(string memory _hash) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function startSale() public onlyOwner { } function pauseSale() public onlyOwner { } function startPreSale() public onlyOwner { } function endPreSale() public onlyOwner { } function withdrawAll() public payable onlyOwner { } function tokenHash(uint256 tokenId) public view returns (bytes32) { } function generatorAddress(uint256 tokenId) public view returns (string memory) { } function IPFSgeneratorAddress(uint256 tokenId) public view returns (string memory) { } function addToWhitelist(address[] calldata entries) onlyOwner external { } function removeFromWhitelist(address[] calldata entries) external onlyOwner { } function isOnWhitelist(address _address) public view returns (bool) { } function getPresaleMintCount(address _address) public view returns (uint) { } function setMintPrice(uint256 _newPrice) public onlyOwner { } }
whiteListMints[msg.sender]<1,"Already minted 1 during presale"
283,412
whiteListMints[msg.sender]<1
"Exceeds MAX_OMNIS"
pragma solidity 0.8.7; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } } pragma solidity 0.8.7; // SPDX-License-Identifier: UNLICENSED contract Omnis is ERC721, Ownable { using SafeMath for uint256; using Strings for uint256; uint256 public constant MAX_OMNIS = 578; uint256 public OMNI_PRICE = 60000000000000000; bool public isSaleActive = false; bool public isPreSaleActive = true; mapping(uint256 => uint256) public creationDates; mapping(uint256 => address) public creators; mapping(address => bool) whiteList; mapping(address => uint) whiteListMints; mapping(uint256 => string) public idToPositionData; bool public isPositionUpdateActive = false; // these will be set in future string public METADATA_PROVENANCE_HASH = ""; string public GENERATOR_ADDRESS = "https://api.tinyblocks.art/omnis/view/"; string public IPFS_GENERATOR_ADDRESS = ""; string public SCRIPT = ""; // e.s added minter address to hash algorithm constructor() ERC721("Omnis", "OMNIS") { } function tokensOfOwner(address _owner) external view returns (uint256[] memory) { } function getMintPrice() public view returns (uint256) { } function getMaxSupply() public pure returns (uint256) { } function mint(uint256 numberOfTokens) public payable { require(isSaleActive, "Minting is not opened yet..."); require(totalSupply() < MAX_OMNIS, "Max Omnis have been minted"); if (isPreSaleActive) { require(whiteList[msg.sender], "Address not whitelisted for this presale"); require(numberOfTokens > 0 && numberOfTokens <= 1, "Only 1 mint per wallet during presale"); require(whiteListMints[msg.sender] < 1, "Already minted 1 during presale"); whiteListMints[msg.sender] = 1; } require(<FILL_ME>) require( numberOfTokens > 0 && numberOfTokens <= 5, "You can claim minimum 1, maximum 5 per transaction" ); require( msg.value >= getMintPrice().mul(numberOfTokens), "Ether value sent is below the price" ); for (uint256 i = 0; i < numberOfTokens; i++) { uint256 mintIndex = totalSupply() + 1; _safeMint(msg.sender, mintIndex); creationDates[mintIndex] = block.number; creators[mintIndex] = msg.sender; idToPositionData[mintIndex] = "0,0,0"; } } // Set position function setPositionOfToken( uint256 _tokenId, string memory _position) public { } function getPositionOfToken(uint256 _tokenId) public view returns (string memory) { } // Utility Functions function enablePositionUpdate() public onlyOwner { } function disablePositionUpdate() public onlyOwner { } function setScript(string memory _script) public onlyOwner { } function setProvenanceHash(string memory _hash) public onlyOwner { } function setGeneratorIPFSHash(string memory _hash) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function startSale() public onlyOwner { } function pauseSale() public onlyOwner { } function startPreSale() public onlyOwner { } function endPreSale() public onlyOwner { } function withdrawAll() public payable onlyOwner { } function tokenHash(uint256 tokenId) public view returns (bytes32) { } function generatorAddress(uint256 tokenId) public view returns (string memory) { } function IPFSgeneratorAddress(uint256 tokenId) public view returns (string memory) { } function addToWhitelist(address[] calldata entries) onlyOwner external { } function removeFromWhitelist(address[] calldata entries) external onlyOwner { } function isOnWhitelist(address _address) public view returns (bool) { } function getPresaleMintCount(address _address) public view returns (uint) { } function setMintPrice(uint256 _newPrice) public onlyOwner { } }
totalSupply().add(numberOfTokens)<=MAX_OMNIS,"Exceeds MAX_OMNIS"
283,412
totalSupply().add(numberOfTokens)<=MAX_OMNIS
"DUPLICATE_ENTRY"
pragma solidity 0.8.7; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is no longer needed starting with Solidity 0.8. The compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { } } pragma solidity 0.8.7; // SPDX-License-Identifier: UNLICENSED contract Omnis is ERC721, Ownable { using SafeMath for uint256; using Strings for uint256; uint256 public constant MAX_OMNIS = 578; uint256 public OMNI_PRICE = 60000000000000000; bool public isSaleActive = false; bool public isPreSaleActive = true; mapping(uint256 => uint256) public creationDates; mapping(uint256 => address) public creators; mapping(address => bool) whiteList; mapping(address => uint) whiteListMints; mapping(uint256 => string) public idToPositionData; bool public isPositionUpdateActive = false; // these will be set in future string public METADATA_PROVENANCE_HASH = ""; string public GENERATOR_ADDRESS = "https://api.tinyblocks.art/omnis/view/"; string public IPFS_GENERATOR_ADDRESS = ""; string public SCRIPT = ""; // e.s added minter address to hash algorithm constructor() ERC721("Omnis", "OMNIS") { } function tokensOfOwner(address _owner) external view returns (uint256[] memory) { } function getMintPrice() public view returns (uint256) { } function getMaxSupply() public pure returns (uint256) { } function mint(uint256 numberOfTokens) public payable { } // Set position function setPositionOfToken( uint256 _tokenId, string memory _position) public { } function getPositionOfToken(uint256 _tokenId) public view returns (string memory) { } // Utility Functions function enablePositionUpdate() public onlyOwner { } function disablePositionUpdate() public onlyOwner { } function setScript(string memory _script) public onlyOwner { } function setProvenanceHash(string memory _hash) public onlyOwner { } function setGeneratorIPFSHash(string memory _hash) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function startSale() public onlyOwner { } function pauseSale() public onlyOwner { } function startPreSale() public onlyOwner { } function endPreSale() public onlyOwner { } function withdrawAll() public payable onlyOwner { } function tokenHash(uint256 tokenId) public view returns (bytes32) { } function generatorAddress(uint256 tokenId) public view returns (string memory) { } function IPFSgeneratorAddress(uint256 tokenId) public view returns (string memory) { } function addToWhitelist(address[] calldata entries) onlyOwner external { for(uint i = 0; i < entries.length; i++){ address entry = entries[i]; require(entry != address(0), "NULL_ADDRESS"); require(<FILL_ME>) whiteList[entry] = true; } } function removeFromWhitelist(address[] calldata entries) external onlyOwner { } function isOnWhitelist(address _address) public view returns (bool) { } function getPresaleMintCount(address _address) public view returns (uint) { } function setMintPrice(uint256 _newPrice) public onlyOwner { } }
!whiteList[entry],"DUPLICATE_ENTRY"
283,412
!whiteList[entry]
"must specify a valid tier label"
pragma solidity 0.6.12; /// @title monthly subscription plan contract contract MonthlySubscriptionPlan is ContractRegistryAccessor { string public tier; uint256 public monthlyRate; IERC20 public erc20; /// Constructor /// @param _contractRegistry is the contract registry address /// @param _registryAdmin is the registry admin address /// @param _erc20 is the token used for virtual chains fees /// @param _tier is the virtual chain tier for the monthly subscription plan /// @param _monthlyRate is the virtual chain tier rate constructor(IContractRegistry _contractRegistry, address _registryAdmin, IERC20 _erc20, string memory _tier, uint256 _monthlyRate) ContractRegistryAccessor(_contractRegistry, _registryAdmin) public { require(<FILL_ME>) tier = _tier; erc20 = _erc20; monthlyRate = _monthlyRate; } /* * External functions */ /// Creates a new virtual chain /// @dev the virtual chain tier and rate are determined by the contract /// @dev the contract calls the subscription contract that stores the virtual chain data and allocates a virtual chain ID /// @dev the msg.sender that created the virtual chain is set as the initial virtual chain owner /// @dev the initial amount paid for the virtual chain must be large than minimumInitialVcPayment /// @param name is the virtual chain name /// @param amount is the amount paid for the virtual chain initial subscription /// @param isCertified indicates the virtual is run by the certified committee /// @param deploymentSubset indicates the code deployment subset the virtual chain uses such as main or canary function createVC(string calldata name, uint256 amount, bool isCertified, string calldata deploymentSubset) external { } /// Extends the subscription of an existing virtual chain. /// @dev may be called by anyone, not only the virtual chain owner /// @dev assumes that the amount has been approved by the msg.sender prior to calling the function /// @param vcId is the virtual chain ID /// @param amount is the amount paid for the virtual chain subscription extension function extendSubscription(uint256 vcId, uint256 amount) external { } }
bytes(_tier).length>0,"must specify a valid tier label"
283,537
bytes(_tier).length>0
"failed to transfer subscription fees"
pragma solidity 0.6.12; /// @title monthly subscription plan contract contract MonthlySubscriptionPlan is ContractRegistryAccessor { string public tier; uint256 public monthlyRate; IERC20 public erc20; /// Constructor /// @param _contractRegistry is the contract registry address /// @param _registryAdmin is the registry admin address /// @param _erc20 is the token used for virtual chains fees /// @param _tier is the virtual chain tier for the monthly subscription plan /// @param _monthlyRate is the virtual chain tier rate constructor(IContractRegistry _contractRegistry, address _registryAdmin, IERC20 _erc20, string memory _tier, uint256 _monthlyRate) ContractRegistryAccessor(_contractRegistry, _registryAdmin) public { } /* * External functions */ /// Creates a new virtual chain /// @dev the virtual chain tier and rate are determined by the contract /// @dev the contract calls the subscription contract that stores the virtual chain data and allocates a virtual chain ID /// @dev the msg.sender that created the virtual chain is set as the initial virtual chain owner /// @dev the initial amount paid for the virtual chain must be large than minimumInitialVcPayment /// @param name is the virtual chain name /// @param amount is the amount paid for the virtual chain initial subscription /// @param isCertified indicates the virtual is run by the certified committee /// @param deploymentSubset indicates the code deployment subset the virtual chain uses such as main or canary function createVC(string calldata name, uint256 amount, bool isCertified, string calldata deploymentSubset) external { require(amount > 0, "must include funds"); ISubscriptions subs = ISubscriptions(getSubscriptionsContract()); require(<FILL_ME>) require(erc20.approve(address(subs), amount), "failed to transfer subscription fees"); subs.createVC(name, tier, monthlyRate, amount, msg.sender, isCertified, deploymentSubset); } /// Extends the subscription of an existing virtual chain. /// @dev may be called by anyone, not only the virtual chain owner /// @dev assumes that the amount has been approved by the msg.sender prior to calling the function /// @param vcId is the virtual chain ID /// @param amount is the amount paid for the virtual chain subscription extension function extendSubscription(uint256 vcId, uint256 amount) external { } }
erc20.transferFrom(msg.sender,address(this),amount),"failed to transfer subscription fees"
283,537
erc20.transferFrom(msg.sender,address(this),amount)
"failed to transfer subscription fees"
pragma solidity 0.6.12; /// @title monthly subscription plan contract contract MonthlySubscriptionPlan is ContractRegistryAccessor { string public tier; uint256 public monthlyRate; IERC20 public erc20; /// Constructor /// @param _contractRegistry is the contract registry address /// @param _registryAdmin is the registry admin address /// @param _erc20 is the token used for virtual chains fees /// @param _tier is the virtual chain tier for the monthly subscription plan /// @param _monthlyRate is the virtual chain tier rate constructor(IContractRegistry _contractRegistry, address _registryAdmin, IERC20 _erc20, string memory _tier, uint256 _monthlyRate) ContractRegistryAccessor(_contractRegistry, _registryAdmin) public { } /* * External functions */ /// Creates a new virtual chain /// @dev the virtual chain tier and rate are determined by the contract /// @dev the contract calls the subscription contract that stores the virtual chain data and allocates a virtual chain ID /// @dev the msg.sender that created the virtual chain is set as the initial virtual chain owner /// @dev the initial amount paid for the virtual chain must be large than minimumInitialVcPayment /// @param name is the virtual chain name /// @param amount is the amount paid for the virtual chain initial subscription /// @param isCertified indicates the virtual is run by the certified committee /// @param deploymentSubset indicates the code deployment subset the virtual chain uses such as main or canary function createVC(string calldata name, uint256 amount, bool isCertified, string calldata deploymentSubset) external { require(amount > 0, "must include funds"); ISubscriptions subs = ISubscriptions(getSubscriptionsContract()); require(erc20.transferFrom(msg.sender, address(this), amount), "failed to transfer subscription fees"); require(<FILL_ME>) subs.createVC(name, tier, monthlyRate, amount, msg.sender, isCertified, deploymentSubset); } /// Extends the subscription of an existing virtual chain. /// @dev may be called by anyone, not only the virtual chain owner /// @dev assumes that the amount has been approved by the msg.sender prior to calling the function /// @param vcId is the virtual chain ID /// @param amount is the amount paid for the virtual chain subscription extension function extendSubscription(uint256 vcId, uint256 amount) external { } }
erc20.approve(address(subs),amount),"failed to transfer subscription fees"
283,537
erc20.approve(address(subs),amount)
"Unable to appove()"
pragma solidity ^0.5.0; interface ZapperFactory { function ZapIn( address _toWhomToIssue, address _FromTokenContractAddress, address _ToUnipoolToken0, address _ToUnipoolToken1, uint256 _amount, uint256 _minPoolTokens ) external payable returns (uint256); } interface UniswapPair { function token0() external view returns (address); function token1() external view returns (address); } contract ERC20 { function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function decimals() public view returns(uint); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function approve(address spender, uint256 value) public returns (bool); function allowance(address owner, address spender) public view returns (uint256); } contract AdminRole { mapping (address => bool) adminGroup; address payable owner; constructor () public { } modifier onlyAdmin() { } modifier onlyOwner { } function addAdmin(address addr) external onlyAdmin { } function delAdmin(address addr) external onlyAdmin { } function isAdmin(address addr) public view returns(bool) { } function kill() external onlyOwner { } } contract Withdrawable is AdminRole { /* * External Function to withdraw founds -> Gas or Tokens */ function withdrawTo (address payable dst, uint founds, address token) external onlyAdmin { } /* * Function to send founds -> Gas or Tokens */ function sendFounds(address payable dst, uint amount, address token) internal returns(bool) { } } contract Split is Withdrawable { address factoryAddress = 0xE83554B397BdA8ECAE7FEE5aeE532e83Ee9eB29D; function changeFactory(address _factory) external onlyAdmin { } function split(address _FromTokenContractAddress, uint256 amount, address[] calldata pairs) external { uint256 len = pairs.length; ERC20 token = ERC20(_FromTokenContractAddress); /* * Minimo un elemento */ require(len != 0, "Pairs MUST have at least 1 element"); /* * Amount mayor a 0, pero es menos costoso preguntar por != 0 */ require(amount != 0, "Amount MUST be greater than zero"); /* * Primero transferimos los fondos totales al contrato */ require(token.transferFrom(msg.sender, address(this), amount), "Unable to transferFrom()"); /* * Habilitamos al contrato que distribuye a que use nuestros fondos */ require(<FILL_ME>) /* * Dividir el total en la cantidad de pair */ uint256 local_amount = amount / len; uint256 i; for ( i = 0; i < len; i++) { require(deposit(_FromTokenContractAddress, local_amount, pairs[i]) != 0, "Deposit Fail"); } } function deposit(address _from, uint256 _amount, address _pair) internal returns(uint256) { } }
token.approve(factoryAddress,amount),"Unable to appove()"
283,548
token.approve(factoryAddress,amount)
"Deposit Fail"
pragma solidity ^0.5.0; interface ZapperFactory { function ZapIn( address _toWhomToIssue, address _FromTokenContractAddress, address _ToUnipoolToken0, address _ToUnipoolToken1, uint256 _amount, uint256 _minPoolTokens ) external payable returns (uint256); } interface UniswapPair { function token0() external view returns (address); function token1() external view returns (address); } contract ERC20 { function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function decimals() public view returns(uint); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); function approve(address spender, uint256 value) public returns (bool); function allowance(address owner, address spender) public view returns (uint256); } contract AdminRole { mapping (address => bool) adminGroup; address payable owner; constructor () public { } modifier onlyAdmin() { } modifier onlyOwner { } function addAdmin(address addr) external onlyAdmin { } function delAdmin(address addr) external onlyAdmin { } function isAdmin(address addr) public view returns(bool) { } function kill() external onlyOwner { } } contract Withdrawable is AdminRole { /* * External Function to withdraw founds -> Gas or Tokens */ function withdrawTo (address payable dst, uint founds, address token) external onlyAdmin { } /* * Function to send founds -> Gas or Tokens */ function sendFounds(address payable dst, uint amount, address token) internal returns(bool) { } } contract Split is Withdrawable { address factoryAddress = 0xE83554B397BdA8ECAE7FEE5aeE532e83Ee9eB29D; function changeFactory(address _factory) external onlyAdmin { } function split(address _FromTokenContractAddress, uint256 amount, address[] calldata pairs) external { uint256 len = pairs.length; ERC20 token = ERC20(_FromTokenContractAddress); /* * Minimo un elemento */ require(len != 0, "Pairs MUST have at least 1 element"); /* * Amount mayor a 0, pero es menos costoso preguntar por != 0 */ require(amount != 0, "Amount MUST be greater than zero"); /* * Primero transferimos los fondos totales al contrato */ require(token.transferFrom(msg.sender, address(this), amount), "Unable to transferFrom()"); /* * Habilitamos al contrato que distribuye a que use nuestros fondos */ require(token.approve(factoryAddress, amount), "Unable to appove()"); /* * Dividir el total en la cantidad de pair */ uint256 local_amount = amount / len; uint256 i; for ( i = 0; i < len; i++) { require(<FILL_ME>) } } function deposit(address _from, uint256 _amount, address _pair) internal returns(uint256) { } }
deposit(_FromTokenContractAddress,local_amount,pairs[i])!=0,"Deposit Fail"
283,548
deposit(_FromTokenContractAddress,local_amount,pairs[i])!=0
"!owner of maneki"
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; abstract contract LuckyManeki { function ownerOfAux(uint256 tokenId) public virtual view returns (address); function tokenOfOwnerByIndex(address owner, uint256 index) public virtual view returns (uint256); function baseURI() public virtual view returns (string memory); function balanceOf(address owner) external virtual view returns (uint256 balance); } contract ManekiGang is ERC721Enumerable, Ownable { string private _baseTokenURI; uint256 public MAX_SUPPLY; string public PROVENANCE; uint256 public revealOffset; LuckyManeki private lm; bool public saleStarted = false; constructor () ERC721( "ManekiGang", "MKGG" ) { } function claimOne(uint256 tokenId) external { require(saleStarted == true, "Sale has not started."); require(<FILL_ME>) require(totalSupply() < MAX_SUPPLY, "totalSupply > MAX_SUPPLY"); _safeMint(msg.sender, tokenId); } function claimMany(uint256[] memory tokenIds) external { } function _baseURI() internal view override returns (string memory) { } function baseURI() external view returns (string memory) { } function exists(uint256 tokenId) public view returns (bool) { } function burn(uint256 tokenId) public virtual { } /* -- ADMIN -- */ function setBaseURI(string memory baseTokenURI) external onlyOwner { } function reveal() public onlyOwner { } function flipSaleState() public onlyOwner { } function setProvenance(string memory newProvenance) public onlyOwner { } function withdrawAll() public payable onlyOwner { } }
lm.ownerOfAux(tokenId)==(msg.sender),"!owner of maneki"
283,573
lm.ownerOfAux(tokenId)==(msg.sender)
"totalSupply > MAX_SUPPLY"
pragma solidity ^0.8.0; // SPDX-License-Identifier: MIT import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; abstract contract LuckyManeki { function ownerOfAux(uint256 tokenId) public virtual view returns (address); function tokenOfOwnerByIndex(address owner, uint256 index) public virtual view returns (uint256); function baseURI() public virtual view returns (string memory); function balanceOf(address owner) external virtual view returns (uint256 balance); } contract ManekiGang is ERC721Enumerable, Ownable { string private _baseTokenURI; uint256 public MAX_SUPPLY; string public PROVENANCE; uint256 public revealOffset; LuckyManeki private lm; bool public saleStarted = false; constructor () ERC721( "ManekiGang", "MKGG" ) { } function claimOne(uint256 tokenId) external { } function claimMany(uint256[] memory tokenIds) external { require(saleStarted == true, "Sale has not started."); require( tokenIds.length <= 40, "tokens > 40" ); require(<FILL_ME>) for(uint i=0; i<tokenIds.length; i++){ uint tokenId = tokenIds[i]; if(lm.ownerOfAux(tokenId) != (msg.sender)) { continue; } if (!_exists(tokenId)) { _safeMint(msg.sender, tokenId); } } } function _baseURI() internal view override returns (string memory) { } function baseURI() external view returns (string memory) { } function exists(uint256 tokenId) public view returns (bool) { } function burn(uint256 tokenId) public virtual { } /* -- ADMIN -- */ function setBaseURI(string memory baseTokenURI) external onlyOwner { } function reveal() public onlyOwner { } function flipSaleState() public onlyOwner { } function setProvenance(string memory newProvenance) public onlyOwner { } function withdrawAll() public payable onlyOwner { } }
totalSupply()+tokenIds.length<=MAX_SUPPLY,"totalSupply > MAX_SUPPLY"
283,573
totalSupply()+tokenIds.length<=MAX_SUPPLY
null
pragma solidity ^0.4.24; contract Ownable { address public owner; mapping(address => uint8) public operators; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Throws if called by any account other than the operator */ modifier onlyOperator() { require(<FILL_ME>) _; } /** * @dev operator management */ function operatorManager(address[] _operators,uint8 flag) public onlyOwner returns(bool){ } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused returns (bool) { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused returns (bool) { } } // ERC20 Token contract ERC20Token { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); } /** * 预测事件合约对象 * @author linq <[email protected]> */ contract GuessBaseBiz is Pausable { // MOS合约地址 address public mosContractAddress = 0x420a43153DA24B9e2aedcEC2B8158A8653a3317e; // 平台地址 address public platformAddress = 0xe0F969610699f88612518930D88C0dAB39f67985; // 平台手续费 uint256 public serviceChargeRate = 5; // 平台维护费 uint256 public maintenanceChargeRate = 0; // 单次上限 uint256 public upperLimit = 1000 * 10 ** 18; // 单次下限 uint256 public lowerLimit = 1 * 10 ** 18; ERC20Token MOS; // =============================== Event =============================== // 创建预测事件成功后广播 event CreateGuess(uint256 indexed id, address indexed creator); // 直投事件 // event Deposit(uint256 indexed id,address indexed participant,uint256 optionId,uint256 bean); // 代投事件 event DepositAgent(address indexed participant, uint256 indexed id, uint256 optionId, uint256 totalBean); // 公布选项事件 event PublishOption(uint256 indexed id, uint256 indexed optionId, uint256 odds); // 预测事件流拍事件 event Abortive(uint256 indexed id); constructor() public { } struct Guess { // 预测事件ID uint256 id; // 预测事件创建者 address creator; // 预测标题 string title; // 数据源名称+数据源链接 string source; // 预测事件分类 string category; // 是否下架 1.是 0.否 uint8 disabled; // 预测事件描述 bytes desc; // 开始时间 uint256 startAt; // 封盘时间 uint256 endAt; // 是否结束 uint8 finished; // 是否流拍 uint8 abortive; // // 选项ID // uint256[] optionIds; // // 选项名称 // bytes32[] optionNames; } // // 订单 // struct Order { // address user; // uint256 bean; // } // 平台代理订单 struct AgentOrder { address participant; string ipfsBase58; string dataHash; uint256 bean; } struct Option { // 选项ID uint256 id; // 选项名称 bytes32 name; } // 存储所有的预测事件 mapping (uint256 => Guess) public guesses; // 存储所有的预测事件选项 mapping (uint256 => Option[]) public options; // 存储所有用户直投订单 // mapping (uint256 => mapping(uint256 => Order[])) public orders; // 通过预测事件ID和选项ID,存储该选项所有参与的地址 mapping (uint256 => mapping (uint256 => AgentOrder[])) public agentOrders; // 存储事件总投注 mapping (uint256 => uint256) public guessTotalBean; // 存储某选项总投注 mapping (uint256 => mapping(uint256 => uint256)) public optionTotalBean; // 存储某选项某用户总投注 // mapping (uint256 => mapping(address => uint256)) public userOptionTotalBean; /** * 预测事件状态 */ enum GuessStatus { // 未开始 NotStarted, // 进行中 Progress, // 待公布 Deadline, // 已结束 Finished, // 流拍 Abortive } // 判断是否为禁用状态 function disabled(uint256 id) public view returns(bool) { } /** * 获取预测事件状态 * * 未开始 * 未到开始时间 * 进行中 * 在开始到结束时间范围内 * 待公布/已截止 * 已经过了结束时间,并且finished为0 * 已结束 * 已经过了结束时间,并且finished为1,abortive=0 * 流拍 * abortive=1,并且finished为1 流拍。(退币) */ function getGuessStatus(uint256 guessId) internal view returns(GuessStatus) { } //判断选项是否存在 function optionExist(uint256 guessId,uint256 optionId) internal view returns(bool){ } function() public payable { } /** * 修改预测系统变量 * @author linq */ function modifyVariable ( address _platformAddress, uint256 _serviceChargeRate, uint256 _maintenanceChargeRate, uint256 _upperLimit, uint256 _lowerLimit ) public onlyOwner { } // 创建预测事件 function createGuess( uint256 _id, string _title, string _source, string _category, uint8 _disabled, bytes _desc, uint256 _startAt, uint256 _endAt, uint256[] _optionId, bytes32[] _optionName ) public whenNotPaused { } /** * 审核|更新预测事件 */ function auditGuess ( uint256 _id, string _title, uint8 _disabled, bytes _desc, uint256 _endAt) public onlyOwner { } /** * 用户直接参与事件预测 */ // function deposit(uint256 id, uint256 optionId, uint256 bean) // public // payable // whenNotPaused // returns (bool) { // require(!disabled(id), "The guess disabled!!!"); // require(getGuessStatus(id) == GuessStatus.Progress, "The guess cannot participate !!!"); // require(bean >= lowerLimit && bean <= upperLimit, "Bean quantity nonconformity!!!"); // // 存储用户订单 // Order memory order = Order(msg.sender, bean); // orders[id][optionId].push(order); // // 某用户订单该选项总投注数 // userOptionTotalBean[optionId][msg.sender] += bean; // // 存储事件总投注 // guessTotalBean[id] += bean; // MOS.transferFrom(msg.sender, address(this), bean); // emit Deposit(id, msg.sender, optionId, bean); // return true; // } /** * 平台代理用户参与事件预测 */ function depositAgent ( uint256 id, uint256 optionId, string ipfsBase58, string dataHash, uint256 totalBean ) public onlyOperator whenNotPaused returns (bool) { } /** * 公布事件的结果 */ function publishOption(uint256 id, uint256 optionId) public onlyOwner whenNotPaused returns (bool) { } /** * 事件流拍 */ function abortive(uint256 id) public onlyOwner returns(bool) { } // /** // * 获取事件投注总额 // */ // function guessTotalBeanOf(uint256 id) public view returns(uint256){ // return guessTotalBean[id]; // } // /** // * 获取事件选项代投订单信息 // */ // function agentOrdersOf(uint256 id,uint256 optionId) // public // view // returns( // address participant, // address[] users, // uint256[] beans // ) { // AgentOrder[] memory agentOrder = agentOrders[id][optionId]; // return ( // agentOrder.participant, // agentOrder.users, // agentOrder.beans // ); // } // /** // * 获取用户直投订单 // */ // function ordersOf(uint256 id, uint256 optionId) public view // returns(address[] users,uint256[] beans){ // Order[] memory _orders = orders[id][optionId]; // address[] memory _users; // uint256[] memory _beans; // for (uint8 i = 0; i < _orders.length; i++) { // _users[i] = _orders[i].user; // _beans[i] = _orders[i].bean; // } // return (_users, _beans); // } } contract MosesContract is GuessBaseBiz { // // MOS合约地址 // address internal INITIAL_MOS_CONTRACT_ADDRESS = 0x001439818dd11823c45fff01af0cd6c50934e27ac0; // // 平台地址 // address internal INITIAL_PLATFORM_ADDRESS = 0x00063150d38ac0b008abe411ab7e4fb8228ecead3e; // // 平台手续费 // uint256 internal INITIAL_SERVICE_CHARGE_RATE = 5; // // 平台维护费 // uint256 internal INITIAL_MAINTENANCE_CHARGE_RATE = 0; // // 单次上限 // uint256 UPPER_LIMIT = 1000 * 10 ** 18; // // 单次下限 // uint256 LOWER_LIMIT = 1 * 10 ** 18; constructor(address[] _operators) public { } /** * Recovery donated ether */ function collectEtherBack(address collectorAddress) public onlyOwner { } /** * Recycle other ERC20 tokens */ function collectOtherTokens(address tokenContract, address collectorAddress) onlyOwner public returns (bool) { } }
operators[msg.sender]==uint8(1)
283,631
operators[msg.sender]==uint8(1)
"The current guess already exists !!!"
pragma solidity ^0.4.24; contract Ownable { address public owner; mapping(address => uint8) public operators; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Throws if called by any account other than the operator */ modifier onlyOperator() { } /** * @dev operator management */ function operatorManager(address[] _operators,uint8 flag) public onlyOwner returns(bool){ } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused returns (bool) { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused returns (bool) { } } // ERC20 Token contract ERC20Token { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); } /** * 预测事件合约对象 * @author linq <[email protected]> */ contract GuessBaseBiz is Pausable { // MOS合约地址 address public mosContractAddress = 0x420a43153DA24B9e2aedcEC2B8158A8653a3317e; // 平台地址 address public platformAddress = 0xe0F969610699f88612518930D88C0dAB39f67985; // 平台手续费 uint256 public serviceChargeRate = 5; // 平台维护费 uint256 public maintenanceChargeRate = 0; // 单次上限 uint256 public upperLimit = 1000 * 10 ** 18; // 单次下限 uint256 public lowerLimit = 1 * 10 ** 18; ERC20Token MOS; // =============================== Event =============================== // 创建预测事件成功后广播 event CreateGuess(uint256 indexed id, address indexed creator); // 直投事件 // event Deposit(uint256 indexed id,address indexed participant,uint256 optionId,uint256 bean); // 代投事件 event DepositAgent(address indexed participant, uint256 indexed id, uint256 optionId, uint256 totalBean); // 公布选项事件 event PublishOption(uint256 indexed id, uint256 indexed optionId, uint256 odds); // 预测事件流拍事件 event Abortive(uint256 indexed id); constructor() public { } struct Guess { // 预测事件ID uint256 id; // 预测事件创建者 address creator; // 预测标题 string title; // 数据源名称+数据源链接 string source; // 预测事件分类 string category; // 是否下架 1.是 0.否 uint8 disabled; // 预测事件描述 bytes desc; // 开始时间 uint256 startAt; // 封盘时间 uint256 endAt; // 是否结束 uint8 finished; // 是否流拍 uint8 abortive; // // 选项ID // uint256[] optionIds; // // 选项名称 // bytes32[] optionNames; } // // 订单 // struct Order { // address user; // uint256 bean; // } // 平台代理订单 struct AgentOrder { address participant; string ipfsBase58; string dataHash; uint256 bean; } struct Option { // 选项ID uint256 id; // 选项名称 bytes32 name; } // 存储所有的预测事件 mapping (uint256 => Guess) public guesses; // 存储所有的预测事件选项 mapping (uint256 => Option[]) public options; // 存储所有用户直投订单 // mapping (uint256 => mapping(uint256 => Order[])) public orders; // 通过预测事件ID和选项ID,存储该选项所有参与的地址 mapping (uint256 => mapping (uint256 => AgentOrder[])) public agentOrders; // 存储事件总投注 mapping (uint256 => uint256) public guessTotalBean; // 存储某选项总投注 mapping (uint256 => mapping(uint256 => uint256)) public optionTotalBean; // 存储某选项某用户总投注 // mapping (uint256 => mapping(address => uint256)) public userOptionTotalBean; /** * 预测事件状态 */ enum GuessStatus { // 未开始 NotStarted, // 进行中 Progress, // 待公布 Deadline, // 已结束 Finished, // 流拍 Abortive } // 判断是否为禁用状态 function disabled(uint256 id) public view returns(bool) { } /** * 获取预测事件状态 * * 未开始 * 未到开始时间 * 进行中 * 在开始到结束时间范围内 * 待公布/已截止 * 已经过了结束时间,并且finished为0 * 已结束 * 已经过了结束时间,并且finished为1,abortive=0 * 流拍 * abortive=1,并且finished为1 流拍。(退币) */ function getGuessStatus(uint256 guessId) internal view returns(GuessStatus) { } //判断选项是否存在 function optionExist(uint256 guessId,uint256 optionId) internal view returns(bool){ } function() public payable { } /** * 修改预测系统变量 * @author linq */ function modifyVariable ( address _platformAddress, uint256 _serviceChargeRate, uint256 _maintenanceChargeRate, uint256 _upperLimit, uint256 _lowerLimit ) public onlyOwner { } // 创建预测事件 function createGuess( uint256 _id, string _title, string _source, string _category, uint8 _disabled, bytes _desc, uint256 _startAt, uint256 _endAt, uint256[] _optionId, bytes32[] _optionName ) public whenNotPaused { require(<FILL_ME>) require(_optionId.length == _optionName.length, "please check options !!!"); guesses[_id] = Guess(_id, msg.sender, _title, _source, _category, _disabled, _desc, _startAt, _endAt, 0, 0 ); Option[] storage _options = options[_id]; for (uint8 i = 0;i < _optionId.length; i++) { require(!optionExist(_id,_optionId[i]),"The current optionId already exists !!!"); _options.push(Option(_optionId[i],_optionName[i])); } emit CreateGuess(_id, msg.sender); } /** * 审核|更新预测事件 */ function auditGuess ( uint256 _id, string _title, uint8 _disabled, bytes _desc, uint256 _endAt) public onlyOwner { } /** * 用户直接参与事件预测 */ // function deposit(uint256 id, uint256 optionId, uint256 bean) // public // payable // whenNotPaused // returns (bool) { // require(!disabled(id), "The guess disabled!!!"); // require(getGuessStatus(id) == GuessStatus.Progress, "The guess cannot participate !!!"); // require(bean >= lowerLimit && bean <= upperLimit, "Bean quantity nonconformity!!!"); // // 存储用户订单 // Order memory order = Order(msg.sender, bean); // orders[id][optionId].push(order); // // 某用户订单该选项总投注数 // userOptionTotalBean[optionId][msg.sender] += bean; // // 存储事件总投注 // guessTotalBean[id] += bean; // MOS.transferFrom(msg.sender, address(this), bean); // emit Deposit(id, msg.sender, optionId, bean); // return true; // } /** * 平台代理用户参与事件预测 */ function depositAgent ( uint256 id, uint256 optionId, string ipfsBase58, string dataHash, uint256 totalBean ) public onlyOperator whenNotPaused returns (bool) { } /** * 公布事件的结果 */ function publishOption(uint256 id, uint256 optionId) public onlyOwner whenNotPaused returns (bool) { } /** * 事件流拍 */ function abortive(uint256 id) public onlyOwner returns(bool) { } // /** // * 获取事件投注总额 // */ // function guessTotalBeanOf(uint256 id) public view returns(uint256){ // return guessTotalBean[id]; // } // /** // * 获取事件选项代投订单信息 // */ // function agentOrdersOf(uint256 id,uint256 optionId) // public // view // returns( // address participant, // address[] users, // uint256[] beans // ) { // AgentOrder[] memory agentOrder = agentOrders[id][optionId]; // return ( // agentOrder.participant, // agentOrder.users, // agentOrder.beans // ); // } // /** // * 获取用户直投订单 // */ // function ordersOf(uint256 id, uint256 optionId) public view // returns(address[] users,uint256[] beans){ // Order[] memory _orders = orders[id][optionId]; // address[] memory _users; // uint256[] memory _beans; // for (uint8 i = 0; i < _orders.length; i++) { // _users[i] = _orders[i].user; // _beans[i] = _orders[i].bean; // } // return (_users, _beans); // } } contract MosesContract is GuessBaseBiz { // // MOS合约地址 // address internal INITIAL_MOS_CONTRACT_ADDRESS = 0x001439818dd11823c45fff01af0cd6c50934e27ac0; // // 平台地址 // address internal INITIAL_PLATFORM_ADDRESS = 0x00063150d38ac0b008abe411ab7e4fb8228ecead3e; // // 平台手续费 // uint256 internal INITIAL_SERVICE_CHARGE_RATE = 5; // // 平台维护费 // uint256 internal INITIAL_MAINTENANCE_CHARGE_RATE = 0; // // 单次上限 // uint256 UPPER_LIMIT = 1000 * 10 ** 18; // // 单次下限 // uint256 LOWER_LIMIT = 1 * 10 ** 18; constructor(address[] _operators) public { } /** * Recovery donated ether */ function collectEtherBack(address collectorAddress) public onlyOwner { } /** * Recycle other ERC20 tokens */ function collectOtherTokens(address tokenContract, address collectorAddress) onlyOwner public returns (bool) { } }
guesses[_id].id==uint256(0),"The current guess already exists !!!"
283,631
guesses[_id].id==uint256(0)
"The current optionId already exists !!!"
pragma solidity ^0.4.24; contract Ownable { address public owner; mapping(address => uint8) public operators; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Throws if called by any account other than the operator */ modifier onlyOperator() { } /** * @dev operator management */ function operatorManager(address[] _operators,uint8 flag) public onlyOwner returns(bool){ } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused returns (bool) { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused returns (bool) { } } // ERC20 Token contract ERC20Token { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); } /** * 预测事件合约对象 * @author linq <[email protected]> */ contract GuessBaseBiz is Pausable { // MOS合约地址 address public mosContractAddress = 0x420a43153DA24B9e2aedcEC2B8158A8653a3317e; // 平台地址 address public platformAddress = 0xe0F969610699f88612518930D88C0dAB39f67985; // 平台手续费 uint256 public serviceChargeRate = 5; // 平台维护费 uint256 public maintenanceChargeRate = 0; // 单次上限 uint256 public upperLimit = 1000 * 10 ** 18; // 单次下限 uint256 public lowerLimit = 1 * 10 ** 18; ERC20Token MOS; // =============================== Event =============================== // 创建预测事件成功后广播 event CreateGuess(uint256 indexed id, address indexed creator); // 直投事件 // event Deposit(uint256 indexed id,address indexed participant,uint256 optionId,uint256 bean); // 代投事件 event DepositAgent(address indexed participant, uint256 indexed id, uint256 optionId, uint256 totalBean); // 公布选项事件 event PublishOption(uint256 indexed id, uint256 indexed optionId, uint256 odds); // 预测事件流拍事件 event Abortive(uint256 indexed id); constructor() public { } struct Guess { // 预测事件ID uint256 id; // 预测事件创建者 address creator; // 预测标题 string title; // 数据源名称+数据源链接 string source; // 预测事件分类 string category; // 是否下架 1.是 0.否 uint8 disabled; // 预测事件描述 bytes desc; // 开始时间 uint256 startAt; // 封盘时间 uint256 endAt; // 是否结束 uint8 finished; // 是否流拍 uint8 abortive; // // 选项ID // uint256[] optionIds; // // 选项名称 // bytes32[] optionNames; } // // 订单 // struct Order { // address user; // uint256 bean; // } // 平台代理订单 struct AgentOrder { address participant; string ipfsBase58; string dataHash; uint256 bean; } struct Option { // 选项ID uint256 id; // 选项名称 bytes32 name; } // 存储所有的预测事件 mapping (uint256 => Guess) public guesses; // 存储所有的预测事件选项 mapping (uint256 => Option[]) public options; // 存储所有用户直投订单 // mapping (uint256 => mapping(uint256 => Order[])) public orders; // 通过预测事件ID和选项ID,存储该选项所有参与的地址 mapping (uint256 => mapping (uint256 => AgentOrder[])) public agentOrders; // 存储事件总投注 mapping (uint256 => uint256) public guessTotalBean; // 存储某选项总投注 mapping (uint256 => mapping(uint256 => uint256)) public optionTotalBean; // 存储某选项某用户总投注 // mapping (uint256 => mapping(address => uint256)) public userOptionTotalBean; /** * 预测事件状态 */ enum GuessStatus { // 未开始 NotStarted, // 进行中 Progress, // 待公布 Deadline, // 已结束 Finished, // 流拍 Abortive } // 判断是否为禁用状态 function disabled(uint256 id) public view returns(bool) { } /** * 获取预测事件状态 * * 未开始 * 未到开始时间 * 进行中 * 在开始到结束时间范围内 * 待公布/已截止 * 已经过了结束时间,并且finished为0 * 已结束 * 已经过了结束时间,并且finished为1,abortive=0 * 流拍 * abortive=1,并且finished为1 流拍。(退币) */ function getGuessStatus(uint256 guessId) internal view returns(GuessStatus) { } //判断选项是否存在 function optionExist(uint256 guessId,uint256 optionId) internal view returns(bool){ } function() public payable { } /** * 修改预测系统变量 * @author linq */ function modifyVariable ( address _platformAddress, uint256 _serviceChargeRate, uint256 _maintenanceChargeRate, uint256 _upperLimit, uint256 _lowerLimit ) public onlyOwner { } // 创建预测事件 function createGuess( uint256 _id, string _title, string _source, string _category, uint8 _disabled, bytes _desc, uint256 _startAt, uint256 _endAt, uint256[] _optionId, bytes32[] _optionName ) public whenNotPaused { require(guesses[_id].id == uint256(0), "The current guess already exists !!!"); require(_optionId.length == _optionName.length, "please check options !!!"); guesses[_id] = Guess(_id, msg.sender, _title, _source, _category, _disabled, _desc, _startAt, _endAt, 0, 0 ); Option[] storage _options = options[_id]; for (uint8 i = 0;i < _optionId.length; i++) { require(<FILL_ME>) _options.push(Option(_optionId[i],_optionName[i])); } emit CreateGuess(_id, msg.sender); } /** * 审核|更新预测事件 */ function auditGuess ( uint256 _id, string _title, uint8 _disabled, bytes _desc, uint256 _endAt) public onlyOwner { } /** * 用户直接参与事件预测 */ // function deposit(uint256 id, uint256 optionId, uint256 bean) // public // payable // whenNotPaused // returns (bool) { // require(!disabled(id), "The guess disabled!!!"); // require(getGuessStatus(id) == GuessStatus.Progress, "The guess cannot participate !!!"); // require(bean >= lowerLimit && bean <= upperLimit, "Bean quantity nonconformity!!!"); // // 存储用户订单 // Order memory order = Order(msg.sender, bean); // orders[id][optionId].push(order); // // 某用户订单该选项总投注数 // userOptionTotalBean[optionId][msg.sender] += bean; // // 存储事件总投注 // guessTotalBean[id] += bean; // MOS.transferFrom(msg.sender, address(this), bean); // emit Deposit(id, msg.sender, optionId, bean); // return true; // } /** * 平台代理用户参与事件预测 */ function depositAgent ( uint256 id, uint256 optionId, string ipfsBase58, string dataHash, uint256 totalBean ) public onlyOperator whenNotPaused returns (bool) { } /** * 公布事件的结果 */ function publishOption(uint256 id, uint256 optionId) public onlyOwner whenNotPaused returns (bool) { } /** * 事件流拍 */ function abortive(uint256 id) public onlyOwner returns(bool) { } // /** // * 获取事件投注总额 // */ // function guessTotalBeanOf(uint256 id) public view returns(uint256){ // return guessTotalBean[id]; // } // /** // * 获取事件选项代投订单信息 // */ // function agentOrdersOf(uint256 id,uint256 optionId) // public // view // returns( // address participant, // address[] users, // uint256[] beans // ) { // AgentOrder[] memory agentOrder = agentOrders[id][optionId]; // return ( // agentOrder.participant, // agentOrder.users, // agentOrder.beans // ); // } // /** // * 获取用户直投订单 // */ // function ordersOf(uint256 id, uint256 optionId) public view // returns(address[] users,uint256[] beans){ // Order[] memory _orders = orders[id][optionId]; // address[] memory _users; // uint256[] memory _beans; // for (uint8 i = 0; i < _orders.length; i++) { // _users[i] = _orders[i].user; // _beans[i] = _orders[i].bean; // } // return (_users, _beans); // } } contract MosesContract is GuessBaseBiz { // // MOS合约地址 // address internal INITIAL_MOS_CONTRACT_ADDRESS = 0x001439818dd11823c45fff01af0cd6c50934e27ac0; // // 平台地址 // address internal INITIAL_PLATFORM_ADDRESS = 0x00063150d38ac0b008abe411ab7e4fb8228ecead3e; // // 平台手续费 // uint256 internal INITIAL_SERVICE_CHARGE_RATE = 5; // // 平台维护费 // uint256 internal INITIAL_MAINTENANCE_CHARGE_RATE = 0; // // 单次上限 // uint256 UPPER_LIMIT = 1000 * 10 ** 18; // // 单次下限 // uint256 LOWER_LIMIT = 1 * 10 ** 18; constructor(address[] _operators) public { } /** * Recovery donated ether */ function collectEtherBack(address collectorAddress) public onlyOwner { } /** * Recycle other ERC20 tokens */ function collectOtherTokens(address tokenContract, address collectorAddress) onlyOwner public returns (bool) { } }
!optionExist(_id,_optionId[i]),"The current optionId already exists !!!"
283,631
!optionExist(_id,_optionId[i])
"The current guess not exists !!!"
pragma solidity ^0.4.24; contract Ownable { address public owner; mapping(address => uint8) public operators; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Throws if called by any account other than the operator */ modifier onlyOperator() { } /** * @dev operator management */ function operatorManager(address[] _operators,uint8 flag) public onlyOwner returns(bool){ } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused returns (bool) { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused returns (bool) { } } // ERC20 Token contract ERC20Token { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); } /** * 预测事件合约对象 * @author linq <[email protected]> */ contract GuessBaseBiz is Pausable { // MOS合约地址 address public mosContractAddress = 0x420a43153DA24B9e2aedcEC2B8158A8653a3317e; // 平台地址 address public platformAddress = 0xe0F969610699f88612518930D88C0dAB39f67985; // 平台手续费 uint256 public serviceChargeRate = 5; // 平台维护费 uint256 public maintenanceChargeRate = 0; // 单次上限 uint256 public upperLimit = 1000 * 10 ** 18; // 单次下限 uint256 public lowerLimit = 1 * 10 ** 18; ERC20Token MOS; // =============================== Event =============================== // 创建预测事件成功后广播 event CreateGuess(uint256 indexed id, address indexed creator); // 直投事件 // event Deposit(uint256 indexed id,address indexed participant,uint256 optionId,uint256 bean); // 代投事件 event DepositAgent(address indexed participant, uint256 indexed id, uint256 optionId, uint256 totalBean); // 公布选项事件 event PublishOption(uint256 indexed id, uint256 indexed optionId, uint256 odds); // 预测事件流拍事件 event Abortive(uint256 indexed id); constructor() public { } struct Guess { // 预测事件ID uint256 id; // 预测事件创建者 address creator; // 预测标题 string title; // 数据源名称+数据源链接 string source; // 预测事件分类 string category; // 是否下架 1.是 0.否 uint8 disabled; // 预测事件描述 bytes desc; // 开始时间 uint256 startAt; // 封盘时间 uint256 endAt; // 是否结束 uint8 finished; // 是否流拍 uint8 abortive; // // 选项ID // uint256[] optionIds; // // 选项名称 // bytes32[] optionNames; } // // 订单 // struct Order { // address user; // uint256 bean; // } // 平台代理订单 struct AgentOrder { address participant; string ipfsBase58; string dataHash; uint256 bean; } struct Option { // 选项ID uint256 id; // 选项名称 bytes32 name; } // 存储所有的预测事件 mapping (uint256 => Guess) public guesses; // 存储所有的预测事件选项 mapping (uint256 => Option[]) public options; // 存储所有用户直投订单 // mapping (uint256 => mapping(uint256 => Order[])) public orders; // 通过预测事件ID和选项ID,存储该选项所有参与的地址 mapping (uint256 => mapping (uint256 => AgentOrder[])) public agentOrders; // 存储事件总投注 mapping (uint256 => uint256) public guessTotalBean; // 存储某选项总投注 mapping (uint256 => mapping(uint256 => uint256)) public optionTotalBean; // 存储某选项某用户总投注 // mapping (uint256 => mapping(address => uint256)) public userOptionTotalBean; /** * 预测事件状态 */ enum GuessStatus { // 未开始 NotStarted, // 进行中 Progress, // 待公布 Deadline, // 已结束 Finished, // 流拍 Abortive } // 判断是否为禁用状态 function disabled(uint256 id) public view returns(bool) { } /** * 获取预测事件状态 * * 未开始 * 未到开始时间 * 进行中 * 在开始到结束时间范围内 * 待公布/已截止 * 已经过了结束时间,并且finished为0 * 已结束 * 已经过了结束时间,并且finished为1,abortive=0 * 流拍 * abortive=1,并且finished为1 流拍。(退币) */ function getGuessStatus(uint256 guessId) internal view returns(GuessStatus) { } //判断选项是否存在 function optionExist(uint256 guessId,uint256 optionId) internal view returns(bool){ } function() public payable { } /** * 修改预测系统变量 * @author linq */ function modifyVariable ( address _platformAddress, uint256 _serviceChargeRate, uint256 _maintenanceChargeRate, uint256 _upperLimit, uint256 _lowerLimit ) public onlyOwner { } // 创建预测事件 function createGuess( uint256 _id, string _title, string _source, string _category, uint8 _disabled, bytes _desc, uint256 _startAt, uint256 _endAt, uint256[] _optionId, bytes32[] _optionName ) public whenNotPaused { } /** * 审核|更新预测事件 */ function auditGuess ( uint256 _id, string _title, uint8 _disabled, bytes _desc, uint256 _endAt) public onlyOwner { require(<FILL_ME>) require(getGuessStatus(_id) == GuessStatus.NotStarted, "The guess cannot audit !!!"); Guess storage guess = guesses[_id]; guess.title = _title; guess.disabled = _disabled; guess.desc = _desc; guess.endAt = _endAt; } /** * 用户直接参与事件预测 */ // function deposit(uint256 id, uint256 optionId, uint256 bean) // public // payable // whenNotPaused // returns (bool) { // require(!disabled(id), "The guess disabled!!!"); // require(getGuessStatus(id) == GuessStatus.Progress, "The guess cannot participate !!!"); // require(bean >= lowerLimit && bean <= upperLimit, "Bean quantity nonconformity!!!"); // // 存储用户订单 // Order memory order = Order(msg.sender, bean); // orders[id][optionId].push(order); // // 某用户订单该选项总投注数 // userOptionTotalBean[optionId][msg.sender] += bean; // // 存储事件总投注 // guessTotalBean[id] += bean; // MOS.transferFrom(msg.sender, address(this), bean); // emit Deposit(id, msg.sender, optionId, bean); // return true; // } /** * 平台代理用户参与事件预测 */ function depositAgent ( uint256 id, uint256 optionId, string ipfsBase58, string dataHash, uint256 totalBean ) public onlyOperator whenNotPaused returns (bool) { } /** * 公布事件的结果 */ function publishOption(uint256 id, uint256 optionId) public onlyOwner whenNotPaused returns (bool) { } /** * 事件流拍 */ function abortive(uint256 id) public onlyOwner returns(bool) { } // /** // * 获取事件投注总额 // */ // function guessTotalBeanOf(uint256 id) public view returns(uint256){ // return guessTotalBean[id]; // } // /** // * 获取事件选项代投订单信息 // */ // function agentOrdersOf(uint256 id,uint256 optionId) // public // view // returns( // address participant, // address[] users, // uint256[] beans // ) { // AgentOrder[] memory agentOrder = agentOrders[id][optionId]; // return ( // agentOrder.participant, // agentOrder.users, // agentOrder.beans // ); // } // /** // * 获取用户直投订单 // */ // function ordersOf(uint256 id, uint256 optionId) public view // returns(address[] users,uint256[] beans){ // Order[] memory _orders = orders[id][optionId]; // address[] memory _users; // uint256[] memory _beans; // for (uint8 i = 0; i < _orders.length; i++) { // _users[i] = _orders[i].user; // _beans[i] = _orders[i].bean; // } // return (_users, _beans); // } } contract MosesContract is GuessBaseBiz { // // MOS合约地址 // address internal INITIAL_MOS_CONTRACT_ADDRESS = 0x001439818dd11823c45fff01af0cd6c50934e27ac0; // // 平台地址 // address internal INITIAL_PLATFORM_ADDRESS = 0x00063150d38ac0b008abe411ab7e4fb8228ecead3e; // // 平台手续费 // uint256 internal INITIAL_SERVICE_CHARGE_RATE = 5; // // 平台维护费 // uint256 internal INITIAL_MAINTENANCE_CHARGE_RATE = 0; // // 单次上限 // uint256 UPPER_LIMIT = 1000 * 10 ** 18; // // 单次下限 // uint256 LOWER_LIMIT = 1 * 10 ** 18; constructor(address[] _operators) public { } /** * Recovery donated ether */ function collectEtherBack(address collectorAddress) public onlyOwner { } /** * Recycle other ERC20 tokens */ function collectOtherTokens(address tokenContract, address collectorAddress) onlyOwner public returns (bool) { } }
guesses[_id].id!=uint256(0),"The current guess not exists !!!"
283,631
guesses[_id].id!=uint256(0)
"The guess cannot audit !!!"
pragma solidity ^0.4.24; contract Ownable { address public owner; mapping(address => uint8) public operators; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Throws if called by any account other than the operator */ modifier onlyOperator() { } /** * @dev operator management */ function operatorManager(address[] _operators,uint8 flag) public onlyOwner returns(bool){ } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused returns (bool) { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused returns (bool) { } } // ERC20 Token contract ERC20Token { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); } /** * 预测事件合约对象 * @author linq <[email protected]> */ contract GuessBaseBiz is Pausable { // MOS合约地址 address public mosContractAddress = 0x420a43153DA24B9e2aedcEC2B8158A8653a3317e; // 平台地址 address public platformAddress = 0xe0F969610699f88612518930D88C0dAB39f67985; // 平台手续费 uint256 public serviceChargeRate = 5; // 平台维护费 uint256 public maintenanceChargeRate = 0; // 单次上限 uint256 public upperLimit = 1000 * 10 ** 18; // 单次下限 uint256 public lowerLimit = 1 * 10 ** 18; ERC20Token MOS; // =============================== Event =============================== // 创建预测事件成功后广播 event CreateGuess(uint256 indexed id, address indexed creator); // 直投事件 // event Deposit(uint256 indexed id,address indexed participant,uint256 optionId,uint256 bean); // 代投事件 event DepositAgent(address indexed participant, uint256 indexed id, uint256 optionId, uint256 totalBean); // 公布选项事件 event PublishOption(uint256 indexed id, uint256 indexed optionId, uint256 odds); // 预测事件流拍事件 event Abortive(uint256 indexed id); constructor() public { } struct Guess { // 预测事件ID uint256 id; // 预测事件创建者 address creator; // 预测标题 string title; // 数据源名称+数据源链接 string source; // 预测事件分类 string category; // 是否下架 1.是 0.否 uint8 disabled; // 预测事件描述 bytes desc; // 开始时间 uint256 startAt; // 封盘时间 uint256 endAt; // 是否结束 uint8 finished; // 是否流拍 uint8 abortive; // // 选项ID // uint256[] optionIds; // // 选项名称 // bytes32[] optionNames; } // // 订单 // struct Order { // address user; // uint256 bean; // } // 平台代理订单 struct AgentOrder { address participant; string ipfsBase58; string dataHash; uint256 bean; } struct Option { // 选项ID uint256 id; // 选项名称 bytes32 name; } // 存储所有的预测事件 mapping (uint256 => Guess) public guesses; // 存储所有的预测事件选项 mapping (uint256 => Option[]) public options; // 存储所有用户直投订单 // mapping (uint256 => mapping(uint256 => Order[])) public orders; // 通过预测事件ID和选项ID,存储该选项所有参与的地址 mapping (uint256 => mapping (uint256 => AgentOrder[])) public agentOrders; // 存储事件总投注 mapping (uint256 => uint256) public guessTotalBean; // 存储某选项总投注 mapping (uint256 => mapping(uint256 => uint256)) public optionTotalBean; // 存储某选项某用户总投注 // mapping (uint256 => mapping(address => uint256)) public userOptionTotalBean; /** * 预测事件状态 */ enum GuessStatus { // 未开始 NotStarted, // 进行中 Progress, // 待公布 Deadline, // 已结束 Finished, // 流拍 Abortive } // 判断是否为禁用状态 function disabled(uint256 id) public view returns(bool) { } /** * 获取预测事件状态 * * 未开始 * 未到开始时间 * 进行中 * 在开始到结束时间范围内 * 待公布/已截止 * 已经过了结束时间,并且finished为0 * 已结束 * 已经过了结束时间,并且finished为1,abortive=0 * 流拍 * abortive=1,并且finished为1 流拍。(退币) */ function getGuessStatus(uint256 guessId) internal view returns(GuessStatus) { } //判断选项是否存在 function optionExist(uint256 guessId,uint256 optionId) internal view returns(bool){ } function() public payable { } /** * 修改预测系统变量 * @author linq */ function modifyVariable ( address _platformAddress, uint256 _serviceChargeRate, uint256 _maintenanceChargeRate, uint256 _upperLimit, uint256 _lowerLimit ) public onlyOwner { } // 创建预测事件 function createGuess( uint256 _id, string _title, string _source, string _category, uint8 _disabled, bytes _desc, uint256 _startAt, uint256 _endAt, uint256[] _optionId, bytes32[] _optionName ) public whenNotPaused { } /** * 审核|更新预测事件 */ function auditGuess ( uint256 _id, string _title, uint8 _disabled, bytes _desc, uint256 _endAt) public onlyOwner { require(guesses[_id].id != uint256(0), "The current guess not exists !!!"); require(<FILL_ME>) Guess storage guess = guesses[_id]; guess.title = _title; guess.disabled = _disabled; guess.desc = _desc; guess.endAt = _endAt; } /** * 用户直接参与事件预测 */ // function deposit(uint256 id, uint256 optionId, uint256 bean) // public // payable // whenNotPaused // returns (bool) { // require(!disabled(id), "The guess disabled!!!"); // require(getGuessStatus(id) == GuessStatus.Progress, "The guess cannot participate !!!"); // require(bean >= lowerLimit && bean <= upperLimit, "Bean quantity nonconformity!!!"); // // 存储用户订单 // Order memory order = Order(msg.sender, bean); // orders[id][optionId].push(order); // // 某用户订单该选项总投注数 // userOptionTotalBean[optionId][msg.sender] += bean; // // 存储事件总投注 // guessTotalBean[id] += bean; // MOS.transferFrom(msg.sender, address(this), bean); // emit Deposit(id, msg.sender, optionId, bean); // return true; // } /** * 平台代理用户参与事件预测 */ function depositAgent ( uint256 id, uint256 optionId, string ipfsBase58, string dataHash, uint256 totalBean ) public onlyOperator whenNotPaused returns (bool) { } /** * 公布事件的结果 */ function publishOption(uint256 id, uint256 optionId) public onlyOwner whenNotPaused returns (bool) { } /** * 事件流拍 */ function abortive(uint256 id) public onlyOwner returns(bool) { } // /** // * 获取事件投注总额 // */ // function guessTotalBeanOf(uint256 id) public view returns(uint256){ // return guessTotalBean[id]; // } // /** // * 获取事件选项代投订单信息 // */ // function agentOrdersOf(uint256 id,uint256 optionId) // public // view // returns( // address participant, // address[] users, // uint256[] beans // ) { // AgentOrder[] memory agentOrder = agentOrders[id][optionId]; // return ( // agentOrder.participant, // agentOrder.users, // agentOrder.beans // ); // } // /** // * 获取用户直投订单 // */ // function ordersOf(uint256 id, uint256 optionId) public view // returns(address[] users,uint256[] beans){ // Order[] memory _orders = orders[id][optionId]; // address[] memory _users; // uint256[] memory _beans; // for (uint8 i = 0; i < _orders.length; i++) { // _users[i] = _orders[i].user; // _beans[i] = _orders[i].bean; // } // return (_users, _beans); // } } contract MosesContract is GuessBaseBiz { // // MOS合约地址 // address internal INITIAL_MOS_CONTRACT_ADDRESS = 0x001439818dd11823c45fff01af0cd6c50934e27ac0; // // 平台地址 // address internal INITIAL_PLATFORM_ADDRESS = 0x00063150d38ac0b008abe411ab7e4fb8228ecead3e; // // 平台手续费 // uint256 internal INITIAL_SERVICE_CHARGE_RATE = 5; // // 平台维护费 // uint256 internal INITIAL_MAINTENANCE_CHARGE_RATE = 0; // // 单次上限 // uint256 UPPER_LIMIT = 1000 * 10 ** 18; // // 单次下限 // uint256 LOWER_LIMIT = 1 * 10 ** 18; constructor(address[] _operators) public { } /** * Recovery donated ether */ function collectEtherBack(address collectorAddress) public onlyOwner { } /** * Recycle other ERC20 tokens */ function collectOtherTokens(address tokenContract, address collectorAddress) onlyOwner public returns (bool) { } }
getGuessStatus(_id)==GuessStatus.NotStarted,"The guess cannot audit !!!"
283,631
getGuessStatus(_id)==GuessStatus.NotStarted
"The current guess not exists !!!"
pragma solidity ^0.4.24; contract Ownable { address public owner; mapping(address => uint8) public operators; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Throws if called by any account other than the operator */ modifier onlyOperator() { } /** * @dev operator management */ function operatorManager(address[] _operators,uint8 flag) public onlyOwner returns(bool){ } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused returns (bool) { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused returns (bool) { } } // ERC20 Token contract ERC20Token { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); } /** * 预测事件合约对象 * @author linq <[email protected]> */ contract GuessBaseBiz is Pausable { // MOS合约地址 address public mosContractAddress = 0x420a43153DA24B9e2aedcEC2B8158A8653a3317e; // 平台地址 address public platformAddress = 0xe0F969610699f88612518930D88C0dAB39f67985; // 平台手续费 uint256 public serviceChargeRate = 5; // 平台维护费 uint256 public maintenanceChargeRate = 0; // 单次上限 uint256 public upperLimit = 1000 * 10 ** 18; // 单次下限 uint256 public lowerLimit = 1 * 10 ** 18; ERC20Token MOS; // =============================== Event =============================== // 创建预测事件成功后广播 event CreateGuess(uint256 indexed id, address indexed creator); // 直投事件 // event Deposit(uint256 indexed id,address indexed participant,uint256 optionId,uint256 bean); // 代投事件 event DepositAgent(address indexed participant, uint256 indexed id, uint256 optionId, uint256 totalBean); // 公布选项事件 event PublishOption(uint256 indexed id, uint256 indexed optionId, uint256 odds); // 预测事件流拍事件 event Abortive(uint256 indexed id); constructor() public { } struct Guess { // 预测事件ID uint256 id; // 预测事件创建者 address creator; // 预测标题 string title; // 数据源名称+数据源链接 string source; // 预测事件分类 string category; // 是否下架 1.是 0.否 uint8 disabled; // 预测事件描述 bytes desc; // 开始时间 uint256 startAt; // 封盘时间 uint256 endAt; // 是否结束 uint8 finished; // 是否流拍 uint8 abortive; // // 选项ID // uint256[] optionIds; // // 选项名称 // bytes32[] optionNames; } // // 订单 // struct Order { // address user; // uint256 bean; // } // 平台代理订单 struct AgentOrder { address participant; string ipfsBase58; string dataHash; uint256 bean; } struct Option { // 选项ID uint256 id; // 选项名称 bytes32 name; } // 存储所有的预测事件 mapping (uint256 => Guess) public guesses; // 存储所有的预测事件选项 mapping (uint256 => Option[]) public options; // 存储所有用户直投订单 // mapping (uint256 => mapping(uint256 => Order[])) public orders; // 通过预测事件ID和选项ID,存储该选项所有参与的地址 mapping (uint256 => mapping (uint256 => AgentOrder[])) public agentOrders; // 存储事件总投注 mapping (uint256 => uint256) public guessTotalBean; // 存储某选项总投注 mapping (uint256 => mapping(uint256 => uint256)) public optionTotalBean; // 存储某选项某用户总投注 // mapping (uint256 => mapping(address => uint256)) public userOptionTotalBean; /** * 预测事件状态 */ enum GuessStatus { // 未开始 NotStarted, // 进行中 Progress, // 待公布 Deadline, // 已结束 Finished, // 流拍 Abortive } // 判断是否为禁用状态 function disabled(uint256 id) public view returns(bool) { } /** * 获取预测事件状态 * * 未开始 * 未到开始时间 * 进行中 * 在开始到结束时间范围内 * 待公布/已截止 * 已经过了结束时间,并且finished为0 * 已结束 * 已经过了结束时间,并且finished为1,abortive=0 * 流拍 * abortive=1,并且finished为1 流拍。(退币) */ function getGuessStatus(uint256 guessId) internal view returns(GuessStatus) { } //判断选项是否存在 function optionExist(uint256 guessId,uint256 optionId) internal view returns(bool){ } function() public payable { } /** * 修改预测系统变量 * @author linq */ function modifyVariable ( address _platformAddress, uint256 _serviceChargeRate, uint256 _maintenanceChargeRate, uint256 _upperLimit, uint256 _lowerLimit ) public onlyOwner { } // 创建预测事件 function createGuess( uint256 _id, string _title, string _source, string _category, uint8 _disabled, bytes _desc, uint256 _startAt, uint256 _endAt, uint256[] _optionId, bytes32[] _optionName ) public whenNotPaused { } /** * 审核|更新预测事件 */ function auditGuess ( uint256 _id, string _title, uint8 _disabled, bytes _desc, uint256 _endAt) public onlyOwner { } /** * 用户直接参与事件预测 */ // function deposit(uint256 id, uint256 optionId, uint256 bean) // public // payable // whenNotPaused // returns (bool) { // require(!disabled(id), "The guess disabled!!!"); // require(getGuessStatus(id) == GuessStatus.Progress, "The guess cannot participate !!!"); // require(bean >= lowerLimit && bean <= upperLimit, "Bean quantity nonconformity!!!"); // // 存储用户订单 // Order memory order = Order(msg.sender, bean); // orders[id][optionId].push(order); // // 某用户订单该选项总投注数 // userOptionTotalBean[optionId][msg.sender] += bean; // // 存储事件总投注 // guessTotalBean[id] += bean; // MOS.transferFrom(msg.sender, address(this), bean); // emit Deposit(id, msg.sender, optionId, bean); // return true; // } /** * 平台代理用户参与事件预测 */ function depositAgent ( uint256 id, uint256 optionId, string ipfsBase58, string dataHash, uint256 totalBean ) public onlyOperator whenNotPaused returns (bool) { require(<FILL_ME>) require(optionExist(id, optionId),"The current optionId not exists !!!"); require(!disabled(id), "The guess disabled!!!"); require(getGuessStatus(id) == GuessStatus.Deadline, "The guess cannot participate !!!"); // 通过预测事件ID和选项ID,存储该选项所有参与的地址 AgentOrder[] storage _agentOrders = agentOrders[id][optionId]; AgentOrder memory agentOrder = AgentOrder(msg.sender,ipfsBase58,dataHash,totalBean); _agentOrders.push(agentOrder); MOS.transferFrom(msg.sender, address(this), totalBean); // 某用户订单该选项总投注数 // userOptionTotalBean[optionId][msg.sender] += totalBean; // 订单选项总投注 optionTotalBean[id][optionId] += totalBean; // 存储事件总投注 guessTotalBean[id] += totalBean; emit DepositAgent(msg.sender, id, optionId, totalBean); return true; } /** * 公布事件的结果 */ function publishOption(uint256 id, uint256 optionId) public onlyOwner whenNotPaused returns (bool) { } /** * 事件流拍 */ function abortive(uint256 id) public onlyOwner returns(bool) { } // /** // * 获取事件投注总额 // */ // function guessTotalBeanOf(uint256 id) public view returns(uint256){ // return guessTotalBean[id]; // } // /** // * 获取事件选项代投订单信息 // */ // function agentOrdersOf(uint256 id,uint256 optionId) // public // view // returns( // address participant, // address[] users, // uint256[] beans // ) { // AgentOrder[] memory agentOrder = agentOrders[id][optionId]; // return ( // agentOrder.participant, // agentOrder.users, // agentOrder.beans // ); // } // /** // * 获取用户直投订单 // */ // function ordersOf(uint256 id, uint256 optionId) public view // returns(address[] users,uint256[] beans){ // Order[] memory _orders = orders[id][optionId]; // address[] memory _users; // uint256[] memory _beans; // for (uint8 i = 0; i < _orders.length; i++) { // _users[i] = _orders[i].user; // _beans[i] = _orders[i].bean; // } // return (_users, _beans); // } } contract MosesContract is GuessBaseBiz { // // MOS合约地址 // address internal INITIAL_MOS_CONTRACT_ADDRESS = 0x001439818dd11823c45fff01af0cd6c50934e27ac0; // // 平台地址 // address internal INITIAL_PLATFORM_ADDRESS = 0x00063150d38ac0b008abe411ab7e4fb8228ecead3e; // // 平台手续费 // uint256 internal INITIAL_SERVICE_CHARGE_RATE = 5; // // 平台维护费 // uint256 internal INITIAL_MAINTENANCE_CHARGE_RATE = 0; // // 单次上限 // uint256 UPPER_LIMIT = 1000 * 10 ** 18; // // 单次下限 // uint256 LOWER_LIMIT = 1 * 10 ** 18; constructor(address[] _operators) public { } /** * Recovery donated ether */ function collectEtherBack(address collectorAddress) public onlyOwner { } /** * Recycle other ERC20 tokens */ function collectOtherTokens(address tokenContract, address collectorAddress) onlyOwner public returns (bool) { } }
guesses[id].id!=uint256(0),"The current guess not exists !!!"
283,631
guesses[id].id!=uint256(0)
"The current optionId not exists !!!"
pragma solidity ^0.4.24; contract Ownable { address public owner; mapping(address => uint8) public operators; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Throws if called by any account other than the operator */ modifier onlyOperator() { } /** * @dev operator management */ function operatorManager(address[] _operators,uint8 flag) public onlyOwner returns(bool){ } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused returns (bool) { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused returns (bool) { } } // ERC20 Token contract ERC20Token { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); } /** * 预测事件合约对象 * @author linq <[email protected]> */ contract GuessBaseBiz is Pausable { // MOS合约地址 address public mosContractAddress = 0x420a43153DA24B9e2aedcEC2B8158A8653a3317e; // 平台地址 address public platformAddress = 0xe0F969610699f88612518930D88C0dAB39f67985; // 平台手续费 uint256 public serviceChargeRate = 5; // 平台维护费 uint256 public maintenanceChargeRate = 0; // 单次上限 uint256 public upperLimit = 1000 * 10 ** 18; // 单次下限 uint256 public lowerLimit = 1 * 10 ** 18; ERC20Token MOS; // =============================== Event =============================== // 创建预测事件成功后广播 event CreateGuess(uint256 indexed id, address indexed creator); // 直投事件 // event Deposit(uint256 indexed id,address indexed participant,uint256 optionId,uint256 bean); // 代投事件 event DepositAgent(address indexed participant, uint256 indexed id, uint256 optionId, uint256 totalBean); // 公布选项事件 event PublishOption(uint256 indexed id, uint256 indexed optionId, uint256 odds); // 预测事件流拍事件 event Abortive(uint256 indexed id); constructor() public { } struct Guess { // 预测事件ID uint256 id; // 预测事件创建者 address creator; // 预测标题 string title; // 数据源名称+数据源链接 string source; // 预测事件分类 string category; // 是否下架 1.是 0.否 uint8 disabled; // 预测事件描述 bytes desc; // 开始时间 uint256 startAt; // 封盘时间 uint256 endAt; // 是否结束 uint8 finished; // 是否流拍 uint8 abortive; // // 选项ID // uint256[] optionIds; // // 选项名称 // bytes32[] optionNames; } // // 订单 // struct Order { // address user; // uint256 bean; // } // 平台代理订单 struct AgentOrder { address participant; string ipfsBase58; string dataHash; uint256 bean; } struct Option { // 选项ID uint256 id; // 选项名称 bytes32 name; } // 存储所有的预测事件 mapping (uint256 => Guess) public guesses; // 存储所有的预测事件选项 mapping (uint256 => Option[]) public options; // 存储所有用户直投订单 // mapping (uint256 => mapping(uint256 => Order[])) public orders; // 通过预测事件ID和选项ID,存储该选项所有参与的地址 mapping (uint256 => mapping (uint256 => AgentOrder[])) public agentOrders; // 存储事件总投注 mapping (uint256 => uint256) public guessTotalBean; // 存储某选项总投注 mapping (uint256 => mapping(uint256 => uint256)) public optionTotalBean; // 存储某选项某用户总投注 // mapping (uint256 => mapping(address => uint256)) public userOptionTotalBean; /** * 预测事件状态 */ enum GuessStatus { // 未开始 NotStarted, // 进行中 Progress, // 待公布 Deadline, // 已结束 Finished, // 流拍 Abortive } // 判断是否为禁用状态 function disabled(uint256 id) public view returns(bool) { } /** * 获取预测事件状态 * * 未开始 * 未到开始时间 * 进行中 * 在开始到结束时间范围内 * 待公布/已截止 * 已经过了结束时间,并且finished为0 * 已结束 * 已经过了结束时间,并且finished为1,abortive=0 * 流拍 * abortive=1,并且finished为1 流拍。(退币) */ function getGuessStatus(uint256 guessId) internal view returns(GuessStatus) { } //判断选项是否存在 function optionExist(uint256 guessId,uint256 optionId) internal view returns(bool){ } function() public payable { } /** * 修改预测系统变量 * @author linq */ function modifyVariable ( address _platformAddress, uint256 _serviceChargeRate, uint256 _maintenanceChargeRate, uint256 _upperLimit, uint256 _lowerLimit ) public onlyOwner { } // 创建预测事件 function createGuess( uint256 _id, string _title, string _source, string _category, uint8 _disabled, bytes _desc, uint256 _startAt, uint256 _endAt, uint256[] _optionId, bytes32[] _optionName ) public whenNotPaused { } /** * 审核|更新预测事件 */ function auditGuess ( uint256 _id, string _title, uint8 _disabled, bytes _desc, uint256 _endAt) public onlyOwner { } /** * 用户直接参与事件预测 */ // function deposit(uint256 id, uint256 optionId, uint256 bean) // public // payable // whenNotPaused // returns (bool) { // require(!disabled(id), "The guess disabled!!!"); // require(getGuessStatus(id) == GuessStatus.Progress, "The guess cannot participate !!!"); // require(bean >= lowerLimit && bean <= upperLimit, "Bean quantity nonconformity!!!"); // // 存储用户订单 // Order memory order = Order(msg.sender, bean); // orders[id][optionId].push(order); // // 某用户订单该选项总投注数 // userOptionTotalBean[optionId][msg.sender] += bean; // // 存储事件总投注 // guessTotalBean[id] += bean; // MOS.transferFrom(msg.sender, address(this), bean); // emit Deposit(id, msg.sender, optionId, bean); // return true; // } /** * 平台代理用户参与事件预测 */ function depositAgent ( uint256 id, uint256 optionId, string ipfsBase58, string dataHash, uint256 totalBean ) public onlyOperator whenNotPaused returns (bool) { require(guesses[id].id != uint256(0), "The current guess not exists !!!"); require(<FILL_ME>) require(!disabled(id), "The guess disabled!!!"); require(getGuessStatus(id) == GuessStatus.Deadline, "The guess cannot participate !!!"); // 通过预测事件ID和选项ID,存储该选项所有参与的地址 AgentOrder[] storage _agentOrders = agentOrders[id][optionId]; AgentOrder memory agentOrder = AgentOrder(msg.sender,ipfsBase58,dataHash,totalBean); _agentOrders.push(agentOrder); MOS.transferFrom(msg.sender, address(this), totalBean); // 某用户订单该选项总投注数 // userOptionTotalBean[optionId][msg.sender] += totalBean; // 订单选项总投注 optionTotalBean[id][optionId] += totalBean; // 存储事件总投注 guessTotalBean[id] += totalBean; emit DepositAgent(msg.sender, id, optionId, totalBean); return true; } /** * 公布事件的结果 */ function publishOption(uint256 id, uint256 optionId) public onlyOwner whenNotPaused returns (bool) { } /** * 事件流拍 */ function abortive(uint256 id) public onlyOwner returns(bool) { } // /** // * 获取事件投注总额 // */ // function guessTotalBeanOf(uint256 id) public view returns(uint256){ // return guessTotalBean[id]; // } // /** // * 获取事件选项代投订单信息 // */ // function agentOrdersOf(uint256 id,uint256 optionId) // public // view // returns( // address participant, // address[] users, // uint256[] beans // ) { // AgentOrder[] memory agentOrder = agentOrders[id][optionId]; // return ( // agentOrder.participant, // agentOrder.users, // agentOrder.beans // ); // } // /** // * 获取用户直投订单 // */ // function ordersOf(uint256 id, uint256 optionId) public view // returns(address[] users,uint256[] beans){ // Order[] memory _orders = orders[id][optionId]; // address[] memory _users; // uint256[] memory _beans; // for (uint8 i = 0; i < _orders.length; i++) { // _users[i] = _orders[i].user; // _beans[i] = _orders[i].bean; // } // return (_users, _beans); // } } contract MosesContract is GuessBaseBiz { // // MOS合约地址 // address internal INITIAL_MOS_CONTRACT_ADDRESS = 0x001439818dd11823c45fff01af0cd6c50934e27ac0; // // 平台地址 // address internal INITIAL_PLATFORM_ADDRESS = 0x00063150d38ac0b008abe411ab7e4fb8228ecead3e; // // 平台手续费 // uint256 internal INITIAL_SERVICE_CHARGE_RATE = 5; // // 平台维护费 // uint256 internal INITIAL_MAINTENANCE_CHARGE_RATE = 0; // // 单次上限 // uint256 UPPER_LIMIT = 1000 * 10 ** 18; // // 单次下限 // uint256 LOWER_LIMIT = 1 * 10 ** 18; constructor(address[] _operators) public { } /** * Recovery donated ether */ function collectEtherBack(address collectorAddress) public onlyOwner { } /** * Recycle other ERC20 tokens */ function collectOtherTokens(address tokenContract, address collectorAddress) onlyOwner public returns (bool) { } }
optionExist(id,optionId),"The current optionId not exists !!!"
283,631
optionExist(id,optionId)
"The guess disabled!!!"
pragma solidity ^0.4.24; contract Ownable { address public owner; mapping(address => uint8) public operators; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Throws if called by any account other than the operator */ modifier onlyOperator() { } /** * @dev operator management */ function operatorManager(address[] _operators,uint8 flag) public onlyOwner returns(bool){ } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused returns (bool) { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused returns (bool) { } } // ERC20 Token contract ERC20Token { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); } /** * 预测事件合约对象 * @author linq <[email protected]> */ contract GuessBaseBiz is Pausable { // MOS合约地址 address public mosContractAddress = 0x420a43153DA24B9e2aedcEC2B8158A8653a3317e; // 平台地址 address public platformAddress = 0xe0F969610699f88612518930D88C0dAB39f67985; // 平台手续费 uint256 public serviceChargeRate = 5; // 平台维护费 uint256 public maintenanceChargeRate = 0; // 单次上限 uint256 public upperLimit = 1000 * 10 ** 18; // 单次下限 uint256 public lowerLimit = 1 * 10 ** 18; ERC20Token MOS; // =============================== Event =============================== // 创建预测事件成功后广播 event CreateGuess(uint256 indexed id, address indexed creator); // 直投事件 // event Deposit(uint256 indexed id,address indexed participant,uint256 optionId,uint256 bean); // 代投事件 event DepositAgent(address indexed participant, uint256 indexed id, uint256 optionId, uint256 totalBean); // 公布选项事件 event PublishOption(uint256 indexed id, uint256 indexed optionId, uint256 odds); // 预测事件流拍事件 event Abortive(uint256 indexed id); constructor() public { } struct Guess { // 预测事件ID uint256 id; // 预测事件创建者 address creator; // 预测标题 string title; // 数据源名称+数据源链接 string source; // 预测事件分类 string category; // 是否下架 1.是 0.否 uint8 disabled; // 预测事件描述 bytes desc; // 开始时间 uint256 startAt; // 封盘时间 uint256 endAt; // 是否结束 uint8 finished; // 是否流拍 uint8 abortive; // // 选项ID // uint256[] optionIds; // // 选项名称 // bytes32[] optionNames; } // // 订单 // struct Order { // address user; // uint256 bean; // } // 平台代理订单 struct AgentOrder { address participant; string ipfsBase58; string dataHash; uint256 bean; } struct Option { // 选项ID uint256 id; // 选项名称 bytes32 name; } // 存储所有的预测事件 mapping (uint256 => Guess) public guesses; // 存储所有的预测事件选项 mapping (uint256 => Option[]) public options; // 存储所有用户直投订单 // mapping (uint256 => mapping(uint256 => Order[])) public orders; // 通过预测事件ID和选项ID,存储该选项所有参与的地址 mapping (uint256 => mapping (uint256 => AgentOrder[])) public agentOrders; // 存储事件总投注 mapping (uint256 => uint256) public guessTotalBean; // 存储某选项总投注 mapping (uint256 => mapping(uint256 => uint256)) public optionTotalBean; // 存储某选项某用户总投注 // mapping (uint256 => mapping(address => uint256)) public userOptionTotalBean; /** * 预测事件状态 */ enum GuessStatus { // 未开始 NotStarted, // 进行中 Progress, // 待公布 Deadline, // 已结束 Finished, // 流拍 Abortive } // 判断是否为禁用状态 function disabled(uint256 id) public view returns(bool) { } /** * 获取预测事件状态 * * 未开始 * 未到开始时间 * 进行中 * 在开始到结束时间范围内 * 待公布/已截止 * 已经过了结束时间,并且finished为0 * 已结束 * 已经过了结束时间,并且finished为1,abortive=0 * 流拍 * abortive=1,并且finished为1 流拍。(退币) */ function getGuessStatus(uint256 guessId) internal view returns(GuessStatus) { } //判断选项是否存在 function optionExist(uint256 guessId,uint256 optionId) internal view returns(bool){ } function() public payable { } /** * 修改预测系统变量 * @author linq */ function modifyVariable ( address _platformAddress, uint256 _serviceChargeRate, uint256 _maintenanceChargeRate, uint256 _upperLimit, uint256 _lowerLimit ) public onlyOwner { } // 创建预测事件 function createGuess( uint256 _id, string _title, string _source, string _category, uint8 _disabled, bytes _desc, uint256 _startAt, uint256 _endAt, uint256[] _optionId, bytes32[] _optionName ) public whenNotPaused { } /** * 审核|更新预测事件 */ function auditGuess ( uint256 _id, string _title, uint8 _disabled, bytes _desc, uint256 _endAt) public onlyOwner { } /** * 用户直接参与事件预测 */ // function deposit(uint256 id, uint256 optionId, uint256 bean) // public // payable // whenNotPaused // returns (bool) { // require(!disabled(id), "The guess disabled!!!"); // require(getGuessStatus(id) == GuessStatus.Progress, "The guess cannot participate !!!"); // require(bean >= lowerLimit && bean <= upperLimit, "Bean quantity nonconformity!!!"); // // 存储用户订单 // Order memory order = Order(msg.sender, bean); // orders[id][optionId].push(order); // // 某用户订单该选项总投注数 // userOptionTotalBean[optionId][msg.sender] += bean; // // 存储事件总投注 // guessTotalBean[id] += bean; // MOS.transferFrom(msg.sender, address(this), bean); // emit Deposit(id, msg.sender, optionId, bean); // return true; // } /** * 平台代理用户参与事件预测 */ function depositAgent ( uint256 id, uint256 optionId, string ipfsBase58, string dataHash, uint256 totalBean ) public onlyOperator whenNotPaused returns (bool) { require(guesses[id].id != uint256(0), "The current guess not exists !!!"); require(optionExist(id, optionId),"The current optionId not exists !!!"); require(<FILL_ME>) require(getGuessStatus(id) == GuessStatus.Deadline, "The guess cannot participate !!!"); // 通过预测事件ID和选项ID,存储该选项所有参与的地址 AgentOrder[] storage _agentOrders = agentOrders[id][optionId]; AgentOrder memory agentOrder = AgentOrder(msg.sender,ipfsBase58,dataHash,totalBean); _agentOrders.push(agentOrder); MOS.transferFrom(msg.sender, address(this), totalBean); // 某用户订单该选项总投注数 // userOptionTotalBean[optionId][msg.sender] += totalBean; // 订单选项总投注 optionTotalBean[id][optionId] += totalBean; // 存储事件总投注 guessTotalBean[id] += totalBean; emit DepositAgent(msg.sender, id, optionId, totalBean); return true; } /** * 公布事件的结果 */ function publishOption(uint256 id, uint256 optionId) public onlyOwner whenNotPaused returns (bool) { } /** * 事件流拍 */ function abortive(uint256 id) public onlyOwner returns(bool) { } // /** // * 获取事件投注总额 // */ // function guessTotalBeanOf(uint256 id) public view returns(uint256){ // return guessTotalBean[id]; // } // /** // * 获取事件选项代投订单信息 // */ // function agentOrdersOf(uint256 id,uint256 optionId) // public // view // returns( // address participant, // address[] users, // uint256[] beans // ) { // AgentOrder[] memory agentOrder = agentOrders[id][optionId]; // return ( // agentOrder.participant, // agentOrder.users, // agentOrder.beans // ); // } // /** // * 获取用户直投订单 // */ // function ordersOf(uint256 id, uint256 optionId) public view // returns(address[] users,uint256[] beans){ // Order[] memory _orders = orders[id][optionId]; // address[] memory _users; // uint256[] memory _beans; // for (uint8 i = 0; i < _orders.length; i++) { // _users[i] = _orders[i].user; // _beans[i] = _orders[i].bean; // } // return (_users, _beans); // } } contract MosesContract is GuessBaseBiz { // // MOS合约地址 // address internal INITIAL_MOS_CONTRACT_ADDRESS = 0x001439818dd11823c45fff01af0cd6c50934e27ac0; // // 平台地址 // address internal INITIAL_PLATFORM_ADDRESS = 0x00063150d38ac0b008abe411ab7e4fb8228ecead3e; // // 平台手续费 // uint256 internal INITIAL_SERVICE_CHARGE_RATE = 5; // // 平台维护费 // uint256 internal INITIAL_MAINTENANCE_CHARGE_RATE = 0; // // 单次上限 // uint256 UPPER_LIMIT = 1000 * 10 ** 18; // // 单次下限 // uint256 LOWER_LIMIT = 1 * 10 ** 18; constructor(address[] _operators) public { } /** * Recovery donated ether */ function collectEtherBack(address collectorAddress) public onlyOwner { } /** * Recycle other ERC20 tokens */ function collectOtherTokens(address tokenContract, address collectorAddress) onlyOwner public returns (bool) { } }
!disabled(id),"The guess disabled!!!"
283,631
!disabled(id)
"The guess cannot participate !!!"
pragma solidity ^0.4.24; contract Ownable { address public owner; mapping(address => uint8) public operators; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Throws if called by any account other than the operator */ modifier onlyOperator() { } /** * @dev operator management */ function operatorManager(address[] _operators,uint8 flag) public onlyOwner returns(bool){ } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused returns (bool) { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused returns (bool) { } } // ERC20 Token contract ERC20Token { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); } /** * 预测事件合约对象 * @author linq <[email protected]> */ contract GuessBaseBiz is Pausable { // MOS合约地址 address public mosContractAddress = 0x420a43153DA24B9e2aedcEC2B8158A8653a3317e; // 平台地址 address public platformAddress = 0xe0F969610699f88612518930D88C0dAB39f67985; // 平台手续费 uint256 public serviceChargeRate = 5; // 平台维护费 uint256 public maintenanceChargeRate = 0; // 单次上限 uint256 public upperLimit = 1000 * 10 ** 18; // 单次下限 uint256 public lowerLimit = 1 * 10 ** 18; ERC20Token MOS; // =============================== Event =============================== // 创建预测事件成功后广播 event CreateGuess(uint256 indexed id, address indexed creator); // 直投事件 // event Deposit(uint256 indexed id,address indexed participant,uint256 optionId,uint256 bean); // 代投事件 event DepositAgent(address indexed participant, uint256 indexed id, uint256 optionId, uint256 totalBean); // 公布选项事件 event PublishOption(uint256 indexed id, uint256 indexed optionId, uint256 odds); // 预测事件流拍事件 event Abortive(uint256 indexed id); constructor() public { } struct Guess { // 预测事件ID uint256 id; // 预测事件创建者 address creator; // 预测标题 string title; // 数据源名称+数据源链接 string source; // 预测事件分类 string category; // 是否下架 1.是 0.否 uint8 disabled; // 预测事件描述 bytes desc; // 开始时间 uint256 startAt; // 封盘时间 uint256 endAt; // 是否结束 uint8 finished; // 是否流拍 uint8 abortive; // // 选项ID // uint256[] optionIds; // // 选项名称 // bytes32[] optionNames; } // // 订单 // struct Order { // address user; // uint256 bean; // } // 平台代理订单 struct AgentOrder { address participant; string ipfsBase58; string dataHash; uint256 bean; } struct Option { // 选项ID uint256 id; // 选项名称 bytes32 name; } // 存储所有的预测事件 mapping (uint256 => Guess) public guesses; // 存储所有的预测事件选项 mapping (uint256 => Option[]) public options; // 存储所有用户直投订单 // mapping (uint256 => mapping(uint256 => Order[])) public orders; // 通过预测事件ID和选项ID,存储该选项所有参与的地址 mapping (uint256 => mapping (uint256 => AgentOrder[])) public agentOrders; // 存储事件总投注 mapping (uint256 => uint256) public guessTotalBean; // 存储某选项总投注 mapping (uint256 => mapping(uint256 => uint256)) public optionTotalBean; // 存储某选项某用户总投注 // mapping (uint256 => mapping(address => uint256)) public userOptionTotalBean; /** * 预测事件状态 */ enum GuessStatus { // 未开始 NotStarted, // 进行中 Progress, // 待公布 Deadline, // 已结束 Finished, // 流拍 Abortive } // 判断是否为禁用状态 function disabled(uint256 id) public view returns(bool) { } /** * 获取预测事件状态 * * 未开始 * 未到开始时间 * 进行中 * 在开始到结束时间范围内 * 待公布/已截止 * 已经过了结束时间,并且finished为0 * 已结束 * 已经过了结束时间,并且finished为1,abortive=0 * 流拍 * abortive=1,并且finished为1 流拍。(退币) */ function getGuessStatus(uint256 guessId) internal view returns(GuessStatus) { } //判断选项是否存在 function optionExist(uint256 guessId,uint256 optionId) internal view returns(bool){ } function() public payable { } /** * 修改预测系统变量 * @author linq */ function modifyVariable ( address _platformAddress, uint256 _serviceChargeRate, uint256 _maintenanceChargeRate, uint256 _upperLimit, uint256 _lowerLimit ) public onlyOwner { } // 创建预测事件 function createGuess( uint256 _id, string _title, string _source, string _category, uint8 _disabled, bytes _desc, uint256 _startAt, uint256 _endAt, uint256[] _optionId, bytes32[] _optionName ) public whenNotPaused { } /** * 审核|更新预测事件 */ function auditGuess ( uint256 _id, string _title, uint8 _disabled, bytes _desc, uint256 _endAt) public onlyOwner { } /** * 用户直接参与事件预测 */ // function deposit(uint256 id, uint256 optionId, uint256 bean) // public // payable // whenNotPaused // returns (bool) { // require(!disabled(id), "The guess disabled!!!"); // require(getGuessStatus(id) == GuessStatus.Progress, "The guess cannot participate !!!"); // require(bean >= lowerLimit && bean <= upperLimit, "Bean quantity nonconformity!!!"); // // 存储用户订单 // Order memory order = Order(msg.sender, bean); // orders[id][optionId].push(order); // // 某用户订单该选项总投注数 // userOptionTotalBean[optionId][msg.sender] += bean; // // 存储事件总投注 // guessTotalBean[id] += bean; // MOS.transferFrom(msg.sender, address(this), bean); // emit Deposit(id, msg.sender, optionId, bean); // return true; // } /** * 平台代理用户参与事件预测 */ function depositAgent ( uint256 id, uint256 optionId, string ipfsBase58, string dataHash, uint256 totalBean ) public onlyOperator whenNotPaused returns (bool) { require(guesses[id].id != uint256(0), "The current guess not exists !!!"); require(optionExist(id, optionId),"The current optionId not exists !!!"); require(!disabled(id), "The guess disabled!!!"); require(<FILL_ME>) // 通过预测事件ID和选项ID,存储该选项所有参与的地址 AgentOrder[] storage _agentOrders = agentOrders[id][optionId]; AgentOrder memory agentOrder = AgentOrder(msg.sender,ipfsBase58,dataHash,totalBean); _agentOrders.push(agentOrder); MOS.transferFrom(msg.sender, address(this), totalBean); // 某用户订单该选项总投注数 // userOptionTotalBean[optionId][msg.sender] += totalBean; // 订单选项总投注 optionTotalBean[id][optionId] += totalBean; // 存储事件总投注 guessTotalBean[id] += totalBean; emit DepositAgent(msg.sender, id, optionId, totalBean); return true; } /** * 公布事件的结果 */ function publishOption(uint256 id, uint256 optionId) public onlyOwner whenNotPaused returns (bool) { } /** * 事件流拍 */ function abortive(uint256 id) public onlyOwner returns(bool) { } // /** // * 获取事件投注总额 // */ // function guessTotalBeanOf(uint256 id) public view returns(uint256){ // return guessTotalBean[id]; // } // /** // * 获取事件选项代投订单信息 // */ // function agentOrdersOf(uint256 id,uint256 optionId) // public // view // returns( // address participant, // address[] users, // uint256[] beans // ) { // AgentOrder[] memory agentOrder = agentOrders[id][optionId]; // return ( // agentOrder.participant, // agentOrder.users, // agentOrder.beans // ); // } // /** // * 获取用户直投订单 // */ // function ordersOf(uint256 id, uint256 optionId) public view // returns(address[] users,uint256[] beans){ // Order[] memory _orders = orders[id][optionId]; // address[] memory _users; // uint256[] memory _beans; // for (uint8 i = 0; i < _orders.length; i++) { // _users[i] = _orders[i].user; // _beans[i] = _orders[i].bean; // } // return (_users, _beans); // } } contract MosesContract is GuessBaseBiz { // // MOS合约地址 // address internal INITIAL_MOS_CONTRACT_ADDRESS = 0x001439818dd11823c45fff01af0cd6c50934e27ac0; // // 平台地址 // address internal INITIAL_PLATFORM_ADDRESS = 0x00063150d38ac0b008abe411ab7e4fb8228ecead3e; // // 平台手续费 // uint256 internal INITIAL_SERVICE_CHARGE_RATE = 5; // // 平台维护费 // uint256 internal INITIAL_MAINTENANCE_CHARGE_RATE = 0; // // 单次上限 // uint256 UPPER_LIMIT = 1000 * 10 ** 18; // // 单次下限 // uint256 LOWER_LIMIT = 1 * 10 ** 18; constructor(address[] _operators) public { } /** * Recovery donated ether */ function collectEtherBack(address collectorAddress) public onlyOwner { } /** * Recycle other ERC20 tokens */ function collectOtherTokens(address tokenContract, address collectorAddress) onlyOwner public returns (bool) { } }
getGuessStatus(id)==GuessStatus.Deadline,"The guess cannot participate !!!"
283,631
getGuessStatus(id)==GuessStatus.Deadline
"The guess cannot abortive !!!"
pragma solidity ^0.4.24; contract Ownable { address public owner; mapping(address => uint8) public operators; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Throws if called by any account other than the operator */ modifier onlyOperator() { } /** * @dev operator management */ function operatorManager(address[] _operators,uint8 flag) public onlyOwner returns(bool){ } /** * @dev Allows the current owner to transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } /** * @title Pausable * @dev Base contract which allows children to implement an emergency stop mechanism. */ contract Pausable is Ownable { event Pause(); event Unpause(); bool public paused = false; /** * @dev modifier to allow actions only when the contract IS paused */ modifier whenNotPaused() { } /** * @dev modifier to allow actions only when the contract IS NOT paused */ modifier whenPaused { } /** * @dev called by the owner to pause, triggers stopped state */ function pause() public onlyOwner whenNotPaused returns (bool) { } /** * @dev called by the owner to unpause, returns to normal state */ function unpause() public onlyOwner whenPaused returns (bool) { } } // ERC20 Token contract ERC20Token { function balanceOf(address _owner) constant public returns (uint256); function transfer(address _to, uint256 _value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); } /** * 预测事件合约对象 * @author linq <[email protected]> */ contract GuessBaseBiz is Pausable { // MOS合约地址 address public mosContractAddress = 0x420a43153DA24B9e2aedcEC2B8158A8653a3317e; // 平台地址 address public platformAddress = 0xe0F969610699f88612518930D88C0dAB39f67985; // 平台手续费 uint256 public serviceChargeRate = 5; // 平台维护费 uint256 public maintenanceChargeRate = 0; // 单次上限 uint256 public upperLimit = 1000 * 10 ** 18; // 单次下限 uint256 public lowerLimit = 1 * 10 ** 18; ERC20Token MOS; // =============================== Event =============================== // 创建预测事件成功后广播 event CreateGuess(uint256 indexed id, address indexed creator); // 直投事件 // event Deposit(uint256 indexed id,address indexed participant,uint256 optionId,uint256 bean); // 代投事件 event DepositAgent(address indexed participant, uint256 indexed id, uint256 optionId, uint256 totalBean); // 公布选项事件 event PublishOption(uint256 indexed id, uint256 indexed optionId, uint256 odds); // 预测事件流拍事件 event Abortive(uint256 indexed id); constructor() public { } struct Guess { // 预测事件ID uint256 id; // 预测事件创建者 address creator; // 预测标题 string title; // 数据源名称+数据源链接 string source; // 预测事件分类 string category; // 是否下架 1.是 0.否 uint8 disabled; // 预测事件描述 bytes desc; // 开始时间 uint256 startAt; // 封盘时间 uint256 endAt; // 是否结束 uint8 finished; // 是否流拍 uint8 abortive; // // 选项ID // uint256[] optionIds; // // 选项名称 // bytes32[] optionNames; } // // 订单 // struct Order { // address user; // uint256 bean; // } // 平台代理订单 struct AgentOrder { address participant; string ipfsBase58; string dataHash; uint256 bean; } struct Option { // 选项ID uint256 id; // 选项名称 bytes32 name; } // 存储所有的预测事件 mapping (uint256 => Guess) public guesses; // 存储所有的预测事件选项 mapping (uint256 => Option[]) public options; // 存储所有用户直投订单 // mapping (uint256 => mapping(uint256 => Order[])) public orders; // 通过预测事件ID和选项ID,存储该选项所有参与的地址 mapping (uint256 => mapping (uint256 => AgentOrder[])) public agentOrders; // 存储事件总投注 mapping (uint256 => uint256) public guessTotalBean; // 存储某选项总投注 mapping (uint256 => mapping(uint256 => uint256)) public optionTotalBean; // 存储某选项某用户总投注 // mapping (uint256 => mapping(address => uint256)) public userOptionTotalBean; /** * 预测事件状态 */ enum GuessStatus { // 未开始 NotStarted, // 进行中 Progress, // 待公布 Deadline, // 已结束 Finished, // 流拍 Abortive } // 判断是否为禁用状态 function disabled(uint256 id) public view returns(bool) { } /** * 获取预测事件状态 * * 未开始 * 未到开始时间 * 进行中 * 在开始到结束时间范围内 * 待公布/已截止 * 已经过了结束时间,并且finished为0 * 已结束 * 已经过了结束时间,并且finished为1,abortive=0 * 流拍 * abortive=1,并且finished为1 流拍。(退币) */ function getGuessStatus(uint256 guessId) internal view returns(GuessStatus) { } //判断选项是否存在 function optionExist(uint256 guessId,uint256 optionId) internal view returns(bool){ } function() public payable { } /** * 修改预测系统变量 * @author linq */ function modifyVariable ( address _platformAddress, uint256 _serviceChargeRate, uint256 _maintenanceChargeRate, uint256 _upperLimit, uint256 _lowerLimit ) public onlyOwner { } // 创建预测事件 function createGuess( uint256 _id, string _title, string _source, string _category, uint8 _disabled, bytes _desc, uint256 _startAt, uint256 _endAt, uint256[] _optionId, bytes32[] _optionName ) public whenNotPaused { } /** * 审核|更新预测事件 */ function auditGuess ( uint256 _id, string _title, uint8 _disabled, bytes _desc, uint256 _endAt) public onlyOwner { } /** * 用户直接参与事件预测 */ // function deposit(uint256 id, uint256 optionId, uint256 bean) // public // payable // whenNotPaused // returns (bool) { // require(!disabled(id), "The guess disabled!!!"); // require(getGuessStatus(id) == GuessStatus.Progress, "The guess cannot participate !!!"); // require(bean >= lowerLimit && bean <= upperLimit, "Bean quantity nonconformity!!!"); // // 存储用户订单 // Order memory order = Order(msg.sender, bean); // orders[id][optionId].push(order); // // 某用户订单该选项总投注数 // userOptionTotalBean[optionId][msg.sender] += bean; // // 存储事件总投注 // guessTotalBean[id] += bean; // MOS.transferFrom(msg.sender, address(this), bean); // emit Deposit(id, msg.sender, optionId, bean); // return true; // } /** * 平台代理用户参与事件预测 */ function depositAgent ( uint256 id, uint256 optionId, string ipfsBase58, string dataHash, uint256 totalBean ) public onlyOperator whenNotPaused returns (bool) { } /** * 公布事件的结果 */ function publishOption(uint256 id, uint256 optionId) public onlyOwner whenNotPaused returns (bool) { } /** * 事件流拍 */ function abortive(uint256 id) public onlyOwner returns(bool) { require(guesses[id].id != uint256(0), "The current guess not exists !!!"); require(<FILL_ME>) Guess storage guess = guesses[id]; guess.abortive = 1; guess.finished = 1; // 退回 Option[] memory _options = options[id]; for(uint8 i = 0; i< _options.length;i ++){ //代投退回 AgentOrder[] memory _agentOrders = agentOrders[id][_options[i].id]; for(uint8 j = 0; j < _agentOrders.length; j++){ uint256 _bean = _agentOrders[j].bean; MOS.transfer(_agentOrders[j].participant, _bean); } } emit Abortive(id); return true; } // /** // * 获取事件投注总额 // */ // function guessTotalBeanOf(uint256 id) public view returns(uint256){ // return guessTotalBean[id]; // } // /** // * 获取事件选项代投订单信息 // */ // function agentOrdersOf(uint256 id,uint256 optionId) // public // view // returns( // address participant, // address[] users, // uint256[] beans // ) { // AgentOrder[] memory agentOrder = agentOrders[id][optionId]; // return ( // agentOrder.participant, // agentOrder.users, // agentOrder.beans // ); // } // /** // * 获取用户直投订单 // */ // function ordersOf(uint256 id, uint256 optionId) public view // returns(address[] users,uint256[] beans){ // Order[] memory _orders = orders[id][optionId]; // address[] memory _users; // uint256[] memory _beans; // for (uint8 i = 0; i < _orders.length; i++) { // _users[i] = _orders[i].user; // _beans[i] = _orders[i].bean; // } // return (_users, _beans); // } } contract MosesContract is GuessBaseBiz { // // MOS合约地址 // address internal INITIAL_MOS_CONTRACT_ADDRESS = 0x001439818dd11823c45fff01af0cd6c50934e27ac0; // // 平台地址 // address internal INITIAL_PLATFORM_ADDRESS = 0x00063150d38ac0b008abe411ab7e4fb8228ecead3e; // // 平台手续费 // uint256 internal INITIAL_SERVICE_CHARGE_RATE = 5; // // 平台维护费 // uint256 internal INITIAL_MAINTENANCE_CHARGE_RATE = 0; // // 单次上限 // uint256 UPPER_LIMIT = 1000 * 10 ** 18; // // 单次下限 // uint256 LOWER_LIMIT = 1 * 10 ** 18; constructor(address[] _operators) public { } /** * Recovery donated ether */ function collectEtherBack(address collectorAddress) public onlyOwner { } /** * Recycle other ERC20 tokens */ function collectOtherTokens(address tokenContract, address collectorAddress) onlyOwner public returns (bool) { } }
getGuessStatus(id)==GuessStatus.Progress||getGuessStatus(id)==GuessStatus.Deadline,"The guess cannot abortive !!!"
283,631
getGuessStatus(id)==GuessStatus.Progress||getGuessStatus(id)==GuessStatus.Deadline
"TX_NOT_FULLY_CONFIRMED"
/* Copyright 2019 ZeroEx Intl. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ pragma solidity ^0.5.9; import "@0x/contracts-utils/contracts/src/LibSafeMath.sol"; import "./MultiSigWallet.sol"; /// @title Multisignature wallet with time lock- Allows multiple parties to execute a transaction after a time lock has passed. /// @author Amir Bandeali - <[email protected]> // solhint-disable not-rely-on-time contract MultiSigWalletWithTimeLock is MultiSigWallet { using LibSafeMath for uint256; event ConfirmationTimeSet(uint256 indexed transactionId, uint256 confirmationTime); event TimeLockChange(uint256 secondsTimeLocked); uint256 public secondsTimeLocked; mapping (uint256 => uint256) public confirmationTimes; modifier fullyConfirmed(uint256 transactionId) { require(<FILL_ME>) _; } modifier pastTimeLock(uint256 transactionId) { } /// @dev Contract constructor sets initial owners, required number of confirmations, and time lock. /// @param _owners List of initial owners. /// @param _required Number of required confirmations. /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds. constructor ( address[] memory _owners, uint256 _required, uint256 _secondsTimeLocked ) public MultiSigWallet(_owners, _required) { } /// @dev Changes the duration of the time lock for transactions. /// @param _secondsTimeLocked Duration needed after a transaction is confirmed and before it becomes executable, in seconds. function changeTimeLock(uint256 _secondsTimeLocked) public onlyWallet { } /// @dev Allows an owner to confirm a transaction. /// @param transactionId Transaction ID. function confirmTransaction(uint256 transactionId) public ownerExists(msg.sender) transactionExists(transactionId) notConfirmed(transactionId, msg.sender) { } /// @dev Allows anyone to execute a confirmed transaction. /// @param transactionId Transaction ID. function executeTransaction(uint256 transactionId) public notExecuted(transactionId) fullyConfirmed(transactionId) pastTimeLock(transactionId) { } /// @dev Sets the time of when a submission first passed. function _setConfirmationTime(uint256 transactionId, uint256 confirmationTime) internal { } }
isConfirmed(transactionId),"TX_NOT_FULLY_CONFIRMED"
283,646
isConfirmed(transactionId)
"SeekReward: Invalid address"
/** *Submitted for verification at Etherscan.io on 2021-04-28 */ pragma solidity 0.6.0; interface IERC777 { function name() external view returns(string memory); function symbol() external view returns(string memory); function decimals() external view returns(uint8); function totalSupply() external view returns(uint256); function balanceOf(address owner) external view returns(uint256); function transfer(address to, uint256 amount) external returns(bool); function transferFrom(address from, address to, uint256 amount) external returns(bool); function approve(address spender, uint256 amount) external returns(bool); function allowance(address owner, address spender) external view returns(uint256); function burnBalance(address _addr, uint _amount) external; function mint(address _tokenHolder, uint256 _amount, bytes calldata _data, bytes calldata _operatorData) external; function defaultOperators() external view returns(address[] memory); // solhint-disable-next-line no-simple-event-func-name event Transfer(address indexed from, address indexed to, uint256 amount); event Approval(address indexed owner, address indexed spender, uint256 amount); } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns(uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns(uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. * * _Available since v2.4.0._ */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns(uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns(uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns(uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns(uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. * (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns(uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. * (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns(uint256) { } } contract SeekReward { using SafeMath for uint256; // Investor details struct user { uint256 cycle; address upline; uint256 referrals; uint256 payouts; uint256 referalBonus; uint256 matchBonus; uint256 depositAmount; uint256 depositPayouts; uint40 depositTime; uint256 totalDeposits; uint256 totalStructure; } // Token instance IERC777 public token; // Mapping users details by address mapping(address => user)public users; // Contract status bool public lockStatus; // Admin1 address address public admin1; // Admin2 address address public admin2; // Total levels uint[]public Levels; // Total users count uint256 public totalUsers = 1; // Total deposit amount. uint256 public totalDeposited; // Total withdraw amount uint256 public totalWithdraw; // Matching bonus event event MatchBonus(address indexed from, address indexed to, uint value, uint time); // Withdraw event event Withdraw(address indexed from, uint value, uint time); // Deposit event event Deposit(address indexed from, address indexed refer, uint value, uint time); // Admin withdraw event event AdminEarnings(address indexed user, uint value, uint time); // User withdraw limt event event LimitReached(address indexed from, uint value, uint time); /** * @dev Initializes the contract setting the owners and token. */ constructor(address _owner1, address _owner2, address _token) public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Throws if lockStatus is true */ modifier isLock() { } /** * @dev Throws if called by other contract */ modifier isContractCheck(address _user) { require(<FILL_ME>) _; } function _setUpline(address _addr, address _upline) private { } function _deposit(address _addr, uint256 _amount) private { } /** * @dev deposit: User deposit with 1 seek token * 5% adminshare split into 2 accounts * @param _upline: Referal address * @param amount:1st deposit minimum 1 seek & maximum 150 for cycle 1 * Next depsoit amount based on previous deposit amount and maximum amount based on cycles */ function deposit(address _upline, uint amount) external isLock isContractCheck(msg.sender) { } function _matchBonus(address _user, uint _amount) private { } /** * @dev withdraw: User can get amount till maximum payout reach. * maximum payout based on(daily ROI,matchbonus) * maximum payout limit 210 percentage */ function withdraw() external isLock { } /** * @dev adminWithdraw: owner invokes the function * owner can get referbonus, matchbonus */ function adminWithdraw() external onlyOwner { } /** * @dev maxPayoutOf: Amount calculate by 210 percentage */ function maxPayoutOf(uint256 _amount) external pure returns(uint256) { } /** * @dev payoutOf: Users daily ROI and maximum payout will be show */ function payoutOf(address _addr) external view returns(uint256 payout, uint256 max_payout) { } /** * @dev userInfo: Returns upline,depositTime,depositAmount,payouts,match_bonus */ function userInfo(address _addr) external view returns(address upline, uint40 deposit_time, uint256 deposit_amount, uint256 payouts, uint256 match_bonus) { } /** * @dev userInfoTotals: Returns users referrals count, totalDeposit, totalStructure */ function userInfoTotals(address _addr) external view returns(uint256 referrals, uint256 total_deposits, uint256 total_structure) { } /** * @dev contractInfo: Returns total users, totalDeposited, totalWithdraw */ function contractInfo() external view returns(uint256 _total_users, uint256 _total_deposited, uint256 _total_withdraw) { } /** * @dev contractLock: For contract status */ function contractLock(bool _lockStatus) public onlyOwner returns(bool) { } /** * @dev failSafe: Returns transfer token */ function failSafe(address _toUser, uint _amount) external onlyOwner returns(bool) { } /** * @dev isContract: Returns true if account is a contract */ function isContract(address _account) public view returns(bool) { } }
!isContract(_user),"SeekReward: Invalid address"
283,661
!isContract(_user)
"No upline"
/** *Submitted for verification at Etherscan.io on 2021-04-28 */ pragma solidity 0.6.0; interface IERC777 { function name() external view returns(string memory); function symbol() external view returns(string memory); function decimals() external view returns(uint8); function totalSupply() external view returns(uint256); function balanceOf(address owner) external view returns(uint256); function transfer(address to, uint256 amount) external returns(bool); function transferFrom(address from, address to, uint256 amount) external returns(bool); function approve(address spender, uint256 amount) external returns(bool); function allowance(address owner, address spender) external view returns(uint256); function burnBalance(address _addr, uint _amount) external; function mint(address _tokenHolder, uint256 _amount, bytes calldata _data, bytes calldata _operatorData) external; function defaultOperators() external view returns(address[] memory); // solhint-disable-next-line no-simple-event-func-name event Transfer(address indexed from, address indexed to, uint256 amount); event Approval(address indexed owner, address indexed spender, uint256 amount); } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns(uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns(uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. * * _Available since v2.4.0._ */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns(uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns(uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns(uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns(uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. * (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns(uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. * (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns(uint256) { } } contract SeekReward { using SafeMath for uint256; // Investor details struct user { uint256 cycle; address upline; uint256 referrals; uint256 payouts; uint256 referalBonus; uint256 matchBonus; uint256 depositAmount; uint256 depositPayouts; uint40 depositTime; uint256 totalDeposits; uint256 totalStructure; } // Token instance IERC777 public token; // Mapping users details by address mapping(address => user)public users; // Contract status bool public lockStatus; // Admin1 address address public admin1; // Admin2 address address public admin2; // Total levels uint[]public Levels; // Total users count uint256 public totalUsers = 1; // Total deposit amount. uint256 public totalDeposited; // Total withdraw amount uint256 public totalWithdraw; // Matching bonus event event MatchBonus(address indexed from, address indexed to, uint value, uint time); // Withdraw event event Withdraw(address indexed from, uint value, uint time); // Deposit event event Deposit(address indexed from, address indexed refer, uint value, uint time); // Admin withdraw event event AdminEarnings(address indexed user, uint value, uint time); // User withdraw limt event event LimitReached(address indexed from, uint value, uint time); /** * @dev Initializes the contract setting the owners and token. */ constructor(address _owner1, address _owner2, address _token) public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Throws if lockStatus is true */ modifier isLock() { } /** * @dev Throws if called by other contract */ modifier isContractCheck(address _user) { } function _setUpline(address _addr, address _upline) private { } function _deposit(address _addr, uint256 _amount) private { require(<FILL_ME>) if (users[_addr].depositTime > 0) { users[_addr].cycle++; require(users[_addr].payouts >= this.maxPayoutOf(users[_addr].depositAmount), "SeekReward: Deposit already exists"); require(_amount >= users[_addr].depositAmount && _amount <= Levels[users[_addr].cycle > Levels.length - 1 ?Levels.length - 1 : users[_addr].cycle], "SeekReward: Bad amount"); } else { require(_amount >= 0.5e18 && _amount <= Levels[0], "SeekReward: Bad amount"); } require(token.transferFrom(msg.sender, address(this), _amount), "Seekreward: transaction failed"); users[_addr].payouts = 0; users[_addr].depositAmount = _amount; users[_addr].depositPayouts = 0; users[_addr].depositTime = uint40(block.timestamp); users[_addr].referalBonus = 0; users[_addr].matchBonus = 0; users[_addr].totalDeposits = users[_addr].totalDeposits.add(_amount); totalDeposited = totalDeposited.add(_amount); address upline = users[_addr].upline; address up = users[users[_addr].upline].upline; if (upline != address(0)) { token.transfer(upline, _amount.mul(10e18).div(100e18)); // 10% for direct referer users[upline].referalBonus = users[upline].referalBonus.add(_amount.mul(10e18).div(100e18)); } if (up != address(0)) { token.transfer(up, _amount.mul(5e18).div(100e18)); // 5% for indirect referer users[up].referalBonus = users[up].referalBonus.add(_amount.mul(5e18).div(100e18)); } uint adminFee = _amount.mul(5e18).div(100e18); token.transfer(admin1, adminFee.div(2)); // 2.5% admin1 token.transfer(admin2, adminFee.div(2)); // 2.5% admin2 adminFee = 0; emit Deposit(_addr, users[_addr].upline, _amount, block.timestamp); } /** * @dev deposit: User deposit with 1 seek token * 5% adminshare split into 2 accounts * @param _upline: Referal address * @param amount:1st deposit minimum 1 seek & maximum 150 for cycle 1 * Next depsoit amount based on previous deposit amount and maximum amount based on cycles */ function deposit(address _upline, uint amount) external isLock isContractCheck(msg.sender) { } function _matchBonus(address _user, uint _amount) private { } /** * @dev withdraw: User can get amount till maximum payout reach. * maximum payout based on(daily ROI,matchbonus) * maximum payout limit 210 percentage */ function withdraw() external isLock { } /** * @dev adminWithdraw: owner invokes the function * owner can get referbonus, matchbonus */ function adminWithdraw() external onlyOwner { } /** * @dev maxPayoutOf: Amount calculate by 210 percentage */ function maxPayoutOf(uint256 _amount) external pure returns(uint256) { } /** * @dev payoutOf: Users daily ROI and maximum payout will be show */ function payoutOf(address _addr) external view returns(uint256 payout, uint256 max_payout) { } /** * @dev userInfo: Returns upline,depositTime,depositAmount,payouts,match_bonus */ function userInfo(address _addr) external view returns(address upline, uint40 deposit_time, uint256 deposit_amount, uint256 payouts, uint256 match_bonus) { } /** * @dev userInfoTotals: Returns users referrals count, totalDeposit, totalStructure */ function userInfoTotals(address _addr) external view returns(uint256 referrals, uint256 total_deposits, uint256 total_structure) { } /** * @dev contractInfo: Returns total users, totalDeposited, totalWithdraw */ function contractInfo() external view returns(uint256 _total_users, uint256 _total_deposited, uint256 _total_withdraw) { } /** * @dev contractLock: For contract status */ function contractLock(bool _lockStatus) public onlyOwner returns(bool) { } /** * @dev failSafe: Returns transfer token */ function failSafe(address _toUser, uint _amount) external onlyOwner returns(bool) { } /** * @dev isContract: Returns true if account is a contract */ function isContract(address _account) public view returns(bool) { } }
users[_addr].upline!=address(0)||_addr==admin1,"No upline"
283,661
users[_addr].upline!=address(0)||_addr==admin1
"SeekReward: Deposit already exists"
/** *Submitted for verification at Etherscan.io on 2021-04-28 */ pragma solidity 0.6.0; interface IERC777 { function name() external view returns(string memory); function symbol() external view returns(string memory); function decimals() external view returns(uint8); function totalSupply() external view returns(uint256); function balanceOf(address owner) external view returns(uint256); function transfer(address to, uint256 amount) external returns(bool); function transferFrom(address from, address to, uint256 amount) external returns(bool); function approve(address spender, uint256 amount) external returns(bool); function allowance(address owner, address spender) external view returns(uint256); function burnBalance(address _addr, uint _amount) external; function mint(address _tokenHolder, uint256 _amount, bytes calldata _data, bytes calldata _operatorData) external; function defaultOperators() external view returns(address[] memory); // solhint-disable-next-line no-simple-event-func-name event Transfer(address indexed from, address indexed to, uint256 amount); event Approval(address indexed owner, address indexed spender, uint256 amount); } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns(uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns(uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. * * _Available since v2.4.0._ */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns(uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns(uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns(uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns(uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. * (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns(uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. * (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns(uint256) { } } contract SeekReward { using SafeMath for uint256; // Investor details struct user { uint256 cycle; address upline; uint256 referrals; uint256 payouts; uint256 referalBonus; uint256 matchBonus; uint256 depositAmount; uint256 depositPayouts; uint40 depositTime; uint256 totalDeposits; uint256 totalStructure; } // Token instance IERC777 public token; // Mapping users details by address mapping(address => user)public users; // Contract status bool public lockStatus; // Admin1 address address public admin1; // Admin2 address address public admin2; // Total levels uint[]public Levels; // Total users count uint256 public totalUsers = 1; // Total deposit amount. uint256 public totalDeposited; // Total withdraw amount uint256 public totalWithdraw; // Matching bonus event event MatchBonus(address indexed from, address indexed to, uint value, uint time); // Withdraw event event Withdraw(address indexed from, uint value, uint time); // Deposit event event Deposit(address indexed from, address indexed refer, uint value, uint time); // Admin withdraw event event AdminEarnings(address indexed user, uint value, uint time); // User withdraw limt event event LimitReached(address indexed from, uint value, uint time); /** * @dev Initializes the contract setting the owners and token. */ constructor(address _owner1, address _owner2, address _token) public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Throws if lockStatus is true */ modifier isLock() { } /** * @dev Throws if called by other contract */ modifier isContractCheck(address _user) { } function _setUpline(address _addr, address _upline) private { } function _deposit(address _addr, uint256 _amount) private { require(users[_addr].upline != address(0) || _addr == admin1, "No upline"); if (users[_addr].depositTime > 0) { users[_addr].cycle++; require(<FILL_ME>) require(_amount >= users[_addr].depositAmount && _amount <= Levels[users[_addr].cycle > Levels.length - 1 ?Levels.length - 1 : users[_addr].cycle], "SeekReward: Bad amount"); } else { require(_amount >= 0.5e18 && _amount <= Levels[0], "SeekReward: Bad amount"); } require(token.transferFrom(msg.sender, address(this), _amount), "Seekreward: transaction failed"); users[_addr].payouts = 0; users[_addr].depositAmount = _amount; users[_addr].depositPayouts = 0; users[_addr].depositTime = uint40(block.timestamp); users[_addr].referalBonus = 0; users[_addr].matchBonus = 0; users[_addr].totalDeposits = users[_addr].totalDeposits.add(_amount); totalDeposited = totalDeposited.add(_amount); address upline = users[_addr].upline; address up = users[users[_addr].upline].upline; if (upline != address(0)) { token.transfer(upline, _amount.mul(10e18).div(100e18)); // 10% for direct referer users[upline].referalBonus = users[upline].referalBonus.add(_amount.mul(10e18).div(100e18)); } if (up != address(0)) { token.transfer(up, _amount.mul(5e18).div(100e18)); // 5% for indirect referer users[up].referalBonus = users[up].referalBonus.add(_amount.mul(5e18).div(100e18)); } uint adminFee = _amount.mul(5e18).div(100e18); token.transfer(admin1, adminFee.div(2)); // 2.5% admin1 token.transfer(admin2, adminFee.div(2)); // 2.5% admin2 adminFee = 0; emit Deposit(_addr, users[_addr].upline, _amount, block.timestamp); } /** * @dev deposit: User deposit with 1 seek token * 5% adminshare split into 2 accounts * @param _upline: Referal address * @param amount:1st deposit minimum 1 seek & maximum 150 for cycle 1 * Next depsoit amount based on previous deposit amount and maximum amount based on cycles */ function deposit(address _upline, uint amount) external isLock isContractCheck(msg.sender) { } function _matchBonus(address _user, uint _amount) private { } /** * @dev withdraw: User can get amount till maximum payout reach. * maximum payout based on(daily ROI,matchbonus) * maximum payout limit 210 percentage */ function withdraw() external isLock { } /** * @dev adminWithdraw: owner invokes the function * owner can get referbonus, matchbonus */ function adminWithdraw() external onlyOwner { } /** * @dev maxPayoutOf: Amount calculate by 210 percentage */ function maxPayoutOf(uint256 _amount) external pure returns(uint256) { } /** * @dev payoutOf: Users daily ROI and maximum payout will be show */ function payoutOf(address _addr) external view returns(uint256 payout, uint256 max_payout) { } /** * @dev userInfo: Returns upline,depositTime,depositAmount,payouts,match_bonus */ function userInfo(address _addr) external view returns(address upline, uint40 deposit_time, uint256 deposit_amount, uint256 payouts, uint256 match_bonus) { } /** * @dev userInfoTotals: Returns users referrals count, totalDeposit, totalStructure */ function userInfoTotals(address _addr) external view returns(uint256 referrals, uint256 total_deposits, uint256 total_structure) { } /** * @dev contractInfo: Returns total users, totalDeposited, totalWithdraw */ function contractInfo() external view returns(uint256 _total_users, uint256 _total_deposited, uint256 _total_withdraw) { } /** * @dev contractLock: For contract status */ function contractLock(bool _lockStatus) public onlyOwner returns(bool) { } /** * @dev failSafe: Returns transfer token */ function failSafe(address _toUser, uint _amount) external onlyOwner returns(bool) { } /** * @dev isContract: Returns true if account is a contract */ function isContract(address _account) public view returns(bool) { } }
users[_addr].payouts>=this.maxPayoutOf(users[_addr].depositAmount),"SeekReward: Deposit already exists"
283,661
users[_addr].payouts>=this.maxPayoutOf(users[_addr].depositAmount)
"SeekReward: Full payouts"
/** *Submitted for verification at Etherscan.io on 2021-04-28 */ pragma solidity 0.6.0; interface IERC777 { function name() external view returns(string memory); function symbol() external view returns(string memory); function decimals() external view returns(uint8); function totalSupply() external view returns(uint256); function balanceOf(address owner) external view returns(uint256); function transfer(address to, uint256 amount) external returns(bool); function transferFrom(address from, address to, uint256 amount) external returns(bool); function approve(address spender, uint256 amount) external returns(bool); function allowance(address owner, address spender) external view returns(uint256); function burnBalance(address _addr, uint _amount) external; function mint(address _tokenHolder, uint256 _amount, bytes calldata _data, bytes calldata _operatorData) external; function defaultOperators() external view returns(address[] memory); // solhint-disable-next-line no-simple-event-func-name event Transfer(address indexed from, address indexed to, uint256 amount); event Approval(address indexed owner, address indexed spender, uint256 amount); } library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns(uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns(uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * - Subtraction cannot overflow. * * _Available since v2.4.0._ */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns(uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns(uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns(uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns(uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. * (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns(uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. * (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * - The divisor cannot be zero. * * _Available since v2.4.0._ */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns(uint256) { } } contract SeekReward { using SafeMath for uint256; // Investor details struct user { uint256 cycle; address upline; uint256 referrals; uint256 payouts; uint256 referalBonus; uint256 matchBonus; uint256 depositAmount; uint256 depositPayouts; uint40 depositTime; uint256 totalDeposits; uint256 totalStructure; } // Token instance IERC777 public token; // Mapping users details by address mapping(address => user)public users; // Contract status bool public lockStatus; // Admin1 address address public admin1; // Admin2 address address public admin2; // Total levels uint[]public Levels; // Total users count uint256 public totalUsers = 1; // Total deposit amount. uint256 public totalDeposited; // Total withdraw amount uint256 public totalWithdraw; // Matching bonus event event MatchBonus(address indexed from, address indexed to, uint value, uint time); // Withdraw event event Withdraw(address indexed from, uint value, uint time); // Deposit event event Deposit(address indexed from, address indexed refer, uint value, uint time); // Admin withdraw event event AdminEarnings(address indexed user, uint value, uint time); // User withdraw limt event event LimitReached(address indexed from, uint value, uint time); /** * @dev Initializes the contract setting the owners and token. */ constructor(address _owner1, address _owner2, address _token) public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Throws if lockStatus is true */ modifier isLock() { } /** * @dev Throws if called by other contract */ modifier isContractCheck(address _user) { } function _setUpline(address _addr, address _upline) private { } function _deposit(address _addr, uint256 _amount) private { } /** * @dev deposit: User deposit with 1 seek token * 5% adminshare split into 2 accounts * @param _upline: Referal address * @param amount:1st deposit minimum 1 seek & maximum 150 for cycle 1 * Next depsoit amount based on previous deposit amount and maximum amount based on cycles */ function deposit(address _upline, uint amount) external isLock isContractCheck(msg.sender) { } function _matchBonus(address _user, uint _amount) private { } /** * @dev withdraw: User can get amount till maximum payout reach. * maximum payout based on(daily ROI,matchbonus) * maximum payout limit 210 percentage */ function withdraw() external isLock { (uint256 to_payout, uint256 max_payout) = this.payoutOf(msg.sender); require(msg.sender != admin1, "SeekReward: only for users"); require(<FILL_ME>) // Deposit payout if (to_payout > 0) { if (users[msg.sender].payouts.add(to_payout) > max_payout) { to_payout = max_payout.sub(users[msg.sender].payouts); } users[msg.sender].depositPayouts = users[msg.sender].depositPayouts.add(to_payout); users[msg.sender].payouts = users[msg.sender].payouts.add(to_payout); _matchBonus(msg.sender, to_payout.mul(3e18).div(100e18)); } // matching bonus if (users[msg.sender].payouts < max_payout && users[msg.sender].matchBonus > 0) { if (users[msg.sender].payouts.add(users[msg.sender].matchBonus) > max_payout) { users[msg.sender].matchBonus = max_payout.sub(users[msg.sender].payouts); } users[msg.sender].payouts = users[msg.sender].payouts.add(users[msg.sender].matchBonus); to_payout = to_payout.add(users[msg.sender].matchBonus); users[msg.sender].matchBonus = users[msg.sender].matchBonus.sub(users[msg.sender].matchBonus); } totalWithdraw = totalWithdraw.add(to_payout); token.transfer(msg.sender, to_payout); // Daily roi and matching bonus emit Withdraw(msg.sender, to_payout, block.timestamp); if (users[msg.sender].payouts >= max_payout) { emit LimitReached(msg.sender, users[msg.sender].payouts, block.timestamp); } } /** * @dev adminWithdraw: owner invokes the function * owner can get referbonus, matchbonus */ function adminWithdraw() external onlyOwner { } /** * @dev maxPayoutOf: Amount calculate by 210 percentage */ function maxPayoutOf(uint256 _amount) external pure returns(uint256) { } /** * @dev payoutOf: Users daily ROI and maximum payout will be show */ function payoutOf(address _addr) external view returns(uint256 payout, uint256 max_payout) { } /** * @dev userInfo: Returns upline,depositTime,depositAmount,payouts,match_bonus */ function userInfo(address _addr) external view returns(address upline, uint40 deposit_time, uint256 deposit_amount, uint256 payouts, uint256 match_bonus) { } /** * @dev userInfoTotals: Returns users referrals count, totalDeposit, totalStructure */ function userInfoTotals(address _addr) external view returns(uint256 referrals, uint256 total_deposits, uint256 total_structure) { } /** * @dev contractInfo: Returns total users, totalDeposited, totalWithdraw */ function contractInfo() external view returns(uint256 _total_users, uint256 _total_deposited, uint256 _total_withdraw) { } /** * @dev contractLock: For contract status */ function contractLock(bool _lockStatus) public onlyOwner returns(bool) { } /** * @dev failSafe: Returns transfer token */ function failSafe(address _toUser, uint _amount) external onlyOwner returns(bool) { } /** * @dev isContract: Returns true if account is a contract */ function isContract(address _account) public view returns(bool) { } }
users[msg.sender].payouts<max_payout,"SeekReward: Full payouts"
283,661
users[msg.sender].payouts<max_payout
null
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; mapping(address => uint32) public nonces; constructor() public { } /** * @dev See `IERC20.totalSupply`. */ function totalSupply() public view returns (uint256) { } /** * @dev See `IERC20.balanceOf`. */ function balanceOf(address account) public view returns (uint256) { } /** * @dev See `IERC20.transfer`. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public returns (bool) { } function transferEtherless(address sender, address recipient, uint256 amount, uint256 fees, uint32 nonce, uint256 time, bytes memory signature) public returns (bool) { bytes32 r; bytes32 s; uint8 v; bytes32 message = keccak256(abi.encodePacked(address(this), sender, recipient, amount, fees, nonce, time)); bytes memory prefix = "\x19Ethereum Signed Message:\n32"; bytes32 hash = keccak256(abi.encodePacked(prefix, message)); require(signature.length == 65); assembly { r := mload(add(signature, 32)) s := mload(add(signature, 64)) v := byte(0, mload(add(signature, 96))) } if (v < 27) { v += 27; } require(v == 27 || v == 28); address msgSender = ecrecover(hash, v, r, s); require(msgSender == sender); require(<FILL_ME>) require((time - 5 minutes) < now); require((time + 2 days) > now); _transfer(sender, recipient, amount); _transfer(sender, address(this), fees); return true; } /** * @dev See `IERC20.allowance`. */ function allowance(address owner, address spender) public view returns (uint256) { } /** * @dev See `IERC20.approve`. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 value) public returns (bool) { } /** * @dev See `IERC20.transferFrom`. * * Emits an `Approval` event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of `ERC20`; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `value`. * - the caller must have allowance for `sender`'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to `approve` that can be used as a mitigation for * problems described in `IERC20.approve`. * * Emits an `Approval` event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to `approve` that can be used as a mitigation for * problems described in `IERC20.approve`. * * Emits an `Approval` event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to `transfer`, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a `Transfer` event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal { } /** * @dev Destoys `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 value) internal { } /** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an `Approval` event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 value) internal { } /** * @dev Destoys `amount` tokens from `account`.`amount` is then deducted * from the caller's allowance. * * See `_burn` and `_approve`. */ function _burnFrom(address account, uint256 amount) internal { } }
nonces[msgSender]++==nonce
283,742
nonces[msgSender]++==nonce
null
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; mapping(address => uint32) public nonces; constructor() public { } /** * @dev See `IERC20.totalSupply`. */ function totalSupply() public view returns (uint256) { } /** * @dev See `IERC20.balanceOf`. */ function balanceOf(address account) public view returns (uint256) { } /** * @dev See `IERC20.transfer`. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public returns (bool) { } function transferEtherless(address sender, address recipient, uint256 amount, uint256 fees, uint32 nonce, uint256 time, bytes memory signature) public returns (bool) { bytes32 r; bytes32 s; uint8 v; bytes32 message = keccak256(abi.encodePacked(address(this), sender, recipient, amount, fees, nonce, time)); bytes memory prefix = "\x19Ethereum Signed Message:\n32"; bytes32 hash = keccak256(abi.encodePacked(prefix, message)); require(signature.length == 65); assembly { r := mload(add(signature, 32)) s := mload(add(signature, 64)) v := byte(0, mload(add(signature, 96))) } if (v < 27) { v += 27; } require(v == 27 || v == 28); address msgSender = ecrecover(hash, v, r, s); require(msgSender == sender); require(nonces[msgSender]++ == nonce); require(<FILL_ME>) require((time + 2 days) > now); _transfer(sender, recipient, amount); _transfer(sender, address(this), fees); return true; } /** * @dev See `IERC20.allowance`. */ function allowance(address owner, address spender) public view returns (uint256) { } /** * @dev See `IERC20.approve`. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 value) public returns (bool) { } /** * @dev See `IERC20.transferFrom`. * * Emits an `Approval` event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of `ERC20`; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `value`. * - the caller must have allowance for `sender`'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to `approve` that can be used as a mitigation for * problems described in `IERC20.approve`. * * Emits an `Approval` event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to `approve` that can be used as a mitigation for * problems described in `IERC20.approve`. * * Emits an `Approval` event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to `transfer`, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a `Transfer` event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal { } /** * @dev Destoys `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 value) internal { } /** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an `Approval` event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 value) internal { } /** * @dev Destoys `amount` tokens from `account`.`amount` is then deducted * from the caller's allowance. * * See `_burn` and `_approve`. */ function _burnFrom(address account, uint256 amount) internal { } }
(time-5minutes)<now
283,742
(time-5minutes)<now
null
contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; mapping(address => uint32) public nonces; constructor() public { } /** * @dev See `IERC20.totalSupply`. */ function totalSupply() public view returns (uint256) { } /** * @dev See `IERC20.balanceOf`. */ function balanceOf(address account) public view returns (uint256) { } /** * @dev See `IERC20.transfer`. * * Requirements: * * - `recipient` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ function transfer(address recipient, uint256 amount) public returns (bool) { } function transferEtherless(address sender, address recipient, uint256 amount, uint256 fees, uint32 nonce, uint256 time, bytes memory signature) public returns (bool) { bytes32 r; bytes32 s; uint8 v; bytes32 message = keccak256(abi.encodePacked(address(this), sender, recipient, amount, fees, nonce, time)); bytes memory prefix = "\x19Ethereum Signed Message:\n32"; bytes32 hash = keccak256(abi.encodePacked(prefix, message)); require(signature.length == 65); assembly { r := mload(add(signature, 32)) s := mload(add(signature, 64)) v := byte(0, mload(add(signature, 96))) } if (v < 27) { v += 27; } require(v == 27 || v == 28); address msgSender = ecrecover(hash, v, r, s); require(msgSender == sender); require(nonces[msgSender]++ == nonce); require((time - 5 minutes) < now); require(<FILL_ME>) _transfer(sender, recipient, amount); _transfer(sender, address(this), fees); return true; } /** * @dev See `IERC20.allowance`. */ function allowance(address owner, address spender) public view returns (uint256) { } /** * @dev See `IERC20.approve`. * * Requirements: * * - `spender` cannot be the zero address. */ function approve(address spender, uint256 value) public returns (bool) { } /** * @dev See `IERC20.transferFrom`. * * Emits an `Approval` event indicating the updated allowance. This is not * required by the EIP. See the note at the beginning of `ERC20`; * * Requirements: * - `sender` and `recipient` cannot be the zero address. * - `sender` must have a balance of at least `value`. * - the caller must have allowance for `sender`'s tokens of at least * `amount`. */ function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { } /** * @dev Atomically increases the allowance granted to `spender` by the caller. * * This is an alternative to `approve` that can be used as a mitigation for * problems described in `IERC20.approve`. * * Emits an `Approval` event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. */ function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } /** * @dev Atomically decreases the allowance granted to `spender` by the caller. * * This is an alternative to `approve` that can be used as a mitigation for * problems described in `IERC20.approve`. * * Emits an `Approval` event indicating the updated allowance. * * Requirements: * * - `spender` cannot be the zero address. * - `spender` must have allowance for the caller of at least * `subtractedValue`. */ function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } /** * @dev Moves tokens `amount` from `sender` to `recipient`. * * This is internal function is equivalent to `transfer`, and can be used to * e.g. implement automatic token fees, slashing mechanisms, etc. * * Emits a `Transfer` event. * * Requirements: * * - `sender` cannot be the zero address. * - `recipient` cannot be the zero address. * - `sender` must have a balance of at least `amount`. */ function _transfer(address sender, address recipient, uint256 amount) internal { } /** * @dev Destoys `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 value) internal { } /** * @dev Sets `amount` as the allowance of `spender` over the `owner`s tokens. * * This is internal function is equivalent to `approve`, and can be used to * e.g. set automatic allowances for certain subsystems, etc. * * Emits an `Approval` event. * * Requirements: * * - `owner` cannot be the zero address. * - `spender` cannot be the zero address. */ function _approve(address owner, address spender, uint256 value) internal { } /** * @dev Destoys `amount` tokens from `account`.`amount` is then deducted * from the caller's allowance. * * See `_burn` and `_approve`. */ function _burnFrom(address account, uint256 amount) internal { } }
(time+2days)>now
283,742
(time+2days)>now
"Auction has already started."
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "./TwentySevenYearScapes.sol"; /* @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | | | | | | -@@ | | | | | | -@@ | | | | | | -@@ | | | | | | -@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@- | || | || | | @@- | || | || | | @@- | || | || | | @@- | || | || | | @8857@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@8857@ */ contract GalleryTwentySeven is Ownable, ReentrancyGuard { // PunkScape collection contracts address private _punkScapes; address private _twentySevenYearScapes; /// @dev The minimum value of an auction. uint128 private _startingPrice; /// @dev The minimum basis points increase per bid. uint64 private _bidBasisIncrease; /// @dev Minimum auction runtime in seconds after new bids. uint64 private _biddingGracePeriod; /// @dev The auction for each PunkScape tokenID mapping(uint256 => Auction) private _auctions; struct Auction { address latestBidder; uint128 latestBid; uint64 endTimestamp; bool rewardsClaimed; bool settled; } /// @dev Emitted when a new bid is entered. event Bid(uint256 indexed punkScapeId, uint256 indexed bid, address indexed from, string message); /// @dev Emitted when a new bid is entered within the _biddingGracePeriod. event AuctionExtended(uint256 indexed punkScapeId, uint256 indexed endTimestamp); /// @dev Initialize the Gallery contract constructor ( address punkScapes, address twentySevenYearScapes, uint128 startingPrice, uint64 bidBasisIncrease, uint64 biddingGracePeriod ) { } /// @dev Get an auction for a specific PunkScape tokenID function getAuction (uint256 punkScapeId) public view returns ( address latestBidder, uint128 latestBid, uint64 endTimestamp, bool settled, bool rewardsClaimed ) { } function currentStartingPrice () external view returns (uint128) { } function currentBidBasisIncrease () external view returns (uint64) { } function currentBiddingGracePeriod () external view returns (uint64) { } /// @dev The minimum value of the next bid for an auction. function currentBidPrice (uint256 punkScapeId) external view returns (uint128) { } /// @dev The first bid to initialize an auction /// @param punkScapeId The tokenId of the PunkScape of the day /// @param endTimestamp The default end time of the auction /// @param signature The signature to verify the above arguments /// @param message The bid message that inspires Yotukito function initializeAuction ( uint256 punkScapeId, uint64 endTimestamp, bytes memory signature, string memory message ) external payable { require(<FILL_ME>) require(msg.value >= _startingPrice, "Auction starting price not met."); require(endTimestamp >= uint64(block.timestamp), "Auction has ended."); // Verify this data was signed by punkscape bytes32 signedData = ECDSA.toEthSignedMessageHash( keccak256(abi.encodePacked(punkScapeId, endTimestamp)) ); require( ECDSA.recover(signedData, signature) == owner(), "Auction data not signed." ); _auctions[punkScapeId] = Auction(_msgSender(), uint128(msg.value), endTimestamp, false, false); _maybeExtendTime(punkScapeId, _auctions[punkScapeId]); emit Bid(punkScapeId, msg.value, _msgSender(), message); } /// @dev Secondary bids /// @param punkScapeId The tokenId of the PunkScape to bid on /// @param message The bid message that inspires Yotukito function bid ( uint256 punkScapeId, string memory message ) external payable nonReentrant { } /// @dev Mints a Twenty Seven Year Scape (27YS) /// @param punkScapeId The tokenId of the PunkScape for which to claim the 27YS /// @param tokenId The tokenId of the 27YS /// @param cid The IPFS content identifyer of the metadata of this token /// @param signature The signature that verifies the authenticity of the above arguments function claim ( uint256 punkScapeId, uint256 tokenId, string memory cid, bytes memory signature ) external { } /// @dev Claims the rewards of previous auctions /// @param punkScapeIDs The tokenIDs of all PunkScapes for which to claim rewards function withdraw(uint256[] memory punkScapeIDs) external { } /// @dev Extends the end time of an auction if we are within the grace period. function _maybeExtendTime (uint256 punkScapeId, Auction storage auction) internal { } /// @dev Set the default auction starting price function setStartingPrice (uint128 startingPrice) external onlyOwner { } /// @dev Set the minimum percentage increase for bids in an auction function setBidBasisIncrease (uint64 bidBasisIncrease) external onlyOwner { } /// @dev Set ducation of the bidding grace period in seconds function setBiddingGracePeriod (uint64 biddingGracePeriod) external onlyOwner { } /// @dev Whether an auction has an existing bid function _hasBid (Auction memory auction) internal pure returns (bool) { } /// @dev Calculates the minimum price for the next bid function _currentBidPrice (Auction memory auction) internal view returns (uint128) { } }
_auctions[punkScapeId].endTimestamp==0,"Auction has already started."
283,771
_auctions[punkScapeId].endTimestamp==0
"Auction data not signed."
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "./TwentySevenYearScapes.sol"; /* @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | | | | | | -@@ | | | | | | -@@ | | | | | | -@@ | | | | | | -@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@- | || | || | | @@- | || | || | | @@- | || | || | | @@- | || | || | | @8857@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@8857@ */ contract GalleryTwentySeven is Ownable, ReentrancyGuard { // PunkScape collection contracts address private _punkScapes; address private _twentySevenYearScapes; /// @dev The minimum value of an auction. uint128 private _startingPrice; /// @dev The minimum basis points increase per bid. uint64 private _bidBasisIncrease; /// @dev Minimum auction runtime in seconds after new bids. uint64 private _biddingGracePeriod; /// @dev The auction for each PunkScape tokenID mapping(uint256 => Auction) private _auctions; struct Auction { address latestBidder; uint128 latestBid; uint64 endTimestamp; bool rewardsClaimed; bool settled; } /// @dev Emitted when a new bid is entered. event Bid(uint256 indexed punkScapeId, uint256 indexed bid, address indexed from, string message); /// @dev Emitted when a new bid is entered within the _biddingGracePeriod. event AuctionExtended(uint256 indexed punkScapeId, uint256 indexed endTimestamp); /// @dev Initialize the Gallery contract constructor ( address punkScapes, address twentySevenYearScapes, uint128 startingPrice, uint64 bidBasisIncrease, uint64 biddingGracePeriod ) { } /// @dev Get an auction for a specific PunkScape tokenID function getAuction (uint256 punkScapeId) public view returns ( address latestBidder, uint128 latestBid, uint64 endTimestamp, bool settled, bool rewardsClaimed ) { } function currentStartingPrice () external view returns (uint128) { } function currentBidBasisIncrease () external view returns (uint64) { } function currentBiddingGracePeriod () external view returns (uint64) { } /// @dev The minimum value of the next bid for an auction. function currentBidPrice (uint256 punkScapeId) external view returns (uint128) { } /// @dev The first bid to initialize an auction /// @param punkScapeId The tokenId of the PunkScape of the day /// @param endTimestamp The default end time of the auction /// @param signature The signature to verify the above arguments /// @param message The bid message that inspires Yotukito function initializeAuction ( uint256 punkScapeId, uint64 endTimestamp, bytes memory signature, string memory message ) external payable { require(_auctions[punkScapeId].endTimestamp == 0, "Auction has already started."); require(msg.value >= _startingPrice, "Auction starting price not met."); require(endTimestamp >= uint64(block.timestamp), "Auction has ended."); // Verify this data was signed by punkscape bytes32 signedData = ECDSA.toEthSignedMessageHash( keccak256(abi.encodePacked(punkScapeId, endTimestamp)) ); require(<FILL_ME>) _auctions[punkScapeId] = Auction(_msgSender(), uint128(msg.value), endTimestamp, false, false); _maybeExtendTime(punkScapeId, _auctions[punkScapeId]); emit Bid(punkScapeId, msg.value, _msgSender(), message); } /// @dev Secondary bids /// @param punkScapeId The tokenId of the PunkScape to bid on /// @param message The bid message that inspires Yotukito function bid ( uint256 punkScapeId, string memory message ) external payable nonReentrant { } /// @dev Mints a Twenty Seven Year Scape (27YS) /// @param punkScapeId The tokenId of the PunkScape for which to claim the 27YS /// @param tokenId The tokenId of the 27YS /// @param cid The IPFS content identifyer of the metadata of this token /// @param signature The signature that verifies the authenticity of the above arguments function claim ( uint256 punkScapeId, uint256 tokenId, string memory cid, bytes memory signature ) external { } /// @dev Claims the rewards of previous auctions /// @param punkScapeIDs The tokenIDs of all PunkScapes for which to claim rewards function withdraw(uint256[] memory punkScapeIDs) external { } /// @dev Extends the end time of an auction if we are within the grace period. function _maybeExtendTime (uint256 punkScapeId, Auction storage auction) internal { } /// @dev Set the default auction starting price function setStartingPrice (uint128 startingPrice) external onlyOwner { } /// @dev Set the minimum percentage increase for bids in an auction function setBidBasisIncrease (uint64 bidBasisIncrease) external onlyOwner { } /// @dev Set ducation of the bidding grace period in seconds function setBiddingGracePeriod (uint64 biddingGracePeriod) external onlyOwner { } /// @dev Whether an auction has an existing bid function _hasBid (Auction memory auction) internal pure returns (bool) { } /// @dev Calculates the minimum price for the next bid function _currentBidPrice (Auction memory auction) internal view returns (uint128) { } }
ECDSA.recover(signedData,signature)==owner(),"Auction data not signed."
283,771
ECDSA.recover(signedData,signature)==owner()
"Auction already settled"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "./TwentySevenYearScapes.sol"; /* @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | | | | | | -@@ | | | | | | -@@ | | | | | | -@@ | | | | | | -@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@- | || | || | | @@- | || | || | | @@- | || | || | | @@- | || | || | | @8857@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@8857@ */ contract GalleryTwentySeven is Ownable, ReentrancyGuard { // PunkScape collection contracts address private _punkScapes; address private _twentySevenYearScapes; /// @dev The minimum value of an auction. uint128 private _startingPrice; /// @dev The minimum basis points increase per bid. uint64 private _bidBasisIncrease; /// @dev Minimum auction runtime in seconds after new bids. uint64 private _biddingGracePeriod; /// @dev The auction for each PunkScape tokenID mapping(uint256 => Auction) private _auctions; struct Auction { address latestBidder; uint128 latestBid; uint64 endTimestamp; bool rewardsClaimed; bool settled; } /// @dev Emitted when a new bid is entered. event Bid(uint256 indexed punkScapeId, uint256 indexed bid, address indexed from, string message); /// @dev Emitted when a new bid is entered within the _biddingGracePeriod. event AuctionExtended(uint256 indexed punkScapeId, uint256 indexed endTimestamp); /// @dev Initialize the Gallery contract constructor ( address punkScapes, address twentySevenYearScapes, uint128 startingPrice, uint64 bidBasisIncrease, uint64 biddingGracePeriod ) { } /// @dev Get an auction for a specific PunkScape tokenID function getAuction (uint256 punkScapeId) public view returns ( address latestBidder, uint128 latestBid, uint64 endTimestamp, bool settled, bool rewardsClaimed ) { } function currentStartingPrice () external view returns (uint128) { } function currentBidBasisIncrease () external view returns (uint64) { } function currentBiddingGracePeriod () external view returns (uint64) { } /// @dev The minimum value of the next bid for an auction. function currentBidPrice (uint256 punkScapeId) external view returns (uint128) { } /// @dev The first bid to initialize an auction /// @param punkScapeId The tokenId of the PunkScape of the day /// @param endTimestamp The default end time of the auction /// @param signature The signature to verify the above arguments /// @param message The bid message that inspires Yotukito function initializeAuction ( uint256 punkScapeId, uint64 endTimestamp, bytes memory signature, string memory message ) external payable { } /// @dev Secondary bids /// @param punkScapeId The tokenId of the PunkScape to bid on /// @param message The bid message that inspires Yotukito function bid ( uint256 punkScapeId, string memory message ) external payable nonReentrant { } /// @dev Mints a Twenty Seven Year Scape (27YS) /// @param punkScapeId The tokenId of the PunkScape for which to claim the 27YS /// @param tokenId The tokenId of the 27YS /// @param cid The IPFS content identifyer of the metadata of this token /// @param signature The signature that verifies the authenticity of the above arguments function claim ( uint256 punkScapeId, uint256 tokenId, string memory cid, bytes memory signature ) external { Auction storage auction = _auctions[punkScapeId]; require(<FILL_ME>) // Verify this data was signed by punkscape bytes32 message = ECDSA.toEthSignedMessageHash( keccak256(abi.encodePacked(punkScapeId, tokenId, cid)) ); require( ECDSA.recover(message, signature) == owner(), "Claim data not signed." ); address claimableBy = _hasBid(auction) ? auction.latestBidder : ERC721(_punkScapes).ownerOf(punkScapeId); require(_msgSender() == claimableBy, "Not allowed to claim."); TwentySevenYearScapes(_twentySevenYearScapes).mint(claimableBy, tokenId, cid); // Reserve 50% of the auction reward for the PunkScape owner uint256 ownerShare = auction.latestBid / 2; payable(owner()).transfer(auction.latestBid - ownerShare); // End the auction auction.settled = true; } /// @dev Claims the rewards of previous auctions /// @param punkScapeIDs The tokenIDs of all PunkScapes for which to claim rewards function withdraw(uint256[] memory punkScapeIDs) external { } /// @dev Extends the end time of an auction if we are within the grace period. function _maybeExtendTime (uint256 punkScapeId, Auction storage auction) internal { } /// @dev Set the default auction starting price function setStartingPrice (uint128 startingPrice) external onlyOwner { } /// @dev Set the minimum percentage increase for bids in an auction function setBidBasisIncrease (uint64 bidBasisIncrease) external onlyOwner { } /// @dev Set ducation of the bidding grace period in seconds function setBiddingGracePeriod (uint64 biddingGracePeriod) external onlyOwner { } /// @dev Whether an auction has an existing bid function _hasBid (Auction memory auction) internal pure returns (bool) { } /// @dev Calculates the minimum price for the next bid function _currentBidPrice (Auction memory auction) internal view returns (uint128) { } }
!auction.settled,"Auction already settled"
283,771
!auction.settled
"Claim data not signed."
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "./TwentySevenYearScapes.sol"; /* @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | | | | | | -@@ | | | | | | -@@ | | | | | | -@@ | | | | | | -@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@- | || | || | | @@- | || | || | | @@- | || | || | | @@- | || | || | | @8857@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@8857@ */ contract GalleryTwentySeven is Ownable, ReentrancyGuard { // PunkScape collection contracts address private _punkScapes; address private _twentySevenYearScapes; /// @dev The minimum value of an auction. uint128 private _startingPrice; /// @dev The minimum basis points increase per bid. uint64 private _bidBasisIncrease; /// @dev Minimum auction runtime in seconds after new bids. uint64 private _biddingGracePeriod; /// @dev The auction for each PunkScape tokenID mapping(uint256 => Auction) private _auctions; struct Auction { address latestBidder; uint128 latestBid; uint64 endTimestamp; bool rewardsClaimed; bool settled; } /// @dev Emitted when a new bid is entered. event Bid(uint256 indexed punkScapeId, uint256 indexed bid, address indexed from, string message); /// @dev Emitted when a new bid is entered within the _biddingGracePeriod. event AuctionExtended(uint256 indexed punkScapeId, uint256 indexed endTimestamp); /// @dev Initialize the Gallery contract constructor ( address punkScapes, address twentySevenYearScapes, uint128 startingPrice, uint64 bidBasisIncrease, uint64 biddingGracePeriod ) { } /// @dev Get an auction for a specific PunkScape tokenID function getAuction (uint256 punkScapeId) public view returns ( address latestBidder, uint128 latestBid, uint64 endTimestamp, bool settled, bool rewardsClaimed ) { } function currentStartingPrice () external view returns (uint128) { } function currentBidBasisIncrease () external view returns (uint64) { } function currentBiddingGracePeriod () external view returns (uint64) { } /// @dev The minimum value of the next bid for an auction. function currentBidPrice (uint256 punkScapeId) external view returns (uint128) { } /// @dev The first bid to initialize an auction /// @param punkScapeId The tokenId of the PunkScape of the day /// @param endTimestamp The default end time of the auction /// @param signature The signature to verify the above arguments /// @param message The bid message that inspires Yotukito function initializeAuction ( uint256 punkScapeId, uint64 endTimestamp, bytes memory signature, string memory message ) external payable { } /// @dev Secondary bids /// @param punkScapeId The tokenId of the PunkScape to bid on /// @param message The bid message that inspires Yotukito function bid ( uint256 punkScapeId, string memory message ) external payable nonReentrant { } /// @dev Mints a Twenty Seven Year Scape (27YS) /// @param punkScapeId The tokenId of the PunkScape for which to claim the 27YS /// @param tokenId The tokenId of the 27YS /// @param cid The IPFS content identifyer of the metadata of this token /// @param signature The signature that verifies the authenticity of the above arguments function claim ( uint256 punkScapeId, uint256 tokenId, string memory cid, bytes memory signature ) external { Auction storage auction = _auctions[punkScapeId]; require(!auction.settled, "Auction already settled"); // Verify this data was signed by punkscape bytes32 message = ECDSA.toEthSignedMessageHash( keccak256(abi.encodePacked(punkScapeId, tokenId, cid)) ); require(<FILL_ME>) address claimableBy = _hasBid(auction) ? auction.latestBidder : ERC721(_punkScapes).ownerOf(punkScapeId); require(_msgSender() == claimableBy, "Not allowed to claim."); TwentySevenYearScapes(_twentySevenYearScapes).mint(claimableBy, tokenId, cid); // Reserve 50% of the auction reward for the PunkScape owner uint256 ownerShare = auction.latestBid / 2; payable(owner()).transfer(auction.latestBid - ownerShare); // End the auction auction.settled = true; } /// @dev Claims the rewards of previous auctions /// @param punkScapeIDs The tokenIDs of all PunkScapes for which to claim rewards function withdraw(uint256[] memory punkScapeIDs) external { } /// @dev Extends the end time of an auction if we are within the grace period. function _maybeExtendTime (uint256 punkScapeId, Auction storage auction) internal { } /// @dev Set the default auction starting price function setStartingPrice (uint128 startingPrice) external onlyOwner { } /// @dev Set the minimum percentage increase for bids in an auction function setBidBasisIncrease (uint64 bidBasisIncrease) external onlyOwner { } /// @dev Set ducation of the bidding grace period in seconds function setBiddingGracePeriod (uint64 biddingGracePeriod) external onlyOwner { } /// @dev Whether an auction has an existing bid function _hasBid (Auction memory auction) internal pure returns (bool) { } /// @dev Calculates the minimum price for the next bid function _currentBidPrice (Auction memory auction) internal view returns (uint128) { } }
ECDSA.recover(message,signature)==owner(),"Claim data not signed."
283,771
ECDSA.recover(message,signature)==owner()
"Not allowed to claim."
// SPDX-License-Identifier: MIT pragma solidity ^0.8.11; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol"; import "./TwentySevenYearScapes.sol"; /* @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ | | | | | | -@@ | | | | | | -@@ | | | | | | -@@ | | | | | | -@@ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @@- | || | || | | @@- | || | || | | @@- | || | || | | @@- | || | || | | @8857@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@8857@ */ contract GalleryTwentySeven is Ownable, ReentrancyGuard { // PunkScape collection contracts address private _punkScapes; address private _twentySevenYearScapes; /// @dev The minimum value of an auction. uint128 private _startingPrice; /// @dev The minimum basis points increase per bid. uint64 private _bidBasisIncrease; /// @dev Minimum auction runtime in seconds after new bids. uint64 private _biddingGracePeriod; /// @dev The auction for each PunkScape tokenID mapping(uint256 => Auction) private _auctions; struct Auction { address latestBidder; uint128 latestBid; uint64 endTimestamp; bool rewardsClaimed; bool settled; } /// @dev Emitted when a new bid is entered. event Bid(uint256 indexed punkScapeId, uint256 indexed bid, address indexed from, string message); /// @dev Emitted when a new bid is entered within the _biddingGracePeriod. event AuctionExtended(uint256 indexed punkScapeId, uint256 indexed endTimestamp); /// @dev Initialize the Gallery contract constructor ( address punkScapes, address twentySevenYearScapes, uint128 startingPrice, uint64 bidBasisIncrease, uint64 biddingGracePeriod ) { } /// @dev Get an auction for a specific PunkScape tokenID function getAuction (uint256 punkScapeId) public view returns ( address latestBidder, uint128 latestBid, uint64 endTimestamp, bool settled, bool rewardsClaimed ) { } function currentStartingPrice () external view returns (uint128) { } function currentBidBasisIncrease () external view returns (uint64) { } function currentBiddingGracePeriod () external view returns (uint64) { } /// @dev The minimum value of the next bid for an auction. function currentBidPrice (uint256 punkScapeId) external view returns (uint128) { } /// @dev The first bid to initialize an auction /// @param punkScapeId The tokenId of the PunkScape of the day /// @param endTimestamp The default end time of the auction /// @param signature The signature to verify the above arguments /// @param message The bid message that inspires Yotukito function initializeAuction ( uint256 punkScapeId, uint64 endTimestamp, bytes memory signature, string memory message ) external payable { } /// @dev Secondary bids /// @param punkScapeId The tokenId of the PunkScape to bid on /// @param message The bid message that inspires Yotukito function bid ( uint256 punkScapeId, string memory message ) external payable nonReentrant { } /// @dev Mints a Twenty Seven Year Scape (27YS) /// @param punkScapeId The tokenId of the PunkScape for which to claim the 27YS /// @param tokenId The tokenId of the 27YS /// @param cid The IPFS content identifyer of the metadata of this token /// @param signature The signature that verifies the authenticity of the above arguments function claim ( uint256 punkScapeId, uint256 tokenId, string memory cid, bytes memory signature ) external { Auction storage auction = _auctions[punkScapeId]; require(!auction.settled, "Auction already settled"); // Verify this data was signed by punkscape bytes32 message = ECDSA.toEthSignedMessageHash( keccak256(abi.encodePacked(punkScapeId, tokenId, cid)) ); require( ECDSA.recover(message, signature) == owner(), "Claim data not signed." ); address claimableBy = _hasBid(auction) ? auction.latestBidder : ERC721(_punkScapes).ownerOf(punkScapeId); require(<FILL_ME>) TwentySevenYearScapes(_twentySevenYearScapes).mint(claimableBy, tokenId, cid); // Reserve 50% of the auction reward for the PunkScape owner uint256 ownerShare = auction.latestBid / 2; payable(owner()).transfer(auction.latestBid - ownerShare); // End the auction auction.settled = true; } /// @dev Claims the rewards of previous auctions /// @param punkScapeIDs The tokenIDs of all PunkScapes for which to claim rewards function withdraw(uint256[] memory punkScapeIDs) external { } /// @dev Extends the end time of an auction if we are within the grace period. function _maybeExtendTime (uint256 punkScapeId, Auction storage auction) internal { } /// @dev Set the default auction starting price function setStartingPrice (uint128 startingPrice) external onlyOwner { } /// @dev Set the minimum percentage increase for bids in an auction function setBidBasisIncrease (uint64 bidBasisIncrease) external onlyOwner { } /// @dev Set ducation of the bidding grace period in seconds function setBiddingGracePeriod (uint64 biddingGracePeriod) external onlyOwner { } /// @dev Whether an auction has an existing bid function _hasBid (Auction memory auction) internal pure returns (bool) { } /// @dev Calculates the minimum price for the next bid function _currentBidPrice (Auction memory auction) internal view returns (uint128) { } }
_msgSender()==claimableBy,"Not allowed to claim."
283,771
_msgSender()==claimableBy
"The token contract is not authorised"
// SPDX-License-Identifier: MIT /* ______ __ __ __ __ |_ _ \ [ | | ] [ | | ] | |_) | | | .--. .--. .--.| | .--. | |--. .---. .--.| | | __'. | | / .'`\ \ / .'`\ \ / /'`\' | ( (`\] | .-. | / /__\\ / /'`\' | _| |__) | | | | \__. | | \__. | | \__/ | `'.'. | | | | | \__., | \__/ | |_______/ [___] '.__.' '.__.' '.__.;__] [\__) ) [___]|__] '.__.' '.__.;__] ________ ___ __ )_____ ______ _________________ __ __ |_ _ \_ __ `/__ ___/__ ___/ _ /_/ / / __// /_/ / _ / _(__ ) /_____/ \___/ \__,_/ /_/ /____/ */ pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; contract BloodToken is Ownable, ERC20("BloodToken", "BLD"), Pausable { uint256 public taxFunds; uint256 public tax = 25; uint256 public spendingTax = 30; uint256 public spending; mapping(address => bool) public authorisedAddresses; mapping(address => uint256) public walletsBalances; modifier authorised() { require(<FILL_ME>) _; } constructor() {} function setAuthorised(address[] calldata addresses_, bool[] calldata authorisations_) external onlyOwner { } function setTax(uint256 tax_) external onlyOwner { } function setSpendingHolding(uint256 spendingHolding_) external onlyOwner { } function depositTokens(address wallet_, uint256 amount_) external whenNotPaused { } function add(address recipient_, uint256 amount_) external authorised { } function spend(address wallet_, uint256 amount_) external authorised { } function withdrawTax(uint256 amount_) external onlyOwner { } function withdrawSpendings(uint256 amount_) external onlyOwner { } function withdraw(uint256 amount_) external whenNotPaused { } function mintTokens(address recipient_, uint256 amount_) external authorised { } function transferTokensBetweenWallets(address to_, uint256 amount_) external whenNotPaused { } function pause() external onlyOwner { } function unpause() external onlyOwner { } function addToInternalWallets(address[] calldata addresses_, uint256[] calldata amounts_) external onlyOwner { } }
authorisedAddresses[msg.sender],"The token contract is not authorised"
283,897
authorisedAddresses[msg.sender]
null
// SPDX-License-Identifier: MIT /* ______ __ __ __ __ |_ _ \ [ | | ] [ | | ] | |_) | | | .--. .--. .--.| | .--. | |--. .---. .--.| | | __'. | | / .'`\ \ / .'`\ \ / /'`\' | ( (`\] | .-. | / /__\\ / /'`\' | _| |__) | | | | \__. | | \__. | | \__/ | `'.'. | | | | | \__., | \__/ | |_______/ [___] '.__.' '.__.' '.__.;__] [\__) ) [___]|__] '.__.' '.__.;__] ________ ___ __ )_____ ______ _________________ __ __ |_ _ \_ __ `/__ ___/__ ___/ _ /_/ / / __// /_/ / _ / _(__ ) /_____/ \___/ \__,_/ /_/ /____/ */ pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; contract BloodToken is Ownable, ERC20("BloodToken", "BLD"), Pausable { uint256 public taxFunds; uint256 public tax = 25; uint256 public spendingTax = 30; uint256 public spending; mapping(address => bool) public authorisedAddresses; mapping(address => uint256) public walletsBalances; modifier authorised() { } constructor() {} function setAuthorised(address[] calldata addresses_, bool[] calldata authorisations_) external onlyOwner { } function setTax(uint256 tax_) external onlyOwner { } function setSpendingHolding(uint256 spendingHolding_) external onlyOwner { } function depositTokens(address wallet_, uint256 amount_) external whenNotPaused { } function add(address recipient_, uint256 amount_) external authorised { } function spend(address wallet_, uint256 amount_) external authorised { require(<FILL_ME>) spending += amount_ * spendingTax / 100; walletsBalances[wallet_] -= amount_; } function withdrawTax(uint256 amount_) external onlyOwner { } function withdrawSpendings(uint256 amount_) external onlyOwner { } function withdraw(uint256 amount_) external whenNotPaused { } function mintTokens(address recipient_, uint256 amount_) external authorised { } function transferTokensBetweenWallets(address to_, uint256 amount_) external whenNotPaused { } function pause() external onlyOwner { } function unpause() external onlyOwner { } function addToInternalWallets(address[] calldata addresses_, uint256[] calldata amounts_) external onlyOwner { } }
walletsBalances[wallet_]>=amount_
283,897
walletsBalances[wallet_]>=amount_
null
// SPDX-License-Identifier: MIT /* ______ __ __ __ __ |_ _ \ [ | | ] [ | | ] | |_) | | | .--. .--. .--.| | .--. | |--. .---. .--.| | | __'. | | / .'`\ \ / .'`\ \ / /'`\' | ( (`\] | .-. | / /__\\ / /'`\' | _| |__) | | | | \__. | | \__. | | \__/ | `'.'. | | | | | \__., | \__/ | |_______/ [___] '.__.' '.__.' '.__.;__] [\__) ) [___]|__] '.__.' '.__.;__] ________ ___ __ )_____ ______ _________________ __ __ |_ _ \_ __ `/__ ___/__ ___/ _ /_/ / / __// /_/ / _ / _(__ ) /_____/ \___/ \__,_/ /_/ /____/ */ pragma solidity ^0.8.0; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; contract BloodToken is Ownable, ERC20("BloodToken", "BLD"), Pausable { uint256 public taxFunds; uint256 public tax = 25; uint256 public spendingTax = 30; uint256 public spending; mapping(address => bool) public authorisedAddresses; mapping(address => uint256) public walletsBalances; modifier authorised() { } constructor() {} function setAuthorised(address[] calldata addresses_, bool[] calldata authorisations_) external onlyOwner { } function setTax(uint256 tax_) external onlyOwner { } function setSpendingHolding(uint256 spendingHolding_) external onlyOwner { } function depositTokens(address wallet_, uint256 amount_) external whenNotPaused { } function add(address recipient_, uint256 amount_) external authorised { } function spend(address wallet_, uint256 amount_) external authorised { } function withdrawTax(uint256 amount_) external onlyOwner { } function withdrawSpendings(uint256 amount_) external onlyOwner { } function withdraw(uint256 amount_) external whenNotPaused { } function mintTokens(address recipient_, uint256 amount_) external authorised { } function transferTokensBetweenWallets(address to_, uint256 amount_) external whenNotPaused { require(<FILL_ME>) walletsBalances[msg.sender] -= amount_; walletsBalances[to_] += amount_; } function pause() external onlyOwner { } function unpause() external onlyOwner { } function addToInternalWallets(address[] calldata addresses_, uint256[] calldata amounts_) external onlyOwner { } }
walletsBalances[msg.sender]>=amount_
283,897
walletsBalances[msg.sender]>=amount_
null
contract InternalNetworkInterface { function addReserve( KyberReserveInterface reserve, bool isPermissionless ) public returns(bool); function removeReserve( KyberReserveInterface reserve, uint index ) public returns(bool); function listPairForReserve( address reserve, ERC20 token, bool ethToToken, bool tokenToEth, bool add ) public returns(bool); FeeBurnerInterface public feeBurnerContract; } contract PermissionlessOrderbookReserveLister { // KNC burn fee per wei value of an order. 25 in BPS = 0.25%. uint constant public ORDERBOOK_BURN_FEE_BPS = 25; uint public minNewOrderValueUsd = 1000; // set in order book minimum USD value of a new limit order uint public maxOrdersPerTrade; // set in order book maximum orders to be traversed in rate query and trade InternalNetworkInterface public kyberNetworkContract; OrderListFactoryInterface public orderFactoryContract; MedianizerInterface public medianizerContract; ERC20 public kncToken; enum ListingStage {NO_RESERVE, RESERVE_ADDED, RESERVE_INIT, RESERVE_LISTED} mapping(address => OrderbookReserveInterface) public reserves; //Permissionless orderbook reserves mapped per token mapping(address => ListingStage) public reserveListingStage; //Reserves listing stage mapping(address => bool) tokenListingBlocked; function PermissionlessOrderbookReserveLister( InternalNetworkInterface kyber, OrderListFactoryInterface factory, MedianizerInterface medianizer, ERC20 knc, address[] unsupportedTokens, uint maxOrders, uint minOrderValueUsd ) public { require(kyber != address(0)); require(factory != address(0)); require(medianizer != address(0)); require(knc != address(0)); require(maxOrders > 1); require(minOrderValueUsd > 0); kyberNetworkContract = kyber; orderFactoryContract = factory; medianizerContract = medianizer; kncToken = knc; maxOrdersPerTrade = maxOrders; minNewOrderValueUsd = minOrderValueUsd; for (uint i = 0; i < unsupportedTokens.length; i++) { require(<FILL_ME>) tokenListingBlocked[unsupportedTokens[i]] = true; } } event TokenOrderbookListingStage(ERC20 token, ListingStage stage); /// @dev anyone can call function addOrderbookContract(ERC20 token) public returns(bool) { } /// @dev anyone can call function initOrderbookContract(ERC20 token) public returns(bool) { } /// @dev anyone can call function listOrderbookContract(ERC20 token) public returns(bool) { } function unlistOrderbookContract(ERC20 token, uint hintReserveIndex) public { } /// @dev permission less reserve currently supports one token per reserve. function getOrderbookListingStage(ERC20 token) public view returns(address, ListingStage) { } }
unsupportedTokens[i]!=address(0)
283,919
unsupportedTokens[i]!=address(0)
null
contract InternalNetworkInterface { function addReserve( KyberReserveInterface reserve, bool isPermissionless ) public returns(bool); function removeReserve( KyberReserveInterface reserve, uint index ) public returns(bool); function listPairForReserve( address reserve, ERC20 token, bool ethToToken, bool tokenToEth, bool add ) public returns(bool); FeeBurnerInterface public feeBurnerContract; } contract PermissionlessOrderbookReserveLister { // KNC burn fee per wei value of an order. 25 in BPS = 0.25%. uint constant public ORDERBOOK_BURN_FEE_BPS = 25; uint public minNewOrderValueUsd = 1000; // set in order book minimum USD value of a new limit order uint public maxOrdersPerTrade; // set in order book maximum orders to be traversed in rate query and trade InternalNetworkInterface public kyberNetworkContract; OrderListFactoryInterface public orderFactoryContract; MedianizerInterface public medianizerContract; ERC20 public kncToken; enum ListingStage {NO_RESERVE, RESERVE_ADDED, RESERVE_INIT, RESERVE_LISTED} mapping(address => OrderbookReserveInterface) public reserves; //Permissionless orderbook reserves mapped per token mapping(address => ListingStage) public reserveListingStage; //Reserves listing stage mapping(address => bool) tokenListingBlocked; function PermissionlessOrderbookReserveLister( InternalNetworkInterface kyber, OrderListFactoryInterface factory, MedianizerInterface medianizer, ERC20 knc, address[] unsupportedTokens, uint maxOrders, uint minOrderValueUsd ) public { } event TokenOrderbookListingStage(ERC20 token, ListingStage stage); /// @dev anyone can call function addOrderbookContract(ERC20 token) public returns(bool) { require(<FILL_ME>) require(!(tokenListingBlocked[token])); reserves[token] = new OrderbookReserve({ knc: kncToken, reserveToken: token, burner: kyberNetworkContract.feeBurnerContract(), network: kyberNetworkContract, medianizer: medianizerContract, factory: orderFactoryContract, minNewOrderUsd: minNewOrderValueUsd, maxOrdersPerTrade: maxOrdersPerTrade, burnFeeBps: ORDERBOOK_BURN_FEE_BPS }); reserveListingStage[token] = ListingStage.RESERVE_ADDED; TokenOrderbookListingStage(token, ListingStage.RESERVE_ADDED); return true; } /// @dev anyone can call function initOrderbookContract(ERC20 token) public returns(bool) { } /// @dev anyone can call function listOrderbookContract(ERC20 token) public returns(bool) { } function unlistOrderbookContract(ERC20 token, uint hintReserveIndex) public { } /// @dev permission less reserve currently supports one token per reserve. function getOrderbookListingStage(ERC20 token) public view returns(address, ListingStage) { } }
reserveListingStage[token]==ListingStage.NO_RESERVE
283,919
reserveListingStage[token]==ListingStage.NO_RESERVE
null
contract InternalNetworkInterface { function addReserve( KyberReserveInterface reserve, bool isPermissionless ) public returns(bool); function removeReserve( KyberReserveInterface reserve, uint index ) public returns(bool); function listPairForReserve( address reserve, ERC20 token, bool ethToToken, bool tokenToEth, bool add ) public returns(bool); FeeBurnerInterface public feeBurnerContract; } contract PermissionlessOrderbookReserveLister { // KNC burn fee per wei value of an order. 25 in BPS = 0.25%. uint constant public ORDERBOOK_BURN_FEE_BPS = 25; uint public minNewOrderValueUsd = 1000; // set in order book minimum USD value of a new limit order uint public maxOrdersPerTrade; // set in order book maximum orders to be traversed in rate query and trade InternalNetworkInterface public kyberNetworkContract; OrderListFactoryInterface public orderFactoryContract; MedianizerInterface public medianizerContract; ERC20 public kncToken; enum ListingStage {NO_RESERVE, RESERVE_ADDED, RESERVE_INIT, RESERVE_LISTED} mapping(address => OrderbookReserveInterface) public reserves; //Permissionless orderbook reserves mapped per token mapping(address => ListingStage) public reserveListingStage; //Reserves listing stage mapping(address => bool) tokenListingBlocked; function PermissionlessOrderbookReserveLister( InternalNetworkInterface kyber, OrderListFactoryInterface factory, MedianizerInterface medianizer, ERC20 knc, address[] unsupportedTokens, uint maxOrders, uint minOrderValueUsd ) public { } event TokenOrderbookListingStage(ERC20 token, ListingStage stage); /// @dev anyone can call function addOrderbookContract(ERC20 token) public returns(bool) { require(reserveListingStage[token] == ListingStage.NO_RESERVE); require(<FILL_ME>) reserves[token] = new OrderbookReserve({ knc: kncToken, reserveToken: token, burner: kyberNetworkContract.feeBurnerContract(), network: kyberNetworkContract, medianizer: medianizerContract, factory: orderFactoryContract, minNewOrderUsd: minNewOrderValueUsd, maxOrdersPerTrade: maxOrdersPerTrade, burnFeeBps: ORDERBOOK_BURN_FEE_BPS }); reserveListingStage[token] = ListingStage.RESERVE_ADDED; TokenOrderbookListingStage(token, ListingStage.RESERVE_ADDED); return true; } /// @dev anyone can call function initOrderbookContract(ERC20 token) public returns(bool) { } /// @dev anyone can call function listOrderbookContract(ERC20 token) public returns(bool) { } function unlistOrderbookContract(ERC20 token, uint hintReserveIndex) public { } /// @dev permission less reserve currently supports one token per reserve. function getOrderbookListingStage(ERC20 token) public view returns(address, ListingStage) { } }
!(tokenListingBlocked[token])
283,919
!(tokenListingBlocked[token])
null
contract InternalNetworkInterface { function addReserve( KyberReserveInterface reserve, bool isPermissionless ) public returns(bool); function removeReserve( KyberReserveInterface reserve, uint index ) public returns(bool); function listPairForReserve( address reserve, ERC20 token, bool ethToToken, bool tokenToEth, bool add ) public returns(bool); FeeBurnerInterface public feeBurnerContract; } contract PermissionlessOrderbookReserveLister { // KNC burn fee per wei value of an order. 25 in BPS = 0.25%. uint constant public ORDERBOOK_BURN_FEE_BPS = 25; uint public minNewOrderValueUsd = 1000; // set in order book minimum USD value of a new limit order uint public maxOrdersPerTrade; // set in order book maximum orders to be traversed in rate query and trade InternalNetworkInterface public kyberNetworkContract; OrderListFactoryInterface public orderFactoryContract; MedianizerInterface public medianizerContract; ERC20 public kncToken; enum ListingStage {NO_RESERVE, RESERVE_ADDED, RESERVE_INIT, RESERVE_LISTED} mapping(address => OrderbookReserveInterface) public reserves; //Permissionless orderbook reserves mapped per token mapping(address => ListingStage) public reserveListingStage; //Reserves listing stage mapping(address => bool) tokenListingBlocked; function PermissionlessOrderbookReserveLister( InternalNetworkInterface kyber, OrderListFactoryInterface factory, MedianizerInterface medianizer, ERC20 knc, address[] unsupportedTokens, uint maxOrders, uint minOrderValueUsd ) public { } event TokenOrderbookListingStage(ERC20 token, ListingStage stage); /// @dev anyone can call function addOrderbookContract(ERC20 token) public returns(bool) { } /// @dev anyone can call function initOrderbookContract(ERC20 token) public returns(bool) { require(<FILL_ME>) require(reserves[token].init()); reserveListingStage[token] = ListingStage.RESERVE_INIT; TokenOrderbookListingStage(token, ListingStage.RESERVE_INIT); return true; } /// @dev anyone can call function listOrderbookContract(ERC20 token) public returns(bool) { } function unlistOrderbookContract(ERC20 token, uint hintReserveIndex) public { } /// @dev permission less reserve currently supports one token per reserve. function getOrderbookListingStage(ERC20 token) public view returns(address, ListingStage) { } }
reserveListingStage[token]==ListingStage.RESERVE_ADDED
283,919
reserveListingStage[token]==ListingStage.RESERVE_ADDED
null
contract InternalNetworkInterface { function addReserve( KyberReserveInterface reserve, bool isPermissionless ) public returns(bool); function removeReserve( KyberReserveInterface reserve, uint index ) public returns(bool); function listPairForReserve( address reserve, ERC20 token, bool ethToToken, bool tokenToEth, bool add ) public returns(bool); FeeBurnerInterface public feeBurnerContract; } contract PermissionlessOrderbookReserveLister { // KNC burn fee per wei value of an order. 25 in BPS = 0.25%. uint constant public ORDERBOOK_BURN_FEE_BPS = 25; uint public minNewOrderValueUsd = 1000; // set in order book minimum USD value of a new limit order uint public maxOrdersPerTrade; // set in order book maximum orders to be traversed in rate query and trade InternalNetworkInterface public kyberNetworkContract; OrderListFactoryInterface public orderFactoryContract; MedianizerInterface public medianizerContract; ERC20 public kncToken; enum ListingStage {NO_RESERVE, RESERVE_ADDED, RESERVE_INIT, RESERVE_LISTED} mapping(address => OrderbookReserveInterface) public reserves; //Permissionless orderbook reserves mapped per token mapping(address => ListingStage) public reserveListingStage; //Reserves listing stage mapping(address => bool) tokenListingBlocked; function PermissionlessOrderbookReserveLister( InternalNetworkInterface kyber, OrderListFactoryInterface factory, MedianizerInterface medianizer, ERC20 knc, address[] unsupportedTokens, uint maxOrders, uint minOrderValueUsd ) public { } event TokenOrderbookListingStage(ERC20 token, ListingStage stage); /// @dev anyone can call function addOrderbookContract(ERC20 token) public returns(bool) { } /// @dev anyone can call function initOrderbookContract(ERC20 token) public returns(bool) { require(reserveListingStage[token] == ListingStage.RESERVE_ADDED); require(<FILL_ME>) reserveListingStage[token] = ListingStage.RESERVE_INIT; TokenOrderbookListingStage(token, ListingStage.RESERVE_INIT); return true; } /// @dev anyone can call function listOrderbookContract(ERC20 token) public returns(bool) { } function unlistOrderbookContract(ERC20 token, uint hintReserveIndex) public { } /// @dev permission less reserve currently supports one token per reserve. function getOrderbookListingStage(ERC20 token) public view returns(address, ListingStage) { } }
reserves[token].init()
283,919
reserves[token].init()
null
contract InternalNetworkInterface { function addReserve( KyberReserveInterface reserve, bool isPermissionless ) public returns(bool); function removeReserve( KyberReserveInterface reserve, uint index ) public returns(bool); function listPairForReserve( address reserve, ERC20 token, bool ethToToken, bool tokenToEth, bool add ) public returns(bool); FeeBurnerInterface public feeBurnerContract; } contract PermissionlessOrderbookReserveLister { // KNC burn fee per wei value of an order. 25 in BPS = 0.25%. uint constant public ORDERBOOK_BURN_FEE_BPS = 25; uint public minNewOrderValueUsd = 1000; // set in order book minimum USD value of a new limit order uint public maxOrdersPerTrade; // set in order book maximum orders to be traversed in rate query and trade InternalNetworkInterface public kyberNetworkContract; OrderListFactoryInterface public orderFactoryContract; MedianizerInterface public medianizerContract; ERC20 public kncToken; enum ListingStage {NO_RESERVE, RESERVE_ADDED, RESERVE_INIT, RESERVE_LISTED} mapping(address => OrderbookReserveInterface) public reserves; //Permissionless orderbook reserves mapped per token mapping(address => ListingStage) public reserveListingStage; //Reserves listing stage mapping(address => bool) tokenListingBlocked; function PermissionlessOrderbookReserveLister( InternalNetworkInterface kyber, OrderListFactoryInterface factory, MedianizerInterface medianizer, ERC20 knc, address[] unsupportedTokens, uint maxOrders, uint minOrderValueUsd ) public { } event TokenOrderbookListingStage(ERC20 token, ListingStage stage); /// @dev anyone can call function addOrderbookContract(ERC20 token) public returns(bool) { } /// @dev anyone can call function initOrderbookContract(ERC20 token) public returns(bool) { } /// @dev anyone can call function listOrderbookContract(ERC20 token) public returns(bool) { require(<FILL_ME>) require( kyberNetworkContract.addReserve( KyberReserveInterface(reserves[token]), true ) ); require( kyberNetworkContract.listPairForReserve( KyberReserveInterface(reserves[token]), token, true, true, true ) ); FeeBurnerInterface feeBurner = FeeBurnerInterface(kyberNetworkContract.feeBurnerContract()); feeBurner.setReserveData( reserves[token], /* reserve */ ORDERBOOK_BURN_FEE_BPS, /* fee */ reserves[token] /* kncWallet */ ); reserveListingStage[token] = ListingStage.RESERVE_LISTED; TokenOrderbookListingStage(token, ListingStage.RESERVE_LISTED); return true; } function unlistOrderbookContract(ERC20 token, uint hintReserveIndex) public { } /// @dev permission less reserve currently supports one token per reserve. function getOrderbookListingStage(ERC20 token) public view returns(address, ListingStage) { } }
reserveListingStage[token]==ListingStage.RESERVE_INIT
283,919
reserveListingStage[token]==ListingStage.RESERVE_INIT
null
contract InternalNetworkInterface { function addReserve( KyberReserveInterface reserve, bool isPermissionless ) public returns(bool); function removeReserve( KyberReserveInterface reserve, uint index ) public returns(bool); function listPairForReserve( address reserve, ERC20 token, bool ethToToken, bool tokenToEth, bool add ) public returns(bool); FeeBurnerInterface public feeBurnerContract; } contract PermissionlessOrderbookReserveLister { // KNC burn fee per wei value of an order. 25 in BPS = 0.25%. uint constant public ORDERBOOK_BURN_FEE_BPS = 25; uint public minNewOrderValueUsd = 1000; // set in order book minimum USD value of a new limit order uint public maxOrdersPerTrade; // set in order book maximum orders to be traversed in rate query and trade InternalNetworkInterface public kyberNetworkContract; OrderListFactoryInterface public orderFactoryContract; MedianizerInterface public medianizerContract; ERC20 public kncToken; enum ListingStage {NO_RESERVE, RESERVE_ADDED, RESERVE_INIT, RESERVE_LISTED} mapping(address => OrderbookReserveInterface) public reserves; //Permissionless orderbook reserves mapped per token mapping(address => ListingStage) public reserveListingStage; //Reserves listing stage mapping(address => bool) tokenListingBlocked; function PermissionlessOrderbookReserveLister( InternalNetworkInterface kyber, OrderListFactoryInterface factory, MedianizerInterface medianizer, ERC20 knc, address[] unsupportedTokens, uint maxOrders, uint minOrderValueUsd ) public { } event TokenOrderbookListingStage(ERC20 token, ListingStage stage); /// @dev anyone can call function addOrderbookContract(ERC20 token) public returns(bool) { } /// @dev anyone can call function initOrderbookContract(ERC20 token) public returns(bool) { } /// @dev anyone can call function listOrderbookContract(ERC20 token) public returns(bool) { require(reserveListingStage[token] == ListingStage.RESERVE_INIT); require(<FILL_ME>) require( kyberNetworkContract.listPairForReserve( KyberReserveInterface(reserves[token]), token, true, true, true ) ); FeeBurnerInterface feeBurner = FeeBurnerInterface(kyberNetworkContract.feeBurnerContract()); feeBurner.setReserveData( reserves[token], /* reserve */ ORDERBOOK_BURN_FEE_BPS, /* fee */ reserves[token] /* kncWallet */ ); reserveListingStage[token] = ListingStage.RESERVE_LISTED; TokenOrderbookListingStage(token, ListingStage.RESERVE_LISTED); return true; } function unlistOrderbookContract(ERC20 token, uint hintReserveIndex) public { } /// @dev permission less reserve currently supports one token per reserve. function getOrderbookListingStage(ERC20 token) public view returns(address, ListingStage) { } }
kyberNetworkContract.addReserve(KyberReserveInterface(reserves[token]),true)
283,919
kyberNetworkContract.addReserve(KyberReserveInterface(reserves[token]),true)
null
contract InternalNetworkInterface { function addReserve( KyberReserveInterface reserve, bool isPermissionless ) public returns(bool); function removeReserve( KyberReserveInterface reserve, uint index ) public returns(bool); function listPairForReserve( address reserve, ERC20 token, bool ethToToken, bool tokenToEth, bool add ) public returns(bool); FeeBurnerInterface public feeBurnerContract; } contract PermissionlessOrderbookReserveLister { // KNC burn fee per wei value of an order. 25 in BPS = 0.25%. uint constant public ORDERBOOK_BURN_FEE_BPS = 25; uint public minNewOrderValueUsd = 1000; // set in order book minimum USD value of a new limit order uint public maxOrdersPerTrade; // set in order book maximum orders to be traversed in rate query and trade InternalNetworkInterface public kyberNetworkContract; OrderListFactoryInterface public orderFactoryContract; MedianizerInterface public medianizerContract; ERC20 public kncToken; enum ListingStage {NO_RESERVE, RESERVE_ADDED, RESERVE_INIT, RESERVE_LISTED} mapping(address => OrderbookReserveInterface) public reserves; //Permissionless orderbook reserves mapped per token mapping(address => ListingStage) public reserveListingStage; //Reserves listing stage mapping(address => bool) tokenListingBlocked; function PermissionlessOrderbookReserveLister( InternalNetworkInterface kyber, OrderListFactoryInterface factory, MedianizerInterface medianizer, ERC20 knc, address[] unsupportedTokens, uint maxOrders, uint minOrderValueUsd ) public { } event TokenOrderbookListingStage(ERC20 token, ListingStage stage); /// @dev anyone can call function addOrderbookContract(ERC20 token) public returns(bool) { } /// @dev anyone can call function initOrderbookContract(ERC20 token) public returns(bool) { } /// @dev anyone can call function listOrderbookContract(ERC20 token) public returns(bool) { require(reserveListingStage[token] == ListingStage.RESERVE_INIT); require( kyberNetworkContract.addReserve( KyberReserveInterface(reserves[token]), true ) ); require(<FILL_ME>) FeeBurnerInterface feeBurner = FeeBurnerInterface(kyberNetworkContract.feeBurnerContract()); feeBurner.setReserveData( reserves[token], /* reserve */ ORDERBOOK_BURN_FEE_BPS, /* fee */ reserves[token] /* kncWallet */ ); reserveListingStage[token] = ListingStage.RESERVE_LISTED; TokenOrderbookListingStage(token, ListingStage.RESERVE_LISTED); return true; } function unlistOrderbookContract(ERC20 token, uint hintReserveIndex) public { } /// @dev permission less reserve currently supports one token per reserve. function getOrderbookListingStage(ERC20 token) public view returns(address, ListingStage) { } }
kyberNetworkContract.listPairForReserve(KyberReserveInterface(reserves[token]),token,true,true,true)
283,919
kyberNetworkContract.listPairForReserve(KyberReserveInterface(reserves[token]),token,true,true,true)
null
contract InternalNetworkInterface { function addReserve( KyberReserveInterface reserve, bool isPermissionless ) public returns(bool); function removeReserve( KyberReserveInterface reserve, uint index ) public returns(bool); function listPairForReserve( address reserve, ERC20 token, bool ethToToken, bool tokenToEth, bool add ) public returns(bool); FeeBurnerInterface public feeBurnerContract; } contract PermissionlessOrderbookReserveLister { // KNC burn fee per wei value of an order. 25 in BPS = 0.25%. uint constant public ORDERBOOK_BURN_FEE_BPS = 25; uint public minNewOrderValueUsd = 1000; // set in order book minimum USD value of a new limit order uint public maxOrdersPerTrade; // set in order book maximum orders to be traversed in rate query and trade InternalNetworkInterface public kyberNetworkContract; OrderListFactoryInterface public orderFactoryContract; MedianizerInterface public medianizerContract; ERC20 public kncToken; enum ListingStage {NO_RESERVE, RESERVE_ADDED, RESERVE_INIT, RESERVE_LISTED} mapping(address => OrderbookReserveInterface) public reserves; //Permissionless orderbook reserves mapped per token mapping(address => ListingStage) public reserveListingStage; //Reserves listing stage mapping(address => bool) tokenListingBlocked; function PermissionlessOrderbookReserveLister( InternalNetworkInterface kyber, OrderListFactoryInterface factory, MedianizerInterface medianizer, ERC20 knc, address[] unsupportedTokens, uint maxOrders, uint minOrderValueUsd ) public { } event TokenOrderbookListingStage(ERC20 token, ListingStage stage); /// @dev anyone can call function addOrderbookContract(ERC20 token) public returns(bool) { } /// @dev anyone can call function initOrderbookContract(ERC20 token) public returns(bool) { } /// @dev anyone can call function listOrderbookContract(ERC20 token) public returns(bool) { } function unlistOrderbookContract(ERC20 token, uint hintReserveIndex) public { require(<FILL_ME>) require(reserves[token].kncRateBlocksTrade()); require(kyberNetworkContract.removeReserve(KyberReserveInterface(reserves[token]), hintReserveIndex)); reserveListingStage[token] = ListingStage.NO_RESERVE; reserves[token] = OrderbookReserveInterface(0); TokenOrderbookListingStage(token, ListingStage.NO_RESERVE); } /// @dev permission less reserve currently supports one token per reserve. function getOrderbookListingStage(ERC20 token) public view returns(address, ListingStage) { } }
reserveListingStage[token]==ListingStage.RESERVE_LISTED
283,919
reserveListingStage[token]==ListingStage.RESERVE_LISTED
null
contract InternalNetworkInterface { function addReserve( KyberReserveInterface reserve, bool isPermissionless ) public returns(bool); function removeReserve( KyberReserveInterface reserve, uint index ) public returns(bool); function listPairForReserve( address reserve, ERC20 token, bool ethToToken, bool tokenToEth, bool add ) public returns(bool); FeeBurnerInterface public feeBurnerContract; } contract PermissionlessOrderbookReserveLister { // KNC burn fee per wei value of an order. 25 in BPS = 0.25%. uint constant public ORDERBOOK_BURN_FEE_BPS = 25; uint public minNewOrderValueUsd = 1000; // set in order book minimum USD value of a new limit order uint public maxOrdersPerTrade; // set in order book maximum orders to be traversed in rate query and trade InternalNetworkInterface public kyberNetworkContract; OrderListFactoryInterface public orderFactoryContract; MedianizerInterface public medianizerContract; ERC20 public kncToken; enum ListingStage {NO_RESERVE, RESERVE_ADDED, RESERVE_INIT, RESERVE_LISTED} mapping(address => OrderbookReserveInterface) public reserves; //Permissionless orderbook reserves mapped per token mapping(address => ListingStage) public reserveListingStage; //Reserves listing stage mapping(address => bool) tokenListingBlocked; function PermissionlessOrderbookReserveLister( InternalNetworkInterface kyber, OrderListFactoryInterface factory, MedianizerInterface medianizer, ERC20 knc, address[] unsupportedTokens, uint maxOrders, uint minOrderValueUsd ) public { } event TokenOrderbookListingStage(ERC20 token, ListingStage stage); /// @dev anyone can call function addOrderbookContract(ERC20 token) public returns(bool) { } /// @dev anyone can call function initOrderbookContract(ERC20 token) public returns(bool) { } /// @dev anyone can call function listOrderbookContract(ERC20 token) public returns(bool) { } function unlistOrderbookContract(ERC20 token, uint hintReserveIndex) public { require(reserveListingStage[token] == ListingStage.RESERVE_LISTED); require(<FILL_ME>) require(kyberNetworkContract.removeReserve(KyberReserveInterface(reserves[token]), hintReserveIndex)); reserveListingStage[token] = ListingStage.NO_RESERVE; reserves[token] = OrderbookReserveInterface(0); TokenOrderbookListingStage(token, ListingStage.NO_RESERVE); } /// @dev permission less reserve currently supports one token per reserve. function getOrderbookListingStage(ERC20 token) public view returns(address, ListingStage) { } }
reserves[token].kncRateBlocksTrade()
283,919
reserves[token].kncRateBlocksTrade()
null
contract InternalNetworkInterface { function addReserve( KyberReserveInterface reserve, bool isPermissionless ) public returns(bool); function removeReserve( KyberReserveInterface reserve, uint index ) public returns(bool); function listPairForReserve( address reserve, ERC20 token, bool ethToToken, bool tokenToEth, bool add ) public returns(bool); FeeBurnerInterface public feeBurnerContract; } contract PermissionlessOrderbookReserveLister { // KNC burn fee per wei value of an order. 25 in BPS = 0.25%. uint constant public ORDERBOOK_BURN_FEE_BPS = 25; uint public minNewOrderValueUsd = 1000; // set in order book minimum USD value of a new limit order uint public maxOrdersPerTrade; // set in order book maximum orders to be traversed in rate query and trade InternalNetworkInterface public kyberNetworkContract; OrderListFactoryInterface public orderFactoryContract; MedianizerInterface public medianizerContract; ERC20 public kncToken; enum ListingStage {NO_RESERVE, RESERVE_ADDED, RESERVE_INIT, RESERVE_LISTED} mapping(address => OrderbookReserveInterface) public reserves; //Permissionless orderbook reserves mapped per token mapping(address => ListingStage) public reserveListingStage; //Reserves listing stage mapping(address => bool) tokenListingBlocked; function PermissionlessOrderbookReserveLister( InternalNetworkInterface kyber, OrderListFactoryInterface factory, MedianizerInterface medianizer, ERC20 knc, address[] unsupportedTokens, uint maxOrders, uint minOrderValueUsd ) public { } event TokenOrderbookListingStage(ERC20 token, ListingStage stage); /// @dev anyone can call function addOrderbookContract(ERC20 token) public returns(bool) { } /// @dev anyone can call function initOrderbookContract(ERC20 token) public returns(bool) { } /// @dev anyone can call function listOrderbookContract(ERC20 token) public returns(bool) { } function unlistOrderbookContract(ERC20 token, uint hintReserveIndex) public { require(reserveListingStage[token] == ListingStage.RESERVE_LISTED); require(reserves[token].kncRateBlocksTrade()); require(<FILL_ME>) reserveListingStage[token] = ListingStage.NO_RESERVE; reserves[token] = OrderbookReserveInterface(0); TokenOrderbookListingStage(token, ListingStage.NO_RESERVE); } /// @dev permission less reserve currently supports one token per reserve. function getOrderbookListingStage(ERC20 token) public view returns(address, ListingStage) { } }
kyberNetworkContract.removeReserve(KyberReserveInterface(reserves[token]),hintReserveIndex)
283,919
kyberNetworkContract.removeReserve(KyberReserveInterface(reserves[token]),hintReserveIndex)
"pool-is-underwater"
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; import "../Strategy.sol"; import "../../interfaces/vesper/ICollateralManager.sol"; /// @dev This strategy will deposit collateral token in Maker, borrow Dai and /// deposit borrowed DAI in other lending pool to earn interest. abstract contract MakerStrategy is Strategy { using SafeERC20 for IERC20; address internal constant DAI = 0x6B175474E89094C44Da98b954EedeAC495271d0F; ICollateralManager public immutable cm; bytes32 public immutable collateralType; uint256 public highWater; uint256 public lowWater; uint256 private constant WAT = 10**16; constructor( address _pool, address _cm, address _swapManager, address _receiptToken, bytes32 _collateralType ) Strategy(_pool, _swapManager, _receiptToken) { } /// @notice Create new Maker vault function createVault() external onlyGovernor { } /** * @dev If pool is underwater this function will resolve underwater condition. * If Debt in Maker is greater than Dai balance in lender then pool is underwater. * Lowering DAI debt in Maker will resolve underwater condition. * Resolve: Calculate required collateral token to lower DAI debt. Withdraw required * collateral token from Maker and convert those to DAI via Uniswap. * Finally payback debt in Maker using DAI. * @dev Also report loss in pool. */ function resurface() external onlyKeeper { } /** * @notice Update balancing factors aka high water and low water values. * Water mark values represent Collateral Ratio in Maker. For example 300 as high water * means 300% collateral ratio. * @param _highWater Value for high water mark. * @param _lowWater Value for low water mark. */ function updateBalancingFactor(uint256 _highWater, uint256 _lowWater) external onlyGovernor { } /** * @notice Report total value of this strategy * @dev Make sure to return value in collateral token and in order to do that * we are using Uniswap to get collateral amount for earned DAI. */ function totalValue() external view virtual override returns (uint256 _totalValue) { } function vaultNum() external view returns (uint256) { } /// @dev Check whether given token is reserved or not. Reserved tokens are not allowed to sweep. function isReservedToken(address _token) public view virtual override returns (bool) { } /** * @notice Returns true if pool is underwater. * @notice Underwater - If debt is greater than earning of pool. * @notice Earning - Sum of DAI balance and DAI from accrued reward, if any, in lending pool. */ function isUnderwater() public view virtual returns (bool) { } /** * @notice Before migration hook. It will be called during migration * @dev Transfer Maker vault ownership to new strategy * @param _newStrategy Address of new strategy. */ function _beforeMigration(address _newStrategy) internal virtual override { } function _approveToken(uint256 _amount) internal virtual override { } function _moveDaiToMaker(uint256 _amount) internal { } function _moveDaiFromMaker(uint256 _amount) internal virtual { } /** * @notice Withdraw collateral to payback excess debt in pool. * @param _excessDebt Excess debt of strategy in collateral token * @return payback amount in collateral token. Usually it is equal to excess debt. */ function _liquidate(uint256 _excessDebt) internal virtual override returns (uint256) { } /** * @notice Calculate earning and convert it to collateral token * @dev Also claim rewards if available. * Withdraw excess DAI from lender. * Swap net earned DAI to collateral token * @return profit in collateral token */ function _realizeProfit( uint256 /*_totalDebt*/ ) internal virtual override returns (uint256) { } /** * @notice Calculate collateral loss from resurface, if any * @dev Difference of total debt of strategy in pool and collateral locked * in Maker vault is the loss. * @return loss in collateral token */ function _realizeLoss(uint256 _totalDebt) internal virtual override returns (uint256) { } /** * @notice Deposit collateral in Maker and rebalance collateral and debt in Maker. * @dev Based on defined risk parameter either borrow more DAI from Maker or * payback some DAI in Maker. It will try to mitigate risk of liquidation. */ function _reinvest() internal virtual override { uint256 _collateralBalance = collateralToken.balanceOf(address(this)); if (_collateralBalance != 0) { cm.depositCollateral(_collateralBalance); } ( uint256 _collateralLocked, uint256 _currentDebt, uint256 _collateralUsdRate, uint256 _collateralRatio, uint256 _minimumAllowedDebt ) = cm.getVaultInfo(address(this)); uint256 _maxDebt = (_collateralLocked * _collateralUsdRate) / highWater; if (_maxDebt < _minimumAllowedDebt) { // Dusting Scenario:: Based on collateral locked, if our max debt is less // than Maker defined minimum debt then payback whole debt and wind up. _moveDaiToMaker(_currentDebt); } else { if (_collateralRatio > highWater) { require(<FILL_ME>) // Safe to borrow more DAI _moveDaiFromMaker(_maxDebt - _currentDebt); } else if (_collateralRatio < lowWater) { // Being below low water brings risk of liquidation in Maker. // Withdraw DAI from Lender and deposit in Maker _moveDaiToMaker(_currentDebt - _maxDebt); } } } function _resurface() internal virtual { } function _withdraw(uint256 _amount) internal override { } // TODO do we need a safe withdraw function _withdrawHere(uint256 _amount) internal { } function _depositDaiToLender(uint256 _amount) internal virtual; function _rebalanceDaiInLender() internal virtual; function _withdrawDaiFromLender(uint256 _amount) internal virtual; function _getDaiBalance() internal view virtual returns (uint256); }
!isUnderwater(),"pool-is-underwater"
283,963
!isUnderwater()
"pool-is-above-water"
// SPDX-License-Identifier: MIT pragma solidity 0.8.3; import "../Strategy.sol"; import "../../interfaces/vesper/ICollateralManager.sol"; /// @dev This strategy will deposit collateral token in Maker, borrow Dai and /// deposit borrowed DAI in other lending pool to earn interest. abstract contract MakerStrategy is Strategy { using SafeERC20 for IERC20; address internal constant DAI = 0x6B175474E89094C44Da98b954EedeAC495271d0F; ICollateralManager public immutable cm; bytes32 public immutable collateralType; uint256 public highWater; uint256 public lowWater; uint256 private constant WAT = 10**16; constructor( address _pool, address _cm, address _swapManager, address _receiptToken, bytes32 _collateralType ) Strategy(_pool, _swapManager, _receiptToken) { } /// @notice Create new Maker vault function createVault() external onlyGovernor { } /** * @dev If pool is underwater this function will resolve underwater condition. * If Debt in Maker is greater than Dai balance in lender then pool is underwater. * Lowering DAI debt in Maker will resolve underwater condition. * Resolve: Calculate required collateral token to lower DAI debt. Withdraw required * collateral token from Maker and convert those to DAI via Uniswap. * Finally payback debt in Maker using DAI. * @dev Also report loss in pool. */ function resurface() external onlyKeeper { } /** * @notice Update balancing factors aka high water and low water values. * Water mark values represent Collateral Ratio in Maker. For example 300 as high water * means 300% collateral ratio. * @param _highWater Value for high water mark. * @param _lowWater Value for low water mark. */ function updateBalancingFactor(uint256 _highWater, uint256 _lowWater) external onlyGovernor { } /** * @notice Report total value of this strategy * @dev Make sure to return value in collateral token and in order to do that * we are using Uniswap to get collateral amount for earned DAI. */ function totalValue() external view virtual override returns (uint256 _totalValue) { } function vaultNum() external view returns (uint256) { } /// @dev Check whether given token is reserved or not. Reserved tokens are not allowed to sweep. function isReservedToken(address _token) public view virtual override returns (bool) { } /** * @notice Returns true if pool is underwater. * @notice Underwater - If debt is greater than earning of pool. * @notice Earning - Sum of DAI balance and DAI from accrued reward, if any, in lending pool. */ function isUnderwater() public view virtual returns (bool) { } /** * @notice Before migration hook. It will be called during migration * @dev Transfer Maker vault ownership to new strategy * @param _newStrategy Address of new strategy. */ function _beforeMigration(address _newStrategy) internal virtual override { } function _approveToken(uint256 _amount) internal virtual override { } function _moveDaiToMaker(uint256 _amount) internal { } function _moveDaiFromMaker(uint256 _amount) internal virtual { } /** * @notice Withdraw collateral to payback excess debt in pool. * @param _excessDebt Excess debt of strategy in collateral token * @return payback amount in collateral token. Usually it is equal to excess debt. */ function _liquidate(uint256 _excessDebt) internal virtual override returns (uint256) { } /** * @notice Calculate earning and convert it to collateral token * @dev Also claim rewards if available. * Withdraw excess DAI from lender. * Swap net earned DAI to collateral token * @return profit in collateral token */ function _realizeProfit( uint256 /*_totalDebt*/ ) internal virtual override returns (uint256) { } /** * @notice Calculate collateral loss from resurface, if any * @dev Difference of total debt of strategy in pool and collateral locked * in Maker vault is the loss. * @return loss in collateral token */ function _realizeLoss(uint256 _totalDebt) internal virtual override returns (uint256) { } /** * @notice Deposit collateral in Maker and rebalance collateral and debt in Maker. * @dev Based on defined risk parameter either borrow more DAI from Maker or * payback some DAI in Maker. It will try to mitigate risk of liquidation. */ function _reinvest() internal virtual override { } function _resurface() internal virtual { require(<FILL_ME>) uint256 _daiNeeded = cm.getVaultDebt(address(this)) - _getDaiBalance(); (address[] memory _path, uint256 _collateralNeeded, uint256 rIdx) = swapManager.bestInputFixedOutput(address(collateralToken), DAI, _daiNeeded); if (_collateralNeeded != 0) { cm.withdrawCollateral(_collateralNeeded); swapManager.ROUTERS(rIdx).swapExactTokensForTokens( _collateralNeeded, 1, _path, address(this), block.timestamp ); cm.payback(IERC20(DAI).balanceOf(address(this))); IVesperPool(pool).reportLoss(_daiNeeded); } } function _withdraw(uint256 _amount) internal override { } // TODO do we need a safe withdraw function _withdrawHere(uint256 _amount) internal { } function _depositDaiToLender(uint256 _amount) internal virtual; function _rebalanceDaiInLender() internal virtual; function _withdrawDaiFromLender(uint256 _amount) internal virtual; function _getDaiBalance() internal view virtual returns (uint256); }
isUnderwater(),"pool-is-above-water"
283,963
isUnderwater()
null
pragma solidity 0.4.24; /** * @title Vivalid ICO Contract * @dev ViV is an ERC-20 Standar Compliant Token * For more info https://vivalid.io */ /** * @title SafeMath by OpenZeppelin (partially) * @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 c) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title admined * @notice This contract is administered */ contract admined { mapping(address => uint8) level; //0 normal user //1 basic admin //2 master admin /** * @dev This contructor takes the msg.sender as the first master admin */ constructor() internal { } /** * @dev This modifier limits function execution to the admin */ modifier onlyAdmin(uint8 _level) { } /** * @notice This function transfer the adminship of the contract to _newAdmin * @param _newAdmin The new admin of the contract */ function adminshipLevel(address _newAdmin, uint8 _level) onlyAdmin(2) public { } /** * @dev Log Events */ event AdminshipUpdated(address _newAdmin, uint8 _level); } contract ViVICO is admined { using SafeMath for uint256; //This ico have 5 possible states enum State { PreSale, //PreSale - best value MainSale, OnHold, Failed, Successful } //Public variables //Time-state Related State public state = State.PreSale; //Set initial stage uint256 public PreSaleStart = now; //Once deployed uint256 constant public PreSaleDeadline = 1529452799; //(GMT): Tuesday, 19 de June de 2018 23:59:59 uint256 public MainSaleStart; //TBA uint256 public MainSaleDeadline; // TBA uint256 public completedAt; //Set when ico finish //Token-eth related uint256 public totalRaised; //eth collected in wei uint256 public PreSaleDistributed; //presale tokens distributed uint256 public totalDistributed; //Whole sale tokens distributed ERC20Basic public tokenReward; //Token contract address uint256 public softCap = 11000000 * (10 ** 18); //11M Tokens uint256 public hardCap = 140000000 * (10 ** 18); // 140M tokens //User balances handlers mapping (address => uint256) public ethOnContract; //Balance of sent eth per user mapping (address => uint256) public tokensSent; //Tokens sent per user mapping (address => uint256) public balance; //Tokens pending to send per user //Contract details address public creator; string public version = '1'; //Tokens per eth rates uint256[5] rates = [2520,2070,1980,1890,1800]; //User rights handlers mapping (address => bool) public whiteList; //List of allowed to send eth mapping (address => bool) public KYCValid; //KYC validation to claim tokens //events for log event LogFundrisingInitialized(address _creator); event LogMainSaleDateSet(uint256 _time); event LogFundingReceived(address _addr, uint _amount, uint _currentTotal); event LogBeneficiaryPaid(address _beneficiaryAddress); event LogContributorsPayout(address _addr, uint _amount); event LogRefund(address _addr, uint _amount); event LogFundingSuccessful(uint _totalRaised); event LogFundingFailed(uint _totalRaised); //Modofoer to prevent execution if ico has ended or is holded modifier notFinishedOrHold() { } /** * @notice ICO constructor * @param _addressOfTokenUsedAsReward is the token to distribute */ constructor(ERC20Basic _addressOfTokenUsedAsReward ) public { } /** * @notice Whitelist function */ function whitelistAddress(address _user, bool _flag) public onlyAdmin(1) { } /** * @notice KYC validation function */ function validateKYC(address _user, bool _flag) public onlyAdmin(1) { } /** * @notice Main Sale Start function */ function setMainSaleStart(uint256 _startTime) public onlyAdmin(2) { } /** * @notice contribution handler */ function contribute() public notFinishedOrHold payable { require(whiteList[msg.sender] == true); //User must be whitelisted require(msg.value >= 0.1 ether); //Minimal contribution uint256 tokenBought = 0; //tokens bought variable totalRaised = totalRaised.add(msg.value); //ether received updated ethOnContract[msg.sender] = ethOnContract[msg.sender].add(msg.value); //ether sent by user updated //Rate of exchange depends on stage if (state == State.PreSale){ require(now >= PreSaleStart); tokenBought = msg.value.mul(rates[0]); PreSaleDistributed = PreSaleDistributed.add(tokenBought); //Tokens sold on presale updated } else if (state == State.MainSale){ require(now >= MainSaleStart); if (now <= MainSaleStart.add(1 weeks)){ tokenBought = msg.value.mul(rates[1]); } else if (now <= MainSaleStart.add(2 weeks)){ tokenBought = msg.value.mul(rates[2]); } else if (now <= MainSaleStart.add(3 weeks)){ tokenBought = msg.value.mul(rates[3]); } else tokenBought = msg.value.mul(rates[4]); } require(<FILL_ME>) if(KYCValid[msg.sender] == true){ //if there are any unclaimed tokens uint256 tempBalance = balance[msg.sender]; //clear pending balance balance[msg.sender] = 0; //If KYC is valid tokens are send immediately require(tokenReward.transfer(msg.sender, tokenBought.add(tempBalance))); //Tokens sent to user updated tokensSent[msg.sender] = tokensSent[msg.sender].add(tokenBought.add(tempBalance)); emit LogContributorsPayout(msg.sender, tokenBought.add(tempBalance)); } else{ //If KYC is not valid tokens becomes pending balance[msg.sender] = balance[msg.sender].add(tokenBought); } totalDistributed = totalDistributed.add(tokenBought); //whole tokens sold updated emit LogFundingReceived(msg.sender, msg.value, totalRaised); checkIfFundingCompleteOrExpired(); } /** * @notice check status */ function checkIfFundingCompleteOrExpired() public { } /** * @notice successful closure handler */ function successful() public { } function claimEth() onlyAdmin(2) public { } /** * @notice function to let users claim their tokens */ function claimTokensByUser() public { } /** * @notice function to let admin claim tokens on behalf users */ function claimTokensByAdmin(address _target) onlyAdmin(1) public { } /** * @notice Failure handler */ function refund() public { } /** * @notice Function to claim any token stuck on contract */ function externalTokensRecovery(ERC20Basic _address) onlyAdmin(2) public{ } /* * @dev Direct payments handler */ function () public payable { } }
totalDistributed.add(tokenBought)<=hardCap
283,995
totalDistributed.add(tokenBought)<=hardCap
null
pragma solidity 0.4.24; /** * @title Vivalid ICO Contract * @dev ViV is an ERC-20 Standar Compliant Token * For more info https://vivalid.io */ /** * @title SafeMath by OpenZeppelin (partially) * @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 c) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title admined * @notice This contract is administered */ contract admined { mapping(address => uint8) level; //0 normal user //1 basic admin //2 master admin /** * @dev This contructor takes the msg.sender as the first master admin */ constructor() internal { } /** * @dev This modifier limits function execution to the admin */ modifier onlyAdmin(uint8 _level) { } /** * @notice This function transfer the adminship of the contract to _newAdmin * @param _newAdmin The new admin of the contract */ function adminshipLevel(address _newAdmin, uint8 _level) onlyAdmin(2) public { } /** * @dev Log Events */ event AdminshipUpdated(address _newAdmin, uint8 _level); } contract ViVICO is admined { using SafeMath for uint256; //This ico have 5 possible states enum State { PreSale, //PreSale - best value MainSale, OnHold, Failed, Successful } //Public variables //Time-state Related State public state = State.PreSale; //Set initial stage uint256 public PreSaleStart = now; //Once deployed uint256 constant public PreSaleDeadline = 1529452799; //(GMT): Tuesday, 19 de June de 2018 23:59:59 uint256 public MainSaleStart; //TBA uint256 public MainSaleDeadline; // TBA uint256 public completedAt; //Set when ico finish //Token-eth related uint256 public totalRaised; //eth collected in wei uint256 public PreSaleDistributed; //presale tokens distributed uint256 public totalDistributed; //Whole sale tokens distributed ERC20Basic public tokenReward; //Token contract address uint256 public softCap = 11000000 * (10 ** 18); //11M Tokens uint256 public hardCap = 140000000 * (10 ** 18); // 140M tokens //User balances handlers mapping (address => uint256) public ethOnContract; //Balance of sent eth per user mapping (address => uint256) public tokensSent; //Tokens sent per user mapping (address => uint256) public balance; //Tokens pending to send per user //Contract details address public creator; string public version = '1'; //Tokens per eth rates uint256[5] rates = [2520,2070,1980,1890,1800]; //User rights handlers mapping (address => bool) public whiteList; //List of allowed to send eth mapping (address => bool) public KYCValid; //KYC validation to claim tokens //events for log event LogFundrisingInitialized(address _creator); event LogMainSaleDateSet(uint256 _time); event LogFundingReceived(address _addr, uint _amount, uint _currentTotal); event LogBeneficiaryPaid(address _beneficiaryAddress); event LogContributorsPayout(address _addr, uint _amount); event LogRefund(address _addr, uint _amount); event LogFundingSuccessful(uint _totalRaised); event LogFundingFailed(uint _totalRaised); //Modofoer to prevent execution if ico has ended or is holded modifier notFinishedOrHold() { } /** * @notice ICO constructor * @param _addressOfTokenUsedAsReward is the token to distribute */ constructor(ERC20Basic _addressOfTokenUsedAsReward ) public { } /** * @notice Whitelist function */ function whitelistAddress(address _user, bool _flag) public onlyAdmin(1) { } /** * @notice KYC validation function */ function validateKYC(address _user, bool _flag) public onlyAdmin(1) { } /** * @notice Main Sale Start function */ function setMainSaleStart(uint256 _startTime) public onlyAdmin(2) { } /** * @notice contribution handler */ function contribute() public notFinishedOrHold payable { require(whiteList[msg.sender] == true); //User must be whitelisted require(msg.value >= 0.1 ether); //Minimal contribution uint256 tokenBought = 0; //tokens bought variable totalRaised = totalRaised.add(msg.value); //ether received updated ethOnContract[msg.sender] = ethOnContract[msg.sender].add(msg.value); //ether sent by user updated //Rate of exchange depends on stage if (state == State.PreSale){ require(now >= PreSaleStart); tokenBought = msg.value.mul(rates[0]); PreSaleDistributed = PreSaleDistributed.add(tokenBought); //Tokens sold on presale updated } else if (state == State.MainSale){ require(now >= MainSaleStart); if (now <= MainSaleStart.add(1 weeks)){ tokenBought = msg.value.mul(rates[1]); } else if (now <= MainSaleStart.add(2 weeks)){ tokenBought = msg.value.mul(rates[2]); } else if (now <= MainSaleStart.add(3 weeks)){ tokenBought = msg.value.mul(rates[3]); } else tokenBought = msg.value.mul(rates[4]); } require(totalDistributed.add(tokenBought) <= hardCap); if(KYCValid[msg.sender] == true){ //if there are any unclaimed tokens uint256 tempBalance = balance[msg.sender]; //clear pending balance balance[msg.sender] = 0; //If KYC is valid tokens are send immediately require(<FILL_ME>) //Tokens sent to user updated tokensSent[msg.sender] = tokensSent[msg.sender].add(tokenBought.add(tempBalance)); emit LogContributorsPayout(msg.sender, tokenBought.add(tempBalance)); } else{ //If KYC is not valid tokens becomes pending balance[msg.sender] = balance[msg.sender].add(tokenBought); } totalDistributed = totalDistributed.add(tokenBought); //whole tokens sold updated emit LogFundingReceived(msg.sender, msg.value, totalRaised); checkIfFundingCompleteOrExpired(); } /** * @notice check status */ function checkIfFundingCompleteOrExpired() public { } /** * @notice successful closure handler */ function successful() public { } function claimEth() onlyAdmin(2) public { } /** * @notice function to let users claim their tokens */ function claimTokensByUser() public { } /** * @notice function to let admin claim tokens on behalf users */ function claimTokensByAdmin(address _target) onlyAdmin(1) public { } /** * @notice Failure handler */ function refund() public { } /** * @notice Function to claim any token stuck on contract */ function externalTokensRecovery(ERC20Basic _address) onlyAdmin(2) public{ } /* * @dev Direct payments handler */ function () public payable { } }
tokenReward.transfer(msg.sender,tokenBought.add(tempBalance))
283,995
tokenReward.transfer(msg.sender,tokenBought.add(tempBalance))
null
pragma solidity 0.4.24; /** * @title Vivalid ICO Contract * @dev ViV is an ERC-20 Standar Compliant Token * For more info https://vivalid.io */ /** * @title SafeMath by OpenZeppelin (partially) * @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 c) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title admined * @notice This contract is administered */ contract admined { mapping(address => uint8) level; //0 normal user //1 basic admin //2 master admin /** * @dev This contructor takes the msg.sender as the first master admin */ constructor() internal { } /** * @dev This modifier limits function execution to the admin */ modifier onlyAdmin(uint8 _level) { } /** * @notice This function transfer the adminship of the contract to _newAdmin * @param _newAdmin The new admin of the contract */ function adminshipLevel(address _newAdmin, uint8 _level) onlyAdmin(2) public { } /** * @dev Log Events */ event AdminshipUpdated(address _newAdmin, uint8 _level); } contract ViVICO is admined { using SafeMath for uint256; //This ico have 5 possible states enum State { PreSale, //PreSale - best value MainSale, OnHold, Failed, Successful } //Public variables //Time-state Related State public state = State.PreSale; //Set initial stage uint256 public PreSaleStart = now; //Once deployed uint256 constant public PreSaleDeadline = 1529452799; //(GMT): Tuesday, 19 de June de 2018 23:59:59 uint256 public MainSaleStart; //TBA uint256 public MainSaleDeadline; // TBA uint256 public completedAt; //Set when ico finish //Token-eth related uint256 public totalRaised; //eth collected in wei uint256 public PreSaleDistributed; //presale tokens distributed uint256 public totalDistributed; //Whole sale tokens distributed ERC20Basic public tokenReward; //Token contract address uint256 public softCap = 11000000 * (10 ** 18); //11M Tokens uint256 public hardCap = 140000000 * (10 ** 18); // 140M tokens //User balances handlers mapping (address => uint256) public ethOnContract; //Balance of sent eth per user mapping (address => uint256) public tokensSent; //Tokens sent per user mapping (address => uint256) public balance; //Tokens pending to send per user //Contract details address public creator; string public version = '1'; //Tokens per eth rates uint256[5] rates = [2520,2070,1980,1890,1800]; //User rights handlers mapping (address => bool) public whiteList; //List of allowed to send eth mapping (address => bool) public KYCValid; //KYC validation to claim tokens //events for log event LogFundrisingInitialized(address _creator); event LogMainSaleDateSet(uint256 _time); event LogFundingReceived(address _addr, uint _amount, uint _currentTotal); event LogBeneficiaryPaid(address _beneficiaryAddress); event LogContributorsPayout(address _addr, uint _amount); event LogRefund(address _addr, uint _amount); event LogFundingSuccessful(uint _totalRaised); event LogFundingFailed(uint _totalRaised); //Modofoer to prevent execution if ico has ended or is holded modifier notFinishedOrHold() { } /** * @notice ICO constructor * @param _addressOfTokenUsedAsReward is the token to distribute */ constructor(ERC20Basic _addressOfTokenUsedAsReward ) public { } /** * @notice Whitelist function */ function whitelistAddress(address _user, bool _flag) public onlyAdmin(1) { } /** * @notice KYC validation function */ function validateKYC(address _user, bool _flag) public onlyAdmin(1) { } /** * @notice Main Sale Start function */ function setMainSaleStart(uint256 _startTime) public onlyAdmin(2) { } /** * @notice contribution handler */ function contribute() public notFinishedOrHold payable { } /** * @notice check status */ function checkIfFundingCompleteOrExpired() public { } /** * @notice successful closure handler */ function successful() public { } function claimEth() onlyAdmin(2) public { } /** * @notice function to let users claim their tokens */ function claimTokensByUser() public { //User must have a valid KYC require(<FILL_ME>) //Tokens pending are taken uint256 tokens = balance[msg.sender]; //For safety, pending balance is cleared balance[msg.sender] = 0; //Tokens are send to user require(tokenReward.transfer(msg.sender, tokens)); //Tokens sent to user updated tokensSent[msg.sender] = tokensSent[msg.sender].add(tokens); emit LogContributorsPayout(msg.sender, tokens); } /** * @notice function to let admin claim tokens on behalf users */ function claimTokensByAdmin(address _target) onlyAdmin(1) public { } /** * @notice Failure handler */ function refund() public { } /** * @notice Function to claim any token stuck on contract */ function externalTokensRecovery(ERC20Basic _address) onlyAdmin(2) public{ } /* * @dev Direct payments handler */ function () public payable { } }
KYCValid[msg.sender]==true
283,995
KYCValid[msg.sender]==true
null
pragma solidity 0.4.24; /** * @title Vivalid ICO Contract * @dev ViV is an ERC-20 Standar Compliant Token * For more info https://vivalid.io */ /** * @title SafeMath by OpenZeppelin (partially) * @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 c) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title admined * @notice This contract is administered */ contract admined { mapping(address => uint8) level; //0 normal user //1 basic admin //2 master admin /** * @dev This contructor takes the msg.sender as the first master admin */ constructor() internal { } /** * @dev This modifier limits function execution to the admin */ modifier onlyAdmin(uint8 _level) { } /** * @notice This function transfer the adminship of the contract to _newAdmin * @param _newAdmin The new admin of the contract */ function adminshipLevel(address _newAdmin, uint8 _level) onlyAdmin(2) public { } /** * @dev Log Events */ event AdminshipUpdated(address _newAdmin, uint8 _level); } contract ViVICO is admined { using SafeMath for uint256; //This ico have 5 possible states enum State { PreSale, //PreSale - best value MainSale, OnHold, Failed, Successful } //Public variables //Time-state Related State public state = State.PreSale; //Set initial stage uint256 public PreSaleStart = now; //Once deployed uint256 constant public PreSaleDeadline = 1529452799; //(GMT): Tuesday, 19 de June de 2018 23:59:59 uint256 public MainSaleStart; //TBA uint256 public MainSaleDeadline; // TBA uint256 public completedAt; //Set when ico finish //Token-eth related uint256 public totalRaised; //eth collected in wei uint256 public PreSaleDistributed; //presale tokens distributed uint256 public totalDistributed; //Whole sale tokens distributed ERC20Basic public tokenReward; //Token contract address uint256 public softCap = 11000000 * (10 ** 18); //11M Tokens uint256 public hardCap = 140000000 * (10 ** 18); // 140M tokens //User balances handlers mapping (address => uint256) public ethOnContract; //Balance of sent eth per user mapping (address => uint256) public tokensSent; //Tokens sent per user mapping (address => uint256) public balance; //Tokens pending to send per user //Contract details address public creator; string public version = '1'; //Tokens per eth rates uint256[5] rates = [2520,2070,1980,1890,1800]; //User rights handlers mapping (address => bool) public whiteList; //List of allowed to send eth mapping (address => bool) public KYCValid; //KYC validation to claim tokens //events for log event LogFundrisingInitialized(address _creator); event LogMainSaleDateSet(uint256 _time); event LogFundingReceived(address _addr, uint _amount, uint _currentTotal); event LogBeneficiaryPaid(address _beneficiaryAddress); event LogContributorsPayout(address _addr, uint _amount); event LogRefund(address _addr, uint _amount); event LogFundingSuccessful(uint _totalRaised); event LogFundingFailed(uint _totalRaised); //Modofoer to prevent execution if ico has ended or is holded modifier notFinishedOrHold() { } /** * @notice ICO constructor * @param _addressOfTokenUsedAsReward is the token to distribute */ constructor(ERC20Basic _addressOfTokenUsedAsReward ) public { } /** * @notice Whitelist function */ function whitelistAddress(address _user, bool _flag) public onlyAdmin(1) { } /** * @notice KYC validation function */ function validateKYC(address _user, bool _flag) public onlyAdmin(1) { } /** * @notice Main Sale Start function */ function setMainSaleStart(uint256 _startTime) public onlyAdmin(2) { } /** * @notice contribution handler */ function contribute() public notFinishedOrHold payable { } /** * @notice check status */ function checkIfFundingCompleteOrExpired() public { } /** * @notice successful closure handler */ function successful() public { } function claimEth() onlyAdmin(2) public { } /** * @notice function to let users claim their tokens */ function claimTokensByUser() public { //User must have a valid KYC require(KYCValid[msg.sender] == true); //Tokens pending are taken uint256 tokens = balance[msg.sender]; //For safety, pending balance is cleared balance[msg.sender] = 0; //Tokens are send to user require(<FILL_ME>) //Tokens sent to user updated tokensSent[msg.sender] = tokensSent[msg.sender].add(tokens); emit LogContributorsPayout(msg.sender, tokens); } /** * @notice function to let admin claim tokens on behalf users */ function claimTokensByAdmin(address _target) onlyAdmin(1) public { } /** * @notice Failure handler */ function refund() public { } /** * @notice Function to claim any token stuck on contract */ function externalTokensRecovery(ERC20Basic _address) onlyAdmin(2) public{ } /* * @dev Direct payments handler */ function () public payable { } }
tokenReward.transfer(msg.sender,tokens)
283,995
tokenReward.transfer(msg.sender,tokens)
null
pragma solidity 0.4.24; /** * @title Vivalid ICO Contract * @dev ViV is an ERC-20 Standar Compliant Token * For more info https://vivalid.io */ /** * @title SafeMath by OpenZeppelin (partially) * @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 c) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title admined * @notice This contract is administered */ contract admined { mapping(address => uint8) level; //0 normal user //1 basic admin //2 master admin /** * @dev This contructor takes the msg.sender as the first master admin */ constructor() internal { } /** * @dev This modifier limits function execution to the admin */ modifier onlyAdmin(uint8 _level) { } /** * @notice This function transfer the adminship of the contract to _newAdmin * @param _newAdmin The new admin of the contract */ function adminshipLevel(address _newAdmin, uint8 _level) onlyAdmin(2) public { } /** * @dev Log Events */ event AdminshipUpdated(address _newAdmin, uint8 _level); } contract ViVICO is admined { using SafeMath for uint256; //This ico have 5 possible states enum State { PreSale, //PreSale - best value MainSale, OnHold, Failed, Successful } //Public variables //Time-state Related State public state = State.PreSale; //Set initial stage uint256 public PreSaleStart = now; //Once deployed uint256 constant public PreSaleDeadline = 1529452799; //(GMT): Tuesday, 19 de June de 2018 23:59:59 uint256 public MainSaleStart; //TBA uint256 public MainSaleDeadline; // TBA uint256 public completedAt; //Set when ico finish //Token-eth related uint256 public totalRaised; //eth collected in wei uint256 public PreSaleDistributed; //presale tokens distributed uint256 public totalDistributed; //Whole sale tokens distributed ERC20Basic public tokenReward; //Token contract address uint256 public softCap = 11000000 * (10 ** 18); //11M Tokens uint256 public hardCap = 140000000 * (10 ** 18); // 140M tokens //User balances handlers mapping (address => uint256) public ethOnContract; //Balance of sent eth per user mapping (address => uint256) public tokensSent; //Tokens sent per user mapping (address => uint256) public balance; //Tokens pending to send per user //Contract details address public creator; string public version = '1'; //Tokens per eth rates uint256[5] rates = [2520,2070,1980,1890,1800]; //User rights handlers mapping (address => bool) public whiteList; //List of allowed to send eth mapping (address => bool) public KYCValid; //KYC validation to claim tokens //events for log event LogFundrisingInitialized(address _creator); event LogMainSaleDateSet(uint256 _time); event LogFundingReceived(address _addr, uint _amount, uint _currentTotal); event LogBeneficiaryPaid(address _beneficiaryAddress); event LogContributorsPayout(address _addr, uint _amount); event LogRefund(address _addr, uint _amount); event LogFundingSuccessful(uint _totalRaised); event LogFundingFailed(uint _totalRaised); //Modofoer to prevent execution if ico has ended or is holded modifier notFinishedOrHold() { } /** * @notice ICO constructor * @param _addressOfTokenUsedAsReward is the token to distribute */ constructor(ERC20Basic _addressOfTokenUsedAsReward ) public { } /** * @notice Whitelist function */ function whitelistAddress(address _user, bool _flag) public onlyAdmin(1) { } /** * @notice KYC validation function */ function validateKYC(address _user, bool _flag) public onlyAdmin(1) { } /** * @notice Main Sale Start function */ function setMainSaleStart(uint256 _startTime) public onlyAdmin(2) { } /** * @notice contribution handler */ function contribute() public notFinishedOrHold payable { } /** * @notice check status */ function checkIfFundingCompleteOrExpired() public { } /** * @notice successful closure handler */ function successful() public { } function claimEth() onlyAdmin(2) public { } /** * @notice function to let users claim their tokens */ function claimTokensByUser() public { } /** * @notice function to let admin claim tokens on behalf users */ function claimTokensByAdmin(address _target) onlyAdmin(1) public { //User must have a valid KYC require(<FILL_ME>) //Tokens pending are taken uint256 tokens = balance[_target]; //For safety, pending balance is cleared balance[_target] = 0; //Tokens are send to user require(tokenReward.transfer(_target, tokens)); //Tokens sent to user updated tokensSent[_target] = tokensSent[_target].add(tokens); emit LogContributorsPayout(_target, tokens); } /** * @notice Failure handler */ function refund() public { } /** * @notice Function to claim any token stuck on contract */ function externalTokensRecovery(ERC20Basic _address) onlyAdmin(2) public{ } /* * @dev Direct payments handler */ function () public payable { } }
KYCValid[_target]==true
283,995
KYCValid[_target]==true
null
pragma solidity 0.4.24; /** * @title Vivalid ICO Contract * @dev ViV is an ERC-20 Standar Compliant Token * For more info https://vivalid.io */ /** * @title SafeMath by OpenZeppelin (partially) * @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 c) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title admined * @notice This contract is administered */ contract admined { mapping(address => uint8) level; //0 normal user //1 basic admin //2 master admin /** * @dev This contructor takes the msg.sender as the first master admin */ constructor() internal { } /** * @dev This modifier limits function execution to the admin */ modifier onlyAdmin(uint8 _level) { } /** * @notice This function transfer the adminship of the contract to _newAdmin * @param _newAdmin The new admin of the contract */ function adminshipLevel(address _newAdmin, uint8 _level) onlyAdmin(2) public { } /** * @dev Log Events */ event AdminshipUpdated(address _newAdmin, uint8 _level); } contract ViVICO is admined { using SafeMath for uint256; //This ico have 5 possible states enum State { PreSale, //PreSale - best value MainSale, OnHold, Failed, Successful } //Public variables //Time-state Related State public state = State.PreSale; //Set initial stage uint256 public PreSaleStart = now; //Once deployed uint256 constant public PreSaleDeadline = 1529452799; //(GMT): Tuesday, 19 de June de 2018 23:59:59 uint256 public MainSaleStart; //TBA uint256 public MainSaleDeadline; // TBA uint256 public completedAt; //Set when ico finish //Token-eth related uint256 public totalRaised; //eth collected in wei uint256 public PreSaleDistributed; //presale tokens distributed uint256 public totalDistributed; //Whole sale tokens distributed ERC20Basic public tokenReward; //Token contract address uint256 public softCap = 11000000 * (10 ** 18); //11M Tokens uint256 public hardCap = 140000000 * (10 ** 18); // 140M tokens //User balances handlers mapping (address => uint256) public ethOnContract; //Balance of sent eth per user mapping (address => uint256) public tokensSent; //Tokens sent per user mapping (address => uint256) public balance; //Tokens pending to send per user //Contract details address public creator; string public version = '1'; //Tokens per eth rates uint256[5] rates = [2520,2070,1980,1890,1800]; //User rights handlers mapping (address => bool) public whiteList; //List of allowed to send eth mapping (address => bool) public KYCValid; //KYC validation to claim tokens //events for log event LogFundrisingInitialized(address _creator); event LogMainSaleDateSet(uint256 _time); event LogFundingReceived(address _addr, uint _amount, uint _currentTotal); event LogBeneficiaryPaid(address _beneficiaryAddress); event LogContributorsPayout(address _addr, uint _amount); event LogRefund(address _addr, uint _amount); event LogFundingSuccessful(uint _totalRaised); event LogFundingFailed(uint _totalRaised); //Modofoer to prevent execution if ico has ended or is holded modifier notFinishedOrHold() { } /** * @notice ICO constructor * @param _addressOfTokenUsedAsReward is the token to distribute */ constructor(ERC20Basic _addressOfTokenUsedAsReward ) public { } /** * @notice Whitelist function */ function whitelistAddress(address _user, bool _flag) public onlyAdmin(1) { } /** * @notice KYC validation function */ function validateKYC(address _user, bool _flag) public onlyAdmin(1) { } /** * @notice Main Sale Start function */ function setMainSaleStart(uint256 _startTime) public onlyAdmin(2) { } /** * @notice contribution handler */ function contribute() public notFinishedOrHold payable { } /** * @notice check status */ function checkIfFundingCompleteOrExpired() public { } /** * @notice successful closure handler */ function successful() public { } function claimEth() onlyAdmin(2) public { } /** * @notice function to let users claim their tokens */ function claimTokensByUser() public { } /** * @notice function to let admin claim tokens on behalf users */ function claimTokensByAdmin(address _target) onlyAdmin(1) public { //User must have a valid KYC require(KYCValid[_target] == true); //Tokens pending are taken uint256 tokens = balance[_target]; //For safety, pending balance is cleared balance[_target] = 0; //Tokens are send to user require(<FILL_ME>) //Tokens sent to user updated tokensSent[_target] = tokensSent[_target].add(tokens); emit LogContributorsPayout(_target, tokens); } /** * @notice Failure handler */ function refund() public { } /** * @notice Function to claim any token stuck on contract */ function externalTokensRecovery(ERC20Basic _address) onlyAdmin(2) public{ } /* * @dev Direct payments handler */ function () public payable { } }
tokenReward.transfer(_target,tokens)
283,995
tokenReward.transfer(_target,tokens)
null
pragma solidity 0.4.24; /** * @title Vivalid ICO Contract * @dev ViV is an ERC-20 Standar Compliant Token * For more info https://vivalid.io */ /** * @title SafeMath by OpenZeppelin (partially) * @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 c) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title admined * @notice This contract is administered */ contract admined { mapping(address => uint8) level; //0 normal user //1 basic admin //2 master admin /** * @dev This contructor takes the msg.sender as the first master admin */ constructor() internal { } /** * @dev This modifier limits function execution to the admin */ modifier onlyAdmin(uint8 _level) { } /** * @notice This function transfer the adminship of the contract to _newAdmin * @param _newAdmin The new admin of the contract */ function adminshipLevel(address _newAdmin, uint8 _level) onlyAdmin(2) public { } /** * @dev Log Events */ event AdminshipUpdated(address _newAdmin, uint8 _level); } contract ViVICO is admined { using SafeMath for uint256; //This ico have 5 possible states enum State { PreSale, //PreSale - best value MainSale, OnHold, Failed, Successful } //Public variables //Time-state Related State public state = State.PreSale; //Set initial stage uint256 public PreSaleStart = now; //Once deployed uint256 constant public PreSaleDeadline = 1529452799; //(GMT): Tuesday, 19 de June de 2018 23:59:59 uint256 public MainSaleStart; //TBA uint256 public MainSaleDeadline; // TBA uint256 public completedAt; //Set when ico finish //Token-eth related uint256 public totalRaised; //eth collected in wei uint256 public PreSaleDistributed; //presale tokens distributed uint256 public totalDistributed; //Whole sale tokens distributed ERC20Basic public tokenReward; //Token contract address uint256 public softCap = 11000000 * (10 ** 18); //11M Tokens uint256 public hardCap = 140000000 * (10 ** 18); // 140M tokens //User balances handlers mapping (address => uint256) public ethOnContract; //Balance of sent eth per user mapping (address => uint256) public tokensSent; //Tokens sent per user mapping (address => uint256) public balance; //Tokens pending to send per user //Contract details address public creator; string public version = '1'; //Tokens per eth rates uint256[5] rates = [2520,2070,1980,1890,1800]; //User rights handlers mapping (address => bool) public whiteList; //List of allowed to send eth mapping (address => bool) public KYCValid; //KYC validation to claim tokens //events for log event LogFundrisingInitialized(address _creator); event LogMainSaleDateSet(uint256 _time); event LogFundingReceived(address _addr, uint _amount, uint _currentTotal); event LogBeneficiaryPaid(address _beneficiaryAddress); event LogContributorsPayout(address _addr, uint _amount); event LogRefund(address _addr, uint _amount); event LogFundingSuccessful(uint _totalRaised); event LogFundingFailed(uint _totalRaised); //Modofoer to prevent execution if ico has ended or is holded modifier notFinishedOrHold() { } /** * @notice ICO constructor * @param _addressOfTokenUsedAsReward is the token to distribute */ constructor(ERC20Basic _addressOfTokenUsedAsReward ) public { } /** * @notice Whitelist function */ function whitelistAddress(address _user, bool _flag) public onlyAdmin(1) { } /** * @notice KYC validation function */ function validateKYC(address _user, bool _flag) public onlyAdmin(1) { } /** * @notice Main Sale Start function */ function setMainSaleStart(uint256 _startTime) public onlyAdmin(2) { } /** * @notice contribution handler */ function contribute() public notFinishedOrHold payable { } /** * @notice check status */ function checkIfFundingCompleteOrExpired() public { } /** * @notice successful closure handler */ function successful() public { } function claimEth() onlyAdmin(2) public { } /** * @notice function to let users claim their tokens */ function claimTokensByUser() public { } /** * @notice function to let admin claim tokens on behalf users */ function claimTokensByAdmin(address _target) onlyAdmin(1) public { } /** * @notice Failure handler */ function refund() public { //On failure users can get back their eth //If funding fail require(state == State.Failed); //Users have 90 days to claim a refund if (now < completedAt.add(90 days)){ //We take the amount of tokens already sent to user uint256 holderTokens = tokensSent[msg.sender]; //For security it's cleared tokensSent[msg.sender] = 0; //Also pending tokens are cleared balance[msg.sender] = 0; //Amount of ether sent by user is checked uint256 holderETH = ethOnContract[msg.sender]; //For security it's cleared ethOnContract[msg.sender] = 0; //Contract try to retrieve tokens from user balance using allowance require(<FILL_ME>) //If successful, send ether back msg.sender.transfer(holderETH); emit LogRefund(msg.sender,holderETH); } else{ //After 90 days period only a master admin can use the function require(level[msg.sender] >= 2); //To claim remanent tokens on contract uint256 remanent = tokenReward.balanceOf(this); //And ether creator.transfer(address(this).balance); tokenReward.transfer(creator,remanent); emit LogBeneficiaryPaid(creator); emit LogContributorsPayout(creator, remanent); } } /** * @notice Function to claim any token stuck on contract */ function externalTokensRecovery(ERC20Basic _address) onlyAdmin(2) public{ } /* * @dev Direct payments handler */ function () public payable { } }
tokenReward.transferFrom(msg.sender,address(this),holderTokens)
283,995
tokenReward.transferFrom(msg.sender,address(this),holderTokens)
null
pragma solidity 0.4.24; /** * @title Vivalid ICO Contract * @dev ViV is an ERC-20 Standar Compliant Token * For more info https://vivalid.io */ /** * @title SafeMath by OpenZeppelin (partially) * @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 c) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } } /** * @title ERC20Basic * @dev Simpler version of ERC20 interface * @dev see https://github.com/ethereum/EIPs/issues/179 */ contract ERC20Basic { function totalSupply() public view returns (uint256); function balanceOf(address who) public view returns (uint256); function transfer(address to, uint256 value) public returns (bool); function transferFrom(address from, address to, uint256 value) public returns (bool); event Transfer(address indexed from, address indexed to, uint256 value); } /** * @title admined * @notice This contract is administered */ contract admined { mapping(address => uint8) level; //0 normal user //1 basic admin //2 master admin /** * @dev This contructor takes the msg.sender as the first master admin */ constructor() internal { } /** * @dev This modifier limits function execution to the admin */ modifier onlyAdmin(uint8 _level) { } /** * @notice This function transfer the adminship of the contract to _newAdmin * @param _newAdmin The new admin of the contract */ function adminshipLevel(address _newAdmin, uint8 _level) onlyAdmin(2) public { } /** * @dev Log Events */ event AdminshipUpdated(address _newAdmin, uint8 _level); } contract ViVICO is admined { using SafeMath for uint256; //This ico have 5 possible states enum State { PreSale, //PreSale - best value MainSale, OnHold, Failed, Successful } //Public variables //Time-state Related State public state = State.PreSale; //Set initial stage uint256 public PreSaleStart = now; //Once deployed uint256 constant public PreSaleDeadline = 1529452799; //(GMT): Tuesday, 19 de June de 2018 23:59:59 uint256 public MainSaleStart; //TBA uint256 public MainSaleDeadline; // TBA uint256 public completedAt; //Set when ico finish //Token-eth related uint256 public totalRaised; //eth collected in wei uint256 public PreSaleDistributed; //presale tokens distributed uint256 public totalDistributed; //Whole sale tokens distributed ERC20Basic public tokenReward; //Token contract address uint256 public softCap = 11000000 * (10 ** 18); //11M Tokens uint256 public hardCap = 140000000 * (10 ** 18); // 140M tokens //User balances handlers mapping (address => uint256) public ethOnContract; //Balance of sent eth per user mapping (address => uint256) public tokensSent; //Tokens sent per user mapping (address => uint256) public balance; //Tokens pending to send per user //Contract details address public creator; string public version = '1'; //Tokens per eth rates uint256[5] rates = [2520,2070,1980,1890,1800]; //User rights handlers mapping (address => bool) public whiteList; //List of allowed to send eth mapping (address => bool) public KYCValid; //KYC validation to claim tokens //events for log event LogFundrisingInitialized(address _creator); event LogMainSaleDateSet(uint256 _time); event LogFundingReceived(address _addr, uint _amount, uint _currentTotal); event LogBeneficiaryPaid(address _beneficiaryAddress); event LogContributorsPayout(address _addr, uint _amount); event LogRefund(address _addr, uint _amount); event LogFundingSuccessful(uint _totalRaised); event LogFundingFailed(uint _totalRaised); //Modofoer to prevent execution if ico has ended or is holded modifier notFinishedOrHold() { } /** * @notice ICO constructor * @param _addressOfTokenUsedAsReward is the token to distribute */ constructor(ERC20Basic _addressOfTokenUsedAsReward ) public { } /** * @notice Whitelist function */ function whitelistAddress(address _user, bool _flag) public onlyAdmin(1) { } /** * @notice KYC validation function */ function validateKYC(address _user, bool _flag) public onlyAdmin(1) { } /** * @notice Main Sale Start function */ function setMainSaleStart(uint256 _startTime) public onlyAdmin(2) { } /** * @notice contribution handler */ function contribute() public notFinishedOrHold payable { } /** * @notice check status */ function checkIfFundingCompleteOrExpired() public { } /** * @notice successful closure handler */ function successful() public { } function claimEth() onlyAdmin(2) public { } /** * @notice function to let users claim their tokens */ function claimTokensByUser() public { } /** * @notice function to let admin claim tokens on behalf users */ function claimTokensByAdmin(address _target) onlyAdmin(1) public { } /** * @notice Failure handler */ function refund() public { //On failure users can get back their eth //If funding fail require(state == State.Failed); //Users have 90 days to claim a refund if (now < completedAt.add(90 days)){ //We take the amount of tokens already sent to user uint256 holderTokens = tokensSent[msg.sender]; //For security it's cleared tokensSent[msg.sender] = 0; //Also pending tokens are cleared balance[msg.sender] = 0; //Amount of ether sent by user is checked uint256 holderETH = ethOnContract[msg.sender]; //For security it's cleared ethOnContract[msg.sender] = 0; //Contract try to retrieve tokens from user balance using allowance require(tokenReward.transferFrom(msg.sender,address(this),holderTokens)); //If successful, send ether back msg.sender.transfer(holderETH); emit LogRefund(msg.sender,holderETH); } else{ //After 90 days period only a master admin can use the function require(<FILL_ME>) //To claim remanent tokens on contract uint256 remanent = tokenReward.balanceOf(this); //And ether creator.transfer(address(this).balance); tokenReward.transfer(creator,remanent); emit LogBeneficiaryPaid(creator); emit LogContributorsPayout(creator, remanent); } } /** * @notice Function to claim any token stuck on contract */ function externalTokensRecovery(ERC20Basic _address) onlyAdmin(2) public{ } /* * @dev Direct payments handler */ function () public payable { } }
level[msg.sender]>=2
283,995
level[msg.sender]>=2
"user-not-allowed-to-hold-token"
// Verified using https://dapp.tools // hevm: flattened sources of src/lender/operator.sol pragma solidity >=0.4.23 >=0.5.15 <0.6.0; ////// lib/tinlake-auth/lib/ds-note/src/note.sol /// note.sol -- the `note' modifier, for logging calls as events // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. /* pragma solidity >=0.4.23; */ contract DSNote { event LogNote( bytes4 indexed sig, address indexed guy, bytes32 indexed foo, bytes32 indexed bar, uint256 wad, bytes fax ) anonymous; modifier note { } } ////// lib/tinlake-auth/src/auth.sol // Copyright (C) Centrifuge 2020, based on MakerDAO dss https://github.com/makerdao/dss // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. /* pragma solidity >=0.5.15 <0.6.0; */ /* import "ds-note/note.sol"; */ contract Auth is DSNote { mapping (address => uint) public wards; function rely(address usr) public auth note { } function deny(address usr) public auth note { } modifier auth { } } ////// src/lender/operator.sol // Copyright (C) 2020 Centrifuge // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. /* pragma solidity >=0.5.15 <0.6.0; */ /* import "ds-note/note.sol"; */ /* import "tinlake-auth/auth.sol"; */ contract TrancheLike_3 { function supplyOrder(address usr, uint currencyAmount) public; function redeemOrder(address usr, uint tokenAmount) public; function disburse(address usr) public returns (uint payoutCurrencyAmount, uint payoutTokenAmount, uint remainingSupplyCurrency, uint remainingRedeemToken); function disburse(address usr, uint endEpoch) public returns (uint payoutCurrencyAmount, uint payoutTokenAmount, uint remainingSupplyCurrency, uint remainingRedeemToken); function currency() public view returns (address); } interface RestrictedTokenLike { function hasMember(address) external view returns (bool); } interface EIP2612PermitLike { function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external; } interface DaiPermitLike { function permit(address holder, address spender, uint256 nonce, uint256 expiry, bool allowed, uint8 v, bytes32 r, bytes32 s) external; } contract Operator is DSNote, Auth { TrancheLike_3 public tranche; RestrictedTokenLike public token; constructor(address tranche_) public { } /// sets the dependency to another contract function depend(bytes32 contractName, address addr) public auth { } /// only investors that are on the memberlist can submit supplyOrders function supplyOrder(uint amount) public note { require(<FILL_ME>) tranche.supplyOrder(msg.sender, amount); } /// only investors that are on the memberlist can submit redeemOrders function redeemOrder(uint amount) public note { } /// only investors that are on the memberlist can disburse function disburse() external returns(uint payoutCurrencyAmount, uint payoutTokenAmount, uint remainingSupplyCurrency, uint remainingRedeemToken) { } function disburse(uint endEpoch) external returns(uint payoutCurrencyAmount, uint payoutTokenAmount, uint remainingSupplyCurrency, uint remainingRedeemToken) { } // --- Permit Support --- function supplyOrderWithDaiPermit(uint amount, uint nonce, uint expiry, uint8 v, bytes32 r, bytes32 s) public { } function supplyOrderWithPermit(uint amount, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) public { } function redeemOrderWithPermit(uint amount, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) public { } }
(token.hasMember(msg.sender)==true),"user-not-allowed-to-hold-token"
284,062
(token.hasMember(msg.sender)==true)
"Max airdrop quantity reached"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract Kings is ERC721, ERC721Enumerable, ERC721URIStorage, Pausable, Ownable { using Counters for Counters.Counter; uint public constant MAX_SUPPLY = 10000; uint public constant AIRDROP_QUANTITY = 100; uint public constant PRE_SALE_QUANTITY = 300; uint public constant MAX_MINT_AMOUNT = 10; bool isPublicSaleOpen = false; bool isPreSaleOpen = false; mapping (address => bool) private presaleWallets; uint public constant SALE_PRICE = 0.09 ether; uint public constant PRESALE_PRICE = 0.09 ether; string public baseURI = "QmUNN5WFUmdD95E8qiGBD1QHjSSTkvNPRSgunSpR1s1UK4/"; uint private airdrop_count = 0; Counters.Counter private _tokenIdCounter; constructor() ERC721("Kings", "KINGS") { } function pause() public onlyOwner { } function unpause() public onlyOwner { } function togglePublicSale() public onlyOwner { } function togglePreSale() public onlyOwner { } function setBaseURI(string memory newBaseURI) external onlyOwner { } function _baseURI() internal override view returns (string memory) { } function registerPresaleWallets(address[] memory wallets) public onlyOwner { } function isRegisteredForPresale(address wallet) public view returns (bool) { } /// @notice The owner-only airdrop minting. function mintAirdrop(uint256 amount) public onlyOwner { uint currentTotalSupply = totalSupply(); /// @notice This must be done before pre-sale or general minting. require(currentTotalSupply < MAX_SUPPLY, "Max airdrop quantity reached"); require(<FILL_ME>) require(currentTotalSupply + amount <= MAX_SUPPLY, "Max airdrop quantity reached"); airdrop_count = airdrop_count + amount; _mintAmountTo(msg.sender, amount); } /// @notice Registered pre-sale minting. function mintPresale(uint256 amount) public payable { } /// @notice Public minting. function mint(uint256 amount) public payable { } /// @notice Send contract balance to owner. function withdraw() public onlyOwner { } function _mintAmountTo(address to, uint256 amount) internal { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal whenNotPaused override(ERC721, ERC721Enumerable) { } // The following functions are overrides required by Solidity. function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) { } function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { } }
airdrop_count+amount<=AIRDROP_QUANTITY,"Max airdrop quantity reached"
284,094
airdrop_count+amount<=AIRDROP_QUANTITY
"Max airdrop quantity reached"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract Kings is ERC721, ERC721Enumerable, ERC721URIStorage, Pausable, Ownable { using Counters for Counters.Counter; uint public constant MAX_SUPPLY = 10000; uint public constant AIRDROP_QUANTITY = 100; uint public constant PRE_SALE_QUANTITY = 300; uint public constant MAX_MINT_AMOUNT = 10; bool isPublicSaleOpen = false; bool isPreSaleOpen = false; mapping (address => bool) private presaleWallets; uint public constant SALE_PRICE = 0.09 ether; uint public constant PRESALE_PRICE = 0.09 ether; string public baseURI = "QmUNN5WFUmdD95E8qiGBD1QHjSSTkvNPRSgunSpR1s1UK4/"; uint private airdrop_count = 0; Counters.Counter private _tokenIdCounter; constructor() ERC721("Kings", "KINGS") { } function pause() public onlyOwner { } function unpause() public onlyOwner { } function togglePublicSale() public onlyOwner { } function togglePreSale() public onlyOwner { } function setBaseURI(string memory newBaseURI) external onlyOwner { } function _baseURI() internal override view returns (string memory) { } function registerPresaleWallets(address[] memory wallets) public onlyOwner { } function isRegisteredForPresale(address wallet) public view returns (bool) { } /// @notice The owner-only airdrop minting. function mintAirdrop(uint256 amount) public onlyOwner { uint currentTotalSupply = totalSupply(); /// @notice This must be done before pre-sale or general minting. require(currentTotalSupply < MAX_SUPPLY, "Max airdrop quantity reached"); require(airdrop_count + amount <= AIRDROP_QUANTITY, "Max airdrop quantity reached"); require(<FILL_ME>) airdrop_count = airdrop_count + amount; _mintAmountTo(msg.sender, amount); } /// @notice Registered pre-sale minting. function mintPresale(uint256 amount) public payable { } /// @notice Public minting. function mint(uint256 amount) public payable { } /// @notice Send contract balance to owner. function withdraw() public onlyOwner { } function _mintAmountTo(address to, uint256 amount) internal { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal whenNotPaused override(ERC721, ERC721Enumerable) { } // The following functions are overrides required by Solidity. function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) { } function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { } }
currentTotalSupply+amount<=MAX_SUPPLY,"Max airdrop quantity reached"
284,094
currentTotalSupply+amount<=MAX_SUPPLY
'Each address may only buy 5 kings in presale'
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract Kings is ERC721, ERC721Enumerable, ERC721URIStorage, Pausable, Ownable { using Counters for Counters.Counter; uint public constant MAX_SUPPLY = 10000; uint public constant AIRDROP_QUANTITY = 100; uint public constant PRE_SALE_QUANTITY = 300; uint public constant MAX_MINT_AMOUNT = 10; bool isPublicSaleOpen = false; bool isPreSaleOpen = false; mapping (address => bool) private presaleWallets; uint public constant SALE_PRICE = 0.09 ether; uint public constant PRESALE_PRICE = 0.09 ether; string public baseURI = "QmUNN5WFUmdD95E8qiGBD1QHjSSTkvNPRSgunSpR1s1UK4/"; uint private airdrop_count = 0; Counters.Counter private _tokenIdCounter; constructor() ERC721("Kings", "KINGS") { } function pause() public onlyOwner { } function unpause() public onlyOwner { } function togglePublicSale() public onlyOwner { } function togglePreSale() public onlyOwner { } function setBaseURI(string memory newBaseURI) external onlyOwner { } function _baseURI() internal override view returns (string memory) { } function registerPresaleWallets(address[] memory wallets) public onlyOwner { } function isRegisteredForPresale(address wallet) public view returns (bool) { } /// @notice The owner-only airdrop minting. function mintAirdrop(uint256 amount) public onlyOwner { } /// @notice Registered pre-sale minting. function mintPresale(uint256 amount) public payable { uint currentTotalSupply = totalSupply(); /// @notice Pre-sale minting cannot happen until the designated time. require(isPreSaleOpen == true, "presale is not open"); // /// @notice Pre-sale minting cannot happen until airdrop is complete. // require(currentTotalSupply >= AIRDROP_QUANTITY, "Not yet launched"); require(<FILL_ME>) /// @notice Sender wallet must be registered for the pre-sale. require(isRegisteredForPresale(msg.sender), "Not registered for pre-sale"); /// @notice Cannot exceed the pre-sale supply. require(currentTotalSupply + amount <= AIRDROP_QUANTITY + PRE_SALE_QUANTITY, "Not enough pre-sale supply left"); /// @notice Cannot mint more than the max mint per transaction. require(amount <= MAX_MINT_AMOUNT, "Mint amount exceeds the limit"); /// @notice Must send the correct amount. require(msg.value > 0 && msg.value == amount * PRESALE_PRICE, "Pre-sale minting price not met"); _mintAmountTo(msg.sender, amount); } /// @notice Public minting. function mint(uint256 amount) public payable { } /// @notice Send contract balance to owner. function withdraw() public onlyOwner { } function _mintAmountTo(address to, uint256 amount) internal { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal whenNotPaused override(ERC721, ERC721Enumerable) { } // The following functions are overrides required by Solidity. function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) { } function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { } }
balanceOf(msg.sender)+amount<=5,'Each address may only buy 5 kings in presale'
284,094
balanceOf(msg.sender)+amount<=5
"Not registered for pre-sale"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract Kings is ERC721, ERC721Enumerable, ERC721URIStorage, Pausable, Ownable { using Counters for Counters.Counter; uint public constant MAX_SUPPLY = 10000; uint public constant AIRDROP_QUANTITY = 100; uint public constant PRE_SALE_QUANTITY = 300; uint public constant MAX_MINT_AMOUNT = 10; bool isPublicSaleOpen = false; bool isPreSaleOpen = false; mapping (address => bool) private presaleWallets; uint public constant SALE_PRICE = 0.09 ether; uint public constant PRESALE_PRICE = 0.09 ether; string public baseURI = "QmUNN5WFUmdD95E8qiGBD1QHjSSTkvNPRSgunSpR1s1UK4/"; uint private airdrop_count = 0; Counters.Counter private _tokenIdCounter; constructor() ERC721("Kings", "KINGS") { } function pause() public onlyOwner { } function unpause() public onlyOwner { } function togglePublicSale() public onlyOwner { } function togglePreSale() public onlyOwner { } function setBaseURI(string memory newBaseURI) external onlyOwner { } function _baseURI() internal override view returns (string memory) { } function registerPresaleWallets(address[] memory wallets) public onlyOwner { } function isRegisteredForPresale(address wallet) public view returns (bool) { } /// @notice The owner-only airdrop minting. function mintAirdrop(uint256 amount) public onlyOwner { } /// @notice Registered pre-sale minting. function mintPresale(uint256 amount) public payable { uint currentTotalSupply = totalSupply(); /// @notice Pre-sale minting cannot happen until the designated time. require(isPreSaleOpen == true, "presale is not open"); // /// @notice Pre-sale minting cannot happen until airdrop is complete. // require(currentTotalSupply >= AIRDROP_QUANTITY, "Not yet launched"); require(balanceOf(msg.sender) + amount <= 5, 'Each address may only buy 5 kings in presale'); /// @notice Sender wallet must be registered for the pre-sale. require(<FILL_ME>) /// @notice Cannot exceed the pre-sale supply. require(currentTotalSupply + amount <= AIRDROP_QUANTITY + PRE_SALE_QUANTITY, "Not enough pre-sale supply left"); /// @notice Cannot mint more than the max mint per transaction. require(amount <= MAX_MINT_AMOUNT, "Mint amount exceeds the limit"); /// @notice Must send the correct amount. require(msg.value > 0 && msg.value == amount * PRESALE_PRICE, "Pre-sale minting price not met"); _mintAmountTo(msg.sender, amount); } /// @notice Public minting. function mint(uint256 amount) public payable { } /// @notice Send contract balance to owner. function withdraw() public onlyOwner { } function _mintAmountTo(address to, uint256 amount) internal { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal whenNotPaused override(ERC721, ERC721Enumerable) { } // The following functions are overrides required by Solidity. function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) { } function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { } }
isRegisteredForPresale(msg.sender),"Not registered for pre-sale"
284,094
isRegisteredForPresale(msg.sender)
"Not enough pre-sale supply left"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import "@openzeppelin/contracts/security/Pausable.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/Counters.sol"; contract Kings is ERC721, ERC721Enumerable, ERC721URIStorage, Pausable, Ownable { using Counters for Counters.Counter; uint public constant MAX_SUPPLY = 10000; uint public constant AIRDROP_QUANTITY = 100; uint public constant PRE_SALE_QUANTITY = 300; uint public constant MAX_MINT_AMOUNT = 10; bool isPublicSaleOpen = false; bool isPreSaleOpen = false; mapping (address => bool) private presaleWallets; uint public constant SALE_PRICE = 0.09 ether; uint public constant PRESALE_PRICE = 0.09 ether; string public baseURI = "QmUNN5WFUmdD95E8qiGBD1QHjSSTkvNPRSgunSpR1s1UK4/"; uint private airdrop_count = 0; Counters.Counter private _tokenIdCounter; constructor() ERC721("Kings", "KINGS") { } function pause() public onlyOwner { } function unpause() public onlyOwner { } function togglePublicSale() public onlyOwner { } function togglePreSale() public onlyOwner { } function setBaseURI(string memory newBaseURI) external onlyOwner { } function _baseURI() internal override view returns (string memory) { } function registerPresaleWallets(address[] memory wallets) public onlyOwner { } function isRegisteredForPresale(address wallet) public view returns (bool) { } /// @notice The owner-only airdrop minting. function mintAirdrop(uint256 amount) public onlyOwner { } /// @notice Registered pre-sale minting. function mintPresale(uint256 amount) public payable { uint currentTotalSupply = totalSupply(); /// @notice Pre-sale minting cannot happen until the designated time. require(isPreSaleOpen == true, "presale is not open"); // /// @notice Pre-sale minting cannot happen until airdrop is complete. // require(currentTotalSupply >= AIRDROP_QUANTITY, "Not yet launched"); require(balanceOf(msg.sender) + amount <= 5, 'Each address may only buy 5 kings in presale'); /// @notice Sender wallet must be registered for the pre-sale. require(isRegisteredForPresale(msg.sender), "Not registered for pre-sale"); /// @notice Cannot exceed the pre-sale supply. require(<FILL_ME>) /// @notice Cannot mint more than the max mint per transaction. require(amount <= MAX_MINT_AMOUNT, "Mint amount exceeds the limit"); /// @notice Must send the correct amount. require(msg.value > 0 && msg.value == amount * PRESALE_PRICE, "Pre-sale minting price not met"); _mintAmountTo(msg.sender, amount); } /// @notice Public minting. function mint(uint256 amount) public payable { } /// @notice Send contract balance to owner. function withdraw() public onlyOwner { } function _mintAmountTo(address to, uint256 amount) internal { } function _beforeTokenTransfer(address from, address to, uint256 tokenId) internal whenNotPaused override(ERC721, ERC721Enumerable) { } // The following functions are overrides required by Solidity. function _burn(uint256 tokenId) internal override(ERC721, ERC721URIStorage) { } function tokenURI(uint256 tokenId) public view override(ERC721, ERC721URIStorage) returns (string memory) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { } }
currentTotalSupply+amount<=AIRDROP_QUANTITY+PRE_SALE_QUANTITY,"Not enough pre-sale supply left"
284,094
currentTotalSupply+amount<=AIRDROP_QUANTITY+PRE_SALE_QUANTITY
"User is not on whitelist"
pragma solidity ^0.8.0; contract WhiteList is Ownable, EIP712 { bytes32 constant public MINT_CALL_HASH_TYPE = keccak256("mint(address receiver)"); address public whitelistSigner; constructor() EIP712("TsukiWhiteList", "1") {} function setWhitelistSigner(address _address) external onlyOwner { } function recoverSigner(address sender, bytes memory signature) public view returns (address) { } function getDigest(address sender) public view returns (bytes32) { } modifier isUserWhileList(address sender, bytes memory signature) { require(<FILL_ME>) _; } function getDomainSeparatorV4() external view onlyOwner returns (bytes32) { } }
recoverSigner(sender,signature)==whitelistSigner,"User is not on whitelist"
284,180
recoverSigner(sender,signature)==whitelistSigner
"Already Signed"
pragma solidity 0.8.4; contract Dispatcher is Ownable { Vault private vault; address private multiSigAddress; address private bridgeControllerAddress; address[] private validators; uint256 private valThreshold = 1; uint256 private uuid = 0; uint256[] private outstandingTransferProposalsIndex; struct transferProposal { address recipientAddress; uint256 amount; address tokenAddress; address[] signatures; string note; bool signed; } mapping(uint256 => transferProposal) private transferProposalStore; mapping(string => string) private transactions; constructor(address _vaultAddress, address _multiSigAddress) Ownable() { } /***************** Getters **************** */ function getBridgeController() public view returns (address) { } function getValidators() public view returns (address[] memory) { } function getVaultAddress() public view returns (Vault) { } function getMultiSig() public view returns (address) { } function getOutstandingTransferProposals() public view returns (uint256[] memory) { } function getValThreshold() public view returns (uint256) { } function getCreatedTransanction(string memory txID) public view returns (string memory) { } function getUUID() public view returns (uint256) { } /***************** Setters **************** */ function newThreshold(uint256 _threshold) external onlyMultiSig { } function newMultiSig(address _multiSigAddress) external onlyMultiSig { } function newVault(address _vaultAddress) external onlyMultiSig { } function newBridgeController(address _bridgeControllerAddress) external onlyMultiSig { } function addNewValidator(address _validatorAddress) external onlyMultiSig { } function removeValidator(address _validatorAddress) external onlyMultiSig { } /***************** Calls **************** */ function proposeNewTxn(address _userAddress, address _tokenAddress, uint256 _amount, string memory _note) external onlyBridgeController{ } function approveTxn(uint256 _proposal) external onlyValidators oneVoteTransfer(_proposal){ require(<FILL_ME>) transferProposalStore[_proposal].signatures.push(msg.sender); if (transferProposalStore[_proposal].signatures.length >= valThreshold) { vault.transferFunds(transferProposalStore[_proposal].tokenAddress, transferProposalStore[_proposal].recipientAddress, transferProposalStore[_proposal].amount); popTransferProposal(_proposal); emit ApprovedTransaction(transferProposalStore[_proposal].recipientAddress, transferProposalStore[_proposal].amount, _proposal); } } function createTxn( string memory _id, string memory _note, address _tokenAddress, uint256 _calculatedFee, uint256 _amount ) external payable{ } /***************** Internal **************** */ function popTransferProposal(uint256 _uuid) private { } /***************** Modifiers **************** */ modifier onlyBridgeController() { } modifier onlyMultiSig() { } modifier onlyValidators() { } modifier oneVoteTransfer (uint256 _proposal) { } /***************** Events **************** */ event NewVault(address newAddress); event NewMultiSigEvent(address newMultiSigAddress); event AddedNewValidator(address newValidator); event RemovedValidator(address oldValidator); event NewBridgeController(address newBridgeController); event NewThresholdEvent(uint256 newThreshold); event proposalCreated(uint256 UUID); event ApprovedTransaction(address indexed recipient, uint256 amount, uint256 UUID); event NewTransactionCreated(address indexed sender, address tokenAddress, uint256 amount); event ReleasedFunds(address indexed recipient, uint256 amount); }
transferProposalStore[_proposal].signed==false,"Already Signed"
284,236
transferProposalStore[_proposal].signed==false
"Must be a new transaction"
pragma solidity 0.8.4; contract Dispatcher is Ownable { Vault private vault; address private multiSigAddress; address private bridgeControllerAddress; address[] private validators; uint256 private valThreshold = 1; uint256 private uuid = 0; uint256[] private outstandingTransferProposalsIndex; struct transferProposal { address recipientAddress; uint256 amount; address tokenAddress; address[] signatures; string note; bool signed; } mapping(uint256 => transferProposal) private transferProposalStore; mapping(string => string) private transactions; constructor(address _vaultAddress, address _multiSigAddress) Ownable() { } /***************** Getters **************** */ function getBridgeController() public view returns (address) { } function getValidators() public view returns (address[] memory) { } function getVaultAddress() public view returns (Vault) { } function getMultiSig() public view returns (address) { } function getOutstandingTransferProposals() public view returns (uint256[] memory) { } function getValThreshold() public view returns (uint256) { } function getCreatedTransanction(string memory txID) public view returns (string memory) { } function getUUID() public view returns (uint256) { } /***************** Setters **************** */ function newThreshold(uint256 _threshold) external onlyMultiSig { } function newMultiSig(address _multiSigAddress) external onlyMultiSig { } function newVault(address _vaultAddress) external onlyMultiSig { } function newBridgeController(address _bridgeControllerAddress) external onlyMultiSig { } function addNewValidator(address _validatorAddress) external onlyMultiSig { } function removeValidator(address _validatorAddress) external onlyMultiSig { } /***************** Calls **************** */ function proposeNewTxn(address _userAddress, address _tokenAddress, uint256 _amount, string memory _note) external onlyBridgeController{ } function approveTxn(uint256 _proposal) external onlyValidators oneVoteTransfer(_proposal){ } function createTxn( string memory _id, string memory _note, address _tokenAddress, uint256 _calculatedFee, uint256 _amount ) external payable{ require(_amount > 0, "Must send an amount"); require(msg.value == _calculatedFee, "Calculated fee sent wrong"); require(<FILL_ME>) transactions[_id] = _note; ERC20(_tokenAddress).transferFrom(msg.sender, address(this), _amount); payable(bridgeControllerAddress).transfer(msg.value); emit NewTransactionCreated(msg.sender, _tokenAddress, _amount); } /***************** Internal **************** */ function popTransferProposal(uint256 _uuid) private { } /***************** Modifiers **************** */ modifier onlyBridgeController() { } modifier onlyMultiSig() { } modifier onlyValidators() { } modifier oneVoteTransfer (uint256 _proposal) { } /***************** Events **************** */ event NewVault(address newAddress); event NewMultiSigEvent(address newMultiSigAddress); event AddedNewValidator(address newValidator); event RemovedValidator(address oldValidator); event NewBridgeController(address newBridgeController); event NewThresholdEvent(uint256 newThreshold); event proposalCreated(uint256 UUID); event ApprovedTransaction(address indexed recipient, uint256 amount, uint256 UUID); event NewTransactionCreated(address indexed sender, address tokenAddress, uint256 amount); event ReleasedFunds(address indexed recipient, uint256 amount); }
bytes(transactions[_id]).length==0,"Must be a new transaction"
284,236
bytes(transactions[_id]).length==0
"You have already voted"
pragma solidity 0.8.4; contract Dispatcher is Ownable { Vault private vault; address private multiSigAddress; address private bridgeControllerAddress; address[] private validators; uint256 private valThreshold = 1; uint256 private uuid = 0; uint256[] private outstandingTransferProposalsIndex; struct transferProposal { address recipientAddress; uint256 amount; address tokenAddress; address[] signatures; string note; bool signed; } mapping(uint256 => transferProposal) private transferProposalStore; mapping(string => string) private transactions; constructor(address _vaultAddress, address _multiSigAddress) Ownable() { } /***************** Getters **************** */ function getBridgeController() public view returns (address) { } function getValidators() public view returns (address[] memory) { } function getVaultAddress() public view returns (Vault) { } function getMultiSig() public view returns (address) { } function getOutstandingTransferProposals() public view returns (uint256[] memory) { } function getValThreshold() public view returns (uint256) { } function getCreatedTransanction(string memory txID) public view returns (string memory) { } function getUUID() public view returns (uint256) { } /***************** Setters **************** */ function newThreshold(uint256 _threshold) external onlyMultiSig { } function newMultiSig(address _multiSigAddress) external onlyMultiSig { } function newVault(address _vaultAddress) external onlyMultiSig { } function newBridgeController(address _bridgeControllerAddress) external onlyMultiSig { } function addNewValidator(address _validatorAddress) external onlyMultiSig { } function removeValidator(address _validatorAddress) external onlyMultiSig { } /***************** Calls **************** */ function proposeNewTxn(address _userAddress, address _tokenAddress, uint256 _amount, string memory _note) external onlyBridgeController{ } function approveTxn(uint256 _proposal) external onlyValidators oneVoteTransfer(_proposal){ } function createTxn( string memory _id, string memory _note, address _tokenAddress, uint256 _calculatedFee, uint256 _amount ) external payable{ } /***************** Internal **************** */ function popTransferProposal(uint256 _uuid) private { } /***************** Modifiers **************** */ modifier onlyBridgeController() { } modifier onlyMultiSig() { } modifier onlyValidators() { } modifier oneVoteTransfer (uint256 _proposal) { for(uint256 i = 0; i < transferProposalStore[_proposal].signatures.length; i++){ require(<FILL_ME>) } _; } /***************** Events **************** */ event NewVault(address newAddress); event NewMultiSigEvent(address newMultiSigAddress); event AddedNewValidator(address newValidator); event RemovedValidator(address oldValidator); event NewBridgeController(address newBridgeController); event NewThresholdEvent(uint256 newThreshold); event proposalCreated(uint256 UUID); event ApprovedTransaction(address indexed recipient, uint256 amount, uint256 UUID); event NewTransactionCreated(address indexed sender, address tokenAddress, uint256 amount); event ReleasedFunds(address indexed recipient, uint256 amount); }
transferProposalStore[_proposal].signatures[i]!=msg.sender,"You have already voted"
284,236
transferProposalStore[_proposal].signatures[i]!=msg.sender
null
pragma solidity ^0.4.19; contract IGold { function balanceOf(address _owner) constant returns (uint256); function issueTokens(address _who, uint _tokens); function burnTokens(address _who, uint _tokens); } // StdToken inheritance is commented, because no 'totalSupply' needed contract IMNTP { /*is StdToken */ function balanceOf(address _owner) constant returns (uint256); // Additional methods that MNTP contract provides function lockTransfer(bool _lock); function issueTokens(address _who, uint _tokens); function burnTokens(address _who, uint _tokens); } contract SafeMath { function safeAdd(uint a, uint b) internal returns (uint) { } function safeSub(uint a, uint b) internal returns (uint) { } } contract CreatorEnabled { address public creator = 0x0; modifier onlyCreator() { } function changeCreator(address _to) public onlyCreator { } } contract StringMover { function stringToBytes32(string s) constant returns(bytes32){ } function stringToBytes64(string s) constant returns(bytes32,bytes32){ } function bytes32ToString(bytes32 x) constant returns (string) { } function bytes64ToString(bytes32 x, bytes32 y) constant returns (string) { } } contract Storage is SafeMath, StringMover { function Storage() public { } address public controllerAddress = 0x0; modifier onlyController() { } function setControllerAddress(address _newController) onlyController { } address public hotWalletAddress = 0x0; function setHotWalletAddress(address _address) onlyController { } // Fields - 1 mapping(uint => string) docs; uint public docCount = 0; // Fields - 2 mapping(string => mapping(uint => int)) fiatTxs; mapping(string => uint) fiatBalancesCents; mapping(string => uint) fiatTxCounts; uint fiatTxTotal = 0; // Fields - 3 mapping(string => mapping(uint => int)) goldTxs; mapping(string => uint) goldHotBalances; mapping(string => uint) goldTxCounts; uint goldTxTotal = 0; // Fields - 4 struct Request { address sender; string userId; string requestHash; bool buyRequest; // otherwise - sell // 0 - init // 1 - processed // 2 - cancelled uint8 state; } mapping (uint=>Request) requests; uint public requestsCount = 0; /////// function addDoc(string _ipfsDocLink) public onlyController returns(uint) { } function getDocCount() public constant returns (uint) { } function getDocAsBytes64(uint _index) public constant returns (bytes32,bytes32) { } function addFiatTransaction(string _userId, int _amountCents) public onlyController returns(uint) { } function getFiatTransactionsCount(string _userId) public constant returns (uint) { } function getAllFiatTransactionsCount() public constant returns (uint) { } function getFiatTransaction(string _userId, uint _index) public constant returns(int) { } function getUserFiatBalance(string _userId) public constant returns(uint) { } function addGoldTransaction(string _userId, int _amount) public onlyController returns(uint) { } function getGoldTransactionsCount(string _userId) public constant returns (uint) { } function getAllGoldTransactionsCount() public constant returns (uint) { } function getGoldTransaction(string _userId, uint _index) public constant returns(int) { } function getUserHotGoldBalance(string _userId) public constant returns(uint) { } function addBuyTokensRequest(address _who, string _userId, string _requestHash) public onlyController returns(uint) { } function addSellTokensRequest(address _who, string _userId, string _requestHash) onlyController returns(uint) { } function getRequestsCount() public constant returns(uint) { } function getRequest(uint _index) public constant returns( address a, bytes32 userId, bytes32 hashA, bytes32 hashB, bool buy, uint8 state) { } function cancelRequest(uint _index) onlyController public { } function setRequestProcessed(uint _index) onlyController public { } } contract GoldFiatFee is CreatorEnabled, StringMover { string gmUserId = ""; // Functions: function GoldFiatFee(string _gmUserId) { } function getGoldmintFeeAccount() public constant returns(bytes32) { } function setGoldmintFeeAccount(string _gmUserId) public onlyCreator { } function calculateBuyGoldFee(uint _mntpBalance, uint _goldValue) public constant returns(uint) { } function calculateSellGoldFee(uint _mntpBalance, uint _goldValue) public constant returns(uint) { } } contract IGoldFiatFee { function getGoldmintFeeAccount()public constant returns(bytes32); function calculateBuyGoldFee(uint _mntpBalance, uint _goldValue) public constant returns(uint); function calculateSellGoldFee(uint _mntpBalance, uint _goldValue) public constant returns(uint); } contract StorageController is SafeMath, CreatorEnabled, StringMover { Storage public stor; IMNTP public mntpToken; IGold public goldToken; IGoldFiatFee public fiatFee; address public ethDepositAddress = 0x0; address public managerAddress = 0x0; event NewTokenBuyRequest(address indexed _from, string indexed _userId); event NewTokenSellRequest(address indexed _from, string indexed _userId); event RequestCancelled(uint indexed _reqId); event RequestProcessed(uint indexed _reqId); event EthDeposited(uint indexed _requestId, address indexed _address, uint _ethValue); modifier onlyManagerOrCreator() { } function StorageController(address _mntpContractAddress, address _goldContractAddress, address _storageAddress, address _fiatFeeContract) { } function setEthDepositAddress(address _address) public onlyCreator { } function setManagerAddress(address _address) public onlyCreator { } function getEthDepositAddress() public constant returns (address) { } // Only old controller can call setControllerAddress function changeController(address _newController) public onlyCreator { } function setHotWalletAddress(address _hotWalletAddress) public onlyCreator { } function getHotWalletAddress() public constant returns (address) { } function changeFiatFeeContract(address _newFiatFee) public onlyCreator { } function addDoc(string _ipfsDocLink) public onlyCreator returns(uint) { } function getDocCount() public constant returns (uint) { } function getDoc(uint _index) public constant returns (string) { } // _amountCents can be negative // returns index in user array function addFiatTransaction(string _userId, int _amountCents) public onlyManagerOrCreator returns(uint) { } function getFiatTransactionsCount(string _userId) public constant returns (uint) { } function getAllFiatTransactionsCount() public constant returns (uint) { } function getFiatTransaction(string _userId, uint _index) public constant returns(int) { } function getUserFiatBalance(string _userId) public constant returns(uint) { } function addGoldTransaction(string _userId, int _amount) public onlyManagerOrCreator returns(uint) { } function getGoldTransactionsCount(string _userId) public constant returns (uint) { } function getAllGoldTransactionsCount() public constant returns (uint) { } function getGoldTransaction(string _userId, uint _index) public constant returns(int) { require(<FILL_ME>) return stor.getGoldTransaction(_userId, _index); } function getUserHotGoldBalance(string _userId) public constant returns(uint) { } function addBuyTokensRequest(string _userId, string _requestHash) public returns(uint) { } function addSellTokensRequest(string _userId, string _requestHash) public returns(uint) { } function getRequestsCount() public constant returns(uint) { } function getRequest(uint _index) public constant returns(address, string, string, bool, uint8) { } function cancelRequest(uint _index) onlyManagerOrCreator public { } function processRequest(uint _index, uint _amountCents, uint _centsPerGold) onlyManagerOrCreator public { } function processBuyRequest(string _userId, address _userAddress, uint _amountCents, uint _centsPerGold) internal { } function processSellRequest(string _userId, address _userAddress, uint _amountCents, uint _centsPerGold) internal { } //////// INTERNAL REQUESTS FROM HOT WALLET function processInternalRequest(string _userId, bool _isBuy, uint _amountCents, uint _centsPerGold) onlyManagerOrCreator public { } function transferGoldFromHotWallet(address _to, uint _value, string _userId) onlyManagerOrCreator public { } //////// function issueGoldTokens(address _userAddress, uint _tokenAmount) internal { } function burnGoldTokens(address _userAddress, uint _tokenAmount) internal { } function isHotWallet(address _address) internal returns(bool) { } /////// function depositEth(uint _requestId) public payable { } // do not allow to send money to this contract... function() external payable { } }
keccak256(_userId)!=keccak256("")
284,237
keccak256(_userId)!=keccak256("")
"no-access"
// Copyright (C) 2020 Maker Ecosystem Growth Holdings, INC. // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. // // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see <https://www.gnu.org/licenses/>. pragma solidity 0.5.12; interface DSPauseAbstract { function setOwner(address) external; function setAuthority(address) external; function setDelay(uint256) external; function plans(bytes32) external view returns (bool); function proxy() external view returns (address); function delay() external view returns (uint256); function plot(address, bytes32, bytes calldata, uint256) external; function drop(address, bytes32, bytes calldata, uint256) external; function exec(address, bytes32, bytes calldata, uint256) external returns (bytes memory); } interface VatAbstract { function wards(address) external view returns (uint256); function rely(address) external; function deny(address) external; function can(address, address) external view returns (uint256); function hope(address) external; function nope(address) external; function ilks(bytes32) external view returns (uint256, uint256, uint256, uint256, uint256); function urns(bytes32, address) external view returns (uint256, uint256); function gem(bytes32, address) external view returns (uint256); function dai(address) external view returns (uint256); function sin(address) external view returns (uint256); function debt() external view returns (uint256); function vice() external view returns (uint256); function Line() external view returns (uint256); function live() external view returns (uint256); function init(bytes32) external; function file(bytes32, uint256) external; function file(bytes32, bytes32, uint256) external; function cage() external; function slip(bytes32, address, int256) external; function flux(bytes32, address, address, uint256) external; function move(address, address, uint256) external; function frob(bytes32, address, address, address, int256, int256) external; function fork(bytes32, address, address, int256, int256) external; function grab(bytes32, address, address, address, int256, int256) external; function heal(uint256) external; function suck(address, address, uint256) external; function fold(bytes32, address, int256) external; } contract SpellAction { // MAINNET ADDRESSES // // The contracts in this list should correspond to MCD core contracts, verify // against the current release list at: // https://changelog.makerdao.com/releases/mainnet/1.1.3/contracts.json address constant MCD_VAT = 0x35D1b3F3D7966A1DFe207aa4514C12a259A0492B; // Decimals & precision uint256 constant THOUSAND = 10 ** 3; uint256 constant MILLION = 10 ** 6; uint256 constant WAD = 10 ** 18; uint256 constant RAY = 10 ** 27; uint256 constant RAD = 10 ** 45; // Many of the settings that change weekly rely on the rate accumulator // described at https://docs.makerdao.com/smart-contract-modules/rates-module // To check this yourself, use the following rate calculation (example 8%): // // $ bc -l <<< 'scale=27; e( l(1.08)/(60 * 60 * 24 * 365) )' // // A table of rates can be found at // https://ipfs.io/ipfs/QmefQMseb3AiTapiAKKexdKHig8wroKuZbmLtPLv4u2YwW function execute() external { // Proving the Pause Proxy has access to the MCD core system at the execution time require(<FILL_ME>) } } contract DssSpell { DSPauseAbstract public pause = DSPauseAbstract(0xbE286431454714F511008713973d3B053A2d38f3); address public action; bytes32 public tag; uint256 public eta; bytes public sig; uint256 public expiration; bool public done; // Provides a descriptive tag for bot consumption // This should be modified weekly to provide a summary of the actions // Hash: seth keccak -- "$(wget https://raw.githubusercontent.com/makerdao/community/d5e2a373bf043380dffd958a8e09339927e988f0/governance/votes/Executive%20vote%20-%20October%2026%2C%202020.md -q -O - 2>/dev/null)" string constant public description = "2020-10-26 MakerDAO Executive Spell | Hash: 0xf4c67a6aa3a86d8378010ffc320219938f2f96ef16ca718284e16e52ccff30b7"; // MIP14: Protocol Dai Transfer // Hash: seth keccak -- "$(wget https://raw.githubusercontent.com/makerdao/mips/3eb4e3d26ac79d93874dea07d095a0d991a14d20/MIP14/mip14.md -q -O - 2>/dev/null)" string constant public MIP15 = "0x70f6c28c1b5ef1657a8a901636f31f9479ff5d32c251dd4eda84b8c00655fdba"; // MIP20: Target Price Adjustment Module (Vox) // Hash: seth keccak -- "$(wget https://raw.githubusercontent.com/makerdao/mips/f6515e96cf4dae6b7e22fb11f5acac81fa5e1d9f/MIP20/mip20.md -q -O - 2>/dev/null)" string constant public MIP20 = "0x35330368b523195aa63e235f5879e9f3d9a0f0d81437d477261dc00a35cda463"; // MIP21: Real World Assets - Off-Chain Asset Backed Lender // Hash: seth keccak -- "$(wget https://raw.githubusercontent.com/makerdao/mips/945da898f0f2ab8d7ebf3ff1672c66d05894dd2a/MIP21/MIP21.md -q -O - 2>/dev/null)" string constant public MIP21 = "0xb538ef266caf65ccb76e8c49a74b57ca50fc4e0d9a303370ad4b0bb277a8164c"; // MIP22: Centrifuge Direct Liquidation Module // Hash: seth keccak -- "$(wget https://raw.githubusercontent.com/makerdao/mips/00dae04b115863517d90e1e1b898c2ace59ad19b/MIP22/mip22.md -q -O - 2>/dev/null)" string constant public MIP22 = "0xc6945ad6c8c2a5842f8335737eb2f9ea3abdf865a301d14111d6fe802b06f034"; // MIP23: Domain Structure and Roles // Hash: seth keccak -- "$(wget https://raw.githubusercontent.com/makerdao/mips/3eb4e3d26ac79d93874dea07d095a0d991a14d20/MIP23/mip23.md -q -O - 2>/dev/null)" string constant public MIP23 = "0xa94258d039103585da7a3c8de095e9907215ce431141fcfdd9b4f5986e07d59a"; // MIP13c3-SP3: Declaration of Intent - Strategic Reserves Fund // Hash: seth keccak -- "$(wget https://raw.githubusercontent.com/makerdao/mips/7d402e6bdf8ce914063acb0a2bf1b7f3ddf1b844/MIP13/MIP13c3-Subproposals/MIP13c3-SP3.md -q -O - 2>/dev/null)" string constant public MIP13c3SP3 = "0x9ebab3236920efbb2f82f4e37eca51dc8b50895d8b1fa592daaa6441eec682e9"; // MIP13c3-SP4: Declaration of Intent & Commercial Points - Off-Chain Asset Backed Lender to onboard Real World Assets as Collateral for a DAI loan // Hash: seth keccak -- "$(wget https://raw.githubusercontent.com/makerdao/mips/b7d3edcbf11d60c8babecf46eaccdc0abf815867/MIP13/MIP13c3-Subproposals/MIP13c3-SP4.md -q -O - 2>/dev/null)" string constant public MIP13c3SP4 = "0x39ff7fa18f4f9845d214a37823f2f6dfd24bf93540785483b0332d1286307bc6"; // MIP13c3-SP5: Declaration of Intent: Maker to commence onboarding work of Centrifuge based Collateral // Hash: seth keccak -- "$(wget https://raw.githubusercontent.com/makerdao/mips/c07e3641f0a45dac2835ac24ec28a9d17a639a23/MIP13/MIP13c3-Subproposals/MIP13c3-SP5.md -q -O - 2>/dev/null)" string constant public MIP13c3SP5 = "0xda7fc22f756a2b0535c44d187fd0316d986adcacd397ee2060007d20b515956c"; constructor() public { } modifier officeHours { } function schedule() public { } function cast() public /* officeHours */ { } }
VatAbstract(MCD_VAT).wards(address(this))==1,"no-access"
284,247
VatAbstract(MCD_VAT).wards(address(this))==1
null
pragma solidity ^0.5.0; interface IKyberNetworkProxy { function getExpectedRate(IERC20 src, IERC20 dest, uint srcQty) external view returns (uint expectedRate, uint slippageRate); function tradeWithHint(IERC20 src, uint srcAmount, IERC20 dest, address destAddress, uint maxDestAmount, uint minConversionRate, address walletId, bytes calldata hint) external payable returns(uint); function swapEtherToToken(IERC20 token, uint minRate) external payable returns (uint); } interface Compound { function approve (address spender, uint256 amount ) external returns ( bool ); function mint ( uint256 mintAmount ) external returns ( uint256 ); function balanceOf(address _owner) external view returns (uint256 balance); function transfer(address _to, uint _value) external returns (bool success); } contract Invest2cDAI_NEW is Ownable { using SafeMath for uint; // state variables // - setting up Imp Contract Addresses IKyberNetworkProxy public kyberNetworkProxyContract = IKyberNetworkProxy(0x818E6FECD516Ecc3849DAf6845e3EC868087B755); IERC20 constant public ETH_TOKEN_ADDRESS = IERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); IERC20 public NEWDAI_TOKEN_ADDRESS = IERC20(0x6B175474E89094C44Da98b954EedeAC495271d0F); Compound public COMPOUND_TOKEN_ADDRESS = Compound(0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643); // - variable for tracking the ETH balance of this contract uint public balance; // events event UnitsReceivedANDSentToAddress(uint, address); // this function should be called should we ever want to change the kyberNetworkProxyContract address function set_kyberNetworkProxyContract(IKyberNetworkProxy _kyberNetworkProxyContract) onlyOwner public { } // this function should be called should we ever want to change the NEWDAI_TOKEN_ADDRESS function set_NEWDAI_TOKEN_ADDRESS(IERC20 _NEWDAI_TOKEN_ADDRESS) onlyOwner public { } // this function should be called should we ever want to change the COMPOUND_TOKEN_ADDRESS function set_COMPOUND_TOKEN_ADDRESS(Compound _COMPOUND_TOKEN_ADDRESS) onlyOwner public { } // function LetsInvest(address _towhomtoissue) public payable { uint minConversionRate; (minConversionRate,) = kyberNetworkProxyContract.getExpectedRate(ETH_TOKEN_ADDRESS, NEWDAI_TOKEN_ADDRESS, msg.value); uint destAmount = kyberNetworkProxyContract.swapEtherToToken.value(msg.value)(NEWDAI_TOKEN_ADDRESS, minConversionRate); uint qty2approve = SafeMath.mul(destAmount, 3); require(<FILL_ME>) COMPOUND_TOKEN_ADDRESS.mint(destAmount); uint cDAI2transfer = COMPOUND_TOKEN_ADDRESS.balanceOf(address(this)); require(COMPOUND_TOKEN_ADDRESS.transfer(_towhomtoissue, cDAI2transfer)); require(NEWDAI_TOKEN_ADDRESS.approve(address(COMPOUND_TOKEN_ADDRESS), 0)); emit UnitsReceivedANDSentToAddress(cDAI2transfer, _towhomtoissue); } // fx, in case something goes wrong {hint! learnt from experience} function inCaseDAI_NEWgetsStuck() onlyOwner public { } function inCaseC_DAIgetsStuck() onlyOwner public { } // fx in relation to ETH held by the contract sent by the owner // - this function lets you deposit ETH into this wallet function depositETH() payable public onlyOwner returns (uint) { } // - fallback function let you / anyone send ETH to this wallet without the need to call any function function() external payable { } // - to withdraw any ETH balance sitting in the contract function withdraw() onlyOwner public{ } }
NEWDAI_TOKEN_ADDRESS.approve(address(COMPOUND_TOKEN_ADDRESS),qty2approve)
284,250
NEWDAI_TOKEN_ADDRESS.approve(address(COMPOUND_TOKEN_ADDRESS),qty2approve)
null
pragma solidity ^0.5.0; interface IKyberNetworkProxy { function getExpectedRate(IERC20 src, IERC20 dest, uint srcQty) external view returns (uint expectedRate, uint slippageRate); function tradeWithHint(IERC20 src, uint srcAmount, IERC20 dest, address destAddress, uint maxDestAmount, uint minConversionRate, address walletId, bytes calldata hint) external payable returns(uint); function swapEtherToToken(IERC20 token, uint minRate) external payable returns (uint); } interface Compound { function approve (address spender, uint256 amount ) external returns ( bool ); function mint ( uint256 mintAmount ) external returns ( uint256 ); function balanceOf(address _owner) external view returns (uint256 balance); function transfer(address _to, uint _value) external returns (bool success); } contract Invest2cDAI_NEW is Ownable { using SafeMath for uint; // state variables // - setting up Imp Contract Addresses IKyberNetworkProxy public kyberNetworkProxyContract = IKyberNetworkProxy(0x818E6FECD516Ecc3849DAf6845e3EC868087B755); IERC20 constant public ETH_TOKEN_ADDRESS = IERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); IERC20 public NEWDAI_TOKEN_ADDRESS = IERC20(0x6B175474E89094C44Da98b954EedeAC495271d0F); Compound public COMPOUND_TOKEN_ADDRESS = Compound(0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643); // - variable for tracking the ETH balance of this contract uint public balance; // events event UnitsReceivedANDSentToAddress(uint, address); // this function should be called should we ever want to change the kyberNetworkProxyContract address function set_kyberNetworkProxyContract(IKyberNetworkProxy _kyberNetworkProxyContract) onlyOwner public { } // this function should be called should we ever want to change the NEWDAI_TOKEN_ADDRESS function set_NEWDAI_TOKEN_ADDRESS(IERC20 _NEWDAI_TOKEN_ADDRESS) onlyOwner public { } // this function should be called should we ever want to change the COMPOUND_TOKEN_ADDRESS function set_COMPOUND_TOKEN_ADDRESS(Compound _COMPOUND_TOKEN_ADDRESS) onlyOwner public { } // function LetsInvest(address _towhomtoissue) public payable { uint minConversionRate; (minConversionRate,) = kyberNetworkProxyContract.getExpectedRate(ETH_TOKEN_ADDRESS, NEWDAI_TOKEN_ADDRESS, msg.value); uint destAmount = kyberNetworkProxyContract.swapEtherToToken.value(msg.value)(NEWDAI_TOKEN_ADDRESS, minConversionRate); uint qty2approve = SafeMath.mul(destAmount, 3); require(NEWDAI_TOKEN_ADDRESS.approve(address(COMPOUND_TOKEN_ADDRESS), qty2approve)); COMPOUND_TOKEN_ADDRESS.mint(destAmount); uint cDAI2transfer = COMPOUND_TOKEN_ADDRESS.balanceOf(address(this)); require(<FILL_ME>) require(NEWDAI_TOKEN_ADDRESS.approve(address(COMPOUND_TOKEN_ADDRESS), 0)); emit UnitsReceivedANDSentToAddress(cDAI2transfer, _towhomtoissue); } // fx, in case something goes wrong {hint! learnt from experience} function inCaseDAI_NEWgetsStuck() onlyOwner public { } function inCaseC_DAIgetsStuck() onlyOwner public { } // fx in relation to ETH held by the contract sent by the owner // - this function lets you deposit ETH into this wallet function depositETH() payable public onlyOwner returns (uint) { } // - fallback function let you / anyone send ETH to this wallet without the need to call any function function() external payable { } // - to withdraw any ETH balance sitting in the contract function withdraw() onlyOwner public{ } }
COMPOUND_TOKEN_ADDRESS.transfer(_towhomtoissue,cDAI2transfer)
284,250
COMPOUND_TOKEN_ADDRESS.transfer(_towhomtoissue,cDAI2transfer)
null
pragma solidity ^0.5.0; interface IKyberNetworkProxy { function getExpectedRate(IERC20 src, IERC20 dest, uint srcQty) external view returns (uint expectedRate, uint slippageRate); function tradeWithHint(IERC20 src, uint srcAmount, IERC20 dest, address destAddress, uint maxDestAmount, uint minConversionRate, address walletId, bytes calldata hint) external payable returns(uint); function swapEtherToToken(IERC20 token, uint minRate) external payable returns (uint); } interface Compound { function approve (address spender, uint256 amount ) external returns ( bool ); function mint ( uint256 mintAmount ) external returns ( uint256 ); function balanceOf(address _owner) external view returns (uint256 balance); function transfer(address _to, uint _value) external returns (bool success); } contract Invest2cDAI_NEW is Ownable { using SafeMath for uint; // state variables // - setting up Imp Contract Addresses IKyberNetworkProxy public kyberNetworkProxyContract = IKyberNetworkProxy(0x818E6FECD516Ecc3849DAf6845e3EC868087B755); IERC20 constant public ETH_TOKEN_ADDRESS = IERC20(0x00eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee); IERC20 public NEWDAI_TOKEN_ADDRESS = IERC20(0x6B175474E89094C44Da98b954EedeAC495271d0F); Compound public COMPOUND_TOKEN_ADDRESS = Compound(0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643); // - variable for tracking the ETH balance of this contract uint public balance; // events event UnitsReceivedANDSentToAddress(uint, address); // this function should be called should we ever want to change the kyberNetworkProxyContract address function set_kyberNetworkProxyContract(IKyberNetworkProxy _kyberNetworkProxyContract) onlyOwner public { } // this function should be called should we ever want to change the NEWDAI_TOKEN_ADDRESS function set_NEWDAI_TOKEN_ADDRESS(IERC20 _NEWDAI_TOKEN_ADDRESS) onlyOwner public { } // this function should be called should we ever want to change the COMPOUND_TOKEN_ADDRESS function set_COMPOUND_TOKEN_ADDRESS(Compound _COMPOUND_TOKEN_ADDRESS) onlyOwner public { } // function LetsInvest(address _towhomtoissue) public payable { uint minConversionRate; (minConversionRate,) = kyberNetworkProxyContract.getExpectedRate(ETH_TOKEN_ADDRESS, NEWDAI_TOKEN_ADDRESS, msg.value); uint destAmount = kyberNetworkProxyContract.swapEtherToToken.value(msg.value)(NEWDAI_TOKEN_ADDRESS, minConversionRate); uint qty2approve = SafeMath.mul(destAmount, 3); require(NEWDAI_TOKEN_ADDRESS.approve(address(COMPOUND_TOKEN_ADDRESS), qty2approve)); COMPOUND_TOKEN_ADDRESS.mint(destAmount); uint cDAI2transfer = COMPOUND_TOKEN_ADDRESS.balanceOf(address(this)); require(COMPOUND_TOKEN_ADDRESS.transfer(_towhomtoissue, cDAI2transfer)); require(<FILL_ME>) emit UnitsReceivedANDSentToAddress(cDAI2transfer, _towhomtoissue); } // fx, in case something goes wrong {hint! learnt from experience} function inCaseDAI_NEWgetsStuck() onlyOwner public { } function inCaseC_DAIgetsStuck() onlyOwner public { } // fx in relation to ETH held by the contract sent by the owner // - this function lets you deposit ETH into this wallet function depositETH() payable public onlyOwner returns (uint) { } // - fallback function let you / anyone send ETH to this wallet without the need to call any function function() external payable { } // - to withdraw any ETH balance sitting in the contract function withdraw() onlyOwner public{ } }
NEWDAI_TOKEN_ADDRESS.approve(address(COMPOUND_TOKEN_ADDRESS),0)
284,250
NEWDAI_TOKEN_ADDRESS.approve(address(COMPOUND_TOKEN_ADDRESS),0)
"Account is frozen"
pragma solidity 0.5.11; interface IERC20 { function totalSupply() external view returns (uint256); function balanceOf(address account) external view returns (uint256); function transfer(address recipient, uint256 amount) external returns (bool); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); 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 mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } } contract ERC20 is IERC20 { using SafeMath for uint256; mapping (address => uint256) private _balances; mapping (address => mapping (address => uint256)) private _allowances; uint256 private _totalSupply; function totalSupply() public view returns (uint256) { } function balanceOf(address account) public view returns (uint256) { } function transfer(address recipient, uint256 amount) public returns (bool) { } function allowance(address owner, address spender) public view returns (uint256) { } function approve(address spender, uint256 value) public returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public returns (bool) { } function _transfer(address sender, address recipient, uint256 amount) internal { } function _mint(address account, uint256 amount) internal { } function _burn(address account, uint256 value) internal { } function _approve(address owner, address spender, uint256 value) internal { } function _burnFrom(address account, uint256 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) { } } contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () internal { } function owner() public view returns (address) { } modifier onlyOwner() { } function isOwner() public view returns (bool) { } function renounceOwnership() public onlyOwner { } function transferOwnership(address newOwner) public onlyOwner { } function _transferOwnership(address newOwner) internal { } } library Roles { struct Role { mapping (address => bool) bearer; } function add(Role storage role, address account) internal { } function remove(Role storage role, address account) internal { } function has(Role storage role, address account) internal view returns (bool) { } } contract BlockBerry is ERC20, ERC20Detailed, Ownable { using SafeMath for uint256; using Roles for Roles.Role; uint256 private _cap; constructor(string memory description, string memory symbol, uint256 cap) ERC20Detailed(description, symbol, 18) public { } function cap() public view returns (uint256) { } function mint(uint256 value) public onlyOwner returns (bool) { } function burn(uint256 value) public onlyOwner returns (bool) { } function transfer(address to, uint256 value) public notFrozen(msg.sender) notFrozen(to) returns (bool) { } function transferFrom(address from, address to, uint256 value) public notFrozen(msg.sender) notFrozen(from) notFrozen(to) returns (bool) { } event Freeze(address indexed frozenAccount); event Unfreeze(address indexed unfrozenAccount); Roles.Role private _frozenAccounts; modifier notFrozen(address account) { require(<FILL_ME>) _; } function isFrozen(address account) public view returns (bool) { } function freeze(address account) public onlyOwner returns (bool) { } function unfreeze(address account) public onlyOwner returns (bool) { } } contract CPUTT is BlockBerry { constructor(string memory description, string memory symbol, uint256 cap) BlockBerry(description, symbol, cap) public { } }
!isFrozen(account),"Account is frozen"
284,353
!isFrozen(account)
null
contract SafeMath { uint256 constant MAX_UINT256 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; function safeAdd(uint256 x, uint256 y) constant internal returns (uint256 z) { } function safeSub(uint256 x, uint256 y) constant internal returns (uint256 z) { } function safeMul(uint256 x, uint256 y) constant internal returns (uint256 z) { if (y == 0) { return 0; } require(<FILL_ME>) return x * y; } } contract ReentrancyHandlingContract{ bool locked; modifier noReentrancy() { } } contract Owned { address public owner; address public newOwner; function Owned() { } modifier onlyOwner { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public { } event OwnerUpdate(address _prevOwner, address _newOwner); } contract Lockable is Owned { uint256 public lockedUntilBlock; event ContractLocked(uint256 _untilBlock, string _reason); modifier lockAffected { } function lockFromSelf(uint256 _untilBlock, string _reason) internal { } function lockUntil(uint256 _untilBlock, string _reason) onlyOwner public { } } contract ERC20TokenInterface { function totalSupply() public constant returns (uint256 _totalSupply); function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); 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 InsurePalTokenInterface { function mint(address _to, uint256 _amount) public; } contract tokenRecipientInterface { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); } contract KycContractInterface { function isAddressVerified(address _address) public view returns (bool); } contract KycContract is Owned { mapping (address => bool) verifiedAddresses; function isAddressVerified(address _address) public view returns (bool) { } function addAddress(address _newAddress) public onlyOwner { } function removeAddress(address _oldAddress) public onlyOwner { } function batchAddAddresses(address[] _addresses) public onlyOwner { } function salvageTokensFromContract(address _tokenAddress, address _to, uint _amount) public onlyOwner{ } function killContract() public onlyOwner { } } contract Crowdsale is ReentrancyHandlingContract, Owned { struct ContributorData { uint contributionAmount; uint tokensIssued; } mapping(address => ContributorData) public contributorList; uint nextContributorIndex; mapping(uint => address) contributorIndexes; state public crowdsaleState = state.pendingStart; enum state { pendingStart, crowdsale, crowdsaleEnded } uint public crowdsaleStartBlock; uint public crowdsaleEndedBlock; event CrowdsaleStarted(uint blockNumber); event CrowdsaleEnded(uint blockNumber); event ErrorSendingETH(address to, uint amount); event MinCapReached(uint blockNumber); event MaxCapReached(uint blockNumber); address tokenAddress = 0x0; address kycAddress = 0x0; uint decimals = 18; uint public minCap; //InTokens uint public maxCap; //InTokens uint public ethRaised; uint public tokenTotalSupply = 300000000 * 10**decimals; uint public tokensIssued = 0; address public multisigAddress; uint blocksInADay; uint nextContributorToClaim; mapping(address => bool) hasClaimedEthWhenFail; uint crowdsaleTokenCap = 201000000 * 10**decimals; uint founders = 30000000 * 10**decimals; uint insurePalTeam = 18000000 * 10**decimals; uint tcsSupportTeam = 18000000 * 10**decimals; uint advisorsAndAmbassadors = 18000000 * 10**decimals; uint incentives = 9000000 * 10**decimals; uint earlyInvestors = 6000000 * 10**decimals; bool foundersTokensClaimed = false; bool insurePalTeamTokensClaimed = false; bool tcsSupportTeamTokensClaimed = false; bool advisorsAndAmbassadorsTokensClaimed = false; bool incentivesTokensClaimed = false; bool earlyInvestorsTokensClaimed = false; // // Unnamed function that runs when eth is sent to the contract // function() noReentrancy payable public { } // // Check crowdsale state and calibrate it // function checkCrowdsaleState() internal returns (bool) { } // // Decide if throw or only return ether // function refundTransaction(bool _stateChanged) internal { } function calculateEthToToken(uint _eth, uint _blockNumber) constant public returns(uint) { } function calculateTokenToEth(uint _token, uint _blockNumber) constant public returns(uint) { } // // Issue tokens and return if there is overflow // function processTransaction(address _contributor, uint _amount) internal { } function pushAngelInvestmentData(address _address, uint _ethContributed) onlyOwner public { } function depositAngelInvestmentEth() payable onlyOwner public {} // // Method is needed for recovering tokens accedentaly sent to token address // function salvageTokensFromContract(address _tokenAddress, address _to, uint _amount) onlyOwner public { } // // withdrawEth when minimum cap is reached // function withdrawEth() onlyOwner public { } // // Users can claim their contribution if min cap is not raised // function claimEthIfFailed() public { } // // Owner can batch return contributors contributions(eth) // function batchReturnEthIfFailed(uint _numberOfReturns) onlyOwner public { } // // If there were any issue/attach with refund owner can withraw eth at the end for manual recovery // function withdrawRemainingBalanceForManualRecovery() onlyOwner public { } function claimTeamTokens(address _to, uint _choice) onlyOwner public { } // // Owner can set multisig address for crowdsale // function setMultisigAddress(address _newAddress) onlyOwner public { } // // Owner can set token address where mints will happen // function setToken(address _newAddress) onlyOwner public { } function setKycAddress(address _newAddress) onlyOwner public { } function getTokenAddress() constant public returns(address) { } function investorCount() constant public returns(uint) { } function setCrowdsaleStartBlock(uint _block) onlyOwner public { } } contract InsurePalCrowdsale is Crowdsale { function InsurePalCrowdsale() { } }
x<=(MAX_UINT256/y)
284,396
x<=(MAX_UINT256/y)
null
contract SafeMath { uint256 constant MAX_UINT256 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; function safeAdd(uint256 x, uint256 y) constant internal returns (uint256 z) { } function safeSub(uint256 x, uint256 y) constant internal returns (uint256 z) { } function safeMul(uint256 x, uint256 y) constant internal returns (uint256 z) { } } contract ReentrancyHandlingContract{ bool locked; modifier noReentrancy() { } } contract Owned { address public owner; address public newOwner; function Owned() { } modifier onlyOwner { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public { } event OwnerUpdate(address _prevOwner, address _newOwner); } contract Lockable is Owned { uint256 public lockedUntilBlock; event ContractLocked(uint256 _untilBlock, string _reason); modifier lockAffected { } function lockFromSelf(uint256 _untilBlock, string _reason) internal { } function lockUntil(uint256 _untilBlock, string _reason) onlyOwner public { } } contract ERC20TokenInterface { function totalSupply() public constant returns (uint256 _totalSupply); function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); 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 InsurePalTokenInterface { function mint(address _to, uint256 _amount) public; } contract tokenRecipientInterface { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); } contract KycContractInterface { function isAddressVerified(address _address) public view returns (bool); } contract KycContract is Owned { mapping (address => bool) verifiedAddresses; function isAddressVerified(address _address) public view returns (bool) { } function addAddress(address _newAddress) public onlyOwner { require(<FILL_ME>) verifiedAddresses[_newAddress] = true; } function removeAddress(address _oldAddress) public onlyOwner { } function batchAddAddresses(address[] _addresses) public onlyOwner { } function salvageTokensFromContract(address _tokenAddress, address _to, uint _amount) public onlyOwner{ } function killContract() public onlyOwner { } } contract Crowdsale is ReentrancyHandlingContract, Owned { struct ContributorData { uint contributionAmount; uint tokensIssued; } mapping(address => ContributorData) public contributorList; uint nextContributorIndex; mapping(uint => address) contributorIndexes; state public crowdsaleState = state.pendingStart; enum state { pendingStart, crowdsale, crowdsaleEnded } uint public crowdsaleStartBlock; uint public crowdsaleEndedBlock; event CrowdsaleStarted(uint blockNumber); event CrowdsaleEnded(uint blockNumber); event ErrorSendingETH(address to, uint amount); event MinCapReached(uint blockNumber); event MaxCapReached(uint blockNumber); address tokenAddress = 0x0; address kycAddress = 0x0; uint decimals = 18; uint public minCap; //InTokens uint public maxCap; //InTokens uint public ethRaised; uint public tokenTotalSupply = 300000000 * 10**decimals; uint public tokensIssued = 0; address public multisigAddress; uint blocksInADay; uint nextContributorToClaim; mapping(address => bool) hasClaimedEthWhenFail; uint crowdsaleTokenCap = 201000000 * 10**decimals; uint founders = 30000000 * 10**decimals; uint insurePalTeam = 18000000 * 10**decimals; uint tcsSupportTeam = 18000000 * 10**decimals; uint advisorsAndAmbassadors = 18000000 * 10**decimals; uint incentives = 9000000 * 10**decimals; uint earlyInvestors = 6000000 * 10**decimals; bool foundersTokensClaimed = false; bool insurePalTeamTokensClaimed = false; bool tcsSupportTeamTokensClaimed = false; bool advisorsAndAmbassadorsTokensClaimed = false; bool incentivesTokensClaimed = false; bool earlyInvestorsTokensClaimed = false; // // Unnamed function that runs when eth is sent to the contract // function() noReentrancy payable public { } // // Check crowdsale state and calibrate it // function checkCrowdsaleState() internal returns (bool) { } // // Decide if throw or only return ether // function refundTransaction(bool _stateChanged) internal { } function calculateEthToToken(uint _eth, uint _blockNumber) constant public returns(uint) { } function calculateTokenToEth(uint _token, uint _blockNumber) constant public returns(uint) { } // // Issue tokens and return if there is overflow // function processTransaction(address _contributor, uint _amount) internal { } function pushAngelInvestmentData(address _address, uint _ethContributed) onlyOwner public { } function depositAngelInvestmentEth() payable onlyOwner public {} // // Method is needed for recovering tokens accedentaly sent to token address // function salvageTokensFromContract(address _tokenAddress, address _to, uint _amount) onlyOwner public { } // // withdrawEth when minimum cap is reached // function withdrawEth() onlyOwner public { } // // Users can claim their contribution if min cap is not raised // function claimEthIfFailed() public { } // // Owner can batch return contributors contributions(eth) // function batchReturnEthIfFailed(uint _numberOfReturns) onlyOwner public { } // // If there were any issue/attach with refund owner can withraw eth at the end for manual recovery // function withdrawRemainingBalanceForManualRecovery() onlyOwner public { } function claimTeamTokens(address _to, uint _choice) onlyOwner public { } // // Owner can set multisig address for crowdsale // function setMultisigAddress(address _newAddress) onlyOwner public { } // // Owner can set token address where mints will happen // function setToken(address _newAddress) onlyOwner public { } function setKycAddress(address _newAddress) onlyOwner public { } function getTokenAddress() constant public returns(address) { } function investorCount() constant public returns(uint) { } function setCrowdsaleStartBlock(uint _block) onlyOwner public { } } contract InsurePalCrowdsale is Crowdsale { function InsurePalCrowdsale() { } }
!verifiedAddresses[_newAddress]
284,396
!verifiedAddresses[_newAddress]
null
contract SafeMath { uint256 constant MAX_UINT256 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; function safeAdd(uint256 x, uint256 y) constant internal returns (uint256 z) { } function safeSub(uint256 x, uint256 y) constant internal returns (uint256 z) { } function safeMul(uint256 x, uint256 y) constant internal returns (uint256 z) { } } contract ReentrancyHandlingContract{ bool locked; modifier noReentrancy() { } } contract Owned { address public owner; address public newOwner; function Owned() { } modifier onlyOwner { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public { } event OwnerUpdate(address _prevOwner, address _newOwner); } contract Lockable is Owned { uint256 public lockedUntilBlock; event ContractLocked(uint256 _untilBlock, string _reason); modifier lockAffected { } function lockFromSelf(uint256 _untilBlock, string _reason) internal { } function lockUntil(uint256 _untilBlock, string _reason) onlyOwner public { } } contract ERC20TokenInterface { function totalSupply() public constant returns (uint256 _totalSupply); function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); 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 InsurePalTokenInterface { function mint(address _to, uint256 _amount) public; } contract tokenRecipientInterface { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); } contract KycContractInterface { function isAddressVerified(address _address) public view returns (bool); } contract KycContract is Owned { mapping (address => bool) verifiedAddresses; function isAddressVerified(address _address) public view returns (bool) { } function addAddress(address _newAddress) public onlyOwner { } function removeAddress(address _oldAddress) public onlyOwner { require(<FILL_ME>) verifiedAddresses[_oldAddress] = false; } function batchAddAddresses(address[] _addresses) public onlyOwner { } function salvageTokensFromContract(address _tokenAddress, address _to, uint _amount) public onlyOwner{ } function killContract() public onlyOwner { } } contract Crowdsale is ReentrancyHandlingContract, Owned { struct ContributorData { uint contributionAmount; uint tokensIssued; } mapping(address => ContributorData) public contributorList; uint nextContributorIndex; mapping(uint => address) contributorIndexes; state public crowdsaleState = state.pendingStart; enum state { pendingStart, crowdsale, crowdsaleEnded } uint public crowdsaleStartBlock; uint public crowdsaleEndedBlock; event CrowdsaleStarted(uint blockNumber); event CrowdsaleEnded(uint blockNumber); event ErrorSendingETH(address to, uint amount); event MinCapReached(uint blockNumber); event MaxCapReached(uint blockNumber); address tokenAddress = 0x0; address kycAddress = 0x0; uint decimals = 18; uint public minCap; //InTokens uint public maxCap; //InTokens uint public ethRaised; uint public tokenTotalSupply = 300000000 * 10**decimals; uint public tokensIssued = 0; address public multisigAddress; uint blocksInADay; uint nextContributorToClaim; mapping(address => bool) hasClaimedEthWhenFail; uint crowdsaleTokenCap = 201000000 * 10**decimals; uint founders = 30000000 * 10**decimals; uint insurePalTeam = 18000000 * 10**decimals; uint tcsSupportTeam = 18000000 * 10**decimals; uint advisorsAndAmbassadors = 18000000 * 10**decimals; uint incentives = 9000000 * 10**decimals; uint earlyInvestors = 6000000 * 10**decimals; bool foundersTokensClaimed = false; bool insurePalTeamTokensClaimed = false; bool tcsSupportTeamTokensClaimed = false; bool advisorsAndAmbassadorsTokensClaimed = false; bool incentivesTokensClaimed = false; bool earlyInvestorsTokensClaimed = false; // // Unnamed function that runs when eth is sent to the contract // function() noReentrancy payable public { } // // Check crowdsale state and calibrate it // function checkCrowdsaleState() internal returns (bool) { } // // Decide if throw or only return ether // function refundTransaction(bool _stateChanged) internal { } function calculateEthToToken(uint _eth, uint _blockNumber) constant public returns(uint) { } function calculateTokenToEth(uint _token, uint _blockNumber) constant public returns(uint) { } // // Issue tokens and return if there is overflow // function processTransaction(address _contributor, uint _amount) internal { } function pushAngelInvestmentData(address _address, uint _ethContributed) onlyOwner public { } function depositAngelInvestmentEth() payable onlyOwner public {} // // Method is needed for recovering tokens accedentaly sent to token address // function salvageTokensFromContract(address _tokenAddress, address _to, uint _amount) onlyOwner public { } // // withdrawEth when minimum cap is reached // function withdrawEth() onlyOwner public { } // // Users can claim their contribution if min cap is not raised // function claimEthIfFailed() public { } // // Owner can batch return contributors contributions(eth) // function batchReturnEthIfFailed(uint _numberOfReturns) onlyOwner public { } // // If there were any issue/attach with refund owner can withraw eth at the end for manual recovery // function withdrawRemainingBalanceForManualRecovery() onlyOwner public { } function claimTeamTokens(address _to, uint _choice) onlyOwner public { } // // Owner can set multisig address for crowdsale // function setMultisigAddress(address _newAddress) onlyOwner public { } // // Owner can set token address where mints will happen // function setToken(address _newAddress) onlyOwner public { } function setKycAddress(address _newAddress) onlyOwner public { } function getTokenAddress() constant public returns(address) { } function investorCount() constant public returns(uint) { } function setCrowdsaleStartBlock(uint _block) onlyOwner public { } } contract InsurePalCrowdsale is Crowdsale { function InsurePalCrowdsale() { } }
verifiedAddresses[_oldAddress]
284,396
verifiedAddresses[_oldAddress]
null
contract SafeMath { uint256 constant MAX_UINT256 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; function safeAdd(uint256 x, uint256 y) constant internal returns (uint256 z) { } function safeSub(uint256 x, uint256 y) constant internal returns (uint256 z) { } function safeMul(uint256 x, uint256 y) constant internal returns (uint256 z) { } } contract ReentrancyHandlingContract{ bool locked; modifier noReentrancy() { } } contract Owned { address public owner; address public newOwner; function Owned() { } modifier onlyOwner { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public { } event OwnerUpdate(address _prevOwner, address _newOwner); } contract Lockable is Owned { uint256 public lockedUntilBlock; event ContractLocked(uint256 _untilBlock, string _reason); modifier lockAffected { } function lockFromSelf(uint256 _untilBlock, string _reason) internal { } function lockUntil(uint256 _untilBlock, string _reason) onlyOwner public { } } contract ERC20TokenInterface { function totalSupply() public constant returns (uint256 _totalSupply); function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); 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 InsurePalTokenInterface { function mint(address _to, uint256 _amount) public; } contract tokenRecipientInterface { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); } contract KycContractInterface { function isAddressVerified(address _address) public view returns (bool); } contract KycContract is Owned { mapping (address => bool) verifiedAddresses; function isAddressVerified(address _address) public view returns (bool) { } function addAddress(address _newAddress) public onlyOwner { } function removeAddress(address _oldAddress) public onlyOwner { } function batchAddAddresses(address[] _addresses) public onlyOwner { } function salvageTokensFromContract(address _tokenAddress, address _to, uint _amount) public onlyOwner{ } function killContract() public onlyOwner { } } contract Crowdsale is ReentrancyHandlingContract, Owned { struct ContributorData { uint contributionAmount; uint tokensIssued; } mapping(address => ContributorData) public contributorList; uint nextContributorIndex; mapping(uint => address) contributorIndexes; state public crowdsaleState = state.pendingStart; enum state { pendingStart, crowdsale, crowdsaleEnded } uint public crowdsaleStartBlock; uint public crowdsaleEndedBlock; event CrowdsaleStarted(uint blockNumber); event CrowdsaleEnded(uint blockNumber); event ErrorSendingETH(address to, uint amount); event MinCapReached(uint blockNumber); event MaxCapReached(uint blockNumber); address tokenAddress = 0x0; address kycAddress = 0x0; uint decimals = 18; uint public minCap; //InTokens uint public maxCap; //InTokens uint public ethRaised; uint public tokenTotalSupply = 300000000 * 10**decimals; uint public tokensIssued = 0; address public multisigAddress; uint blocksInADay; uint nextContributorToClaim; mapping(address => bool) hasClaimedEthWhenFail; uint crowdsaleTokenCap = 201000000 * 10**decimals; uint founders = 30000000 * 10**decimals; uint insurePalTeam = 18000000 * 10**decimals; uint tcsSupportTeam = 18000000 * 10**decimals; uint advisorsAndAmbassadors = 18000000 * 10**decimals; uint incentives = 9000000 * 10**decimals; uint earlyInvestors = 6000000 * 10**decimals; bool foundersTokensClaimed = false; bool insurePalTeamTokensClaimed = false; bool tcsSupportTeamTokensClaimed = false; bool advisorsAndAmbassadorsTokensClaimed = false; bool incentivesTokensClaimed = false; bool earlyInvestorsTokensClaimed = false; // // Unnamed function that runs when eth is sent to the contract // function() noReentrancy payable public { require(msg.value != 0); // Throw if value is 0 require(crowdsaleState != state.crowdsaleEnded);// Check if crowdsale has ended require(<FILL_ME>) bool stateChanged = checkCrowdsaleState(); // Check blocks and calibrate crowdsale state if (crowdsaleState == state.crowdsale) { processTransaction(msg.sender, msg.value); // Process transaction and issue tokens } else { refundTransaction(stateChanged); // Set state and return funds or throw } } // // Check crowdsale state and calibrate it // function checkCrowdsaleState() internal returns (bool) { } // // Decide if throw or only return ether // function refundTransaction(bool _stateChanged) internal { } function calculateEthToToken(uint _eth, uint _blockNumber) constant public returns(uint) { } function calculateTokenToEth(uint _token, uint _blockNumber) constant public returns(uint) { } // // Issue tokens and return if there is overflow // function processTransaction(address _contributor, uint _amount) internal { } function pushAngelInvestmentData(address _address, uint _ethContributed) onlyOwner public { } function depositAngelInvestmentEth() payable onlyOwner public {} // // Method is needed for recovering tokens accedentaly sent to token address // function salvageTokensFromContract(address _tokenAddress, address _to, uint _amount) onlyOwner public { } // // withdrawEth when minimum cap is reached // function withdrawEth() onlyOwner public { } // // Users can claim their contribution if min cap is not raised // function claimEthIfFailed() public { } // // Owner can batch return contributors contributions(eth) // function batchReturnEthIfFailed(uint _numberOfReturns) onlyOwner public { } // // If there were any issue/attach with refund owner can withraw eth at the end for manual recovery // function withdrawRemainingBalanceForManualRecovery() onlyOwner public { } function claimTeamTokens(address _to, uint _choice) onlyOwner public { } // // Owner can set multisig address for crowdsale // function setMultisigAddress(address _newAddress) onlyOwner public { } // // Owner can set token address where mints will happen // function setToken(address _newAddress) onlyOwner public { } function setKycAddress(address _newAddress) onlyOwner public { } function getTokenAddress() constant public returns(address) { } function investorCount() constant public returns(uint) { } function setCrowdsaleStartBlock(uint _block) onlyOwner public { } } contract InsurePalCrowdsale is Crowdsale { function InsurePalCrowdsale() { } }
KycContractInterface(kycAddress).isAddressVerified(msg.sender)
284,396
KycContractInterface(kycAddress).isAddressVerified(msg.sender)
null
contract SafeMath { uint256 constant MAX_UINT256 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; function safeAdd(uint256 x, uint256 y) constant internal returns (uint256 z) { } function safeSub(uint256 x, uint256 y) constant internal returns (uint256 z) { } function safeMul(uint256 x, uint256 y) constant internal returns (uint256 z) { } } contract ReentrancyHandlingContract{ bool locked; modifier noReentrancy() { } } contract Owned { address public owner; address public newOwner; function Owned() { } modifier onlyOwner { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public { } event OwnerUpdate(address _prevOwner, address _newOwner); } contract Lockable is Owned { uint256 public lockedUntilBlock; event ContractLocked(uint256 _untilBlock, string _reason); modifier lockAffected { } function lockFromSelf(uint256 _untilBlock, string _reason) internal { } function lockUntil(uint256 _untilBlock, string _reason) onlyOwner public { } } contract ERC20TokenInterface { function totalSupply() public constant returns (uint256 _totalSupply); function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); 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 InsurePalTokenInterface { function mint(address _to, uint256 _amount) public; } contract tokenRecipientInterface { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); } contract KycContractInterface { function isAddressVerified(address _address) public view returns (bool); } contract KycContract is Owned { mapping (address => bool) verifiedAddresses; function isAddressVerified(address _address) public view returns (bool) { } function addAddress(address _newAddress) public onlyOwner { } function removeAddress(address _oldAddress) public onlyOwner { } function batchAddAddresses(address[] _addresses) public onlyOwner { } function salvageTokensFromContract(address _tokenAddress, address _to, uint _amount) public onlyOwner{ } function killContract() public onlyOwner { } } contract Crowdsale is ReentrancyHandlingContract, Owned { struct ContributorData { uint contributionAmount; uint tokensIssued; } mapping(address => ContributorData) public contributorList; uint nextContributorIndex; mapping(uint => address) contributorIndexes; state public crowdsaleState = state.pendingStart; enum state { pendingStart, crowdsale, crowdsaleEnded } uint public crowdsaleStartBlock; uint public crowdsaleEndedBlock; event CrowdsaleStarted(uint blockNumber); event CrowdsaleEnded(uint blockNumber); event ErrorSendingETH(address to, uint amount); event MinCapReached(uint blockNumber); event MaxCapReached(uint blockNumber); address tokenAddress = 0x0; address kycAddress = 0x0; uint decimals = 18; uint public minCap; //InTokens uint public maxCap; //InTokens uint public ethRaised; uint public tokenTotalSupply = 300000000 * 10**decimals; uint public tokensIssued = 0; address public multisigAddress; uint blocksInADay; uint nextContributorToClaim; mapping(address => bool) hasClaimedEthWhenFail; uint crowdsaleTokenCap = 201000000 * 10**decimals; uint founders = 30000000 * 10**decimals; uint insurePalTeam = 18000000 * 10**decimals; uint tcsSupportTeam = 18000000 * 10**decimals; uint advisorsAndAmbassadors = 18000000 * 10**decimals; uint incentives = 9000000 * 10**decimals; uint earlyInvestors = 6000000 * 10**decimals; bool foundersTokensClaimed = false; bool insurePalTeamTokensClaimed = false; bool tcsSupportTeamTokensClaimed = false; bool advisorsAndAmbassadorsTokensClaimed = false; bool incentivesTokensClaimed = false; bool earlyInvestorsTokensClaimed = false; // // Unnamed function that runs when eth is sent to the contract // function() noReentrancy payable public { } // // Check crowdsale state and calibrate it // function checkCrowdsaleState() internal returns (bool) { } // // Decide if throw or only return ether // function refundTransaction(bool _stateChanged) internal { } function calculateEthToToken(uint _eth, uint _blockNumber) constant public returns(uint) { } function calculateTokenToEth(uint _token, uint _blockNumber) constant public returns(uint) { } // // Issue tokens and return if there is overflow // function processTransaction(address _contributor, uint _amount) internal { } function pushAngelInvestmentData(address _address, uint _ethContributed) onlyOwner public { } function depositAngelInvestmentEth() payable onlyOwner public {} // // Method is needed for recovering tokens accedentaly sent to token address // function salvageTokensFromContract(address _tokenAddress, address _to, uint _amount) onlyOwner public { } // // withdrawEth when minimum cap is reached // function withdrawEth() onlyOwner public { } // // Users can claim their contribution if min cap is not raised // function claimEthIfFailed() public { require(block.number > crowdsaleEndedBlock && tokensIssued < minCap); // Check if crowdsale has failed require(<FILL_ME>) // Check if contributor has contributed to crowdsaleEndedBlock require(!hasClaimedEthWhenFail[msg.sender]); // Check if contributor has already claimed his eth uint ethContributed = contributorList[msg.sender].contributionAmount; // Get contributors contribution hasClaimedEthWhenFail[msg.sender] = true; // Set that he has claimed if (!msg.sender.send(ethContributed)) { // Refund eth ErrorSendingETH(msg.sender, ethContributed); // If there is an issue raise event for manual recovery } } // // Owner can batch return contributors contributions(eth) // function batchReturnEthIfFailed(uint _numberOfReturns) onlyOwner public { } // // If there were any issue/attach with refund owner can withraw eth at the end for manual recovery // function withdrawRemainingBalanceForManualRecovery() onlyOwner public { } function claimTeamTokens(address _to, uint _choice) onlyOwner public { } // // Owner can set multisig address for crowdsale // function setMultisigAddress(address _newAddress) onlyOwner public { } // // Owner can set token address where mints will happen // function setToken(address _newAddress) onlyOwner public { } function setKycAddress(address _newAddress) onlyOwner public { } function getTokenAddress() constant public returns(address) { } function investorCount() constant public returns(uint) { } function setCrowdsaleStartBlock(uint _block) onlyOwner public { } } contract InsurePalCrowdsale is Crowdsale { function InsurePalCrowdsale() { } }
contributorList[msg.sender].contributionAmount>0
284,396
contributorList[msg.sender].contributionAmount>0
null
contract SafeMath { uint256 constant MAX_UINT256 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; function safeAdd(uint256 x, uint256 y) constant internal returns (uint256 z) { } function safeSub(uint256 x, uint256 y) constant internal returns (uint256 z) { } function safeMul(uint256 x, uint256 y) constant internal returns (uint256 z) { } } contract ReentrancyHandlingContract{ bool locked; modifier noReentrancy() { } } contract Owned { address public owner; address public newOwner; function Owned() { } modifier onlyOwner { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public { } event OwnerUpdate(address _prevOwner, address _newOwner); } contract Lockable is Owned { uint256 public lockedUntilBlock; event ContractLocked(uint256 _untilBlock, string _reason); modifier lockAffected { } function lockFromSelf(uint256 _untilBlock, string _reason) internal { } function lockUntil(uint256 _untilBlock, string _reason) onlyOwner public { } } contract ERC20TokenInterface { function totalSupply() public constant returns (uint256 _totalSupply); function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); 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 InsurePalTokenInterface { function mint(address _to, uint256 _amount) public; } contract tokenRecipientInterface { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); } contract KycContractInterface { function isAddressVerified(address _address) public view returns (bool); } contract KycContract is Owned { mapping (address => bool) verifiedAddresses; function isAddressVerified(address _address) public view returns (bool) { } function addAddress(address _newAddress) public onlyOwner { } function removeAddress(address _oldAddress) public onlyOwner { } function batchAddAddresses(address[] _addresses) public onlyOwner { } function salvageTokensFromContract(address _tokenAddress, address _to, uint _amount) public onlyOwner{ } function killContract() public onlyOwner { } } contract Crowdsale is ReentrancyHandlingContract, Owned { struct ContributorData { uint contributionAmount; uint tokensIssued; } mapping(address => ContributorData) public contributorList; uint nextContributorIndex; mapping(uint => address) contributorIndexes; state public crowdsaleState = state.pendingStart; enum state { pendingStart, crowdsale, crowdsaleEnded } uint public crowdsaleStartBlock; uint public crowdsaleEndedBlock; event CrowdsaleStarted(uint blockNumber); event CrowdsaleEnded(uint blockNumber); event ErrorSendingETH(address to, uint amount); event MinCapReached(uint blockNumber); event MaxCapReached(uint blockNumber); address tokenAddress = 0x0; address kycAddress = 0x0; uint decimals = 18; uint public minCap; //InTokens uint public maxCap; //InTokens uint public ethRaised; uint public tokenTotalSupply = 300000000 * 10**decimals; uint public tokensIssued = 0; address public multisigAddress; uint blocksInADay; uint nextContributorToClaim; mapping(address => bool) hasClaimedEthWhenFail; uint crowdsaleTokenCap = 201000000 * 10**decimals; uint founders = 30000000 * 10**decimals; uint insurePalTeam = 18000000 * 10**decimals; uint tcsSupportTeam = 18000000 * 10**decimals; uint advisorsAndAmbassadors = 18000000 * 10**decimals; uint incentives = 9000000 * 10**decimals; uint earlyInvestors = 6000000 * 10**decimals; bool foundersTokensClaimed = false; bool insurePalTeamTokensClaimed = false; bool tcsSupportTeamTokensClaimed = false; bool advisorsAndAmbassadorsTokensClaimed = false; bool incentivesTokensClaimed = false; bool earlyInvestorsTokensClaimed = false; // // Unnamed function that runs when eth is sent to the contract // function() noReentrancy payable public { } // // Check crowdsale state and calibrate it // function checkCrowdsaleState() internal returns (bool) { } // // Decide if throw or only return ether // function refundTransaction(bool _stateChanged) internal { } function calculateEthToToken(uint _eth, uint _blockNumber) constant public returns(uint) { } function calculateTokenToEth(uint _token, uint _blockNumber) constant public returns(uint) { } // // Issue tokens and return if there is overflow // function processTransaction(address _contributor, uint _amount) internal { } function pushAngelInvestmentData(address _address, uint _ethContributed) onlyOwner public { } function depositAngelInvestmentEth() payable onlyOwner public {} // // Method is needed for recovering tokens accedentaly sent to token address // function salvageTokensFromContract(address _tokenAddress, address _to, uint _amount) onlyOwner public { } // // withdrawEth when minimum cap is reached // function withdrawEth() onlyOwner public { } // // Users can claim their contribution if min cap is not raised // function claimEthIfFailed() public { require(block.number > crowdsaleEndedBlock && tokensIssued < minCap); // Check if crowdsale has failed require(contributorList[msg.sender].contributionAmount > 0); // Check if contributor has contributed to crowdsaleEndedBlock require(<FILL_ME>) // Check if contributor has already claimed his eth uint ethContributed = contributorList[msg.sender].contributionAmount; // Get contributors contribution hasClaimedEthWhenFail[msg.sender] = true; // Set that he has claimed if (!msg.sender.send(ethContributed)) { // Refund eth ErrorSendingETH(msg.sender, ethContributed); // If there is an issue raise event for manual recovery } } // // Owner can batch return contributors contributions(eth) // function batchReturnEthIfFailed(uint _numberOfReturns) onlyOwner public { } // // If there were any issue/attach with refund owner can withraw eth at the end for manual recovery // function withdrawRemainingBalanceForManualRecovery() onlyOwner public { } function claimTeamTokens(address _to, uint _choice) onlyOwner public { } // // Owner can set multisig address for crowdsale // function setMultisigAddress(address _newAddress) onlyOwner public { } // // Owner can set token address where mints will happen // function setToken(address _newAddress) onlyOwner public { } function setKycAddress(address _newAddress) onlyOwner public { } function getTokenAddress() constant public returns(address) { } function investorCount() constant public returns(uint) { } function setCrowdsaleStartBlock(uint _block) onlyOwner public { } } contract InsurePalCrowdsale is Crowdsale { function InsurePalCrowdsale() { } }
!hasClaimedEthWhenFail[msg.sender]
284,396
!hasClaimedEthWhenFail[msg.sender]
null
contract SafeMath { uint256 constant MAX_UINT256 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; function safeAdd(uint256 x, uint256 y) constant internal returns (uint256 z) { } function safeSub(uint256 x, uint256 y) constant internal returns (uint256 z) { } function safeMul(uint256 x, uint256 y) constant internal returns (uint256 z) { } } contract ReentrancyHandlingContract{ bool locked; modifier noReentrancy() { } } contract Owned { address public owner; address public newOwner; function Owned() { } modifier onlyOwner { } function transferOwnership(address _newOwner) public onlyOwner { } function acceptOwnership() public { } event OwnerUpdate(address _prevOwner, address _newOwner); } contract Lockable is Owned { uint256 public lockedUntilBlock; event ContractLocked(uint256 _untilBlock, string _reason); modifier lockAffected { } function lockFromSelf(uint256 _untilBlock, string _reason) internal { } function lockUntil(uint256 _untilBlock, string _reason) onlyOwner public { } } contract ERC20TokenInterface { function totalSupply() public constant returns (uint256 _totalSupply); function balanceOf(address _owner) public constant returns (uint256 balance); function transfer(address _to, uint256 _value) public returns (bool success); function transferFrom(address _from, address _to, uint256 _value) public returns (bool success); function approve(address _spender, uint256 _value) public returns (bool success); 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 InsurePalTokenInterface { function mint(address _to, uint256 _amount) public; } contract tokenRecipientInterface { function receiveApproval(address _from, uint256 _value, address _token, bytes _extraData); } contract KycContractInterface { function isAddressVerified(address _address) public view returns (bool); } contract KycContract is Owned { mapping (address => bool) verifiedAddresses; function isAddressVerified(address _address) public view returns (bool) { } function addAddress(address _newAddress) public onlyOwner { } function removeAddress(address _oldAddress) public onlyOwner { } function batchAddAddresses(address[] _addresses) public onlyOwner { } function salvageTokensFromContract(address _tokenAddress, address _to, uint _amount) public onlyOwner{ } function killContract() public onlyOwner { } } contract Crowdsale is ReentrancyHandlingContract, Owned { struct ContributorData { uint contributionAmount; uint tokensIssued; } mapping(address => ContributorData) public contributorList; uint nextContributorIndex; mapping(uint => address) contributorIndexes; state public crowdsaleState = state.pendingStart; enum state { pendingStart, crowdsale, crowdsaleEnded } uint public crowdsaleStartBlock; uint public crowdsaleEndedBlock; event CrowdsaleStarted(uint blockNumber); event CrowdsaleEnded(uint blockNumber); event ErrorSendingETH(address to, uint amount); event MinCapReached(uint blockNumber); event MaxCapReached(uint blockNumber); address tokenAddress = 0x0; address kycAddress = 0x0; uint decimals = 18; uint public minCap; //InTokens uint public maxCap; //InTokens uint public ethRaised; uint public tokenTotalSupply = 300000000 * 10**decimals; uint public tokensIssued = 0; address public multisigAddress; uint blocksInADay; uint nextContributorToClaim; mapping(address => bool) hasClaimedEthWhenFail; uint crowdsaleTokenCap = 201000000 * 10**decimals; uint founders = 30000000 * 10**decimals; uint insurePalTeam = 18000000 * 10**decimals; uint tcsSupportTeam = 18000000 * 10**decimals; uint advisorsAndAmbassadors = 18000000 * 10**decimals; uint incentives = 9000000 * 10**decimals; uint earlyInvestors = 6000000 * 10**decimals; bool foundersTokensClaimed = false; bool insurePalTeamTokensClaimed = false; bool tcsSupportTeamTokensClaimed = false; bool advisorsAndAmbassadorsTokensClaimed = false; bool incentivesTokensClaimed = false; bool earlyInvestorsTokensClaimed = false; // // Unnamed function that runs when eth is sent to the contract // function() noReentrancy payable public { } // // Check crowdsale state and calibrate it // function checkCrowdsaleState() internal returns (bool) { } // // Decide if throw or only return ether // function refundTransaction(bool _stateChanged) internal { } function calculateEthToToken(uint _eth, uint _blockNumber) constant public returns(uint) { } function calculateTokenToEth(uint _token, uint _blockNumber) constant public returns(uint) { } // // Issue tokens and return if there is overflow // function processTransaction(address _contributor, uint _amount) internal { } function pushAngelInvestmentData(address _address, uint _ethContributed) onlyOwner public { } function depositAngelInvestmentEth() payable onlyOwner public {} // // Method is needed for recovering tokens accedentaly sent to token address // function salvageTokensFromContract(address _tokenAddress, address _to, uint _amount) onlyOwner public { } // // withdrawEth when minimum cap is reached // function withdrawEth() onlyOwner public { } // // Users can claim their contribution if min cap is not raised // function claimEthIfFailed() public { } // // Owner can batch return contributors contributions(eth) // function batchReturnEthIfFailed(uint _numberOfReturns) onlyOwner public { } // // If there were any issue/attach with refund owner can withraw eth at the end for manual recovery // function withdrawRemainingBalanceForManualRecovery() onlyOwner public { require(this.balance != 0); // Check if there are any eth to claim require(block.number > crowdsaleEndedBlock); // Check if crowdsale is over require(<FILL_ME>) // Check if all the users were refunded multisigAddress.transfer(this.balance); // Withdraw to multisig } function claimTeamTokens(address _to, uint _choice) onlyOwner public { } // // Owner can set multisig address for crowdsale // function setMultisigAddress(address _newAddress) onlyOwner public { } // // Owner can set token address where mints will happen // function setToken(address _newAddress) onlyOwner public { } function setKycAddress(address _newAddress) onlyOwner public { } function getTokenAddress() constant public returns(address) { } function investorCount() constant public returns(uint) { } function setCrowdsaleStartBlock(uint _block) onlyOwner public { } } contract InsurePalCrowdsale is Crowdsale { function InsurePalCrowdsale() { } }
contributorIndexes[nextContributorToClaim]==0x0
284,396
contributorIndexes[nextContributorToClaim]==0x0
null
pragma solidity 0.4.15; /** * Basic interface for contracts, following ERC20 standard */ contract ERC20Token { /** * Triggered when tokens are transferred. * @param from - address tokens were transfered from * @param to - address tokens were transfered to * @param value - amount of tokens transfered */ event Transfer(address indexed from, address indexed to, uint256 value); /** * Triggered whenever allowance status changes * @param owner - tokens owner, allowance changed for * @param spender - tokens spender, allowance changed for * @param value - new allowance value (overwriting the old value) */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * Returns total supply of tokens ever emitted * @return totalSupply - total supply of tokens ever emitted */ function totalSupply() constant returns (uint256 totalSupply); /** * Returns `owner` balance of tokens * @param owner address to request balance for * @return balance - token balance of `owner` */ function balanceOf(address owner) constant returns (uint256 balance); /** * Transfers `amount` of tokens to `to` address * @param to - address to transfer to * @param value - amount of tokens to transfer * @return success - `true` if the transfer was succesful, `false` otherwise */ function transfer(address to, uint256 value) returns (bool success); /** * Transfers `value` tokens from `from` address to `to` * the sender needs to have allowance for this operation * @param from - address to take tokens from * @param to - address to send tokens to * @param value - amount of tokens to send * @return success - `true` if the transfer was succesful, `false` otherwise */ function transferFrom(address from, address to, uint256 value) returns (bool success); /** * Allow spender to withdraw from your account, multiple times, up to the value amount. * If this function is called again it overwrites the current allowance with `value`. * this function is required for some DEX functionality * @param spender - address to give allowance to * @param value - the maximum amount of tokens allowed for spending * @return success - `true` if the allowance was given, `false` otherwise */ function approve(address spender, uint256 value) returns (bool success); /** * Returns the amount which `spender` is still allowed to withdraw from `owner` * @param owner - tokens owner * @param spender - addres to request allowance for * @return remaining - remaining allowance (token count) */ function allowance(address owner, address spender) constant returns (uint256 remaining); } /** * @title Token Holder * Given a ERC20 compatible Token allows holding for a certain amount of time * after that time, the beneficiar can acquire his Tokens */ contract TokenHolder { uint256 constant MIN_TOKENS_TO_HOLD = 1000; /** * A single token deposit for a certain amount of time for a certain beneficiar */ struct TokenDeposit { uint256 tokens; uint256 releaseTime; } /** Emited when Tokens where put on hold * @param tokens - amount of Tokens * @param beneficiar - the address that will be able to claim Tokens in the future * @param depositor - the address deposited tokens * @param releaseTime - timestamp of a moment which `beneficiar` would be able to claim Tokens after */ event Deposited(address indexed depositor, address indexed beneficiar, uint256 tokens, uint256 releaseTime); /** Emited when Tokens where claimed back * @param tokens - amount of Tokens claimed * @param beneficiar - who claimed the Tokens */ event Claimed(address indexed beneficiar, uint256 tokens); /** all the deposits made */ mapping(address => TokenDeposit[]) deposits; /** Tokens contract instance */ ERC20Token public tokenContract; /** * Creates the Token Holder with the specifief `ERC20` Token Contract instance * @param _tokenContract `ERC20` Token Contract instance to use */ function TokenHolder (address _tokenContract) { } /** * Puts some amount of Tokens on hold to be retrieved later * @param tokenCount - amount of tokens * @param tokenBeneficiar - will be able to retrieve tokens in the future * @param depositTime - time to hold in seconds */ function depositTokens (uint256 tokenCount, address tokenBeneficiar, uint256 depositTime) { require(tokenCount >= MIN_TOKENS_TO_HOLD); require(<FILL_ME>) if(tokenContract.transferFrom(msg.sender, address(this), tokenCount)) { deposits[tokenBeneficiar].push(TokenDeposit(tokenCount, now + depositTime)); Deposited(msg.sender, tokenBeneficiar, tokenCount, now + depositTime); } } /** * Returns the amount of deposits for `beneficiar` */ function getDepositCount (address beneficiar) constant returns (uint count) { } /** * returns the `idx` deposit for `beneficiar` */ function getDeposit (address beneficiar, uint idx) constant returns (uint256 deposit_dot_tokens, uint256 deposit_dot_releaseTime) { } /** * Transfers all the Tokens already unlocked to `msg.sender` */ function claimAllTokens () { } }
tokenContract.allowance(msg.sender,address(this))>=tokenCount
284,416
tokenContract.allowance(msg.sender,address(this))>=tokenCount