comment
stringlengths
1
211
input
stringlengths
155
20k
label
stringlengths
4
1k
original_idx
int64
203
514k
predicate
stringlengths
1
1k
"Could not transfer tokens."
pragma solidity >=0.8.0; // SPDX-License-Identifier: BSD-3-Clause /** * @title SafeMath * @dev Math operations with safety checks that throw on error */ library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner ; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor() { } /** * @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 { } } interface Token { function transferFrom(address, address, uint) external returns (bool); function transfer(address, uint) external returns (bool); } contract BSB_Locking_Marketing is Ownable { using SafeMath for uint; // BSB token contract address address public constant tokenAddress = 0xA478A13242b64629bff309125770B69f75Bd77cb; uint256 public tokens = 0; uint256 public current_withdraw = 1 ; uint256 public constant number_withdraws = 54; uint256 public constant period_time = 30 days; uint256 public timing ; uint256 public amount_per_withdraw = 0; uint256 public amount_already_out = 0; function getNumPeriods() public view returns(uint){ } function getTiming() public view returns (uint256){ } function deposit(uint amountToStake) public onlyOwner returns (bool){ } function withdraw() public onlyOwner returns(bool){ require( tokens > 0, "No tokens left"); require(current_withdraw <= getNumPeriods() , "Not yet"); current_withdraw = current_withdraw.add(1); require(<FILL_ME>) tokens = tokens.sub(amount_per_withdraw); amount_already_out = amount_already_out.add(amount_per_withdraw); return true; } }
Token(tokenAddress).transfer(owner,amount_per_withdraw),"Could not transfer tokens."
34,222
Token(tokenAddress).transfer(owner,amount_per_withdraw)
'transfer failed'
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } 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); } contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { } function owner() public view returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } } /** * @dev A token holder contract that will allow a beneficiary to extract the * tokens at predefined intervals. Tokens not claimed at payment epochs accumulate * Modified version of Openzeppelin's TokenTimeLock */ contract Lock is Ownable { enum period { second, minute, hour, day, week, month, //inaccurate, assumes 30 day month, subject to drift year, quarter,//13 weeks biannual//26 weeks } //The length in seconds for each epoch between payments uint epochLength; // ERC20 basic token contract being held IERC20 private _token; // beneficiary of tokens after they are released address private _beneficiary; uint periods; //the size of periodic payments uint paymentSize; uint paymentsRemaining =0; uint startTime =0; uint beneficiaryBalance = 0; function initialize(address tokenAddress, address beneficiary, uint duration,uint durationMultiple,uint p) public onlyOwner{ } function deposit (uint amount) public { //remember to ERC20.approve require(<FILL_ME>) uint balance = _token.balanceOf(address(this)); if(paymentsRemaining==0) { paymentsRemaining = periods; startTime = block.timestamp; } paymentSize = balance/paymentsRemaining; emit PaymentsUpdatedOnDeposit(paymentSize,startTime,paymentsRemaining); } function getElapsedReward() public view returns (uint,uint,uint){ } function updateBeneficiaryBalance() private { } function changeBeneficiary (address beneficiary) public { } /** * @return the beneficiary of the tokens. */ function currentBeneficiary() public view returns (address) { } /** * @notice Transfers tokens held by timelock to beneficiary. */ function release() public { } function emergencyWithdrawal() public onlyOwner{ } event PaymentsUpdatedOnDeposit(uint paymentSize,uint startTime, uint paymentsRemaining); event Initialized (address tokenAddress, address beneficiary, uint duration,uint periods); event FundsReleasedToBeneficiary(address beneficiary, uint value, uint timeStamp); event Shutdowntriggered(); }
_token.transferFrom(msg.sender,address(this),amount),'transfer failed'
34,260
_token.transferFrom(msg.sender,address(this),amount)
'TokenTimelock: cannot change beneficiary while token balance positive'
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } 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); } contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { } function owner() public view returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } } /** * @dev A token holder contract that will allow a beneficiary to extract the * tokens at predefined intervals. Tokens not claimed at payment epochs accumulate * Modified version of Openzeppelin's TokenTimeLock */ contract Lock is Ownable { enum period { second, minute, hour, day, week, month, //inaccurate, assumes 30 day month, subject to drift year, quarter,//13 weeks biannual//26 weeks } //The length in seconds for each epoch between payments uint epochLength; // ERC20 basic token contract being held IERC20 private _token; // beneficiary of tokens after they are released address private _beneficiary; uint periods; //the size of periodic payments uint paymentSize; uint paymentsRemaining =0; uint startTime =0; uint beneficiaryBalance = 0; function initialize(address tokenAddress, address beneficiary, uint duration,uint durationMultiple,uint p) public onlyOwner{ } function deposit (uint amount) public { } function getElapsedReward() public view returns (uint,uint,uint){ } function updateBeneficiaryBalance() private { } function changeBeneficiary (address beneficiary) public { require(<FILL_ME>) _beneficiary = beneficiary; } /** * @return the beneficiary of the tokens. */ function currentBeneficiary() public view returns (address) { } /** * @notice Transfers tokens held by timelock to beneficiary. */ function release() public { } function emergencyWithdrawal() public onlyOwner{ } event PaymentsUpdatedOnDeposit(uint paymentSize,uint startTime, uint paymentsRemaining); event Initialized (address tokenAddress, address beneficiary, uint duration,uint periods); event FundsReleasedToBeneficiary(address beneficiary, uint value, uint timeStamp); event Shutdowntriggered(); }
(msg.sender==owner()&&paymentsRemaining==0)||msg.sender==beneficiary,'TokenTimelock: cannot change beneficiary while token balance positive'
34,260
(msg.sender==owner()&&paymentsRemaining==0)||msg.sender==beneficiary
'release funds failed'
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } 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); } contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { } function owner() public view returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } } /** * @dev A token holder contract that will allow a beneficiary to extract the * tokens at predefined intervals. Tokens not claimed at payment epochs accumulate * Modified version of Openzeppelin's TokenTimeLock */ contract Lock is Ownable { enum period { second, minute, hour, day, week, month, //inaccurate, assumes 30 day month, subject to drift year, quarter,//13 weeks biannual//26 weeks } //The length in seconds for each epoch between payments uint epochLength; // ERC20 basic token contract being held IERC20 private _token; // beneficiary of tokens after they are released address private _beneficiary; uint periods; //the size of periodic payments uint paymentSize; uint paymentsRemaining =0; uint startTime =0; uint beneficiaryBalance = 0; function initialize(address tokenAddress, address beneficiary, uint duration,uint durationMultiple,uint p) public onlyOwner{ } function deposit (uint amount) public { } function getElapsedReward() public view returns (uint,uint,uint){ } function updateBeneficiaryBalance() private { } function changeBeneficiary (address beneficiary) public { } /** * @return the beneficiary of the tokens. */ function currentBeneficiary() public view returns (address) { } /** * @notice Transfers tokens held by timelock to beneficiary. */ function release() public { // solhint-disable-next-line not-rely-on-time require(block.timestamp >= startTime, "TokenTimelock: current time is before release time"); updateBeneficiaryBalance(); uint amountToSend = beneficiaryBalance; beneficiaryBalance = 0; if(amountToSend>0) require(<FILL_ME>) emit FundsReleasedToBeneficiary(_beneficiary,amountToSend,block.timestamp); } function emergencyWithdrawal() public onlyOwner{ } event PaymentsUpdatedOnDeposit(uint paymentSize,uint startTime, uint paymentsRemaining); event Initialized (address tokenAddress, address beneficiary, uint duration,uint periods); event FundsReleasedToBeneficiary(address beneficiary, uint value, uint timeStamp); event Shutdowntriggered(); }
_token.transfer(_beneficiary,amountToSend),'release funds failed'
34,260
_token.transfer(_beneficiary,amountToSend)
"Unable to transfer"
// SPDX-License-Identifier: MIT pragma solidity 0.8.7; library Address { function isContract(address account) internal view returns (bool) { } function sendValue(address payable recipient, uint256 amount) internal { } function functionCall(address target, bytes memory data) internal returns (bytes memory) { } /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with * `errorMessage` as a fallback revert reason when `target` reverts. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { } function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) { } function _functionCallWithValue(address target, bytes memory data, uint256 weiValue, string memory errorMessage) private returns (bytes memory) { } } 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); } contract Ownable { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor () { } function owner() public view returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner { } function transferOwnership(address newOwner) public virtual onlyOwner { } } /** * @dev A token holder contract that will allow a beneficiary to extract the * tokens at predefined intervals. Tokens not claimed at payment epochs accumulate * Modified version of Openzeppelin's TokenTimeLock */ contract Lock is Ownable { enum period { second, minute, hour, day, week, month, //inaccurate, assumes 30 day month, subject to drift year, quarter,//13 weeks biannual//26 weeks } //The length in seconds for each epoch between payments uint epochLength; // ERC20 basic token contract being held IERC20 private _token; // beneficiary of tokens after they are released address private _beneficiary; uint periods; //the size of periodic payments uint paymentSize; uint paymentsRemaining =0; uint startTime =0; uint beneficiaryBalance = 0; function initialize(address tokenAddress, address beneficiary, uint duration,uint durationMultiple,uint p) public onlyOwner{ } function deposit (uint amount) public { } function getElapsedReward() public view returns (uint,uint,uint){ } function updateBeneficiaryBalance() private { } function changeBeneficiary (address beneficiary) public { } /** * @return the beneficiary of the tokens. */ function currentBeneficiary() public view returns (address) { } /** * @notice Transfers tokens held by timelock to beneficiary. */ function release() public { } function emergencyWithdrawal() public onlyOwner{ uint balance = _token.balanceOf(address(this)); require(<FILL_ME>) emit Shutdowntriggered(); } event PaymentsUpdatedOnDeposit(uint paymentSize,uint startTime, uint paymentsRemaining); event Initialized (address tokenAddress, address beneficiary, uint duration,uint periods); event FundsReleasedToBeneficiary(address beneficiary, uint value, uint timeStamp); event Shutdowntriggered(); }
_token.transfer(msg.sender,balance),"Unable to transfer"
34,260
_token.transfer(msg.sender,balance)
"Amount to pay is over the user limit"
// SPDX-License-Identifier: MIT pragma solidity ^0.5.0; /** * @dev Wrappers over Solidity's arithmetic operations with added overflow * checks. * * Arithmetic operations in Solidity wrap on overflow. This can easily result * in bugs, because programmers usually assume that an overflow raises an * error, which is the standard behavior in high level programming languages. * `SafeMath` restores this intuition by reverting the transaction when an * operation overflows. * * Using this library instead of the unchecked operations eliminates an entire * class of bugs, so it's recommended to use it always. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the integer division of two unsigned integers. Reverts with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * Reverts with custom message when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } /** * @title Roles * @dev Library for managing addresses assigned to a Role. */ library Roles { struct Role { mapping (address => bool) bearer; } /** * @dev give an account access to this role */ function add(Role storage role, address account) internal { } /** * @dev remove an account's access to this role */ function remove(Role storage role, address account) internal { } /** * @dev check if an account has this role * @return bool */ function has(Role storage role, address account) internal view returns (bool) { } } /** * @title ChainlinkConversionPath * * @notice ChainlinkConversionPath is a contract allowing to compute conversion rate from a Chainlink aggretators */ interface ChainlinkConversionPath { /** * @notice Computes the rate from a list of conversion * @param _path List of addresses representing the currencies for the conversions * @return rate the rate * @return oldestRateTimestamp he oldest timestamp of the path * @return decimals of the conversion rate */ function getRate( address[] calldata _path ) external view returns (uint256 rate, uint256 oldestRateTimestamp, uint256 decimals); } interface IERC20FeeProxy { event TransferWithReferenceAndFee( address tokenAddress, address to, uint256 amount, bytes indexed paymentReference, uint256 feeAmount, address feeAddress ); function transferFromWithReferenceAndFee( address _tokenAddress, address _to, uint256 _amount, bytes calldata _paymentReference, uint256 _feeAmount, address _feeAddress ) external; } /** * @title ERC20ConversionProxy */ contract ERC20ConversionProxy { using SafeMath for uint256; address public paymentProxy; ChainlinkConversionPath public chainlinkConversionPath; constructor(address _paymentProxyAddress, address _chainlinkConversionPathAddress) public { } // Event to declare a transfer with a reference event TransferWithConversionAndReference( uint256 amount, address currency, bytes indexed paymentReference, uint256 feeAmount, uint256 maxRateTimespan ); /** * @notice Performs an ERC20 token transfer with a reference computing the amount based on a fiat amount * @param _to Transfer recipient * @param _requestAmount request amount * @param _path conversion path * @param _paymentReference Reference of the payment related * @param _feeAmount The amount of the payment fee * @param _feeAddress The fee recipient * @param _maxToSpend amount max that we can spend on the behalf of the user * @param _maxRateTimespan max time span with the oldestrate, ignored if zero */ function transferFromWithReferenceAndFee( address _to, uint256 _requestAmount, address[] calldata _path, bytes calldata _paymentReference, uint256 _feeAmount, address _feeAddress, uint256 _maxToSpend, uint256 _maxRateTimespan ) external { (uint256 amountToPay, uint256 amountToPayInFees) = getConversions(_path, _requestAmount, _feeAmount, _maxRateTimespan); require(<FILL_ME>) // Pay the request and fees (bool status, ) = paymentProxy.delegatecall( abi.encodeWithSignature( "transferFromWithReferenceAndFee(address,address,uint256,bytes,uint256,address)", // payment currency _path[_path.length - 1], _to, amountToPay, _paymentReference, amountToPayInFees, _feeAddress ) ); require(status, "transferFromWithReferenceAndFee failed"); // Event to declare a transfer with a reference emit TransferWithConversionAndReference( _requestAmount, // request currency _path[0], _paymentReference, _feeAmount, _maxRateTimespan ); } function getConversions( address[] memory _path, uint256 _requestAmount, uint256 _feeAmount, uint256 _maxRateTimespan ) internal view returns (uint256 amountToPay, uint256 amountToPayInFees) { } }
amountToPay.add(amountToPayInFees)<=_maxToSpend,"Amount to pay is over the user limit"
34,276
amountToPay.add(amountToPayInFees)<=_maxToSpend
null
/* Token recipient. Modified very slightly from the example on http://ethereum.org/dao (just to index log parameters). */ pragma solidity 0.4.23; import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol"; /** * @title TokenRecipient * @author Project Wyvern Developers */ contract TokenRecipient { event ReceivedEther(address indexed sender, uint amount); event ReceivedTokens(address indexed from, uint256 value, address indexed token, bytes extraData); /** * @dev Receive tokens and generate a log event * @param from Address from which to transfer tokens * @param value Amount of tokens to transfer * @param token Address of token * @param extraData Additional data to log */ function receiveApproval(address from, uint256 value, address token, bytes extraData) public { ERC20 t = ERC20(token); require(<FILL_ME>) emit ReceivedTokens(from, value, token, extraData); } /** * @dev Receive Ether and generate a log event */ function () payable public { } }
t.transferFrom(from,this,value)
34,323
t.transferFrom(from,this,value)
null
pragma solidity ^0.4.24; contract AccessControl { address public creatorAddress; uint16 public totalSeraphims = 0; mapping (address => bool) public seraphims; bool public isMaintenanceMode = true; modifier onlyCREATOR() { } modifier onlySERAPHIM() { require(<FILL_ME>) _; } modifier isContractActive { } // Constructor constructor() public { } function addSERAPHIM(address _newSeraphim) onlyCREATOR public { } function removeSERAPHIM(address _oldSeraphim) onlyCREATOR public { } function updateMaintenanceMode(bool _isMaintaining) onlyCREATOR public { } } pragma solidity ^0.4.16; contract SafeMath { function safeAdd(uint x, uint y) pure internal returns(uint) { } function safeSubtract(uint x, uint y) pure internal returns(uint) { } function safeMult(uint x, uint y) pure internal returns(uint) { } function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { } function getRandomNumber(uint16 maxRandom, uint16 min, address privateAddress) constant public returns(uint8) { } } contract Enums { enum ResultCode { SUCCESS, ERROR_CLASS_NOT_FOUND, ERROR_LOW_BALANCE, ERROR_SEND_FAIL, ERROR_NOT_OWNER, ERROR_NOT_ENOUGH_MONEY, ERROR_INVALID_AMOUNT } enum AngelAura { Blue, Yellow, Purple, Orange, Red, Green } } contract IABToken is AccessControl { function balanceOf(address owner) public view returns (uint256); function totalSupply() external view returns (uint256) ; function ownerOf(uint256 tokenId) public view returns (address) ; function setMaxAngels() external; function setMaxAccessories() external; function setMaxMedals() external ; function initAngelPrices() external; function initAccessoryPrices() external ; function setCardSeriesPrice(uint8 _cardSeriesId, uint _newPrice) external; function approve(address to, uint256 tokenId) public; function getRandomNumber(uint16 maxRandom, uint8 min, address privateAddress) view public returns(uint8) ; function tokenURI(uint256 _tokenId) public pure returns (string memory) ; function baseTokenURI() public pure returns (string memory) ; function name() external pure returns (string memory _name) ; function symbol() external pure returns (string memory _symbol) ; function getApproved(uint256 tokenId) public view returns (address) ; function setApprovalForAll(address to, bool approved) public ; function isApprovedForAll(address owner, address operator) public view returns (bool); function transferFrom(address from, address to, uint256 tokenId) public ; function safeTransferFrom(address from, address to, uint256 tokenId) public ; function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public ; function _exists(uint256 tokenId) internal view returns (bool) ; function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) ; function _mint(address to, uint256 tokenId) internal ; function mintABToken(address owner, uint8 _cardSeriesId, uint16 _power, uint16 _auraRed, uint16 _auraYellow, uint16 _auraBlue, string memory _name, uint16 _experience, uint16 _oldId) public; function addABTokenIdMapping(address _owner, uint256 _tokenId) private ; function getPrice(uint8 _cardSeriesId) public view returns (uint); function buyAngel(uint8 _angelSeriesId) public payable ; function buyAccessory(uint8 _accessorySeriesId) public payable ; function getAura(uint8 _angelSeriesId) pure public returns (uint8 auraRed, uint8 auraYellow, uint8 auraBlue) ; function getAngelPower(uint8 _angelSeriesId) private view returns (uint16) ; function getABToken(uint256 tokenId) view public returns(uint8 cardSeriesId, uint16 power, uint16 auraRed, uint16 auraYellow, uint16 auraBlue, string memory name, uint16 experience, uint64 lastBattleTime, uint16 lastBattleResult, address owner, uint16 oldId); function setAuras(uint256 tokenId, uint16 _red, uint16 _blue, uint16 _yellow) external; function setName(uint256 tokenId,string memory namechange) public ; function setExperience(uint256 tokenId, uint16 _experience) external; function setLastBattleResult(uint256 tokenId, uint16 _result) external ; function setLastBattleTime(uint256 tokenId) external; function setLastBreedingTime(uint256 tokenId) external ; function setoldId(uint256 tokenId, uint16 _oldId) external; function getABTokenByIndex(address _owner, uint64 _index) view external returns(uint256) ; function _burn(address owner, uint256 tokenId) internal ; function _burn(uint256 tokenId) internal ; function _transferFrom(address from, address to, uint256 tokenId) internal ; function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) internal returns (bool); function _clearApproval(uint256 tokenId) private ; } contract IPetCardData is AccessControl, Enums { uint8 public totalPetCardSeries; uint64 public totalPets; // write function createPetCardSeries(uint8 _petCardSeriesId, uint32 _maxTotal) onlyCREATOR public returns(uint8); function setPet(uint8 _petCardSeriesId, address _owner, string _name, uint8 _luck, uint16 _auraRed, uint16 _auraYellow, uint16 _auraBlue) onlySERAPHIM external returns(uint64); function setPetAuras(uint64 _petId, uint8 _auraRed, uint8 _auraBlue, uint8 _auraYellow) onlySERAPHIM external; function setPetLastTrainingTime(uint64 _petId) onlySERAPHIM external; function setPetLastBreedingTime(uint64 _petId) onlySERAPHIM external; function addPetIdMapping(address _owner, uint64 _petId) private; function transferPet(address _from, address _to, uint64 _petId) onlySERAPHIM public returns(ResultCode); function ownerPetTransfer (address _to, uint64 _petId) public; function setPetName(string _name, uint64 _petId) public; // read function getPetCardSeries(uint8 _petCardSeriesId) constant public returns(uint8 petCardSeriesId, uint32 currentPetTotal, uint32 maxPetTotal); function getPet(uint _petId) constant public returns(uint petId, uint8 petCardSeriesId, string name, uint8 luck, uint16 auraRed, uint16 auraBlue, uint16 auraYellow, uint64 lastTrainingTime, uint64 lastBreedingTime, address owner); function getOwnerPetCount(address _owner) constant public returns(uint); function getPetByIndex(address _owner, uint _index) constant public returns(uint); function getTotalPetCardSeries() constant public returns (uint8); function getTotalPets() constant public returns (uint); } contract Pets is AccessControl, SafeMath { // Addresses for other contracts Pets interacts with. address public petCardDataContract = 0xB340686da996b8B3d486b4D27E38E38500A9E926; address public ABTokenDataContract = 0xDC32FF5aaDA11b5cE3CAf2D00459cfDA05293F96; uint16 public maxRetireAura = 30; uint16 public minRetireAura = 10; uint64 public breedingDelay = 0; uint64 public breedingPrice = 0; uint8 public upgradeChance = 17; uint8 public bigAuraRand = 100; uint8 public smallAuraRand = 50; uint16 public elementalThreshold = 300; /*** DATA TYPES ***/ //Main ABCard Struct, but only using values used in this contract. struct ABCard { uint256 tokenId; uint8 cardSeriesId; //This is 0 to 23 for angels, 24 to 42 for pets, 43 to 60 for accessories, 61 to 72 for medals uint16 power; //This number is luck for pets and battlepower for angels uint16 auraRed; uint16 auraYellow; uint16 auraBlue; string name; uint64 lastBattleTime; } // write functions function DataContacts(address _petCardDataContract, address _ABTokenDataContract) onlyCREATOR external { } function setParameters(uint16 _minRetireAura, uint16 _maxRetireAura, uint64 _breedingDelay, uint64 _breedingPrice, uint8 _upgradeChance, uint8 _bigAuraRand, uint8 _smallAuraRand) onlyCREATOR external { } function getParameters() view external returns (uint16 _minRetireAura, uint16 _maxRetireAura, uint64 _breedingDelay, uint64 _breedingPrice, uint8 _upgradeChance, uint8 _bigAuraRand, uint8 _smallAuraRand) { } //Non-721 Retirement functions ///////////////////////////////////////////////// function checkPet (uint64 petID) private constant returns (uint8) { } function retireLegacyPets(uint64 pet1, uint64 pet2, uint64 pet3, uint64 pet4, uint64 pet5, uint64 pet6) public { } //721 Retirement Functions ////////////////////////////////////////////////// function check721Pet (uint256 petId) private constant returns (uint8) { } function retirePets(uint256 pet1, uint256 pet2, uint256 pet3, uint256 pet4, uint256 pet5, uint256 pet6) public { } //Used for both 721 and legacy retirements. //////////////////////////////////////// function getNewPetCard(uint8 seriesId, uint8 _luck) private { } //////////////////////////////////////////////////////////////////////////////////////////// // Get level 1 pets ////// //////////////////////////////////////////////////////////////////////////////////////////// function getLevelFreePet(uint8 petSeriesId) public { } //////////////////////////////////////////////////////////////////////////////////////////// // Breeding Functions ////// //////////////////////////////////////////////////////////////////////////////////////////// function BreedElemental (uint16 pet1Red, uint16 pet2Red, uint16 pet1Yellow, uint16 pet2Yellow, uint16 pet1Blue, uint16 pet2Blue) private { } function Breed (uint256 pet1Id, uint256 pet2Id) external payable { } function getNewPetSeries (uint8 pet1CardSeries, uint8 pet2CardSeries) private returns (uint8 newPetLineToCreate, uint16 newPetPowerToCreate) { } //////////////// function findNewPetType (uint16 _newPetPower, uint8 _newPetLine) private returns (uint8 newPetLine, uint16 newPetPower) { } //////////////// function findAuras (uint16 pet1Aura, uint16 pet2Aura) private returns (uint16) { } //////////////// function setNewPetLastBreedingTime () private { } function withdrawEther() external onlyCREATOR { } function kill() onlyCREATOR external { } }
seraphims[msg.sender]==true
34,412
seraphims[msg.sender]==true
null
pragma solidity ^0.4.24; contract AccessControl { address public creatorAddress; uint16 public totalSeraphims = 0; mapping (address => bool) public seraphims; bool public isMaintenanceMode = true; modifier onlyCREATOR() { } modifier onlySERAPHIM() { } modifier isContractActive { require(<FILL_ME>) _; } // Constructor constructor() public { } function addSERAPHIM(address _newSeraphim) onlyCREATOR public { } function removeSERAPHIM(address _oldSeraphim) onlyCREATOR public { } function updateMaintenanceMode(bool _isMaintaining) onlyCREATOR public { } } pragma solidity ^0.4.16; contract SafeMath { function safeAdd(uint x, uint y) pure internal returns(uint) { } function safeSubtract(uint x, uint y) pure internal returns(uint) { } function safeMult(uint x, uint y) pure internal returns(uint) { } function safeDiv(uint256 a, uint256 b) internal pure returns (uint256) { } function getRandomNumber(uint16 maxRandom, uint16 min, address privateAddress) constant public returns(uint8) { } } contract Enums { enum ResultCode { SUCCESS, ERROR_CLASS_NOT_FOUND, ERROR_LOW_BALANCE, ERROR_SEND_FAIL, ERROR_NOT_OWNER, ERROR_NOT_ENOUGH_MONEY, ERROR_INVALID_AMOUNT } enum AngelAura { Blue, Yellow, Purple, Orange, Red, Green } } contract IABToken is AccessControl { function balanceOf(address owner) public view returns (uint256); function totalSupply() external view returns (uint256) ; function ownerOf(uint256 tokenId) public view returns (address) ; function setMaxAngels() external; function setMaxAccessories() external; function setMaxMedals() external ; function initAngelPrices() external; function initAccessoryPrices() external ; function setCardSeriesPrice(uint8 _cardSeriesId, uint _newPrice) external; function approve(address to, uint256 tokenId) public; function getRandomNumber(uint16 maxRandom, uint8 min, address privateAddress) view public returns(uint8) ; function tokenURI(uint256 _tokenId) public pure returns (string memory) ; function baseTokenURI() public pure returns (string memory) ; function name() external pure returns (string memory _name) ; function symbol() external pure returns (string memory _symbol) ; function getApproved(uint256 tokenId) public view returns (address) ; function setApprovalForAll(address to, bool approved) public ; function isApprovedForAll(address owner, address operator) public view returns (bool); function transferFrom(address from, address to, uint256 tokenId) public ; function safeTransferFrom(address from, address to, uint256 tokenId) public ; function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) public ; function _exists(uint256 tokenId) internal view returns (bool) ; function _isApprovedOrOwner(address spender, uint256 tokenId) internal view returns (bool) ; function _mint(address to, uint256 tokenId) internal ; function mintABToken(address owner, uint8 _cardSeriesId, uint16 _power, uint16 _auraRed, uint16 _auraYellow, uint16 _auraBlue, string memory _name, uint16 _experience, uint16 _oldId) public; function addABTokenIdMapping(address _owner, uint256 _tokenId) private ; function getPrice(uint8 _cardSeriesId) public view returns (uint); function buyAngel(uint8 _angelSeriesId) public payable ; function buyAccessory(uint8 _accessorySeriesId) public payable ; function getAura(uint8 _angelSeriesId) pure public returns (uint8 auraRed, uint8 auraYellow, uint8 auraBlue) ; function getAngelPower(uint8 _angelSeriesId) private view returns (uint16) ; function getABToken(uint256 tokenId) view public returns(uint8 cardSeriesId, uint16 power, uint16 auraRed, uint16 auraYellow, uint16 auraBlue, string memory name, uint16 experience, uint64 lastBattleTime, uint16 lastBattleResult, address owner, uint16 oldId); function setAuras(uint256 tokenId, uint16 _red, uint16 _blue, uint16 _yellow) external; function setName(uint256 tokenId,string memory namechange) public ; function setExperience(uint256 tokenId, uint16 _experience) external; function setLastBattleResult(uint256 tokenId, uint16 _result) external ; function setLastBattleTime(uint256 tokenId) external; function setLastBreedingTime(uint256 tokenId) external ; function setoldId(uint256 tokenId, uint16 _oldId) external; function getABTokenByIndex(address _owner, uint64 _index) view external returns(uint256) ; function _burn(address owner, uint256 tokenId) internal ; function _burn(uint256 tokenId) internal ; function _transferFrom(address from, address to, uint256 tokenId) internal ; function _checkOnERC721Received(address from, address to, uint256 tokenId, bytes memory _data) internal returns (bool); function _clearApproval(uint256 tokenId) private ; } contract IPetCardData is AccessControl, Enums { uint8 public totalPetCardSeries; uint64 public totalPets; // write function createPetCardSeries(uint8 _petCardSeriesId, uint32 _maxTotal) onlyCREATOR public returns(uint8); function setPet(uint8 _petCardSeriesId, address _owner, string _name, uint8 _luck, uint16 _auraRed, uint16 _auraYellow, uint16 _auraBlue) onlySERAPHIM external returns(uint64); function setPetAuras(uint64 _petId, uint8 _auraRed, uint8 _auraBlue, uint8 _auraYellow) onlySERAPHIM external; function setPetLastTrainingTime(uint64 _petId) onlySERAPHIM external; function setPetLastBreedingTime(uint64 _petId) onlySERAPHIM external; function addPetIdMapping(address _owner, uint64 _petId) private; function transferPet(address _from, address _to, uint64 _petId) onlySERAPHIM public returns(ResultCode); function ownerPetTransfer (address _to, uint64 _petId) public; function setPetName(string _name, uint64 _petId) public; // read function getPetCardSeries(uint8 _petCardSeriesId) constant public returns(uint8 petCardSeriesId, uint32 currentPetTotal, uint32 maxPetTotal); function getPet(uint _petId) constant public returns(uint petId, uint8 petCardSeriesId, string name, uint8 luck, uint16 auraRed, uint16 auraBlue, uint16 auraYellow, uint64 lastTrainingTime, uint64 lastBreedingTime, address owner); function getOwnerPetCount(address _owner) constant public returns(uint); function getPetByIndex(address _owner, uint _index) constant public returns(uint); function getTotalPetCardSeries() constant public returns (uint8); function getTotalPets() constant public returns (uint); } contract Pets is AccessControl, SafeMath { // Addresses for other contracts Pets interacts with. address public petCardDataContract = 0xB340686da996b8B3d486b4D27E38E38500A9E926; address public ABTokenDataContract = 0xDC32FF5aaDA11b5cE3CAf2D00459cfDA05293F96; uint16 public maxRetireAura = 30; uint16 public minRetireAura = 10; uint64 public breedingDelay = 0; uint64 public breedingPrice = 0; uint8 public upgradeChance = 17; uint8 public bigAuraRand = 100; uint8 public smallAuraRand = 50; uint16 public elementalThreshold = 300; /*** DATA TYPES ***/ //Main ABCard Struct, but only using values used in this contract. struct ABCard { uint256 tokenId; uint8 cardSeriesId; //This is 0 to 23 for angels, 24 to 42 for pets, 43 to 60 for accessories, 61 to 72 for medals uint16 power; //This number is luck for pets and battlepower for angels uint16 auraRed; uint16 auraYellow; uint16 auraBlue; string name; uint64 lastBattleTime; } // write functions function DataContacts(address _petCardDataContract, address _ABTokenDataContract) onlyCREATOR external { } function setParameters(uint16 _minRetireAura, uint16 _maxRetireAura, uint64 _breedingDelay, uint64 _breedingPrice, uint8 _upgradeChance, uint8 _bigAuraRand, uint8 _smallAuraRand) onlyCREATOR external { } function getParameters() view external returns (uint16 _minRetireAura, uint16 _maxRetireAura, uint64 _breedingDelay, uint64 _breedingPrice, uint8 _upgradeChance, uint8 _bigAuraRand, uint8 _smallAuraRand) { } //Non-721 Retirement functions ///////////////////////////////////////////////// function checkPet (uint64 petID) private constant returns (uint8) { } function retireLegacyPets(uint64 pet1, uint64 pet2, uint64 pet3, uint64 pet4, uint64 pet5, uint64 pet6) public { } //721 Retirement Functions ////////////////////////////////////////////////// function check721Pet (uint256 petId) private constant returns (uint8) { } function retirePets(uint256 pet1, uint256 pet2, uint256 pet3, uint256 pet4, uint256 pet5, uint256 pet6) public { } //Used for both 721 and legacy retirements. //////////////////////////////////////// function getNewPetCard(uint8 seriesId, uint8 _luck) private { } //////////////////////////////////////////////////////////////////////////////////////////// // Get level 1 pets ////// //////////////////////////////////////////////////////////////////////////////////////////// function getLevelFreePet(uint8 petSeriesId) public { } //////////////////////////////////////////////////////////////////////////////////////////// // Breeding Functions ////// //////////////////////////////////////////////////////////////////////////////////////////// function BreedElemental (uint16 pet1Red, uint16 pet2Red, uint16 pet1Yellow, uint16 pet2Yellow, uint16 pet1Blue, uint16 pet2Blue) private { } function Breed (uint256 pet1Id, uint256 pet2Id) external payable { } function getNewPetSeries (uint8 pet1CardSeries, uint8 pet2CardSeries) private returns (uint8 newPetLineToCreate, uint16 newPetPowerToCreate) { } //////////////// function findNewPetType (uint16 _newPetPower, uint8 _newPetLine) private returns (uint8 newPetLine, uint16 newPetPower) { } //////////////// function findAuras (uint16 pet1Aura, uint16 pet2Aura) private returns (uint16) { } //////////////// function setNewPetLastBreedingTime () private { } function withdrawEther() external onlyCREATOR { } function kill() onlyCREATOR external { } }
!isMaintenanceMode
34,412
!isMaintenanceMode
'Not the owner of this N'
@v4.3.0 pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { } } // ODDBALL // CREATED BY @GERAINTTAYLOR pragma solidity ^0.8.5; pragma experimental ABIEncoderV2; interface NInterface { function ownerOf(uint256 tokenId) external view returns (address owner); } contract CAMOsplinters is Ownable, ERC721Enumerable, ReentrancyGuard { using SafeMath for uint256; using Address for address; address public nAddress = 0x05a46f1E545526FB803FF974C790aCeA34D1f2D6; NInterface nContract = NInterface(nAddress); bool public presaleActive = false; bool public publicSaleActive = false; bool public burnt = false; uint256 public presalePrice = 0.015 ether; uint256 public publicPrice = 0.015 ether; string public baseTokenURI; address public team1Address = 0x8633C9ccBBD3c0B8a8912bDf9db78b9dCcB28d1a; address public team2Address = 0xe16087BeA4471B7a3ea01f1c084b04D19Ada7892; uint256 public constant TEAM_1_SELL_PERCENT = 20; uint256 public constant TEAM_2_SELL_PERCENT = 5; event licenseisLocked(string _licenseText); constructor() ERC721('CAMOsplinters', 'CAMO') { } // Override so the openzeppelin tokenURI() method will use this method to create the full tokenURI instead function _baseURI() internal view virtual override returns (string memory) { } // See which address owns which tokens function tokensOfOwner(address _ownerAddress) public view returns (uint256[] memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } // Exclusive presale minting with N function mintWithN(uint256 _nId) public payable nonReentrant { require(presaleActive, 'Presale not started'); require(msg.value == presalePrice, 'Wrong amount of ETH sent'); require(<FILL_ME>) require(!burnt, 'Contract burnt. No minting can happen'); _safeMint(msg.sender, _nId); sendTeamValue(); } // Standard mint function function mint(uint256 _nId) public payable { } function flipPreSaleState() public onlyOwner { } function flipPublicSaleState() public onlyOwner { } function burn()public onlyOwner { } // Set new baseURI function setBaseURI(string memory _newBaseURI) public onlyOwner { } function withdraw() public onlyOwner { } function sendTeamValue() internal { } function sendValueTo(address to_, uint256 value) internal { } }
nContract.ownerOf(_nId)==msg.sender,'Not the owner of this N'
34,465
nContract.ownerOf(_nId)==msg.sender
'Contract burnt. No minting can happen'
@v4.3.0 pragma solidity ^0.8.0; /** * @dev Contract module that helps prevent reentrant calls to a function. * * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier * available, which can be applied to functions to make sure there are no nested * (reentrant) calls to them. * * Note that because there is a single `nonReentrant` guard, functions marked as * `nonReentrant` may not call one another. This can be worked around by making * those functions `private`, and then adding `external` `nonReentrant` entry * points to them. * * TIP: If you would like to learn more about reentrancy and alternative ways * to protect against it, check out our blog post * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul]. */ abstract contract ReentrancyGuard { // Booleans are more expensive than uint256 or any type that takes up a full // word because each write operation emits an extra SLOAD to first read the // slot's contents, replace the bits taken up by the boolean, and then write // back. This is the compiler's defense against contract upgrades and // pointer aliasing, and it cannot be disabled. // The values being non-zero value makes deployment a bit more expensive, // but in exchange the refund on every call to nonReentrant will be lower in // amount. Since refunds are capped to a percentage of the total // transaction's gas, it is best to keep them low in cases like this one, to // increase the likelihood of the full refund coming into effect. uint256 private constant _NOT_ENTERED = 1; uint256 private constant _ENTERED = 2; uint256 private _status; constructor() { } /** * @dev Prevents a contract from calling itself, directly or indirectly. * Calling a `nonReentrant` function from another `nonReentrant` * function is not supported. It is possible to prevent this from happening * by making the `nonReentrant` function external, and make it call a * `private` function that does the actual work. */ modifier nonReentrant() { } } // ODDBALL // CREATED BY @GERAINTTAYLOR pragma solidity ^0.8.5; pragma experimental ABIEncoderV2; interface NInterface { function ownerOf(uint256 tokenId) external view returns (address owner); } contract CAMOsplinters is Ownable, ERC721Enumerable, ReentrancyGuard { using SafeMath for uint256; using Address for address; address public nAddress = 0x05a46f1E545526FB803FF974C790aCeA34D1f2D6; NInterface nContract = NInterface(nAddress); bool public presaleActive = false; bool public publicSaleActive = false; bool public burnt = false; uint256 public presalePrice = 0.015 ether; uint256 public publicPrice = 0.015 ether; string public baseTokenURI; address public team1Address = 0x8633C9ccBBD3c0B8a8912bDf9db78b9dCcB28d1a; address public team2Address = 0xe16087BeA4471B7a3ea01f1c084b04D19Ada7892; uint256 public constant TEAM_1_SELL_PERCENT = 20; uint256 public constant TEAM_2_SELL_PERCENT = 5; event licenseisLocked(string _licenseText); constructor() ERC721('CAMOsplinters', 'CAMO') { } // Override so the openzeppelin tokenURI() method will use this method to create the full tokenURI instead function _baseURI() internal view virtual override returns (string memory) { } // See which address owns which tokens function tokensOfOwner(address _ownerAddress) public view returns (uint256[] memory) { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } // Exclusive presale minting with N function mintWithN(uint256 _nId) public payable nonReentrant { require(presaleActive, 'Presale not started'); require(msg.value == presalePrice, 'Wrong amount of ETH sent'); require(nContract.ownerOf(_nId) == msg.sender, 'Not the owner of this N'); require(<FILL_ME>) _safeMint(msg.sender, _nId); sendTeamValue(); } // Standard mint function function mint(uint256 _nId) public payable { } function flipPreSaleState() public onlyOwner { } function flipPublicSaleState() public onlyOwner { } function burn()public onlyOwner { } // Set new baseURI function setBaseURI(string memory _newBaseURI) public onlyOwner { } function withdraw() public onlyOwner { } function sendTeamValue() internal { } function sendValueTo(address to_, uint256 value) internal { } }
!burnt,'Contract burnt. No minting can happen'
34,465
!burnt
"Reading bytes out of bounds"
pragma solidity ^0.5.12; contract BytesUtils { function readBytes32(bytes memory data, uint256 index) internal pure returns (bytes32 o) { require(<FILL_ME>) assembly { o := mload(add(data, add(32, mul(32, index)))) } } function read(bytes memory data, uint256 offset, uint256 length) internal pure returns (bytes32 o) { } function decode( bytes memory _data, uint256 _la ) internal pure returns (bytes32 _a) { } function decode( bytes memory _data, uint256 _la, uint256 _lb ) internal pure returns (bytes32 _a, bytes32 _b) { } function decode( bytes memory _data, uint256 _la, uint256 _lb, uint256 _lc ) internal pure returns (bytes32 _a, bytes32 _b, bytes32 _c) { } function decode( bytes memory _data, uint256 _la, uint256 _lb, uint256 _lc, uint256 _ld ) internal pure returns (bytes32 _a, bytes32 _b, bytes32 _c, bytes32 _d) { } function decode( bytes memory _data, uint256 _la, uint256 _lb, uint256 _lc, uint256 _ld, uint256 _le ) internal pure returns (bytes32 _a, bytes32 _b, bytes32 _c, bytes32 _d, bytes32 _e) { } function decode( bytes memory _data, uint256 _la, uint256 _lb, uint256 _lc, uint256 _ld, uint256 _le, uint256 _lf ) internal pure returns ( bytes32 _a, bytes32 _b, bytes32 _c, bytes32 _d, bytes32 _e, bytes32 _f ) { } }
data.length/32>index,"Reading bytes out of bounds"
34,494
data.length/32>index
"The approved amount should be more than swap amount"
// SPDX-License-Identifier: MIT pragma solidity ^0.7.6; pragma experimental ABIEncoderV2; import "./Context.sol"; import "./Address.sol"; import "./Ownable.sol"; import "./IERC20.sol"; import "./SafeERC20.sol"; import "./SafeMath.sol"; import "./IUniswapV2Pair.sol"; interface TokenInterface is IERC20 { function deposit() external payable; function withdraw(uint256) external; } contract Swap is Ownable { using SafeMath for uint256; using SafeERC20 for IERC20; using SafeERC20 for TokenInterface; uint256 private feePercent; TokenInterface private _weth; event SetFeePercent(uint256 oldFeePercent, uint256 newFeePercent); event OrderSwap( uint256 orderId, address userAddress, address baseToken, address quoteToken, uint256 swapAmount, uint256 outAmount, uint256 feeAmount ); struct Pair { address pair; address tokenIn; address tokenOut; bool isReserveIn; } struct Rooter { uint256 orderId; address userAddress; uint256 inputAmount; Pair[] pairList; } constructor() { } receive() external payable {} function getFeePercent() public view returns (uint256) { } function setFeePercent(uint256 newFeePercent) external onlyOwner { } function getFeeAmount(address tokenAddress) public view returns (uint256) { } function adminWithdraw(address tokenAddress, address withdrawAddress) external onlyOwner { } function _getAmountOut( bool isReserveIn, uint256 amountIn, uint256 reserveIn, uint256 reserveOut ) internal pure returns (uint256 amountOut) { } function _uniswapV2Swap( uint256 inputAmount, Pair memory pairInfo ) internal { } function _swapTokenToToken( uint256 amountIn, Pair memory pairInfo ) internal returns (uint256 outputAmount) { } function orderSwap( Rooter memory orderRouter ) external { uint8 pairLength = uint8(orderRouter.pairList.length); uint256 amountIn = orderRouter.inputAmount; TokenInterface baseToken = TokenInterface(orderRouter.pairList[0].tokenIn); TokenInterface quoteToken = TokenInterface(orderRouter.pairList[pairLength - 1].tokenOut); // Check Approve require(<FILL_ME>) // TransferFrom User Address to Contract baseToken.safeTransferFrom( orderRouter.userAddress, address(this), amountIn ); for (uint8 i = 0; i < pairLength; i += 1) { amountIn = _swapTokenToToken( amountIn, orderRouter.pairList[i] ); } // Check Fee uint256 feeAmount = amountIn.mul(feePercent).div(10000); uint256 userAmount = amountIn.sub(feeAmount); // Transfer To User quoteToken.safeTransfer(orderRouter.userAddress, userAmount); // Emit the event emit OrderSwap( orderRouter.orderId, orderRouter.userAddress, address(baseToken), address(quoteToken), orderRouter.inputAmount, userAmount, feeAmount ); } }
baseToken.allowance(orderRouter.userAddress,address(this))>=orderRouter.inputAmount,"The approved amount should be more than swap amount"
34,627
baseToken.allowance(orderRouter.userAddress,address(this))>=orderRouter.inputAmount
null
pragma solidity ^0.4.4; /** * @title ERC20 interface * see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { uint public totalSupply; uint public decimals; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } /** * @title Ownable * The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { /* Current Owner */ address public owner; /* New owner which can be set in future */ address public newOwner; /* event to indicate finally ownership has been succesfully transferred and accepted */ event OwnershipTransferred(address indexed _from, address indexed _to); /** * The Ownable constructor sets the original `owner` of the contract to the sender account. */ function Ownable() { } /** * Throws if called by any account other than the owner. */ modifier onlyOwner { } /** * 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 { } /** * Allows the new owner toaccept ownership */ function acceptOwnership() { } } /* *This library is used to do mathematics safely */ contract SafeMathLib { function safeMul(uint a, uint b) returns (uint) { } function safeSub(uint a, uint b) returns (uint) { } function safeAdd(uint a, uint b) returns (uint) { } } /** * Upgrade agent interface inspired by Lunyr. * Taken and inspired from https://tokenmarket.net * * Upgrade agent transfers tokens to a new version of a token contract. * Upgrade agent can be set on a token by the upgrade master. * * Steps are * - Upgradeabletoken.upgradeMaster calls UpgradeableToken.setUpgradeAgent() * - Individual token holders can now call UpgradeableToken.upgrade() * -> This results to call UpgradeAgent.upgradeFrom() that issues new tokens * -> UpgradeableToken.upgrade() reduces the original total supply based on amount of upgraded tokens * * Upgrade agent itself can be the token contract, or just a middle man contract doing the heavy lifting. */ contract UpgradeAgent { uint public originalSupply; /** Interface marker */ function isUpgradeAgent() public constant returns (bool) { } /** * Upgrade amount of tokens to a new version. * * Only callable by UpgradeableToken. * * @param _tokenHolder Address that wants to upgrade its tokens * @param _amount Number of tokens to upgrade. The address may consider to hold back some amount of tokens in the old version. */ function upgradeFrom(address _tokenHolder, uint256 _amount) external; } /** * Standard ERC20 token with Short Hand Attack and approve() race condition mitigation. * * Based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, SafeMathLib { /* Actual balances of token holders */ mapping(address => uint) balances; /* approve() allowances */ mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } /** * A token upgrade mechanism where users can opt-in amount of tokens to the next smart contract revision. * First envisioned by Golem and Lunyr projects. * Taken and inspired from https://tokenmarket.net */ contract TCAUpgradeableToken is StandardToken { /** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */ address public upgradeMaster; /** The next contract where the tokens will be migrated. */ UpgradeAgent public upgradeAgent; /** How many tokens we have upgraded by now. */ uint256 public totalUpgraded; /** * Upgrade states. * * - NotAllowed: The child contract has not reached a condition where the upgrade can bgun * - WaitingForAgent: Token allows upgrade, but we don't have a new agent yet * - ReadyToUpgrade: The agent is set, but not a single token has been upgraded yet * - Upgrading: Upgrade agent is set and the balance holders can upgrade their tokens * */ enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading} /** * Somebody has upgraded some of his tokens. */ event Upgrade(address indexed _from, address indexed _to, uint256 _value); /** * New upgrade agent available. */ event UpgradeAgentSet(address agent); /** * Do not allow construction without upgrade master set. */ function TCAUpgradeableToken(address _upgradeMaster) { } /** * Allow the token holder to upgrade some of their tokens to a new contract. */ function upgrade(uint256 value) public { } /** * Set an upgrade agent that handles */ function setUpgradeAgent(address agent) external { // The token is not yet in a state that we could think upgrading require(<FILL_ME>) require(agent != 0x0); // Only a master can designate the next agent require(msg.sender == upgradeMaster); // Upgrade has already begun for an agent require(getUpgradeState() != UpgradeState.Upgrading); upgradeAgent = UpgradeAgent(agent); // Bad interface require(upgradeAgent.isUpgradeAgent()); // Make sure that token supplies match in source and target require(upgradeAgent.originalSupply() == totalSupply); UpgradeAgentSet(upgradeAgent); } /** * Get the state of the token upgrade. */ function getUpgradeState() public constant returns(UpgradeState) { } /** * Change the upgrade master. * * This allows us to set a new owner for the upgrade mechanism. */ function setUpgradeMaster(address master) public { } /** * Child contract can enable to provide the condition when the upgrade can begun. */ function canUpgrade() public constant returns(bool) { } } /** * Define interface for releasing the token transfer after a successful crowdsale. * Taken and inspired from https://tokenmarket.net */ contract ReleasableToken is ERC20, Ownable { /* The finalizer contract that allows unlift the transfer limits on this token */ address public releaseAgent; /** A crowdsale contract can release us to the wild if ICO success. If false we are are in transfer lock up period.*/ bool public released = false; /** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */ mapping (address => bool) public transferAgents; /** * Limit token transfer until the crowdsale is over. * */ modifier canTransfer(address _sender) { } /** * Set the contract that can call release and make the token transferable. */ function setReleaseAgent(address addr) onlyOwner inReleaseState(false) public { } /** * Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period. */ function setTransferAgent(address addr, bool state) onlyOwner inReleaseState(false) public { } /** * One way function to release the tokens to the wild. * * Can be called only from the release agent that is the final ICO contract. It is only called if the crowdsale has been success (first milestone reached). */ function releaseTokenTransfer() public onlyReleaseAgent { } /** The function can be called only before or after the tokens have been releasesd */ modifier inReleaseState(bool releaseState) { } /** The function can be called only by a whitelisted release agent. */ modifier onlyReleaseAgent() { } function transfer(address _to, uint _value) canTransfer(msg.sender) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) canTransfer(_from) returns (bool success) { } } contract Coin is TCAUpgradeableToken, ReleasableToken { event UpdatedTokenInformation(string newName, string newSymbol); /* name of the token */ string public name = "TheCurrencyAnalytics"; /* symbol of the token */ string public symbol = "TCAT"; /* token decimals to handle fractions */ uint public decimals = 18; //Crowdsale running bool public isCrowdsaleOpen=false; /* initial token supply */ uint public totalSupply = 400000000 * (10 ** decimals); uint public onSaleTokens = 200000000 * (10 ** decimals); uint tokensForPublicSale = 0; address contractAddress; uint256 pricePerToken = 2860; //1 Eth = 2860 TCAT uint minETH = 0 * 10**decimals; // 0 ether uint maxETH = 15 * 10**decimals; // 15 ether function Coin() TCAUpgradeableToken(msg.sender) { } /* function to update token name and symbol */ function updateTokenInformation(string _name, string _symbol) onlyOwner { } function sendTokensToOwner(uint _tokens) onlyOwner returns (bool ok){ } /* single address */ function sendTokensToInvestors(address _investor, uint _tokens) onlyOwner returns (bool ok){ } /* A dispense feature to allocate some addresses with TCA tokens * calculation done using token count * Can be called only by owner */ function dispenseTokensToInvestorAddressesByValue(address[] _addresses, uint[] _value) onlyOwner returns (bool ok){ } function startCrowdSale() onlyOwner { } function stopCrowdSale() onlyOwner { } function setPublicSaleParams(uint _tokensForPublicSale, uint _min, uint _max, bool _crowdsaleStatus ) onlyOwner { } function setTotalTokensForPublicSale(uint _value) onlyOwner{ } function increaseSupply(uint value) onlyOwner returns (bool) { } function decreaseSupply(uint value) onlyOwner returns (bool) { } function setMinAndMaxEthersForPublicSale(uint _min, uint _max) onlyOwner{ } function updateTokenPrice(uint _value) onlyOwner{ } function updateOnSaleSupply(uint _newSupply) onlyOwner{ } function buyTokens() public payable returns(uint tokenAmount) { } // There is no need for vesting. It will be done manually by manually releasing tokens to certain addresses function() payable { } function destroyToken() public onlyOwner { } }
canUpgrade()
34,725
canUpgrade()
null
pragma solidity ^0.4.4; /** * @title ERC20 interface * see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { uint public totalSupply; uint public decimals; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } /** * @title Ownable * The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { /* Current Owner */ address public owner; /* New owner which can be set in future */ address public newOwner; /* event to indicate finally ownership has been succesfully transferred and accepted */ event OwnershipTransferred(address indexed _from, address indexed _to); /** * The Ownable constructor sets the original `owner` of the contract to the sender account. */ function Ownable() { } /** * Throws if called by any account other than the owner. */ modifier onlyOwner { } /** * 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 { } /** * Allows the new owner toaccept ownership */ function acceptOwnership() { } } /* *This library is used to do mathematics safely */ contract SafeMathLib { function safeMul(uint a, uint b) returns (uint) { } function safeSub(uint a, uint b) returns (uint) { } function safeAdd(uint a, uint b) returns (uint) { } } /** * Upgrade agent interface inspired by Lunyr. * Taken and inspired from https://tokenmarket.net * * Upgrade agent transfers tokens to a new version of a token contract. * Upgrade agent can be set on a token by the upgrade master. * * Steps are * - Upgradeabletoken.upgradeMaster calls UpgradeableToken.setUpgradeAgent() * - Individual token holders can now call UpgradeableToken.upgrade() * -> This results to call UpgradeAgent.upgradeFrom() that issues new tokens * -> UpgradeableToken.upgrade() reduces the original total supply based on amount of upgraded tokens * * Upgrade agent itself can be the token contract, or just a middle man contract doing the heavy lifting. */ contract UpgradeAgent { uint public originalSupply; /** Interface marker */ function isUpgradeAgent() public constant returns (bool) { } /** * Upgrade amount of tokens to a new version. * * Only callable by UpgradeableToken. * * @param _tokenHolder Address that wants to upgrade its tokens * @param _amount Number of tokens to upgrade. The address may consider to hold back some amount of tokens in the old version. */ function upgradeFrom(address _tokenHolder, uint256 _amount) external; } /** * Standard ERC20 token with Short Hand Attack and approve() race condition mitigation. * * Based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, SafeMathLib { /* Actual balances of token holders */ mapping(address => uint) balances; /* approve() allowances */ mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } /** * A token upgrade mechanism where users can opt-in amount of tokens to the next smart contract revision. * First envisioned by Golem and Lunyr projects. * Taken and inspired from https://tokenmarket.net */ contract TCAUpgradeableToken is StandardToken { /** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */ address public upgradeMaster; /** The next contract where the tokens will be migrated. */ UpgradeAgent public upgradeAgent; /** How many tokens we have upgraded by now. */ uint256 public totalUpgraded; /** * Upgrade states. * * - NotAllowed: The child contract has not reached a condition where the upgrade can bgun * - WaitingForAgent: Token allows upgrade, but we don't have a new agent yet * - ReadyToUpgrade: The agent is set, but not a single token has been upgraded yet * - Upgrading: Upgrade agent is set and the balance holders can upgrade their tokens * */ enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading} /** * Somebody has upgraded some of his tokens. */ event Upgrade(address indexed _from, address indexed _to, uint256 _value); /** * New upgrade agent available. */ event UpgradeAgentSet(address agent); /** * Do not allow construction without upgrade master set. */ function TCAUpgradeableToken(address _upgradeMaster) { } /** * Allow the token holder to upgrade some of their tokens to a new contract. */ function upgrade(uint256 value) public { } /** * Set an upgrade agent that handles */ function setUpgradeAgent(address agent) external { // The token is not yet in a state that we could think upgrading require(canUpgrade()); require(agent != 0x0); // Only a master can designate the next agent require(msg.sender == upgradeMaster); // Upgrade has already begun for an agent require(<FILL_ME>) upgradeAgent = UpgradeAgent(agent); // Bad interface require(upgradeAgent.isUpgradeAgent()); // Make sure that token supplies match in source and target require(upgradeAgent.originalSupply() == totalSupply); UpgradeAgentSet(upgradeAgent); } /** * Get the state of the token upgrade. */ function getUpgradeState() public constant returns(UpgradeState) { } /** * Change the upgrade master. * * This allows us to set a new owner for the upgrade mechanism. */ function setUpgradeMaster(address master) public { } /** * Child contract can enable to provide the condition when the upgrade can begun. */ function canUpgrade() public constant returns(bool) { } } /** * Define interface for releasing the token transfer after a successful crowdsale. * Taken and inspired from https://tokenmarket.net */ contract ReleasableToken is ERC20, Ownable { /* The finalizer contract that allows unlift the transfer limits on this token */ address public releaseAgent; /** A crowdsale contract can release us to the wild if ICO success. If false we are are in transfer lock up period.*/ bool public released = false; /** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */ mapping (address => bool) public transferAgents; /** * Limit token transfer until the crowdsale is over. * */ modifier canTransfer(address _sender) { } /** * Set the contract that can call release and make the token transferable. */ function setReleaseAgent(address addr) onlyOwner inReleaseState(false) public { } /** * Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period. */ function setTransferAgent(address addr, bool state) onlyOwner inReleaseState(false) public { } /** * One way function to release the tokens to the wild. * * Can be called only from the release agent that is the final ICO contract. It is only called if the crowdsale has been success (first milestone reached). */ function releaseTokenTransfer() public onlyReleaseAgent { } /** The function can be called only before or after the tokens have been releasesd */ modifier inReleaseState(bool releaseState) { } /** The function can be called only by a whitelisted release agent. */ modifier onlyReleaseAgent() { } function transfer(address _to, uint _value) canTransfer(msg.sender) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) canTransfer(_from) returns (bool success) { } } contract Coin is TCAUpgradeableToken, ReleasableToken { event UpdatedTokenInformation(string newName, string newSymbol); /* name of the token */ string public name = "TheCurrencyAnalytics"; /* symbol of the token */ string public symbol = "TCAT"; /* token decimals to handle fractions */ uint public decimals = 18; //Crowdsale running bool public isCrowdsaleOpen=false; /* initial token supply */ uint public totalSupply = 400000000 * (10 ** decimals); uint public onSaleTokens = 200000000 * (10 ** decimals); uint tokensForPublicSale = 0; address contractAddress; uint256 pricePerToken = 2860; //1 Eth = 2860 TCAT uint minETH = 0 * 10**decimals; // 0 ether uint maxETH = 15 * 10**decimals; // 15 ether function Coin() TCAUpgradeableToken(msg.sender) { } /* function to update token name and symbol */ function updateTokenInformation(string _name, string _symbol) onlyOwner { } function sendTokensToOwner(uint _tokens) onlyOwner returns (bool ok){ } /* single address */ function sendTokensToInvestors(address _investor, uint _tokens) onlyOwner returns (bool ok){ } /* A dispense feature to allocate some addresses with TCA tokens * calculation done using token count * Can be called only by owner */ function dispenseTokensToInvestorAddressesByValue(address[] _addresses, uint[] _value) onlyOwner returns (bool ok){ } function startCrowdSale() onlyOwner { } function stopCrowdSale() onlyOwner { } function setPublicSaleParams(uint _tokensForPublicSale, uint _min, uint _max, bool _crowdsaleStatus ) onlyOwner { } function setTotalTokensForPublicSale(uint _value) onlyOwner{ } function increaseSupply(uint value) onlyOwner returns (bool) { } function decreaseSupply(uint value) onlyOwner returns (bool) { } function setMinAndMaxEthersForPublicSale(uint _min, uint _max) onlyOwner{ } function updateTokenPrice(uint _value) onlyOwner{ } function updateOnSaleSupply(uint _newSupply) onlyOwner{ } function buyTokens() public payable returns(uint tokenAmount) { } // There is no need for vesting. It will be done manually by manually releasing tokens to certain addresses function() payable { } function destroyToken() public onlyOwner { } }
getUpgradeState()!=UpgradeState.Upgrading
34,725
getUpgradeState()!=UpgradeState.Upgrading
null
pragma solidity ^0.4.4; /** * @title ERC20 interface * see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { uint public totalSupply; uint public decimals; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } /** * @title Ownable * The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { /* Current Owner */ address public owner; /* New owner which can be set in future */ address public newOwner; /* event to indicate finally ownership has been succesfully transferred and accepted */ event OwnershipTransferred(address indexed _from, address indexed _to); /** * The Ownable constructor sets the original `owner` of the contract to the sender account. */ function Ownable() { } /** * Throws if called by any account other than the owner. */ modifier onlyOwner { } /** * 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 { } /** * Allows the new owner toaccept ownership */ function acceptOwnership() { } } /* *This library is used to do mathematics safely */ contract SafeMathLib { function safeMul(uint a, uint b) returns (uint) { } function safeSub(uint a, uint b) returns (uint) { } function safeAdd(uint a, uint b) returns (uint) { } } /** * Upgrade agent interface inspired by Lunyr. * Taken and inspired from https://tokenmarket.net * * Upgrade agent transfers tokens to a new version of a token contract. * Upgrade agent can be set on a token by the upgrade master. * * Steps are * - Upgradeabletoken.upgradeMaster calls UpgradeableToken.setUpgradeAgent() * - Individual token holders can now call UpgradeableToken.upgrade() * -> This results to call UpgradeAgent.upgradeFrom() that issues new tokens * -> UpgradeableToken.upgrade() reduces the original total supply based on amount of upgraded tokens * * Upgrade agent itself can be the token contract, or just a middle man contract doing the heavy lifting. */ contract UpgradeAgent { uint public originalSupply; /** Interface marker */ function isUpgradeAgent() public constant returns (bool) { } /** * Upgrade amount of tokens to a new version. * * Only callable by UpgradeableToken. * * @param _tokenHolder Address that wants to upgrade its tokens * @param _amount Number of tokens to upgrade. The address may consider to hold back some amount of tokens in the old version. */ function upgradeFrom(address _tokenHolder, uint256 _amount) external; } /** * Standard ERC20 token with Short Hand Attack and approve() race condition mitigation. * * Based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, SafeMathLib { /* Actual balances of token holders */ mapping(address => uint) balances; /* approve() allowances */ mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } /** * A token upgrade mechanism where users can opt-in amount of tokens to the next smart contract revision. * First envisioned by Golem and Lunyr projects. * Taken and inspired from https://tokenmarket.net */ contract TCAUpgradeableToken is StandardToken { /** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */ address public upgradeMaster; /** The next contract where the tokens will be migrated. */ UpgradeAgent public upgradeAgent; /** How many tokens we have upgraded by now. */ uint256 public totalUpgraded; /** * Upgrade states. * * - NotAllowed: The child contract has not reached a condition where the upgrade can bgun * - WaitingForAgent: Token allows upgrade, but we don't have a new agent yet * - ReadyToUpgrade: The agent is set, but not a single token has been upgraded yet * - Upgrading: Upgrade agent is set and the balance holders can upgrade their tokens * */ enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading} /** * Somebody has upgraded some of his tokens. */ event Upgrade(address indexed _from, address indexed _to, uint256 _value); /** * New upgrade agent available. */ event UpgradeAgentSet(address agent); /** * Do not allow construction without upgrade master set. */ function TCAUpgradeableToken(address _upgradeMaster) { } /** * Allow the token holder to upgrade some of their tokens to a new contract. */ function upgrade(uint256 value) public { } /** * Set an upgrade agent that handles */ function setUpgradeAgent(address agent) external { // The token is not yet in a state that we could think upgrading require(canUpgrade()); require(agent != 0x0); // Only a master can designate the next agent require(msg.sender == upgradeMaster); // Upgrade has already begun for an agent require(getUpgradeState() != UpgradeState.Upgrading); upgradeAgent = UpgradeAgent(agent); // Bad interface require(<FILL_ME>) // Make sure that token supplies match in source and target require(upgradeAgent.originalSupply() == totalSupply); UpgradeAgentSet(upgradeAgent); } /** * Get the state of the token upgrade. */ function getUpgradeState() public constant returns(UpgradeState) { } /** * Change the upgrade master. * * This allows us to set a new owner for the upgrade mechanism. */ function setUpgradeMaster(address master) public { } /** * Child contract can enable to provide the condition when the upgrade can begun. */ function canUpgrade() public constant returns(bool) { } } /** * Define interface for releasing the token transfer after a successful crowdsale. * Taken and inspired from https://tokenmarket.net */ contract ReleasableToken is ERC20, Ownable { /* The finalizer contract that allows unlift the transfer limits on this token */ address public releaseAgent; /** A crowdsale contract can release us to the wild if ICO success. If false we are are in transfer lock up period.*/ bool public released = false; /** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */ mapping (address => bool) public transferAgents; /** * Limit token transfer until the crowdsale is over. * */ modifier canTransfer(address _sender) { } /** * Set the contract that can call release and make the token transferable. */ function setReleaseAgent(address addr) onlyOwner inReleaseState(false) public { } /** * Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period. */ function setTransferAgent(address addr, bool state) onlyOwner inReleaseState(false) public { } /** * One way function to release the tokens to the wild. * * Can be called only from the release agent that is the final ICO contract. It is only called if the crowdsale has been success (first milestone reached). */ function releaseTokenTransfer() public onlyReleaseAgent { } /** The function can be called only before or after the tokens have been releasesd */ modifier inReleaseState(bool releaseState) { } /** The function can be called only by a whitelisted release agent. */ modifier onlyReleaseAgent() { } function transfer(address _to, uint _value) canTransfer(msg.sender) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) canTransfer(_from) returns (bool success) { } } contract Coin is TCAUpgradeableToken, ReleasableToken { event UpdatedTokenInformation(string newName, string newSymbol); /* name of the token */ string public name = "TheCurrencyAnalytics"; /* symbol of the token */ string public symbol = "TCAT"; /* token decimals to handle fractions */ uint public decimals = 18; //Crowdsale running bool public isCrowdsaleOpen=false; /* initial token supply */ uint public totalSupply = 400000000 * (10 ** decimals); uint public onSaleTokens = 200000000 * (10 ** decimals); uint tokensForPublicSale = 0; address contractAddress; uint256 pricePerToken = 2860; //1 Eth = 2860 TCAT uint minETH = 0 * 10**decimals; // 0 ether uint maxETH = 15 * 10**decimals; // 15 ether function Coin() TCAUpgradeableToken(msg.sender) { } /* function to update token name and symbol */ function updateTokenInformation(string _name, string _symbol) onlyOwner { } function sendTokensToOwner(uint _tokens) onlyOwner returns (bool ok){ } /* single address */ function sendTokensToInvestors(address _investor, uint _tokens) onlyOwner returns (bool ok){ } /* A dispense feature to allocate some addresses with TCA tokens * calculation done using token count * Can be called only by owner */ function dispenseTokensToInvestorAddressesByValue(address[] _addresses, uint[] _value) onlyOwner returns (bool ok){ } function startCrowdSale() onlyOwner { } function stopCrowdSale() onlyOwner { } function setPublicSaleParams(uint _tokensForPublicSale, uint _min, uint _max, bool _crowdsaleStatus ) onlyOwner { } function setTotalTokensForPublicSale(uint _value) onlyOwner{ } function increaseSupply(uint value) onlyOwner returns (bool) { } function decreaseSupply(uint value) onlyOwner returns (bool) { } function setMinAndMaxEthersForPublicSale(uint _min, uint _max) onlyOwner{ } function updateTokenPrice(uint _value) onlyOwner{ } function updateOnSaleSupply(uint _newSupply) onlyOwner{ } function buyTokens() public payable returns(uint tokenAmount) { } // There is no need for vesting. It will be done manually by manually releasing tokens to certain addresses function() payable { } function destroyToken() public onlyOwner { } }
upgradeAgent.isUpgradeAgent()
34,725
upgradeAgent.isUpgradeAgent()
null
pragma solidity ^0.4.4; /** * @title ERC20 interface * see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { uint public totalSupply; uint public decimals; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } /** * @title Ownable * The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { /* Current Owner */ address public owner; /* New owner which can be set in future */ address public newOwner; /* event to indicate finally ownership has been succesfully transferred and accepted */ event OwnershipTransferred(address indexed _from, address indexed _to); /** * The Ownable constructor sets the original `owner` of the contract to the sender account. */ function Ownable() { } /** * Throws if called by any account other than the owner. */ modifier onlyOwner { } /** * 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 { } /** * Allows the new owner toaccept ownership */ function acceptOwnership() { } } /* *This library is used to do mathematics safely */ contract SafeMathLib { function safeMul(uint a, uint b) returns (uint) { } function safeSub(uint a, uint b) returns (uint) { } function safeAdd(uint a, uint b) returns (uint) { } } /** * Upgrade agent interface inspired by Lunyr. * Taken and inspired from https://tokenmarket.net * * Upgrade agent transfers tokens to a new version of a token contract. * Upgrade agent can be set on a token by the upgrade master. * * Steps are * - Upgradeabletoken.upgradeMaster calls UpgradeableToken.setUpgradeAgent() * - Individual token holders can now call UpgradeableToken.upgrade() * -> This results to call UpgradeAgent.upgradeFrom() that issues new tokens * -> UpgradeableToken.upgrade() reduces the original total supply based on amount of upgraded tokens * * Upgrade agent itself can be the token contract, or just a middle man contract doing the heavy lifting. */ contract UpgradeAgent { uint public originalSupply; /** Interface marker */ function isUpgradeAgent() public constant returns (bool) { } /** * Upgrade amount of tokens to a new version. * * Only callable by UpgradeableToken. * * @param _tokenHolder Address that wants to upgrade its tokens * @param _amount Number of tokens to upgrade. The address may consider to hold back some amount of tokens in the old version. */ function upgradeFrom(address _tokenHolder, uint256 _amount) external; } /** * Standard ERC20 token with Short Hand Attack and approve() race condition mitigation. * * Based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, SafeMathLib { /* Actual balances of token holders */ mapping(address => uint) balances; /* approve() allowances */ mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } /** * A token upgrade mechanism where users can opt-in amount of tokens to the next smart contract revision. * First envisioned by Golem and Lunyr projects. * Taken and inspired from https://tokenmarket.net */ contract TCAUpgradeableToken is StandardToken { /** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */ address public upgradeMaster; /** The next contract where the tokens will be migrated. */ UpgradeAgent public upgradeAgent; /** How many tokens we have upgraded by now. */ uint256 public totalUpgraded; /** * Upgrade states. * * - NotAllowed: The child contract has not reached a condition where the upgrade can bgun * - WaitingForAgent: Token allows upgrade, but we don't have a new agent yet * - ReadyToUpgrade: The agent is set, but not a single token has been upgraded yet * - Upgrading: Upgrade agent is set and the balance holders can upgrade their tokens * */ enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading} /** * Somebody has upgraded some of his tokens. */ event Upgrade(address indexed _from, address indexed _to, uint256 _value); /** * New upgrade agent available. */ event UpgradeAgentSet(address agent); /** * Do not allow construction without upgrade master set. */ function TCAUpgradeableToken(address _upgradeMaster) { } /** * Allow the token holder to upgrade some of their tokens to a new contract. */ function upgrade(uint256 value) public { } /** * Set an upgrade agent that handles */ function setUpgradeAgent(address agent) external { // The token is not yet in a state that we could think upgrading require(canUpgrade()); require(agent != 0x0); // Only a master can designate the next agent require(msg.sender == upgradeMaster); // Upgrade has already begun for an agent require(getUpgradeState() != UpgradeState.Upgrading); upgradeAgent = UpgradeAgent(agent); // Bad interface require(upgradeAgent.isUpgradeAgent()); // Make sure that token supplies match in source and target require(<FILL_ME>) UpgradeAgentSet(upgradeAgent); } /** * Get the state of the token upgrade. */ function getUpgradeState() public constant returns(UpgradeState) { } /** * Change the upgrade master. * * This allows us to set a new owner for the upgrade mechanism. */ function setUpgradeMaster(address master) public { } /** * Child contract can enable to provide the condition when the upgrade can begun. */ function canUpgrade() public constant returns(bool) { } } /** * Define interface for releasing the token transfer after a successful crowdsale. * Taken and inspired from https://tokenmarket.net */ contract ReleasableToken is ERC20, Ownable { /* The finalizer contract that allows unlift the transfer limits on this token */ address public releaseAgent; /** A crowdsale contract can release us to the wild if ICO success. If false we are are in transfer lock up period.*/ bool public released = false; /** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */ mapping (address => bool) public transferAgents; /** * Limit token transfer until the crowdsale is over. * */ modifier canTransfer(address _sender) { } /** * Set the contract that can call release and make the token transferable. */ function setReleaseAgent(address addr) onlyOwner inReleaseState(false) public { } /** * Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period. */ function setTransferAgent(address addr, bool state) onlyOwner inReleaseState(false) public { } /** * One way function to release the tokens to the wild. * * Can be called only from the release agent that is the final ICO contract. It is only called if the crowdsale has been success (first milestone reached). */ function releaseTokenTransfer() public onlyReleaseAgent { } /** The function can be called only before or after the tokens have been releasesd */ modifier inReleaseState(bool releaseState) { } /** The function can be called only by a whitelisted release agent. */ modifier onlyReleaseAgent() { } function transfer(address _to, uint _value) canTransfer(msg.sender) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) canTransfer(_from) returns (bool success) { } } contract Coin is TCAUpgradeableToken, ReleasableToken { event UpdatedTokenInformation(string newName, string newSymbol); /* name of the token */ string public name = "TheCurrencyAnalytics"; /* symbol of the token */ string public symbol = "TCAT"; /* token decimals to handle fractions */ uint public decimals = 18; //Crowdsale running bool public isCrowdsaleOpen=false; /* initial token supply */ uint public totalSupply = 400000000 * (10 ** decimals); uint public onSaleTokens = 200000000 * (10 ** decimals); uint tokensForPublicSale = 0; address contractAddress; uint256 pricePerToken = 2860; //1 Eth = 2860 TCAT uint minETH = 0 * 10**decimals; // 0 ether uint maxETH = 15 * 10**decimals; // 15 ether function Coin() TCAUpgradeableToken(msg.sender) { } /* function to update token name and symbol */ function updateTokenInformation(string _name, string _symbol) onlyOwner { } function sendTokensToOwner(uint _tokens) onlyOwner returns (bool ok){ } /* single address */ function sendTokensToInvestors(address _investor, uint _tokens) onlyOwner returns (bool ok){ } /* A dispense feature to allocate some addresses with TCA tokens * calculation done using token count * Can be called only by owner */ function dispenseTokensToInvestorAddressesByValue(address[] _addresses, uint[] _value) onlyOwner returns (bool ok){ } function startCrowdSale() onlyOwner { } function stopCrowdSale() onlyOwner { } function setPublicSaleParams(uint _tokensForPublicSale, uint _min, uint _max, bool _crowdsaleStatus ) onlyOwner { } function setTotalTokensForPublicSale(uint _value) onlyOwner{ } function increaseSupply(uint value) onlyOwner returns (bool) { } function decreaseSupply(uint value) onlyOwner returns (bool) { } function setMinAndMaxEthersForPublicSale(uint _min, uint _max) onlyOwner{ } function updateTokenPrice(uint _value) onlyOwner{ } function updateOnSaleSupply(uint _newSupply) onlyOwner{ } function buyTokens() public payable returns(uint tokenAmount) { } // There is no need for vesting. It will be done manually by manually releasing tokens to certain addresses function() payable { } function destroyToken() public onlyOwner { } }
upgradeAgent.originalSupply()==totalSupply
34,725
upgradeAgent.originalSupply()==totalSupply
null
pragma solidity ^0.4.4; /** * @title ERC20 interface * see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { uint public totalSupply; uint public decimals; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } /** * @title Ownable * The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { /* Current Owner */ address public owner; /* New owner which can be set in future */ address public newOwner; /* event to indicate finally ownership has been succesfully transferred and accepted */ event OwnershipTransferred(address indexed _from, address indexed _to); /** * The Ownable constructor sets the original `owner` of the contract to the sender account. */ function Ownable() { } /** * Throws if called by any account other than the owner. */ modifier onlyOwner { } /** * 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 { } /** * Allows the new owner toaccept ownership */ function acceptOwnership() { } } /* *This library is used to do mathematics safely */ contract SafeMathLib { function safeMul(uint a, uint b) returns (uint) { } function safeSub(uint a, uint b) returns (uint) { } function safeAdd(uint a, uint b) returns (uint) { } } /** * Upgrade agent interface inspired by Lunyr. * Taken and inspired from https://tokenmarket.net * * Upgrade agent transfers tokens to a new version of a token contract. * Upgrade agent can be set on a token by the upgrade master. * * Steps are * - Upgradeabletoken.upgradeMaster calls UpgradeableToken.setUpgradeAgent() * - Individual token holders can now call UpgradeableToken.upgrade() * -> This results to call UpgradeAgent.upgradeFrom() that issues new tokens * -> UpgradeableToken.upgrade() reduces the original total supply based on amount of upgraded tokens * * Upgrade agent itself can be the token contract, or just a middle man contract doing the heavy lifting. */ contract UpgradeAgent { uint public originalSupply; /** Interface marker */ function isUpgradeAgent() public constant returns (bool) { } /** * Upgrade amount of tokens to a new version. * * Only callable by UpgradeableToken. * * @param _tokenHolder Address that wants to upgrade its tokens * @param _amount Number of tokens to upgrade. The address may consider to hold back some amount of tokens in the old version. */ function upgradeFrom(address _tokenHolder, uint256 _amount) external; } /** * Standard ERC20 token with Short Hand Attack and approve() race condition mitigation. * * Based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, SafeMathLib { /* Actual balances of token holders */ mapping(address => uint) balances; /* approve() allowances */ mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } /** * A token upgrade mechanism where users can opt-in amount of tokens to the next smart contract revision. * First envisioned by Golem and Lunyr projects. * Taken and inspired from https://tokenmarket.net */ contract TCAUpgradeableToken is StandardToken { /** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */ address public upgradeMaster; /** The next contract where the tokens will be migrated. */ UpgradeAgent public upgradeAgent; /** How many tokens we have upgraded by now. */ uint256 public totalUpgraded; /** * Upgrade states. * * - NotAllowed: The child contract has not reached a condition where the upgrade can bgun * - WaitingForAgent: Token allows upgrade, but we don't have a new agent yet * - ReadyToUpgrade: The agent is set, but not a single token has been upgraded yet * - Upgrading: Upgrade agent is set and the balance holders can upgrade their tokens * */ enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading} /** * Somebody has upgraded some of his tokens. */ event Upgrade(address indexed _from, address indexed _to, uint256 _value); /** * New upgrade agent available. */ event UpgradeAgentSet(address agent); /** * Do not allow construction without upgrade master set. */ function TCAUpgradeableToken(address _upgradeMaster) { } /** * Allow the token holder to upgrade some of their tokens to a new contract. */ function upgrade(uint256 value) public { } /** * Set an upgrade agent that handles */ function setUpgradeAgent(address agent) external { } /** * Get the state of the token upgrade. */ function getUpgradeState() public constant returns(UpgradeState) { } /** * Change the upgrade master. * * This allows us to set a new owner for the upgrade mechanism. */ function setUpgradeMaster(address master) public { } /** * Child contract can enable to provide the condition when the upgrade can begun. */ function canUpgrade() public constant returns(bool) { } } /** * Define interface for releasing the token transfer after a successful crowdsale. * Taken and inspired from https://tokenmarket.net */ contract ReleasableToken is ERC20, Ownable { /* The finalizer contract that allows unlift the transfer limits on this token */ address public releaseAgent; /** A crowdsale contract can release us to the wild if ICO success. If false we are are in transfer lock up period.*/ bool public released = false; /** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */ mapping (address => bool) public transferAgents; /** * Limit token transfer until the crowdsale is over. * */ modifier canTransfer(address _sender) { if(!released) { require(<FILL_ME>) } _; } /** * Set the contract that can call release and make the token transferable. */ function setReleaseAgent(address addr) onlyOwner inReleaseState(false) public { } /** * Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period. */ function setTransferAgent(address addr, bool state) onlyOwner inReleaseState(false) public { } /** * One way function to release the tokens to the wild. * * Can be called only from the release agent that is the final ICO contract. It is only called if the crowdsale has been success (first milestone reached). */ function releaseTokenTransfer() public onlyReleaseAgent { } /** The function can be called only before or after the tokens have been releasesd */ modifier inReleaseState(bool releaseState) { } /** The function can be called only by a whitelisted release agent. */ modifier onlyReleaseAgent() { } function transfer(address _to, uint _value) canTransfer(msg.sender) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) canTransfer(_from) returns (bool success) { } } contract Coin is TCAUpgradeableToken, ReleasableToken { event UpdatedTokenInformation(string newName, string newSymbol); /* name of the token */ string public name = "TheCurrencyAnalytics"; /* symbol of the token */ string public symbol = "TCAT"; /* token decimals to handle fractions */ uint public decimals = 18; //Crowdsale running bool public isCrowdsaleOpen=false; /* initial token supply */ uint public totalSupply = 400000000 * (10 ** decimals); uint public onSaleTokens = 200000000 * (10 ** decimals); uint tokensForPublicSale = 0; address contractAddress; uint256 pricePerToken = 2860; //1 Eth = 2860 TCAT uint minETH = 0 * 10**decimals; // 0 ether uint maxETH = 15 * 10**decimals; // 15 ether function Coin() TCAUpgradeableToken(msg.sender) { } /* function to update token name and symbol */ function updateTokenInformation(string _name, string _symbol) onlyOwner { } function sendTokensToOwner(uint _tokens) onlyOwner returns (bool ok){ } /* single address */ function sendTokensToInvestors(address _investor, uint _tokens) onlyOwner returns (bool ok){ } /* A dispense feature to allocate some addresses with TCA tokens * calculation done using token count * Can be called only by owner */ function dispenseTokensToInvestorAddressesByValue(address[] _addresses, uint[] _value) onlyOwner returns (bool ok){ } function startCrowdSale() onlyOwner { } function stopCrowdSale() onlyOwner { } function setPublicSaleParams(uint _tokensForPublicSale, uint _min, uint _max, bool _crowdsaleStatus ) onlyOwner { } function setTotalTokensForPublicSale(uint _value) onlyOwner{ } function increaseSupply(uint value) onlyOwner returns (bool) { } function decreaseSupply(uint value) onlyOwner returns (bool) { } function setMinAndMaxEthersForPublicSale(uint _min, uint _max) onlyOwner{ } function updateTokenPrice(uint _value) onlyOwner{ } function updateOnSaleSupply(uint _newSupply) onlyOwner{ } function buyTokens() public payable returns(uint tokenAmount) { } // There is no need for vesting. It will be done manually by manually releasing tokens to certain addresses function() payable { } function destroyToken() public onlyOwner { } }
transferAgents[_sender]
34,725
transferAgents[_sender]
null
pragma solidity ^0.4.4; /** * @title ERC20 interface * see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { uint public totalSupply; uint public decimals; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } /** * @title Ownable * The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { /* Current Owner */ address public owner; /* New owner which can be set in future */ address public newOwner; /* event to indicate finally ownership has been succesfully transferred and accepted */ event OwnershipTransferred(address indexed _from, address indexed _to); /** * The Ownable constructor sets the original `owner` of the contract to the sender account. */ function Ownable() { } /** * Throws if called by any account other than the owner. */ modifier onlyOwner { } /** * 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 { } /** * Allows the new owner toaccept ownership */ function acceptOwnership() { } } /* *This library is used to do mathematics safely */ contract SafeMathLib { function safeMul(uint a, uint b) returns (uint) { } function safeSub(uint a, uint b) returns (uint) { } function safeAdd(uint a, uint b) returns (uint) { } } /** * Upgrade agent interface inspired by Lunyr. * Taken and inspired from https://tokenmarket.net * * Upgrade agent transfers tokens to a new version of a token contract. * Upgrade agent can be set on a token by the upgrade master. * * Steps are * - Upgradeabletoken.upgradeMaster calls UpgradeableToken.setUpgradeAgent() * - Individual token holders can now call UpgradeableToken.upgrade() * -> This results to call UpgradeAgent.upgradeFrom() that issues new tokens * -> UpgradeableToken.upgrade() reduces the original total supply based on amount of upgraded tokens * * Upgrade agent itself can be the token contract, or just a middle man contract doing the heavy lifting. */ contract UpgradeAgent { uint public originalSupply; /** Interface marker */ function isUpgradeAgent() public constant returns (bool) { } /** * Upgrade amount of tokens to a new version. * * Only callable by UpgradeableToken. * * @param _tokenHolder Address that wants to upgrade its tokens * @param _amount Number of tokens to upgrade. The address may consider to hold back some amount of tokens in the old version. */ function upgradeFrom(address _tokenHolder, uint256 _amount) external; } /** * Standard ERC20 token with Short Hand Attack and approve() race condition mitigation. * * Based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, SafeMathLib { /* Actual balances of token holders */ mapping(address => uint) balances; /* approve() allowances */ mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } /** * A token upgrade mechanism where users can opt-in amount of tokens to the next smart contract revision. * First envisioned by Golem and Lunyr projects. * Taken and inspired from https://tokenmarket.net */ contract TCAUpgradeableToken is StandardToken { /** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */ address public upgradeMaster; /** The next contract where the tokens will be migrated. */ UpgradeAgent public upgradeAgent; /** How many tokens we have upgraded by now. */ uint256 public totalUpgraded; /** * Upgrade states. * * - NotAllowed: The child contract has not reached a condition where the upgrade can bgun * - WaitingForAgent: Token allows upgrade, but we don't have a new agent yet * - ReadyToUpgrade: The agent is set, but not a single token has been upgraded yet * - Upgrading: Upgrade agent is set and the balance holders can upgrade their tokens * */ enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading} /** * Somebody has upgraded some of his tokens. */ event Upgrade(address indexed _from, address indexed _to, uint256 _value); /** * New upgrade agent available. */ event UpgradeAgentSet(address agent); /** * Do not allow construction without upgrade master set. */ function TCAUpgradeableToken(address _upgradeMaster) { } /** * Allow the token holder to upgrade some of their tokens to a new contract. */ function upgrade(uint256 value) public { } /** * Set an upgrade agent that handles */ function setUpgradeAgent(address agent) external { } /** * Get the state of the token upgrade. */ function getUpgradeState() public constant returns(UpgradeState) { } /** * Change the upgrade master. * * This allows us to set a new owner for the upgrade mechanism. */ function setUpgradeMaster(address master) public { } /** * Child contract can enable to provide the condition when the upgrade can begun. */ function canUpgrade() public constant returns(bool) { } } /** * Define interface for releasing the token transfer after a successful crowdsale. * Taken and inspired from https://tokenmarket.net */ contract ReleasableToken is ERC20, Ownable { /* The finalizer contract that allows unlift the transfer limits on this token */ address public releaseAgent; /** A crowdsale contract can release us to the wild if ICO success. If false we are are in transfer lock up period.*/ bool public released = false; /** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */ mapping (address => bool) public transferAgents; /** * Limit token transfer until the crowdsale is over. * */ modifier canTransfer(address _sender) { } /** * Set the contract that can call release and make the token transferable. */ function setReleaseAgent(address addr) onlyOwner inReleaseState(false) public { } /** * Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period. */ function setTransferAgent(address addr, bool state) onlyOwner inReleaseState(false) public { } /** * One way function to release the tokens to the wild. * * Can be called only from the release agent that is the final ICO contract. It is only called if the crowdsale has been success (first milestone reached). */ function releaseTokenTransfer() public onlyReleaseAgent { } /** The function can be called only before or after the tokens have been releasesd */ modifier inReleaseState(bool releaseState) { } /** The function can be called only by a whitelisted release agent. */ modifier onlyReleaseAgent() { } function transfer(address _to, uint _value) canTransfer(msg.sender) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) canTransfer(_from) returns (bool success) { } } contract Coin is TCAUpgradeableToken, ReleasableToken { event UpdatedTokenInformation(string newName, string newSymbol); /* name of the token */ string public name = "TheCurrencyAnalytics"; /* symbol of the token */ string public symbol = "TCAT"; /* token decimals to handle fractions */ uint public decimals = 18; //Crowdsale running bool public isCrowdsaleOpen=false; /* initial token supply */ uint public totalSupply = 400000000 * (10 ** decimals); uint public onSaleTokens = 200000000 * (10 ** decimals); uint tokensForPublicSale = 0; address contractAddress; uint256 pricePerToken = 2860; //1 Eth = 2860 TCAT uint minETH = 0 * 10**decimals; // 0 ether uint maxETH = 15 * 10**decimals; // 15 ether function Coin() TCAUpgradeableToken(msg.sender) { } /* function to update token name and symbol */ function updateTokenInformation(string _name, string _symbol) onlyOwner { } function sendTokensToOwner(uint _tokens) onlyOwner returns (bool ok){ require(<FILL_ME>) balances[contractAddress] = safeSub(balances[contractAddress],_tokens); balances[owner] = safeAdd(balances[owner],_tokens); return true; } /* single address */ function sendTokensToInvestors(address _investor, uint _tokens) onlyOwner returns (bool ok){ } /* A dispense feature to allocate some addresses with TCA tokens * calculation done using token count * Can be called only by owner */ function dispenseTokensToInvestorAddressesByValue(address[] _addresses, uint[] _value) onlyOwner returns (bool ok){ } function startCrowdSale() onlyOwner { } function stopCrowdSale() onlyOwner { } function setPublicSaleParams(uint _tokensForPublicSale, uint _min, uint _max, bool _crowdsaleStatus ) onlyOwner { } function setTotalTokensForPublicSale(uint _value) onlyOwner{ } function increaseSupply(uint value) onlyOwner returns (bool) { } function decreaseSupply(uint value) onlyOwner returns (bool) { } function setMinAndMaxEthersForPublicSale(uint _min, uint _max) onlyOwner{ } function updateTokenPrice(uint _value) onlyOwner{ } function updateOnSaleSupply(uint _newSupply) onlyOwner{ } function buyTokens() public payable returns(uint tokenAmount) { } // There is no need for vesting. It will be done manually by manually releasing tokens to certain addresses function() payable { } function destroyToken() public onlyOwner { } }
balances[contractAddress]>=_tokens
34,725
balances[contractAddress]>=_tokens
null
pragma solidity ^0.4.4; /** * @title ERC20 interface * see https://github.com/ethereum/EIPs/issues/20 */ contract ERC20 { uint public totalSupply; uint public decimals; function balanceOf(address who) constant returns (uint); function allowance(address owner, address spender) constant returns (uint); function transfer(address to, uint value) returns (bool ok); function transferFrom(address from, address to, uint value) returns (bool ok); function approve(address spender, uint value) returns (bool ok); event Transfer(address indexed from, address indexed to, uint value); event Approval(address indexed owner, address indexed spender, uint value); } /** * @title Ownable * The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { /* Current Owner */ address public owner; /* New owner which can be set in future */ address public newOwner; /* event to indicate finally ownership has been succesfully transferred and accepted */ event OwnershipTransferred(address indexed _from, address indexed _to); /** * The Ownable constructor sets the original `owner` of the contract to the sender account. */ function Ownable() { } /** * Throws if called by any account other than the owner. */ modifier onlyOwner { } /** * 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 { } /** * Allows the new owner toaccept ownership */ function acceptOwnership() { } } /* *This library is used to do mathematics safely */ contract SafeMathLib { function safeMul(uint a, uint b) returns (uint) { } function safeSub(uint a, uint b) returns (uint) { } function safeAdd(uint a, uint b) returns (uint) { } } /** * Upgrade agent interface inspired by Lunyr. * Taken and inspired from https://tokenmarket.net * * Upgrade agent transfers tokens to a new version of a token contract. * Upgrade agent can be set on a token by the upgrade master. * * Steps are * - Upgradeabletoken.upgradeMaster calls UpgradeableToken.setUpgradeAgent() * - Individual token holders can now call UpgradeableToken.upgrade() * -> This results to call UpgradeAgent.upgradeFrom() that issues new tokens * -> UpgradeableToken.upgrade() reduces the original total supply based on amount of upgraded tokens * * Upgrade agent itself can be the token contract, or just a middle man contract doing the heavy lifting. */ contract UpgradeAgent { uint public originalSupply; /** Interface marker */ function isUpgradeAgent() public constant returns (bool) { } /** * Upgrade amount of tokens to a new version. * * Only callable by UpgradeableToken. * * @param _tokenHolder Address that wants to upgrade its tokens * @param _amount Number of tokens to upgrade. The address may consider to hold back some amount of tokens in the old version. */ function upgradeFrom(address _tokenHolder, uint256 _amount) external; } /** * Standard ERC20 token with Short Hand Attack and approve() race condition mitigation. * * Based on code by FirstBlood: * https://github.com/Firstbloodio/token/blob/master/smart_contract/FirstBloodToken.sol */ contract StandardToken is ERC20, SafeMathLib { /* Actual balances of token holders */ mapping(address => uint) balances; /* approve() allowances */ mapping (address => mapping (address => uint)) allowed; function transfer(address _to, uint _value) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) returns (bool success) { } function balanceOf(address _owner) constant returns (uint balance) { } function approve(address _spender, uint _value) returns (bool success) { } function allowance(address _owner, address _spender) constant returns (uint remaining) { } } /** * A token upgrade mechanism where users can opt-in amount of tokens to the next smart contract revision. * First envisioned by Golem and Lunyr projects. * Taken and inspired from https://tokenmarket.net */ contract TCAUpgradeableToken is StandardToken { /** Contract / person who can set the upgrade path. This can be the same as team multisig wallet, as what it is with its default value. */ address public upgradeMaster; /** The next contract where the tokens will be migrated. */ UpgradeAgent public upgradeAgent; /** How many tokens we have upgraded by now. */ uint256 public totalUpgraded; /** * Upgrade states. * * - NotAllowed: The child contract has not reached a condition where the upgrade can bgun * - WaitingForAgent: Token allows upgrade, but we don't have a new agent yet * - ReadyToUpgrade: The agent is set, but not a single token has been upgraded yet * - Upgrading: Upgrade agent is set and the balance holders can upgrade their tokens * */ enum UpgradeState {Unknown, NotAllowed, WaitingForAgent, ReadyToUpgrade, Upgrading} /** * Somebody has upgraded some of his tokens. */ event Upgrade(address indexed _from, address indexed _to, uint256 _value); /** * New upgrade agent available. */ event UpgradeAgentSet(address agent); /** * Do not allow construction without upgrade master set. */ function TCAUpgradeableToken(address _upgradeMaster) { } /** * Allow the token holder to upgrade some of their tokens to a new contract. */ function upgrade(uint256 value) public { } /** * Set an upgrade agent that handles */ function setUpgradeAgent(address agent) external { } /** * Get the state of the token upgrade. */ function getUpgradeState() public constant returns(UpgradeState) { } /** * Change the upgrade master. * * This allows us to set a new owner for the upgrade mechanism. */ function setUpgradeMaster(address master) public { } /** * Child contract can enable to provide the condition when the upgrade can begun. */ function canUpgrade() public constant returns(bool) { } } /** * Define interface for releasing the token transfer after a successful crowdsale. * Taken and inspired from https://tokenmarket.net */ contract ReleasableToken is ERC20, Ownable { /* The finalizer contract that allows unlift the transfer limits on this token */ address public releaseAgent; /** A crowdsale contract can release us to the wild if ICO success. If false we are are in transfer lock up period.*/ bool public released = false; /** Map of agents that are allowed to transfer tokens regardless of the lock down period. These are crowdsale contracts and possible the team multisig itself. */ mapping (address => bool) public transferAgents; /** * Limit token transfer until the crowdsale is over. * */ modifier canTransfer(address _sender) { } /** * Set the contract that can call release and make the token transferable. */ function setReleaseAgent(address addr) onlyOwner inReleaseState(false) public { } /** * Owner can allow a particular address (a crowdsale contract) to transfer tokens despite the lock up period. */ function setTransferAgent(address addr, bool state) onlyOwner inReleaseState(false) public { } /** * One way function to release the tokens to the wild. * * Can be called only from the release agent that is the final ICO contract. It is only called if the crowdsale has been success (first milestone reached). */ function releaseTokenTransfer() public onlyReleaseAgent { } /** The function can be called only before or after the tokens have been releasesd */ modifier inReleaseState(bool releaseState) { } /** The function can be called only by a whitelisted release agent. */ modifier onlyReleaseAgent() { } function transfer(address _to, uint _value) canTransfer(msg.sender) returns (bool success) { } function transferFrom(address _from, address _to, uint _value) canTransfer(_from) returns (bool success) { } } contract Coin is TCAUpgradeableToken, ReleasableToken { event UpdatedTokenInformation(string newName, string newSymbol); /* name of the token */ string public name = "TheCurrencyAnalytics"; /* symbol of the token */ string public symbol = "TCAT"; /* token decimals to handle fractions */ uint public decimals = 18; //Crowdsale running bool public isCrowdsaleOpen=false; /* initial token supply */ uint public totalSupply = 400000000 * (10 ** decimals); uint public onSaleTokens = 200000000 * (10 ** decimals); uint tokensForPublicSale = 0; address contractAddress; uint256 pricePerToken = 2860; //1 Eth = 2860 TCAT uint minETH = 0 * 10**decimals; // 0 ether uint maxETH = 15 * 10**decimals; // 15 ether function Coin() TCAUpgradeableToken(msg.sender) { } /* function to update token name and symbol */ function updateTokenInformation(string _name, string _symbol) onlyOwner { } function sendTokensToOwner(uint _tokens) onlyOwner returns (bool ok){ } /* single address */ function sendTokensToInvestors(address _investor, uint _tokens) onlyOwner returns (bool ok){ } /* A dispense feature to allocate some addresses with TCA tokens * calculation done using token count * Can be called only by owner */ function dispenseTokensToInvestorAddressesByValue(address[] _addresses, uint[] _value) onlyOwner returns (bool ok){ } function startCrowdSale() onlyOwner { } function stopCrowdSale() onlyOwner { } function setPublicSaleParams(uint _tokensForPublicSale, uint _min, uint _max, bool _crowdsaleStatus ) onlyOwner { } function setTotalTokensForPublicSale(uint _value) onlyOwner{ } function increaseSupply(uint value) onlyOwner returns (bool) { } function decreaseSupply(uint value) onlyOwner returns (bool) { } function setMinAndMaxEthersForPublicSale(uint _min, uint _max) onlyOwner{ } function updateTokenPrice(uint _value) onlyOwner{ } function updateOnSaleSupply(uint _newSupply) onlyOwner{ } function buyTokens() public payable returns(uint tokenAmount) { uint _tokenAmount; uint multiplier = (10 ** decimals); uint weiAmount = msg.value; require(isCrowdsaleOpen); //require(whitelistedAddress[msg.sender]); require(weiAmount >= minETH); require(weiAmount <= maxETH); // _tokenAmount = safeMul(weiAmount,multiplier) / pricePerToken; _tokenAmount = safeMul(weiAmount,pricePerToken); require(_tokenAmount > 0); //safe sub will automatically handle overflows tokensForPublicSale = safeSub(tokensForPublicSale, _tokenAmount); onSaleTokens = safeSub(onSaleTokens, _tokenAmount); balances[contractAddress] = safeSub(balances[contractAddress],_tokenAmount); //assign tokens balances[msg.sender] = safeAdd(balances[msg.sender], _tokenAmount); //send money to the owner require(<FILL_ME>) return _tokenAmount; } // There is no need for vesting. It will be done manually by manually releasing tokens to certain addresses function() payable { } function destroyToken() public onlyOwner { } }
owner.send(weiAmount)
34,725
owner.send(weiAmount)
"Sale has already ended"
// contracts/RooCrew // SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "./ERC721.sol"; import "./Ownable.sol"; contract RooCrew is ERC721, Ownable { using SafeMath for uint256; uint public constant MAX_ROOS = 5000; uint public constant MAX_PRESALE_ROOS = 600; bool public hasSaleStarted = false; bool public hasPresaleStarted = false; string public ROO_PROVENANCE = ""; uint256 public constant rooPrice = 50000000000000000; constructor(string memory baseURI) ERC721("RooCrew","ROO") { } function tokensOfOwner(address _owner) external view returns(uint256[] memory ) { } function mintRoo(uint256 numRoos) public payable { require(hasSaleStarted, "Sale has not started"); require(<FILL_ME>) require(numRoos > 0 && numRoos <= 10, "You can mint from 1 to 10 Roos"); require(totalSupply().add(numRoos) <= MAX_ROOS, "Exceeds MAX_ROOS"); require(rooPrice.mul(numRoos) <= msg.value, "Not enough Ether sent for this tx"); for (uint i = 0; i < numRoos; i++) { uint mintIndex = totalSupply() + 1; _safeMint(msg.sender, mintIndex); } } function mintPresaleRoo(uint256 numRoos) public payable { } function mintGiveawayRoos(uint256 numRoos) public payable onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function startSale() public onlyOwner { } function startPresale() public onlyOwner { } function pauseSale() public onlyOwner { } function pausePresale() public onlyOwner { } /* * Set provenance once it's calculated */ function setProvenanceHash(string memory _hash) public onlyOwner { } function withdraw() public onlyOwner { } }
totalSupply()<MAX_ROOS,"Sale has already ended"
34,743
totalSupply()<MAX_ROOS
"Exceeds MAX_ROOS"
// contracts/RooCrew // SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "./ERC721.sol"; import "./Ownable.sol"; contract RooCrew is ERC721, Ownable { using SafeMath for uint256; uint public constant MAX_ROOS = 5000; uint public constant MAX_PRESALE_ROOS = 600; bool public hasSaleStarted = false; bool public hasPresaleStarted = false; string public ROO_PROVENANCE = ""; uint256 public constant rooPrice = 50000000000000000; constructor(string memory baseURI) ERC721("RooCrew","ROO") { } function tokensOfOwner(address _owner) external view returns(uint256[] memory ) { } function mintRoo(uint256 numRoos) public payable { require(hasSaleStarted, "Sale has not started"); require(totalSupply() < MAX_ROOS, "Sale has already ended"); require(numRoos > 0 && numRoos <= 10, "You can mint from 1 to 10 Roos"); require(<FILL_ME>) require(rooPrice.mul(numRoos) <= msg.value, "Not enough Ether sent for this tx"); for (uint i = 0; i < numRoos; i++) { uint mintIndex = totalSupply() + 1; _safeMint(msg.sender, mintIndex); } } function mintPresaleRoo(uint256 numRoos) public payable { } function mintGiveawayRoos(uint256 numRoos) public payable onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function startSale() public onlyOwner { } function startPresale() public onlyOwner { } function pauseSale() public onlyOwner { } function pausePresale() public onlyOwner { } /* * Set provenance once it's calculated */ function setProvenanceHash(string memory _hash) public onlyOwner { } function withdraw() public onlyOwner { } }
totalSupply().add(numRoos)<=MAX_ROOS,"Exceeds MAX_ROOS"
34,743
totalSupply().add(numRoos)<=MAX_ROOS
"Not enough Ether sent for this tx"
// contracts/RooCrew // SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "./ERC721.sol"; import "./Ownable.sol"; contract RooCrew is ERC721, Ownable { using SafeMath for uint256; uint public constant MAX_ROOS = 5000; uint public constant MAX_PRESALE_ROOS = 600; bool public hasSaleStarted = false; bool public hasPresaleStarted = false; string public ROO_PROVENANCE = ""; uint256 public constant rooPrice = 50000000000000000; constructor(string memory baseURI) ERC721("RooCrew","ROO") { } function tokensOfOwner(address _owner) external view returns(uint256[] memory ) { } function mintRoo(uint256 numRoos) public payable { require(hasSaleStarted, "Sale has not started"); require(totalSupply() < MAX_ROOS, "Sale has already ended"); require(numRoos > 0 && numRoos <= 10, "You can mint from 1 to 10 Roos"); require(totalSupply().add(numRoos) <= MAX_ROOS, "Exceeds MAX_ROOS"); require(<FILL_ME>) for (uint i = 0; i < numRoos; i++) { uint mintIndex = totalSupply() + 1; _safeMint(msg.sender, mintIndex); } } function mintPresaleRoo(uint256 numRoos) public payable { } function mintGiveawayRoos(uint256 numRoos) public payable onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function startSale() public onlyOwner { } function startPresale() public onlyOwner { } function pauseSale() public onlyOwner { } function pausePresale() public onlyOwner { } /* * Set provenance once it's calculated */ function setProvenanceHash(string memory _hash) public onlyOwner { } function withdraw() public onlyOwner { } }
rooPrice.mul(numRoos)<=msg.value,"Not enough Ether sent for this tx"
34,743
rooPrice.mul(numRoos)<=msg.value
"Presale has already ended"
// contracts/RooCrew // SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "./ERC721.sol"; import "./Ownable.sol"; contract RooCrew is ERC721, Ownable { using SafeMath for uint256; uint public constant MAX_ROOS = 5000; uint public constant MAX_PRESALE_ROOS = 600; bool public hasSaleStarted = false; bool public hasPresaleStarted = false; string public ROO_PROVENANCE = ""; uint256 public constant rooPrice = 50000000000000000; constructor(string memory baseURI) ERC721("RooCrew","ROO") { } function tokensOfOwner(address _owner) external view returns(uint256[] memory ) { } function mintRoo(uint256 numRoos) public payable { } function mintPresaleRoo(uint256 numRoos) public payable { require(hasPresaleStarted, "Presale has not started"); require(<FILL_ME>) require(numRoos > 0 && numRoos <= 1, "You can mint only 1 presale Roo"); require(totalSupply().add(numRoos) <= MAX_PRESALE_ROOS, "Exceeds MAX_PRESALE_ROOS"); require(rooPrice.mul(numRoos) <= msg.value, "Not enough Ether sent for this tx"); for (uint i = 0; i < numRoos; i++) { uint mintIndex = totalSupply() + 1; _safeMint(msg.sender, mintIndex); } } function mintGiveawayRoos(uint256 numRoos) public payable onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function startSale() public onlyOwner { } function startPresale() public onlyOwner { } function pauseSale() public onlyOwner { } function pausePresale() public onlyOwner { } /* * Set provenance once it's calculated */ function setProvenanceHash(string memory _hash) public onlyOwner { } function withdraw() public onlyOwner { } }
totalSupply()<MAX_PRESALE_ROOS,"Presale has already ended"
34,743
totalSupply()<MAX_PRESALE_ROOS
"Exceeds MAX_PRESALE_ROOS"
// contracts/RooCrew // SPDX-License-Identifier: MIT pragma solidity ^0.7.0; import "./ERC721.sol"; import "./Ownable.sol"; contract RooCrew is ERC721, Ownable { using SafeMath for uint256; uint public constant MAX_ROOS = 5000; uint public constant MAX_PRESALE_ROOS = 600; bool public hasSaleStarted = false; bool public hasPresaleStarted = false; string public ROO_PROVENANCE = ""; uint256 public constant rooPrice = 50000000000000000; constructor(string memory baseURI) ERC721("RooCrew","ROO") { } function tokensOfOwner(address _owner) external view returns(uint256[] memory ) { } function mintRoo(uint256 numRoos) public payable { } function mintPresaleRoo(uint256 numRoos) public payable { require(hasPresaleStarted, "Presale has not started"); require(totalSupply() < MAX_PRESALE_ROOS, "Presale has already ended"); require(numRoos > 0 && numRoos <= 1, "You can mint only 1 presale Roo"); require(<FILL_ME>) require(rooPrice.mul(numRoos) <= msg.value, "Not enough Ether sent for this tx"); for (uint i = 0; i < numRoos; i++) { uint mintIndex = totalSupply() + 1; _safeMint(msg.sender, mintIndex); } } function mintGiveawayRoos(uint256 numRoos) public payable onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function startSale() public onlyOwner { } function startPresale() public onlyOwner { } function pauseSale() public onlyOwner { } function pausePresale() public onlyOwner { } /* * Set provenance once it's calculated */ function setProvenanceHash(string memory _hash) public onlyOwner { } function withdraw() public onlyOwner { } }
totalSupply().add(numRoos)<=MAX_PRESALE_ROOS,"Exceeds MAX_PRESALE_ROOS"
34,743
totalSupply().add(numRoos)<=MAX_PRESALE_ROOS
"AaveMarket: An input address is not a contract"
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.4; import {SafeERC20} from "../../libs/SafeERC20.sol"; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import { AddressUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import {MoneyMarket} from "../MoneyMarket.sol"; import {ILendingPool} from "./imports/ILendingPool.sol"; import { ILendingPoolAddressesProvider } from "./imports/ILendingPoolAddressesProvider.sol"; import {IAaveMining} from "./imports/IAaveMining.sol"; contract AaveMarket is MoneyMarket { using SafeERC20 for ERC20; using AddressUpgradeable for address; uint16 internal constant REFERRALCODE = 20; // Aave referral program code ILendingPoolAddressesProvider public provider; // Used for fetching the current address of LendingPool ERC20 public override stablecoin; ERC20 public aToken; IAaveMining public aaveMining; address public rewards; function initialize( address _provider, address _aToken, address _aaveMining, address _rewards, address _rescuer, address _stablecoin ) external initializer { __MoneyMarket_init(_rescuer); // Verify input addresses require(<FILL_ME>) provider = ILendingPoolAddressesProvider(_provider); stablecoin = ERC20(_stablecoin); aaveMining = IAaveMining(_aaveMining); aToken = ERC20(_aToken); rewards = _rewards; } function deposit(uint256 amount) external override onlyOwner { } function withdraw(uint256 amountInUnderlying) external override onlyOwner returns (uint256 actualAmountWithdrawn) { } function claimRewards() external override { } /** Param setters */ function setRewards(address newValue) external override onlyOwner { } /** @dev IMPORTANT MUST READ This function is for restricting unauthorized accounts from taking funds and ensuring only tokens not used by the MoneyMarket can be rescued. IF YOU DON'T GET IT RIGHT YOU WILL LOSE PEOPLE'S MONEY MAKE SURE YOU DO ALL OF THE FOLLOWING 1) You MUST override it in a MoneyMarket implementation. 2) You MUST make `super._authorizeRescue(token, target);` the first line of your overriding function. 3) You MUST revert during a call to this function if a token used by the MoneyMarket is being rescued. 4) You SHOULD look at how existing MoneyMarkets do it as an example. */ function _authorizeRescue(address token, address target) internal view override { } function _totalValue( uint256 /*currentIncomeIndex*/ ) internal view override returns (uint256) { } function _incomeIndex() internal view override returns (uint256 index) { } uint256[45] private __gap; }
_provider.isContract()&&_aToken.isContract()&&_aaveMining.isContract()&&_rewards!=address(0)&&_stablecoin.isContract(),"AaveMarket: An input address is not a contract"
34,777
_provider.isContract()&&_aToken.isContract()&&_aaveMining.isContract()&&_rewards!=address(0)&&_stablecoin.isContract()
"CreamERC20Market: An input address is not a contract"
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.4; import {SafeERC20} from "../../libs/SafeERC20.sol"; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import { AddressUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import {MoneyMarket} from "../MoneyMarket.sol"; import {PRBMathUD60x18} from "prb-math/contracts/PRBMathUD60x18.sol"; import {ICrERC20} from "./imports/ICrERC20.sol"; contract CreamERC20Market is MoneyMarket { using PRBMathUD60x18 for uint256; using SafeERC20 for ERC20; using AddressUpgradeable for address; uint256 internal constant ERRCODE_OK = 0; ICrERC20 public cToken; ERC20 public override stablecoin; function initialize( address _cToken, address _rescuer, address _stablecoin ) external initializer { __MoneyMarket_init(_rescuer); // Verify input addresses require(<FILL_ME>) cToken = ICrERC20(_cToken); stablecoin = ERC20(_stablecoin); } function deposit(uint256 amount) external override onlyOwner { } function withdraw(uint256 amountInUnderlying) external override onlyOwner returns (uint256 actualAmountWithdrawn) { } function claimRewards() external override {} function setRewards(address newValue) external override onlyOwner {} /** @dev IMPORTANT MUST READ This function is for restricting unauthorized accounts from taking funds and ensuring only tokens not used by the MoneyMarket can be rescued. IF YOU DON'T GET IT RIGHT YOU WILL LOSE PEOPLE'S MONEY MAKE SURE YOU DO ALL OF THE FOLLOWING 1) You MUST override it in a MoneyMarket implementation. 2) You MUST make `super._authorizeRescue(token, target);` the first line of your overriding function. 3) You MUST revert during a call to this function if a token used by the MoneyMarket is being rescued. 4) You SHOULD look at how existing MoneyMarkets do it as an example. */ function _authorizeRescue(address token, address target) internal view override { } function _totalValue(uint256 currentIncomeIndex) internal view override returns (uint256) { } function _incomeIndex() internal override returns (uint256 index) { } uint256[48] private __gap; }
_cToken.isContract()&&_stablecoin.isContract(),"CreamERC20Market: An input address is not a contract"
34,785
_cToken.isContract()&&_stablecoin.isContract()
"CreamERC20Market: Failed to mint cTokens"
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.4; import {SafeERC20} from "../../libs/SafeERC20.sol"; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import { AddressUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import {MoneyMarket} from "../MoneyMarket.sol"; import {PRBMathUD60x18} from "prb-math/contracts/PRBMathUD60x18.sol"; import {ICrERC20} from "./imports/ICrERC20.sol"; contract CreamERC20Market is MoneyMarket { using PRBMathUD60x18 for uint256; using SafeERC20 for ERC20; using AddressUpgradeable for address; uint256 internal constant ERRCODE_OK = 0; ICrERC20 public cToken; ERC20 public override stablecoin; function initialize( address _cToken, address _rescuer, address _stablecoin ) external initializer { } function deposit(uint256 amount) external override onlyOwner { require(amount > 0, "CreamERC20Market: amount is 0"); // Transfer `amount` stablecoin from `msg.sender` stablecoin.safeTransferFrom(msg.sender, address(this), amount); // Deposit `amount` stablecoin into cToken stablecoin.safeIncreaseAllowance(address(cToken), amount); require(<FILL_ME>) } function withdraw(uint256 amountInUnderlying) external override onlyOwner returns (uint256 actualAmountWithdrawn) { } function claimRewards() external override {} function setRewards(address newValue) external override onlyOwner {} /** @dev IMPORTANT MUST READ This function is for restricting unauthorized accounts from taking funds and ensuring only tokens not used by the MoneyMarket can be rescued. IF YOU DON'T GET IT RIGHT YOU WILL LOSE PEOPLE'S MONEY MAKE SURE YOU DO ALL OF THE FOLLOWING 1) You MUST override it in a MoneyMarket implementation. 2) You MUST make `super._authorizeRescue(token, target);` the first line of your overriding function. 3) You MUST revert during a call to this function if a token used by the MoneyMarket is being rescued. 4) You SHOULD look at how existing MoneyMarkets do it as an example. */ function _authorizeRescue(address token, address target) internal view override { } function _totalValue(uint256 currentIncomeIndex) internal view override returns (uint256) { } function _incomeIndex() internal override returns (uint256 index) { } uint256[48] private __gap; }
cToken.mint(amount)==ERRCODE_OK,"CreamERC20Market: Failed to mint cTokens"
34,785
cToken.mint(amount)==ERRCODE_OK
"CreamERC20Market: Failed to redeem"
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.4; import {SafeERC20} from "../../libs/SafeERC20.sol"; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import { AddressUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import {MoneyMarket} from "../MoneyMarket.sol"; import {PRBMathUD60x18} from "prb-math/contracts/PRBMathUD60x18.sol"; import {ICrERC20} from "./imports/ICrERC20.sol"; contract CreamERC20Market is MoneyMarket { using PRBMathUD60x18 for uint256; using SafeERC20 for ERC20; using AddressUpgradeable for address; uint256 internal constant ERRCODE_OK = 0; ICrERC20 public cToken; ERC20 public override stablecoin; function initialize( address _cToken, address _rescuer, address _stablecoin ) external initializer { } function deposit(uint256 amount) external override onlyOwner { } function withdraw(uint256 amountInUnderlying) external override onlyOwner returns (uint256 actualAmountWithdrawn) { require( amountInUnderlying > 0, "CreamERC20Market: amountInUnderlying is 0" ); // Withdraw `amountInUnderlying` stablecoin from cToken require(<FILL_ME>) // Transfer `amountInUnderlying` stablecoin to `msg.sender` stablecoin.safeTransfer(msg.sender, amountInUnderlying); return amountInUnderlying; } function claimRewards() external override {} function setRewards(address newValue) external override onlyOwner {} /** @dev IMPORTANT MUST READ This function is for restricting unauthorized accounts from taking funds and ensuring only tokens not used by the MoneyMarket can be rescued. IF YOU DON'T GET IT RIGHT YOU WILL LOSE PEOPLE'S MONEY MAKE SURE YOU DO ALL OF THE FOLLOWING 1) You MUST override it in a MoneyMarket implementation. 2) You MUST make `super._authorizeRescue(token, target);` the first line of your overriding function. 3) You MUST revert during a call to this function if a token used by the MoneyMarket is being rescued. 4) You SHOULD look at how existing MoneyMarkets do it as an example. */ function _authorizeRescue(address token, address target) internal view override { } function _totalValue(uint256 currentIncomeIndex) internal view override returns (uint256) { } function _incomeIndex() internal override returns (uint256 index) { } uint256[48] private __gap; }
cToken.redeemUnderlying(amountInUnderlying)==ERRCODE_OK,"CreamERC20Market: Failed to redeem"
34,785
cToken.redeemUnderlying(amountInUnderlying)==ERRCODE_OK
"HarvestMarket: Invalid input address"
// SPDX-License-Identifier: GPL-3.0-or-later pragma solidity 0.8.4; import {SafeERC20} from "../../libs/SafeERC20.sol"; import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import { AddressUpgradeable } from "@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol"; import {MoneyMarket} from "../MoneyMarket.sol"; import {PRBMathUD60x18} from "prb-math/contracts/PRBMathUD60x18.sol"; import {HarvestVault} from "./imports/HarvestVault.sol"; import {HarvestStaking} from "./imports/HarvestStaking.sol"; contract HarvestMarket is MoneyMarket { using PRBMathUD60x18 for uint256; using SafeERC20 for ERC20; using AddressUpgradeable for address; HarvestVault public vault; address public rewards; HarvestStaking public stakingPool; ERC20 public override stablecoin; function initialize( address _vault, address _rewards, address _stakingPool, address _rescuer, address _stablecoin ) external initializer { __MoneyMarket_init(_rescuer); // Verify input addresses require(<FILL_ME>) vault = HarvestVault(_vault); rewards = _rewards; stakingPool = HarvestStaking(_stakingPool); stablecoin = ERC20(_stablecoin); } function deposit(uint256 amount) external override onlyOwner { } function withdraw(uint256 amountInUnderlying) external override onlyOwner returns (uint256 actualAmountWithdrawn) { } function claimRewards() external override { } /** Param setters */ function setRewards(address newValue) external override onlyOwner { } /** @dev IMPORTANT MUST READ This function is for restricting unauthorized accounts from taking funds and ensuring only tokens not used by the MoneyMarket can be rescued. IF YOU DON'T GET IT RIGHT YOU WILL LOSE PEOPLE'S MONEY MAKE SURE YOU DO ALL OF THE FOLLOWING 1) You MUST override it in a MoneyMarket implementation. 2) You MUST make `super._authorizeRescue(token, target);` the first line of your overriding function. 3) You MUST revert during a call to this function if a token used by the MoneyMarket is being rescued. 4) You SHOULD look at how existing MoneyMarkets do it as an example. */ function _authorizeRescue(address token, address target) internal view override { } function _totalValue(uint256 currentIncomeIndex) internal view override returns (uint256) { } function _incomeIndex() internal view override returns (uint256 index) { } uint256[46] private __gap; }
_vault.isContract()&&_rewards!=address(0)&&_stakingPool.isContract()&&_stablecoin.isContract(),"HarvestMarket: Invalid input address"
34,787
_vault.isContract()&&_rewards!=address(0)&&_stakingPool.isContract()&&_stablecoin.isContract()
'oracle not support lp token'
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import './BasicSpell.sol'; import '../Governable.sol'; contract WhitelistSpell is BasicSpell, Governable { mapping(address => bool) public whitelistedLpTokens; // mapping from lp token to whitelist status constructor( IBank _bank, address _werc20, address _weth ) public BasicSpell(_bank, _werc20, _weth) { } /// @dev Set whitelist LP token statuses for spell /// @param lpTokens LP tokens to set whitelist statuses /// @param statuses Whitelist statuses function setWhitelistLPTokens(address[] calldata lpTokens, bool[] calldata statuses) external onlyGov { require(lpTokens.length == statuses.length, 'lpTokens & statuses length mismatched'); for (uint idx = 0; idx < lpTokens.length; idx++) { if (statuses[idx]) { require(<FILL_ME>) } whitelistedLpTokens[lpTokens[idx]] = statuses[idx]; } } }
bank.support(lpTokens[idx]),'oracle not support lp token'
34,807
bank.support(lpTokens[idx])
'no mapping'
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; pragma experimental ABIEncoderV2; import 'OpenZeppelin/[email protected]/contracts/math/SafeMath.sol'; import '../Governable.sol'; import '../../interfaces/IBaseOracle.sol'; interface IStdReference { /// A structure returned whenever someone requests for standard reference data. struct ReferenceData { uint rate; // base/quote exchange rate, multiplied by 1e18. uint lastUpdatedBase; // UNIX epoch of the last time when base price gets updated. uint lastUpdatedQuote; // UNIX epoch of the last time when quote price gets updated. } /// @dev Returns the price data for the given base/quote pair. Revert if not available. function getReferenceData(string memory _base, string memory _quote) external view returns (ReferenceData memory); /// @dev Similar to getReferenceData, but with multiple base/quote pairs at once. function getReferenceDataBulk(string[] memory _bases, string[] memory _quotes) external view returns (ReferenceData[] memory); } interface BandDetailedERC20 { function decimals() external view returns (uint8); } contract BandAdapterOracle is IBaseOracle, Governable { using SafeMath for uint; event SetSymbol(address token, string symbol); event SetRef(address ref); event SetMaxDelayTime(address token, uint maxDelayTime); string public constant ETH = 'ETH'; address public constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; IStdReference public ref; // Standard reference mapping(address => string) public symbols; // Mapping from token to symbol string mapping(address => uint) public maxDelayTimes; // Mapping from token address to max delay time constructor(IStdReference _ref) public { } /// @dev Set token symbols /// @param tokens List of tokens /// @param syms List of string symbols function setSymbols(address[] memory tokens, string[] memory syms) external onlyGov { } /// @dev Set standard reference source /// @param _ref Standard reference source function setRef(IStdReference _ref) external onlyGov { } /// @dev Set max delay time for each token /// @param tokens list of tokens to set max delay /// @param maxDelays list of max delay times to set to function setMaxDelayTimes(address[] calldata tokens, uint[] calldata maxDelays) external onlyGov { } /// @dev Return the value of the given input as ETH per unit, multiplied by 2**112. /// @param token The ERC-20 token to check the value. function getETHPx(address token) external view override returns (uint) { if (token == WETH || token == 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE) return uint(2**112); string memory sym = symbols[token]; uint maxDelayTime = maxDelayTimes[token]; require(<FILL_ME>) require(maxDelayTime != 0, 'max delay time not set'); uint decimals = uint(BandDetailedERC20(token).decimals()); IStdReference.ReferenceData memory data = ref.getReferenceData(sym, ETH); require(data.lastUpdatedBase >= block.timestamp.sub(maxDelayTime), 'delayed base data'); require(data.lastUpdatedQuote >= block.timestamp.sub(maxDelayTime), 'delayed quote data'); return data.rate.mul(2**112).div(10**decimals); } }
bytes(sym).length!=0,'no mapping'
34,815
bytes(sym).length!=0
'bad oracle address'
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/IERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/SafeERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC1155/IERC1155.sol'; import 'OpenZeppelin/[email protected]/contracts/math/SafeMath.sol'; import 'OpenZeppelin/[email protected]/contracts/math/Math.sol'; import './Governable.sol'; import './utils/ERC1155NaiveReceiver.sol'; import '../interfaces/IBank.sol'; import '../interfaces/ICErc20.sol'; import '../interfaces/IOracle.sol'; library HomoraSafeMath { using SafeMath for uint; /// @dev Computes round-up division. function ceilDiv(uint a, uint b) internal pure returns (uint) { } } contract HomoraCaster { /// @dev Call to the target using the given data. /// @param target The address target to call. /// @param data The data used in the call. function cast(address target, bytes calldata data) external payable { } } contract HomoraBank is Governable, ERC1155NaiveReceiver, IBank { using SafeMath for uint; using HomoraSafeMath for uint; using SafeERC20 for IERC20; uint private constant _NOT_ENTERED = 1; uint private constant _ENTERED = 2; uint private constant _NO_ID = uint(-1); address private constant _NO_ADDRESS = address(1); struct Bank { bool isListed; // Whether this market exists. uint8 index; // Reverse look up index for this bank. address cToken; // The CToken to draw liquidity from. uint reserve; // The reserve portion allocated to Homora protocol. uint totalDebt; // The last recorded total debt since last action. uint totalShare; // The total debt share count across all open positions. } struct Position { address owner; // The owner of this position. address collToken; // The ERC1155 token used as collateral for this position. uint collId; // The token id used as collateral. uint collateralSize; // The size of collateral token for this position. uint debtMap; // Bitmap of nonzero debt. i^th bit is set iff debt share of i^th bank is nonzero. mapping(address => uint) debtShareOf; // The debt share for each token. } uint public _GENERAL_LOCK; // TEMPORARY: re-entrancy lock guard. uint public _IN_EXEC_LOCK; // TEMPORARY: exec lock guard. uint public override POSITION_ID; // TEMPORARY: position ID currently under execution. address public override SPELL; // TEMPORARY: spell currently under execution. address public caster; // The caster address for untrusted execution. IOracle public oracle; // The oracle address for determining prices. uint public feeBps; // The fee collected as protocol reserve in basis points from interest. uint public override nextPositionId; // Next available position ID, starting from 1 (see initialize). address[] public allBanks; // The list of all listed banks. mapping(address => Bank) public banks; // Mapping from token to bank data. mapping(address => bool) public cTokenInBank; // Mapping from cToken to its existence in bank. mapping(uint => Position) public positions; // Mapping from position ID to position data. bool public allowContractCalls; // The boolean status whether to allow call from contract (false = onlyEOA) mapping(address => bool) public whitelistedTokens; // Mapping from token to whitelist status mapping(address => bool) public whitelistedSpells; // Mapping from spell to whitelist status mapping(address => bool) public whitelistedUsers; // Mapping from user to whitelist status uint public bankStatus; // Each bit stores certain bank status, e.g. borrow allowed, repay allowed /// @dev Ensure that the function is called from EOA when allowContractCalls is set to false and caller is not whitelisted modifier onlyEOAEx() { } /// @dev Reentrancy lock guard. modifier lock() { } /// @dev Ensure that the function is called from within the execution scope. modifier inExec() { } /// @dev Ensure that the interest rate of the given token is accrued. modifier poke(address token) { } /// @dev Initialize the bank smart contract, using msg.sender as the first governor. /// @param _oracle The oracle smart contract address. /// @param _feeBps The fee collected to Homora bank. function initialize(IOracle _oracle, uint _feeBps) external initializer { __Governable__init(); _GENERAL_LOCK = _NOT_ENTERED; _IN_EXEC_LOCK = _NOT_ENTERED; POSITION_ID = _NO_ID; SPELL = _NO_ADDRESS; caster = address(new HomoraCaster()); oracle = _oracle; require(<FILL_ME>) feeBps = _feeBps; nextPositionId = 1; bankStatus = 3; // allow both borrow and repay emit SetOracle(address(_oracle)); emit SetFeeBps(_feeBps); } /// @dev Return the current executor (the owner of the current position). function EXECUTOR() external view override returns (address) { } /// @dev Set allowContractCalls /// @param ok The status to set allowContractCalls to (false = onlyEOA) function setAllowContractCalls(bool ok) external onlyGov { } /// @dev Set whitelist spell status /// @param spells list of spells to change status /// @param statuses list of statuses to change to function setWhitelistSpells(address[] calldata spells, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist token status /// @param tokens list of tokens to change status /// @param statuses list of statuses to change to function setWhitelistTokens(address[] calldata tokens, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist user status /// @param users list of users to change status /// @param statuses list of statuses to change to function setWhitelistUsers(address[] calldata users, bool[] calldata statuses) external onlyGov { } /// @dev Check whether the oracle supports the token /// @param token ERC-20 token to check for support function support(address token) public view override returns (bool) { } /// @dev Set bank status /// @param _bankStatus new bank status to change to function setBankStatus(uint _bankStatus) external onlyGov { } /// @dev Bank borrow status allowed or not /// @notice check last bit of bankStatus function allowBorrowStatus() public view returns (bool) { } /// @dev Bank repay status allowed or not /// @notice Check second-to-last bit of bankStatus function allowRepayStatus() public view returns (bool) { } /// @dev Trigger interest accrual for the given bank. /// @param token The underlying token to trigger the interest accrual. function accrue(address token) public override { } /// @dev Convenient function to trigger interest accrual for a list of banks. /// @param tokens The list of banks to trigger interest accrual. function accrueAll(address[] memory tokens) external { } /// @dev Return the borrow balance for given position and token without triggering interest accrual. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceStored(uint positionId, address token) public view override returns (uint) { } /// @dev Trigger interest accrual and return the current borrow balance. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceCurrent(uint positionId, address token) external override returns (uint) { } /// @dev Return bank information for the given token. /// @param token The token address to query for bank information. function getBankInfo(address token) external view override returns ( bool isListed, address cToken, uint reserve, uint totalDebt, uint totalShare ) { } /// @dev Return position information for the given position id. /// @param positionId The position id to query for position information. function getPositionInfo(uint positionId) public view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return current position information function getCurrentPositionInfo() external view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return the debt share of the given bank token for the given position id. /// @param positionId position id to get debt of /// @param token ERC20 debt token to query function getPositionDebtShareOf(uint positionId, address token) external view returns (uint) { } /// @dev Return the list of all debts for the given position id. /// @param positionId position id to get debts of function getPositionDebts(uint positionId) external view returns (address[] memory tokens, uint[] memory debts) { } /// @dev Return the total collateral value of the given position in ETH. /// @param positionId The position ID to query for the collateral value. function getCollateralETHValue(uint positionId) public view returns (uint) { } /// @dev Return the total borrow value of the given position in ETH. /// @param positionId The position ID to query for the borrow value. function getBorrowETHValue(uint positionId) public view override returns (uint) { } /// @dev Add a new bank to the ecosystem. /// @param token The underlying token for the bank. /// @param cToken The address of the cToken smart contract. function addBank(address token, address cToken) external onlyGov { } /// @dev Set the oracle smart contract address. /// @param _oracle The new oracle smart contract address. function setOracle(IOracle _oracle) external onlyGov { } /// @dev Set the fee bps value that Homora bank charges. /// @param _feeBps The new fee bps value. function setFeeBps(uint _feeBps) external onlyGov { } /// @dev Withdraw the reserve portion of the bank. /// @param amount The amount of tokens to withdraw. function withdrawReserve(address token, uint amount) external onlyGov lock { } /// @dev Liquidate a position. Pay debt for its owner and take the collateral. /// @param positionId The position ID to liquidate. /// @param debtToken The debt token to repay. /// @param amountCall The amount to repay when doing transferFrom call. function liquidate( uint positionId, address debtToken, uint amountCall ) external override lock poke(debtToken) { } /// @dev Execute the action via HomoraCaster, calling its function with the supplied data. /// @param positionId The position ID to execute the action, or zero for new position. /// @param spell The target spell to invoke the execution via HomoraCaster. /// @param data Extra data to pass to the target for the execution. function execute( uint positionId, address spell, bytes memory data ) external payable lock onlyEOAEx returns (uint) { } /// @dev Borrow tokens from that bank. Must only be called while under execution. /// @param token The token to borrow from the bank. /// @param amount The amount of tokens to borrow. function borrow(address token, uint amount) external override inExec poke(token) { } /// @dev Repay tokens to the bank. Must only be called while under execution. /// @param token The token to repay to the bank. /// @param amountCall The amount of tokens to repay via transferFrom. function repay(address token, uint amountCall) external override inExec poke(token) { } /// @dev Perform repay action. Return the amount actually taken and the debt share reduced. /// @param positionId The position ID to repay the debt. /// @param token The bank token to pay the debt. /// @param amountCall The amount to repay by calling transferFrom, or -1 for debt size. function repayInternal( uint positionId, address token, uint amountCall ) internal returns (uint, uint) { } /// @dev Transmit user assets to the caller, so users only need to approve Bank for spending. /// @param token The token to transfer from user to the caller. /// @param amount The amount to transfer. function transmit(address token, uint amount) external override inExec { } /// @dev Put more collateral for users. Must only be called during execution. /// @param collToken The ERC1155 token to collateral. /// @param collId The token id to collateral. /// @param amountCall The amount of tokens to put via transferFrom. function putCollateral( address collToken, uint collId, uint amountCall ) external override inExec { } /// @dev Take some collateral back. Must only be called during execution. /// @param collToken The ERC1155 token to take back. /// @param collId The token id to take back. /// @param amount The amount of tokens to take back via transfer. function takeCollateral( address collToken, uint collId, uint amount ) external override inExec { } /// @dev Internal function to perform borrow from the bank and return the amount received. /// @param token The token to perform borrow action. /// @param amountCall The amount use in the transferFrom call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doBorrow(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform repay to the bank and return the amount actually repaid. /// @param token The token to perform repay action. /// @param amountCall The amount to use in the repay call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doRepay(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC20 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC20TransferIn(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC1155 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param id The id to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC1155TransferIn( address token, uint id, uint amountCall ) internal returns (uint) { } }
address(_oracle)!=address(0),'bad oracle address'
34,825
address(_oracle)!=address(0)
'oracle not support token'
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/IERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/SafeERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC1155/IERC1155.sol'; import 'OpenZeppelin/[email protected]/contracts/math/SafeMath.sol'; import 'OpenZeppelin/[email protected]/contracts/math/Math.sol'; import './Governable.sol'; import './utils/ERC1155NaiveReceiver.sol'; import '../interfaces/IBank.sol'; import '../interfaces/ICErc20.sol'; import '../interfaces/IOracle.sol'; library HomoraSafeMath { using SafeMath for uint; /// @dev Computes round-up division. function ceilDiv(uint a, uint b) internal pure returns (uint) { } } contract HomoraCaster { /// @dev Call to the target using the given data. /// @param target The address target to call. /// @param data The data used in the call. function cast(address target, bytes calldata data) external payable { } } contract HomoraBank is Governable, ERC1155NaiveReceiver, IBank { using SafeMath for uint; using HomoraSafeMath for uint; using SafeERC20 for IERC20; uint private constant _NOT_ENTERED = 1; uint private constant _ENTERED = 2; uint private constant _NO_ID = uint(-1); address private constant _NO_ADDRESS = address(1); struct Bank { bool isListed; // Whether this market exists. uint8 index; // Reverse look up index for this bank. address cToken; // The CToken to draw liquidity from. uint reserve; // The reserve portion allocated to Homora protocol. uint totalDebt; // The last recorded total debt since last action. uint totalShare; // The total debt share count across all open positions. } struct Position { address owner; // The owner of this position. address collToken; // The ERC1155 token used as collateral for this position. uint collId; // The token id used as collateral. uint collateralSize; // The size of collateral token for this position. uint debtMap; // Bitmap of nonzero debt. i^th bit is set iff debt share of i^th bank is nonzero. mapping(address => uint) debtShareOf; // The debt share for each token. } uint public _GENERAL_LOCK; // TEMPORARY: re-entrancy lock guard. uint public _IN_EXEC_LOCK; // TEMPORARY: exec lock guard. uint public override POSITION_ID; // TEMPORARY: position ID currently under execution. address public override SPELL; // TEMPORARY: spell currently under execution. address public caster; // The caster address for untrusted execution. IOracle public oracle; // The oracle address for determining prices. uint public feeBps; // The fee collected as protocol reserve in basis points from interest. uint public override nextPositionId; // Next available position ID, starting from 1 (see initialize). address[] public allBanks; // The list of all listed banks. mapping(address => Bank) public banks; // Mapping from token to bank data. mapping(address => bool) public cTokenInBank; // Mapping from cToken to its existence in bank. mapping(uint => Position) public positions; // Mapping from position ID to position data. bool public allowContractCalls; // The boolean status whether to allow call from contract (false = onlyEOA) mapping(address => bool) public whitelistedTokens; // Mapping from token to whitelist status mapping(address => bool) public whitelistedSpells; // Mapping from spell to whitelist status mapping(address => bool) public whitelistedUsers; // Mapping from user to whitelist status uint public bankStatus; // Each bit stores certain bank status, e.g. borrow allowed, repay allowed /// @dev Ensure that the function is called from EOA when allowContractCalls is set to false and caller is not whitelisted modifier onlyEOAEx() { } /// @dev Reentrancy lock guard. modifier lock() { } /// @dev Ensure that the function is called from within the execution scope. modifier inExec() { } /// @dev Ensure that the interest rate of the given token is accrued. modifier poke(address token) { } /// @dev Initialize the bank smart contract, using msg.sender as the first governor. /// @param _oracle The oracle smart contract address. /// @param _feeBps The fee collected to Homora bank. function initialize(IOracle _oracle, uint _feeBps) external initializer { } /// @dev Return the current executor (the owner of the current position). function EXECUTOR() external view override returns (address) { } /// @dev Set allowContractCalls /// @param ok The status to set allowContractCalls to (false = onlyEOA) function setAllowContractCalls(bool ok) external onlyGov { } /// @dev Set whitelist spell status /// @param spells list of spells to change status /// @param statuses list of statuses to change to function setWhitelistSpells(address[] calldata spells, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist token status /// @param tokens list of tokens to change status /// @param statuses list of statuses to change to function setWhitelistTokens(address[] calldata tokens, bool[] calldata statuses) external onlyGov { require(tokens.length == statuses.length, 'tokens & statuses length mismatched'); for (uint idx = 0; idx < tokens.length; idx++) { if (statuses[idx]) { // check oracle suppport require(<FILL_ME>) } whitelistedTokens[tokens[idx]] = statuses[idx]; } } /// @dev Set whitelist user status /// @param users list of users to change status /// @param statuses list of statuses to change to function setWhitelistUsers(address[] calldata users, bool[] calldata statuses) external onlyGov { } /// @dev Check whether the oracle supports the token /// @param token ERC-20 token to check for support function support(address token) public view override returns (bool) { } /// @dev Set bank status /// @param _bankStatus new bank status to change to function setBankStatus(uint _bankStatus) external onlyGov { } /// @dev Bank borrow status allowed or not /// @notice check last bit of bankStatus function allowBorrowStatus() public view returns (bool) { } /// @dev Bank repay status allowed or not /// @notice Check second-to-last bit of bankStatus function allowRepayStatus() public view returns (bool) { } /// @dev Trigger interest accrual for the given bank. /// @param token The underlying token to trigger the interest accrual. function accrue(address token) public override { } /// @dev Convenient function to trigger interest accrual for a list of banks. /// @param tokens The list of banks to trigger interest accrual. function accrueAll(address[] memory tokens) external { } /// @dev Return the borrow balance for given position and token without triggering interest accrual. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceStored(uint positionId, address token) public view override returns (uint) { } /// @dev Trigger interest accrual and return the current borrow balance. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceCurrent(uint positionId, address token) external override returns (uint) { } /// @dev Return bank information for the given token. /// @param token The token address to query for bank information. function getBankInfo(address token) external view override returns ( bool isListed, address cToken, uint reserve, uint totalDebt, uint totalShare ) { } /// @dev Return position information for the given position id. /// @param positionId The position id to query for position information. function getPositionInfo(uint positionId) public view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return current position information function getCurrentPositionInfo() external view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return the debt share of the given bank token for the given position id. /// @param positionId position id to get debt of /// @param token ERC20 debt token to query function getPositionDebtShareOf(uint positionId, address token) external view returns (uint) { } /// @dev Return the list of all debts for the given position id. /// @param positionId position id to get debts of function getPositionDebts(uint positionId) external view returns (address[] memory tokens, uint[] memory debts) { } /// @dev Return the total collateral value of the given position in ETH. /// @param positionId The position ID to query for the collateral value. function getCollateralETHValue(uint positionId) public view returns (uint) { } /// @dev Return the total borrow value of the given position in ETH. /// @param positionId The position ID to query for the borrow value. function getBorrowETHValue(uint positionId) public view override returns (uint) { } /// @dev Add a new bank to the ecosystem. /// @param token The underlying token for the bank. /// @param cToken The address of the cToken smart contract. function addBank(address token, address cToken) external onlyGov { } /// @dev Set the oracle smart contract address. /// @param _oracle The new oracle smart contract address. function setOracle(IOracle _oracle) external onlyGov { } /// @dev Set the fee bps value that Homora bank charges. /// @param _feeBps The new fee bps value. function setFeeBps(uint _feeBps) external onlyGov { } /// @dev Withdraw the reserve portion of the bank. /// @param amount The amount of tokens to withdraw. function withdrawReserve(address token, uint amount) external onlyGov lock { } /// @dev Liquidate a position. Pay debt for its owner and take the collateral. /// @param positionId The position ID to liquidate. /// @param debtToken The debt token to repay. /// @param amountCall The amount to repay when doing transferFrom call. function liquidate( uint positionId, address debtToken, uint amountCall ) external override lock poke(debtToken) { } /// @dev Execute the action via HomoraCaster, calling its function with the supplied data. /// @param positionId The position ID to execute the action, or zero for new position. /// @param spell The target spell to invoke the execution via HomoraCaster. /// @param data Extra data to pass to the target for the execution. function execute( uint positionId, address spell, bytes memory data ) external payable lock onlyEOAEx returns (uint) { } /// @dev Borrow tokens from that bank. Must only be called while under execution. /// @param token The token to borrow from the bank. /// @param amount The amount of tokens to borrow. function borrow(address token, uint amount) external override inExec poke(token) { } /// @dev Repay tokens to the bank. Must only be called while under execution. /// @param token The token to repay to the bank. /// @param amountCall The amount of tokens to repay via transferFrom. function repay(address token, uint amountCall) external override inExec poke(token) { } /// @dev Perform repay action. Return the amount actually taken and the debt share reduced. /// @param positionId The position ID to repay the debt. /// @param token The bank token to pay the debt. /// @param amountCall The amount to repay by calling transferFrom, or -1 for debt size. function repayInternal( uint positionId, address token, uint amountCall ) internal returns (uint, uint) { } /// @dev Transmit user assets to the caller, so users only need to approve Bank for spending. /// @param token The token to transfer from user to the caller. /// @param amount The amount to transfer. function transmit(address token, uint amount) external override inExec { } /// @dev Put more collateral for users. Must only be called during execution. /// @param collToken The ERC1155 token to collateral. /// @param collId The token id to collateral. /// @param amountCall The amount of tokens to put via transferFrom. function putCollateral( address collToken, uint collId, uint amountCall ) external override inExec { } /// @dev Take some collateral back. Must only be called during execution. /// @param collToken The ERC1155 token to take back. /// @param collId The token id to take back. /// @param amount The amount of tokens to take back via transfer. function takeCollateral( address collToken, uint collId, uint amount ) external override inExec { } /// @dev Internal function to perform borrow from the bank and return the amount received. /// @param token The token to perform borrow action. /// @param amountCall The amount use in the transferFrom call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doBorrow(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform repay to the bank and return the amount actually repaid. /// @param token The token to perform repay action. /// @param amountCall The amount to use in the repay call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doRepay(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC20 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC20TransferIn(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC1155 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param id The id to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC1155TransferIn( address token, uint id, uint amountCall ) internal returns (uint) { } }
support(tokens[idx]),'oracle not support token'
34,825
support(tokens[idx])
'bank not exist'
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/IERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/SafeERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC1155/IERC1155.sol'; import 'OpenZeppelin/[email protected]/contracts/math/SafeMath.sol'; import 'OpenZeppelin/[email protected]/contracts/math/Math.sol'; import './Governable.sol'; import './utils/ERC1155NaiveReceiver.sol'; import '../interfaces/IBank.sol'; import '../interfaces/ICErc20.sol'; import '../interfaces/IOracle.sol'; library HomoraSafeMath { using SafeMath for uint; /// @dev Computes round-up division. function ceilDiv(uint a, uint b) internal pure returns (uint) { } } contract HomoraCaster { /// @dev Call to the target using the given data. /// @param target The address target to call. /// @param data The data used in the call. function cast(address target, bytes calldata data) external payable { } } contract HomoraBank is Governable, ERC1155NaiveReceiver, IBank { using SafeMath for uint; using HomoraSafeMath for uint; using SafeERC20 for IERC20; uint private constant _NOT_ENTERED = 1; uint private constant _ENTERED = 2; uint private constant _NO_ID = uint(-1); address private constant _NO_ADDRESS = address(1); struct Bank { bool isListed; // Whether this market exists. uint8 index; // Reverse look up index for this bank. address cToken; // The CToken to draw liquidity from. uint reserve; // The reserve portion allocated to Homora protocol. uint totalDebt; // The last recorded total debt since last action. uint totalShare; // The total debt share count across all open positions. } struct Position { address owner; // The owner of this position. address collToken; // The ERC1155 token used as collateral for this position. uint collId; // The token id used as collateral. uint collateralSize; // The size of collateral token for this position. uint debtMap; // Bitmap of nonzero debt. i^th bit is set iff debt share of i^th bank is nonzero. mapping(address => uint) debtShareOf; // The debt share for each token. } uint public _GENERAL_LOCK; // TEMPORARY: re-entrancy lock guard. uint public _IN_EXEC_LOCK; // TEMPORARY: exec lock guard. uint public override POSITION_ID; // TEMPORARY: position ID currently under execution. address public override SPELL; // TEMPORARY: spell currently under execution. address public caster; // The caster address for untrusted execution. IOracle public oracle; // The oracle address for determining prices. uint public feeBps; // The fee collected as protocol reserve in basis points from interest. uint public override nextPositionId; // Next available position ID, starting from 1 (see initialize). address[] public allBanks; // The list of all listed banks. mapping(address => Bank) public banks; // Mapping from token to bank data. mapping(address => bool) public cTokenInBank; // Mapping from cToken to its existence in bank. mapping(uint => Position) public positions; // Mapping from position ID to position data. bool public allowContractCalls; // The boolean status whether to allow call from contract (false = onlyEOA) mapping(address => bool) public whitelistedTokens; // Mapping from token to whitelist status mapping(address => bool) public whitelistedSpells; // Mapping from spell to whitelist status mapping(address => bool) public whitelistedUsers; // Mapping from user to whitelist status uint public bankStatus; // Each bit stores certain bank status, e.g. borrow allowed, repay allowed /// @dev Ensure that the function is called from EOA when allowContractCalls is set to false and caller is not whitelisted modifier onlyEOAEx() { } /// @dev Reentrancy lock guard. modifier lock() { } /// @dev Ensure that the function is called from within the execution scope. modifier inExec() { } /// @dev Ensure that the interest rate of the given token is accrued. modifier poke(address token) { } /// @dev Initialize the bank smart contract, using msg.sender as the first governor. /// @param _oracle The oracle smart contract address. /// @param _feeBps The fee collected to Homora bank. function initialize(IOracle _oracle, uint _feeBps) external initializer { } /// @dev Return the current executor (the owner of the current position). function EXECUTOR() external view override returns (address) { } /// @dev Set allowContractCalls /// @param ok The status to set allowContractCalls to (false = onlyEOA) function setAllowContractCalls(bool ok) external onlyGov { } /// @dev Set whitelist spell status /// @param spells list of spells to change status /// @param statuses list of statuses to change to function setWhitelistSpells(address[] calldata spells, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist token status /// @param tokens list of tokens to change status /// @param statuses list of statuses to change to function setWhitelistTokens(address[] calldata tokens, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist user status /// @param users list of users to change status /// @param statuses list of statuses to change to function setWhitelistUsers(address[] calldata users, bool[] calldata statuses) external onlyGov { } /// @dev Check whether the oracle supports the token /// @param token ERC-20 token to check for support function support(address token) public view override returns (bool) { } /// @dev Set bank status /// @param _bankStatus new bank status to change to function setBankStatus(uint _bankStatus) external onlyGov { } /// @dev Bank borrow status allowed or not /// @notice check last bit of bankStatus function allowBorrowStatus() public view returns (bool) { } /// @dev Bank repay status allowed or not /// @notice Check second-to-last bit of bankStatus function allowRepayStatus() public view returns (bool) { } /// @dev Trigger interest accrual for the given bank. /// @param token The underlying token to trigger the interest accrual. function accrue(address token) public override { Bank storage bank = banks[token]; require(<FILL_ME>) uint totalDebt = bank.totalDebt; uint debt = ICErc20(bank.cToken).borrowBalanceCurrent(address(this)); if (debt > totalDebt) { uint fee = debt.sub(totalDebt).mul(feeBps).div(10000); bank.totalDebt = debt; bank.reserve = bank.reserve.add(doBorrow(token, fee)); } else if (totalDebt != debt) { // We should never reach here because CREAMv2 does not support *repayBorrowBehalf* // functionality. We set bank.totalDebt = debt nonetheless to ensure consistency. But do // note that if *repayBorrowBehalf* exists, an attacker can maliciously deflate debt // share value and potentially make this contract stop working due to math overflow. bank.totalDebt = debt; } } /// @dev Convenient function to trigger interest accrual for a list of banks. /// @param tokens The list of banks to trigger interest accrual. function accrueAll(address[] memory tokens) external { } /// @dev Return the borrow balance for given position and token without triggering interest accrual. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceStored(uint positionId, address token) public view override returns (uint) { } /// @dev Trigger interest accrual and return the current borrow balance. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceCurrent(uint positionId, address token) external override returns (uint) { } /// @dev Return bank information for the given token. /// @param token The token address to query for bank information. function getBankInfo(address token) external view override returns ( bool isListed, address cToken, uint reserve, uint totalDebt, uint totalShare ) { } /// @dev Return position information for the given position id. /// @param positionId The position id to query for position information. function getPositionInfo(uint positionId) public view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return current position information function getCurrentPositionInfo() external view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return the debt share of the given bank token for the given position id. /// @param positionId position id to get debt of /// @param token ERC20 debt token to query function getPositionDebtShareOf(uint positionId, address token) external view returns (uint) { } /// @dev Return the list of all debts for the given position id. /// @param positionId position id to get debts of function getPositionDebts(uint positionId) external view returns (address[] memory tokens, uint[] memory debts) { } /// @dev Return the total collateral value of the given position in ETH. /// @param positionId The position ID to query for the collateral value. function getCollateralETHValue(uint positionId) public view returns (uint) { } /// @dev Return the total borrow value of the given position in ETH. /// @param positionId The position ID to query for the borrow value. function getBorrowETHValue(uint positionId) public view override returns (uint) { } /// @dev Add a new bank to the ecosystem. /// @param token The underlying token for the bank. /// @param cToken The address of the cToken smart contract. function addBank(address token, address cToken) external onlyGov { } /// @dev Set the oracle smart contract address. /// @param _oracle The new oracle smart contract address. function setOracle(IOracle _oracle) external onlyGov { } /// @dev Set the fee bps value that Homora bank charges. /// @param _feeBps The new fee bps value. function setFeeBps(uint _feeBps) external onlyGov { } /// @dev Withdraw the reserve portion of the bank. /// @param amount The amount of tokens to withdraw. function withdrawReserve(address token, uint amount) external onlyGov lock { } /// @dev Liquidate a position. Pay debt for its owner and take the collateral. /// @param positionId The position ID to liquidate. /// @param debtToken The debt token to repay. /// @param amountCall The amount to repay when doing transferFrom call. function liquidate( uint positionId, address debtToken, uint amountCall ) external override lock poke(debtToken) { } /// @dev Execute the action via HomoraCaster, calling its function with the supplied data. /// @param positionId The position ID to execute the action, or zero for new position. /// @param spell The target spell to invoke the execution via HomoraCaster. /// @param data Extra data to pass to the target for the execution. function execute( uint positionId, address spell, bytes memory data ) external payable lock onlyEOAEx returns (uint) { } /// @dev Borrow tokens from that bank. Must only be called while under execution. /// @param token The token to borrow from the bank. /// @param amount The amount of tokens to borrow. function borrow(address token, uint amount) external override inExec poke(token) { } /// @dev Repay tokens to the bank. Must only be called while under execution. /// @param token The token to repay to the bank. /// @param amountCall The amount of tokens to repay via transferFrom. function repay(address token, uint amountCall) external override inExec poke(token) { } /// @dev Perform repay action. Return the amount actually taken and the debt share reduced. /// @param positionId The position ID to repay the debt. /// @param token The bank token to pay the debt. /// @param amountCall The amount to repay by calling transferFrom, or -1 for debt size. function repayInternal( uint positionId, address token, uint amountCall ) internal returns (uint, uint) { } /// @dev Transmit user assets to the caller, so users only need to approve Bank for spending. /// @param token The token to transfer from user to the caller. /// @param amount The amount to transfer. function transmit(address token, uint amount) external override inExec { } /// @dev Put more collateral for users. Must only be called during execution. /// @param collToken The ERC1155 token to collateral. /// @param collId The token id to collateral. /// @param amountCall The amount of tokens to put via transferFrom. function putCollateral( address collToken, uint collId, uint amountCall ) external override inExec { } /// @dev Take some collateral back. Must only be called during execution. /// @param collToken The ERC1155 token to take back. /// @param collId The token id to take back. /// @param amount The amount of tokens to take back via transfer. function takeCollateral( address collToken, uint collId, uint amount ) external override inExec { } /// @dev Internal function to perform borrow from the bank and return the amount received. /// @param token The token to perform borrow action. /// @param amountCall The amount use in the transferFrom call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doBorrow(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform repay to the bank and return the amount actually repaid. /// @param token The token to perform repay action. /// @param amountCall The amount to use in the repay call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doRepay(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC20 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC20TransferIn(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC1155 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param id The id to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC1155TransferIn( address token, uint id, uint amountCall ) internal returns (uint) { } }
bank.isListed,'bank not exist'
34,825
bank.isListed
'cToken already exists'
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/IERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/SafeERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC1155/IERC1155.sol'; import 'OpenZeppelin/[email protected]/contracts/math/SafeMath.sol'; import 'OpenZeppelin/[email protected]/contracts/math/Math.sol'; import './Governable.sol'; import './utils/ERC1155NaiveReceiver.sol'; import '../interfaces/IBank.sol'; import '../interfaces/ICErc20.sol'; import '../interfaces/IOracle.sol'; library HomoraSafeMath { using SafeMath for uint; /// @dev Computes round-up division. function ceilDiv(uint a, uint b) internal pure returns (uint) { } } contract HomoraCaster { /// @dev Call to the target using the given data. /// @param target The address target to call. /// @param data The data used in the call. function cast(address target, bytes calldata data) external payable { } } contract HomoraBank is Governable, ERC1155NaiveReceiver, IBank { using SafeMath for uint; using HomoraSafeMath for uint; using SafeERC20 for IERC20; uint private constant _NOT_ENTERED = 1; uint private constant _ENTERED = 2; uint private constant _NO_ID = uint(-1); address private constant _NO_ADDRESS = address(1); struct Bank { bool isListed; // Whether this market exists. uint8 index; // Reverse look up index for this bank. address cToken; // The CToken to draw liquidity from. uint reserve; // The reserve portion allocated to Homora protocol. uint totalDebt; // The last recorded total debt since last action. uint totalShare; // The total debt share count across all open positions. } struct Position { address owner; // The owner of this position. address collToken; // The ERC1155 token used as collateral for this position. uint collId; // The token id used as collateral. uint collateralSize; // The size of collateral token for this position. uint debtMap; // Bitmap of nonzero debt. i^th bit is set iff debt share of i^th bank is nonzero. mapping(address => uint) debtShareOf; // The debt share for each token. } uint public _GENERAL_LOCK; // TEMPORARY: re-entrancy lock guard. uint public _IN_EXEC_LOCK; // TEMPORARY: exec lock guard. uint public override POSITION_ID; // TEMPORARY: position ID currently under execution. address public override SPELL; // TEMPORARY: spell currently under execution. address public caster; // The caster address for untrusted execution. IOracle public oracle; // The oracle address for determining prices. uint public feeBps; // The fee collected as protocol reserve in basis points from interest. uint public override nextPositionId; // Next available position ID, starting from 1 (see initialize). address[] public allBanks; // The list of all listed banks. mapping(address => Bank) public banks; // Mapping from token to bank data. mapping(address => bool) public cTokenInBank; // Mapping from cToken to its existence in bank. mapping(uint => Position) public positions; // Mapping from position ID to position data. bool public allowContractCalls; // The boolean status whether to allow call from contract (false = onlyEOA) mapping(address => bool) public whitelistedTokens; // Mapping from token to whitelist status mapping(address => bool) public whitelistedSpells; // Mapping from spell to whitelist status mapping(address => bool) public whitelistedUsers; // Mapping from user to whitelist status uint public bankStatus; // Each bit stores certain bank status, e.g. borrow allowed, repay allowed /// @dev Ensure that the function is called from EOA when allowContractCalls is set to false and caller is not whitelisted modifier onlyEOAEx() { } /// @dev Reentrancy lock guard. modifier lock() { } /// @dev Ensure that the function is called from within the execution scope. modifier inExec() { } /// @dev Ensure that the interest rate of the given token is accrued. modifier poke(address token) { } /// @dev Initialize the bank smart contract, using msg.sender as the first governor. /// @param _oracle The oracle smart contract address. /// @param _feeBps The fee collected to Homora bank. function initialize(IOracle _oracle, uint _feeBps) external initializer { } /// @dev Return the current executor (the owner of the current position). function EXECUTOR() external view override returns (address) { } /// @dev Set allowContractCalls /// @param ok The status to set allowContractCalls to (false = onlyEOA) function setAllowContractCalls(bool ok) external onlyGov { } /// @dev Set whitelist spell status /// @param spells list of spells to change status /// @param statuses list of statuses to change to function setWhitelistSpells(address[] calldata spells, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist token status /// @param tokens list of tokens to change status /// @param statuses list of statuses to change to function setWhitelistTokens(address[] calldata tokens, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist user status /// @param users list of users to change status /// @param statuses list of statuses to change to function setWhitelistUsers(address[] calldata users, bool[] calldata statuses) external onlyGov { } /// @dev Check whether the oracle supports the token /// @param token ERC-20 token to check for support function support(address token) public view override returns (bool) { } /// @dev Set bank status /// @param _bankStatus new bank status to change to function setBankStatus(uint _bankStatus) external onlyGov { } /// @dev Bank borrow status allowed or not /// @notice check last bit of bankStatus function allowBorrowStatus() public view returns (bool) { } /// @dev Bank repay status allowed or not /// @notice Check second-to-last bit of bankStatus function allowRepayStatus() public view returns (bool) { } /// @dev Trigger interest accrual for the given bank. /// @param token The underlying token to trigger the interest accrual. function accrue(address token) public override { } /// @dev Convenient function to trigger interest accrual for a list of banks. /// @param tokens The list of banks to trigger interest accrual. function accrueAll(address[] memory tokens) external { } /// @dev Return the borrow balance for given position and token without triggering interest accrual. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceStored(uint positionId, address token) public view override returns (uint) { } /// @dev Trigger interest accrual and return the current borrow balance. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceCurrent(uint positionId, address token) external override returns (uint) { } /// @dev Return bank information for the given token. /// @param token The token address to query for bank information. function getBankInfo(address token) external view override returns ( bool isListed, address cToken, uint reserve, uint totalDebt, uint totalShare ) { } /// @dev Return position information for the given position id. /// @param positionId The position id to query for position information. function getPositionInfo(uint positionId) public view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return current position information function getCurrentPositionInfo() external view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return the debt share of the given bank token for the given position id. /// @param positionId position id to get debt of /// @param token ERC20 debt token to query function getPositionDebtShareOf(uint positionId, address token) external view returns (uint) { } /// @dev Return the list of all debts for the given position id. /// @param positionId position id to get debts of function getPositionDebts(uint positionId) external view returns (address[] memory tokens, uint[] memory debts) { } /// @dev Return the total collateral value of the given position in ETH. /// @param positionId The position ID to query for the collateral value. function getCollateralETHValue(uint positionId) public view returns (uint) { } /// @dev Return the total borrow value of the given position in ETH. /// @param positionId The position ID to query for the borrow value. function getBorrowETHValue(uint positionId) public view override returns (uint) { } /// @dev Add a new bank to the ecosystem. /// @param token The underlying token for the bank. /// @param cToken The address of the cToken smart contract. function addBank(address token, address cToken) external onlyGov { Bank storage bank = banks[token]; require(<FILL_ME>) require(!bank.isListed, 'bank already exists'); cTokenInBank[cToken] = true; bank.isListed = true; require(allBanks.length < 256, 'reach bank limit'); bank.index = uint8(allBanks.length); bank.cToken = cToken; IERC20(token).safeApprove(cToken, 0); IERC20(token).safeApprove(cToken, uint(-1)); allBanks.push(token); emit AddBank(token, cToken); } /// @dev Set the oracle smart contract address. /// @param _oracle The new oracle smart contract address. function setOracle(IOracle _oracle) external onlyGov { } /// @dev Set the fee bps value that Homora bank charges. /// @param _feeBps The new fee bps value. function setFeeBps(uint _feeBps) external onlyGov { } /// @dev Withdraw the reserve portion of the bank. /// @param amount The amount of tokens to withdraw. function withdrawReserve(address token, uint amount) external onlyGov lock { } /// @dev Liquidate a position. Pay debt for its owner and take the collateral. /// @param positionId The position ID to liquidate. /// @param debtToken The debt token to repay. /// @param amountCall The amount to repay when doing transferFrom call. function liquidate( uint positionId, address debtToken, uint amountCall ) external override lock poke(debtToken) { } /// @dev Execute the action via HomoraCaster, calling its function with the supplied data. /// @param positionId The position ID to execute the action, or zero for new position. /// @param spell The target spell to invoke the execution via HomoraCaster. /// @param data Extra data to pass to the target for the execution. function execute( uint positionId, address spell, bytes memory data ) external payable lock onlyEOAEx returns (uint) { } /// @dev Borrow tokens from that bank. Must only be called while under execution. /// @param token The token to borrow from the bank. /// @param amount The amount of tokens to borrow. function borrow(address token, uint amount) external override inExec poke(token) { } /// @dev Repay tokens to the bank. Must only be called while under execution. /// @param token The token to repay to the bank. /// @param amountCall The amount of tokens to repay via transferFrom. function repay(address token, uint amountCall) external override inExec poke(token) { } /// @dev Perform repay action. Return the amount actually taken and the debt share reduced. /// @param positionId The position ID to repay the debt. /// @param token The bank token to pay the debt. /// @param amountCall The amount to repay by calling transferFrom, or -1 for debt size. function repayInternal( uint positionId, address token, uint amountCall ) internal returns (uint, uint) { } /// @dev Transmit user assets to the caller, so users only need to approve Bank for spending. /// @param token The token to transfer from user to the caller. /// @param amount The amount to transfer. function transmit(address token, uint amount) external override inExec { } /// @dev Put more collateral for users. Must only be called during execution. /// @param collToken The ERC1155 token to collateral. /// @param collId The token id to collateral. /// @param amountCall The amount of tokens to put via transferFrom. function putCollateral( address collToken, uint collId, uint amountCall ) external override inExec { } /// @dev Take some collateral back. Must only be called during execution. /// @param collToken The ERC1155 token to take back. /// @param collId The token id to take back. /// @param amount The amount of tokens to take back via transfer. function takeCollateral( address collToken, uint collId, uint amount ) external override inExec { } /// @dev Internal function to perform borrow from the bank and return the amount received. /// @param token The token to perform borrow action. /// @param amountCall The amount use in the transferFrom call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doBorrow(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform repay to the bank and return the amount actually repaid. /// @param token The token to perform repay action. /// @param amountCall The amount to use in the repay call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doRepay(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC20 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC20TransferIn(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC1155 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param id The id to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC1155TransferIn( address token, uint id, uint amountCall ) internal returns (uint) { } }
!cTokenInBank[cToken],'cToken already exists'
34,825
!cTokenInBank[cToken]
'bank already exists'
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/IERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/SafeERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC1155/IERC1155.sol'; import 'OpenZeppelin/[email protected]/contracts/math/SafeMath.sol'; import 'OpenZeppelin/[email protected]/contracts/math/Math.sol'; import './Governable.sol'; import './utils/ERC1155NaiveReceiver.sol'; import '../interfaces/IBank.sol'; import '../interfaces/ICErc20.sol'; import '../interfaces/IOracle.sol'; library HomoraSafeMath { using SafeMath for uint; /// @dev Computes round-up division. function ceilDiv(uint a, uint b) internal pure returns (uint) { } } contract HomoraCaster { /// @dev Call to the target using the given data. /// @param target The address target to call. /// @param data The data used in the call. function cast(address target, bytes calldata data) external payable { } } contract HomoraBank is Governable, ERC1155NaiveReceiver, IBank { using SafeMath for uint; using HomoraSafeMath for uint; using SafeERC20 for IERC20; uint private constant _NOT_ENTERED = 1; uint private constant _ENTERED = 2; uint private constant _NO_ID = uint(-1); address private constant _NO_ADDRESS = address(1); struct Bank { bool isListed; // Whether this market exists. uint8 index; // Reverse look up index for this bank. address cToken; // The CToken to draw liquidity from. uint reserve; // The reserve portion allocated to Homora protocol. uint totalDebt; // The last recorded total debt since last action. uint totalShare; // The total debt share count across all open positions. } struct Position { address owner; // The owner of this position. address collToken; // The ERC1155 token used as collateral for this position. uint collId; // The token id used as collateral. uint collateralSize; // The size of collateral token for this position. uint debtMap; // Bitmap of nonzero debt. i^th bit is set iff debt share of i^th bank is nonzero. mapping(address => uint) debtShareOf; // The debt share for each token. } uint public _GENERAL_LOCK; // TEMPORARY: re-entrancy lock guard. uint public _IN_EXEC_LOCK; // TEMPORARY: exec lock guard. uint public override POSITION_ID; // TEMPORARY: position ID currently under execution. address public override SPELL; // TEMPORARY: spell currently under execution. address public caster; // The caster address for untrusted execution. IOracle public oracle; // The oracle address for determining prices. uint public feeBps; // The fee collected as protocol reserve in basis points from interest. uint public override nextPositionId; // Next available position ID, starting from 1 (see initialize). address[] public allBanks; // The list of all listed banks. mapping(address => Bank) public banks; // Mapping from token to bank data. mapping(address => bool) public cTokenInBank; // Mapping from cToken to its existence in bank. mapping(uint => Position) public positions; // Mapping from position ID to position data. bool public allowContractCalls; // The boolean status whether to allow call from contract (false = onlyEOA) mapping(address => bool) public whitelistedTokens; // Mapping from token to whitelist status mapping(address => bool) public whitelistedSpells; // Mapping from spell to whitelist status mapping(address => bool) public whitelistedUsers; // Mapping from user to whitelist status uint public bankStatus; // Each bit stores certain bank status, e.g. borrow allowed, repay allowed /// @dev Ensure that the function is called from EOA when allowContractCalls is set to false and caller is not whitelisted modifier onlyEOAEx() { } /// @dev Reentrancy lock guard. modifier lock() { } /// @dev Ensure that the function is called from within the execution scope. modifier inExec() { } /// @dev Ensure that the interest rate of the given token is accrued. modifier poke(address token) { } /// @dev Initialize the bank smart contract, using msg.sender as the first governor. /// @param _oracle The oracle smart contract address. /// @param _feeBps The fee collected to Homora bank. function initialize(IOracle _oracle, uint _feeBps) external initializer { } /// @dev Return the current executor (the owner of the current position). function EXECUTOR() external view override returns (address) { } /// @dev Set allowContractCalls /// @param ok The status to set allowContractCalls to (false = onlyEOA) function setAllowContractCalls(bool ok) external onlyGov { } /// @dev Set whitelist spell status /// @param spells list of spells to change status /// @param statuses list of statuses to change to function setWhitelistSpells(address[] calldata spells, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist token status /// @param tokens list of tokens to change status /// @param statuses list of statuses to change to function setWhitelistTokens(address[] calldata tokens, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist user status /// @param users list of users to change status /// @param statuses list of statuses to change to function setWhitelistUsers(address[] calldata users, bool[] calldata statuses) external onlyGov { } /// @dev Check whether the oracle supports the token /// @param token ERC-20 token to check for support function support(address token) public view override returns (bool) { } /// @dev Set bank status /// @param _bankStatus new bank status to change to function setBankStatus(uint _bankStatus) external onlyGov { } /// @dev Bank borrow status allowed or not /// @notice check last bit of bankStatus function allowBorrowStatus() public view returns (bool) { } /// @dev Bank repay status allowed or not /// @notice Check second-to-last bit of bankStatus function allowRepayStatus() public view returns (bool) { } /// @dev Trigger interest accrual for the given bank. /// @param token The underlying token to trigger the interest accrual. function accrue(address token) public override { } /// @dev Convenient function to trigger interest accrual for a list of banks. /// @param tokens The list of banks to trigger interest accrual. function accrueAll(address[] memory tokens) external { } /// @dev Return the borrow balance for given position and token without triggering interest accrual. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceStored(uint positionId, address token) public view override returns (uint) { } /// @dev Trigger interest accrual and return the current borrow balance. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceCurrent(uint positionId, address token) external override returns (uint) { } /// @dev Return bank information for the given token. /// @param token The token address to query for bank information. function getBankInfo(address token) external view override returns ( bool isListed, address cToken, uint reserve, uint totalDebt, uint totalShare ) { } /// @dev Return position information for the given position id. /// @param positionId The position id to query for position information. function getPositionInfo(uint positionId) public view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return current position information function getCurrentPositionInfo() external view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return the debt share of the given bank token for the given position id. /// @param positionId position id to get debt of /// @param token ERC20 debt token to query function getPositionDebtShareOf(uint positionId, address token) external view returns (uint) { } /// @dev Return the list of all debts for the given position id. /// @param positionId position id to get debts of function getPositionDebts(uint positionId) external view returns (address[] memory tokens, uint[] memory debts) { } /// @dev Return the total collateral value of the given position in ETH. /// @param positionId The position ID to query for the collateral value. function getCollateralETHValue(uint positionId) public view returns (uint) { } /// @dev Return the total borrow value of the given position in ETH. /// @param positionId The position ID to query for the borrow value. function getBorrowETHValue(uint positionId) public view override returns (uint) { } /// @dev Add a new bank to the ecosystem. /// @param token The underlying token for the bank. /// @param cToken The address of the cToken smart contract. function addBank(address token, address cToken) external onlyGov { Bank storage bank = banks[token]; require(!cTokenInBank[cToken], 'cToken already exists'); require(<FILL_ME>) cTokenInBank[cToken] = true; bank.isListed = true; require(allBanks.length < 256, 'reach bank limit'); bank.index = uint8(allBanks.length); bank.cToken = cToken; IERC20(token).safeApprove(cToken, 0); IERC20(token).safeApprove(cToken, uint(-1)); allBanks.push(token); emit AddBank(token, cToken); } /// @dev Set the oracle smart contract address. /// @param _oracle The new oracle smart contract address. function setOracle(IOracle _oracle) external onlyGov { } /// @dev Set the fee bps value that Homora bank charges. /// @param _feeBps The new fee bps value. function setFeeBps(uint _feeBps) external onlyGov { } /// @dev Withdraw the reserve portion of the bank. /// @param amount The amount of tokens to withdraw. function withdrawReserve(address token, uint amount) external onlyGov lock { } /// @dev Liquidate a position. Pay debt for its owner and take the collateral. /// @param positionId The position ID to liquidate. /// @param debtToken The debt token to repay. /// @param amountCall The amount to repay when doing transferFrom call. function liquidate( uint positionId, address debtToken, uint amountCall ) external override lock poke(debtToken) { } /// @dev Execute the action via HomoraCaster, calling its function with the supplied data. /// @param positionId The position ID to execute the action, or zero for new position. /// @param spell The target spell to invoke the execution via HomoraCaster. /// @param data Extra data to pass to the target for the execution. function execute( uint positionId, address spell, bytes memory data ) external payable lock onlyEOAEx returns (uint) { } /// @dev Borrow tokens from that bank. Must only be called while under execution. /// @param token The token to borrow from the bank. /// @param amount The amount of tokens to borrow. function borrow(address token, uint amount) external override inExec poke(token) { } /// @dev Repay tokens to the bank. Must only be called while under execution. /// @param token The token to repay to the bank. /// @param amountCall The amount of tokens to repay via transferFrom. function repay(address token, uint amountCall) external override inExec poke(token) { } /// @dev Perform repay action. Return the amount actually taken and the debt share reduced. /// @param positionId The position ID to repay the debt. /// @param token The bank token to pay the debt. /// @param amountCall The amount to repay by calling transferFrom, or -1 for debt size. function repayInternal( uint positionId, address token, uint amountCall ) internal returns (uint, uint) { } /// @dev Transmit user assets to the caller, so users only need to approve Bank for spending. /// @param token The token to transfer from user to the caller. /// @param amount The amount to transfer. function transmit(address token, uint amount) external override inExec { } /// @dev Put more collateral for users. Must only be called during execution. /// @param collToken The ERC1155 token to collateral. /// @param collId The token id to collateral. /// @param amountCall The amount of tokens to put via transferFrom. function putCollateral( address collToken, uint collId, uint amountCall ) external override inExec { } /// @dev Take some collateral back. Must only be called during execution. /// @param collToken The ERC1155 token to take back. /// @param collId The token id to take back. /// @param amount The amount of tokens to take back via transfer. function takeCollateral( address collToken, uint collId, uint amount ) external override inExec { } /// @dev Internal function to perform borrow from the bank and return the amount received. /// @param token The token to perform borrow action. /// @param amountCall The amount use in the transferFrom call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doBorrow(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform repay to the bank and return the amount actually repaid. /// @param token The token to perform repay action. /// @param amountCall The amount to use in the repay call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doRepay(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC20 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC20TransferIn(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC1155 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param id The id to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC1155TransferIn( address token, uint id, uint amountCall ) internal returns (uint) { } }
!bank.isListed,'bank already exists'
34,825
!bank.isListed
'spell not whitelisted'
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/IERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/SafeERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC1155/IERC1155.sol'; import 'OpenZeppelin/[email protected]/contracts/math/SafeMath.sol'; import 'OpenZeppelin/[email protected]/contracts/math/Math.sol'; import './Governable.sol'; import './utils/ERC1155NaiveReceiver.sol'; import '../interfaces/IBank.sol'; import '../interfaces/ICErc20.sol'; import '../interfaces/IOracle.sol'; library HomoraSafeMath { using SafeMath for uint; /// @dev Computes round-up division. function ceilDiv(uint a, uint b) internal pure returns (uint) { } } contract HomoraCaster { /// @dev Call to the target using the given data. /// @param target The address target to call. /// @param data The data used in the call. function cast(address target, bytes calldata data) external payable { } } contract HomoraBank is Governable, ERC1155NaiveReceiver, IBank { using SafeMath for uint; using HomoraSafeMath for uint; using SafeERC20 for IERC20; uint private constant _NOT_ENTERED = 1; uint private constant _ENTERED = 2; uint private constant _NO_ID = uint(-1); address private constant _NO_ADDRESS = address(1); struct Bank { bool isListed; // Whether this market exists. uint8 index; // Reverse look up index for this bank. address cToken; // The CToken to draw liquidity from. uint reserve; // The reserve portion allocated to Homora protocol. uint totalDebt; // The last recorded total debt since last action. uint totalShare; // The total debt share count across all open positions. } struct Position { address owner; // The owner of this position. address collToken; // The ERC1155 token used as collateral for this position. uint collId; // The token id used as collateral. uint collateralSize; // The size of collateral token for this position. uint debtMap; // Bitmap of nonzero debt. i^th bit is set iff debt share of i^th bank is nonzero. mapping(address => uint) debtShareOf; // The debt share for each token. } uint public _GENERAL_LOCK; // TEMPORARY: re-entrancy lock guard. uint public _IN_EXEC_LOCK; // TEMPORARY: exec lock guard. uint public override POSITION_ID; // TEMPORARY: position ID currently under execution. address public override SPELL; // TEMPORARY: spell currently under execution. address public caster; // The caster address for untrusted execution. IOracle public oracle; // The oracle address for determining prices. uint public feeBps; // The fee collected as protocol reserve in basis points from interest. uint public override nextPositionId; // Next available position ID, starting from 1 (see initialize). address[] public allBanks; // The list of all listed banks. mapping(address => Bank) public banks; // Mapping from token to bank data. mapping(address => bool) public cTokenInBank; // Mapping from cToken to its existence in bank. mapping(uint => Position) public positions; // Mapping from position ID to position data. bool public allowContractCalls; // The boolean status whether to allow call from contract (false = onlyEOA) mapping(address => bool) public whitelistedTokens; // Mapping from token to whitelist status mapping(address => bool) public whitelistedSpells; // Mapping from spell to whitelist status mapping(address => bool) public whitelistedUsers; // Mapping from user to whitelist status uint public bankStatus; // Each bit stores certain bank status, e.g. borrow allowed, repay allowed /// @dev Ensure that the function is called from EOA when allowContractCalls is set to false and caller is not whitelisted modifier onlyEOAEx() { } /// @dev Reentrancy lock guard. modifier lock() { } /// @dev Ensure that the function is called from within the execution scope. modifier inExec() { } /// @dev Ensure that the interest rate of the given token is accrued. modifier poke(address token) { } /// @dev Initialize the bank smart contract, using msg.sender as the first governor. /// @param _oracle The oracle smart contract address. /// @param _feeBps The fee collected to Homora bank. function initialize(IOracle _oracle, uint _feeBps) external initializer { } /// @dev Return the current executor (the owner of the current position). function EXECUTOR() external view override returns (address) { } /// @dev Set allowContractCalls /// @param ok The status to set allowContractCalls to (false = onlyEOA) function setAllowContractCalls(bool ok) external onlyGov { } /// @dev Set whitelist spell status /// @param spells list of spells to change status /// @param statuses list of statuses to change to function setWhitelistSpells(address[] calldata spells, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist token status /// @param tokens list of tokens to change status /// @param statuses list of statuses to change to function setWhitelistTokens(address[] calldata tokens, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist user status /// @param users list of users to change status /// @param statuses list of statuses to change to function setWhitelistUsers(address[] calldata users, bool[] calldata statuses) external onlyGov { } /// @dev Check whether the oracle supports the token /// @param token ERC-20 token to check for support function support(address token) public view override returns (bool) { } /// @dev Set bank status /// @param _bankStatus new bank status to change to function setBankStatus(uint _bankStatus) external onlyGov { } /// @dev Bank borrow status allowed or not /// @notice check last bit of bankStatus function allowBorrowStatus() public view returns (bool) { } /// @dev Bank repay status allowed or not /// @notice Check second-to-last bit of bankStatus function allowRepayStatus() public view returns (bool) { } /// @dev Trigger interest accrual for the given bank. /// @param token The underlying token to trigger the interest accrual. function accrue(address token) public override { } /// @dev Convenient function to trigger interest accrual for a list of banks. /// @param tokens The list of banks to trigger interest accrual. function accrueAll(address[] memory tokens) external { } /// @dev Return the borrow balance for given position and token without triggering interest accrual. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceStored(uint positionId, address token) public view override returns (uint) { } /// @dev Trigger interest accrual and return the current borrow balance. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceCurrent(uint positionId, address token) external override returns (uint) { } /// @dev Return bank information for the given token. /// @param token The token address to query for bank information. function getBankInfo(address token) external view override returns ( bool isListed, address cToken, uint reserve, uint totalDebt, uint totalShare ) { } /// @dev Return position information for the given position id. /// @param positionId The position id to query for position information. function getPositionInfo(uint positionId) public view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return current position information function getCurrentPositionInfo() external view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return the debt share of the given bank token for the given position id. /// @param positionId position id to get debt of /// @param token ERC20 debt token to query function getPositionDebtShareOf(uint positionId, address token) external view returns (uint) { } /// @dev Return the list of all debts for the given position id. /// @param positionId position id to get debts of function getPositionDebts(uint positionId) external view returns (address[] memory tokens, uint[] memory debts) { } /// @dev Return the total collateral value of the given position in ETH. /// @param positionId The position ID to query for the collateral value. function getCollateralETHValue(uint positionId) public view returns (uint) { } /// @dev Return the total borrow value of the given position in ETH. /// @param positionId The position ID to query for the borrow value. function getBorrowETHValue(uint positionId) public view override returns (uint) { } /// @dev Add a new bank to the ecosystem. /// @param token The underlying token for the bank. /// @param cToken The address of the cToken smart contract. function addBank(address token, address cToken) external onlyGov { } /// @dev Set the oracle smart contract address. /// @param _oracle The new oracle smart contract address. function setOracle(IOracle _oracle) external onlyGov { } /// @dev Set the fee bps value that Homora bank charges. /// @param _feeBps The new fee bps value. function setFeeBps(uint _feeBps) external onlyGov { } /// @dev Withdraw the reserve portion of the bank. /// @param amount The amount of tokens to withdraw. function withdrawReserve(address token, uint amount) external onlyGov lock { } /// @dev Liquidate a position. Pay debt for its owner and take the collateral. /// @param positionId The position ID to liquidate. /// @param debtToken The debt token to repay. /// @param amountCall The amount to repay when doing transferFrom call. function liquidate( uint positionId, address debtToken, uint amountCall ) external override lock poke(debtToken) { } /// @dev Execute the action via HomoraCaster, calling its function with the supplied data. /// @param positionId The position ID to execute the action, or zero for new position. /// @param spell The target spell to invoke the execution via HomoraCaster. /// @param data Extra data to pass to the target for the execution. function execute( uint positionId, address spell, bytes memory data ) external payable lock onlyEOAEx returns (uint) { require(<FILL_ME>) if (positionId == 0) { positionId = nextPositionId++; positions[positionId].owner = msg.sender; } else { require(positionId < nextPositionId, 'position id not exists'); require(msg.sender == positions[positionId].owner, 'not position owner'); } POSITION_ID = positionId; SPELL = spell; HomoraCaster(caster).cast{value: msg.value}(spell, data); uint collateralValue = getCollateralETHValue(positionId); uint borrowValue = getBorrowETHValue(positionId); require(collateralValue >= borrowValue, 'insufficient collateral'); POSITION_ID = _NO_ID; SPELL = _NO_ADDRESS; return positionId; } /// @dev Borrow tokens from that bank. Must only be called while under execution. /// @param token The token to borrow from the bank. /// @param amount The amount of tokens to borrow. function borrow(address token, uint amount) external override inExec poke(token) { } /// @dev Repay tokens to the bank. Must only be called while under execution. /// @param token The token to repay to the bank. /// @param amountCall The amount of tokens to repay via transferFrom. function repay(address token, uint amountCall) external override inExec poke(token) { } /// @dev Perform repay action. Return the amount actually taken and the debt share reduced. /// @param positionId The position ID to repay the debt. /// @param token The bank token to pay the debt. /// @param amountCall The amount to repay by calling transferFrom, or -1 for debt size. function repayInternal( uint positionId, address token, uint amountCall ) internal returns (uint, uint) { } /// @dev Transmit user assets to the caller, so users only need to approve Bank for spending. /// @param token The token to transfer from user to the caller. /// @param amount The amount to transfer. function transmit(address token, uint amount) external override inExec { } /// @dev Put more collateral for users. Must only be called during execution. /// @param collToken The ERC1155 token to collateral. /// @param collId The token id to collateral. /// @param amountCall The amount of tokens to put via transferFrom. function putCollateral( address collToken, uint collId, uint amountCall ) external override inExec { } /// @dev Take some collateral back. Must only be called during execution. /// @param collToken The ERC1155 token to take back. /// @param collId The token id to take back. /// @param amount The amount of tokens to take back via transfer. function takeCollateral( address collToken, uint collId, uint amount ) external override inExec { } /// @dev Internal function to perform borrow from the bank and return the amount received. /// @param token The token to perform borrow action. /// @param amountCall The amount use in the transferFrom call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doBorrow(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform repay to the bank and return the amount actually repaid. /// @param token The token to perform repay action. /// @param amountCall The amount to use in the repay call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doRepay(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC20 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC20TransferIn(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC1155 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param id The id to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC1155TransferIn( address token, uint id, uint amountCall ) internal returns (uint) { } }
whitelistedSpells[spell],'spell not whitelisted'
34,825
whitelistedSpells[spell]
'borrow not allowed'
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/IERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/SafeERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC1155/IERC1155.sol'; import 'OpenZeppelin/[email protected]/contracts/math/SafeMath.sol'; import 'OpenZeppelin/[email protected]/contracts/math/Math.sol'; import './Governable.sol'; import './utils/ERC1155NaiveReceiver.sol'; import '../interfaces/IBank.sol'; import '../interfaces/ICErc20.sol'; import '../interfaces/IOracle.sol'; library HomoraSafeMath { using SafeMath for uint; /// @dev Computes round-up division. function ceilDiv(uint a, uint b) internal pure returns (uint) { } } contract HomoraCaster { /// @dev Call to the target using the given data. /// @param target The address target to call. /// @param data The data used in the call. function cast(address target, bytes calldata data) external payable { } } contract HomoraBank is Governable, ERC1155NaiveReceiver, IBank { using SafeMath for uint; using HomoraSafeMath for uint; using SafeERC20 for IERC20; uint private constant _NOT_ENTERED = 1; uint private constant _ENTERED = 2; uint private constant _NO_ID = uint(-1); address private constant _NO_ADDRESS = address(1); struct Bank { bool isListed; // Whether this market exists. uint8 index; // Reverse look up index for this bank. address cToken; // The CToken to draw liquidity from. uint reserve; // The reserve portion allocated to Homora protocol. uint totalDebt; // The last recorded total debt since last action. uint totalShare; // The total debt share count across all open positions. } struct Position { address owner; // The owner of this position. address collToken; // The ERC1155 token used as collateral for this position. uint collId; // The token id used as collateral. uint collateralSize; // The size of collateral token for this position. uint debtMap; // Bitmap of nonzero debt. i^th bit is set iff debt share of i^th bank is nonzero. mapping(address => uint) debtShareOf; // The debt share for each token. } uint public _GENERAL_LOCK; // TEMPORARY: re-entrancy lock guard. uint public _IN_EXEC_LOCK; // TEMPORARY: exec lock guard. uint public override POSITION_ID; // TEMPORARY: position ID currently under execution. address public override SPELL; // TEMPORARY: spell currently under execution. address public caster; // The caster address for untrusted execution. IOracle public oracle; // The oracle address for determining prices. uint public feeBps; // The fee collected as protocol reserve in basis points from interest. uint public override nextPositionId; // Next available position ID, starting from 1 (see initialize). address[] public allBanks; // The list of all listed banks. mapping(address => Bank) public banks; // Mapping from token to bank data. mapping(address => bool) public cTokenInBank; // Mapping from cToken to its existence in bank. mapping(uint => Position) public positions; // Mapping from position ID to position data. bool public allowContractCalls; // The boolean status whether to allow call from contract (false = onlyEOA) mapping(address => bool) public whitelistedTokens; // Mapping from token to whitelist status mapping(address => bool) public whitelistedSpells; // Mapping from spell to whitelist status mapping(address => bool) public whitelistedUsers; // Mapping from user to whitelist status uint public bankStatus; // Each bit stores certain bank status, e.g. borrow allowed, repay allowed /// @dev Ensure that the function is called from EOA when allowContractCalls is set to false and caller is not whitelisted modifier onlyEOAEx() { } /// @dev Reentrancy lock guard. modifier lock() { } /// @dev Ensure that the function is called from within the execution scope. modifier inExec() { } /// @dev Ensure that the interest rate of the given token is accrued. modifier poke(address token) { } /// @dev Initialize the bank smart contract, using msg.sender as the first governor. /// @param _oracle The oracle smart contract address. /// @param _feeBps The fee collected to Homora bank. function initialize(IOracle _oracle, uint _feeBps) external initializer { } /// @dev Return the current executor (the owner of the current position). function EXECUTOR() external view override returns (address) { } /// @dev Set allowContractCalls /// @param ok The status to set allowContractCalls to (false = onlyEOA) function setAllowContractCalls(bool ok) external onlyGov { } /// @dev Set whitelist spell status /// @param spells list of spells to change status /// @param statuses list of statuses to change to function setWhitelistSpells(address[] calldata spells, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist token status /// @param tokens list of tokens to change status /// @param statuses list of statuses to change to function setWhitelistTokens(address[] calldata tokens, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist user status /// @param users list of users to change status /// @param statuses list of statuses to change to function setWhitelistUsers(address[] calldata users, bool[] calldata statuses) external onlyGov { } /// @dev Check whether the oracle supports the token /// @param token ERC-20 token to check for support function support(address token) public view override returns (bool) { } /// @dev Set bank status /// @param _bankStatus new bank status to change to function setBankStatus(uint _bankStatus) external onlyGov { } /// @dev Bank borrow status allowed or not /// @notice check last bit of bankStatus function allowBorrowStatus() public view returns (bool) { } /// @dev Bank repay status allowed or not /// @notice Check second-to-last bit of bankStatus function allowRepayStatus() public view returns (bool) { } /// @dev Trigger interest accrual for the given bank. /// @param token The underlying token to trigger the interest accrual. function accrue(address token) public override { } /// @dev Convenient function to trigger interest accrual for a list of banks. /// @param tokens The list of banks to trigger interest accrual. function accrueAll(address[] memory tokens) external { } /// @dev Return the borrow balance for given position and token without triggering interest accrual. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceStored(uint positionId, address token) public view override returns (uint) { } /// @dev Trigger interest accrual and return the current borrow balance. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceCurrent(uint positionId, address token) external override returns (uint) { } /// @dev Return bank information for the given token. /// @param token The token address to query for bank information. function getBankInfo(address token) external view override returns ( bool isListed, address cToken, uint reserve, uint totalDebt, uint totalShare ) { } /// @dev Return position information for the given position id. /// @param positionId The position id to query for position information. function getPositionInfo(uint positionId) public view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return current position information function getCurrentPositionInfo() external view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return the debt share of the given bank token for the given position id. /// @param positionId position id to get debt of /// @param token ERC20 debt token to query function getPositionDebtShareOf(uint positionId, address token) external view returns (uint) { } /// @dev Return the list of all debts for the given position id. /// @param positionId position id to get debts of function getPositionDebts(uint positionId) external view returns (address[] memory tokens, uint[] memory debts) { } /// @dev Return the total collateral value of the given position in ETH. /// @param positionId The position ID to query for the collateral value. function getCollateralETHValue(uint positionId) public view returns (uint) { } /// @dev Return the total borrow value of the given position in ETH. /// @param positionId The position ID to query for the borrow value. function getBorrowETHValue(uint positionId) public view override returns (uint) { } /// @dev Add a new bank to the ecosystem. /// @param token The underlying token for the bank. /// @param cToken The address of the cToken smart contract. function addBank(address token, address cToken) external onlyGov { } /// @dev Set the oracle smart contract address. /// @param _oracle The new oracle smart contract address. function setOracle(IOracle _oracle) external onlyGov { } /// @dev Set the fee bps value that Homora bank charges. /// @param _feeBps The new fee bps value. function setFeeBps(uint _feeBps) external onlyGov { } /// @dev Withdraw the reserve portion of the bank. /// @param amount The amount of tokens to withdraw. function withdrawReserve(address token, uint amount) external onlyGov lock { } /// @dev Liquidate a position. Pay debt for its owner and take the collateral. /// @param positionId The position ID to liquidate. /// @param debtToken The debt token to repay. /// @param amountCall The amount to repay when doing transferFrom call. function liquidate( uint positionId, address debtToken, uint amountCall ) external override lock poke(debtToken) { } /// @dev Execute the action via HomoraCaster, calling its function with the supplied data. /// @param positionId The position ID to execute the action, or zero for new position. /// @param spell The target spell to invoke the execution via HomoraCaster. /// @param data Extra data to pass to the target for the execution. function execute( uint positionId, address spell, bytes memory data ) external payable lock onlyEOAEx returns (uint) { } /// @dev Borrow tokens from that bank. Must only be called while under execution. /// @param token The token to borrow from the bank. /// @param amount The amount of tokens to borrow. function borrow(address token, uint amount) external override inExec poke(token) { require(<FILL_ME>) require(whitelistedTokens[token], 'token not whitelisted'); Bank storage bank = banks[token]; Position storage pos = positions[POSITION_ID]; uint totalShare = bank.totalShare; uint totalDebt = bank.totalDebt; uint share = totalShare == 0 ? amount : amount.mul(totalShare).ceilDiv(totalDebt); bank.totalShare = bank.totalShare.add(share); uint newShare = pos.debtShareOf[token].add(share); pos.debtShareOf[token] = newShare; if (newShare > 0) { pos.debtMap |= (1 << uint(bank.index)); } IERC20(token).safeTransfer(msg.sender, doBorrow(token, amount)); emit Borrow(POSITION_ID, msg.sender, token, amount, share); } /// @dev Repay tokens to the bank. Must only be called while under execution. /// @param token The token to repay to the bank. /// @param amountCall The amount of tokens to repay via transferFrom. function repay(address token, uint amountCall) external override inExec poke(token) { } /// @dev Perform repay action. Return the amount actually taken and the debt share reduced. /// @param positionId The position ID to repay the debt. /// @param token The bank token to pay the debt. /// @param amountCall The amount to repay by calling transferFrom, or -1 for debt size. function repayInternal( uint positionId, address token, uint amountCall ) internal returns (uint, uint) { } /// @dev Transmit user assets to the caller, so users only need to approve Bank for spending. /// @param token The token to transfer from user to the caller. /// @param amount The amount to transfer. function transmit(address token, uint amount) external override inExec { } /// @dev Put more collateral for users. Must only be called during execution. /// @param collToken The ERC1155 token to collateral. /// @param collId The token id to collateral. /// @param amountCall The amount of tokens to put via transferFrom. function putCollateral( address collToken, uint collId, uint amountCall ) external override inExec { } /// @dev Take some collateral back. Must only be called during execution. /// @param collToken The ERC1155 token to take back. /// @param collId The token id to take back. /// @param amount The amount of tokens to take back via transfer. function takeCollateral( address collToken, uint collId, uint amount ) external override inExec { } /// @dev Internal function to perform borrow from the bank and return the amount received. /// @param token The token to perform borrow action. /// @param amountCall The amount use in the transferFrom call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doBorrow(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform repay to the bank and return the amount actually repaid. /// @param token The token to perform repay action. /// @param amountCall The amount to use in the repay call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doRepay(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC20 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC20TransferIn(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC1155 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param id The id to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC1155TransferIn( address token, uint id, uint amountCall ) internal returns (uint) { } }
allowBorrowStatus(),'borrow not allowed'
34,825
allowBorrowStatus()
'token not whitelisted'
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/IERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/SafeERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC1155/IERC1155.sol'; import 'OpenZeppelin/[email protected]/contracts/math/SafeMath.sol'; import 'OpenZeppelin/[email protected]/contracts/math/Math.sol'; import './Governable.sol'; import './utils/ERC1155NaiveReceiver.sol'; import '../interfaces/IBank.sol'; import '../interfaces/ICErc20.sol'; import '../interfaces/IOracle.sol'; library HomoraSafeMath { using SafeMath for uint; /// @dev Computes round-up division. function ceilDiv(uint a, uint b) internal pure returns (uint) { } } contract HomoraCaster { /// @dev Call to the target using the given data. /// @param target The address target to call. /// @param data The data used in the call. function cast(address target, bytes calldata data) external payable { } } contract HomoraBank is Governable, ERC1155NaiveReceiver, IBank { using SafeMath for uint; using HomoraSafeMath for uint; using SafeERC20 for IERC20; uint private constant _NOT_ENTERED = 1; uint private constant _ENTERED = 2; uint private constant _NO_ID = uint(-1); address private constant _NO_ADDRESS = address(1); struct Bank { bool isListed; // Whether this market exists. uint8 index; // Reverse look up index for this bank. address cToken; // The CToken to draw liquidity from. uint reserve; // The reserve portion allocated to Homora protocol. uint totalDebt; // The last recorded total debt since last action. uint totalShare; // The total debt share count across all open positions. } struct Position { address owner; // The owner of this position. address collToken; // The ERC1155 token used as collateral for this position. uint collId; // The token id used as collateral. uint collateralSize; // The size of collateral token for this position. uint debtMap; // Bitmap of nonzero debt. i^th bit is set iff debt share of i^th bank is nonzero. mapping(address => uint) debtShareOf; // The debt share for each token. } uint public _GENERAL_LOCK; // TEMPORARY: re-entrancy lock guard. uint public _IN_EXEC_LOCK; // TEMPORARY: exec lock guard. uint public override POSITION_ID; // TEMPORARY: position ID currently under execution. address public override SPELL; // TEMPORARY: spell currently under execution. address public caster; // The caster address for untrusted execution. IOracle public oracle; // The oracle address for determining prices. uint public feeBps; // The fee collected as protocol reserve in basis points from interest. uint public override nextPositionId; // Next available position ID, starting from 1 (see initialize). address[] public allBanks; // The list of all listed banks. mapping(address => Bank) public banks; // Mapping from token to bank data. mapping(address => bool) public cTokenInBank; // Mapping from cToken to its existence in bank. mapping(uint => Position) public positions; // Mapping from position ID to position data. bool public allowContractCalls; // The boolean status whether to allow call from contract (false = onlyEOA) mapping(address => bool) public whitelistedTokens; // Mapping from token to whitelist status mapping(address => bool) public whitelistedSpells; // Mapping from spell to whitelist status mapping(address => bool) public whitelistedUsers; // Mapping from user to whitelist status uint public bankStatus; // Each bit stores certain bank status, e.g. borrow allowed, repay allowed /// @dev Ensure that the function is called from EOA when allowContractCalls is set to false and caller is not whitelisted modifier onlyEOAEx() { } /// @dev Reentrancy lock guard. modifier lock() { } /// @dev Ensure that the function is called from within the execution scope. modifier inExec() { } /// @dev Ensure that the interest rate of the given token is accrued. modifier poke(address token) { } /// @dev Initialize the bank smart contract, using msg.sender as the first governor. /// @param _oracle The oracle smart contract address. /// @param _feeBps The fee collected to Homora bank. function initialize(IOracle _oracle, uint _feeBps) external initializer { } /// @dev Return the current executor (the owner of the current position). function EXECUTOR() external view override returns (address) { } /// @dev Set allowContractCalls /// @param ok The status to set allowContractCalls to (false = onlyEOA) function setAllowContractCalls(bool ok) external onlyGov { } /// @dev Set whitelist spell status /// @param spells list of spells to change status /// @param statuses list of statuses to change to function setWhitelistSpells(address[] calldata spells, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist token status /// @param tokens list of tokens to change status /// @param statuses list of statuses to change to function setWhitelistTokens(address[] calldata tokens, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist user status /// @param users list of users to change status /// @param statuses list of statuses to change to function setWhitelistUsers(address[] calldata users, bool[] calldata statuses) external onlyGov { } /// @dev Check whether the oracle supports the token /// @param token ERC-20 token to check for support function support(address token) public view override returns (bool) { } /// @dev Set bank status /// @param _bankStatus new bank status to change to function setBankStatus(uint _bankStatus) external onlyGov { } /// @dev Bank borrow status allowed or not /// @notice check last bit of bankStatus function allowBorrowStatus() public view returns (bool) { } /// @dev Bank repay status allowed or not /// @notice Check second-to-last bit of bankStatus function allowRepayStatus() public view returns (bool) { } /// @dev Trigger interest accrual for the given bank. /// @param token The underlying token to trigger the interest accrual. function accrue(address token) public override { } /// @dev Convenient function to trigger interest accrual for a list of banks. /// @param tokens The list of banks to trigger interest accrual. function accrueAll(address[] memory tokens) external { } /// @dev Return the borrow balance for given position and token without triggering interest accrual. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceStored(uint positionId, address token) public view override returns (uint) { } /// @dev Trigger interest accrual and return the current borrow balance. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceCurrent(uint positionId, address token) external override returns (uint) { } /// @dev Return bank information for the given token. /// @param token The token address to query for bank information. function getBankInfo(address token) external view override returns ( bool isListed, address cToken, uint reserve, uint totalDebt, uint totalShare ) { } /// @dev Return position information for the given position id. /// @param positionId The position id to query for position information. function getPositionInfo(uint positionId) public view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return current position information function getCurrentPositionInfo() external view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return the debt share of the given bank token for the given position id. /// @param positionId position id to get debt of /// @param token ERC20 debt token to query function getPositionDebtShareOf(uint positionId, address token) external view returns (uint) { } /// @dev Return the list of all debts for the given position id. /// @param positionId position id to get debts of function getPositionDebts(uint positionId) external view returns (address[] memory tokens, uint[] memory debts) { } /// @dev Return the total collateral value of the given position in ETH. /// @param positionId The position ID to query for the collateral value. function getCollateralETHValue(uint positionId) public view returns (uint) { } /// @dev Return the total borrow value of the given position in ETH. /// @param positionId The position ID to query for the borrow value. function getBorrowETHValue(uint positionId) public view override returns (uint) { } /// @dev Add a new bank to the ecosystem. /// @param token The underlying token for the bank. /// @param cToken The address of the cToken smart contract. function addBank(address token, address cToken) external onlyGov { } /// @dev Set the oracle smart contract address. /// @param _oracle The new oracle smart contract address. function setOracle(IOracle _oracle) external onlyGov { } /// @dev Set the fee bps value that Homora bank charges. /// @param _feeBps The new fee bps value. function setFeeBps(uint _feeBps) external onlyGov { } /// @dev Withdraw the reserve portion of the bank. /// @param amount The amount of tokens to withdraw. function withdrawReserve(address token, uint amount) external onlyGov lock { } /// @dev Liquidate a position. Pay debt for its owner and take the collateral. /// @param positionId The position ID to liquidate. /// @param debtToken The debt token to repay. /// @param amountCall The amount to repay when doing transferFrom call. function liquidate( uint positionId, address debtToken, uint amountCall ) external override lock poke(debtToken) { } /// @dev Execute the action via HomoraCaster, calling its function with the supplied data. /// @param positionId The position ID to execute the action, or zero for new position. /// @param spell The target spell to invoke the execution via HomoraCaster. /// @param data Extra data to pass to the target for the execution. function execute( uint positionId, address spell, bytes memory data ) external payable lock onlyEOAEx returns (uint) { } /// @dev Borrow tokens from that bank. Must only be called while under execution. /// @param token The token to borrow from the bank. /// @param amount The amount of tokens to borrow. function borrow(address token, uint amount) external override inExec poke(token) { require(allowBorrowStatus(), 'borrow not allowed'); require(<FILL_ME>) Bank storage bank = banks[token]; Position storage pos = positions[POSITION_ID]; uint totalShare = bank.totalShare; uint totalDebt = bank.totalDebt; uint share = totalShare == 0 ? amount : amount.mul(totalShare).ceilDiv(totalDebt); bank.totalShare = bank.totalShare.add(share); uint newShare = pos.debtShareOf[token].add(share); pos.debtShareOf[token] = newShare; if (newShare > 0) { pos.debtMap |= (1 << uint(bank.index)); } IERC20(token).safeTransfer(msg.sender, doBorrow(token, amount)); emit Borrow(POSITION_ID, msg.sender, token, amount, share); } /// @dev Repay tokens to the bank. Must only be called while under execution. /// @param token The token to repay to the bank. /// @param amountCall The amount of tokens to repay via transferFrom. function repay(address token, uint amountCall) external override inExec poke(token) { } /// @dev Perform repay action. Return the amount actually taken and the debt share reduced. /// @param positionId The position ID to repay the debt. /// @param token The bank token to pay the debt. /// @param amountCall The amount to repay by calling transferFrom, or -1 for debt size. function repayInternal( uint positionId, address token, uint amountCall ) internal returns (uint, uint) { } /// @dev Transmit user assets to the caller, so users only need to approve Bank for spending. /// @param token The token to transfer from user to the caller. /// @param amount The amount to transfer. function transmit(address token, uint amount) external override inExec { } /// @dev Put more collateral for users. Must only be called during execution. /// @param collToken The ERC1155 token to collateral. /// @param collId The token id to collateral. /// @param amountCall The amount of tokens to put via transferFrom. function putCollateral( address collToken, uint collId, uint amountCall ) external override inExec { } /// @dev Take some collateral back. Must only be called during execution. /// @param collToken The ERC1155 token to take back. /// @param collId The token id to take back. /// @param amount The amount of tokens to take back via transfer. function takeCollateral( address collToken, uint collId, uint amount ) external override inExec { } /// @dev Internal function to perform borrow from the bank and return the amount received. /// @param token The token to perform borrow action. /// @param amountCall The amount use in the transferFrom call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doBorrow(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform repay to the bank and return the amount actually repaid. /// @param token The token to perform repay action. /// @param amountCall The amount to use in the repay call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doRepay(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC20 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC20TransferIn(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC1155 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param id The id to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC1155TransferIn( address token, uint id, uint amountCall ) internal returns (uint) { } }
whitelistedTokens[token],'token not whitelisted'
34,825
whitelistedTokens[token]
'repay not allowed'
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/IERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/SafeERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC1155/IERC1155.sol'; import 'OpenZeppelin/[email protected]/contracts/math/SafeMath.sol'; import 'OpenZeppelin/[email protected]/contracts/math/Math.sol'; import './Governable.sol'; import './utils/ERC1155NaiveReceiver.sol'; import '../interfaces/IBank.sol'; import '../interfaces/ICErc20.sol'; import '../interfaces/IOracle.sol'; library HomoraSafeMath { using SafeMath for uint; /// @dev Computes round-up division. function ceilDiv(uint a, uint b) internal pure returns (uint) { } } contract HomoraCaster { /// @dev Call to the target using the given data. /// @param target The address target to call. /// @param data The data used in the call. function cast(address target, bytes calldata data) external payable { } } contract HomoraBank is Governable, ERC1155NaiveReceiver, IBank { using SafeMath for uint; using HomoraSafeMath for uint; using SafeERC20 for IERC20; uint private constant _NOT_ENTERED = 1; uint private constant _ENTERED = 2; uint private constant _NO_ID = uint(-1); address private constant _NO_ADDRESS = address(1); struct Bank { bool isListed; // Whether this market exists. uint8 index; // Reverse look up index for this bank. address cToken; // The CToken to draw liquidity from. uint reserve; // The reserve portion allocated to Homora protocol. uint totalDebt; // The last recorded total debt since last action. uint totalShare; // The total debt share count across all open positions. } struct Position { address owner; // The owner of this position. address collToken; // The ERC1155 token used as collateral for this position. uint collId; // The token id used as collateral. uint collateralSize; // The size of collateral token for this position. uint debtMap; // Bitmap of nonzero debt. i^th bit is set iff debt share of i^th bank is nonzero. mapping(address => uint) debtShareOf; // The debt share for each token. } uint public _GENERAL_LOCK; // TEMPORARY: re-entrancy lock guard. uint public _IN_EXEC_LOCK; // TEMPORARY: exec lock guard. uint public override POSITION_ID; // TEMPORARY: position ID currently under execution. address public override SPELL; // TEMPORARY: spell currently under execution. address public caster; // The caster address for untrusted execution. IOracle public oracle; // The oracle address for determining prices. uint public feeBps; // The fee collected as protocol reserve in basis points from interest. uint public override nextPositionId; // Next available position ID, starting from 1 (see initialize). address[] public allBanks; // The list of all listed banks. mapping(address => Bank) public banks; // Mapping from token to bank data. mapping(address => bool) public cTokenInBank; // Mapping from cToken to its existence in bank. mapping(uint => Position) public positions; // Mapping from position ID to position data. bool public allowContractCalls; // The boolean status whether to allow call from contract (false = onlyEOA) mapping(address => bool) public whitelistedTokens; // Mapping from token to whitelist status mapping(address => bool) public whitelistedSpells; // Mapping from spell to whitelist status mapping(address => bool) public whitelistedUsers; // Mapping from user to whitelist status uint public bankStatus; // Each bit stores certain bank status, e.g. borrow allowed, repay allowed /// @dev Ensure that the function is called from EOA when allowContractCalls is set to false and caller is not whitelisted modifier onlyEOAEx() { } /// @dev Reentrancy lock guard. modifier lock() { } /// @dev Ensure that the function is called from within the execution scope. modifier inExec() { } /// @dev Ensure that the interest rate of the given token is accrued. modifier poke(address token) { } /// @dev Initialize the bank smart contract, using msg.sender as the first governor. /// @param _oracle The oracle smart contract address. /// @param _feeBps The fee collected to Homora bank. function initialize(IOracle _oracle, uint _feeBps) external initializer { } /// @dev Return the current executor (the owner of the current position). function EXECUTOR() external view override returns (address) { } /// @dev Set allowContractCalls /// @param ok The status to set allowContractCalls to (false = onlyEOA) function setAllowContractCalls(bool ok) external onlyGov { } /// @dev Set whitelist spell status /// @param spells list of spells to change status /// @param statuses list of statuses to change to function setWhitelistSpells(address[] calldata spells, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist token status /// @param tokens list of tokens to change status /// @param statuses list of statuses to change to function setWhitelistTokens(address[] calldata tokens, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist user status /// @param users list of users to change status /// @param statuses list of statuses to change to function setWhitelistUsers(address[] calldata users, bool[] calldata statuses) external onlyGov { } /// @dev Check whether the oracle supports the token /// @param token ERC-20 token to check for support function support(address token) public view override returns (bool) { } /// @dev Set bank status /// @param _bankStatus new bank status to change to function setBankStatus(uint _bankStatus) external onlyGov { } /// @dev Bank borrow status allowed or not /// @notice check last bit of bankStatus function allowBorrowStatus() public view returns (bool) { } /// @dev Bank repay status allowed or not /// @notice Check second-to-last bit of bankStatus function allowRepayStatus() public view returns (bool) { } /// @dev Trigger interest accrual for the given bank. /// @param token The underlying token to trigger the interest accrual. function accrue(address token) public override { } /// @dev Convenient function to trigger interest accrual for a list of banks. /// @param tokens The list of banks to trigger interest accrual. function accrueAll(address[] memory tokens) external { } /// @dev Return the borrow balance for given position and token without triggering interest accrual. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceStored(uint positionId, address token) public view override returns (uint) { } /// @dev Trigger interest accrual and return the current borrow balance. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceCurrent(uint positionId, address token) external override returns (uint) { } /// @dev Return bank information for the given token. /// @param token The token address to query for bank information. function getBankInfo(address token) external view override returns ( bool isListed, address cToken, uint reserve, uint totalDebt, uint totalShare ) { } /// @dev Return position information for the given position id. /// @param positionId The position id to query for position information. function getPositionInfo(uint positionId) public view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return current position information function getCurrentPositionInfo() external view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return the debt share of the given bank token for the given position id. /// @param positionId position id to get debt of /// @param token ERC20 debt token to query function getPositionDebtShareOf(uint positionId, address token) external view returns (uint) { } /// @dev Return the list of all debts for the given position id. /// @param positionId position id to get debts of function getPositionDebts(uint positionId) external view returns (address[] memory tokens, uint[] memory debts) { } /// @dev Return the total collateral value of the given position in ETH. /// @param positionId The position ID to query for the collateral value. function getCollateralETHValue(uint positionId) public view returns (uint) { } /// @dev Return the total borrow value of the given position in ETH. /// @param positionId The position ID to query for the borrow value. function getBorrowETHValue(uint positionId) public view override returns (uint) { } /// @dev Add a new bank to the ecosystem. /// @param token The underlying token for the bank. /// @param cToken The address of the cToken smart contract. function addBank(address token, address cToken) external onlyGov { } /// @dev Set the oracle smart contract address. /// @param _oracle The new oracle smart contract address. function setOracle(IOracle _oracle) external onlyGov { } /// @dev Set the fee bps value that Homora bank charges. /// @param _feeBps The new fee bps value. function setFeeBps(uint _feeBps) external onlyGov { } /// @dev Withdraw the reserve portion of the bank. /// @param amount The amount of tokens to withdraw. function withdrawReserve(address token, uint amount) external onlyGov lock { } /// @dev Liquidate a position. Pay debt for its owner and take the collateral. /// @param positionId The position ID to liquidate. /// @param debtToken The debt token to repay. /// @param amountCall The amount to repay when doing transferFrom call. function liquidate( uint positionId, address debtToken, uint amountCall ) external override lock poke(debtToken) { } /// @dev Execute the action via HomoraCaster, calling its function with the supplied data. /// @param positionId The position ID to execute the action, or zero for new position. /// @param spell The target spell to invoke the execution via HomoraCaster. /// @param data Extra data to pass to the target for the execution. function execute( uint positionId, address spell, bytes memory data ) external payable lock onlyEOAEx returns (uint) { } /// @dev Borrow tokens from that bank. Must only be called while under execution. /// @param token The token to borrow from the bank. /// @param amount The amount of tokens to borrow. function borrow(address token, uint amount) external override inExec poke(token) { } /// @dev Repay tokens to the bank. Must only be called while under execution. /// @param token The token to repay to the bank. /// @param amountCall The amount of tokens to repay via transferFrom. function repay(address token, uint amountCall) external override inExec poke(token) { require(<FILL_ME>) require(whitelistedTokens[token], 'token not whitelisted'); (uint amount, uint share) = repayInternal(POSITION_ID, token, amountCall); emit Repay(POSITION_ID, msg.sender, token, amount, share); } /// @dev Perform repay action. Return the amount actually taken and the debt share reduced. /// @param positionId The position ID to repay the debt. /// @param token The bank token to pay the debt. /// @param amountCall The amount to repay by calling transferFrom, or -1 for debt size. function repayInternal( uint positionId, address token, uint amountCall ) internal returns (uint, uint) { } /// @dev Transmit user assets to the caller, so users only need to approve Bank for spending. /// @param token The token to transfer from user to the caller. /// @param amount The amount to transfer. function transmit(address token, uint amount) external override inExec { } /// @dev Put more collateral for users. Must only be called during execution. /// @param collToken The ERC1155 token to collateral. /// @param collId The token id to collateral. /// @param amountCall The amount of tokens to put via transferFrom. function putCollateral( address collToken, uint collId, uint amountCall ) external override inExec { } /// @dev Take some collateral back. Must only be called during execution. /// @param collToken The ERC1155 token to take back. /// @param collId The token id to take back. /// @param amount The amount of tokens to take back via transfer. function takeCollateral( address collToken, uint collId, uint amount ) external override inExec { } /// @dev Internal function to perform borrow from the bank and return the amount received. /// @param token The token to perform borrow action. /// @param amountCall The amount use in the transferFrom call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doBorrow(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform repay to the bank and return the amount actually repaid. /// @param token The token to perform repay action. /// @param amountCall The amount to use in the repay call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doRepay(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC20 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC20TransferIn(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC1155 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param id The id to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC1155TransferIn( address token, uint id, uint amountCall ) internal returns (uint) { } }
allowRepayStatus(),'repay not allowed'
34,825
allowRepayStatus()
'collateral not supported'
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/IERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/SafeERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC1155/IERC1155.sol'; import 'OpenZeppelin/[email protected]/contracts/math/SafeMath.sol'; import 'OpenZeppelin/[email protected]/contracts/math/Math.sol'; import './Governable.sol'; import './utils/ERC1155NaiveReceiver.sol'; import '../interfaces/IBank.sol'; import '../interfaces/ICErc20.sol'; import '../interfaces/IOracle.sol'; library HomoraSafeMath { using SafeMath for uint; /// @dev Computes round-up division. function ceilDiv(uint a, uint b) internal pure returns (uint) { } } contract HomoraCaster { /// @dev Call to the target using the given data. /// @param target The address target to call. /// @param data The data used in the call. function cast(address target, bytes calldata data) external payable { } } contract HomoraBank is Governable, ERC1155NaiveReceiver, IBank { using SafeMath for uint; using HomoraSafeMath for uint; using SafeERC20 for IERC20; uint private constant _NOT_ENTERED = 1; uint private constant _ENTERED = 2; uint private constant _NO_ID = uint(-1); address private constant _NO_ADDRESS = address(1); struct Bank { bool isListed; // Whether this market exists. uint8 index; // Reverse look up index for this bank. address cToken; // The CToken to draw liquidity from. uint reserve; // The reserve portion allocated to Homora protocol. uint totalDebt; // The last recorded total debt since last action. uint totalShare; // The total debt share count across all open positions. } struct Position { address owner; // The owner of this position. address collToken; // The ERC1155 token used as collateral for this position. uint collId; // The token id used as collateral. uint collateralSize; // The size of collateral token for this position. uint debtMap; // Bitmap of nonzero debt. i^th bit is set iff debt share of i^th bank is nonzero. mapping(address => uint) debtShareOf; // The debt share for each token. } uint public _GENERAL_LOCK; // TEMPORARY: re-entrancy lock guard. uint public _IN_EXEC_LOCK; // TEMPORARY: exec lock guard. uint public override POSITION_ID; // TEMPORARY: position ID currently under execution. address public override SPELL; // TEMPORARY: spell currently under execution. address public caster; // The caster address for untrusted execution. IOracle public oracle; // The oracle address for determining prices. uint public feeBps; // The fee collected as protocol reserve in basis points from interest. uint public override nextPositionId; // Next available position ID, starting from 1 (see initialize). address[] public allBanks; // The list of all listed banks. mapping(address => Bank) public banks; // Mapping from token to bank data. mapping(address => bool) public cTokenInBank; // Mapping from cToken to its existence in bank. mapping(uint => Position) public positions; // Mapping from position ID to position data. bool public allowContractCalls; // The boolean status whether to allow call from contract (false = onlyEOA) mapping(address => bool) public whitelistedTokens; // Mapping from token to whitelist status mapping(address => bool) public whitelistedSpells; // Mapping from spell to whitelist status mapping(address => bool) public whitelistedUsers; // Mapping from user to whitelist status uint public bankStatus; // Each bit stores certain bank status, e.g. borrow allowed, repay allowed /// @dev Ensure that the function is called from EOA when allowContractCalls is set to false and caller is not whitelisted modifier onlyEOAEx() { } /// @dev Reentrancy lock guard. modifier lock() { } /// @dev Ensure that the function is called from within the execution scope. modifier inExec() { } /// @dev Ensure that the interest rate of the given token is accrued. modifier poke(address token) { } /// @dev Initialize the bank smart contract, using msg.sender as the first governor. /// @param _oracle The oracle smart contract address. /// @param _feeBps The fee collected to Homora bank. function initialize(IOracle _oracle, uint _feeBps) external initializer { } /// @dev Return the current executor (the owner of the current position). function EXECUTOR() external view override returns (address) { } /// @dev Set allowContractCalls /// @param ok The status to set allowContractCalls to (false = onlyEOA) function setAllowContractCalls(bool ok) external onlyGov { } /// @dev Set whitelist spell status /// @param spells list of spells to change status /// @param statuses list of statuses to change to function setWhitelistSpells(address[] calldata spells, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist token status /// @param tokens list of tokens to change status /// @param statuses list of statuses to change to function setWhitelistTokens(address[] calldata tokens, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist user status /// @param users list of users to change status /// @param statuses list of statuses to change to function setWhitelistUsers(address[] calldata users, bool[] calldata statuses) external onlyGov { } /// @dev Check whether the oracle supports the token /// @param token ERC-20 token to check for support function support(address token) public view override returns (bool) { } /// @dev Set bank status /// @param _bankStatus new bank status to change to function setBankStatus(uint _bankStatus) external onlyGov { } /// @dev Bank borrow status allowed or not /// @notice check last bit of bankStatus function allowBorrowStatus() public view returns (bool) { } /// @dev Bank repay status allowed or not /// @notice Check second-to-last bit of bankStatus function allowRepayStatus() public view returns (bool) { } /// @dev Trigger interest accrual for the given bank. /// @param token The underlying token to trigger the interest accrual. function accrue(address token) public override { } /// @dev Convenient function to trigger interest accrual for a list of banks. /// @param tokens The list of banks to trigger interest accrual. function accrueAll(address[] memory tokens) external { } /// @dev Return the borrow balance for given position and token without triggering interest accrual. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceStored(uint positionId, address token) public view override returns (uint) { } /// @dev Trigger interest accrual and return the current borrow balance. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceCurrent(uint positionId, address token) external override returns (uint) { } /// @dev Return bank information for the given token. /// @param token The token address to query for bank information. function getBankInfo(address token) external view override returns ( bool isListed, address cToken, uint reserve, uint totalDebt, uint totalShare ) { } /// @dev Return position information for the given position id. /// @param positionId The position id to query for position information. function getPositionInfo(uint positionId) public view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return current position information function getCurrentPositionInfo() external view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return the debt share of the given bank token for the given position id. /// @param positionId position id to get debt of /// @param token ERC20 debt token to query function getPositionDebtShareOf(uint positionId, address token) external view returns (uint) { } /// @dev Return the list of all debts for the given position id. /// @param positionId position id to get debts of function getPositionDebts(uint positionId) external view returns (address[] memory tokens, uint[] memory debts) { } /// @dev Return the total collateral value of the given position in ETH. /// @param positionId The position ID to query for the collateral value. function getCollateralETHValue(uint positionId) public view returns (uint) { } /// @dev Return the total borrow value of the given position in ETH. /// @param positionId The position ID to query for the borrow value. function getBorrowETHValue(uint positionId) public view override returns (uint) { } /// @dev Add a new bank to the ecosystem. /// @param token The underlying token for the bank. /// @param cToken The address of the cToken smart contract. function addBank(address token, address cToken) external onlyGov { } /// @dev Set the oracle smart contract address. /// @param _oracle The new oracle smart contract address. function setOracle(IOracle _oracle) external onlyGov { } /// @dev Set the fee bps value that Homora bank charges. /// @param _feeBps The new fee bps value. function setFeeBps(uint _feeBps) external onlyGov { } /// @dev Withdraw the reserve portion of the bank. /// @param amount The amount of tokens to withdraw. function withdrawReserve(address token, uint amount) external onlyGov lock { } /// @dev Liquidate a position. Pay debt for its owner and take the collateral. /// @param positionId The position ID to liquidate. /// @param debtToken The debt token to repay. /// @param amountCall The amount to repay when doing transferFrom call. function liquidate( uint positionId, address debtToken, uint amountCall ) external override lock poke(debtToken) { } /// @dev Execute the action via HomoraCaster, calling its function with the supplied data. /// @param positionId The position ID to execute the action, or zero for new position. /// @param spell The target spell to invoke the execution via HomoraCaster. /// @param data Extra data to pass to the target for the execution. function execute( uint positionId, address spell, bytes memory data ) external payable lock onlyEOAEx returns (uint) { } /// @dev Borrow tokens from that bank. Must only be called while under execution. /// @param token The token to borrow from the bank. /// @param amount The amount of tokens to borrow. function borrow(address token, uint amount) external override inExec poke(token) { } /// @dev Repay tokens to the bank. Must only be called while under execution. /// @param token The token to repay to the bank. /// @param amountCall The amount of tokens to repay via transferFrom. function repay(address token, uint amountCall) external override inExec poke(token) { } /// @dev Perform repay action. Return the amount actually taken and the debt share reduced. /// @param positionId The position ID to repay the debt. /// @param token The bank token to pay the debt. /// @param amountCall The amount to repay by calling transferFrom, or -1 for debt size. function repayInternal( uint positionId, address token, uint amountCall ) internal returns (uint, uint) { } /// @dev Transmit user assets to the caller, so users only need to approve Bank for spending. /// @param token The token to transfer from user to the caller. /// @param amount The amount to transfer. function transmit(address token, uint amount) external override inExec { } /// @dev Put more collateral for users. Must only be called during execution. /// @param collToken The ERC1155 token to collateral. /// @param collId The token id to collateral. /// @param amountCall The amount of tokens to put via transferFrom. function putCollateral( address collToken, uint collId, uint amountCall ) external override inExec { Position storage pos = positions[POSITION_ID]; if (pos.collToken != collToken || pos.collId != collId) { require(<FILL_ME>) require(pos.collateralSize == 0, 'another type of collateral already exists'); pos.collToken = collToken; pos.collId = collId; } uint amount = doERC1155TransferIn(collToken, collId, amountCall); pos.collateralSize = pos.collateralSize.add(amount); emit PutCollateral(POSITION_ID, msg.sender, collToken, collId, amount); } /// @dev Take some collateral back. Must only be called during execution. /// @param collToken The ERC1155 token to take back. /// @param collId The token id to take back. /// @param amount The amount of tokens to take back via transfer. function takeCollateral( address collToken, uint collId, uint amount ) external override inExec { } /// @dev Internal function to perform borrow from the bank and return the amount received. /// @param token The token to perform borrow action. /// @param amountCall The amount use in the transferFrom call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doBorrow(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform repay to the bank and return the amount actually repaid. /// @param token The token to perform repay action. /// @param amountCall The amount to use in the repay call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doRepay(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC20 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC20TransferIn(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC1155 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param id The id to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC1155TransferIn( address token, uint id, uint amountCall ) internal returns (uint) { } }
oracle.supportWrappedToken(collToken,collId),'collateral not supported'
34,825
oracle.supportWrappedToken(collToken,collId)
'bad borrow'
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/IERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/SafeERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC1155/IERC1155.sol'; import 'OpenZeppelin/[email protected]/contracts/math/SafeMath.sol'; import 'OpenZeppelin/[email protected]/contracts/math/Math.sol'; import './Governable.sol'; import './utils/ERC1155NaiveReceiver.sol'; import '../interfaces/IBank.sol'; import '../interfaces/ICErc20.sol'; import '../interfaces/IOracle.sol'; library HomoraSafeMath { using SafeMath for uint; /// @dev Computes round-up division. function ceilDiv(uint a, uint b) internal pure returns (uint) { } } contract HomoraCaster { /// @dev Call to the target using the given data. /// @param target The address target to call. /// @param data The data used in the call. function cast(address target, bytes calldata data) external payable { } } contract HomoraBank is Governable, ERC1155NaiveReceiver, IBank { using SafeMath for uint; using HomoraSafeMath for uint; using SafeERC20 for IERC20; uint private constant _NOT_ENTERED = 1; uint private constant _ENTERED = 2; uint private constant _NO_ID = uint(-1); address private constant _NO_ADDRESS = address(1); struct Bank { bool isListed; // Whether this market exists. uint8 index; // Reverse look up index for this bank. address cToken; // The CToken to draw liquidity from. uint reserve; // The reserve portion allocated to Homora protocol. uint totalDebt; // The last recorded total debt since last action. uint totalShare; // The total debt share count across all open positions. } struct Position { address owner; // The owner of this position. address collToken; // The ERC1155 token used as collateral for this position. uint collId; // The token id used as collateral. uint collateralSize; // The size of collateral token for this position. uint debtMap; // Bitmap of nonzero debt. i^th bit is set iff debt share of i^th bank is nonzero. mapping(address => uint) debtShareOf; // The debt share for each token. } uint public _GENERAL_LOCK; // TEMPORARY: re-entrancy lock guard. uint public _IN_EXEC_LOCK; // TEMPORARY: exec lock guard. uint public override POSITION_ID; // TEMPORARY: position ID currently under execution. address public override SPELL; // TEMPORARY: spell currently under execution. address public caster; // The caster address for untrusted execution. IOracle public oracle; // The oracle address for determining prices. uint public feeBps; // The fee collected as protocol reserve in basis points from interest. uint public override nextPositionId; // Next available position ID, starting from 1 (see initialize). address[] public allBanks; // The list of all listed banks. mapping(address => Bank) public banks; // Mapping from token to bank data. mapping(address => bool) public cTokenInBank; // Mapping from cToken to its existence in bank. mapping(uint => Position) public positions; // Mapping from position ID to position data. bool public allowContractCalls; // The boolean status whether to allow call from contract (false = onlyEOA) mapping(address => bool) public whitelistedTokens; // Mapping from token to whitelist status mapping(address => bool) public whitelistedSpells; // Mapping from spell to whitelist status mapping(address => bool) public whitelistedUsers; // Mapping from user to whitelist status uint public bankStatus; // Each bit stores certain bank status, e.g. borrow allowed, repay allowed /// @dev Ensure that the function is called from EOA when allowContractCalls is set to false and caller is not whitelisted modifier onlyEOAEx() { } /// @dev Reentrancy lock guard. modifier lock() { } /// @dev Ensure that the function is called from within the execution scope. modifier inExec() { } /// @dev Ensure that the interest rate of the given token is accrued. modifier poke(address token) { } /// @dev Initialize the bank smart contract, using msg.sender as the first governor. /// @param _oracle The oracle smart contract address. /// @param _feeBps The fee collected to Homora bank. function initialize(IOracle _oracle, uint _feeBps) external initializer { } /// @dev Return the current executor (the owner of the current position). function EXECUTOR() external view override returns (address) { } /// @dev Set allowContractCalls /// @param ok The status to set allowContractCalls to (false = onlyEOA) function setAllowContractCalls(bool ok) external onlyGov { } /// @dev Set whitelist spell status /// @param spells list of spells to change status /// @param statuses list of statuses to change to function setWhitelistSpells(address[] calldata spells, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist token status /// @param tokens list of tokens to change status /// @param statuses list of statuses to change to function setWhitelistTokens(address[] calldata tokens, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist user status /// @param users list of users to change status /// @param statuses list of statuses to change to function setWhitelistUsers(address[] calldata users, bool[] calldata statuses) external onlyGov { } /// @dev Check whether the oracle supports the token /// @param token ERC-20 token to check for support function support(address token) public view override returns (bool) { } /// @dev Set bank status /// @param _bankStatus new bank status to change to function setBankStatus(uint _bankStatus) external onlyGov { } /// @dev Bank borrow status allowed or not /// @notice check last bit of bankStatus function allowBorrowStatus() public view returns (bool) { } /// @dev Bank repay status allowed or not /// @notice Check second-to-last bit of bankStatus function allowRepayStatus() public view returns (bool) { } /// @dev Trigger interest accrual for the given bank. /// @param token The underlying token to trigger the interest accrual. function accrue(address token) public override { } /// @dev Convenient function to trigger interest accrual for a list of banks. /// @param tokens The list of banks to trigger interest accrual. function accrueAll(address[] memory tokens) external { } /// @dev Return the borrow balance for given position and token without triggering interest accrual. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceStored(uint positionId, address token) public view override returns (uint) { } /// @dev Trigger interest accrual and return the current borrow balance. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceCurrent(uint positionId, address token) external override returns (uint) { } /// @dev Return bank information for the given token. /// @param token The token address to query for bank information. function getBankInfo(address token) external view override returns ( bool isListed, address cToken, uint reserve, uint totalDebt, uint totalShare ) { } /// @dev Return position information for the given position id. /// @param positionId The position id to query for position information. function getPositionInfo(uint positionId) public view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return current position information function getCurrentPositionInfo() external view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return the debt share of the given bank token for the given position id. /// @param positionId position id to get debt of /// @param token ERC20 debt token to query function getPositionDebtShareOf(uint positionId, address token) external view returns (uint) { } /// @dev Return the list of all debts for the given position id. /// @param positionId position id to get debts of function getPositionDebts(uint positionId) external view returns (address[] memory tokens, uint[] memory debts) { } /// @dev Return the total collateral value of the given position in ETH. /// @param positionId The position ID to query for the collateral value. function getCollateralETHValue(uint positionId) public view returns (uint) { } /// @dev Return the total borrow value of the given position in ETH. /// @param positionId The position ID to query for the borrow value. function getBorrowETHValue(uint positionId) public view override returns (uint) { } /// @dev Add a new bank to the ecosystem. /// @param token The underlying token for the bank. /// @param cToken The address of the cToken smart contract. function addBank(address token, address cToken) external onlyGov { } /// @dev Set the oracle smart contract address. /// @param _oracle The new oracle smart contract address. function setOracle(IOracle _oracle) external onlyGov { } /// @dev Set the fee bps value that Homora bank charges. /// @param _feeBps The new fee bps value. function setFeeBps(uint _feeBps) external onlyGov { } /// @dev Withdraw the reserve portion of the bank. /// @param amount The amount of tokens to withdraw. function withdrawReserve(address token, uint amount) external onlyGov lock { } /// @dev Liquidate a position. Pay debt for its owner and take the collateral. /// @param positionId The position ID to liquidate. /// @param debtToken The debt token to repay. /// @param amountCall The amount to repay when doing transferFrom call. function liquidate( uint positionId, address debtToken, uint amountCall ) external override lock poke(debtToken) { } /// @dev Execute the action via HomoraCaster, calling its function with the supplied data. /// @param positionId The position ID to execute the action, or zero for new position. /// @param spell The target spell to invoke the execution via HomoraCaster. /// @param data Extra data to pass to the target for the execution. function execute( uint positionId, address spell, bytes memory data ) external payable lock onlyEOAEx returns (uint) { } /// @dev Borrow tokens from that bank. Must only be called while under execution. /// @param token The token to borrow from the bank. /// @param amount The amount of tokens to borrow. function borrow(address token, uint amount) external override inExec poke(token) { } /// @dev Repay tokens to the bank. Must only be called while under execution. /// @param token The token to repay to the bank. /// @param amountCall The amount of tokens to repay via transferFrom. function repay(address token, uint amountCall) external override inExec poke(token) { } /// @dev Perform repay action. Return the amount actually taken and the debt share reduced. /// @param positionId The position ID to repay the debt. /// @param token The bank token to pay the debt. /// @param amountCall The amount to repay by calling transferFrom, or -1 for debt size. function repayInternal( uint positionId, address token, uint amountCall ) internal returns (uint, uint) { } /// @dev Transmit user assets to the caller, so users only need to approve Bank for spending. /// @param token The token to transfer from user to the caller. /// @param amount The amount to transfer. function transmit(address token, uint amount) external override inExec { } /// @dev Put more collateral for users. Must only be called during execution. /// @param collToken The ERC1155 token to collateral. /// @param collId The token id to collateral. /// @param amountCall The amount of tokens to put via transferFrom. function putCollateral( address collToken, uint collId, uint amountCall ) external override inExec { } /// @dev Take some collateral back. Must only be called during execution. /// @param collToken The ERC1155 token to take back. /// @param collId The token id to take back. /// @param amount The amount of tokens to take back via transfer. function takeCollateral( address collToken, uint collId, uint amount ) external override inExec { } /// @dev Internal function to perform borrow from the bank and return the amount received. /// @param token The token to perform borrow action. /// @param amountCall The amount use in the transferFrom call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doBorrow(address token, uint amountCall) internal returns (uint) { Bank storage bank = banks[token]; // assume the input is already sanity checked. uint balanceBefore = IERC20(token).balanceOf(address(this)); require(<FILL_ME>) uint balanceAfter = IERC20(token).balanceOf(address(this)); bank.totalDebt = bank.totalDebt.add(amountCall); return balanceAfter.sub(balanceBefore); } /// @dev Internal function to perform repay to the bank and return the amount actually repaid. /// @param token The token to perform repay action. /// @param amountCall The amount to use in the repay call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doRepay(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC20 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC20TransferIn(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC1155 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param id The id to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC1155TransferIn( address token, uint id, uint amountCall ) internal returns (uint) { } }
ICErc20(bank.cToken).borrow(amountCall)==0,'bad borrow'
34,825
ICErc20(bank.cToken).borrow(amountCall)==0
'bad repay'
// SPDX-License-Identifier: MIT pragma solidity 0.6.12; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/IERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC20/SafeERC20.sol'; import 'OpenZeppelin/[email protected]/contracts/token/ERC1155/IERC1155.sol'; import 'OpenZeppelin/[email protected]/contracts/math/SafeMath.sol'; import 'OpenZeppelin/[email protected]/contracts/math/Math.sol'; import './Governable.sol'; import './utils/ERC1155NaiveReceiver.sol'; import '../interfaces/IBank.sol'; import '../interfaces/ICErc20.sol'; import '../interfaces/IOracle.sol'; library HomoraSafeMath { using SafeMath for uint; /// @dev Computes round-up division. function ceilDiv(uint a, uint b) internal pure returns (uint) { } } contract HomoraCaster { /// @dev Call to the target using the given data. /// @param target The address target to call. /// @param data The data used in the call. function cast(address target, bytes calldata data) external payable { } } contract HomoraBank is Governable, ERC1155NaiveReceiver, IBank { using SafeMath for uint; using HomoraSafeMath for uint; using SafeERC20 for IERC20; uint private constant _NOT_ENTERED = 1; uint private constant _ENTERED = 2; uint private constant _NO_ID = uint(-1); address private constant _NO_ADDRESS = address(1); struct Bank { bool isListed; // Whether this market exists. uint8 index; // Reverse look up index for this bank. address cToken; // The CToken to draw liquidity from. uint reserve; // The reserve portion allocated to Homora protocol. uint totalDebt; // The last recorded total debt since last action. uint totalShare; // The total debt share count across all open positions. } struct Position { address owner; // The owner of this position. address collToken; // The ERC1155 token used as collateral for this position. uint collId; // The token id used as collateral. uint collateralSize; // The size of collateral token for this position. uint debtMap; // Bitmap of nonzero debt. i^th bit is set iff debt share of i^th bank is nonzero. mapping(address => uint) debtShareOf; // The debt share for each token. } uint public _GENERAL_LOCK; // TEMPORARY: re-entrancy lock guard. uint public _IN_EXEC_LOCK; // TEMPORARY: exec lock guard. uint public override POSITION_ID; // TEMPORARY: position ID currently under execution. address public override SPELL; // TEMPORARY: spell currently under execution. address public caster; // The caster address for untrusted execution. IOracle public oracle; // The oracle address for determining prices. uint public feeBps; // The fee collected as protocol reserve in basis points from interest. uint public override nextPositionId; // Next available position ID, starting from 1 (see initialize). address[] public allBanks; // The list of all listed banks. mapping(address => Bank) public banks; // Mapping from token to bank data. mapping(address => bool) public cTokenInBank; // Mapping from cToken to its existence in bank. mapping(uint => Position) public positions; // Mapping from position ID to position data. bool public allowContractCalls; // The boolean status whether to allow call from contract (false = onlyEOA) mapping(address => bool) public whitelistedTokens; // Mapping from token to whitelist status mapping(address => bool) public whitelistedSpells; // Mapping from spell to whitelist status mapping(address => bool) public whitelistedUsers; // Mapping from user to whitelist status uint public bankStatus; // Each bit stores certain bank status, e.g. borrow allowed, repay allowed /// @dev Ensure that the function is called from EOA when allowContractCalls is set to false and caller is not whitelisted modifier onlyEOAEx() { } /// @dev Reentrancy lock guard. modifier lock() { } /// @dev Ensure that the function is called from within the execution scope. modifier inExec() { } /// @dev Ensure that the interest rate of the given token is accrued. modifier poke(address token) { } /// @dev Initialize the bank smart contract, using msg.sender as the first governor. /// @param _oracle The oracle smart contract address. /// @param _feeBps The fee collected to Homora bank. function initialize(IOracle _oracle, uint _feeBps) external initializer { } /// @dev Return the current executor (the owner of the current position). function EXECUTOR() external view override returns (address) { } /// @dev Set allowContractCalls /// @param ok The status to set allowContractCalls to (false = onlyEOA) function setAllowContractCalls(bool ok) external onlyGov { } /// @dev Set whitelist spell status /// @param spells list of spells to change status /// @param statuses list of statuses to change to function setWhitelistSpells(address[] calldata spells, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist token status /// @param tokens list of tokens to change status /// @param statuses list of statuses to change to function setWhitelistTokens(address[] calldata tokens, bool[] calldata statuses) external onlyGov { } /// @dev Set whitelist user status /// @param users list of users to change status /// @param statuses list of statuses to change to function setWhitelistUsers(address[] calldata users, bool[] calldata statuses) external onlyGov { } /// @dev Check whether the oracle supports the token /// @param token ERC-20 token to check for support function support(address token) public view override returns (bool) { } /// @dev Set bank status /// @param _bankStatus new bank status to change to function setBankStatus(uint _bankStatus) external onlyGov { } /// @dev Bank borrow status allowed or not /// @notice check last bit of bankStatus function allowBorrowStatus() public view returns (bool) { } /// @dev Bank repay status allowed or not /// @notice Check second-to-last bit of bankStatus function allowRepayStatus() public view returns (bool) { } /// @dev Trigger interest accrual for the given bank. /// @param token The underlying token to trigger the interest accrual. function accrue(address token) public override { } /// @dev Convenient function to trigger interest accrual for a list of banks. /// @param tokens The list of banks to trigger interest accrual. function accrueAll(address[] memory tokens) external { } /// @dev Return the borrow balance for given position and token without triggering interest accrual. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceStored(uint positionId, address token) public view override returns (uint) { } /// @dev Trigger interest accrual and return the current borrow balance. /// @param positionId The position to query for borrow balance. /// @param token The token to query for borrow balance. function borrowBalanceCurrent(uint positionId, address token) external override returns (uint) { } /// @dev Return bank information for the given token. /// @param token The token address to query for bank information. function getBankInfo(address token) external view override returns ( bool isListed, address cToken, uint reserve, uint totalDebt, uint totalShare ) { } /// @dev Return position information for the given position id. /// @param positionId The position id to query for position information. function getPositionInfo(uint positionId) public view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return current position information function getCurrentPositionInfo() external view override returns ( address owner, address collToken, uint collId, uint collateralSize ) { } /// @dev Return the debt share of the given bank token for the given position id. /// @param positionId position id to get debt of /// @param token ERC20 debt token to query function getPositionDebtShareOf(uint positionId, address token) external view returns (uint) { } /// @dev Return the list of all debts for the given position id. /// @param positionId position id to get debts of function getPositionDebts(uint positionId) external view returns (address[] memory tokens, uint[] memory debts) { } /// @dev Return the total collateral value of the given position in ETH. /// @param positionId The position ID to query for the collateral value. function getCollateralETHValue(uint positionId) public view returns (uint) { } /// @dev Return the total borrow value of the given position in ETH. /// @param positionId The position ID to query for the borrow value. function getBorrowETHValue(uint positionId) public view override returns (uint) { } /// @dev Add a new bank to the ecosystem. /// @param token The underlying token for the bank. /// @param cToken The address of the cToken smart contract. function addBank(address token, address cToken) external onlyGov { } /// @dev Set the oracle smart contract address. /// @param _oracle The new oracle smart contract address. function setOracle(IOracle _oracle) external onlyGov { } /// @dev Set the fee bps value that Homora bank charges. /// @param _feeBps The new fee bps value. function setFeeBps(uint _feeBps) external onlyGov { } /// @dev Withdraw the reserve portion of the bank. /// @param amount The amount of tokens to withdraw. function withdrawReserve(address token, uint amount) external onlyGov lock { } /// @dev Liquidate a position. Pay debt for its owner and take the collateral. /// @param positionId The position ID to liquidate. /// @param debtToken The debt token to repay. /// @param amountCall The amount to repay when doing transferFrom call. function liquidate( uint positionId, address debtToken, uint amountCall ) external override lock poke(debtToken) { } /// @dev Execute the action via HomoraCaster, calling its function with the supplied data. /// @param positionId The position ID to execute the action, or zero for new position. /// @param spell The target spell to invoke the execution via HomoraCaster. /// @param data Extra data to pass to the target for the execution. function execute( uint positionId, address spell, bytes memory data ) external payable lock onlyEOAEx returns (uint) { } /// @dev Borrow tokens from that bank. Must only be called while under execution. /// @param token The token to borrow from the bank. /// @param amount The amount of tokens to borrow. function borrow(address token, uint amount) external override inExec poke(token) { } /// @dev Repay tokens to the bank. Must only be called while under execution. /// @param token The token to repay to the bank. /// @param amountCall The amount of tokens to repay via transferFrom. function repay(address token, uint amountCall) external override inExec poke(token) { } /// @dev Perform repay action. Return the amount actually taken and the debt share reduced. /// @param positionId The position ID to repay the debt. /// @param token The bank token to pay the debt. /// @param amountCall The amount to repay by calling transferFrom, or -1 for debt size. function repayInternal( uint positionId, address token, uint amountCall ) internal returns (uint, uint) { } /// @dev Transmit user assets to the caller, so users only need to approve Bank for spending. /// @param token The token to transfer from user to the caller. /// @param amount The amount to transfer. function transmit(address token, uint amount) external override inExec { } /// @dev Put more collateral for users. Must only be called during execution. /// @param collToken The ERC1155 token to collateral. /// @param collId The token id to collateral. /// @param amountCall The amount of tokens to put via transferFrom. function putCollateral( address collToken, uint collId, uint amountCall ) external override inExec { } /// @dev Take some collateral back. Must only be called during execution. /// @param collToken The ERC1155 token to take back. /// @param collId The token id to take back. /// @param amount The amount of tokens to take back via transfer. function takeCollateral( address collToken, uint collId, uint amount ) external override inExec { } /// @dev Internal function to perform borrow from the bank and return the amount received. /// @param token The token to perform borrow action. /// @param amountCall The amount use in the transferFrom call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doBorrow(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform repay to the bank and return the amount actually repaid. /// @param token The token to perform repay action. /// @param amountCall The amount to use in the repay call. /// NOTE: Caller must ensure that cToken interest was already accrued up to this block. function doRepay(address token, uint amountCall) internal returns (uint) { Bank storage bank = banks[token]; // assume the input is already sanity checked. ICErc20 cToken = ICErc20(bank.cToken); uint oldDebt = bank.totalDebt; require(<FILL_ME>) uint newDebt = cToken.borrowBalanceStored(address(this)); bank.totalDebt = newDebt; return oldDebt.sub(newDebt); } /// @dev Internal function to perform ERC20 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC20TransferIn(address token, uint amountCall) internal returns (uint) { } /// @dev Internal function to perform ERC1155 transfer in and return amount actually received. /// @param token The token to perform transferFrom action. /// @param id The id to perform transferFrom action. /// @param amountCall The amount use in the transferFrom call. function doERC1155TransferIn( address token, uint id, uint amountCall ) internal returns (uint) { } }
cToken.repayBorrow(amountCall)==0,'bad repay'
34,825
cToken.repayBorrow(amountCall)==0
"One of the tokens should be ETH"
pragma solidity ^0.5.0; library DisableFlags { function enabled(uint256 disableFlags, uint256 flag) internal pure returns(bool) { } function disabledReserve(uint256 disableFlags, uint256 flag) internal pure returns(bool) { } function disabled(uint256 disableFlags, uint256 flag) internal pure returns(bool) { } } contract OneSplitBase is IOneSplit { using SafeMath for uint256; using DisableFlags for uint256; using UniversalERC20 for IERC20; using UniversalERC20 for IWETH; using UniversalERC20 for IBancorEtherToken; IERC20 constant public ETH_ADDRESS = IERC20(0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE); IERC20 public dai = IERC20(0x6B175474E89094C44Da98b954EedeAC495271d0F); IWETH public wethToken = IWETH(0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2); IBancorEtherToken public bancorEtherToken = IBancorEtherToken(0xc0829421C1d260BD3cB3E0F06cfE2D52db2cE315); IKyberNetworkProxy public kyberNetworkProxy = IKyberNetworkProxy(0x818E6FECD516Ecc3849DAf6845e3EC868087B755); IUniswapFactory public uniswapFactory = IUniswapFactory(0xc0a47dFe034B400B47bDaD5FecDa2621de6c4d95); IBancorContractRegistry public bancorContractRegistry = IBancorContractRegistry(0x52Ae12ABe5D8BD778BD5397F99cA900624CfADD4); IBancorNetworkPathFinder bancorNetworkPathFinder = IBancorNetworkPathFinder(0x6F0cD8C4f6F06eAB664C7E3031909452b4B72861); IOasisExchange public oasisExchange = IOasisExchange(0x39755357759cE0d7f32dC8dC45414CCa409AE24e); function() external payable { } function log(uint256) external view { } function getExpectedReturn( IERC20 fromToken, IERC20 toToken, uint256 amount, uint256 parts, uint256 disableFlags // 1 - Uniswap, 2 - Kyber, 4 - Bancor, 8 - Oasis, 16 - Compound, 32 - Fulcrum, 64 - Chai, 128 - Aave, 256 - SmartToken ) public view returns( uint256 returnAmount, uint256[] memory distribution // [Uniswap, Kyber, Bancor, Oasis] ) { } function _swap( IERC20 fromToken, IERC20 toToken, uint256 amount, uint256[] memory distribution, // [Uniswap, Kyber, Bancor, Oasis] uint256 /*disableFlags*/ // 16 - Compound, 32 - Fulcrum, 64 - Chai, 128 - Aave, 256 - SmartToken ) internal { } // View Helpers function calculateUniswapReturn( IERC20 fromToken, IERC20 toToken, uint256 amount, uint256 /*disableFlags*/ ) public view returns(uint256) { } function calculateKyberReturn( IERC20 fromToken, IERC20 toToken, uint256 amount, uint256 disableFlags ) public view returns(uint256) { } function _calculateKyberReturnWithEth( IKyberNetworkContract kyberNetworkContract, IERC20 fromToken, IERC20 toToken, uint256 amount, uint256 disableFlags ) public view returns(uint256) { require(<FILL_ME>) (bool success, bytes memory data) = address(kyberNetworkContract).staticcall.gas(1500000)(abi.encodeWithSelector( kyberNetworkContract.searchBestRate.selector, fromToken.isETH() ? ETH_ADDRESS : fromToken, toToken.isETH() ? ETH_ADDRESS : toToken, amount, true )); if (!success) { return 0; } (address reserve, uint256 rate) = abi.decode(data, (address,uint256)); if ((reserve == 0x31E085Afd48a1d6e51Cc193153d625e8f0514C7F && disableFlags.disabledReserve(FLAG_KYBER_UNISWAP_RESERVE)) || (reserve == 0xCf1394C5e2e879969fdB1f464cE1487147863dCb && disableFlags.disabledReserve(FLAG_KYBER_OASIS_RESERVE)) || (reserve == 0x053AA84FCC676113a57e0EbB0bD1913839874bE4 && disableFlags.disabledReserve(FLAG_KYBER_BANCOR_RESERVE))) { return 0; } if (disableFlags.disabledReserve(FLAG_KYBER_UNISWAP_RESERVE)) { (success,) = reserve.staticcall.gas(2300)(abi.encodeWithSelector( IKyberUniswapReserve(reserve).uniswapFactory.selector )); if (success) { return 0; } } if (disableFlags.disabledReserve(FLAG_KYBER_OASIS_RESERVE)) { (success,) = reserve.staticcall.gas(2300)(abi.encodeWithSelector( IKyberOasisReserve(reserve).otc.selector )); if (success) { return 0; } } if (disableFlags.disabledReserve(FLAG_KYBER_BANCOR_RESERVE)) { (success,) = reserve.staticcall.gas(2300)(abi.encodeWithSelector( IKyberBancorReserve(reserve).bancorEth.selector )); if (success) { return 0; } } return rate.mul(amount) .mul(10 ** IERC20(toToken).universalDecimals()) .div(10 ** IERC20(fromToken).universalDecimals()) .div(1e18); } function calculateBancorReturn( IERC20 fromToken, IERC20 toToken, uint256 amount, uint256 /*disableFlags*/ ) public view returns(uint256) { } function calculateOasisReturn( IERC20 fromToken, IERC20 toToken, uint256 amount, uint256 /*disableFlags*/ ) public view returns(uint256) { } function _calculateNoReturn( IERC20 /*fromToken*/, IERC20 /*toToken*/, uint256 /*amount*/, uint256 /*disableFlags*/ ) internal view returns(uint256) { } // Swap helpers function _swapOnUniswap( IERC20 fromToken, IERC20 toToken, uint256 amount ) internal returns(uint256) { } function _swapOnKyber( IERC20 fromToken, IERC20 toToken, uint256 amount ) internal returns(uint256) { } function _swapOnBancor( IERC20 fromToken, IERC20 toToken, uint256 amount ) internal returns(uint256) { } function _swapOnOasis( IERC20 fromToken, IERC20 toToken, uint256 amount ) internal returns(uint256) { } // Helpers function _infiniteApproveIfNeeded(IERC20 token, address to) internal { } }
fromToken.isETH()||toToken.isETH(),"One of the tokens should be ETH"
34,886
fromToken.isETH()||toToken.isETH()
"ERC721: transfer from incorrect owner"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol"; import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol"; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/Strings.sol"; import "@openzeppelin/contracts/utils/introspection/ERC165.sol"; /** * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including * the Metadata extension, but not including the Enumerable extension. This does random batch minting. */ contract ERC721r is Context, ERC165, IERC721, IERC721Metadata { using Address for address; using Strings for uint256; // Token name string private _name; // Token symbol string private _symbol; mapping(uint => uint) private _availableTokens; uint256 private _numAvailableTokens; uint256 immutable _maxSupply; // Mapping from token ID to owner address mapping(uint256 => address) private _owners; // Mapping owner address to token count mapping(address => uint256) private _balances; // Mapping from token ID to approved address mapping(uint256 => address) private _tokenApprovals; // Mapping from owner to operator approvals mapping(address => mapping(address => bool)) private _operatorApprovals; /** * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection. */ constructor(string memory name_, string memory symbol_, uint maxSupply_) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { } function totalSupply() public view virtual returns (uint256) { } function maxSupply() public view virtual returns (uint256) { } /** * @dev See {IERC721-balanceOf}. */ function balanceOf(address owner) public view virtual override returns (uint256) { } /** * @dev See {IERC721-ownerOf}. */ function ownerOf(uint256 tokenId) public view virtual override returns (address) { } /** * @dev See {IERC721Metadata-name}. */ function name() public view virtual override returns (string memory) { } /** * @dev See {IERC721Metadata-symbol}. */ function symbol() public view virtual override returns (string memory) { } /** * @dev See {IERC721Metadata-tokenURI}. */ function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } /** * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each * token will be the concatenation of the `baseURI` and the `tokenId`. Empty * by default, can be overridden in child contracts. */ function _baseURI() internal view virtual returns (string memory) { } /** * @dev See {IERC721-approve}. */ function approve(address to, uint256 tokenId) public virtual override { } /** * @dev See {IERC721-getApproved}. */ function getApproved(uint256 tokenId) public view virtual override returns (address) { } /** * @dev See {IERC721-setApprovalForAll}. */ function setApprovalForAll(address operator, bool approved) public virtual override { } /** * @dev See {IERC721-isApprovedForAll}. */ function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { } /** * @dev See {IERC721-transferFrom}. */ function transferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId ) public virtual override { } /** * @dev See {IERC721-safeTransferFrom}. */ function safeTransferFrom( address from, address to, uint256 tokenId, bytes memory _data ) public virtual override { } /** * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients * are aware of the ERC721 protocol to prevent tokens from being forever locked. * * `_data` is additional data, it has no specified format and it is sent in call to `to`. * * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g. * implement alternative mechanisms to perform token transfer, such as signature-based. * * Requirements: * * - `from` cannot be the zero address. * - `to` cannot be the zero address. * - `tokenId` token must exist and be owned by `from`. * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer. * * Emits a {Transfer} event. */ function _safeTransfer( address from, address to, uint256 tokenId, bytes memory _data ) internal virtual { } /** * @dev Returns whether `tokenId` exists. * * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}. * * Tokens start existing when they are minted (`_mint`), * and stop existing when they are burned (`_burn`). */ function _exists(uint256 tokenId) internal view virtual returns (bool) { } /** * @dev Returns whether `spender` is allowed to manage `tokenId`. * * Requirements: * * - `tokenId` must exist. */ function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) { } function _mintIdWithoutBalanceUpdate(address to, uint256 tokenId) private { } function _mintRandom(address to, uint _numToMint) internal virtual { } function getRandomAvailableTokenId(address to, uint updatedNumAvailableTokens) internal returns (uint256) { } // Implements https://en.wikipedia.org/wiki/Fisher%E2%80%93Yates_shuffle. Code taken from CryptoPhunksV2 function getAvailableTokenAtIndex(uint256 indexToUse, uint updatedNumAvailableTokens) internal returns (uint256) { } // Not as good as minting a specific tokenId, but will behave the same at the start // allowing you to explicitly mint some tokens at launch. function _mintAtIndex(address to, uint index) internal virtual { } /** * @dev Transfers `tokenId` from `from` to `to`. * As opposed to {transferFrom}, this imposes no restrictions on msg.sender. * * Requirements: * * - `to` cannot be the zero address. * - `tokenId` token must be owned by `from`. * * Emits a {Transfer} event. */ function _transfer( address from, address to, uint256 tokenId ) internal virtual { require(<FILL_ME>) require(to != address(0), "ERC721: transfer to the zero address"); _beforeTokenTransfer(from, to, tokenId); // Clear approvals from the previous owner _approve(address(0), tokenId); _balances[from] -= 1; _balances[to] += 1; _owners[tokenId] = to; emit Transfer(from, to, tokenId); _afterTokenTransfer(from, to, tokenId); } /** * @dev Approve `to` to operate on `tokenId` * * Emits a {Approval} event. */ function _approve(address to, uint256 tokenId) internal virtual { } /** * @dev Approve `operator` to operate on all of `owner` tokens * * Emits a {ApprovalForAll} event. */ function _setApprovalForAll( address owner, address operator, bool approved ) internal virtual { } /** * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address. * The call is not executed if the target address is not a contract. * * @param from address representing the previous owner of the given token ID * @param to target address that will receive the tokens * @param tokenId uint256 ID of the token to be transferred * @param _data bytes optional data to send along with the call * @return bool whether the call correctly returned the expected magic value */ function _checkOnERC721Received( address from, address to, uint256 tokenId, bytes memory _data ) private returns (bool) { } /** * @dev Hook that is called before any token transfer. This includes minting * and burning. * * Calling conditions: * * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be * transferred to `to`. * - When `from` is zero, `tokenId` will be minted for `to`. * - When `to` is zero, ``from``'s `tokenId` will be burned. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} /** * @dev Hook that is called after any transfer of tokens. This includes * minting and burning. * * Calling conditions: * * - when `from` and `to` are both non-zero. * - `from` and `to` are never both zero. * * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks]. */ function _afterTokenTransfer( address from, address to, uint256 tokenId ) internal virtual {} }
ERC721r.ownerOf(tokenId)==from,"ERC721: transfer from incorrect owner"
35,052
ERC721r.ownerOf(tokenId)==from
null
@v1.1.2 pragma solidity >=0.7.6 <0.8.0; abstract contract Recoverable is ManagedIdentity, Ownable { using ERC20Wrapper for IWrappedERC20; /** * Extract ERC20 tokens which were accidentally sent to the contract to a list of accounts. * Warning: this function should be overriden for contracts which are supposed to hold ERC20 tokens * so that the extraction is limited to only amounts sent accidentally. * @dev Reverts if the sender is not the contract owner. * @dev Reverts if `accounts`, `tokens` and `amounts` do not have the same length. * @dev Reverts if one of `tokens` is does not implement the ERC20 transfer function. * @dev Reverts if one of the ERC20 transfers fail for any reason. * @param accounts the list of accounts to transfer the tokens to. * @param tokens the list of ERC20 token addresses. * @param amounts the list of token amounts to transfer. */ function recoverERC20s( address[] calldata accounts, address[] calldata tokens, uint256[] calldata amounts ) external virtual { require(<FILL_ME>) uint256 length = accounts.length; require(length == tokens.length && length == amounts.length, "Recov: inconsistent arrays"); for (uint256 i = 0; i != length; ++i) { IWrappedERC20(tokens[i]).wrappedTransfer(accounts[i], amounts[i]); } } /** * Extract ERC721 tokens which were accidentally sent to the contract to a list of accounts. * Warning: this function should be overriden for contracts which are supposed to hold ERC721 tokens * so that the extraction is limited to only tokens sent accidentally. * @dev Reverts if the sender is not the contract owner. * @dev Reverts if `accounts`, `contracts` and `amounts` do not have the same length. * @dev Reverts if one of `contracts` is does not implement the ERC721 transferFrom function. * @dev Reverts if one of the ERC721 transfers fail for any reason. * @param accounts the list of accounts to transfer the tokens to. * @param contracts the list of ERC721 contract addresses. * @param tokenIds the list of token ids to transfer. */ function recoverERC721s( address[] calldata accounts, address[] calldata contracts, uint256[] calldata tokenIds ) external virtual { } } interface IRecoverableERC721 { /// See {IERC721-transferFrom(address,address,uint256)} function transferFrom( address from, address to, uint256 tokenId ) external; }
Ownership(_msgSender()
35,182
_msgSender()
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./Ownable.sol"; import "./SafeMath.sol"; import "./Address.sol"; import "./ISwapRouter.sol"; import "./INonfungiblePositionManager.sol"; contract CuttToken is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => bool) private _isExcluded; mapping(address => bool) private _isExcludedFromMaxTxAmount; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 1000000000 * 10**6 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private _name = "Cutt Token"; string private _symbol = "CUTT"; uint8 private _decimals = 9; uint256 public _taxFee = 5; uint256 private _previousTaxFee = _taxFee; uint256 public _liquidityFee = 5; uint256 private _previousLiquidityFee = _liquidityFee; uint256 public _liquidityPercent = 20; uint256 public _cuttiesPercent = 10; uint256 public _nftStakingPercent = 15; uint256 public _v3StakingPercent = 25; uint256 public _smartFarmingPercent = 25; uint256 public _treasuryPercent = 5; address public _liquidityAddress; address public _cuttiesAddress; address public _nftStakingAddress; address public _v3StakingAddress; address public _smartFarmingAddress; address public _treasuryAddress; bool public _liquidityLocked = false; bool public _cuttiesLocked = false; bool public _nftStakingLocked = false; bool public _v3StakingLocked = false; bool public _smartFarmingLocked = false; bool public _treasuryLocked = false; ISwapRouter public swapRouter; INonfungiblePositionManager public nonfungiblePositionManager; bool inSwapAndLiquify; bool public swapAndLiquifyEnabled = true; uint256 public _maxTxAmount = 5000000 * 10**6 * 10**9; uint256 private numTokensSellToAddToLiquidity = 500000 * 10**6 * 10**9; uint24 private _uniswapV3Fee = 500; int24 private _tickLower = -887270; int24 private _tickUpper = 887270; event SwapAndLiquifyEnabledUpdated(bool enabled); event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity ); modifier lockTheSwap { } constructor() { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function isExcludedFromReward(address account) public view returns (bool) { } function totalFees() public view returns (uint256) { } function setSwapParam( uint24 fee, int24 tickLower, int24 tickUpper ) public onlyOwner { } function setTreasuryAddress(address treasuryAddress) public onlyOwner { } function setLiquidityAddress(address liquidityAddress) public onlyOwner { } function setNFTStakingAddress(address nftStakingAddress) public onlyOwner { } function setV3StakingAddress(address v3StakingAddress) public onlyOwner { } function setSmartFarmingAddress(address farmingAddress) public onlyOwner { } function setPoolAddress(address poolAddress) external { require(<FILL_ME>) _setExcludedAll(poolAddress); } function setCuttiesAddress(address cuttiesAddress) public onlyOwner { } function _setExcludedAll(address settingAddress) private { } function mintTreasuryToken() external { } function mintLiquidityToken() external { } function mintNFTStakingToken() external { } function mintV3StakingToken() external { } function mintSmartFarmingToken() external { } function mintCuttiesToken() external { } function _mint(address to, uint256 percent) private { } function deliver(uint256 tAmount) public { } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns (uint256) { } function tokenFromReflection(uint256 rAmount) public view returns (uint256) { } function excludeFromReward(address account) public onlyOwner() { } function includeInReward(address account) external onlyOwner() { } function _transferBothExcluded( address sender, address recipient, uint256 tAmount ) private { } function excludeFromFee(address account) public onlyOwner { } function includeInFee(address account) public onlyOwner { } function excludeFromMaxTxAmount(address account) public onlyOwner { } function includeInMaxTxAmount(address account) public onlyOwner { } function setTaxFeePercent(uint256 taxFee) external onlyOwner() { } function setLiquidityFeePercent(uint256 liquidityFee) external onlyOwner() { } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { } function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner { } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _reflectFee(uint256 rFee, uint256 tFee) private { } function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { } function _getTValues(uint256 tAmount) private view returns ( uint256, uint256, uint256 ) { } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { } function _getRate() private view returns (uint256) { } function _getCurrentSupply() private view returns (uint256, uint256) { } function _takeLiquidity(uint256 tLiquidity) private { } function calculateTaxFee(uint256 _amount) private view returns (uint256) { } function calculateLiquidityFee(uint256 _amount) private view returns (uint256) { } function removeAllFee() private { } function restoreAllFee() private { } function isExcludedFromFee(address account) public view returns (bool) { } function isExcludedFromMaxTxAmount(address account) public view returns (bool) { } function _approve( address owner, address spender, uint256 amount ) private { } function _transfer( address from, address to, uint256 amount ) private { } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { } function swapTokensForEth(uint256 tokenAmount) private { } function getTokens() private view returns (address token0, address token1) { } function getTokenBalances(uint256 tokenAmount, uint256 ethAmount) private view returns (uint256 balance0, uint256 balance1) { } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { } function _transferToExcluded( address sender, address recipient, uint256 tAmount ) private { } function _transferFromExcluded( address sender, address recipient, uint256 tAmount ) private { } function burn(uint256 amount) public returns (bool) { } }
_msgSender()==_liquidityAddress
35,204
_msgSender()==_liquidityAddress
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./Ownable.sol"; import "./SafeMath.sol"; import "./Address.sol"; import "./ISwapRouter.sol"; import "./INonfungiblePositionManager.sol"; contract CuttToken is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => bool) private _isExcluded; mapping(address => bool) private _isExcludedFromMaxTxAmount; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 1000000000 * 10**6 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private _name = "Cutt Token"; string private _symbol = "CUTT"; uint8 private _decimals = 9; uint256 public _taxFee = 5; uint256 private _previousTaxFee = _taxFee; uint256 public _liquidityFee = 5; uint256 private _previousLiquidityFee = _liquidityFee; uint256 public _liquidityPercent = 20; uint256 public _cuttiesPercent = 10; uint256 public _nftStakingPercent = 15; uint256 public _v3StakingPercent = 25; uint256 public _smartFarmingPercent = 25; uint256 public _treasuryPercent = 5; address public _liquidityAddress; address public _cuttiesAddress; address public _nftStakingAddress; address public _v3StakingAddress; address public _smartFarmingAddress; address public _treasuryAddress; bool public _liquidityLocked = false; bool public _cuttiesLocked = false; bool public _nftStakingLocked = false; bool public _v3StakingLocked = false; bool public _smartFarmingLocked = false; bool public _treasuryLocked = false; ISwapRouter public swapRouter; INonfungiblePositionManager public nonfungiblePositionManager; bool inSwapAndLiquify; bool public swapAndLiquifyEnabled = true; uint256 public _maxTxAmount = 5000000 * 10**6 * 10**9; uint256 private numTokensSellToAddToLiquidity = 500000 * 10**6 * 10**9; uint24 private _uniswapV3Fee = 500; int24 private _tickLower = -887270; int24 private _tickUpper = 887270; event SwapAndLiquifyEnabledUpdated(bool enabled); event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity ); modifier lockTheSwap { } constructor() { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function isExcludedFromReward(address account) public view returns (bool) { } function totalFees() public view returns (uint256) { } function setSwapParam( uint24 fee, int24 tickLower, int24 tickUpper ) public onlyOwner { } function setTreasuryAddress(address treasuryAddress) public onlyOwner { } function setLiquidityAddress(address liquidityAddress) public onlyOwner { } function setNFTStakingAddress(address nftStakingAddress) public onlyOwner { } function setV3StakingAddress(address v3StakingAddress) public onlyOwner { } function setSmartFarmingAddress(address farmingAddress) public onlyOwner { } function setPoolAddress(address poolAddress) external { } function setCuttiesAddress(address cuttiesAddress) public onlyOwner { } function _setExcludedAll(address settingAddress) private { } function mintTreasuryToken() external { require(<FILL_ME>) require(!_treasuryLocked); _mint(_treasuryAddress, _treasuryPercent); _treasuryLocked = true; } function mintLiquidityToken() external { } function mintNFTStakingToken() external { } function mintV3StakingToken() external { } function mintSmartFarmingToken() external { } function mintCuttiesToken() external { } function _mint(address to, uint256 percent) private { } function deliver(uint256 tAmount) public { } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns (uint256) { } function tokenFromReflection(uint256 rAmount) public view returns (uint256) { } function excludeFromReward(address account) public onlyOwner() { } function includeInReward(address account) external onlyOwner() { } function _transferBothExcluded( address sender, address recipient, uint256 tAmount ) private { } function excludeFromFee(address account) public onlyOwner { } function includeInFee(address account) public onlyOwner { } function excludeFromMaxTxAmount(address account) public onlyOwner { } function includeInMaxTxAmount(address account) public onlyOwner { } function setTaxFeePercent(uint256 taxFee) external onlyOwner() { } function setLiquidityFeePercent(uint256 liquidityFee) external onlyOwner() { } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { } function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner { } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _reflectFee(uint256 rFee, uint256 tFee) private { } function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { } function _getTValues(uint256 tAmount) private view returns ( uint256, uint256, uint256 ) { } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { } function _getRate() private view returns (uint256) { } function _getCurrentSupply() private view returns (uint256, uint256) { } function _takeLiquidity(uint256 tLiquidity) private { } function calculateTaxFee(uint256 _amount) private view returns (uint256) { } function calculateLiquidityFee(uint256 _amount) private view returns (uint256) { } function removeAllFee() private { } function restoreAllFee() private { } function isExcludedFromFee(address account) public view returns (bool) { } function isExcludedFromMaxTxAmount(address account) public view returns (bool) { } function _approve( address owner, address spender, uint256 amount ) private { } function _transfer( address from, address to, uint256 amount ) private { } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { } function swapTokensForEth(uint256 tokenAmount) private { } function getTokens() private view returns (address token0, address token1) { } function getTokenBalances(uint256 tokenAmount, uint256 ethAmount) private view returns (uint256 balance0, uint256 balance1) { } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { } function _transferToExcluded( address sender, address recipient, uint256 tAmount ) private { } function _transferFromExcluded( address sender, address recipient, uint256 tAmount ) private { } function burn(uint256 amount) public returns (bool) { } }
_msgSender()==_treasuryAddress
35,204
_msgSender()==_treasuryAddress
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./Ownable.sol"; import "./SafeMath.sol"; import "./Address.sol"; import "./ISwapRouter.sol"; import "./INonfungiblePositionManager.sol"; contract CuttToken is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => bool) private _isExcluded; mapping(address => bool) private _isExcludedFromMaxTxAmount; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 1000000000 * 10**6 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private _name = "Cutt Token"; string private _symbol = "CUTT"; uint8 private _decimals = 9; uint256 public _taxFee = 5; uint256 private _previousTaxFee = _taxFee; uint256 public _liquidityFee = 5; uint256 private _previousLiquidityFee = _liquidityFee; uint256 public _liquidityPercent = 20; uint256 public _cuttiesPercent = 10; uint256 public _nftStakingPercent = 15; uint256 public _v3StakingPercent = 25; uint256 public _smartFarmingPercent = 25; uint256 public _treasuryPercent = 5; address public _liquidityAddress; address public _cuttiesAddress; address public _nftStakingAddress; address public _v3StakingAddress; address public _smartFarmingAddress; address public _treasuryAddress; bool public _liquidityLocked = false; bool public _cuttiesLocked = false; bool public _nftStakingLocked = false; bool public _v3StakingLocked = false; bool public _smartFarmingLocked = false; bool public _treasuryLocked = false; ISwapRouter public swapRouter; INonfungiblePositionManager public nonfungiblePositionManager; bool inSwapAndLiquify; bool public swapAndLiquifyEnabled = true; uint256 public _maxTxAmount = 5000000 * 10**6 * 10**9; uint256 private numTokensSellToAddToLiquidity = 500000 * 10**6 * 10**9; uint24 private _uniswapV3Fee = 500; int24 private _tickLower = -887270; int24 private _tickUpper = 887270; event SwapAndLiquifyEnabledUpdated(bool enabled); event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity ); modifier lockTheSwap { } constructor() { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function isExcludedFromReward(address account) public view returns (bool) { } function totalFees() public view returns (uint256) { } function setSwapParam( uint24 fee, int24 tickLower, int24 tickUpper ) public onlyOwner { } function setTreasuryAddress(address treasuryAddress) public onlyOwner { } function setLiquidityAddress(address liquidityAddress) public onlyOwner { } function setNFTStakingAddress(address nftStakingAddress) public onlyOwner { } function setV3StakingAddress(address v3StakingAddress) public onlyOwner { } function setSmartFarmingAddress(address farmingAddress) public onlyOwner { } function setPoolAddress(address poolAddress) external { } function setCuttiesAddress(address cuttiesAddress) public onlyOwner { } function _setExcludedAll(address settingAddress) private { } function mintTreasuryToken() external { require(_msgSender() == _treasuryAddress); require(<FILL_ME>) _mint(_treasuryAddress, _treasuryPercent); _treasuryLocked = true; } function mintLiquidityToken() external { } function mintNFTStakingToken() external { } function mintV3StakingToken() external { } function mintSmartFarmingToken() external { } function mintCuttiesToken() external { } function _mint(address to, uint256 percent) private { } function deliver(uint256 tAmount) public { } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns (uint256) { } function tokenFromReflection(uint256 rAmount) public view returns (uint256) { } function excludeFromReward(address account) public onlyOwner() { } function includeInReward(address account) external onlyOwner() { } function _transferBothExcluded( address sender, address recipient, uint256 tAmount ) private { } function excludeFromFee(address account) public onlyOwner { } function includeInFee(address account) public onlyOwner { } function excludeFromMaxTxAmount(address account) public onlyOwner { } function includeInMaxTxAmount(address account) public onlyOwner { } function setTaxFeePercent(uint256 taxFee) external onlyOwner() { } function setLiquidityFeePercent(uint256 liquidityFee) external onlyOwner() { } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { } function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner { } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _reflectFee(uint256 rFee, uint256 tFee) private { } function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { } function _getTValues(uint256 tAmount) private view returns ( uint256, uint256, uint256 ) { } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { } function _getRate() private view returns (uint256) { } function _getCurrentSupply() private view returns (uint256, uint256) { } function _takeLiquidity(uint256 tLiquidity) private { } function calculateTaxFee(uint256 _amount) private view returns (uint256) { } function calculateLiquidityFee(uint256 _amount) private view returns (uint256) { } function removeAllFee() private { } function restoreAllFee() private { } function isExcludedFromFee(address account) public view returns (bool) { } function isExcludedFromMaxTxAmount(address account) public view returns (bool) { } function _approve( address owner, address spender, uint256 amount ) private { } function _transfer( address from, address to, uint256 amount ) private { } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { } function swapTokensForEth(uint256 tokenAmount) private { } function getTokens() private view returns (address token0, address token1) { } function getTokenBalances(uint256 tokenAmount, uint256 ethAmount) private view returns (uint256 balance0, uint256 balance1) { } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { } function _transferToExcluded( address sender, address recipient, uint256 tAmount ) private { } function _transferFromExcluded( address sender, address recipient, uint256 tAmount ) private { } function burn(uint256 amount) public returns (bool) { } }
!_treasuryLocked
35,204
!_treasuryLocked
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./Ownable.sol"; import "./SafeMath.sol"; import "./Address.sol"; import "./ISwapRouter.sol"; import "./INonfungiblePositionManager.sol"; contract CuttToken is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => bool) private _isExcluded; mapping(address => bool) private _isExcludedFromMaxTxAmount; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 1000000000 * 10**6 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private _name = "Cutt Token"; string private _symbol = "CUTT"; uint8 private _decimals = 9; uint256 public _taxFee = 5; uint256 private _previousTaxFee = _taxFee; uint256 public _liquidityFee = 5; uint256 private _previousLiquidityFee = _liquidityFee; uint256 public _liquidityPercent = 20; uint256 public _cuttiesPercent = 10; uint256 public _nftStakingPercent = 15; uint256 public _v3StakingPercent = 25; uint256 public _smartFarmingPercent = 25; uint256 public _treasuryPercent = 5; address public _liquidityAddress; address public _cuttiesAddress; address public _nftStakingAddress; address public _v3StakingAddress; address public _smartFarmingAddress; address public _treasuryAddress; bool public _liquidityLocked = false; bool public _cuttiesLocked = false; bool public _nftStakingLocked = false; bool public _v3StakingLocked = false; bool public _smartFarmingLocked = false; bool public _treasuryLocked = false; ISwapRouter public swapRouter; INonfungiblePositionManager public nonfungiblePositionManager; bool inSwapAndLiquify; bool public swapAndLiquifyEnabled = true; uint256 public _maxTxAmount = 5000000 * 10**6 * 10**9; uint256 private numTokensSellToAddToLiquidity = 500000 * 10**6 * 10**9; uint24 private _uniswapV3Fee = 500; int24 private _tickLower = -887270; int24 private _tickUpper = 887270; event SwapAndLiquifyEnabledUpdated(bool enabled); event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity ); modifier lockTheSwap { } constructor() { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function isExcludedFromReward(address account) public view returns (bool) { } function totalFees() public view returns (uint256) { } function setSwapParam( uint24 fee, int24 tickLower, int24 tickUpper ) public onlyOwner { } function setTreasuryAddress(address treasuryAddress) public onlyOwner { } function setLiquidityAddress(address liquidityAddress) public onlyOwner { } function setNFTStakingAddress(address nftStakingAddress) public onlyOwner { } function setV3StakingAddress(address v3StakingAddress) public onlyOwner { } function setSmartFarmingAddress(address farmingAddress) public onlyOwner { } function setPoolAddress(address poolAddress) external { } function setCuttiesAddress(address cuttiesAddress) public onlyOwner { } function _setExcludedAll(address settingAddress) private { } function mintTreasuryToken() external { } function mintLiquidityToken() external { require(_msgSender() == _liquidityAddress); require(<FILL_ME>) _mint(_liquidityAddress, _liquidityPercent); _liquidityLocked = true; } function mintNFTStakingToken() external { } function mintV3StakingToken() external { } function mintSmartFarmingToken() external { } function mintCuttiesToken() external { } function _mint(address to, uint256 percent) private { } function deliver(uint256 tAmount) public { } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns (uint256) { } function tokenFromReflection(uint256 rAmount) public view returns (uint256) { } function excludeFromReward(address account) public onlyOwner() { } function includeInReward(address account) external onlyOwner() { } function _transferBothExcluded( address sender, address recipient, uint256 tAmount ) private { } function excludeFromFee(address account) public onlyOwner { } function includeInFee(address account) public onlyOwner { } function excludeFromMaxTxAmount(address account) public onlyOwner { } function includeInMaxTxAmount(address account) public onlyOwner { } function setTaxFeePercent(uint256 taxFee) external onlyOwner() { } function setLiquidityFeePercent(uint256 liquidityFee) external onlyOwner() { } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { } function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner { } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _reflectFee(uint256 rFee, uint256 tFee) private { } function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { } function _getTValues(uint256 tAmount) private view returns ( uint256, uint256, uint256 ) { } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { } function _getRate() private view returns (uint256) { } function _getCurrentSupply() private view returns (uint256, uint256) { } function _takeLiquidity(uint256 tLiquidity) private { } function calculateTaxFee(uint256 _amount) private view returns (uint256) { } function calculateLiquidityFee(uint256 _amount) private view returns (uint256) { } function removeAllFee() private { } function restoreAllFee() private { } function isExcludedFromFee(address account) public view returns (bool) { } function isExcludedFromMaxTxAmount(address account) public view returns (bool) { } function _approve( address owner, address spender, uint256 amount ) private { } function _transfer( address from, address to, uint256 amount ) private { } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { } function swapTokensForEth(uint256 tokenAmount) private { } function getTokens() private view returns (address token0, address token1) { } function getTokenBalances(uint256 tokenAmount, uint256 ethAmount) private view returns (uint256 balance0, uint256 balance1) { } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { } function _transferToExcluded( address sender, address recipient, uint256 tAmount ) private { } function _transferFromExcluded( address sender, address recipient, uint256 tAmount ) private { } function burn(uint256 amount) public returns (bool) { } }
!_liquidityLocked
35,204
!_liquidityLocked
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./Ownable.sol"; import "./SafeMath.sol"; import "./Address.sol"; import "./ISwapRouter.sol"; import "./INonfungiblePositionManager.sol"; contract CuttToken is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => bool) private _isExcluded; mapping(address => bool) private _isExcludedFromMaxTxAmount; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 1000000000 * 10**6 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private _name = "Cutt Token"; string private _symbol = "CUTT"; uint8 private _decimals = 9; uint256 public _taxFee = 5; uint256 private _previousTaxFee = _taxFee; uint256 public _liquidityFee = 5; uint256 private _previousLiquidityFee = _liquidityFee; uint256 public _liquidityPercent = 20; uint256 public _cuttiesPercent = 10; uint256 public _nftStakingPercent = 15; uint256 public _v3StakingPercent = 25; uint256 public _smartFarmingPercent = 25; uint256 public _treasuryPercent = 5; address public _liquidityAddress; address public _cuttiesAddress; address public _nftStakingAddress; address public _v3StakingAddress; address public _smartFarmingAddress; address public _treasuryAddress; bool public _liquidityLocked = false; bool public _cuttiesLocked = false; bool public _nftStakingLocked = false; bool public _v3StakingLocked = false; bool public _smartFarmingLocked = false; bool public _treasuryLocked = false; ISwapRouter public swapRouter; INonfungiblePositionManager public nonfungiblePositionManager; bool inSwapAndLiquify; bool public swapAndLiquifyEnabled = true; uint256 public _maxTxAmount = 5000000 * 10**6 * 10**9; uint256 private numTokensSellToAddToLiquidity = 500000 * 10**6 * 10**9; uint24 private _uniswapV3Fee = 500; int24 private _tickLower = -887270; int24 private _tickUpper = 887270; event SwapAndLiquifyEnabledUpdated(bool enabled); event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity ); modifier lockTheSwap { } constructor() { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function isExcludedFromReward(address account) public view returns (bool) { } function totalFees() public view returns (uint256) { } function setSwapParam( uint24 fee, int24 tickLower, int24 tickUpper ) public onlyOwner { } function setTreasuryAddress(address treasuryAddress) public onlyOwner { } function setLiquidityAddress(address liquidityAddress) public onlyOwner { } function setNFTStakingAddress(address nftStakingAddress) public onlyOwner { } function setV3StakingAddress(address v3StakingAddress) public onlyOwner { } function setSmartFarmingAddress(address farmingAddress) public onlyOwner { } function setPoolAddress(address poolAddress) external { } function setCuttiesAddress(address cuttiesAddress) public onlyOwner { } function _setExcludedAll(address settingAddress) private { } function mintTreasuryToken() external { } function mintLiquidityToken() external { } function mintNFTStakingToken() external { require(<FILL_ME>) require(!_nftStakingLocked); _mint(_nftStakingAddress, _nftStakingPercent); _nftStakingLocked = true; } function mintV3StakingToken() external { } function mintSmartFarmingToken() external { } function mintCuttiesToken() external { } function _mint(address to, uint256 percent) private { } function deliver(uint256 tAmount) public { } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns (uint256) { } function tokenFromReflection(uint256 rAmount) public view returns (uint256) { } function excludeFromReward(address account) public onlyOwner() { } function includeInReward(address account) external onlyOwner() { } function _transferBothExcluded( address sender, address recipient, uint256 tAmount ) private { } function excludeFromFee(address account) public onlyOwner { } function includeInFee(address account) public onlyOwner { } function excludeFromMaxTxAmount(address account) public onlyOwner { } function includeInMaxTxAmount(address account) public onlyOwner { } function setTaxFeePercent(uint256 taxFee) external onlyOwner() { } function setLiquidityFeePercent(uint256 liquidityFee) external onlyOwner() { } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { } function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner { } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _reflectFee(uint256 rFee, uint256 tFee) private { } function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { } function _getTValues(uint256 tAmount) private view returns ( uint256, uint256, uint256 ) { } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { } function _getRate() private view returns (uint256) { } function _getCurrentSupply() private view returns (uint256, uint256) { } function _takeLiquidity(uint256 tLiquidity) private { } function calculateTaxFee(uint256 _amount) private view returns (uint256) { } function calculateLiquidityFee(uint256 _amount) private view returns (uint256) { } function removeAllFee() private { } function restoreAllFee() private { } function isExcludedFromFee(address account) public view returns (bool) { } function isExcludedFromMaxTxAmount(address account) public view returns (bool) { } function _approve( address owner, address spender, uint256 amount ) private { } function _transfer( address from, address to, uint256 amount ) private { } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { } function swapTokensForEth(uint256 tokenAmount) private { } function getTokens() private view returns (address token0, address token1) { } function getTokenBalances(uint256 tokenAmount, uint256 ethAmount) private view returns (uint256 balance0, uint256 balance1) { } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { } function _transferToExcluded( address sender, address recipient, uint256 tAmount ) private { } function _transferFromExcluded( address sender, address recipient, uint256 tAmount ) private { } function burn(uint256 amount) public returns (bool) { } }
_msgSender()==_nftStakingAddress
35,204
_msgSender()==_nftStakingAddress
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./Ownable.sol"; import "./SafeMath.sol"; import "./Address.sol"; import "./ISwapRouter.sol"; import "./INonfungiblePositionManager.sol"; contract CuttToken is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => bool) private _isExcluded; mapping(address => bool) private _isExcludedFromMaxTxAmount; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 1000000000 * 10**6 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private _name = "Cutt Token"; string private _symbol = "CUTT"; uint8 private _decimals = 9; uint256 public _taxFee = 5; uint256 private _previousTaxFee = _taxFee; uint256 public _liquidityFee = 5; uint256 private _previousLiquidityFee = _liquidityFee; uint256 public _liquidityPercent = 20; uint256 public _cuttiesPercent = 10; uint256 public _nftStakingPercent = 15; uint256 public _v3StakingPercent = 25; uint256 public _smartFarmingPercent = 25; uint256 public _treasuryPercent = 5; address public _liquidityAddress; address public _cuttiesAddress; address public _nftStakingAddress; address public _v3StakingAddress; address public _smartFarmingAddress; address public _treasuryAddress; bool public _liquidityLocked = false; bool public _cuttiesLocked = false; bool public _nftStakingLocked = false; bool public _v3StakingLocked = false; bool public _smartFarmingLocked = false; bool public _treasuryLocked = false; ISwapRouter public swapRouter; INonfungiblePositionManager public nonfungiblePositionManager; bool inSwapAndLiquify; bool public swapAndLiquifyEnabled = true; uint256 public _maxTxAmount = 5000000 * 10**6 * 10**9; uint256 private numTokensSellToAddToLiquidity = 500000 * 10**6 * 10**9; uint24 private _uniswapV3Fee = 500; int24 private _tickLower = -887270; int24 private _tickUpper = 887270; event SwapAndLiquifyEnabledUpdated(bool enabled); event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity ); modifier lockTheSwap { } constructor() { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function isExcludedFromReward(address account) public view returns (bool) { } function totalFees() public view returns (uint256) { } function setSwapParam( uint24 fee, int24 tickLower, int24 tickUpper ) public onlyOwner { } function setTreasuryAddress(address treasuryAddress) public onlyOwner { } function setLiquidityAddress(address liquidityAddress) public onlyOwner { } function setNFTStakingAddress(address nftStakingAddress) public onlyOwner { } function setV3StakingAddress(address v3StakingAddress) public onlyOwner { } function setSmartFarmingAddress(address farmingAddress) public onlyOwner { } function setPoolAddress(address poolAddress) external { } function setCuttiesAddress(address cuttiesAddress) public onlyOwner { } function _setExcludedAll(address settingAddress) private { } function mintTreasuryToken() external { } function mintLiquidityToken() external { } function mintNFTStakingToken() external { require(_msgSender() == _nftStakingAddress); require(<FILL_ME>) _mint(_nftStakingAddress, _nftStakingPercent); _nftStakingLocked = true; } function mintV3StakingToken() external { } function mintSmartFarmingToken() external { } function mintCuttiesToken() external { } function _mint(address to, uint256 percent) private { } function deliver(uint256 tAmount) public { } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns (uint256) { } function tokenFromReflection(uint256 rAmount) public view returns (uint256) { } function excludeFromReward(address account) public onlyOwner() { } function includeInReward(address account) external onlyOwner() { } function _transferBothExcluded( address sender, address recipient, uint256 tAmount ) private { } function excludeFromFee(address account) public onlyOwner { } function includeInFee(address account) public onlyOwner { } function excludeFromMaxTxAmount(address account) public onlyOwner { } function includeInMaxTxAmount(address account) public onlyOwner { } function setTaxFeePercent(uint256 taxFee) external onlyOwner() { } function setLiquidityFeePercent(uint256 liquidityFee) external onlyOwner() { } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { } function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner { } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _reflectFee(uint256 rFee, uint256 tFee) private { } function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { } function _getTValues(uint256 tAmount) private view returns ( uint256, uint256, uint256 ) { } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { } function _getRate() private view returns (uint256) { } function _getCurrentSupply() private view returns (uint256, uint256) { } function _takeLiquidity(uint256 tLiquidity) private { } function calculateTaxFee(uint256 _amount) private view returns (uint256) { } function calculateLiquidityFee(uint256 _amount) private view returns (uint256) { } function removeAllFee() private { } function restoreAllFee() private { } function isExcludedFromFee(address account) public view returns (bool) { } function isExcludedFromMaxTxAmount(address account) public view returns (bool) { } function _approve( address owner, address spender, uint256 amount ) private { } function _transfer( address from, address to, uint256 amount ) private { } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { } function swapTokensForEth(uint256 tokenAmount) private { } function getTokens() private view returns (address token0, address token1) { } function getTokenBalances(uint256 tokenAmount, uint256 ethAmount) private view returns (uint256 balance0, uint256 balance1) { } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { } function _transferToExcluded( address sender, address recipient, uint256 tAmount ) private { } function _transferFromExcluded( address sender, address recipient, uint256 tAmount ) private { } function burn(uint256 amount) public returns (bool) { } }
!_nftStakingLocked
35,204
!_nftStakingLocked
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./Ownable.sol"; import "./SafeMath.sol"; import "./Address.sol"; import "./ISwapRouter.sol"; import "./INonfungiblePositionManager.sol"; contract CuttToken is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => bool) private _isExcluded; mapping(address => bool) private _isExcludedFromMaxTxAmount; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 1000000000 * 10**6 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private _name = "Cutt Token"; string private _symbol = "CUTT"; uint8 private _decimals = 9; uint256 public _taxFee = 5; uint256 private _previousTaxFee = _taxFee; uint256 public _liquidityFee = 5; uint256 private _previousLiquidityFee = _liquidityFee; uint256 public _liquidityPercent = 20; uint256 public _cuttiesPercent = 10; uint256 public _nftStakingPercent = 15; uint256 public _v3StakingPercent = 25; uint256 public _smartFarmingPercent = 25; uint256 public _treasuryPercent = 5; address public _liquidityAddress; address public _cuttiesAddress; address public _nftStakingAddress; address public _v3StakingAddress; address public _smartFarmingAddress; address public _treasuryAddress; bool public _liquidityLocked = false; bool public _cuttiesLocked = false; bool public _nftStakingLocked = false; bool public _v3StakingLocked = false; bool public _smartFarmingLocked = false; bool public _treasuryLocked = false; ISwapRouter public swapRouter; INonfungiblePositionManager public nonfungiblePositionManager; bool inSwapAndLiquify; bool public swapAndLiquifyEnabled = true; uint256 public _maxTxAmount = 5000000 * 10**6 * 10**9; uint256 private numTokensSellToAddToLiquidity = 500000 * 10**6 * 10**9; uint24 private _uniswapV3Fee = 500; int24 private _tickLower = -887270; int24 private _tickUpper = 887270; event SwapAndLiquifyEnabledUpdated(bool enabled); event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity ); modifier lockTheSwap { } constructor() { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function isExcludedFromReward(address account) public view returns (bool) { } function totalFees() public view returns (uint256) { } function setSwapParam( uint24 fee, int24 tickLower, int24 tickUpper ) public onlyOwner { } function setTreasuryAddress(address treasuryAddress) public onlyOwner { } function setLiquidityAddress(address liquidityAddress) public onlyOwner { } function setNFTStakingAddress(address nftStakingAddress) public onlyOwner { } function setV3StakingAddress(address v3StakingAddress) public onlyOwner { } function setSmartFarmingAddress(address farmingAddress) public onlyOwner { } function setPoolAddress(address poolAddress) external { } function setCuttiesAddress(address cuttiesAddress) public onlyOwner { } function _setExcludedAll(address settingAddress) private { } function mintTreasuryToken() external { } function mintLiquidityToken() external { } function mintNFTStakingToken() external { } function mintV3StakingToken() external { require(<FILL_ME>) require(!_v3StakingLocked); _mint(_v3StakingAddress, _v3StakingPercent); _v3StakingLocked = true; } function mintSmartFarmingToken() external { } function mintCuttiesToken() external { } function _mint(address to, uint256 percent) private { } function deliver(uint256 tAmount) public { } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns (uint256) { } function tokenFromReflection(uint256 rAmount) public view returns (uint256) { } function excludeFromReward(address account) public onlyOwner() { } function includeInReward(address account) external onlyOwner() { } function _transferBothExcluded( address sender, address recipient, uint256 tAmount ) private { } function excludeFromFee(address account) public onlyOwner { } function includeInFee(address account) public onlyOwner { } function excludeFromMaxTxAmount(address account) public onlyOwner { } function includeInMaxTxAmount(address account) public onlyOwner { } function setTaxFeePercent(uint256 taxFee) external onlyOwner() { } function setLiquidityFeePercent(uint256 liquidityFee) external onlyOwner() { } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { } function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner { } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _reflectFee(uint256 rFee, uint256 tFee) private { } function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { } function _getTValues(uint256 tAmount) private view returns ( uint256, uint256, uint256 ) { } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { } function _getRate() private view returns (uint256) { } function _getCurrentSupply() private view returns (uint256, uint256) { } function _takeLiquidity(uint256 tLiquidity) private { } function calculateTaxFee(uint256 _amount) private view returns (uint256) { } function calculateLiquidityFee(uint256 _amount) private view returns (uint256) { } function removeAllFee() private { } function restoreAllFee() private { } function isExcludedFromFee(address account) public view returns (bool) { } function isExcludedFromMaxTxAmount(address account) public view returns (bool) { } function _approve( address owner, address spender, uint256 amount ) private { } function _transfer( address from, address to, uint256 amount ) private { } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { } function swapTokensForEth(uint256 tokenAmount) private { } function getTokens() private view returns (address token0, address token1) { } function getTokenBalances(uint256 tokenAmount, uint256 ethAmount) private view returns (uint256 balance0, uint256 balance1) { } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { } function _transferToExcluded( address sender, address recipient, uint256 tAmount ) private { } function _transferFromExcluded( address sender, address recipient, uint256 tAmount ) private { } function burn(uint256 amount) public returns (bool) { } }
_msgSender()==_v3StakingAddress
35,204
_msgSender()==_v3StakingAddress
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./Ownable.sol"; import "./SafeMath.sol"; import "./Address.sol"; import "./ISwapRouter.sol"; import "./INonfungiblePositionManager.sol"; contract CuttToken is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => bool) private _isExcluded; mapping(address => bool) private _isExcludedFromMaxTxAmount; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 1000000000 * 10**6 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private _name = "Cutt Token"; string private _symbol = "CUTT"; uint8 private _decimals = 9; uint256 public _taxFee = 5; uint256 private _previousTaxFee = _taxFee; uint256 public _liquidityFee = 5; uint256 private _previousLiquidityFee = _liquidityFee; uint256 public _liquidityPercent = 20; uint256 public _cuttiesPercent = 10; uint256 public _nftStakingPercent = 15; uint256 public _v3StakingPercent = 25; uint256 public _smartFarmingPercent = 25; uint256 public _treasuryPercent = 5; address public _liquidityAddress; address public _cuttiesAddress; address public _nftStakingAddress; address public _v3StakingAddress; address public _smartFarmingAddress; address public _treasuryAddress; bool public _liquidityLocked = false; bool public _cuttiesLocked = false; bool public _nftStakingLocked = false; bool public _v3StakingLocked = false; bool public _smartFarmingLocked = false; bool public _treasuryLocked = false; ISwapRouter public swapRouter; INonfungiblePositionManager public nonfungiblePositionManager; bool inSwapAndLiquify; bool public swapAndLiquifyEnabled = true; uint256 public _maxTxAmount = 5000000 * 10**6 * 10**9; uint256 private numTokensSellToAddToLiquidity = 500000 * 10**6 * 10**9; uint24 private _uniswapV3Fee = 500; int24 private _tickLower = -887270; int24 private _tickUpper = 887270; event SwapAndLiquifyEnabledUpdated(bool enabled); event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity ); modifier lockTheSwap { } constructor() { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function isExcludedFromReward(address account) public view returns (bool) { } function totalFees() public view returns (uint256) { } function setSwapParam( uint24 fee, int24 tickLower, int24 tickUpper ) public onlyOwner { } function setTreasuryAddress(address treasuryAddress) public onlyOwner { } function setLiquidityAddress(address liquidityAddress) public onlyOwner { } function setNFTStakingAddress(address nftStakingAddress) public onlyOwner { } function setV3StakingAddress(address v3StakingAddress) public onlyOwner { } function setSmartFarmingAddress(address farmingAddress) public onlyOwner { } function setPoolAddress(address poolAddress) external { } function setCuttiesAddress(address cuttiesAddress) public onlyOwner { } function _setExcludedAll(address settingAddress) private { } function mintTreasuryToken() external { } function mintLiquidityToken() external { } function mintNFTStakingToken() external { } function mintV3StakingToken() external { require(_msgSender() == _v3StakingAddress); require(<FILL_ME>) _mint(_v3StakingAddress, _v3StakingPercent); _v3StakingLocked = true; } function mintSmartFarmingToken() external { } function mintCuttiesToken() external { } function _mint(address to, uint256 percent) private { } function deliver(uint256 tAmount) public { } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns (uint256) { } function tokenFromReflection(uint256 rAmount) public view returns (uint256) { } function excludeFromReward(address account) public onlyOwner() { } function includeInReward(address account) external onlyOwner() { } function _transferBothExcluded( address sender, address recipient, uint256 tAmount ) private { } function excludeFromFee(address account) public onlyOwner { } function includeInFee(address account) public onlyOwner { } function excludeFromMaxTxAmount(address account) public onlyOwner { } function includeInMaxTxAmount(address account) public onlyOwner { } function setTaxFeePercent(uint256 taxFee) external onlyOwner() { } function setLiquidityFeePercent(uint256 liquidityFee) external onlyOwner() { } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { } function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner { } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _reflectFee(uint256 rFee, uint256 tFee) private { } function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { } function _getTValues(uint256 tAmount) private view returns ( uint256, uint256, uint256 ) { } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { } function _getRate() private view returns (uint256) { } function _getCurrentSupply() private view returns (uint256, uint256) { } function _takeLiquidity(uint256 tLiquidity) private { } function calculateTaxFee(uint256 _amount) private view returns (uint256) { } function calculateLiquidityFee(uint256 _amount) private view returns (uint256) { } function removeAllFee() private { } function restoreAllFee() private { } function isExcludedFromFee(address account) public view returns (bool) { } function isExcludedFromMaxTxAmount(address account) public view returns (bool) { } function _approve( address owner, address spender, uint256 amount ) private { } function _transfer( address from, address to, uint256 amount ) private { } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { } function swapTokensForEth(uint256 tokenAmount) private { } function getTokens() private view returns (address token0, address token1) { } function getTokenBalances(uint256 tokenAmount, uint256 ethAmount) private view returns (uint256 balance0, uint256 balance1) { } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { } function _transferToExcluded( address sender, address recipient, uint256 tAmount ) private { } function _transferFromExcluded( address sender, address recipient, uint256 tAmount ) private { } function burn(uint256 amount) public returns (bool) { } }
!_v3StakingLocked
35,204
!_v3StakingLocked
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./Ownable.sol"; import "./SafeMath.sol"; import "./Address.sol"; import "./ISwapRouter.sol"; import "./INonfungiblePositionManager.sol"; contract CuttToken is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => bool) private _isExcluded; mapping(address => bool) private _isExcludedFromMaxTxAmount; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 1000000000 * 10**6 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private _name = "Cutt Token"; string private _symbol = "CUTT"; uint8 private _decimals = 9; uint256 public _taxFee = 5; uint256 private _previousTaxFee = _taxFee; uint256 public _liquidityFee = 5; uint256 private _previousLiquidityFee = _liquidityFee; uint256 public _liquidityPercent = 20; uint256 public _cuttiesPercent = 10; uint256 public _nftStakingPercent = 15; uint256 public _v3StakingPercent = 25; uint256 public _smartFarmingPercent = 25; uint256 public _treasuryPercent = 5; address public _liquidityAddress; address public _cuttiesAddress; address public _nftStakingAddress; address public _v3StakingAddress; address public _smartFarmingAddress; address public _treasuryAddress; bool public _liquidityLocked = false; bool public _cuttiesLocked = false; bool public _nftStakingLocked = false; bool public _v3StakingLocked = false; bool public _smartFarmingLocked = false; bool public _treasuryLocked = false; ISwapRouter public swapRouter; INonfungiblePositionManager public nonfungiblePositionManager; bool inSwapAndLiquify; bool public swapAndLiquifyEnabled = true; uint256 public _maxTxAmount = 5000000 * 10**6 * 10**9; uint256 private numTokensSellToAddToLiquidity = 500000 * 10**6 * 10**9; uint24 private _uniswapV3Fee = 500; int24 private _tickLower = -887270; int24 private _tickUpper = 887270; event SwapAndLiquifyEnabledUpdated(bool enabled); event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity ); modifier lockTheSwap { } constructor() { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function isExcludedFromReward(address account) public view returns (bool) { } function totalFees() public view returns (uint256) { } function setSwapParam( uint24 fee, int24 tickLower, int24 tickUpper ) public onlyOwner { } function setTreasuryAddress(address treasuryAddress) public onlyOwner { } function setLiquidityAddress(address liquidityAddress) public onlyOwner { } function setNFTStakingAddress(address nftStakingAddress) public onlyOwner { } function setV3StakingAddress(address v3StakingAddress) public onlyOwner { } function setSmartFarmingAddress(address farmingAddress) public onlyOwner { } function setPoolAddress(address poolAddress) external { } function setCuttiesAddress(address cuttiesAddress) public onlyOwner { } function _setExcludedAll(address settingAddress) private { } function mintTreasuryToken() external { } function mintLiquidityToken() external { } function mintNFTStakingToken() external { } function mintV3StakingToken() external { } function mintSmartFarmingToken() external { require(<FILL_ME>) require(!_smartFarmingLocked); _mint(_smartFarmingAddress, _smartFarmingPercent); _smartFarmingLocked = true; } function mintCuttiesToken() external { } function _mint(address to, uint256 percent) private { } function deliver(uint256 tAmount) public { } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns (uint256) { } function tokenFromReflection(uint256 rAmount) public view returns (uint256) { } function excludeFromReward(address account) public onlyOwner() { } function includeInReward(address account) external onlyOwner() { } function _transferBothExcluded( address sender, address recipient, uint256 tAmount ) private { } function excludeFromFee(address account) public onlyOwner { } function includeInFee(address account) public onlyOwner { } function excludeFromMaxTxAmount(address account) public onlyOwner { } function includeInMaxTxAmount(address account) public onlyOwner { } function setTaxFeePercent(uint256 taxFee) external onlyOwner() { } function setLiquidityFeePercent(uint256 liquidityFee) external onlyOwner() { } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { } function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner { } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _reflectFee(uint256 rFee, uint256 tFee) private { } function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { } function _getTValues(uint256 tAmount) private view returns ( uint256, uint256, uint256 ) { } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { } function _getRate() private view returns (uint256) { } function _getCurrentSupply() private view returns (uint256, uint256) { } function _takeLiquidity(uint256 tLiquidity) private { } function calculateTaxFee(uint256 _amount) private view returns (uint256) { } function calculateLiquidityFee(uint256 _amount) private view returns (uint256) { } function removeAllFee() private { } function restoreAllFee() private { } function isExcludedFromFee(address account) public view returns (bool) { } function isExcludedFromMaxTxAmount(address account) public view returns (bool) { } function _approve( address owner, address spender, uint256 amount ) private { } function _transfer( address from, address to, uint256 amount ) private { } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { } function swapTokensForEth(uint256 tokenAmount) private { } function getTokens() private view returns (address token0, address token1) { } function getTokenBalances(uint256 tokenAmount, uint256 ethAmount) private view returns (uint256 balance0, uint256 balance1) { } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { } function _transferToExcluded( address sender, address recipient, uint256 tAmount ) private { } function _transferFromExcluded( address sender, address recipient, uint256 tAmount ) private { } function burn(uint256 amount) public returns (bool) { } }
_msgSender()==_smartFarmingAddress
35,204
_msgSender()==_smartFarmingAddress
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./Ownable.sol"; import "./SafeMath.sol"; import "./Address.sol"; import "./ISwapRouter.sol"; import "./INonfungiblePositionManager.sol"; contract CuttToken is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => bool) private _isExcluded; mapping(address => bool) private _isExcludedFromMaxTxAmount; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 1000000000 * 10**6 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private _name = "Cutt Token"; string private _symbol = "CUTT"; uint8 private _decimals = 9; uint256 public _taxFee = 5; uint256 private _previousTaxFee = _taxFee; uint256 public _liquidityFee = 5; uint256 private _previousLiquidityFee = _liquidityFee; uint256 public _liquidityPercent = 20; uint256 public _cuttiesPercent = 10; uint256 public _nftStakingPercent = 15; uint256 public _v3StakingPercent = 25; uint256 public _smartFarmingPercent = 25; uint256 public _treasuryPercent = 5; address public _liquidityAddress; address public _cuttiesAddress; address public _nftStakingAddress; address public _v3StakingAddress; address public _smartFarmingAddress; address public _treasuryAddress; bool public _liquidityLocked = false; bool public _cuttiesLocked = false; bool public _nftStakingLocked = false; bool public _v3StakingLocked = false; bool public _smartFarmingLocked = false; bool public _treasuryLocked = false; ISwapRouter public swapRouter; INonfungiblePositionManager public nonfungiblePositionManager; bool inSwapAndLiquify; bool public swapAndLiquifyEnabled = true; uint256 public _maxTxAmount = 5000000 * 10**6 * 10**9; uint256 private numTokensSellToAddToLiquidity = 500000 * 10**6 * 10**9; uint24 private _uniswapV3Fee = 500; int24 private _tickLower = -887270; int24 private _tickUpper = 887270; event SwapAndLiquifyEnabledUpdated(bool enabled); event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity ); modifier lockTheSwap { } constructor() { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function isExcludedFromReward(address account) public view returns (bool) { } function totalFees() public view returns (uint256) { } function setSwapParam( uint24 fee, int24 tickLower, int24 tickUpper ) public onlyOwner { } function setTreasuryAddress(address treasuryAddress) public onlyOwner { } function setLiquidityAddress(address liquidityAddress) public onlyOwner { } function setNFTStakingAddress(address nftStakingAddress) public onlyOwner { } function setV3StakingAddress(address v3StakingAddress) public onlyOwner { } function setSmartFarmingAddress(address farmingAddress) public onlyOwner { } function setPoolAddress(address poolAddress) external { } function setCuttiesAddress(address cuttiesAddress) public onlyOwner { } function _setExcludedAll(address settingAddress) private { } function mintTreasuryToken() external { } function mintLiquidityToken() external { } function mintNFTStakingToken() external { } function mintV3StakingToken() external { } function mintSmartFarmingToken() external { require(_msgSender() == _smartFarmingAddress); require(<FILL_ME>) _mint(_smartFarmingAddress, _smartFarmingPercent); _smartFarmingLocked = true; } function mintCuttiesToken() external { } function _mint(address to, uint256 percent) private { } function deliver(uint256 tAmount) public { } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns (uint256) { } function tokenFromReflection(uint256 rAmount) public view returns (uint256) { } function excludeFromReward(address account) public onlyOwner() { } function includeInReward(address account) external onlyOwner() { } function _transferBothExcluded( address sender, address recipient, uint256 tAmount ) private { } function excludeFromFee(address account) public onlyOwner { } function includeInFee(address account) public onlyOwner { } function excludeFromMaxTxAmount(address account) public onlyOwner { } function includeInMaxTxAmount(address account) public onlyOwner { } function setTaxFeePercent(uint256 taxFee) external onlyOwner() { } function setLiquidityFeePercent(uint256 liquidityFee) external onlyOwner() { } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { } function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner { } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _reflectFee(uint256 rFee, uint256 tFee) private { } function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { } function _getTValues(uint256 tAmount) private view returns ( uint256, uint256, uint256 ) { } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { } function _getRate() private view returns (uint256) { } function _getCurrentSupply() private view returns (uint256, uint256) { } function _takeLiquidity(uint256 tLiquidity) private { } function calculateTaxFee(uint256 _amount) private view returns (uint256) { } function calculateLiquidityFee(uint256 _amount) private view returns (uint256) { } function removeAllFee() private { } function restoreAllFee() private { } function isExcludedFromFee(address account) public view returns (bool) { } function isExcludedFromMaxTxAmount(address account) public view returns (bool) { } function _approve( address owner, address spender, uint256 amount ) private { } function _transfer( address from, address to, uint256 amount ) private { } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { } function swapTokensForEth(uint256 tokenAmount) private { } function getTokens() private view returns (address token0, address token1) { } function getTokenBalances(uint256 tokenAmount, uint256 ethAmount) private view returns (uint256 balance0, uint256 balance1) { } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { } function _transferToExcluded( address sender, address recipient, uint256 tAmount ) private { } function _transferFromExcluded( address sender, address recipient, uint256 tAmount ) private { } function burn(uint256 amount) public returns (bool) { } }
!_smartFarmingLocked
35,204
!_smartFarmingLocked
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./Ownable.sol"; import "./SafeMath.sol"; import "./Address.sol"; import "./ISwapRouter.sol"; import "./INonfungiblePositionManager.sol"; contract CuttToken is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => bool) private _isExcluded; mapping(address => bool) private _isExcludedFromMaxTxAmount; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 1000000000 * 10**6 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private _name = "Cutt Token"; string private _symbol = "CUTT"; uint8 private _decimals = 9; uint256 public _taxFee = 5; uint256 private _previousTaxFee = _taxFee; uint256 public _liquidityFee = 5; uint256 private _previousLiquidityFee = _liquidityFee; uint256 public _liquidityPercent = 20; uint256 public _cuttiesPercent = 10; uint256 public _nftStakingPercent = 15; uint256 public _v3StakingPercent = 25; uint256 public _smartFarmingPercent = 25; uint256 public _treasuryPercent = 5; address public _liquidityAddress; address public _cuttiesAddress; address public _nftStakingAddress; address public _v3StakingAddress; address public _smartFarmingAddress; address public _treasuryAddress; bool public _liquidityLocked = false; bool public _cuttiesLocked = false; bool public _nftStakingLocked = false; bool public _v3StakingLocked = false; bool public _smartFarmingLocked = false; bool public _treasuryLocked = false; ISwapRouter public swapRouter; INonfungiblePositionManager public nonfungiblePositionManager; bool inSwapAndLiquify; bool public swapAndLiquifyEnabled = true; uint256 public _maxTxAmount = 5000000 * 10**6 * 10**9; uint256 private numTokensSellToAddToLiquidity = 500000 * 10**6 * 10**9; uint24 private _uniswapV3Fee = 500; int24 private _tickLower = -887270; int24 private _tickUpper = 887270; event SwapAndLiquifyEnabledUpdated(bool enabled); event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity ); modifier lockTheSwap { } constructor() { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function isExcludedFromReward(address account) public view returns (bool) { } function totalFees() public view returns (uint256) { } function setSwapParam( uint24 fee, int24 tickLower, int24 tickUpper ) public onlyOwner { } function setTreasuryAddress(address treasuryAddress) public onlyOwner { } function setLiquidityAddress(address liquidityAddress) public onlyOwner { } function setNFTStakingAddress(address nftStakingAddress) public onlyOwner { } function setV3StakingAddress(address v3StakingAddress) public onlyOwner { } function setSmartFarmingAddress(address farmingAddress) public onlyOwner { } function setPoolAddress(address poolAddress) external { } function setCuttiesAddress(address cuttiesAddress) public onlyOwner { } function _setExcludedAll(address settingAddress) private { } function mintTreasuryToken() external { } function mintLiquidityToken() external { } function mintNFTStakingToken() external { } function mintV3StakingToken() external { } function mintSmartFarmingToken() external { } function mintCuttiesToken() external { require(<FILL_ME>) require(!_cuttiesLocked); _mint(_cuttiesAddress, _cuttiesPercent); _cuttiesLocked = true; } function _mint(address to, uint256 percent) private { } function deliver(uint256 tAmount) public { } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns (uint256) { } function tokenFromReflection(uint256 rAmount) public view returns (uint256) { } function excludeFromReward(address account) public onlyOwner() { } function includeInReward(address account) external onlyOwner() { } function _transferBothExcluded( address sender, address recipient, uint256 tAmount ) private { } function excludeFromFee(address account) public onlyOwner { } function includeInFee(address account) public onlyOwner { } function excludeFromMaxTxAmount(address account) public onlyOwner { } function includeInMaxTxAmount(address account) public onlyOwner { } function setTaxFeePercent(uint256 taxFee) external onlyOwner() { } function setLiquidityFeePercent(uint256 liquidityFee) external onlyOwner() { } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { } function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner { } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _reflectFee(uint256 rFee, uint256 tFee) private { } function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { } function _getTValues(uint256 tAmount) private view returns ( uint256, uint256, uint256 ) { } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { } function _getRate() private view returns (uint256) { } function _getCurrentSupply() private view returns (uint256, uint256) { } function _takeLiquidity(uint256 tLiquidity) private { } function calculateTaxFee(uint256 _amount) private view returns (uint256) { } function calculateLiquidityFee(uint256 _amount) private view returns (uint256) { } function removeAllFee() private { } function restoreAllFee() private { } function isExcludedFromFee(address account) public view returns (bool) { } function isExcludedFromMaxTxAmount(address account) public view returns (bool) { } function _approve( address owner, address spender, uint256 amount ) private { } function _transfer( address from, address to, uint256 amount ) private { } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { } function swapTokensForEth(uint256 tokenAmount) private { } function getTokens() private view returns (address token0, address token1) { } function getTokenBalances(uint256 tokenAmount, uint256 ethAmount) private view returns (uint256 balance0, uint256 balance1) { } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { } function _transferToExcluded( address sender, address recipient, uint256 tAmount ) private { } function _transferFromExcluded( address sender, address recipient, uint256 tAmount ) private { } function burn(uint256 amount) public returns (bool) { } }
_msgSender()==_cuttiesAddress
35,204
_msgSender()==_cuttiesAddress
null
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./IERC20.sol"; import "./Ownable.sol"; import "./SafeMath.sol"; import "./Address.sol"; import "./ISwapRouter.sol"; import "./INonfungiblePositionManager.sol"; contract CuttToken is Context, IERC20, Ownable { using SafeMath for uint256; using Address for address; mapping(address => uint256) private _rOwned; mapping(address => uint256) private _tOwned; mapping(address => mapping(address => uint256)) private _allowances; mapping(address => bool) private _isExcludedFromFee; mapping(address => bool) private _isExcluded; mapping(address => bool) private _isExcludedFromMaxTxAmount; address[] private _excluded; uint256 private constant MAX = ~uint256(0); uint256 private _tTotal = 1000000000 * 10**6 * 10**9; uint256 private _rTotal = (MAX - (MAX % _tTotal)); uint256 private _tFeeTotal; string private _name = "Cutt Token"; string private _symbol = "CUTT"; uint8 private _decimals = 9; uint256 public _taxFee = 5; uint256 private _previousTaxFee = _taxFee; uint256 public _liquidityFee = 5; uint256 private _previousLiquidityFee = _liquidityFee; uint256 public _liquidityPercent = 20; uint256 public _cuttiesPercent = 10; uint256 public _nftStakingPercent = 15; uint256 public _v3StakingPercent = 25; uint256 public _smartFarmingPercent = 25; uint256 public _treasuryPercent = 5; address public _liquidityAddress; address public _cuttiesAddress; address public _nftStakingAddress; address public _v3StakingAddress; address public _smartFarmingAddress; address public _treasuryAddress; bool public _liquidityLocked = false; bool public _cuttiesLocked = false; bool public _nftStakingLocked = false; bool public _v3StakingLocked = false; bool public _smartFarmingLocked = false; bool public _treasuryLocked = false; ISwapRouter public swapRouter; INonfungiblePositionManager public nonfungiblePositionManager; bool inSwapAndLiquify; bool public swapAndLiquifyEnabled = true; uint256 public _maxTxAmount = 5000000 * 10**6 * 10**9; uint256 private numTokensSellToAddToLiquidity = 500000 * 10**6 * 10**9; uint24 private _uniswapV3Fee = 500; int24 private _tickLower = -887270; int24 private _tickUpper = 887270; event SwapAndLiquifyEnabledUpdated(bool enabled); event SwapAndLiquify( uint256 tokensSwapped, uint256 ethReceived, uint256 tokensIntoLiquidity ); modifier lockTheSwap { } constructor() { } function name() public view returns (string memory) { } function symbol() public view returns (string memory) { } function decimals() public view returns (uint8) { } function totalSupply() public view override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom( address sender, address recipient, uint256 amount ) public override returns (bool) { } function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) { } function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) { } function isExcludedFromReward(address account) public view returns (bool) { } function totalFees() public view returns (uint256) { } function setSwapParam( uint24 fee, int24 tickLower, int24 tickUpper ) public onlyOwner { } function setTreasuryAddress(address treasuryAddress) public onlyOwner { } function setLiquidityAddress(address liquidityAddress) public onlyOwner { } function setNFTStakingAddress(address nftStakingAddress) public onlyOwner { } function setV3StakingAddress(address v3StakingAddress) public onlyOwner { } function setSmartFarmingAddress(address farmingAddress) public onlyOwner { } function setPoolAddress(address poolAddress) external { } function setCuttiesAddress(address cuttiesAddress) public onlyOwner { } function _setExcludedAll(address settingAddress) private { } function mintTreasuryToken() external { } function mintLiquidityToken() external { } function mintNFTStakingToken() external { } function mintV3StakingToken() external { } function mintSmartFarmingToken() external { } function mintCuttiesToken() external { require(_msgSender() == _cuttiesAddress); require(<FILL_ME>) _mint(_cuttiesAddress, _cuttiesPercent); _cuttiesLocked = true; } function _mint(address to, uint256 percent) private { } function deliver(uint256 tAmount) public { } function reflectionFromToken(uint256 tAmount, bool deductTransferFee) public view returns (uint256) { } function tokenFromReflection(uint256 rAmount) public view returns (uint256) { } function excludeFromReward(address account) public onlyOwner() { } function includeInReward(address account) external onlyOwner() { } function _transferBothExcluded( address sender, address recipient, uint256 tAmount ) private { } function excludeFromFee(address account) public onlyOwner { } function includeInFee(address account) public onlyOwner { } function excludeFromMaxTxAmount(address account) public onlyOwner { } function includeInMaxTxAmount(address account) public onlyOwner { } function setTaxFeePercent(uint256 taxFee) external onlyOwner() { } function setLiquidityFeePercent(uint256 liquidityFee) external onlyOwner() { } function setMaxTxPercent(uint256 maxTxPercent) external onlyOwner() { } function setSwapAndLiquifyEnabled(bool _enabled) public onlyOwner { } //to recieve ETH from uniswapV2Router when swaping receive() external payable {} function _reflectFee(uint256 rFee, uint256 tFee) private { } function _getValues(uint256 tAmount) private view returns ( uint256, uint256, uint256, uint256, uint256, uint256 ) { } function _getTValues(uint256 tAmount) private view returns ( uint256, uint256, uint256 ) { } function _getRValues( uint256 tAmount, uint256 tFee, uint256 tLiquidity, uint256 currentRate ) private pure returns ( uint256, uint256, uint256 ) { } function _getRate() private view returns (uint256) { } function _getCurrentSupply() private view returns (uint256, uint256) { } function _takeLiquidity(uint256 tLiquidity) private { } function calculateTaxFee(uint256 _amount) private view returns (uint256) { } function calculateLiquidityFee(uint256 _amount) private view returns (uint256) { } function removeAllFee() private { } function restoreAllFee() private { } function isExcludedFromFee(address account) public view returns (bool) { } function isExcludedFromMaxTxAmount(address account) public view returns (bool) { } function _approve( address owner, address spender, uint256 amount ) private { } function _transfer( address from, address to, uint256 amount ) private { } function swapAndLiquify(uint256 contractTokenBalance) private lockTheSwap { } function swapTokensForEth(uint256 tokenAmount) private { } function getTokens() private view returns (address token0, address token1) { } function getTokenBalances(uint256 tokenAmount, uint256 ethAmount) private view returns (uint256 balance0, uint256 balance1) { } function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private { } function _tokenTransfer( address sender, address recipient, uint256 amount, bool takeFee ) private { } function _transferStandard( address sender, address recipient, uint256 tAmount ) private { } function _transferToExcluded( address sender, address recipient, uint256 tAmount ) private { } function _transferFromExcluded( address sender, address recipient, uint256 tAmount ) private { } function burn(uint256 amount) public returns (bool) { } }
!_cuttiesLocked
35,204
!_cuttiesLocked
"Base URI has already been set"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import '@openzeppelin/contracts/access/Ownable.sol'; import '@openzeppelin/contracts/utils/Strings.sol'; import './ERC721/ERC721Enum.sol'; contract BasicBatsVIP is ERC721Enum, Ownable { using Strings for uint256; string baseTokenUri; bool baseUriDefined = false; constructor(string memory baseURI) ERC721P("Basic Bats VIP", "BBTSVIP") { } function _baseURI() internal view virtual returns (string memory) { } /* * The setBaseURI function with a possibility to freeze it ! */ function setBaseURI(string memory baseURI) public onlyOwner() { require(<FILL_ME>) baseTokenUri = baseURI; } function lockMetadatas() public onlyOwner() { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } }
!baseUriDefined,"Base URI has already been set"
35,225
!baseUriDefined
null
pragma solidity ^0.4.24; interface PlayerBookReceiverInterface { function receivePlayerInfo(uint256 _pID, address _addr, bytes32 _name, uint256 _laff) external; function receivePlayerNameList(uint256 _pID, bytes32 _name) external; } contract PlayerBook { using NameFilter for string; using SafeMath for uint256; address private admin = msg.sender; address private com = 0x0787c7510b21305eea4c267fafd46ab85bdec67e; //============================================================================== // _| _ _|_ _ _ _ _|_ _ . // (_|(_| | (_| _\(/_ | |_||_) . //=============================|================================================ uint256 public registrationFee_ = 10 finney; // price to register a name mapping(uint256 => PlayerBookReceiverInterface) public games_; // mapping of our game interfaces for sending your account info to games mapping(address => bytes32) public gameNames_; // lookup a games name mapping(address => uint256) public gameIDs_; // lokup a games ID uint256 public gID_; // total number of games uint256 public pID_; // total number of players mapping (address => uint256) public pIDxAddr_; // (addr => pID) returns player id by address mapping (bytes32 => uint256) public pIDxName_; // (name => pID) returns player id by name mapping (uint256 => Player) public plyr_; // (pID => data) player data mapping (uint256 => mapping (bytes32 => bool)) public plyrNames_; // (pID => name => bool) list of names a player owns. (used so you can change your display name amoungst any name you own) mapping (uint256 => mapping (uint256 => bytes32)) public plyrNameList_; // (pID => nameNum => name) list of names a player owns struct Player { address addr; bytes32 name; uint256 laff; uint256 names; } //============================================================================== // _ _ _ __|_ _ __|_ _ _ . // (_(_)| |_\ | | |_|(_ | (_)| . (initial data setup upon contract deploy) //============================================================================== constructor() public { } //============================================================================== // _ _ _ _|. |`. _ _ _ . // | | |(_)(_||~|~|(/_| _\ . (these are safety checks) //============================================================================== /** * @dev prevents contracts from interacting with fomo3d */ modifier isHuman() { } modifier isRegisteredGame() { require(<FILL_ME>) _; } //============================================================================== // _ _ _ _|_ _ . // (/_\/(/_| | | _\ . //============================================================================== // fired whenever a player registers a name event onNewName ( uint256 indexed playerID, address indexed playerAddress, bytes32 indexed playerName, bool isNewPlayer, uint256 affiliateID, address affiliateAddress, bytes32 affiliateName, uint256 amountPaid, uint256 timeStamp ); function checkIfNameValid(string _nameStr) public view returns(bool) { } //============================================================================== // _ |_ |. _ |` _ __|_. _ _ _ . // |_)|_||_)||(_ ~|~|_|| |(_ | |(_)| |_\ . (use these to interact with contract) //====|========================================================================= /** * @dev registers a name. UI will always display the last name you registered. * but you will still own all previously registered names to use as affiliate * links. * - must pay a registration fee. * - name must be unique * - names will be converted to lowercase * - name cannot start or end with a space * - cannot have more than 1 space in a row * - cannot be only numbers * - cannot start with 0x * - name must be at least 1 char * - max length of 32 characters long * - allowed characters: a-z, 0-9, and space * -functionhash- 0x921dec21 (using ID for affiliate) * -functionhash- 0x3ddd4698 (using address for affiliate) * -functionhash- 0x685ffd83 (using name for affiliate) * @param _nameString players desired name * @param _affCode affiliate ID, address, or name of who refered you * @param _all set to true if you want this to push your info to all games * (this might cost a lot of gas) */ function registerNameXID(string _nameString, uint256 _affCode, bool _all) isHuman() public payable { } function registerNameXaddr(string _nameString, address _affCode, bool _all) isHuman() public payable { } function registerNameXname(string _nameString, bytes32 _affCode, bool _all) isHuman() public payable { } /** * @dev players, if you registered a profile, before a game was released, or * set the all bool to false when you registered, use this function to push * your profile to a single game. also, if you've updated your name, you * can use this to push your name to games of your choosing. * -functionhash- 0x81c5b206 * @param _gameID game id */ function addMeToGame(uint256 _gameID) isHuman() public { } /** * @dev players, use this to push your player profile to all registered games. * -functionhash- 0x0c6940ea */ function addMeToAllGames() isHuman() public { } /** * @dev players use this to change back to one of your old names. tip, you'll * still need to push that info to existing games. * -functionhash- 0xb9291296 * @param _nameString the name you want to use */ function useMyOldName(string _nameString) isHuman() public { } //============================================================================== // _ _ _ _ | _ _ . _ . // (_(_)| (/_ |(_)(_||(_ . //=====================_|======================================================= function registerNameCore(uint256 _pID, address _addr, uint256 _affID, bytes32 _name, bool _isNewPlayer, bool _all) private { } //============================================================================== // _|_ _ _ | _ . // | (_)(_)|_\ . //============================================================================== function determinePID(address _addr) private returns (bool) { } //============================================================================== // _ _|_ _ _ _ _ | _ _ || _ . // (/_>< | (/_| | |(_|| (_(_|||_\ . //============================================================================== function getPlayerID(address _addr) isRegisteredGame() external returns (uint256) { } function getPlayerName(uint256 _pID) external view returns (bytes32) { } function getPlayerLAff(uint256 _pID) external view returns (uint256) { } function getPlayerAddr(uint256 _pID) external view returns (address) { } function getNameFee() external view returns (uint256) { } function registerNameXIDFromDapp(address _addr, bytes32 _name, uint256 _affCode, bool _all) isRegisteredGame() external payable returns(bool, uint256) { } function registerNameXaddrFromDapp(address _addr, bytes32 _name, address _affCode, bool _all) isRegisteredGame() external payable returns(bool, uint256) { } function registerNameXnameFromDapp(address _addr, bytes32 _name, bytes32 _affCode, bool _all) isRegisteredGame() external payable returns(bool, uint256) { } //============================================================================== // _ _ _|_ _ . // _\(/_ | |_||_) . //=============|================================================================ function addGame(address _gameAddress, string _gameNameStr) public { } function setRegistrationFee(uint256 _fee) public { } } library NameFilter { /** * @dev filters name strings * -converts uppercase to lower case. * -makes sure it does not start/end with a space * -makes sure it does not contain multiple spaces in a row * -cannot be only numbers * -cannot start with 0x * -restricts characters to A-Z, a-z, 0-9, and space. * @return reprocessed string in bytes32 format */ function nameFilter(string _input) internal pure returns(bytes32) { } } /** * @title SafeMath v0.1.9 * @dev Math operations with safety checks that throw on error * change notes: original SafeMath library from OpenZeppelin modified by Inventor * - added sqrt * - added sq * - added pwr * - changed asserts to requires with error log outputs * - removed div, its useless */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev gives square root of given x. */ function sqrt(uint256 x) internal pure returns (uint256 y) { } /** * @dev gives square. multiplies x by x */ function sq(uint256 x) internal pure returns (uint256) { } /** * @dev x to the power of y */ function pwr(uint256 x, uint256 y) internal pure returns (uint256) { } }
gameIDs_[msg.sender]!=0
35,342
gameIDs_[msg.sender]!=0
"umm... thats not a name you own"
pragma solidity ^0.4.24; interface PlayerBookReceiverInterface { function receivePlayerInfo(uint256 _pID, address _addr, bytes32 _name, uint256 _laff) external; function receivePlayerNameList(uint256 _pID, bytes32 _name) external; } contract PlayerBook { using NameFilter for string; using SafeMath for uint256; address private admin = msg.sender; address private com = 0x0787c7510b21305eea4c267fafd46ab85bdec67e; //============================================================================== // _| _ _|_ _ _ _ _|_ _ . // (_|(_| | (_| _\(/_ | |_||_) . //=============================|================================================ uint256 public registrationFee_ = 10 finney; // price to register a name mapping(uint256 => PlayerBookReceiverInterface) public games_; // mapping of our game interfaces for sending your account info to games mapping(address => bytes32) public gameNames_; // lookup a games name mapping(address => uint256) public gameIDs_; // lokup a games ID uint256 public gID_; // total number of games uint256 public pID_; // total number of players mapping (address => uint256) public pIDxAddr_; // (addr => pID) returns player id by address mapping (bytes32 => uint256) public pIDxName_; // (name => pID) returns player id by name mapping (uint256 => Player) public plyr_; // (pID => data) player data mapping (uint256 => mapping (bytes32 => bool)) public plyrNames_; // (pID => name => bool) list of names a player owns. (used so you can change your display name amoungst any name you own) mapping (uint256 => mapping (uint256 => bytes32)) public plyrNameList_; // (pID => nameNum => name) list of names a player owns struct Player { address addr; bytes32 name; uint256 laff; uint256 names; } //============================================================================== // _ _ _ __|_ _ __|_ _ _ . // (_(_)| |_\ | | |_|(_ | (_)| . (initial data setup upon contract deploy) //============================================================================== constructor() public { } //============================================================================== // _ _ _ _|. |`. _ _ _ . // | | |(_)(_||~|~|(/_| _\ . (these are safety checks) //============================================================================== /** * @dev prevents contracts from interacting with fomo3d */ modifier isHuman() { } modifier isRegisteredGame() { } //============================================================================== // _ _ _ _|_ _ . // (/_\/(/_| | | _\ . //============================================================================== // fired whenever a player registers a name event onNewName ( uint256 indexed playerID, address indexed playerAddress, bytes32 indexed playerName, bool isNewPlayer, uint256 affiliateID, address affiliateAddress, bytes32 affiliateName, uint256 amountPaid, uint256 timeStamp ); function checkIfNameValid(string _nameStr) public view returns(bool) { } //============================================================================== // _ |_ |. _ |` _ __|_. _ _ _ . // |_)|_||_)||(_ ~|~|_|| |(_ | |(_)| |_\ . (use these to interact with contract) //====|========================================================================= /** * @dev registers a name. UI will always display the last name you registered. * but you will still own all previously registered names to use as affiliate * links. * - must pay a registration fee. * - name must be unique * - names will be converted to lowercase * - name cannot start or end with a space * - cannot have more than 1 space in a row * - cannot be only numbers * - cannot start with 0x * - name must be at least 1 char * - max length of 32 characters long * - allowed characters: a-z, 0-9, and space * -functionhash- 0x921dec21 (using ID for affiliate) * -functionhash- 0x3ddd4698 (using address for affiliate) * -functionhash- 0x685ffd83 (using name for affiliate) * @param _nameString players desired name * @param _affCode affiliate ID, address, or name of who refered you * @param _all set to true if you want this to push your info to all games * (this might cost a lot of gas) */ function registerNameXID(string _nameString, uint256 _affCode, bool _all) isHuman() public payable { } function registerNameXaddr(string _nameString, address _affCode, bool _all) isHuman() public payable { } function registerNameXname(string _nameString, bytes32 _affCode, bool _all) isHuman() public payable { } /** * @dev players, if you registered a profile, before a game was released, or * set the all bool to false when you registered, use this function to push * your profile to a single game. also, if you've updated your name, you * can use this to push your name to games of your choosing. * -functionhash- 0x81c5b206 * @param _gameID game id */ function addMeToGame(uint256 _gameID) isHuman() public { } /** * @dev players, use this to push your player profile to all registered games. * -functionhash- 0x0c6940ea */ function addMeToAllGames() isHuman() public { } /** * @dev players use this to change back to one of your old names. tip, you'll * still need to push that info to existing games. * -functionhash- 0xb9291296 * @param _nameString the name you want to use */ function useMyOldName(string _nameString) isHuman() public { // filter name, and get pID bytes32 _name = _nameString.nameFilter(); uint256 _pID = pIDxAddr_[msg.sender]; // make sure they own the name require(<FILL_ME>) // update their current name plyr_[_pID].name = _name; } //============================================================================== // _ _ _ _ | _ _ . _ . // (_(_)| (/_ |(_)(_||(_ . //=====================_|======================================================= function registerNameCore(uint256 _pID, address _addr, uint256 _affID, bytes32 _name, bool _isNewPlayer, bool _all) private { } //============================================================================== // _|_ _ _ | _ . // | (_)(_)|_\ . //============================================================================== function determinePID(address _addr) private returns (bool) { } //============================================================================== // _ _|_ _ _ _ _ | _ _ || _ . // (/_>< | (/_| | |(_|| (_(_|||_\ . //============================================================================== function getPlayerID(address _addr) isRegisteredGame() external returns (uint256) { } function getPlayerName(uint256 _pID) external view returns (bytes32) { } function getPlayerLAff(uint256 _pID) external view returns (uint256) { } function getPlayerAddr(uint256 _pID) external view returns (address) { } function getNameFee() external view returns (uint256) { } function registerNameXIDFromDapp(address _addr, bytes32 _name, uint256 _affCode, bool _all) isRegisteredGame() external payable returns(bool, uint256) { } function registerNameXaddrFromDapp(address _addr, bytes32 _name, address _affCode, bool _all) isRegisteredGame() external payable returns(bool, uint256) { } function registerNameXnameFromDapp(address _addr, bytes32 _name, bytes32 _affCode, bool _all) isRegisteredGame() external payable returns(bool, uint256) { } //============================================================================== // _ _ _|_ _ . // _\(/_ | |_||_) . //=============|================================================================ function addGame(address _gameAddress, string _gameNameStr) public { } function setRegistrationFee(uint256 _fee) public { } } library NameFilter { /** * @dev filters name strings * -converts uppercase to lower case. * -makes sure it does not start/end with a space * -makes sure it does not contain multiple spaces in a row * -cannot be only numbers * -cannot start with 0x * -restricts characters to A-Z, a-z, 0-9, and space. * @return reprocessed string in bytes32 format */ function nameFilter(string _input) internal pure returns(bytes32) { } } /** * @title SafeMath v0.1.9 * @dev Math operations with safety checks that throw on error * change notes: original SafeMath library from OpenZeppelin modified by Inventor * - added sqrt * - added sq * - added pwr * - changed asserts to requires with error log outputs * - removed div, its useless */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev gives square root of given x. */ function sqrt(uint256 x) internal pure returns (uint256 y) { } /** * @dev gives square. multiplies x by x */ function sq(uint256 x) internal pure returns (uint256) { } /** * @dev x to the power of y */ function pwr(uint256 x, uint256 y) internal pure returns (uint256) { } }
plyrNames_[_pID][_name]==true,"umm... thats not a name you own"
35,342
plyrNames_[_pID][_name]==true
"derp, that games already been registered"
pragma solidity ^0.4.24; interface PlayerBookReceiverInterface { function receivePlayerInfo(uint256 _pID, address _addr, bytes32 _name, uint256 _laff) external; function receivePlayerNameList(uint256 _pID, bytes32 _name) external; } contract PlayerBook { using NameFilter for string; using SafeMath for uint256; address private admin = msg.sender; address private com = 0x0787c7510b21305eea4c267fafd46ab85bdec67e; //============================================================================== // _| _ _|_ _ _ _ _|_ _ . // (_|(_| | (_| _\(/_ | |_||_) . //=============================|================================================ uint256 public registrationFee_ = 10 finney; // price to register a name mapping(uint256 => PlayerBookReceiverInterface) public games_; // mapping of our game interfaces for sending your account info to games mapping(address => bytes32) public gameNames_; // lookup a games name mapping(address => uint256) public gameIDs_; // lokup a games ID uint256 public gID_; // total number of games uint256 public pID_; // total number of players mapping (address => uint256) public pIDxAddr_; // (addr => pID) returns player id by address mapping (bytes32 => uint256) public pIDxName_; // (name => pID) returns player id by name mapping (uint256 => Player) public plyr_; // (pID => data) player data mapping (uint256 => mapping (bytes32 => bool)) public plyrNames_; // (pID => name => bool) list of names a player owns. (used so you can change your display name amoungst any name you own) mapping (uint256 => mapping (uint256 => bytes32)) public plyrNameList_; // (pID => nameNum => name) list of names a player owns struct Player { address addr; bytes32 name; uint256 laff; uint256 names; } //============================================================================== // _ _ _ __|_ _ __|_ _ _ . // (_(_)| |_\ | | |_|(_ | (_)| . (initial data setup upon contract deploy) //============================================================================== constructor() public { } //============================================================================== // _ _ _ _|. |`. _ _ _ . // | | |(_)(_||~|~|(/_| _\ . (these are safety checks) //============================================================================== /** * @dev prevents contracts from interacting with fomo3d */ modifier isHuman() { } modifier isRegisteredGame() { } //============================================================================== // _ _ _ _|_ _ . // (/_\/(/_| | | _\ . //============================================================================== // fired whenever a player registers a name event onNewName ( uint256 indexed playerID, address indexed playerAddress, bytes32 indexed playerName, bool isNewPlayer, uint256 affiliateID, address affiliateAddress, bytes32 affiliateName, uint256 amountPaid, uint256 timeStamp ); function checkIfNameValid(string _nameStr) public view returns(bool) { } //============================================================================== // _ |_ |. _ |` _ __|_. _ _ _ . // |_)|_||_)||(_ ~|~|_|| |(_ | |(_)| |_\ . (use these to interact with contract) //====|========================================================================= /** * @dev registers a name. UI will always display the last name you registered. * but you will still own all previously registered names to use as affiliate * links. * - must pay a registration fee. * - name must be unique * - names will be converted to lowercase * - name cannot start or end with a space * - cannot have more than 1 space in a row * - cannot be only numbers * - cannot start with 0x * - name must be at least 1 char * - max length of 32 characters long * - allowed characters: a-z, 0-9, and space * -functionhash- 0x921dec21 (using ID for affiliate) * -functionhash- 0x3ddd4698 (using address for affiliate) * -functionhash- 0x685ffd83 (using name for affiliate) * @param _nameString players desired name * @param _affCode affiliate ID, address, or name of who refered you * @param _all set to true if you want this to push your info to all games * (this might cost a lot of gas) */ function registerNameXID(string _nameString, uint256 _affCode, bool _all) isHuman() public payable { } function registerNameXaddr(string _nameString, address _affCode, bool _all) isHuman() public payable { } function registerNameXname(string _nameString, bytes32 _affCode, bool _all) isHuman() public payable { } /** * @dev players, if you registered a profile, before a game was released, or * set the all bool to false when you registered, use this function to push * your profile to a single game. also, if you've updated your name, you * can use this to push your name to games of your choosing. * -functionhash- 0x81c5b206 * @param _gameID game id */ function addMeToGame(uint256 _gameID) isHuman() public { } /** * @dev players, use this to push your player profile to all registered games. * -functionhash- 0x0c6940ea */ function addMeToAllGames() isHuman() public { } /** * @dev players use this to change back to one of your old names. tip, you'll * still need to push that info to existing games. * -functionhash- 0xb9291296 * @param _nameString the name you want to use */ function useMyOldName(string _nameString) isHuman() public { } //============================================================================== // _ _ _ _ | _ _ . _ . // (_(_)| (/_ |(_)(_||(_ . //=====================_|======================================================= function registerNameCore(uint256 _pID, address _addr, uint256 _affID, bytes32 _name, bool _isNewPlayer, bool _all) private { } //============================================================================== // _|_ _ _ | _ . // | (_)(_)|_\ . //============================================================================== function determinePID(address _addr) private returns (bool) { } //============================================================================== // _ _|_ _ _ _ _ | _ _ || _ . // (/_>< | (/_| | |(_|| (_(_|||_\ . //============================================================================== function getPlayerID(address _addr) isRegisteredGame() external returns (uint256) { } function getPlayerName(uint256 _pID) external view returns (bytes32) { } function getPlayerLAff(uint256 _pID) external view returns (uint256) { } function getPlayerAddr(uint256 _pID) external view returns (address) { } function getNameFee() external view returns (uint256) { } function registerNameXIDFromDapp(address _addr, bytes32 _name, uint256 _affCode, bool _all) isRegisteredGame() external payable returns(bool, uint256) { } function registerNameXaddrFromDapp(address _addr, bytes32 _name, address _affCode, bool _all) isRegisteredGame() external payable returns(bool, uint256) { } function registerNameXnameFromDapp(address _addr, bytes32 _name, bytes32 _affCode, bool _all) isRegisteredGame() external payable returns(bool, uint256) { } //============================================================================== // _ _ _|_ _ . // _\(/_ | |_||_) . //=============|================================================================ function addGame(address _gameAddress, string _gameNameStr) public { require(msg.sender == admin, "only admin can call"); require(<FILL_ME>) gID_++; bytes32 _name = _gameNameStr.nameFilter(); gameIDs_[_gameAddress] = gID_; gameNames_[_gameAddress] = _name; games_[gID_] = PlayerBookReceiverInterface(_gameAddress); games_[gID_].receivePlayerInfo(1, plyr_[1].addr, plyr_[1].name, 0); } function setRegistrationFee(uint256 _fee) public { } } library NameFilter { /** * @dev filters name strings * -converts uppercase to lower case. * -makes sure it does not start/end with a space * -makes sure it does not contain multiple spaces in a row * -cannot be only numbers * -cannot start with 0x * -restricts characters to A-Z, a-z, 0-9, and space. * @return reprocessed string in bytes32 format */ function nameFilter(string _input) internal pure returns(bytes32) { } } /** * @title SafeMath v0.1.9 * @dev Math operations with safety checks that throw on error * change notes: original SafeMath library from OpenZeppelin modified by Inventor * - added sqrt * - added sq * - added pwr * - changed asserts to requires with error log outputs * - removed div, its useless */ library SafeMath { /** * @dev Multiplies two numbers, throws on overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev Subtracts two numbers, throws on overflow (i.e. if subtrahend is greater than minuend). */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { } /** * @dev Adds two numbers, throws on overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256 c) { } /** * @dev gives square root of given x. */ function sqrt(uint256 x) internal pure returns (uint256 y) { } /** * @dev gives square. multiplies x by x */ function sq(uint256 x) internal pure returns (uint256) { } /** * @dev x to the power of y */ function pwr(uint256 x, uint256 y) internal pure returns (uint256) { } }
gameIDs_[_gameAddress]==0,"derp, that games already been registered"
35,342
gameIDs_[_gameAddress]==0
"FWD: insufficient gas"
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.7.6; pragma abicoder v2; import "@openzeppelin/contracts/cryptography/ECDSA.sol"; import "./IForwarder.sol"; contract Forwarder is IForwarder { using ECDSA for bytes32; string public constant GENERIC_PARAMS = "address from,address to,uint256 value,uint256 gas,uint256 nonce,bytes data,uint256 validUntil"; string public constant EIP712_DOMAIN_TYPE = "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"; mapping(bytes32 => bool) public typeHashes; mapping(bytes32 => bool) public domains; // Nonces of senders, used to prevent replay attacks mapping(address => uint256) private nonces; // solhint-disable-next-line no-empty-blocks receive() external payable {} function getNonce(address from) public view override returns (uint256) { } constructor() { } function verify( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig) external override view { } function execute( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig ) external payable override returns (bool success, bytes memory ret) { _verifySig(req, domainSeparator, requestTypeHash, suffixData, sig); _verifyAndUpdateNonce(req); require(req.validUntil == 0 || req.validUntil > block.number, "FWD: request expired"); uint gasForTransfer = 0; if ( req.value != 0 ) { gasForTransfer = 40000; //buffer in case we need to move eth after the transaction. } bytes memory callData = abi.encodePacked(req.data, req.from); require(<FILL_ME>) // solhint-disable-next-line avoid-low-level-calls (success,ret) = req.to.call{gas : req.gas, value : req.value}(callData); if ( req.value != 0 && address(this).balance>0 ) { // can't fail: req.from signed (off-chain) the request, so it must be an EOA... payable(req.from).transfer(address(this).balance); } return (success,ret); } function _verifyNonce(ForwardRequest calldata req) internal view { } function _verifyAndUpdateNonce(ForwardRequest calldata req) internal { } function registerRequestType(string calldata typeName, string calldata typeSuffix) external override { } function registerDomainSeparator(string calldata name, string calldata version) external override { } function registerRequestTypeInternal(string memory requestType) internal { } function _verifySig( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig) internal view { } function _getEncoded( ForwardRequest calldata req, bytes32 requestTypeHash, bytes calldata suffixData ) public pure returns ( bytes memory ) { } }
gasleft()*63/64>=req.gas+gasForTransfer,"FWD: insufficient gas"
35,352
gasleft()*63/64>=req.gas+gasForTransfer
"FWD: nonce mismatch"
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.7.6; pragma abicoder v2; import "@openzeppelin/contracts/cryptography/ECDSA.sol"; import "./IForwarder.sol"; contract Forwarder is IForwarder { using ECDSA for bytes32; string public constant GENERIC_PARAMS = "address from,address to,uint256 value,uint256 gas,uint256 nonce,bytes data,uint256 validUntil"; string public constant EIP712_DOMAIN_TYPE = "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"; mapping(bytes32 => bool) public typeHashes; mapping(bytes32 => bool) public domains; // Nonces of senders, used to prevent replay attacks mapping(address => uint256) private nonces; // solhint-disable-next-line no-empty-blocks receive() external payable {} function getNonce(address from) public view override returns (uint256) { } constructor() { } function verify( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig) external override view { } function execute( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig ) external payable override returns (bool success, bytes memory ret) { } function _verifyNonce(ForwardRequest calldata req) internal view { require(<FILL_ME>) } function _verifyAndUpdateNonce(ForwardRequest calldata req) internal { } function registerRequestType(string calldata typeName, string calldata typeSuffix) external override { } function registerDomainSeparator(string calldata name, string calldata version) external override { } function registerRequestTypeInternal(string memory requestType) internal { } function _verifySig( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig) internal view { } function _getEncoded( ForwardRequest calldata req, bytes32 requestTypeHash, bytes calldata suffixData ) public pure returns ( bytes memory ) { } }
nonces[req.from]==req.nonce,"FWD: nonce mismatch"
35,352
nonces[req.from]==req.nonce
"FWD: nonce mismatch"
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.7.6; pragma abicoder v2; import "@openzeppelin/contracts/cryptography/ECDSA.sol"; import "./IForwarder.sol"; contract Forwarder is IForwarder { using ECDSA for bytes32; string public constant GENERIC_PARAMS = "address from,address to,uint256 value,uint256 gas,uint256 nonce,bytes data,uint256 validUntil"; string public constant EIP712_DOMAIN_TYPE = "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"; mapping(bytes32 => bool) public typeHashes; mapping(bytes32 => bool) public domains; // Nonces of senders, used to prevent replay attacks mapping(address => uint256) private nonces; // solhint-disable-next-line no-empty-blocks receive() external payable {} function getNonce(address from) public view override returns (uint256) { } constructor() { } function verify( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig) external override view { } function execute( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig ) external payable override returns (bool success, bytes memory ret) { } function _verifyNonce(ForwardRequest calldata req) internal view { } function _verifyAndUpdateNonce(ForwardRequest calldata req) internal { require(<FILL_ME>) } function registerRequestType(string calldata typeName, string calldata typeSuffix) external override { } function registerDomainSeparator(string calldata name, string calldata version) external override { } function registerRequestTypeInternal(string memory requestType) internal { } function _verifySig( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig) internal view { } function _getEncoded( ForwardRequest calldata req, bytes32 requestTypeHash, bytes calldata suffixData ) public pure returns ( bytes memory ) { } }
nonces[req.from]++==req.nonce,"FWD: nonce mismatch"
35,352
nonces[req.from]++==req.nonce
"FWD: invalid typename"
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.7.6; pragma abicoder v2; import "@openzeppelin/contracts/cryptography/ECDSA.sol"; import "./IForwarder.sol"; contract Forwarder is IForwarder { using ECDSA for bytes32; string public constant GENERIC_PARAMS = "address from,address to,uint256 value,uint256 gas,uint256 nonce,bytes data,uint256 validUntil"; string public constant EIP712_DOMAIN_TYPE = "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"; mapping(bytes32 => bool) public typeHashes; mapping(bytes32 => bool) public domains; // Nonces of senders, used to prevent replay attacks mapping(address => uint256) private nonces; // solhint-disable-next-line no-empty-blocks receive() external payable {} function getNonce(address from) public view override returns (uint256) { } constructor() { } function verify( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig) external override view { } function execute( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig ) external payable override returns (bool success, bytes memory ret) { } function _verifyNonce(ForwardRequest calldata req) internal view { } function _verifyAndUpdateNonce(ForwardRequest calldata req) internal { } function registerRequestType(string calldata typeName, string calldata typeSuffix) external override { for (uint i = 0; i < bytes(typeName).length; i++) { bytes1 c = bytes(typeName)[i]; require(<FILL_ME>) } string memory requestType = string(abi.encodePacked(typeName, "(", GENERIC_PARAMS, ",", typeSuffix)); registerRequestTypeInternal(requestType); } function registerDomainSeparator(string calldata name, string calldata version) external override { } function registerRequestTypeInternal(string memory requestType) internal { } function _verifySig( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig) internal view { } function _getEncoded( ForwardRequest calldata req, bytes32 requestTypeHash, bytes calldata suffixData ) public pure returns ( bytes memory ) { } }
c!="("&&c!=")","FWD: invalid typename"
35,352
c!="("&&c!=")"
"FWD: unregistered domain sep."
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.7.6; pragma abicoder v2; import "@openzeppelin/contracts/cryptography/ECDSA.sol"; import "./IForwarder.sol"; contract Forwarder is IForwarder { using ECDSA for bytes32; string public constant GENERIC_PARAMS = "address from,address to,uint256 value,uint256 gas,uint256 nonce,bytes data,uint256 validUntil"; string public constant EIP712_DOMAIN_TYPE = "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"; mapping(bytes32 => bool) public typeHashes; mapping(bytes32 => bool) public domains; // Nonces of senders, used to prevent replay attacks mapping(address => uint256) private nonces; // solhint-disable-next-line no-empty-blocks receive() external payable {} function getNonce(address from) public view override returns (uint256) { } constructor() { } function verify( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig) external override view { } function execute( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig ) external payable override returns (bool success, bytes memory ret) { } function _verifyNonce(ForwardRequest calldata req) internal view { } function _verifyAndUpdateNonce(ForwardRequest calldata req) internal { } function registerRequestType(string calldata typeName, string calldata typeSuffix) external override { } function registerDomainSeparator(string calldata name, string calldata version) external override { } function registerRequestTypeInternal(string memory requestType) internal { } function _verifySig( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig) internal view { require(<FILL_ME>) require(typeHashes[requestTypeHash], "FWD: unregistered typehash"); bytes32 digest = keccak256(abi.encodePacked( "\x19\x01", domainSeparator, keccak256(_getEncoded(req, requestTypeHash, suffixData)) )); require(digest.recover(sig) == req.from, "FWD: signature mismatch"); } function _getEncoded( ForwardRequest calldata req, bytes32 requestTypeHash, bytes calldata suffixData ) public pure returns ( bytes memory ) { } }
domains[domainSeparator],"FWD: unregistered domain sep."
35,352
domains[domainSeparator]
"FWD: unregistered typehash"
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.7.6; pragma abicoder v2; import "@openzeppelin/contracts/cryptography/ECDSA.sol"; import "./IForwarder.sol"; contract Forwarder is IForwarder { using ECDSA for bytes32; string public constant GENERIC_PARAMS = "address from,address to,uint256 value,uint256 gas,uint256 nonce,bytes data,uint256 validUntil"; string public constant EIP712_DOMAIN_TYPE = "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"; mapping(bytes32 => bool) public typeHashes; mapping(bytes32 => bool) public domains; // Nonces of senders, used to prevent replay attacks mapping(address => uint256) private nonces; // solhint-disable-next-line no-empty-blocks receive() external payable {} function getNonce(address from) public view override returns (uint256) { } constructor() { } function verify( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig) external override view { } function execute( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig ) external payable override returns (bool success, bytes memory ret) { } function _verifyNonce(ForwardRequest calldata req) internal view { } function _verifyAndUpdateNonce(ForwardRequest calldata req) internal { } function registerRequestType(string calldata typeName, string calldata typeSuffix) external override { } function registerDomainSeparator(string calldata name, string calldata version) external override { } function registerRequestTypeInternal(string memory requestType) internal { } function _verifySig( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig) internal view { require(domains[domainSeparator], "FWD: unregistered domain sep."); require(<FILL_ME>) bytes32 digest = keccak256(abi.encodePacked( "\x19\x01", domainSeparator, keccak256(_getEncoded(req, requestTypeHash, suffixData)) )); require(digest.recover(sig) == req.from, "FWD: signature mismatch"); } function _getEncoded( ForwardRequest calldata req, bytes32 requestTypeHash, bytes calldata suffixData ) public pure returns ( bytes memory ) { } }
typeHashes[requestTypeHash],"FWD: unregistered typehash"
35,352
typeHashes[requestTypeHash]
"FWD: signature mismatch"
// SPDX-License-Identifier: GPL-3.0-only pragma solidity ^0.7.6; pragma abicoder v2; import "@openzeppelin/contracts/cryptography/ECDSA.sol"; import "./IForwarder.sol"; contract Forwarder is IForwarder { using ECDSA for bytes32; string public constant GENERIC_PARAMS = "address from,address to,uint256 value,uint256 gas,uint256 nonce,bytes data,uint256 validUntil"; string public constant EIP712_DOMAIN_TYPE = "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"; mapping(bytes32 => bool) public typeHashes; mapping(bytes32 => bool) public domains; // Nonces of senders, used to prevent replay attacks mapping(address => uint256) private nonces; // solhint-disable-next-line no-empty-blocks receive() external payable {} function getNonce(address from) public view override returns (uint256) { } constructor() { } function verify( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig) external override view { } function execute( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig ) external payable override returns (bool success, bytes memory ret) { } function _verifyNonce(ForwardRequest calldata req) internal view { } function _verifyAndUpdateNonce(ForwardRequest calldata req) internal { } function registerRequestType(string calldata typeName, string calldata typeSuffix) external override { } function registerDomainSeparator(string calldata name, string calldata version) external override { } function registerRequestTypeInternal(string memory requestType) internal { } function _verifySig( ForwardRequest calldata req, bytes32 domainSeparator, bytes32 requestTypeHash, bytes calldata suffixData, bytes calldata sig) internal view { require(domains[domainSeparator], "FWD: unregistered domain sep."); require(typeHashes[requestTypeHash], "FWD: unregistered typehash"); bytes32 digest = keccak256(abi.encodePacked( "\x19\x01", domainSeparator, keccak256(_getEncoded(req, requestTypeHash, suffixData)) )); require(<FILL_ME>) } function _getEncoded( ForwardRequest calldata req, bytes32 requestTypeHash, bytes calldata suffixData ) public pure returns ( bytes memory ) { } }
digest.recover(sig)==req.from,"FWD: signature mismatch"
35,352
digest.recover(sig)==req.from
"NFTCyphertakes: INVALID_TOKEN_ID"
pragma solidity ^0.8.0; import {ERC721URIStorage, ERC721, IERC165} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {AccessControlMixin, AccessControl, Context} from "../../common/AccessControlMixin.sol"; import {NativeMetaTransaction} from "../../common/NativeMetaTransaction.sol"; import {ContextMixin} from "../../common/ContextMixin.sol"; contract NFTCyphertakes is ERC721URIStorage, Pausable, Ownable, AccessControlMixin, NativeMetaTransaction, ContextMixin { // Minter Role bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); // Initial BASE_TOKEN_URI string private BASE_TOKEN_URI; // Initial Contract URI string private CONTRACT_URI; constructor( string memory name_, string memory symbol_, address minterRole ) public ERC721(name_, symbol_) { } modifier TokenId(uint256 tokenId_) { // Restrict minting of tokens to only the minter role, and only for 5 tokens require(<FILL_ME>) _; } // This is to support Native meta transactions // never use msg.sender directly, use _msgSender() instead function _msgSender() internal override view returns (address sender) { } function _msgData() internal override (Context) pure returns (bytes calldata) { } /** * Override isApprovedForAll to auto-approve OS's proxy contract */ function isApprovedForAll( address _owner, address _operator ) public override view returns (bool isOperator) { } /** * @notice Make the SetTokenURI method visible for future upgrade of metadata * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * Requirements: * * - `tokenId` must exist. */ function setTokenURI(uint256 tokenId, string memory _tokenURI) public virtual only(DEFAULT_ADMIN_ROLE) TokenId(tokenId) { } /** * @notice Method for reduce the friction with openSea allows to map the `tokenId` * @dev into our NFT Smart contract and handle some metadata offchain in OpenSea */ function baseTokenURI() public view returns (string memory) { } /** * @notice Method for reduce the friction with openSea allows update the Base Token URI * @dev This method is only available for the owner of the contract * @param _baseTokenURI The new base token URI */ function setBaseTokenURI(string memory _baseTokenURI) public only(DEFAULT_ADMIN_ROLE) { } /** * @notice Method for reduce the friction with openSea allows to map the `tokenId` * @dev into our NFT Smart contract and handle some metadata offchain in OpenSea */ function contractURI() public view returns (string memory) { } /** * @notice Method for reduce the friction with openSea allows update the Contract URI * @dev This method is only available for the owner of the contract * @param _contractURI The new contract URI */ function setContractURI(string memory _contractURI) public only(DEFAULT_ADMIN_ROLE) { } /** * @dev Implementation / Instance of paused methods() in the ERC721. * @param status Setting the status boolean (True for paused, or False for unpaused) * See {ERC721Pausable}. */ function pause(bool status) public only(DEFAULT_ADMIN_ROLE) { } /** * @notice Method for getting OpenSea Version we Operate * @dev This method is for getting the Max Supply by token id */ function openSeaVersion() public pure returns (string memory) { } /** * Compat for factory interfaces on OpenSea * Indicates that this contract can return balances for * tokens that haven't been minted yet */ function supportsFactoryInterface() public pure returns (bool) { } /** * @notice Example function to handle minting tokens on matic chain * @dev Minting can be done as per requirement, * This implementation allows only admin to mint tokens but it can be changed as per requirement * Should verify if token is withdrawn by checking `withdrawnTokens` mapping * @param user user for whom tokens are being minted * @param tokenId tokenId to mint */ function mint(address user, uint256 tokenId, string memory _tokenURI) public TokenId(tokenId) only(MINTER_ROLE) { } /** * @dev Burns `tokenId`. See {ERC721-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) public virtual TokenId(tokenId) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, AccessControl) returns (bool) { } /** * @dev See {ERC721-_beforeTokenTransfer}. * * Requirements: * * - the contract must not be paused. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { } }
((tokenId_>uint(0))),"NFTCyphertakes: INVALID_TOKEN_ID"
35,422
((tokenId_>uint(0)))
"NFTCyphertakes: TOKEN_URI_TOO_SHORT"
pragma solidity ^0.8.0; import {ERC721URIStorage, ERC721, IERC165} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; import {Pausable} from "@openzeppelin/contracts/security/Pausable.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {AccessControlMixin, AccessControl, Context} from "../../common/AccessControlMixin.sol"; import {NativeMetaTransaction} from "../../common/NativeMetaTransaction.sol"; import {ContextMixin} from "../../common/ContextMixin.sol"; contract NFTCyphertakes is ERC721URIStorage, Pausable, Ownable, AccessControlMixin, NativeMetaTransaction, ContextMixin { // Minter Role bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE"); // Initial BASE_TOKEN_URI string private BASE_TOKEN_URI; // Initial Contract URI string private CONTRACT_URI; constructor( string memory name_, string memory symbol_, address minterRole ) public ERC721(name_, symbol_) { } modifier TokenId(uint256 tokenId_) { } // This is to support Native meta transactions // never use msg.sender directly, use _msgSender() instead function _msgSender() internal override view returns (address sender) { } function _msgData() internal override (Context) pure returns (bytes calldata) { } /** * Override isApprovedForAll to auto-approve OS's proxy contract */ function isApprovedForAll( address _owner, address _operator ) public override view returns (bool isOperator) { } /** * @notice Make the SetTokenURI method visible for future upgrade of metadata * @dev Sets `_tokenURI` as the tokenURI of `tokenId`. * Requirements: * * - `tokenId` must exist. */ function setTokenURI(uint256 tokenId, string memory _tokenURI) public virtual only(DEFAULT_ADMIN_ROLE) TokenId(tokenId) { } /** * @notice Method for reduce the friction with openSea allows to map the `tokenId` * @dev into our NFT Smart contract and handle some metadata offchain in OpenSea */ function baseTokenURI() public view returns (string memory) { } /** * @notice Method for reduce the friction with openSea allows update the Base Token URI * @dev This method is only available for the owner of the contract * @param _baseTokenURI The new base token URI */ function setBaseTokenURI(string memory _baseTokenURI) public only(DEFAULT_ADMIN_ROLE) { } /** * @notice Method for reduce the friction with openSea allows to map the `tokenId` * @dev into our NFT Smart contract and handle some metadata offchain in OpenSea */ function contractURI() public view returns (string memory) { } /** * @notice Method for reduce the friction with openSea allows update the Contract URI * @dev This method is only available for the owner of the contract * @param _contractURI The new contract URI */ function setContractURI(string memory _contractURI) public only(DEFAULT_ADMIN_ROLE) { } /** * @dev Implementation / Instance of paused methods() in the ERC721. * @param status Setting the status boolean (True for paused, or False for unpaused) * See {ERC721Pausable}. */ function pause(bool status) public only(DEFAULT_ADMIN_ROLE) { } /** * @notice Method for getting OpenSea Version we Operate * @dev This method is for getting the Max Supply by token id */ function openSeaVersion() public pure returns (string memory) { } /** * Compat for factory interfaces on OpenSea * Indicates that this contract can return balances for * tokens that haven't been minted yet */ function supportsFactoryInterface() public pure returns (bool) { } /** * @notice Example function to handle minting tokens on matic chain * @dev Minting can be done as per requirement, * This implementation allows only admin to mint tokens but it can be changed as per requirement * Should verify if token is withdrawn by checking `withdrawnTokens` mapping * @param user user for whom tokens are being minted * @param tokenId tokenId to mint */ function mint(address user, uint256 tokenId, string memory _tokenURI) public TokenId(tokenId) only(MINTER_ROLE) { require(<FILL_ME>) _mint(user, tokenId); _setTokenURI(tokenId, _tokenURI); } /** * @dev Burns `tokenId`. See {ERC721-_burn}. * * Requirements: * * - The caller must own `tokenId` or be an approved operator. */ function burn(uint256 tokenId) public virtual TokenId(tokenId) { } /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, AccessControl) returns (bool) { } /** * @dev See {ERC721-_beforeTokenTransfer}. * * Requirements: * * - the contract must not be paused. */ function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal virtual override { } }
(bytes(_tokenURI).length>=5),"NFTCyphertakes: TOKEN_URI_TOO_SHORT"
35,422
(bytes(_tokenURI).length>=5)
"UniV3Liquidity.bind: already bind"
pragma solidity ^0.7.6; /// @title Position Management /// @notice Provide asset operation functions, allow authorized identities to perform asset operations, and achieve the purpose of increasing the net value of the fund contract UniV3Liquidity is GovIdentity { using Path for bytes; using SafeMath for uint256; using SafeERC20 for IERC20; using EnumerableSet for EnumerableSet.UintSet; using EnumerableSet for EnumerableSet.AddressSet; using UniV3PeripheryExtends for mapping(address => mapping(address => bytes)); //Contract binding status bool bound; //Fund purchase and redemption token IERC20 public ioToken; //Fund contract address address public fund; //Position list mapping(bytes32 => uint256) public posList; //Swap route mapping(address => mapping(address => bytes)) public swapRoute; //Working positions EnumerableSet.UintSet private atWorkPos; //Underlying asset EnumerableSet.AddressSet private underlying; //Swap event Swap(uint256 amountIn, uint256 amountOut); //Create positoin event Mint(uint256 tokenId, uint128 liquidity); //Increase liquidity event IncreaseLiquidity(uint256 tokenId, uint128 liquidity); //Decrease liquidity event DecreaseLiquidity(uint256 tokenId, uint128 liquidity); //Collect asset event Collect(uint256 tokenId, uint256 amount0, uint256 amount1); constructor() { } /// @notice Binding funds and subscription redemption token /// @dev Only bind once and cannot be modified /// @param _fund Fund address /// @param _ioToken Subscription and redemption token function bind(address _fund, address _ioToken) external onlyGovernance { require(<FILL_ME>) fund = _fund; ioToken = IERC20(_ioToken); bound = true; } //Only allow fund contract access modifier onlyFund() { } //Only allow governance, strategy, fund contract access modifier onlyAuthorize() { } /// @notice Check current position /// @dev Check the current UniV3 position by pool token ID. /// @param pool liquidity pool /// @param tickLower Tick lower bound /// @param tickUpper Tick upper bound /// @return atWork Position status /// @return has Check if the position ID exist /// @return tokenId Position ID function checkPos( address pool, int24 tickLower, int24 tickUpper ) public view returns (bool atWork, bool has, uint256 tokenId){ } /// @notice in work tokenId array /// @dev read in works NFT array /// @return tokenIds NFT array function worksPos() public view returns (uint256[] memory tokenIds){ } /// @notice Authorize UniV3 contract to move fund asset /// @dev Only allow governance and strategist identities to execute authorized functions to reduce miner fee consumption /// @param token Authorized target token function safeApproveAll(address token) public onlyStrategistOrGovernance { } /// @notice Multiple functions of the contract can be executed at the same time /// @dev Only the governance and strategist identities are allowed to execute multiple function calls, /// and the execution of multiple functions can ensure the consistency of the execution results /// @param data Encode data of multiple execution functions /// @return results Execution result function multicall(bytes[] calldata data) external onlyStrategistOrGovernance returns (bytes[] memory results) { } /// @notice Set asset swap route /// @dev Only the governance identity is allowed to set the asset swap path, and the firstToken and lastToken contained in the path will be used as the underlying asset token address by default /// @param path Swap path byte code function settingSwapRoute(bytes memory path) external onlyGovernance { } /// @notice Set the underlying asset token address /// @dev Only allow the governance identity to set the underlying asset token address /// @param ts The underlying asset token address array to be added function setUnderlyings(address[] memory ts) public onlyGovernance { } /// @notice Delete the underlying asset token address /// @dev Only allow the governance identity to delete the underlying asset token address /// @param ts The underlying asset token address array to be deleted function removeUnderlyings(address[] memory ts) public onlyGovernance { } /// @notice Estimated to obtain the target token amount /// @dev Only allow the asset transaction path that has been set to be estimated /// @param from Source token address /// @param to Target token address /// @param amountIn Source token amount /// @return amountOut Target token amount function estimateAmountOut( address from, address to, uint256 amountIn ) public view returns (uint256 amountOut){ } /// @notice Estimate the amount of source tokens that need to be provided /// @dev Only allow the governance identity to set the underlying asset token address /// @param from Source token address /// @param to Target token address /// @param amountOut Expect to get the target token amount /// @return amountIn Source token amount function estimateAmountIn( address from, address to, uint256 amountOut ) public view returns (uint256 amountIn){ } /// @notice Swaps `amountIn` of one token for as much as possible of another token /// @dev Initiate a transaction with a known input amount and return the output amount /// @param tokenIn Token in address /// @param tokenOut Token out address /// @param amountIn Token in amount /// @param amountOutMinimum Expected to get minimum token out amount /// @return amountOut Token out amount function exactInput( address tokenIn, address tokenOut, uint256 amountIn, uint256 amountOutMinimum ) public onlyAuthorize returns (uint256 amountOut) { } /// @notice Swaps as little as possible of one token for `amountOut` of another token /// @dev Initiate a transaction with a known output amount and return the input amount /// @param tokenIn Token in address /// @param tokenOut Token out address /// @param amountOut Token out amount /// @param amountInMaximum Expect to input the maximum amount of tokens /// @return amountIn Token in amount function exactOutput( address tokenIn, address tokenOut, uint256 amountOut, uint256 amountInMaximum ) public onlyAuthorize returns (uint256 amountIn) { } /// @notice Create position /// @dev Repeated creation of the same position will cause an error, you need to change tickLower Or tickUpper /// @param token0 Liquidity pool token 0 contract address /// @param token1 Liquidity pool token 1 contract address /// @param fee Target liquidity pool rate /// @param tickLower Expect to place the lower price boundary of the target liquidity pool /// @param tickUpper Expect to place the upper price boundary of the target liquidity pool /// @param amount0Desired Desired token 0 amount /// @param amount1Desired Desired token 1 amount function mint( address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint256 amount0Desired, uint256 amount1Desired ) public onlyAuthorize { } /// @notice Increase liquidity /// @dev Use checkPos to check the position ID /// @param tokenId Position ID /// @param amount0 Desired Desired token 0 amount /// @param amount1 Desired Desired token 1 amount /// @param amount0Min Minimum token 0 amount /// @param amount1Min Minimum token 1 amount /// @return liquidity The amount of liquidity /// @return amount0 Actual token 0 amount being added /// @return amount1 Actual token 1 amount being added function increaseLiquidity( uint256 tokenId, uint256 amount0Desired, uint256 amount1Desired, uint256 amount0Min, uint256 amount1Min ) public onlyAuthorize returns ( uint128 liquidity, uint256 amount0, uint256 amount1 ){ } /// @notice Decrease liquidity /// @dev Use checkPos to query the position ID /// @param tokenId Position ID /// @param liquidity Expected reduction amount of liquidity /// @param amount0Min Minimum amount of token 0 to be reduced /// @param amount1Min Minimum amount of token 1 to be reduced /// @return amount0 Actual amount of token 0 being reduced /// @return amount1 Actual amount of token 1 being reduced function decreaseLiquidity( uint256 tokenId, uint128 liquidity, uint256 amount0Min, uint256 amount1Min ) public onlyAuthorize returns (uint256 amount0, uint256 amount1){ } /// @notice Collect position asset /// @dev Use checkPos to check the position ID /// @param tokenId Position ID /// @param amount0Max Maximum amount of token 0 to be collected /// @param amount1Max Maximum amount of token 1 to be collected /// @return amount0 Actual amount of token 0 being collected /// @return amount1 Actual amount of token 1 being collected function collect( uint256 tokenId, uint128 amount0Max, uint128 amount1Max ) public onlyAuthorize returns (uint256 amount0, uint256 amount1){ } /// @notice Withdraw asset /// @dev Only fund contract can withdraw asset /// @param to Withdraw address /// @param amount Withdraw amount /// @param scale Withdraw percentage function withdraw(address to, uint256 amount, uint256 scale) external onlyFund { } /// @notice Withdraw underlying asset /// @dev Only fund contract can withdraw underlying asset /// @param to Withdraw address /// @param scale Withdraw percentage function withdrawOfUnderlying(address to, uint256 scale) external onlyFund { } /// @notice Decrease liquidity by scale /// @dev Decrease liquidity by provided scale /// @param scale Scale of the liquidity function _decreaseLiquidityByScale(uint256 scale) internal { } /// @notice Total asset /// @dev This function calculates the net worth or AUM /// @return Total asset function assets() public view returns (uint256){ } /// @notice idle asset /// @dev This function calculates idle asset /// @return idle asset function idleAssets() public view returns (uint256){ } /// @notice liquidity asset /// @dev This function calculates liquidity asset /// @return liquidity asset function liquidityAssets() public view returns (uint256){ } }
!bound,"UniV3Liquidity.bind: already bind"
35,440
!bound
'UniV3Liquidity.settingSwapRoute: path is not valid'
pragma solidity ^0.7.6; /// @title Position Management /// @notice Provide asset operation functions, allow authorized identities to perform asset operations, and achieve the purpose of increasing the net value of the fund contract UniV3Liquidity is GovIdentity { using Path for bytes; using SafeMath for uint256; using SafeERC20 for IERC20; using EnumerableSet for EnumerableSet.UintSet; using EnumerableSet for EnumerableSet.AddressSet; using UniV3PeripheryExtends for mapping(address => mapping(address => bytes)); //Contract binding status bool bound; //Fund purchase and redemption token IERC20 public ioToken; //Fund contract address address public fund; //Position list mapping(bytes32 => uint256) public posList; //Swap route mapping(address => mapping(address => bytes)) public swapRoute; //Working positions EnumerableSet.UintSet private atWorkPos; //Underlying asset EnumerableSet.AddressSet private underlying; //Swap event Swap(uint256 amountIn, uint256 amountOut); //Create positoin event Mint(uint256 tokenId, uint128 liquidity); //Increase liquidity event IncreaseLiquidity(uint256 tokenId, uint128 liquidity); //Decrease liquidity event DecreaseLiquidity(uint256 tokenId, uint128 liquidity); //Collect asset event Collect(uint256 tokenId, uint256 amount0, uint256 amount1); constructor() { } /// @notice Binding funds and subscription redemption token /// @dev Only bind once and cannot be modified /// @param _fund Fund address /// @param _ioToken Subscription and redemption token function bind(address _fund, address _ioToken) external onlyGovernance { } //Only allow fund contract access modifier onlyFund() { } //Only allow governance, strategy, fund contract access modifier onlyAuthorize() { } /// @notice Check current position /// @dev Check the current UniV3 position by pool token ID. /// @param pool liquidity pool /// @param tickLower Tick lower bound /// @param tickUpper Tick upper bound /// @return atWork Position status /// @return has Check if the position ID exist /// @return tokenId Position ID function checkPos( address pool, int24 tickLower, int24 tickUpper ) public view returns (bool atWork, bool has, uint256 tokenId){ } /// @notice in work tokenId array /// @dev read in works NFT array /// @return tokenIds NFT array function worksPos() public view returns (uint256[] memory tokenIds){ } /// @notice Authorize UniV3 contract to move fund asset /// @dev Only allow governance and strategist identities to execute authorized functions to reduce miner fee consumption /// @param token Authorized target token function safeApproveAll(address token) public onlyStrategistOrGovernance { } /// @notice Multiple functions of the contract can be executed at the same time /// @dev Only the governance and strategist identities are allowed to execute multiple function calls, /// and the execution of multiple functions can ensure the consistency of the execution results /// @param data Encode data of multiple execution functions /// @return results Execution result function multicall(bytes[] calldata data) external onlyStrategistOrGovernance returns (bytes[] memory results) { } /// @notice Set asset swap route /// @dev Only the governance identity is allowed to set the asset swap path, and the firstToken and lastToken contained in the path will be used as the underlying asset token address by default /// @param path Swap path byte code function settingSwapRoute(bytes memory path) external onlyGovernance { require(<FILL_ME>) address fromToken = path.getFirstAddress(); address toToken = path.getLastAddress(); swapRoute[fromToken][toToken] = path; if (!underlying.contains(fromToken)) underlying.add(fromToken); if (!underlying.contains(toToken)) underlying.add(toToken); } /// @notice Set the underlying asset token address /// @dev Only allow the governance identity to set the underlying asset token address /// @param ts The underlying asset token address array to be added function setUnderlyings(address[] memory ts) public onlyGovernance { } /// @notice Delete the underlying asset token address /// @dev Only allow the governance identity to delete the underlying asset token address /// @param ts The underlying asset token address array to be deleted function removeUnderlyings(address[] memory ts) public onlyGovernance { } /// @notice Estimated to obtain the target token amount /// @dev Only allow the asset transaction path that has been set to be estimated /// @param from Source token address /// @param to Target token address /// @param amountIn Source token amount /// @return amountOut Target token amount function estimateAmountOut( address from, address to, uint256 amountIn ) public view returns (uint256 amountOut){ } /// @notice Estimate the amount of source tokens that need to be provided /// @dev Only allow the governance identity to set the underlying asset token address /// @param from Source token address /// @param to Target token address /// @param amountOut Expect to get the target token amount /// @return amountIn Source token amount function estimateAmountIn( address from, address to, uint256 amountOut ) public view returns (uint256 amountIn){ } /// @notice Swaps `amountIn` of one token for as much as possible of another token /// @dev Initiate a transaction with a known input amount and return the output amount /// @param tokenIn Token in address /// @param tokenOut Token out address /// @param amountIn Token in amount /// @param amountOutMinimum Expected to get minimum token out amount /// @return amountOut Token out amount function exactInput( address tokenIn, address tokenOut, uint256 amountIn, uint256 amountOutMinimum ) public onlyAuthorize returns (uint256 amountOut) { } /// @notice Swaps as little as possible of one token for `amountOut` of another token /// @dev Initiate a transaction with a known output amount and return the input amount /// @param tokenIn Token in address /// @param tokenOut Token out address /// @param amountOut Token out amount /// @param amountInMaximum Expect to input the maximum amount of tokens /// @return amountIn Token in amount function exactOutput( address tokenIn, address tokenOut, uint256 amountOut, uint256 amountInMaximum ) public onlyAuthorize returns (uint256 amountIn) { } /// @notice Create position /// @dev Repeated creation of the same position will cause an error, you need to change tickLower Or tickUpper /// @param token0 Liquidity pool token 0 contract address /// @param token1 Liquidity pool token 1 contract address /// @param fee Target liquidity pool rate /// @param tickLower Expect to place the lower price boundary of the target liquidity pool /// @param tickUpper Expect to place the upper price boundary of the target liquidity pool /// @param amount0Desired Desired token 0 amount /// @param amount1Desired Desired token 1 amount function mint( address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint256 amount0Desired, uint256 amount1Desired ) public onlyAuthorize { } /// @notice Increase liquidity /// @dev Use checkPos to check the position ID /// @param tokenId Position ID /// @param amount0 Desired Desired token 0 amount /// @param amount1 Desired Desired token 1 amount /// @param amount0Min Minimum token 0 amount /// @param amount1Min Minimum token 1 amount /// @return liquidity The amount of liquidity /// @return amount0 Actual token 0 amount being added /// @return amount1 Actual token 1 amount being added function increaseLiquidity( uint256 tokenId, uint256 amount0Desired, uint256 amount1Desired, uint256 amount0Min, uint256 amount1Min ) public onlyAuthorize returns ( uint128 liquidity, uint256 amount0, uint256 amount1 ){ } /// @notice Decrease liquidity /// @dev Use checkPos to query the position ID /// @param tokenId Position ID /// @param liquidity Expected reduction amount of liquidity /// @param amount0Min Minimum amount of token 0 to be reduced /// @param amount1Min Minimum amount of token 1 to be reduced /// @return amount0 Actual amount of token 0 being reduced /// @return amount1 Actual amount of token 1 being reduced function decreaseLiquidity( uint256 tokenId, uint128 liquidity, uint256 amount0Min, uint256 amount1Min ) public onlyAuthorize returns (uint256 amount0, uint256 amount1){ } /// @notice Collect position asset /// @dev Use checkPos to check the position ID /// @param tokenId Position ID /// @param amount0Max Maximum amount of token 0 to be collected /// @param amount1Max Maximum amount of token 1 to be collected /// @return amount0 Actual amount of token 0 being collected /// @return amount1 Actual amount of token 1 being collected function collect( uint256 tokenId, uint128 amount0Max, uint128 amount1Max ) public onlyAuthorize returns (uint256 amount0, uint256 amount1){ } /// @notice Withdraw asset /// @dev Only fund contract can withdraw asset /// @param to Withdraw address /// @param amount Withdraw amount /// @param scale Withdraw percentage function withdraw(address to, uint256 amount, uint256 scale) external onlyFund { } /// @notice Withdraw underlying asset /// @dev Only fund contract can withdraw underlying asset /// @param to Withdraw address /// @param scale Withdraw percentage function withdrawOfUnderlying(address to, uint256 scale) external onlyFund { } /// @notice Decrease liquidity by scale /// @dev Decrease liquidity by provided scale /// @param scale Scale of the liquidity function _decreaseLiquidityByScale(uint256 scale) internal { } /// @notice Total asset /// @dev This function calculates the net worth or AUM /// @return Total asset function assets() public view returns (uint256){ } /// @notice idle asset /// @dev This function calculates idle asset /// @return idle asset function idleAssets() public view returns (uint256){ } /// @notice liquidity asset /// @dev This function calculates liquidity asset /// @return liquidity asset function liquidityAssets() public view returns (uint256){ } }
path.valid(),'UniV3Liquidity.settingSwapRoute: path is not valid'
35,440
path.valid()
null
// SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.6.0 <0.7.0; pragma experimental ABIEncoderV2; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/math/SafeMath.sol"; struct StrategyParams { uint256 performanceFee; uint256 activation; uint256 debtLimit; uint256 rateLimit; uint256 lastSync; uint256 totalDebt; uint256 totalReturns; } interface VaultAPI { function apiVersion() external view returns (string memory); function token() external view returns (address); function strategies(address _strategy) external view returns (StrategyParams memory); /* * View how much the Vault would increase this strategy's borrow limit, * based on it's present performance (since its last report). Can be used to * determine expectedReturn in your strategy. */ function creditAvailable() external view returns (uint256); /* * View how much the Vault would like to pull back from the Strategy, * based on it's present performance (since its last report). Can be used to * determine expectedReturn in your strategy. */ function debtOutstanding() external view returns (uint256); /* * View how much the Vault expect this strategy to return at the current block, * based on it's present performance (since its last report). Can be used to * determine expectedReturn in your strategy. */ function expectedReturn() external view returns (uint256); /* * This is the main contact point where the strategy interacts with the Vault. * It is critical that this call is handled as intended by the Strategy. * Therefore, this function will be called by BaseStrategy to make sure the * integration is correct. */ function report(uint256 _harvest) external returns (uint256); /* * This function is used in the scenario where there is a newer strategy that * would hold the same positions as this one, and those positions are easily * transferrable to the newer strategy. These positions must be able to be * transferred at the moment this call is made, if any prep is required to * execute a full transfer in one transaction, that must be accounted for * separately from this call. */ function migrateStrategy(address _newStrategy) external; /* * This function should only be used in the scenario where the strategy is * being retired but no migration of the positions are possible, or in the * extreme scenario that the Strategy needs to be put into "Emergency Exit" * mode in order for it to exit as quickly as possible. The latter scenario * could be for any reason that is considered "critical" that the Strategy * exits it's position as fast as possible, such as a sudden change in market * conditions leading to losses, or an imminent failure in an external * dependency. */ function revokeStrategy() external; /* * View the governance address of the Vault to assert privileged functions * can only be called by governance. The Strategy serves the Vault, so it * is subject to governance defined by the Vault. * */ function governance() external view returns (address); } /* * This interface is here for the keeper bot to use */ interface StrategyAPI { function apiVersion() external pure returns (string memory); function name() external pure returns (string memory); function vault() external view returns (address); function keeper() external view returns (address); function tendTrigger(uint256 gasCost) external view returns (bool); function tend() external; function harvestTrigger(uint256 gasCost) external view returns (bool); function harvest() external; event Harvested(uint256 wantEarned, uint256 lifetimeEarned); } /* * BaseStrategy implements all of the required functionality to interoperate closely * with the core protocol. This contract should be inherited and the abstract methods * implemented to adapt the strategy to the particular needs it has to create a return. */ abstract contract BaseStrategy { using SafeMath for uint256; // Version of this contract's StrategyAPI (must match Vault) function apiVersion() public pure returns (string memory) { } // Name of this contract's Strategy (Must override!) // NOTE: You can use this field to manage the "version" of this strategy // e.g. `StrategySomethingOrOtherV1`. It's up to you! function name() external virtual pure returns (string memory); VaultAPI public vault; address public strategist; address public keeper; IERC20 public want; // So indexers can keep track of this event Harvested(uint256 wantEarned, uint256 lifetimeEarned); // Adjust this to keep some of the position in reserve in the strategy, // to accomodate larger variations needed to sustain the strategy's core positon(s) uint256 public reserve = 0; // This gets adjusted every time the Strategy reports to the Vault, // and should be used during adjustment of the strategy's positions to "deleverage" // in order to pay back the amount the next time it reports. // // NOTE: Do not edit this variable, for safe usage (only read from it) // NOTE: Strategy should not expect to increase it's working capital until this value // is zero. uint256 public outstanding = 0; bool public emergencyExit; constructor(address _vault) public { } function setStrategist(address _strategist) external { } function setKeeper(address _keeper) external { } /* * Resolve governance address from Vault contract, used to make * assertions on protected functions in the Strategy */ function governance() internal view returns (address) { } /* * Provide an accurate expected value for the return this strategy * would provide to the Vault the next time `report()` is called * (since the last time it was called) */ function expectedReturn() public virtual view returns (uint256); /* * Provide an accurate estimate for the total amount of assets (principle + return) * that this strategy is currently managing, denominated in terms of `want` tokens. * This total should be "realizable" e.g. the total value that could *actually* be * obtained from this strategy if it were to divest it's entire position based on * current on-chain conditions. * * NOTE: care must be taken in using this function, since it relies on external * systems, which could be manipulated by the attacker to give an inflated * (or reduced) value produced by this function, based on current on-chain * conditions (e.g. this function is possible to influence through flashloan * attacks, oracle manipulations, or other DeFi attack mechanisms). * * NOTE: It is up to governance to use this function in order to correctly order * this strategy relative to its peers in order to minimize losses for the * Vault based on sudden withdrawals. This value should be higher than the * total debt of the strategy and higher than it's expected value to be "safe". */ function estimatedTotalAssets() public virtual view returns (uint256); /* * Perform any strategy unwinding or other calls necessary to capture * the "free return" this strategy has generated since the last time it's * core position(s) were adusted. Examples include unwrapping extra rewards. * This call is only used during "normal operation" of a Strategy, and should * be optimized to minimize losses as much as possible. It is okay to report * "no returns", however this will affect the credit limit extended to the * strategy and reduce it's overall position if lower than expected returns * are sustained for long periods of time. */ function prepareReturn() internal virtual; /* * Perform any adjustments to the core position(s) of this strategy given * what change the Vault made in the "investable capital" available to the * strategy. Note that all "free capital" in the strategy after the report * was made is available for reinvestment. Also note that this number could * be 0, and you should handle that scenario accordingly. */ function adjustPosition() internal virtual; /* * Make as much capital as possible "free" for the Vault to take. Some slippage * is allowed, since when this method is called the strategist is no longer receiving * their performance fee. The goal is for the strategy to divest as quickly as possible * while not suffering exorbitant losses. This function is used during emergency exit * instead of `prepareReturn()` */ function exitPosition() internal virtual; /* * Provide a signal to the keeper that `tend()` should be called. The keeper will provide * the estimated gas cost that they would pay to call `tend()`, and this function should * use that estimate to make a determination if calling it is "worth it" for the keeper. * This is not the only consideration into issuing this trigger, for example if the position * would be negatively affected if `tend()` is not called shortly, then this can return `true` * even if the keeper might be "at a loss" (keepers are always reimbursed by yEarn) * * NOTE: this call and `harvestTrigger` should never return `true` at the same time. * NOTE: if `tend()` is never intended to be called, it should always return `false` */ function tendTrigger(uint256 gasCost) public virtual view returns (bool); function tend() external { } /* * Provide a signal to the keeper that `harvest()` should be called. The keeper will provide * the estimated gas cost that they would pay to call `harvest()`, and this function should * use that estimate to make a determination if calling it is "worth it" for the keeper. * This is not the only consideration into issuing this trigger, for example if the position * would be negatively affected if `harvest()` is not called shortly, then this can return `true` * even if the keeper might be "at a loss" (keepers are always reimbursed by yEarn) * * NOTE: this call and `tendTrigger` should never return `true` at the same time. */ function harvestTrigger(uint256 gasCost) public virtual view returns (bool); function harvest() external { } /* * Liquidate as many assets as possible to `want`, irregardless of slippage, * up to `_amount`. Any excess should be re-invested here as well. */ function liquidatePosition(uint256 _amount) internal virtual; function withdraw(uint256 _amount) external { } /* * Do anything necesseary to prepare this strategy for migration, such * as transfering any reserve or LP tokens, CDPs, or other tokens or stores of value. */ function prepareMigration(address _newStrategy) internal virtual; function migrate(address _newStrategy) external { require(msg.sender == address(vault) || msg.sender == governance()); require(<FILL_ME>) prepareMigration(_newStrategy); } function setEmergencyExit() external { } // Override this to add all tokens this contract manages on a *persistant* basis // (e.g. not just for swapping back to want ephemerally) // NOTE: Must inclide `want` token function protectedTokens() internal virtual view returns (address[] memory) { } function sweep(address _token) external { } }
BaseStrategy(_newStrategy).vault()==vault
35,484
BaseStrategy(_newStrategy).vault()==vault
null
// Congratulations! Its your free airdrop token. More about project at: https://MARK.SPACE // // // An open source platform for creation of 3D- and VR- compatible web-spaces (websites) and objects, powered by Blockchain. // 3DとVR対応のウェブ空間(ウェブサイト)とオブジェクトの作成が可能な ブロックチェーンベースのオープンソースプラットフォーム // 由区块链支持的创造3D/VR兼容网页空间的开源平台 // Una plataforma de código abierto para la creación de espacios web (sitios web) y objetos compatibles con 3D y VR, con tecnología de Blockchain. // 3D와 VR 호환이 가능한 웹 스페이스(웹 사이트)와 사물을 창조해내는 블록체인 기반의 오픈소스 플랫폼 // Платформа с открытым исходным кодом для создания 3D / VR - совместимых онлайн-пространств (сайтов) и объектов, на базе технологии Блокчейн. // Una plataforma de código abierto para la creación de espacios web (sitios web) y objetos compatibles con 3D y VR, con tecnología de Blockchain. // // ▄▄▄▄▄▄▄▄▄ // ▄▀ ▀▄ // █ ▄ ▄ █ ▐█▄ ▄█▌ ▄██▄ ▐█▀▀▀▀█▄ █ ▄█▀ ▄█▀▀▀▀█ ▐█▀▀▀▀█▄ ▄██▄ ██▀▀▀▀█ ▐█▀▀▀▀▀ // ▐▌ ▀▄▀ ▀▄▀ ▐▌ ▐█▀█ ▄█▀█▌ ▄█ █▄ ▐█ ██ ██▄██ ▀█▄▄▄ ▐█ ██ ▄█ █▄ █▌ ▐█▄▄▄▄ // ▐▌ ▐▀▄ ▄▀▌ ▐▌ ▐█ █▄█ █▌ ▄█▄▄▄▄█▄ ▐█▀▀██▀ ██▀ ▐█ ██ ▐█▀▀▀▀▀ ▄█▄▄▄▄█▄ ██ ▐█ // ▀▄ ▀ ▀ ▀ ▄▀ ▐█ ▀ █▌ ▄█ █▄ ▐█ ▐█▄ █ █▄ ▐█ ▀█▄▄▄█▀ ▐█ ▄█ █▄ ▀█▄▄▄▄█ ▐█▄▄▄▄▄ // ▀▄▄▄▄▄▄▄▄▄▀ pragma solidity 0.4.18; contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); modifier onlyOwner() { } function Ownable() public { } function transferOwnership(address newOwner) public onlyOwner { } } contract Withdrawable is Ownable { function withdrawEther(address _to, uint _value) onlyOwner public returns(bool) { } function withdrawTokens(ERC20 _token, address _to, uint _value) onlyOwner public returns(bool) { } } contract ERC20 { uint256 public totalSupply; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); 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); function allowance(address owner, address spender) public view returns(uint256); function approve(address spender, uint256 value) public returns(bool); } contract AirDrop is Withdrawable { event TransferEther(address indexed to, uint256 value); function tokenBalanceOf(ERC20 _token) public view returns(uint256) { } function tokenAllowance(ERC20 _token, address spender) public view returns(uint256) { } function tokenTransfer(ERC20 _token, uint _value, address[] _to) onlyOwner public { require(_token != address(0)); for(uint i = 0; i < _to.length; i++) { require(<FILL_ME>) } } function tokenTransferFrom(ERC20 _token, address spender, uint _value, address[] _to) onlyOwner public { } function etherTransfer(uint _value, address[] _to) onlyOwner payable public { } }
_token.transfer(_to[i],_value)
35,517
_token.transfer(_to[i],_value)
null
// Congratulations! Its your free airdrop token. More about project at: https://MARK.SPACE // // // An open source platform for creation of 3D- and VR- compatible web-spaces (websites) and objects, powered by Blockchain. // 3DとVR対応のウェブ空間(ウェブサイト)とオブジェクトの作成が可能な ブロックチェーンベースのオープンソースプラットフォーム // 由区块链支持的创造3D/VR兼容网页空间的开源平台 // Una plataforma de código abierto para la creación de espacios web (sitios web) y objetos compatibles con 3D y VR, con tecnología de Blockchain. // 3D와 VR 호환이 가능한 웹 스페이스(웹 사이트)와 사물을 창조해내는 블록체인 기반의 오픈소스 플랫폼 // Платформа с открытым исходным кодом для создания 3D / VR - совместимых онлайн-пространств (сайтов) и объектов, на базе технологии Блокчейн. // Una plataforma de código abierto para la creación de espacios web (sitios web) y objetos compatibles con 3D y VR, con tecnología de Blockchain. // // ▄▄▄▄▄▄▄▄▄ // ▄▀ ▀▄ // █ ▄ ▄ █ ▐█▄ ▄█▌ ▄██▄ ▐█▀▀▀▀█▄ █ ▄█▀ ▄█▀▀▀▀█ ▐█▀▀▀▀█▄ ▄██▄ ██▀▀▀▀█ ▐█▀▀▀▀▀ // ▐▌ ▀▄▀ ▀▄▀ ▐▌ ▐█▀█ ▄█▀█▌ ▄█ █▄ ▐█ ██ ██▄██ ▀█▄▄▄ ▐█ ██ ▄█ █▄ █▌ ▐█▄▄▄▄ // ▐▌ ▐▀▄ ▄▀▌ ▐▌ ▐█ █▄█ █▌ ▄█▄▄▄▄█▄ ▐█▀▀██▀ ██▀ ▐█ ██ ▐█▀▀▀▀▀ ▄█▄▄▄▄█▄ ██ ▐█ // ▀▄ ▀ ▀ ▀ ▄▀ ▐█ ▀ █▌ ▄█ █▄ ▐█ ▐█▄ █ █▄ ▐█ ▀█▄▄▄█▀ ▐█ ▄█ █▄ ▀█▄▄▄▄█ ▐█▄▄▄▄▄ // ▀▄▄▄▄▄▄▄▄▄▀ pragma solidity 0.4.18; contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); modifier onlyOwner() { } function Ownable() public { } function transferOwnership(address newOwner) public onlyOwner { } } contract Withdrawable is Ownable { function withdrawEther(address _to, uint _value) onlyOwner public returns(bool) { } function withdrawTokens(ERC20 _token, address _to, uint _value) onlyOwner public returns(bool) { } } contract ERC20 { uint256 public totalSupply; event Transfer(address indexed from, address indexed to, uint256 value); event Approval(address indexed owner, address indexed spender, uint256 value); 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); function allowance(address owner, address spender) public view returns(uint256); function approve(address spender, uint256 value) public returns(bool); } contract AirDrop is Withdrawable { event TransferEther(address indexed to, uint256 value); function tokenBalanceOf(ERC20 _token) public view returns(uint256) { } function tokenAllowance(ERC20 _token, address spender) public view returns(uint256) { } function tokenTransfer(ERC20 _token, uint _value, address[] _to) onlyOwner public { } function tokenTransferFrom(ERC20 _token, address spender, uint _value, address[] _to) onlyOwner public { require(_token != address(0)); for(uint i = 0; i < _to.length; i++) { require(<FILL_ME>) } } function etherTransfer(uint _value, address[] _to) onlyOwner payable public { } }
_token.transferFrom(spender,_to[i],_value)
35,517
_token.transferFrom(spender,_to[i],_value)
"Bubblemates :: Beyond Max Supply"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC721A.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract Bubblemates is ERC721A, Ownable{ using Strings for uint256; string private baseTokenUri; string public placeholderTokenUri; uint256 public constant MAX_SUPPLY = 10000; uint256 public constant PUBLIC_SALE_PRICE = .08 ether; bool public isRevealed; bool public pause; mapping(address => uint256) public totalPublicMint; constructor( string memory _initBaseURI, string memory _initNotRevealedUri ) ERC721A("Bubblemates", "BM"){ } modifier callerIsUser() { } function mint(uint256 _quantity) external payable callerIsUser{ require(<FILL_ME>) require(msg.value >= (PUBLIC_SALE_PRICE * _quantity), "Bubblemates :: Below "); totalPublicMint[msg.sender] += _quantity; _safeMint(msg.sender, _quantity); } function _baseURI() internal view virtual override returns (string memory) { } //return uri for certain token function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } /// @dev walletOf() function shouldn't be called on-chain due to gas consumption function walletOf() external view returns(uint256[] memory){ } function setTokenUri(string memory _baseTokenUri) public onlyOwner{ } function setPlaceHolderUri(string memory _placeholderTokenUri) public onlyOwner{ } function togglePause() public onlyOwner{ } function toggleReveal() external onlyOwner{ } function withdraw() external onlyOwner{ } }
(totalSupply()+_quantity)<=MAX_SUPPLY,"Bubblemates :: Beyond Max Supply"
35,577
(totalSupply()+_quantity)<=MAX_SUPPLY
"Bubblemates :: Below "
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./ERC721A.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; contract Bubblemates is ERC721A, Ownable{ using Strings for uint256; string private baseTokenUri; string public placeholderTokenUri; uint256 public constant MAX_SUPPLY = 10000; uint256 public constant PUBLIC_SALE_PRICE = .08 ether; bool public isRevealed; bool public pause; mapping(address => uint256) public totalPublicMint; constructor( string memory _initBaseURI, string memory _initNotRevealedUri ) ERC721A("Bubblemates", "BM"){ } modifier callerIsUser() { } function mint(uint256 _quantity) external payable callerIsUser{ require((totalSupply() + _quantity) <= MAX_SUPPLY, "Bubblemates :: Beyond Max Supply"); require(<FILL_ME>) totalPublicMint[msg.sender] += _quantity; _safeMint(msg.sender, _quantity); } function _baseURI() internal view virtual override returns (string memory) { } //return uri for certain token function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } /// @dev walletOf() function shouldn't be called on-chain due to gas consumption function walletOf() external view returns(uint256[] memory){ } function setTokenUri(string memory _baseTokenUri) public onlyOwner{ } function setPlaceHolderUri(string memory _placeholderTokenUri) public onlyOwner{ } function togglePause() public onlyOwner{ } function toggleReveal() external onlyOwner{ } function withdraw() external onlyOwner{ } }
msg.value>=(PUBLIC_SALE_PRICE*_quantity),"Bubblemates :: Below "
35,577
msg.value>=(PUBLIC_SALE_PRICE*_quantity)
"FreezableTokenURI: all token static URI already freezed"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; abstract contract FreezableTokenURI is ERC721Upgradeable { mapping(uint256 => string) private _tokenStaticURIs; mapping(uint256 => bool) private _isTokenStaticURIFreezed; bool private _isAllTokenStaticURIFreezed; bool private _isTokenURIBaseFreezed; string private _tokenURIBase; event AllTokenStaticURIFreezed(); event TokenStaticURIFreezed(uint256 tokenId); event TokenStaticURIDefrosted(uint256 tokenId); event TokenStaticURISet(uint256 indexed tokenId, string tokenStaticURI); event TokenURIBaseFreezed(); event TokenURIBaseSet(string tokenURIBase); modifier whenNotAllTokenStaticURIFreezed() { require(<FILL_ME>) _; } modifier whenNotTokenStaticURIFreezed(uint256 tokenId) { } modifier whenNotTokenURIBaseFreezed() { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function _freezeAllTokenStaticURI() internal whenNotAllTokenStaticURIFreezed { } function _freezeTokenStaticURI(uint256 tokenId) internal whenNotAllTokenStaticURIFreezed whenNotTokenStaticURIFreezed(tokenId) { } function _setTokenStaticURI( uint256 tokenId, string memory _tokenStaticURI, bool freezing ) internal whenNotAllTokenStaticURIFreezed whenNotTokenStaticURIFreezed(tokenId) { } function _freezeTokenURIBase() internal whenNotTokenURIBaseFreezed { } function _setTokenURIBase(string memory tokenURIBase, bool freezing) internal whenNotTokenURIBaseFreezed { } function _burn(uint256 tokenId) internal virtual override { } function _baseURI() internal view virtual override returns (string memory) { } // solhint-disable-next-line ordering uint256[50] private __gap; }
!_isAllTokenStaticURIFreezed,"FreezableTokenURI: all token static URI already freezed"
35,614
!_isAllTokenStaticURIFreezed
"FreezableTokenURI: token static URI already freezed"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; abstract contract FreezableTokenURI is ERC721Upgradeable { mapping(uint256 => string) private _tokenStaticURIs; mapping(uint256 => bool) private _isTokenStaticURIFreezed; bool private _isAllTokenStaticURIFreezed; bool private _isTokenURIBaseFreezed; string private _tokenURIBase; event AllTokenStaticURIFreezed(); event TokenStaticURIFreezed(uint256 tokenId); event TokenStaticURIDefrosted(uint256 tokenId); event TokenStaticURISet(uint256 indexed tokenId, string tokenStaticURI); event TokenURIBaseFreezed(); event TokenURIBaseSet(string tokenURIBase); modifier whenNotAllTokenStaticURIFreezed() { } modifier whenNotTokenStaticURIFreezed(uint256 tokenId) { require(<FILL_ME>) _; } modifier whenNotTokenURIBaseFreezed() { } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function _freezeAllTokenStaticURI() internal whenNotAllTokenStaticURIFreezed { } function _freezeTokenStaticURI(uint256 tokenId) internal whenNotAllTokenStaticURIFreezed whenNotTokenStaticURIFreezed(tokenId) { } function _setTokenStaticURI( uint256 tokenId, string memory _tokenStaticURI, bool freezing ) internal whenNotAllTokenStaticURIFreezed whenNotTokenStaticURIFreezed(tokenId) { } function _freezeTokenURIBase() internal whenNotTokenURIBaseFreezed { } function _setTokenURIBase(string memory tokenURIBase, bool freezing) internal whenNotTokenURIBaseFreezed { } function _burn(uint256 tokenId) internal virtual override { } function _baseURI() internal view virtual override returns (string memory) { } // solhint-disable-next-line ordering uint256[50] private __gap; }
!_isTokenStaticURIFreezed[tokenId],"FreezableTokenURI: token static URI already freezed"
35,614
!_isTokenStaticURIFreezed[tokenId]
"FreezableTokenURI: token URI base already freezed"
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts-upgradeable/token/ERC721/ERC721Upgradeable.sol"; abstract contract FreezableTokenURI is ERC721Upgradeable { mapping(uint256 => string) private _tokenStaticURIs; mapping(uint256 => bool) private _isTokenStaticURIFreezed; bool private _isAllTokenStaticURIFreezed; bool private _isTokenURIBaseFreezed; string private _tokenURIBase; event AllTokenStaticURIFreezed(); event TokenStaticURIFreezed(uint256 tokenId); event TokenStaticURIDefrosted(uint256 tokenId); event TokenStaticURISet(uint256 indexed tokenId, string tokenStaticURI); event TokenURIBaseFreezed(); event TokenURIBaseSet(string tokenURIBase); modifier whenNotAllTokenStaticURIFreezed() { } modifier whenNotTokenStaticURIFreezed(uint256 tokenId) { } modifier whenNotTokenURIBaseFreezed() { require(<FILL_ME>) _; } function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { } function _freezeAllTokenStaticURI() internal whenNotAllTokenStaticURIFreezed { } function _freezeTokenStaticURI(uint256 tokenId) internal whenNotAllTokenStaticURIFreezed whenNotTokenStaticURIFreezed(tokenId) { } function _setTokenStaticURI( uint256 tokenId, string memory _tokenStaticURI, bool freezing ) internal whenNotAllTokenStaticURIFreezed whenNotTokenStaticURIFreezed(tokenId) { } function _freezeTokenURIBase() internal whenNotTokenURIBaseFreezed { } function _setTokenURIBase(string memory tokenURIBase, bool freezing) internal whenNotTokenURIBaseFreezed { } function _burn(uint256 tokenId) internal virtual override { } function _baseURI() internal view virtual override returns (string memory) { } // solhint-disable-next-line ordering uint256[50] private __gap; }
!_isTokenURIBaseFreezed,"FreezableTokenURI: token URI base already freezed"
35,614
!_isTokenURIBaseFreezed
"Bit Chicks already claimed"
pragma solidity ^0.8.9; contract BitChicks is ERC721, ERC721Enumerable, Ownable { uint256 public constant MAX_PER_TXN = 20; // @notice Add Chunky Chickens URI here string private URI = ""; // Chunky Chickens contract IERC721Enumerable IBaseContract = IERC721Enumerable(0x06c6DB12875E254a0e0C7259C7d4993E017EDC80); mapping (uint256 => bool) public claimedChicks; constructor() ERC721("Bit Chicks", "#PixelChicks") {} function _baseURI() internal view override returns (string memory) { } function setURI(string memory _URI) external onlyOwner { } function freeMint(uint256 tokenId) public { require(<FILL_ME>) require(IBaseContract.ownerOf(tokenId) == msg.sender, "Chunky Chicken not owned"); _safeMint(msg.sender, tokenId); claimedChicks[tokenId] = true; } function freeMintMultiple(uint256 amount, uint256[] calldata tokenIds) external { } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal override(ERC721, ERC721Enumerable) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { } }
!claimedChicks[tokenId],"Bit Chicks already claimed"
35,677
!claimedChicks[tokenId]
"Chunky Chicken not owned"
pragma solidity ^0.8.9; contract BitChicks is ERC721, ERC721Enumerable, Ownable { uint256 public constant MAX_PER_TXN = 20; // @notice Add Chunky Chickens URI here string private URI = ""; // Chunky Chickens contract IERC721Enumerable IBaseContract = IERC721Enumerable(0x06c6DB12875E254a0e0C7259C7d4993E017EDC80); mapping (uint256 => bool) public claimedChicks; constructor() ERC721("Bit Chicks", "#PixelChicks") {} function _baseURI() internal view override returns (string memory) { } function setURI(string memory _URI) external onlyOwner { } function freeMint(uint256 tokenId) public { require(!claimedChicks[tokenId], "Bit Chicks already claimed"); require(<FILL_ME>) _safeMint(msg.sender, tokenId); claimedChicks[tokenId] = true; } function freeMintMultiple(uint256 amount, uint256[] calldata tokenIds) external { } function _beforeTokenTransfer( address from, address to, uint256 tokenId ) internal override(ERC721, ERC721Enumerable) { } function supportsInterface(bytes4 interfaceId) public view override(ERC721, ERC721Enumerable) returns (bool) { } }
IBaseContract.ownerOf(tokenId)==msg.sender,"Chunky Chicken not owned"
35,677
IBaseContract.ownerOf(tokenId)==msg.sender
string(abi.encodePacked("name ",daoName," already taken"))
pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; // SPDX-License-Identifier: MIT import "./DaoConstants.sol"; import "./DaoRegistry.sol"; import "./CloneFactory.sol"; /** MIT License Copyright (c) 2020 Openlaw Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ contract DaoFactory is CloneFactory, DaoConstants { struct Adapter { bytes32 id; address addr; uint128 flags; } // daoAddr => hashedName mapping(address => bytes32) public daos; // hashedName => daoAddr mapping(bytes32 => address) public addresses; address public identityAddress; /** * @notice Event emitted when a new DAO has been created. * @param _address The DAO address. * @param _name The DAO name. */ event DAOCreated(address _address, string _name); constructor(address _identityAddress) { } /** * @notice Creates and initializes a new DaoRegistry with the DAO creator and the transaction sender. * @notice Enters the new DaoRegistry in the DaoFactory state. * @dev The daoName must not already have been taken. * @param daoName The name of the DAO which, after being hashed, is used to access the address. * @param creator The DAO's creator, who will be an initial member. */ function createDao(string calldata daoName, address creator) external { bytes32 hashedName = keccak256(abi.encode(daoName)); require(<FILL_ME>) DaoRegistry dao = DaoRegistry(_createClone(identityAddress)); address daoAddr = address(dao); dao.initialize(creator, msg.sender); addresses[hashedName] = daoAddr; daos[daoAddr] = hashedName; emit DAOCreated(daoAddr, daoName); } /** * @notice Returns the DAO address based on its name. * @return The address of a DAO, given its name. * @param daoName Name of the DAO to be searched. */ function getDaoAddress(string calldata daoName) public view returns (address) { } /** * @notice Adds adapters and sets their ACL for DaoRegistry functions. * @dev A new DAO is instantiated with only the Core Modules enabled, to reduce the call cost. This call must be made to add adapters. * @dev The message sender must be an active member of the DAO. * @dev The DAO must be in `CREATION` state. * @param dao DaoRegistry to have adapters added to. * @param adapters Adapter structs to be added to the DAO. */ function addAdapters(DaoRegistry dao, Adapter[] calldata adapters) external { } /** * @notice Configures extension to set the ACL for each adapter that needs to access the extension. * @dev The message sender must be an active member of the DAO. * @dev The DAO must be in `CREATION` state. * @param dao DaoRegistry for which the extension is being configured. * @param extension The address of the extension to be configured. * @param adapters Adapter structs for which the ACL is being set for the extension. */ function configureExtension( DaoRegistry dao, address extension, Adapter[] calldata adapters ) external { } /** * @notice Removes an adapter with a given ID from a DAO, and adds a new one of the same ID. * @dev The message sender must be an active member of the DAO. * @dev The DAO must be in `CREATION` state. * @param dao DAO to be updated. * @param adapter Adapter that will be replacing the currently-existing adapter of the same ID. */ function updateAdapter(DaoRegistry dao, Adapter calldata adapter) external { } }
addresses[hashedName]==address(0x0),string(abi.encodePacked("name ",daoName," already taken"))
35,730
addresses[hashedName]==address(0x0)
"not member"
pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; // SPDX-License-Identifier: MIT import "./DaoConstants.sol"; import "./DaoRegistry.sol"; import "./CloneFactory.sol"; /** MIT License Copyright (c) 2020 Openlaw Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ contract DaoFactory is CloneFactory, DaoConstants { struct Adapter { bytes32 id; address addr; uint128 flags; } // daoAddr => hashedName mapping(address => bytes32) public daos; // hashedName => daoAddr mapping(bytes32 => address) public addresses; address public identityAddress; /** * @notice Event emitted when a new DAO has been created. * @param _address The DAO address. * @param _name The DAO name. */ event DAOCreated(address _address, string _name); constructor(address _identityAddress) { } /** * @notice Creates and initializes a new DaoRegistry with the DAO creator and the transaction sender. * @notice Enters the new DaoRegistry in the DaoFactory state. * @dev The daoName must not already have been taken. * @param daoName The name of the DAO which, after being hashed, is used to access the address. * @param creator The DAO's creator, who will be an initial member. */ function createDao(string calldata daoName, address creator) external { } /** * @notice Returns the DAO address based on its name. * @return The address of a DAO, given its name. * @param daoName Name of the DAO to be searched. */ function getDaoAddress(string calldata daoName) public view returns (address) { } /** * @notice Adds adapters and sets their ACL for DaoRegistry functions. * @dev A new DAO is instantiated with only the Core Modules enabled, to reduce the call cost. This call must be made to add adapters. * @dev The message sender must be an active member of the DAO. * @dev The DAO must be in `CREATION` state. * @param dao DaoRegistry to have adapters added to. * @param adapters Adapter structs to be added to the DAO. */ function addAdapters(DaoRegistry dao, Adapter[] calldata adapters) external { require(<FILL_ME>) //Registring Adapters require( dao.state() == DaoRegistry.DaoState.CREATION, "this DAO has already been setup" ); for (uint256 i = 0; i < adapters.length; i++) { dao.replaceAdapter( adapters[i].id, adapters[i].addr, adapters[i].flags, new bytes32[](0), new uint256[](0) ); } } /** * @notice Configures extension to set the ACL for each adapter that needs to access the extension. * @dev The message sender must be an active member of the DAO. * @dev The DAO must be in `CREATION` state. * @param dao DaoRegistry for which the extension is being configured. * @param extension The address of the extension to be configured. * @param adapters Adapter structs for which the ACL is being set for the extension. */ function configureExtension( DaoRegistry dao, address extension, Adapter[] calldata adapters ) external { } /** * @notice Removes an adapter with a given ID from a DAO, and adds a new one of the same ID. * @dev The message sender must be an active member of the DAO. * @dev The DAO must be in `CREATION` state. * @param dao DAO to be updated. * @param adapter Adapter that will be replacing the currently-existing adapter of the same ID. */ function updateAdapter(DaoRegistry dao, Adapter calldata adapter) external { } }
dao.isMember(msg.sender),"not member"
35,730
dao.isMember(msg.sender)
"this DAO has already been setup"
pragma solidity ^0.8.0; pragma experimental ABIEncoderV2; // SPDX-License-Identifier: MIT import "./DaoConstants.sol"; import "./DaoRegistry.sol"; import "./CloneFactory.sol"; /** MIT License Copyright (c) 2020 Openlaw Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ contract DaoFactory is CloneFactory, DaoConstants { struct Adapter { bytes32 id; address addr; uint128 flags; } // daoAddr => hashedName mapping(address => bytes32) public daos; // hashedName => daoAddr mapping(bytes32 => address) public addresses; address public identityAddress; /** * @notice Event emitted when a new DAO has been created. * @param _address The DAO address. * @param _name The DAO name. */ event DAOCreated(address _address, string _name); constructor(address _identityAddress) { } /** * @notice Creates and initializes a new DaoRegistry with the DAO creator and the transaction sender. * @notice Enters the new DaoRegistry in the DaoFactory state. * @dev The daoName must not already have been taken. * @param daoName The name of the DAO which, after being hashed, is used to access the address. * @param creator The DAO's creator, who will be an initial member. */ function createDao(string calldata daoName, address creator) external { } /** * @notice Returns the DAO address based on its name. * @return The address of a DAO, given its name. * @param daoName Name of the DAO to be searched. */ function getDaoAddress(string calldata daoName) public view returns (address) { } /** * @notice Adds adapters and sets their ACL for DaoRegistry functions. * @dev A new DAO is instantiated with only the Core Modules enabled, to reduce the call cost. This call must be made to add adapters. * @dev The message sender must be an active member of the DAO. * @dev The DAO must be in `CREATION` state. * @param dao DaoRegistry to have adapters added to. * @param adapters Adapter structs to be added to the DAO. */ function addAdapters(DaoRegistry dao, Adapter[] calldata adapters) external { require(dao.isMember(msg.sender), "not member"); //Registring Adapters require(<FILL_ME>) for (uint256 i = 0; i < adapters.length; i++) { dao.replaceAdapter( adapters[i].id, adapters[i].addr, adapters[i].flags, new bytes32[](0), new uint256[](0) ); } } /** * @notice Configures extension to set the ACL for each adapter that needs to access the extension. * @dev The message sender must be an active member of the DAO. * @dev The DAO must be in `CREATION` state. * @param dao DaoRegistry for which the extension is being configured. * @param extension The address of the extension to be configured. * @param adapters Adapter structs for which the ACL is being set for the extension. */ function configureExtension( DaoRegistry dao, address extension, Adapter[] calldata adapters ) external { } /** * @notice Removes an adapter with a given ID from a DAO, and adds a new one of the same ID. * @dev The message sender must be an active member of the DAO. * @dev The DAO must be in `CREATION` state. * @param dao DAO to be updated. * @param adapter Adapter that will be replacing the currently-existing adapter of the same ID. */ function updateAdapter(DaoRegistry dao, Adapter calldata adapter) external { } }
dao.state()==DaoRegistry.DaoState.CREATION,"this DAO has already been setup"
35,730
dao.state()==DaoRegistry.DaoState.CREATION
"Your address has been marked as a bot, please contact staff to appeal your case."
/** 🐳TG https://t.me/supershark 🖥Website https://supershark.games 🐤Twitter https://twitter.com/supersharkgames */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { } } 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 sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { } function owner() public view virtual returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner() { } function transferOwnership(address newOwner) public virtual onlyOwner() { } function _transferOwnership(address newOwner) internal virtual { } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); } contract SUPERSHARK is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint256 private constant _MAX = ~uint256(0); uint256 private constant _tTotal = 1e11 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Super Shark"; string private constant _symbol = "SSK"; uint private constant _decimals = 9; uint256 private _teamFee = 13; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; // Uniswap Pair IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { } modifier handleFees(bool takeFee) { } constructor () { } function name() public pure returns (string memory) { } function symbol() public pure returns (string memory) { } function decimals() public pure returns (uint) { } function totalSupply() public pure override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { } function _removeAllFees() private { } function _restoreAllFees() private { } function _approve(address owner, address spender, uint256 amount) private { } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(<FILL_ME>) bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !_noTaxMode && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen, 'Trading has not yet been opened.'); takeFee = true; if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(amount.add(walletBalance) <= _tTotal.mul(5).div(100)); } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(5).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(5).div(100); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { } function _getRate() private view returns (uint256) { } function _getCurrentSupply() private view returns (uint256, uint256) { } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { } function _takeTeam(uint256 tTeam) private { } function initContract(address payable feeAddress) external onlyOwner() { } function openTrading() external onlyOwner() { } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { } function excludeFromFee(address payable ad) external onlyOwner() { } function includeToFee(address payable ad) external onlyOwner() { } function setNoTaxMode(bool onoff) external onlyOwner() { } function setTeamFee(uint256 fee) external onlyOwner() { } function setBots(address[] memory bots_) public onlyOwner() { } function delBots(address[] memory bots_) public onlyOwner() { } function isBot(address ad) public view returns (bool) { } function isExcludedFromFee(address ad) public view returns (bool) { } function swapFeesManual() external onlyOwner() { } function withdrawFees() external { } receive() external payable {} }
!_isBot[from],"Your address has been marked as a bot, please contact staff to appeal your case."
35,808
!_isBot[from]
null
/** 🐳TG https://t.me/supershark 🖥Website https://supershark.games 🐤Twitter https://twitter.com/supersharkgames */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { } } 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 sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { } function owner() public view virtual returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner() { } function transferOwnership(address newOwner) public virtual onlyOwner() { } function _transferOwnership(address newOwner) internal virtual { } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); } contract SUPERSHARK is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint256 private constant _MAX = ~uint256(0); uint256 private constant _tTotal = 1e11 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Super Shark"; string private constant _symbol = "SSK"; uint private constant _decimals = 9; uint256 private _teamFee = 13; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; // Uniswap Pair IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { } modifier handleFees(bool takeFee) { } constructor () { } function name() public pure returns (string memory) { } function symbol() public pure returns (string memory) { } function decimals() public pure returns (uint) { } function totalSupply() public pure override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { } function _removeAllFees() private { } function _restoreAllFees() private { } function _approve(address owner, address spender, uint256 amount) private { } function _transfer(address from, address to, uint256 amount) private { require(from != address(0), "ERC20: transfer from the zero address"); require(to != address(0), "ERC20: transfer to the zero address"); require(amount > 0, "Transfer amount must be greater than zero"); require(!_isBot[from], "Your address has been marked as a bot, please contact staff to appeal your case."); bool takeFee = false; if ( !_isExcludedFromFee[from] && !_isExcludedFromFee[to] && !_noTaxMode && (from == _uniswapV2Pair || to == _uniswapV2Pair) ) { require(_tradingOpen, 'Trading has not yet been opened.'); takeFee = true; if (from == _uniswapV2Pair && to != address(_uniswapV2Router) && _initialLimitDuration > block.timestamp) { uint walletBalance = balanceOf(address(to)); require(<FILL_ME>) } if (block.timestamp == _launchTime) _isBot[to] = true; uint256 contractTokenBalance = balanceOf(address(this)); if (!_inSwap && from != _uniswapV2Pair) { if (contractTokenBalance > 0) { if (contractTokenBalance > balanceOf(_uniswapV2Pair).mul(5).div(100)) contractTokenBalance = balanceOf(_uniswapV2Pair).mul(5).div(100); _swapTokensForEth(contractTokenBalance); } } } _tokenTransfer(from, to, amount, takeFee); } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { } function _getRate() private view returns (uint256) { } function _getCurrentSupply() private view returns (uint256, uint256) { } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { } function _takeTeam(uint256 tTeam) private { } function initContract(address payable feeAddress) external onlyOwner() { } function openTrading() external onlyOwner() { } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { } function excludeFromFee(address payable ad) external onlyOwner() { } function includeToFee(address payable ad) external onlyOwner() { } function setNoTaxMode(bool onoff) external onlyOwner() { } function setTeamFee(uint256 fee) external onlyOwner() { } function setBots(address[] memory bots_) public onlyOwner() { } function delBots(address[] memory bots_) public onlyOwner() { } function isBot(address ad) public view returns (bool) { } function isExcludedFromFee(address ad) public view returns (bool) { } function swapFeesManual() external onlyOwner() { } function withdrawFees() external { } receive() external payable {} }
amount.add(walletBalance)<=_tTotal.mul(5).div(100)
35,808
amount.add(walletBalance)<=_tTotal.mul(5).div(100)
"Contract has already been initialized"
/** 🐳TG https://t.me/supershark 🖥Website https://supershark.games 🐤Twitter https://twitter.com/supersharkgames */ // SPDX-License-Identifier: Unlicensed pragma solidity ^0.8.10; abstract contract Context { function _msgSender() internal view virtual returns (address) { } } 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 sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } function mod(uint256 a, uint256 b) internal pure returns (uint256) { } function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) { } } abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); constructor() { } function owner() public view virtual returns (address) { } modifier onlyOwner() { } function renounceOwnership() public virtual onlyOwner() { } function transferOwnership(address newOwner) public virtual onlyOwner() { } function _transferOwnership(address newOwner) internal virtual { } } interface IUniswapV2Factory { function createPair(address tokenA, address tokenB) external returns (address pair); } interface IUniswapV2Router02 { function swapExactTokensForETHSupportingFeeOnTransferTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external; function factory() external pure returns (address); function WETH() external pure returns (address); } contract SUPERSHARK is Context, IERC20, Ownable { using SafeMath for uint256; mapping (address => uint256) private _rOwned; mapping (address => uint256) private _tOwned; mapping (address => mapping (address => uint256)) private _allowances; mapping (address => bool) private _isExcludedFromFee; mapping (address => bool) private _isBot; uint256 private constant _MAX = ~uint256(0); uint256 private constant _tTotal = 1e11 * 10**9; uint256 private _rTotal = (_MAX - (_MAX % _tTotal)); uint256 private _tFeeTotal; string private constant _name = "Super Shark"; string private constant _symbol = "SSK"; uint private constant _decimals = 9; uint256 private _teamFee = 13; uint256 private _previousteamFee = _teamFee; address payable private _feeAddress; // Uniswap Pair IUniswapV2Router02 private _uniswapV2Router; address private _uniswapV2Pair; bool private _initialized = false; bool private _noTaxMode = false; bool private _inSwap = false; bool private _tradingOpen = false; uint256 private _launchTime; uint256 private _initialLimitDuration; modifier lockTheSwap() { } modifier handleFees(bool takeFee) { } constructor () { } function name() public pure returns (string memory) { } function symbol() public pure returns (string memory) { } function decimals() public pure returns (uint) { } function totalSupply() public pure override returns (uint256) { } function balanceOf(address account) public view override returns (uint256) { } function transfer(address recipient, uint256 amount) public override returns (bool) { } function allowance(address owner, address spender) public view override returns (uint256) { } function approve(address spender, uint256 amount) public override returns (bool) { } function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) { } function _tokenFromReflection(uint256 rAmount) private view returns(uint256) { } function _removeAllFees() private { } function _restoreAllFees() private { } function _approve(address owner, address spender, uint256 amount) private { } function _transfer(address from, address to, uint256 amount) private { } function _swapTokensForEth(uint256 tokenAmount) private lockTheSwap() { } function _tokenTransfer(address sender, address recipient, uint256 tAmount, bool takeFee) private handleFees(takeFee) { } function _getValues(uint256 tAmount) private view returns (uint256, uint256, uint256, uint256) { } function _getTValues(uint256 tAmount, uint256 TeamFee) private pure returns (uint256, uint256) { } function _getRate() private view returns (uint256) { } function _getCurrentSupply() private view returns (uint256, uint256) { } function _getRValues(uint256 tAmount, uint256 tTeam, uint256 currentRate) private pure returns (uint256, uint256) { } function _takeTeam(uint256 tTeam) private { } function initContract(address payable feeAddress) external onlyOwner() { require(<FILL_ME>) IUniswapV2Router02 uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); _uniswapV2Pair = IUniswapV2Factory(uniswapV2Router.factory()).createPair(address(this), uniswapV2Router.WETH()); _uniswapV2Router = uniswapV2Router; _feeAddress = feeAddress; _isExcludedFromFee[_feeAddress] = true; _initialized = true; } function openTrading() external onlyOwner() { } function setFeeWallet(address payable feeWalletAddress) external onlyOwner() { } function excludeFromFee(address payable ad) external onlyOwner() { } function includeToFee(address payable ad) external onlyOwner() { } function setNoTaxMode(bool onoff) external onlyOwner() { } function setTeamFee(uint256 fee) external onlyOwner() { } function setBots(address[] memory bots_) public onlyOwner() { } function delBots(address[] memory bots_) public onlyOwner() { } function isBot(address ad) public view returns (bool) { } function isExcludedFromFee(address ad) public view returns (bool) { } function swapFeesManual() external onlyOwner() { } function withdrawFees() external { } receive() external payable {} }
!_initialized,"Contract has already been initialized"
35,808
!_initialized
"CrossDrop would exceed max supply of Bottles"
pragma solidity 0.7.0; abstract contract AOS { function ownerOf(uint256 tokenId) public virtual view returns (address); function tokenOfOwnerByIndex(address owner, uint256 index) public virtual view returns (uint256); function balanceOf(address owner) external virtual view returns (uint256 balance); } /** * @title SpacePirateBottles contract * @dev Extends ERC721 Non-Fungible Token Standard basic implementation */ contract SpacePirateBottles is ERC721, Ownable { using SafeMath for uint256; AOS private aos; uint256 public bottlesPrice = 25000000000000000; // 0.025 ETH uint256 public constant maxBottlesPurchase = 30; uint256 public MAX_BOTTLES = 6000; uint256 public MAX_CROSS_DROP = 2000; uint256 public crossDropSupply = 0; bool public saleIsActive = false; bool public crossDropIsActive = false; constructor(address dependentContractAddress) ERC721("SpacePirateBottles", "SPB") { } function claimCrossDrop() public { require(crossDropIsActive, "CrossDrop must be active to mint a Bottle"); require(<FILL_ME>) require( crossDropSupply + 1 <= MAX_CROSS_DROP, "CrossDrop would exceed max supply of cross drop bottles" ); uint apeBalance = aos.balanceOf(msg.sender); uint bottleBalance = balanceOf(msg.sender); require(apeBalance > 0, "Must hold at least one Ape to mint a Bottle"); require(bottleBalance <= 0, "Must have less than 1 bottle claimed"); _safeMint(msg.sender, totalSupply()); crossDropSupply = crossDropSupply + 1; } function withdraw() public onlyOwner { } function reserveBottles(uint256 reserveAmount) public onlyOwner { } function airdropBottles(uint256 numBottles, address recipient) public onlyOwner { } function airdropBottlesToMany(address[] memory recipients) external onlyOwner { } function flipSaleState() public onlyOwner { } function flipCrossDropState() public onlyOwner { } function changeBottlesPrice(uint256 newBottlesPrice) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function mintBottles(uint256 numberOfTokens) public payable { } }
totalSupply().add(1)<=MAX_BOTTLES,"CrossDrop would exceed max supply of Bottles"
35,825
totalSupply().add(1)<=MAX_BOTTLES
"CrossDrop would exceed max supply of cross drop bottles"
pragma solidity 0.7.0; abstract contract AOS { function ownerOf(uint256 tokenId) public virtual view returns (address); function tokenOfOwnerByIndex(address owner, uint256 index) public virtual view returns (uint256); function balanceOf(address owner) external virtual view returns (uint256 balance); } /** * @title SpacePirateBottles contract * @dev Extends ERC721 Non-Fungible Token Standard basic implementation */ contract SpacePirateBottles is ERC721, Ownable { using SafeMath for uint256; AOS private aos; uint256 public bottlesPrice = 25000000000000000; // 0.025 ETH uint256 public constant maxBottlesPurchase = 30; uint256 public MAX_BOTTLES = 6000; uint256 public MAX_CROSS_DROP = 2000; uint256 public crossDropSupply = 0; bool public saleIsActive = false; bool public crossDropIsActive = false; constructor(address dependentContractAddress) ERC721("SpacePirateBottles", "SPB") { } function claimCrossDrop() public { require(crossDropIsActive, "CrossDrop must be active to mint a Bottle"); require( totalSupply().add(1) <= MAX_BOTTLES, "CrossDrop would exceed max supply of Bottles" ); require(<FILL_ME>) uint apeBalance = aos.balanceOf(msg.sender); uint bottleBalance = balanceOf(msg.sender); require(apeBalance > 0, "Must hold at least one Ape to mint a Bottle"); require(bottleBalance <= 0, "Must have less than 1 bottle claimed"); _safeMint(msg.sender, totalSupply()); crossDropSupply = crossDropSupply + 1; } function withdraw() public onlyOwner { } function reserveBottles(uint256 reserveAmount) public onlyOwner { } function airdropBottles(uint256 numBottles, address recipient) public onlyOwner { } function airdropBottlesToMany(address[] memory recipients) external onlyOwner { } function flipSaleState() public onlyOwner { } function flipCrossDropState() public onlyOwner { } function changeBottlesPrice(uint256 newBottlesPrice) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function mintBottles(uint256 numberOfTokens) public payable { } }
crossDropSupply+1<=MAX_CROSS_DROP,"CrossDrop would exceed max supply of cross drop bottles"
35,825
crossDropSupply+1<=MAX_CROSS_DROP
"Reserve would exceed max supply of Bottles"
pragma solidity 0.7.0; abstract contract AOS { function ownerOf(uint256 tokenId) public virtual view returns (address); function tokenOfOwnerByIndex(address owner, uint256 index) public virtual view returns (uint256); function balanceOf(address owner) external virtual view returns (uint256 balance); } /** * @title SpacePirateBottles contract * @dev Extends ERC721 Non-Fungible Token Standard basic implementation */ contract SpacePirateBottles is ERC721, Ownable { using SafeMath for uint256; AOS private aos; uint256 public bottlesPrice = 25000000000000000; // 0.025 ETH uint256 public constant maxBottlesPurchase = 30; uint256 public MAX_BOTTLES = 6000; uint256 public MAX_CROSS_DROP = 2000; uint256 public crossDropSupply = 0; bool public saleIsActive = false; bool public crossDropIsActive = false; constructor(address dependentContractAddress) ERC721("SpacePirateBottles", "SPB") { } function claimCrossDrop() public { } function withdraw() public onlyOwner { } function reserveBottles(uint256 reserveAmount) public onlyOwner { require(<FILL_ME>) uint256 supply = totalSupply(); uint256 i; for (i = 0; i < reserveAmount; i++) { _safeMint(msg.sender, supply + i); } } function airdropBottles(uint256 numBottles, address recipient) public onlyOwner { } function airdropBottlesToMany(address[] memory recipients) external onlyOwner { } function flipSaleState() public onlyOwner { } function flipCrossDropState() public onlyOwner { } function changeBottlesPrice(uint256 newBottlesPrice) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function mintBottles(uint256 numberOfTokens) public payable { } }
totalSupply().add(reserveAmount)<=MAX_BOTTLES,"Reserve would exceed max supply of Bottles"
35,825
totalSupply().add(reserveAmount)<=MAX_BOTTLES
"Airdrop would exceed max supply"
pragma solidity 0.7.0; abstract contract AOS { function ownerOf(uint256 tokenId) public virtual view returns (address); function tokenOfOwnerByIndex(address owner, uint256 index) public virtual view returns (uint256); function balanceOf(address owner) external virtual view returns (uint256 balance); } /** * @title SpacePirateBottles contract * @dev Extends ERC721 Non-Fungible Token Standard basic implementation */ contract SpacePirateBottles is ERC721, Ownable { using SafeMath for uint256; AOS private aos; uint256 public bottlesPrice = 25000000000000000; // 0.025 ETH uint256 public constant maxBottlesPurchase = 30; uint256 public MAX_BOTTLES = 6000; uint256 public MAX_CROSS_DROP = 2000; uint256 public crossDropSupply = 0; bool public saleIsActive = false; bool public crossDropIsActive = false; constructor(address dependentContractAddress) ERC721("SpacePirateBottles", "SPB") { } function claimCrossDrop() public { } function withdraw() public onlyOwner { } function reserveBottles(uint256 reserveAmount) public onlyOwner { } function airdropBottles(uint256 numBottles, address recipient) public onlyOwner { require(<FILL_ME>) uint256 mintIndex = totalSupply(); uint256 i; for (i = 0; i < numBottles; i++) { if (mintIndex + i < MAX_BOTTLES) { _safeMint(recipient, mintIndex + i); } } } function airdropBottlesToMany(address[] memory recipients) external onlyOwner { } function flipSaleState() public onlyOwner { } function flipCrossDropState() public onlyOwner { } function changeBottlesPrice(uint256 newBottlesPrice) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function mintBottles(uint256 numberOfTokens) public payable { } }
totalSupply().add(numBottles)<=MAX_BOTTLES,"Airdrop would exceed max supply"
35,825
totalSupply().add(numBottles)<=MAX_BOTTLES
"Airdrop would exceed max supply"
pragma solidity 0.7.0; abstract contract AOS { function ownerOf(uint256 tokenId) public virtual view returns (address); function tokenOfOwnerByIndex(address owner, uint256 index) public virtual view returns (uint256); function balanceOf(address owner) external virtual view returns (uint256 balance); } /** * @title SpacePirateBottles contract * @dev Extends ERC721 Non-Fungible Token Standard basic implementation */ contract SpacePirateBottles is ERC721, Ownable { using SafeMath for uint256; AOS private aos; uint256 public bottlesPrice = 25000000000000000; // 0.025 ETH uint256 public constant maxBottlesPurchase = 30; uint256 public MAX_BOTTLES = 6000; uint256 public MAX_CROSS_DROP = 2000; uint256 public crossDropSupply = 0; bool public saleIsActive = false; bool public crossDropIsActive = false; constructor(address dependentContractAddress) ERC721("SpacePirateBottles", "SPB") { } function claimCrossDrop() public { } function withdraw() public onlyOwner { } function reserveBottles(uint256 reserveAmount) public onlyOwner { } function airdropBottles(uint256 numBottles, address recipient) public onlyOwner { } function airdropBottlesToMany(address[] memory recipients) external onlyOwner { require(<FILL_ME>) for (uint256 i = 0; i < recipients.length; i++) { airdropBottles(1, recipients[i]); } } function flipSaleState() public onlyOwner { } function flipCrossDropState() public onlyOwner { } function changeBottlesPrice(uint256 newBottlesPrice) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function mintBottles(uint256 numberOfTokens) public payable { } }
totalSupply().add(recipients.length)<=MAX_BOTTLES,"Airdrop would exceed max supply"
35,825
totalSupply().add(recipients.length)<=MAX_BOTTLES
"Purchase would exceed max supply of Bottles"
pragma solidity 0.7.0; abstract contract AOS { function ownerOf(uint256 tokenId) public virtual view returns (address); function tokenOfOwnerByIndex(address owner, uint256 index) public virtual view returns (uint256); function balanceOf(address owner) external virtual view returns (uint256 balance); } /** * @title SpacePirateBottles contract * @dev Extends ERC721 Non-Fungible Token Standard basic implementation */ contract SpacePirateBottles is ERC721, Ownable { using SafeMath for uint256; AOS private aos; uint256 public bottlesPrice = 25000000000000000; // 0.025 ETH uint256 public constant maxBottlesPurchase = 30; uint256 public MAX_BOTTLES = 6000; uint256 public MAX_CROSS_DROP = 2000; uint256 public crossDropSupply = 0; bool public saleIsActive = false; bool public crossDropIsActive = false; constructor(address dependentContractAddress) ERC721("SpacePirateBottles", "SPB") { } function claimCrossDrop() public { } function withdraw() public onlyOwner { } function reserveBottles(uint256 reserveAmount) public onlyOwner { } function airdropBottles(uint256 numBottles, address recipient) public onlyOwner { } function airdropBottlesToMany(address[] memory recipients) external onlyOwner { } function flipSaleState() public onlyOwner { } function flipCrossDropState() public onlyOwner { } function changeBottlesPrice(uint256 newBottlesPrice) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function mintBottles(uint256 numberOfTokens) public payable { require(saleIsActive, "Sale must be active to mint Bottles"); require( numberOfTokens <= maxBottlesPurchase, "Can only mint 30 tokens at a time" ); require(<FILL_ME>) require( bottlesPrice.mul(numberOfTokens) <= msg.value, "Ether value sent is not correct" ); uint256 mintIndex = totalSupply(); uint256 i; for (i = 0; i < numberOfTokens; i++) { if (mintIndex + i < MAX_BOTTLES) { _safeMint(msg.sender, mintIndex + i); } } } }
totalSupply().add(numberOfTokens)<=MAX_BOTTLES,"Purchase would exceed max supply of Bottles"
35,825
totalSupply().add(numberOfTokens)<=MAX_BOTTLES
"Ether value sent is not correct"
pragma solidity 0.7.0; abstract contract AOS { function ownerOf(uint256 tokenId) public virtual view returns (address); function tokenOfOwnerByIndex(address owner, uint256 index) public virtual view returns (uint256); function balanceOf(address owner) external virtual view returns (uint256 balance); } /** * @title SpacePirateBottles contract * @dev Extends ERC721 Non-Fungible Token Standard basic implementation */ contract SpacePirateBottles is ERC721, Ownable { using SafeMath for uint256; AOS private aos; uint256 public bottlesPrice = 25000000000000000; // 0.025 ETH uint256 public constant maxBottlesPurchase = 30; uint256 public MAX_BOTTLES = 6000; uint256 public MAX_CROSS_DROP = 2000; uint256 public crossDropSupply = 0; bool public saleIsActive = false; bool public crossDropIsActive = false; constructor(address dependentContractAddress) ERC721("SpacePirateBottles", "SPB") { } function claimCrossDrop() public { } function withdraw() public onlyOwner { } function reserveBottles(uint256 reserveAmount) public onlyOwner { } function airdropBottles(uint256 numBottles, address recipient) public onlyOwner { } function airdropBottlesToMany(address[] memory recipients) external onlyOwner { } function flipSaleState() public onlyOwner { } function flipCrossDropState() public onlyOwner { } function changeBottlesPrice(uint256 newBottlesPrice) public onlyOwner { } function setBaseURI(string memory baseURI) public onlyOwner { } function mintBottles(uint256 numberOfTokens) public payable { require(saleIsActive, "Sale must be active to mint Bottles"); require( numberOfTokens <= maxBottlesPurchase, "Can only mint 30 tokens at a time" ); require( totalSupply().add(numberOfTokens) <= MAX_BOTTLES, "Purchase would exceed max supply of Bottles" ); require(<FILL_ME>) uint256 mintIndex = totalSupply(); uint256 i; for (i = 0; i < numberOfTokens; i++) { if (mintIndex + i < MAX_BOTTLES) { _safeMint(msg.sender, mintIndex + i); } } } }
bottlesPrice.mul(numberOfTokens)<=msg.value,"Ether value sent is not correct"
35,825
bottlesPrice.mul(numberOfTokens)<=msg.value
null
pragma solidity ^0.4.23; /** * SafeMath <https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol/> * Copyright (c) 2016 Smart Contract Solutions, Inc. * Released under the MIT License (MIT) */ /// @title Math operations with safety checks library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } function max64(uint64 a, uint64 b) internal pure returns (uint64) { } function min64(uint64 a, uint64 b) internal pure returns (uint64) { } function max256(uint256 a, uint256 b) internal pure returns (uint256) { } function min256(uint256 a, uint256 b) internal pure returns (uint256) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner t o transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } /// ERC Token Standard #20 Interface (https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md) interface IERC20 { function balanceOf(address _owner) public view returns (uint256 balance); function transfer(address _to, uint256 _value) external returns (bool success); function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); function approve(address _spender, uint256 _value) external returns (bool success); function allowance(address _owner, address _spender) external view returns (uint256 remaining); function totalSupply() external view returns (uint256); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } interface ISecurityToken { /** * @dev Add a verified address to the Security Token whitelist * @param _whitelistAddress Address attempting to join ST whitelist * @return bool success */ function addToWhitelist(address _whitelistAddress) public returns (bool success); /** * @dev Add verified addresses to the Security Token whitelist * @param _whitelistAddresses Array of addresses attempting to join ST whitelist * @return bool success */ function addToWhitelistMulti(address[] _whitelistAddresses) external returns (bool success); /** * @dev Removes a previosly verified address to the Security Token blacklist * @param _blacklistAddress Address being added to the blacklist * @return bool success */ function addToBlacklist(address _blacklistAddress) public returns (bool success); /** * @dev Removes previously verified addresseses to the Security Token whitelist * @param _blacklistAddresses Array of addresses attempting to join ST whitelist * @return bool success */ function addToBlacklistMulti(address[] _blacklistAddresses) external returns (bool success); /// Get token decimals function decimals() view external returns (uint); // @notice it will return status of white listing // @return true if user is white listed and false if is not function isWhiteListed(address _user) external view returns (bool); } // The Exchange token contract SecurityToken is IERC20, Ownable, ISecurityToken { using SafeMath for uint; // Public variables of the token string public name; string public symbol; uint public decimals; // How many decimals to show. string public version; uint public totalSupply; uint public tokenPrice; bool public exchangeEnabled; bool public codeExportEnabled; address public commissionAddress; // address to deposit commissions uint public deploymentCost; // cost of deployment with exchange feature uint public tokenOnlyDeploymentCost; // cost of deployment with basic ERC20 feature uint public exchangeEnableCost; // cost of upgrading existing ERC20 to exchange feature uint public codeExportCost; // cost of exporting the code string public securityISIN; // Security token shareholders struct Shareholder { // Structure that contains the data of the shareholders bool allowed; // allowed - whether the shareholder is allowed to transfer or recieve the security token uint receivedAmt; uint releasedAmt; uint vestingDuration; uint vestingCliff; uint vestingStart; } mapping(address => uint) public balances; mapping(address => mapping(address => uint)) public allowed; mapping(address => Shareholder) public shareholders; // Mapping that holds the data of the shareholder corresponding to investor address modifier onlyWhitelisted(address _to) { require(<FILL_ME>) _; } modifier onlyVested(address _from) { } // The Token constructor constructor ( uint _initialSupply, string _tokenName, string _tokenSymbol, uint _decimalUnits, string _version, uint _tokenPrice, string _securityISIN ) public payable { } event LogTransferSold(address indexed to, uint value); event LogTokenExchangeEnabled(address indexed caller, uint exchangeCost); event LogTokenExportEnabled(address indexed caller, uint enableCost); event LogNewWhitelistedAddress( address indexed shareholder); event LogNewBlacklistedAddress(address indexed shareholder); event logVestingAllocation(address indexed shareholder, uint amount, uint duration, uint cliff, uint start); event logISIN(string isin); function updateISIN(string _securityISIN) external onlyOwner() { } function allocateVestedTokens(address _to, uint _value, uint _duration, uint _cliff, uint _vestingStart ) external onlyWhitelisted(_to) onlyOwner() returns (bool) { } function availableAmount(address _from) public view returns (uint256) { } // @noice To be called by owner of the contract to enable exchange functionality // @param _tokenPrice {uint} cost of token in ETH // @return true {bool} if successful function enableExchange(uint _tokenPrice) public payable { } // @notice to enable code export functionality function enableCodeExport() public payable { } // @notice It will send tokens to sender based on the token price function swapTokens() public payable onlyWhitelisted(msg.sender) { } // @notice will be able to mint tokens in the future // @param _target {address} address to which new tokens will be assigned // @parm _mintedAmount {uint256} amouont of tokens to mint function mintToken(address _target, uint256 _mintedAmount) public onlyWhitelisted(_target) onlyOwner() { } // @notice transfer tokens to given address // @param _to {address} address or recipient // @param _value {uint} amount to transfer // @return {bool} true if successful function transfer(address _to, uint _value) external onlyVested(_to) onlyWhitelisted(_to) returns(bool) { } // @notice transfer tokens from given address to another address // @param _from {address} from whom tokens are transferred // @param _to {address} to whom tokens are transferred // @param _value {uint} amount of tokens to transfer // @return {bool} true if successful function transferFrom(address _from, address _to, uint256 _value) external onlyVested(_to) onlyWhitelisted(_to) returns(bool success) { } // @notice to query balance of account // @return _owner {address} address of user to query balance function balanceOf(address _owner) public view returns(uint balance) { } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint _value) external returns(bool) { } // @notice to query of allowance of one user to the other // @param _owner {address} of the owner of the account // @param _spender {address} of the spender of the account // @return remaining {uint} amount of remaining allowance function allowance(address _owner, address _spender) external view returns(uint remaining) { } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { } /** * @dev Add a verified address to the Security Token whitelist * The Issuer can add an address to the whitelist by themselves by * creating their own KYC provider and using it to verify the accounts * they want to add to the whitelist. * @param _whitelistAddress Address attempting to join ST whitelist * @return bool success */ function addToWhitelist(address _whitelistAddress) onlyOwner public returns (bool success) { } /** * @dev Add verified addresses to the Security Token whitelist * @param _whitelistAddresses Array of addresses attempting to join ST whitelist * @return bool success */ function addToWhitelistMulti(address[] _whitelistAddresses) onlyOwner external returns (bool success) { } /** * @dev Add a verified address to the Security Token blacklist * @param _blacklistAddress Address being added to the blacklist * @return bool success */ function addToBlacklist(address _blacklistAddress) onlyOwner public returns (bool success) { } /** * @dev Removes previously verified addresseses to the Security Token whitelist * @param _blacklistAddresses Array of addresses attempting to join ST whitelist * @return bool success */ function addToBlacklistMulti(address[] _blacklistAddresses) onlyOwner external returns (bool success) { } // @notice it will return status of white listing // @return true if user is white listed and false if is not function isWhiteListed(address _user) external view returns (bool) { } function totalSupply() external view returns (uint256) { } function decimals() external view returns (uint) { } }
shareholders[_to].allowed&&shareholders[msg.sender].allowed
35,831
shareholders[_to].allowed&&shareholders[msg.sender].allowed
null
pragma solidity ^0.4.23; /** * SafeMath <https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol/> * Copyright (c) 2016 Smart Contract Solutions, Inc. * Released under the MIT License (MIT) */ /// @title Math operations with safety checks library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } function max64(uint64 a, uint64 b) internal pure returns (uint64) { } function min64(uint64 a, uint64 b) internal pure returns (uint64) { } function max256(uint256 a, uint256 b) internal pure returns (uint256) { } function min256(uint256 a, uint256 b) internal pure returns (uint256) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner t o transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } /// ERC Token Standard #20 Interface (https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md) interface IERC20 { function balanceOf(address _owner) public view returns (uint256 balance); function transfer(address _to, uint256 _value) external returns (bool success); function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); function approve(address _spender, uint256 _value) external returns (bool success); function allowance(address _owner, address _spender) external view returns (uint256 remaining); function totalSupply() external view returns (uint256); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } interface ISecurityToken { /** * @dev Add a verified address to the Security Token whitelist * @param _whitelistAddress Address attempting to join ST whitelist * @return bool success */ function addToWhitelist(address _whitelistAddress) public returns (bool success); /** * @dev Add verified addresses to the Security Token whitelist * @param _whitelistAddresses Array of addresses attempting to join ST whitelist * @return bool success */ function addToWhitelistMulti(address[] _whitelistAddresses) external returns (bool success); /** * @dev Removes a previosly verified address to the Security Token blacklist * @param _blacklistAddress Address being added to the blacklist * @return bool success */ function addToBlacklist(address _blacklistAddress) public returns (bool success); /** * @dev Removes previously verified addresseses to the Security Token whitelist * @param _blacklistAddresses Array of addresses attempting to join ST whitelist * @return bool success */ function addToBlacklistMulti(address[] _blacklistAddresses) external returns (bool success); /// Get token decimals function decimals() view external returns (uint); // @notice it will return status of white listing // @return true if user is white listed and false if is not function isWhiteListed(address _user) external view returns (bool); } // The Exchange token contract SecurityToken is IERC20, Ownable, ISecurityToken { using SafeMath for uint; // Public variables of the token string public name; string public symbol; uint public decimals; // How many decimals to show. string public version; uint public totalSupply; uint public tokenPrice; bool public exchangeEnabled; bool public codeExportEnabled; address public commissionAddress; // address to deposit commissions uint public deploymentCost; // cost of deployment with exchange feature uint public tokenOnlyDeploymentCost; // cost of deployment with basic ERC20 feature uint public exchangeEnableCost; // cost of upgrading existing ERC20 to exchange feature uint public codeExportCost; // cost of exporting the code string public securityISIN; // Security token shareholders struct Shareholder { // Structure that contains the data of the shareholders bool allowed; // allowed - whether the shareholder is allowed to transfer or recieve the security token uint receivedAmt; uint releasedAmt; uint vestingDuration; uint vestingCliff; uint vestingStart; } mapping(address => uint) public balances; mapping(address => mapping(address => uint)) public allowed; mapping(address => Shareholder) public shareholders; // Mapping that holds the data of the shareholder corresponding to investor address modifier onlyWhitelisted(address _to) { } modifier onlyVested(address _from) { require(<FILL_ME>) _; } // The Token constructor constructor ( uint _initialSupply, string _tokenName, string _tokenSymbol, uint _decimalUnits, string _version, uint _tokenPrice, string _securityISIN ) public payable { } event LogTransferSold(address indexed to, uint value); event LogTokenExchangeEnabled(address indexed caller, uint exchangeCost); event LogTokenExportEnabled(address indexed caller, uint enableCost); event LogNewWhitelistedAddress( address indexed shareholder); event LogNewBlacklistedAddress(address indexed shareholder); event logVestingAllocation(address indexed shareholder, uint amount, uint duration, uint cliff, uint start); event logISIN(string isin); function updateISIN(string _securityISIN) external onlyOwner() { } function allocateVestedTokens(address _to, uint _value, uint _duration, uint _cliff, uint _vestingStart ) external onlyWhitelisted(_to) onlyOwner() returns (bool) { } function availableAmount(address _from) public view returns (uint256) { } // @noice To be called by owner of the contract to enable exchange functionality // @param _tokenPrice {uint} cost of token in ETH // @return true {bool} if successful function enableExchange(uint _tokenPrice) public payable { } // @notice to enable code export functionality function enableCodeExport() public payable { } // @notice It will send tokens to sender based on the token price function swapTokens() public payable onlyWhitelisted(msg.sender) { } // @notice will be able to mint tokens in the future // @param _target {address} address to which new tokens will be assigned // @parm _mintedAmount {uint256} amouont of tokens to mint function mintToken(address _target, uint256 _mintedAmount) public onlyWhitelisted(_target) onlyOwner() { } // @notice transfer tokens to given address // @param _to {address} address or recipient // @param _value {uint} amount to transfer // @return {bool} true if successful function transfer(address _to, uint _value) external onlyVested(_to) onlyWhitelisted(_to) returns(bool) { } // @notice transfer tokens from given address to another address // @param _from {address} from whom tokens are transferred // @param _to {address} to whom tokens are transferred // @param _value {uint} amount of tokens to transfer // @return {bool} true if successful function transferFrom(address _from, address _to, uint256 _value) external onlyVested(_to) onlyWhitelisted(_to) returns(bool success) { } // @notice to query balance of account // @return _owner {address} address of user to query balance function balanceOf(address _owner) public view returns(uint balance) { } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint _value) external returns(bool) { } // @notice to query of allowance of one user to the other // @param _owner {address} of the owner of the account // @param _spender {address} of the spender of the account // @return remaining {uint} amount of remaining allowance function allowance(address _owner, address _spender) external view returns(uint remaining) { } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { } /** * @dev Add a verified address to the Security Token whitelist * The Issuer can add an address to the whitelist by themselves by * creating their own KYC provider and using it to verify the accounts * they want to add to the whitelist. * @param _whitelistAddress Address attempting to join ST whitelist * @return bool success */ function addToWhitelist(address _whitelistAddress) onlyOwner public returns (bool success) { } /** * @dev Add verified addresses to the Security Token whitelist * @param _whitelistAddresses Array of addresses attempting to join ST whitelist * @return bool success */ function addToWhitelistMulti(address[] _whitelistAddresses) onlyOwner external returns (bool success) { } /** * @dev Add a verified address to the Security Token blacklist * @param _blacklistAddress Address being added to the blacklist * @return bool success */ function addToBlacklist(address _blacklistAddress) onlyOwner public returns (bool success) { } /** * @dev Removes previously verified addresseses to the Security Token whitelist * @param _blacklistAddresses Array of addresses attempting to join ST whitelist * @return bool success */ function addToBlacklistMulti(address[] _blacklistAddresses) onlyOwner external returns (bool success) { } // @notice it will return status of white listing // @return true if user is white listed and false if is not function isWhiteListed(address _user) external view returns (bool) { } function totalSupply() external view returns (uint256) { } function decimals() external view returns (uint) { } }
availableAmount(_from)>0
35,831
availableAmount(_from)>0
null
pragma solidity ^0.4.23; /** * SafeMath <https://github.com/OpenZeppelin/zeppelin-solidity/blob/master/contracts/math/SafeMath.sol/> * Copyright (c) 2016 Smart Contract Solutions, Inc. * Released under the MIT License (MIT) */ /// @title Math operations with safety checks library SafeMath { function mul(uint256 a, uint256 b) internal pure returns (uint256) { } function div(uint256 a, uint256 b) internal pure returns (uint256) { } function sub(uint256 a, uint256 b) internal pure returns (uint256) { } function add(uint256 a, uint256 b) internal pure returns (uint256) { } function max64(uint64 a, uint64 b) internal pure returns (uint64) { } function min64(uint64 a, uint64 b) internal pure returns (uint64) { } function max256(uint256 a, uint256 b) internal pure returns (uint256) { } function min256(uint256 a, uint256 b) internal pure returns (uint256) { } } /** * @title Ownable * @dev The Ownable contract has an owner address, and provides basic authorization control * functions, this simplifies the implementation of "user permissions". */ contract Ownable { address public owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev The Ownable constructor sets the original `owner` of the contract to the sender * account. */ constructor () public { } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { } /** * @dev Allows the current owner t o transfer control of the contract to a newOwner. * @param newOwner The address to transfer ownership to. */ function transferOwnership(address newOwner) public onlyOwner { } } /// ERC Token Standard #20 Interface (https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md) interface IERC20 { function balanceOf(address _owner) public view returns (uint256 balance); function transfer(address _to, uint256 _value) external returns (bool success); function transferFrom(address _from, address _to, uint256 _value) external returns (bool success); function approve(address _spender, uint256 _value) external returns (bool success); function allowance(address _owner, address _spender) external view returns (uint256 remaining); function totalSupply() external view returns (uint256); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); } interface ISecurityToken { /** * @dev Add a verified address to the Security Token whitelist * @param _whitelistAddress Address attempting to join ST whitelist * @return bool success */ function addToWhitelist(address _whitelistAddress) public returns (bool success); /** * @dev Add verified addresses to the Security Token whitelist * @param _whitelistAddresses Array of addresses attempting to join ST whitelist * @return bool success */ function addToWhitelistMulti(address[] _whitelistAddresses) external returns (bool success); /** * @dev Removes a previosly verified address to the Security Token blacklist * @param _blacklistAddress Address being added to the blacklist * @return bool success */ function addToBlacklist(address _blacklistAddress) public returns (bool success); /** * @dev Removes previously verified addresseses to the Security Token whitelist * @param _blacklistAddresses Array of addresses attempting to join ST whitelist * @return bool success */ function addToBlacklistMulti(address[] _blacklistAddresses) external returns (bool success); /// Get token decimals function decimals() view external returns (uint); // @notice it will return status of white listing // @return true if user is white listed and false if is not function isWhiteListed(address _user) external view returns (bool); } // The Exchange token contract SecurityToken is IERC20, Ownable, ISecurityToken { using SafeMath for uint; // Public variables of the token string public name; string public symbol; uint public decimals; // How many decimals to show. string public version; uint public totalSupply; uint public tokenPrice; bool public exchangeEnabled; bool public codeExportEnabled; address public commissionAddress; // address to deposit commissions uint public deploymentCost; // cost of deployment with exchange feature uint public tokenOnlyDeploymentCost; // cost of deployment with basic ERC20 feature uint public exchangeEnableCost; // cost of upgrading existing ERC20 to exchange feature uint public codeExportCost; // cost of exporting the code string public securityISIN; // Security token shareholders struct Shareholder { // Structure that contains the data of the shareholders bool allowed; // allowed - whether the shareholder is allowed to transfer or recieve the security token uint receivedAmt; uint releasedAmt; uint vestingDuration; uint vestingCliff; uint vestingStart; } mapping(address => uint) public balances; mapping(address => mapping(address => uint)) public allowed; mapping(address => Shareholder) public shareholders; // Mapping that holds the data of the shareholder corresponding to investor address modifier onlyWhitelisted(address _to) { } modifier onlyVested(address _from) { } // The Token constructor constructor ( uint _initialSupply, string _tokenName, string _tokenSymbol, uint _decimalUnits, string _version, uint _tokenPrice, string _securityISIN ) public payable { } event LogTransferSold(address indexed to, uint value); event LogTokenExchangeEnabled(address indexed caller, uint exchangeCost); event LogTokenExportEnabled(address indexed caller, uint enableCost); event LogNewWhitelistedAddress( address indexed shareholder); event LogNewBlacklistedAddress(address indexed shareholder); event logVestingAllocation(address indexed shareholder, uint amount, uint duration, uint cliff, uint start); event logISIN(string isin); function updateISIN(string _securityISIN) external onlyOwner() { } function allocateVestedTokens(address _to, uint _value, uint _duration, uint _cliff, uint _vestingStart ) external onlyWhitelisted(_to) onlyOwner() returns (bool) { } function availableAmount(address _from) public view returns (uint256) { } // @noice To be called by owner of the contract to enable exchange functionality // @param _tokenPrice {uint} cost of token in ETH // @return true {bool} if successful function enableExchange(uint _tokenPrice) public payable { require(<FILL_ME>) require(exchangeEnableCost == msg.value); exchangeEnabled = true; tokenPrice = _tokenPrice; commissionAddress.transfer(msg.value); emit LogTokenExchangeEnabled(msg.sender, _tokenPrice); } // @notice to enable code export functionality function enableCodeExport() public payable { } // @notice It will send tokens to sender based on the token price function swapTokens() public payable onlyWhitelisted(msg.sender) { } // @notice will be able to mint tokens in the future // @param _target {address} address to which new tokens will be assigned // @parm _mintedAmount {uint256} amouont of tokens to mint function mintToken(address _target, uint256 _mintedAmount) public onlyWhitelisted(_target) onlyOwner() { } // @notice transfer tokens to given address // @param _to {address} address or recipient // @param _value {uint} amount to transfer // @return {bool} true if successful function transfer(address _to, uint _value) external onlyVested(_to) onlyWhitelisted(_to) returns(bool) { } // @notice transfer tokens from given address to another address // @param _from {address} from whom tokens are transferred // @param _to {address} to whom tokens are transferred // @param _value {uint} amount of tokens to transfer // @return {bool} true if successful function transferFrom(address _from, address _to, uint256 _value) external onlyVested(_to) onlyWhitelisted(_to) returns(bool success) { } // @notice to query balance of account // @return _owner {address} address of user to query balance function balanceOf(address _owner) public view returns(uint balance) { } /** * @dev Approve the passed address to spend the specified amount of tokens on behalf of msg.sender. * * Beware that changing an allowance with this method brings the risk that someone may use both the old * and the new allowance by unfortunate transaction ordering. One possible solution to mitigate this * race condition is to first reduce the spender's allowance to 0 and set the desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * @param _spender The address which will spend the funds. * @param _value The amount of tokens to be spent. */ function approve(address _spender, uint _value) external returns(bool) { } // @notice to query of allowance of one user to the other // @param _owner {address} of the owner of the account // @param _spender {address} of the spender of the account // @return remaining {uint} amount of remaining allowance function allowance(address _owner, address _spender) external view returns(uint remaining) { } /** * approve should be called when allowed[_spender] == 0. To increment * allowed value is better to use this function to avoid 2 calls (and wait until * the first transaction is mined) * From MonolithDAO Token.sol */ function increaseApproval (address _spender, uint _addedValue) public returns (bool success) { } function decreaseApproval (address _spender, uint _subtractedValue) public returns (bool success) { } /** * @dev Add a verified address to the Security Token whitelist * The Issuer can add an address to the whitelist by themselves by * creating their own KYC provider and using it to verify the accounts * they want to add to the whitelist. * @param _whitelistAddress Address attempting to join ST whitelist * @return bool success */ function addToWhitelist(address _whitelistAddress) onlyOwner public returns (bool success) { } /** * @dev Add verified addresses to the Security Token whitelist * @param _whitelistAddresses Array of addresses attempting to join ST whitelist * @return bool success */ function addToWhitelistMulti(address[] _whitelistAddresses) onlyOwner external returns (bool success) { } /** * @dev Add a verified address to the Security Token blacklist * @param _blacklistAddress Address being added to the blacklist * @return bool success */ function addToBlacklist(address _blacklistAddress) onlyOwner public returns (bool success) { } /** * @dev Removes previously verified addresseses to the Security Token whitelist * @param _blacklistAddresses Array of addresses attempting to join ST whitelist * @return bool success */ function addToBlacklistMulti(address[] _blacklistAddresses) onlyOwner external returns (bool success) { } // @notice it will return status of white listing // @return true if user is white listed and false if is not function isWhiteListed(address _user) external view returns (bool) { } function totalSupply() external view returns (uint256) { } function decimals() external view returns (uint) { } }
!exchangeEnabled
35,831
!exchangeEnabled